From e0bf75e2c3209c011e249d2d5c775e5cd65680ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 23:55:12 +0000 Subject: [PATCH 1/2] chore(deps): bump zod from 4.6.2 to 4.6.7 Bumps [zod](https://github.com/colinhacks/zod) from 4.6.2 to 4.6.7. - [Release notes](https://github.com/colinhacks/zod/releases) - [Commits](https://github.com/colinhacks/zod/compare/v4.6.2...v4.6.7) --- updated-dependencies: - dependency-name: zod dependency-version: 4.6.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2da8dc34..ad347c27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "0.1.14", "license": "MIT", "dependencies": { - "@anthropic-ai/sdk": "0.125.0", "@graphql-inspector/core": "^8.0.0", "@modelcontextprotocol/sdk": "^1.30.0", "@octokit/rest": "^22.0.1", @@ -2552,9 +2551,9 @@ } }, "node_modules/zod": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.2.tgz", - "integrity": "sha512-lh5RCAGFa1Cm2hjtNwLQhSs/AsqdWnTQaBER9fEwN/88pSh7KOtJavtBx/0VlkN/uFd61SwYmljLMDAsHlvzBQ==", + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" From 3b349050f1c8e083487b64887a81d4e290b924d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 23:55:29 +0000 Subject: [PATCH 2/2] chore(action): update bundled action --- action/index.cjs | 808 +++++++++++++++++++++++------------------------ 1 file changed, 404 insertions(+), 404 deletions(-) diff --git a/action/index.cjs b/action/index.cjs index 5f6dbf9a..df68eb1b 100644 --- a/action/index.cjs +++ b/action/index.cjs @@ -1,74 +1,74 @@ -"use strict";var Mie=Object.create;var aE=Object.defineProperty;var Lie=Object.getOwnPropertyDescriptor;var Fie=Object.getOwnPropertyNames;var Uie=Object.getPrototypeOf,jie=Object.prototype.hasOwnProperty;var j=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},_r=(e,t)=>{for(var n in t)aE(e,n,{get:t[n],enumerable:!0})},zie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fie(t))!jie.call(e,r)&&r!==n&&aE(e,r,{get:()=>t[r],enumerable:!(i=Lie(t,r))||i.enumerable});return e};var gt=(e,t,n)=>(n=e!=null?Mie(Uie(e)):{},zie(t||!e||!e.__esModule?aE(n,"default",{value:e,enumerable:!0}):n,e));var Ze=q(Pn=>{"use strict";var cE=Symbol.for("yaml.alias"),zU=Symbol.for("yaml.document"),ib=Symbol.for("yaml.map"),GU=Symbol.for("yaml.pair"),lE=Symbol.for("yaml.scalar"),ob=Symbol.for("yaml.seq"),Bo=Symbol.for("yaml.node.type"),Gie=e=>!!e&&typeof e=="object"&&e[Bo]===cE,Vie=e=>!!e&&typeof e=="object"&&e[Bo]===zU,Bie=e=>!!e&&typeof e=="object"&&e[Bo]===ib,qie=e=>!!e&&typeof e=="object"&&e[Bo]===GU,VU=e=>!!e&&typeof e=="object"&&e[Bo]===lE,Wie=e=>!!e&&typeof e=="object"&&e[Bo]===ob;function BU(e){if(e&&typeof e=="object")switch(e[Bo]){case ib:case ob:return!0}return!1}function Hie(e){if(e&&typeof e=="object")switch(e[Bo]){case cE:case ib:case lE:case ob:return!0}return!1}var Kie=e=>(VU(e)||BU(e))&&!!e.anchor;Pn.ALIAS=cE;Pn.DOC=zU;Pn.MAP=ib;Pn.NODE_TYPE=Bo;Pn.PAIR=GU;Pn.SCALAR=lE;Pn.SEQ=ob;Pn.hasAnchor=Kie;Pn.isAlias=Gie;Pn.isCollection=BU;Pn.isDocument=Vie;Pn.isMap=Bie;Pn.isNode=Hie;Pn.isPair=qie;Pn.isScalar=VU;Pn.isSeq=Wie});var Kf=q(uE=>{"use strict";var gn=Ze(),Sr=Symbol("break visit"),qU=Symbol("skip children"),lo=Symbol("remove node");function sb(e,t){let n=WU(t);gn.isDocument(e)?gu(null,e.contents,n,Object.freeze([e]))===lo&&(e.contents=null):gu(null,e,n,Object.freeze([]))}sb.BREAK=Sr;sb.SKIP=qU;sb.REMOVE=lo;function gu(e,t,n,i){let r=HU(e,t,n,i);if(gn.isNode(r)||gn.isPair(r))return KU(e,i,r),gu(e,r,n,i);if(typeof r!="symbol"){if(gn.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o{"use strict";var JU=Ze(),Jie=Kf(),Zie={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Yie=e=>e.replace(/[!,[\]{}]/g,t=>Zie[t]),Jf=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+Yie(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&JU.isNode(t.contents)){let o={};Jie.visit(t.contents,(s,a)=>{JU.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(` -`)}};Jf.defaultYaml={explicit:!1,version:"1.2"};Jf.defaultTags={"!!":"tag:yaml.org,2002:"};ZU.Directives=Jf});var cb=q(Zf=>{"use strict";var YU=Ze(),Qie=Kf();function Xie(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function QU(e){let t=new Set;return Qie.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function XU(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function eoe(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=QU(e));let s=XU(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(YU.isScalar(s.node)||YU.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}Zf.anchorIsValid=Xie;Zf.anchorNames=QU;Zf.createNodeAnchors=eoe;Zf.findNewAnchor=XU});var pE=q(ej=>{"use strict";function Yf(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r{"use strict";var toe=Ze();function tj(e,t,n){if(Array.isArray(e))return e.map((i,r)=>tj(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!toe.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}nj.toJS=tj});var lb=q(ij=>{"use strict";var noe=pE(),rj=Ze(),roe=Is(),fE=class{constructor(t){Object.defineProperty(this,rj.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!rj.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=roe.toJS(this,"",s);if(typeof r=="function")for(let{count:c,res:l}of s.anchors.values())r(l,c);return typeof o=="function"?noe.applyReviver(o,{"":a},"",a):a}};ij.NodeBase=fE});var Qf=q(oj=>{"use strict";var ioe=cb(),ooe=Kf(),yu=Ze(),soe=lb(),aoe=Is(),mE=class extends soe.NodeBase{constructor(t){super(yu.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],ooe.visit(t,{Node:(o,s)=>{(yu.isAlias(s)||yu.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}if(r&&n){let{anchors:o,doc:s,maxAliasCount:a}=n,c=o.get(r);if(c||(aoe.toJS(r,null,n),c=o.get(r)),c?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=ub(s,r,o)),c.count*c.aliasCount>a)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return r}toJSON(t,n){if(!n)return{source:this.source};let i=this.resolve(n.doc,n);if(!i){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(i).res}toString(t,n,i){let r=`*${this.source}`;if(t){if(ioe.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function ub(e,t,n){if(yu.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(yu.isCollection(t)){let i=0;for(let r of t.items){let o=ub(e,r,n);o>i&&(i=o)}return i}else if(yu.isPair(t)){let i=ub(e,t.key,n),r=ub(e,t.value,n);return Math.max(i,r)}return 1}oj.Alias=mE});var an=q(gE=>{"use strict";var coe=Ze(),loe=lb(),uoe=Is(),doe=e=>!e||typeof e!="function"&&typeof e!="object",As=class extends loe.NodeBase{constructor(t){super(coe.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:uoe.toJS(this.value,t,n)}toString(){return String(this.value)}};As.BLOCK_FOLDED="BLOCK_FOLDED";As.BLOCK_LITERAL="BLOCK_LITERAL";As.PLAIN="PLAIN";As.QUOTE_DOUBLE="QUOTE_DOUBLE";As.QUOTE_SINGLE="QUOTE_SINGLE";gE.Scalar=As;gE.isScalarValue=doe});var Xf=q(aj=>{"use strict";var poe=Qf(),lc=Ze(),sj=an(),foe="tag:yaml.org,2002:";function moe(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function goe(e,t,n){if(lc.isDocument(e)&&(e=e.contents),lc.isNode(e))return e;if(lc.isPair(e)){let d=n.schema[lc.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(i&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=r(e)),new poe.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=foe+t.slice(2));let l=moe(e,t,s.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new sj.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?s[lc.MAP]:Symbol.iterator in Object(e)?s[lc.SEQ]:s[lc.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new sj.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}aj.createNode=goe});var pb=q(db=>{"use strict";var hoe=Xf(),uo=Ze(),yoe=lb();function hE(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return hoe.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var cj=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,yE=class extends yoe.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>uo.isNode(i)||uo.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cj(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(uo.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,hE(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(uo.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&uo.isScalar(o)?o.value:o:uo.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!uo.isPair(n))return!1;let i=n.value;return i==null||t&&uo.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return uo.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(uo.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,hE(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};db.Collection=yE;db.collectionFromPath=hE;db.isEmptyPath=cj});var em=q(fb=>{"use strict";var boe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function bE(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var voe=(e,t,n)=>e.endsWith(` -`)?bE(n,t):n.includes(` +"use strict";var Gie=Object.create;var mE=Object.defineProperty;var Vie=Object.getOwnPropertyDescriptor;var Bie=Object.getOwnPropertyNames;var qie=Object.getPrototypeOf,Wie=Object.prototype.hasOwnProperty;var j=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},kr=(e,t)=>{for(var n in t)mE(e,n,{get:t[n],enumerable:!0})},Kie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bie(t))!Wie.call(e,r)&&r!==n&&mE(e,r,{get:()=>t[r],enumerable:!(i=Vie(t,r))||i.enumerable});return e};var gt=(e,t,n)=>(n=e!=null?Gie(qie(e)):{},Kie(t||!e||!e.__esModule?mE(n,"default",{value:e,enumerable:!0}):n,e));var Ze=q(Cn=>{"use strict";var gE=Symbol.for("yaml.alias"),JU=Symbol.for("yaml.document"),db=Symbol.for("yaml.map"),ZU=Symbol.for("yaml.pair"),hE=Symbol.for("yaml.scalar"),pb=Symbol.for("yaml.seq"),Bo=Symbol.for("yaml.node.type"),Hie=e=>!!e&&typeof e=="object"&&e[Bo]===gE,Jie=e=>!!e&&typeof e=="object"&&e[Bo]===JU,Zie=e=>!!e&&typeof e=="object"&&e[Bo]===db,Yie=e=>!!e&&typeof e=="object"&&e[Bo]===ZU,YU=e=>!!e&&typeof e=="object"&&e[Bo]===hE,Qie=e=>!!e&&typeof e=="object"&&e[Bo]===pb;function QU(e){if(e&&typeof e=="object")switch(e[Bo]){case db:case pb:return!0}return!1}function Xie(e){if(e&&typeof e=="object")switch(e[Bo]){case gE:case db:case hE:case pb:return!0}return!1}var eoe=e=>(YU(e)||QU(e))&&!!e.anchor;Cn.ALIAS=gE;Cn.DOC=JU;Cn.MAP=db;Cn.NODE_TYPE=Bo;Cn.PAIR=ZU;Cn.SCALAR=hE;Cn.SEQ=pb;Cn.hasAnchor=eoe;Cn.isAlias=Hie;Cn.isCollection=QU;Cn.isDocument=Jie;Cn.isMap=Zie;Cn.isNode=Xie;Cn.isPair=Yie;Cn.isScalar=YU;Cn.isSeq=Qie});var Jf=q(yE=>{"use strict";var mn=Ze(),_r=Symbol("break visit"),XU=Symbol("skip children"),lo=Symbol("remove node");function fb(e,t){let n=ej(t);mn.isDocument(e)?yu(null,e.contents,n,Object.freeze([e]))===lo&&(e.contents=null):yu(null,e,n,Object.freeze([]))}fb.BREAK=_r;fb.SKIP=XU;fb.REMOVE=lo;function yu(e,t,n,i){let r=tj(e,t,n,i);if(mn.isNode(r)||mn.isPair(r))return nj(e,i,r),yu(e,r,n,i);if(typeof r!="symbol"){if(mn.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o{"use strict";var rj=Ze(),toe=Jf(),noe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},roe=e=>e.replace(/[!,[\]{}]/g,t=>noe[t]),Zf=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(s){return n(String(s)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+roe(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&rj.isNode(t.contents)){let o={};toe.visit(t.contents,(s,a)=>{rj.isNode(a)&&a.tag&&(o[a.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(` +`)}};Zf.defaultYaml={explicit:!1,version:"1.2"};Zf.defaultTags={"!!":"tag:yaml.org,2002:"};ij.Directives=Zf});var gb=q(Yf=>{"use strict";var oj=Ze(),ioe=Jf();function ooe(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function sj(e){let t=new Set;return ioe.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function aj(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function soe(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=sj(e));let s=aj(t,r);return r.add(s),s},setAnchors:()=>{for(let o of n){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(oj.isScalar(s.node)||oj.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}Yf.anchorIsValid=ooe;Yf.anchorNames=sj;Yf.createNodeAnchors=soe;Yf.findNewAnchor=aj});var vE=q(cj=>{"use strict";function Qf(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r{"use strict";var aoe=Ze();function lj(e,t,n){if(Array.isArray(e))return e.map((i,r)=>lj(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!aoe.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}uj.toJS=lj});var hb=q(pj=>{"use strict";var coe=vE(),dj=Ze(),loe=Is(),wE=class{constructor(t){Object.defineProperty(this,dj.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!dj.isDocument(t))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=loe.toJS(this,"",s);if(typeof r=="function")for(let{count:c,res:l}of s.anchors.values())r(l,c);return typeof o=="function"?coe.applyReviver(o,{"":a},"",a):a}};pj.NodeBase=wE});var Xf=q(fj=>{"use strict";var uoe=gb(),doe=Jf(),vu=Ze(),poe=hb(),foe=Is(),kE=class extends poe.NodeBase{constructor(t){super(vu.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],doe.visit(t,{Node:(o,s)=>{(vu.isAlias(s)||vu.hasAnchor(s))&&i.push(s)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}if(r&&n){let{anchors:o,doc:s,maxAliasCount:a}=n,c=o.get(r);if(c||(foe.toJS(r,null,n),c=o.get(r)),c?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=yb(s,r,o)),c.count*c.aliasCount>a)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return r}toJSON(t,n){if(!n)return{source:this.source};let i=this.resolve(n.doc,n);if(!i){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(i).res}toString(t,n,i){let r=`*${this.source}`;if(t){if(uoe.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function yb(e,t,n){if(vu.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(vu.isCollection(t)){let i=0;for(let r of t.items){let o=yb(e,r,n);o>i&&(i=o)}return i}else if(vu.isPair(t)){let i=yb(e,t.key,n),r=yb(e,t.value,n);return Math.max(i,r)}return 1}fj.Alias=kE});var sn=q(_E=>{"use strict";var moe=Ze(),goe=hb(),hoe=Is(),yoe=e=>!e||typeof e!="function"&&typeof e!="object",As=class extends goe.NodeBase{constructor(t){super(moe.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:hoe.toJS(this.value,t,n)}toString(){return String(this.value)}};As.BLOCK_FOLDED="BLOCK_FOLDED";As.BLOCK_LITERAL="BLOCK_LITERAL";As.PLAIN="PLAIN";As.QUOTE_DOUBLE="QUOTE_DOUBLE";As.QUOTE_SINGLE="QUOTE_SINGLE";_E.Scalar=As;_E.isScalarValue=yoe});var em=q(gj=>{"use strict";var boe=Xf(),lc=Ze(),mj=sn(),voe="tag:yaml.org,2002:";function woe(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function koe(e,t,n){if(lc.isDocument(e)&&(e=e.contents),lc.isNode(e))return e;if(lc.isPair(e)){let d=n.schema[lc.MAP].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(i&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=r(e)),new boe.Alias(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=voe+t.slice(2));let l=woe(e,t,s.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let d=new mj.Scalar(e);return c&&(c.node=d),d}l=e instanceof Map?s[lc.MAP]:Symbol.iterator in Object(e)?s[lc.SEQ]:s[lc.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new mj.Scalar(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}gj.createNode=koe});var vb=q(bb=>{"use strict";var _oe=em(),uo=Ze(),$oe=hb();function $E(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return _oe.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var hj=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,SE=class extends $oe.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>uo.isNode(i)||uo.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(hj(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(uo.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,$E(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(uo.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&uo.isScalar(o)?o.value:o:uo.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!uo.isPair(n))return!1;let i=n.value;return i==null||t&&uo.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return uo.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(uo.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,$E(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};bb.Collection=SE;bb.collectionFromPath=$E;bb.isEmptyPath=hj});var tm=q(wb=>{"use strict";var Soe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function xE(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var xoe=(e,t,n)=>e.endsWith(` +`)?xE(n,t):n.includes(` `)?` -`+bE(n,t):(e.endsWith(" ")?"":" ")+n;fb.indentComment=bE;fb.lineComment=voe;fb.stringifyComment=boe});var uj=q(tm=>{"use strict";var woe="flow",vE="block",mb="quoted";function koe(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return e;rr-Math.max(2,o)?l.push(0):d=r-i);let p,f,m=!1,g=-1,h=-1,b=-1;n===vE&&(g=lj(e,g,t.length),g!==-1&&(d=g+c));for(let w;w=e[g+=1];){if(n===mb&&w==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(w===` -`)n===vE&&(g=lj(e,g,t.length)),d=g+t.length+c,p=void 0;else{if(w===" "&&f&&f!==" "&&f!==` +`+xE(n,t):(e.endsWith(" ")?"":" ")+n;wb.indentComment=xE;wb.lineComment=xoe;wb.stringifyComment=Soe});var bj=q(nm=>{"use strict";var Eoe="flow",EE="block",kb="quoted";function Toe(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!r||r<0)return e;rr-Math.max(2,o)?l.push(0):d=r-i);let p,f,m=!1,g=-1,h=-1,b=-1;n===EE&&(g=yj(e,g,t.length),g!==-1&&(d=g+c));for(let w;w=e[g+=1];){if(n===kb&&w==="\\"){switch(h=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(w===` +`)n===EE&&(g=yj(e,g,t.length)),d=g+t.length+c,p=void 0;else{if(w===" "&&f&&f!==" "&&f!==` `&&f!==" "){let k=e[g+1];k&&k!==" "&&k!==` -`&&k!==" "&&(p=g)}if(g>=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===mb){for(;f===" "||f===" ";)f=w,w=e[g+=1],m=!0;let k=g>b+1?g-2:h-1;if(u[k])return e;l.push(k),u[k]=!0,d=k+c,p=void 0}else m=!0}f=w}if(m&&a&&a(),l.length===0)return e;s&&s();let y=e.slice(0,l[0]);for(let w=0;w{"use strict";var Mi=an(),Rs=uj(),hb=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),yb=e=>/^(%|---|\.\.\.)/m.test(e);function $oe(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,s=0;oi)return!0;if(s=o+1,r-s<=i)return!1}return!0}function nm(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(yb(e)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){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:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length=d)if(p)l.push(p),d=p+c,p=void 0;else if(n===kb){for(;f===" "||f===" ";)f=w,w=e[g+=1],m=!0;let k=g>b+1?g-2:h-1;if(u[k])return e;l.push(k),u[k]=!0,d=k+c,p=void 0}else m=!0}f=w}if(m&&a&&a(),l.length===0)return e;s&&s();let y=e.slice(0,l[0]);for(let w=0;w{"use strict";var Mi=sn(),Rs=bj(),$b=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Sb=e=>/^(%|---|\.\.\.)/m.test(e);function Ioe(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,s=0;oi)return!0;if(s=o+1,r-s<=i)return!1}return!0}function rm(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Sb(e)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){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:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(i||n[c+2]==='"'||n.length -`;let d,p;for(p=n.length;p>0;--p){let _=n[p-1];if(_!==` -`&&_!==" "&&_!==" ")break}let f=n.substring(p),m=f.indexOf(` +`;let d,p;for(p=n.length;p>0;--p){let $=n[p-1];if($!==` +`&&$!==" "&&$!==" ")break}let f=n.substring(p),m=f.indexOf(` `);m===-1?d="-":n===f||m!==f.length-1?(d="+",o&&o()):d="",f&&(n=n.slice(0,-f.length),f[f.length-1]===` -`&&(f=f.slice(0,-1)),f=f.replace(kE,`$&${l}`));let g=!1,h,b=-1;for(h=0;h{S=!0});let E=Rs.foldFlowLines(`${y}${_}${f}`,l,Rs.FOLD_BLOCK,x);if(!S)return`>${k} +`&&(f=f.slice(0,-1)),f=f.replace(IE,`$&${l}`));let g=!1,h,b=-1;for(h=0;h{S=!0});let E=Rs.foldFlowLines(`${y}${$}${f}`,l,Rs.FOLD_BLOCK,x);if(!S)return`>${k} ${l}${E}`}return n=n.replace(/\n+/g,`$&${l}`),`|${k} -${l}${y}${n}${f}`}function _oe(e,t,n,i){let{type:r,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&o.includes(` -`)||u&&/[[\]{},]/.test(o))return bu(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` -`)?bu(o,t):gb(e,t,n,i);if(!a&&!u&&r!==Mi.Scalar.PLAIN&&o.includes(` -`))return gb(e,t,n,i);if(yb(o)){if(c==="")return t.forceBlockIndent=!0,gb(e,t,n,i);if(a&&c===l)return bu(o,t)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let p=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:f,tags:m}=t.doc.schema;if(m.some(p)||f?.some(p))return bu(o,t)}return a?d:Rs.foldFlowLines(d,c,Rs.FOLD_FLOW,hb(t,!1))}function Soe(e,t,n,i){let{implicitKey:r,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==Mi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Mi.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Mi.Scalar.BLOCK_FOLDED:case Mi.Scalar.BLOCK_LITERAL:return r||o?bu(s.value,t):gb(s,t,n,i);case Mi.Scalar.QUOTE_DOUBLE:return nm(s.value,t);case Mi.Scalar.QUOTE_SINGLE:return wE(s.value,t);case Mi.Scalar.PLAIN:return _oe(s,t,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=r&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}dj.stringifyString=Soe});var im=q($E=>{"use strict";var xoe=cb(),Ns=Ze(),Eoe=em(),Toe=rm();function Ioe(e,t){let n=Object.assign({blockQuote:!0,commentString:Eoe.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),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Aoe(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(Ns.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Roe(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Ns.isScalar(e)||Ns.isCollection(e))&&e.anchor;o&&xoe.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Noe(e,t,n,i){if(Ns.isPair(e))return e.toString(t,n,i);if(Ns.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=Ns.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>r=c});r??(r=Aoe(t.doc.schema.tags,o));let s=Roe(o,r,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,t,n,i):Ns.isScalar(o)?Toe.stringifyString(o,t,n,i):o.toString(t,n,i);return s?Ns.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${t.indent}${a}`:a}$E.createStringifyContext=Ioe;$E.stringify=Noe});var gj=q(mj=>{"use strict";var qo=Ze(),pj=an(),fj=im(),om=em();function Coe({key:e,value:t},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=qo.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(qo.isCollection(e)||!qo.isNode(e)&&typeof e=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let f=!d&&(!e||p&&t==null&&!n.inFlow||qo.isCollection(e)||(qo.isScalar(e)?e.type===pj.Scalar.BLOCK_FOLDED||e.type===pj.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!o),indent:a+c});let m=!1,g=!1,h=fj.stringify(e,n,()=>m=!0,()=>g=!0);if(!f&&!n.inFlow&&h.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(o||t==null)return m&&i&&i(),h===""?"?":f?`? ${h}`:h}else if(o&&!d||t==null&&f)return h=`? ${h}`,p&&!m?h+=om.lineComment(h,n.indent,l(p)):g&&r&&r(),h;m&&(p=null),f?(p&&(h+=om.lineComment(h,n.indent,l(p))),h=`? ${h} -${a}:`):(h=`${h}:`,p&&(h+=om.lineComment(h,n.indent,l(p))));let b,y,w;qo.isNode(t)?(b=!!t.spaceBefore,y=t.commentBefore,w=t.comment):(b=!1,y=null,w=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!f&&!p&&qo.isScalar(t)&&(n.indentAtStart=h.length+1),g=!1,!u&&c.length>=2&&!n.inFlow&&!f&&qo.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1,_=fj.stringify(t,n,()=>k=!0,()=>g=!0),S=" ";if(p||b||y){if(S=b?` +${l}${y}${n}${f}`}function Aoe(e,t,n,i){let{type:r,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&o.includes(` +`)||u&&/[[\]{},]/.test(o))return wu(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` +`)?wu(o,t):_b(e,t,n,i);if(!a&&!u&&r!==Mi.Scalar.PLAIN&&o.includes(` +`))return _b(e,t,n,i);if(Sb(o)){if(c==="")return t.forceBlockIndent=!0,_b(e,t,n,i);if(a&&c===l)return wu(o,t)}let d=o.replace(/\n+/g,`$& +${c}`);if(s){let p=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(d),{compat:f,tags:m}=t.doc.schema;if(m.some(p)||f?.some(p))return wu(o,t)}return a?d:Rs.foldFlowLines(d,c,Rs.FOLD_FLOW,$b(t,!1))}function Roe(e,t,n,i){let{implicitKey:r,inFlow:o}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==Mi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Mi.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Mi.Scalar.BLOCK_FOLDED:case Mi.Scalar.BLOCK_LITERAL:return r||o?wu(s.value,t):_b(s,t,n,i);case Mi.Scalar.QUOTE_DOUBLE:return rm(s.value,t);case Mi.Scalar.QUOTE_SINGLE:return TE(s.value,t);case Mi.Scalar.PLAIN:return Aoe(s,t,n,i);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=t.options,p=r&&u||d;if(l=c(p),l===null)throw new Error(`Unsupported default string type ${p}`)}return l}vj.stringifyString=Roe});var om=q(AE=>{"use strict";var Coe=gb(),Cs=Ze(),Noe=tm(),Poe=im();function Doe(e,t){let n=Object.assign({blockQuote:!0,commentString:Noe.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),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Ooe(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(Cs.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(s=>s.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Moe(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Cs.isScalar(e)||Cs.isCollection(e))&&e.anchor;o&&Coe.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let s=e.tag??(t.default?null:t.tag);return s&&r.push(i.directives.tagString(s)),r.join(" ")}function Loe(e,t,n,i){if(Cs.isPair(e))return e.toString(t,n,i);if(Cs.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=Cs.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>r=c});r??(r=Ooe(t.doc.schema.tags,o));let s=Moe(o,r,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let a=typeof r.stringify=="function"?r.stringify(o,t,n,i):Cs.isScalar(o)?Poe.stringifyString(o,t,n,i):o.toString(t,n,i);return s?Cs.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${t.indent}${a}`:a}AE.createStringifyContext=Doe;AE.stringify=Loe});var $j=q(_j=>{"use strict";var qo=Ze(),wj=sn(),kj=om(),sm=tm();function Foe({key:e,value:t},n,i,r){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,p=qo.isNode(e)&&e.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(qo.isCollection(e)||!qo.isNode(e)&&typeof e=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let f=!d&&(!e||p&&t==null&&!n.inFlow||qo.isCollection(e)||(qo.isScalar(e)?e.type===wj.Scalar.BLOCK_FOLDED||e.type===wj.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!o),indent:a+c});let m=!1,g=!1,h=kj.stringify(e,n,()=>m=!0,()=>g=!0);if(!f&&!n.inFlow&&h.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(o||t==null)return m&&i&&i(),h===""?"?":f?`? ${h}`:h}else if(o&&!d||t==null&&f)return h=`? ${h}`,p&&!m?h+=sm.lineComment(h,n.indent,l(p)):g&&r&&r(),h;m&&(p=null),f?(p&&(h+=sm.lineComment(h,n.indent,l(p))),h=`? ${h} +${a}:`):(h=`${h}:`,p&&(h+=sm.lineComment(h,n.indent,l(p))));let b,y,w;qo.isNode(t)?(b=!!t.spaceBefore,y=t.commentBefore,w=t.comment):(b=!1,y=null,w=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!f&&!p&&qo.isScalar(t)&&(n.indentAtStart=h.length+1),g=!1,!u&&c.length>=2&&!n.inFlow&&!f&&qo.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let k=!1,$=kj.stringify(t,n,()=>k=!0,()=>g=!0),S=" ";if(p||b||y){if(S=b?` `:"",y){let x=l(y);S+=` -${om.indentComment(x,n.indent)}`}_===""&&!n.inFlow?S===` +${sm.indentComment(x,n.indent)}`}$===""&&!n.inFlow?S===` `&&w&&(S=` `):S+=` -${n.indent}`}else if(!f&&qo.isCollection(t)){let x=_[0],E=_.indexOf(` -`),T=E!==-1,A=n.inFlow??t.flow??t.items.length===0;if(T||!A){let L=!1;if(T&&(x==="&"||x==="!")){let F=_.indexOf(" ");x==="&"&&F!==-1&&F{"use strict";var hj=require("process");function Poe(e,...t){e==="debug"&&console.log(...t)}function Doe(e,t){(e==="debug"||e==="warn")&&(typeof hj.emitWarning=="function"?hj.emitWarning(t):console.warn(t))}_E.debug=Poe;_E.warn=Doe});var $b=q(kb=>{"use strict";var wb=Ze(),yj=an(),bb="<<",vb={identify:e=>e===bb||typeof e=="symbol"&&e.description===bb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new yj.Scalar(Symbol(bb)),{addToJSMap:bj}),stringify:()=>bb},Ooe=(e,t)=>(vb.identify(t)||wb.isScalar(t)&&(!t.type||t.type===yj.Scalar.PLAIN)&&vb.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===vb.tag&&n.default);function bj(e,t,n){let i=vj(e,n);if(wb.isSeq(i))for(let r of i.items)xE(e,t,r);else if(Array.isArray(i))for(let r of i)xE(e,t,r);else xE(e,t,i)}function xE(e,t,n){let i=vj(e,n);if(!wb.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,s]of r)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function vj(e,t){return e&&wb.isAlias(t)?t.resolve(e.doc,e):t}kb.addMergeToJSMap=bj;kb.isMergeKey=Ooe;kb.merge=vb});var TE=q($j=>{"use strict";var Moe=SE(),wj=$b(),Loe=im(),kj=Ze(),EE=Is();function Foe(e,t,{key:n,value:i}){if(kj.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(wj.isMergeKey(e,n))wj.addMergeToJSMap(e,t,i);else{let r=EE.toJS(n,"",e);if(t instanceof Map)t.set(r,EE.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=Uoe(n,r,e),s=EE.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function Uoe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(kj.isNode(e)&&n?.doc){let i=Loe.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Moe.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}$j.addPairToJSMap=Foe});var Cs=q(IE=>{"use strict";var _j=Xf(),joe=gj(),zoe=TE(),_b=Ze();function Goe(e,t,n){let i=_j.createNode(e,void 0,n),r=_j.createNode(t,void 0,n);return new Sb(i,r)}var Sb=class e{constructor(t,n=null){Object.defineProperty(this,_b.NODE_TYPE,{value:_b.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return _b.isNode(n)&&(n=n.clone(t)),_b.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return zoe.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?joe.stringifyPair(this,t,n,i):JSON.stringify(this)}};IE.Pair=Sb;IE.createPair=Goe});var AE=q(xj=>{"use strict";var uc=Ze(),Sj=im(),xb=em();function Voe(e,t,n){return(t.inFlow??e.flow?qoe:Boe)(e,t,n)}function Boe({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),d=!1,p=[];for(let m=0;mh=null,()=>d=!0);h&&(b+=xb.lineComment(b,o,l(h))),d&&h&&(d=!1),p.push(i+b)}let f;if(p.length===0)f=r.start+r.end;else{f=p[0];for(let m=1;m{"use strict";var Sj=require("process");function Uoe(e,...t){e==="debug"&&console.log(...t)}function joe(e,t){(e==="debug"||e==="warn")&&(typeof Sj.emitWarning=="function"?Sj.emitWarning(t):console.warn(t))}RE.debug=Uoe;RE.warn=joe});var Ab=q(Ib=>{"use strict";var Tb=Ze(),xj=sn(),xb="<<",Eb={identify:e=>e===xb||typeof e=="symbol"&&e.description===xb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new xj.Scalar(Symbol(xb)),{addToJSMap:Ej}),stringify:()=>xb},zoe=(e,t)=>(Eb.identify(t)||Tb.isScalar(t)&&(!t.type||t.type===xj.Scalar.PLAIN)&&Eb.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Eb.tag&&n.default);function Ej(e,t,n){let i=Tj(e,n);if(Tb.isSeq(i))for(let r of i.items)NE(e,t,r);else if(Array.isArray(i))for(let r of i)NE(e,t,r);else NE(e,t,i)}function NE(e,t,n){let i=Tj(e,n);if(!Tb.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,s]of r)t instanceof Map?t.has(o)||t.set(o,s):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function Tj(e,t){return e&&Tb.isAlias(t)?t.resolve(e.doc,e):t}Ib.addMergeToJSMap=Ej;Ib.isMergeKey=zoe;Ib.merge=Eb});var DE=q(Rj=>{"use strict";var Goe=CE(),Ij=Ab(),Voe=om(),Aj=Ze(),PE=Is();function Boe(e,t,{key:n,value:i}){if(Aj.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(Ij.isMergeKey(e,n))Ij.addMergeToJSMap(e,t,i);else{let r=PE.toJS(n,"",e);if(t instanceof Map)t.set(r,PE.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=qoe(n,r,e),s=PE.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}function qoe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Aj.isNode(e)&&n?.doc){let i=Voe.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Goe.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}Rj.addPairToJSMap=Boe});var Ns=q(OE=>{"use strict";var Cj=em(),Woe=$j(),Koe=DE(),Rb=Ze();function Hoe(e,t,n){let i=Cj.createNode(e,void 0,n),r=Cj.createNode(t,void 0,n);return new Cb(i,r)}var Cb=class e{constructor(t,n=null){Object.defineProperty(this,Rb.NODE_TYPE,{value:Rb.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Rb.isNode(n)&&(n=n.clone(t)),Rb.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return Koe.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?Woe.stringifyPair(this,t,n,i):JSON.stringify(this)}};OE.Pair=Cb;OE.createPair=Hoe});var ME=q(Pj=>{"use strict";var uc=Ze(),Nj=om(),Nb=tm();function Joe(e,t,n){return(t.inFlow??e.flow?Yoe:Zoe)(e,t,n)}function Zoe({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),d=!1,p=[];for(let m=0;mh=null,()=>d=!0);h&&(b+=Nb.lineComment(b,o,l(h))),d&&h&&(d=!1),p.push(i+b)}let f;if(p.length===0)f=r.start+r.end;else{f=p[0];for(let m=1;mh=null);l||(l=d.length>u||b.includes(` -`)),m0&&(l||(l=d.reduce((y,w)=>y+w.length+2,2)+(b.length+2)>t.options.lineWidth)),l&&(b+=",")),h&&(b+=xb.lineComment(b,i,a(h))),d.push(b),u=d.length}let{start:p,end:f}=n;if(d.length===0)return p+f;if(!l){let m=d.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=p;for(let g of d)m+=g?` +`+Nb.indentComment(l(e),c),a&&a()):d&&s&&s(),f}function Yoe({items:e},t,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=t;i+=o;let c=Object.assign({},t,{indent:i,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mh=null);l||(l=d.length>u||b.includes(` +`)),m0&&(l||(l=d.reduce((y,w)=>y+w.length+2,2)+(b.length+2)>t.options.lineWidth)),l&&(b+=",")),h&&(b+=Nb.lineComment(b,i,a(h))),d.push(b),u=d.length}let{start:p,end:f}=n;if(d.length===0)return p+f;if(!l){let m=d.reduce((g,h)=>g+h.length+2,2);l=t.options.lineWidth>0&&m>t.options.lineWidth}if(l){let m=p;for(let g of d)m+=g?` ${o}${r}${g}`:` `;return`${m} -${r}${f}`}else return`${p}${s}${d.join(" ")}${s}${f}`}function Eb({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=xb.indentComment(t(i),e);n.push(o.trimStart())}}xj.stringifyCollection=Voe});var Ds=q(NE=>{"use strict";var Woe=AE(),Hoe=TE(),Koe=pb(),Ps=Ze(),Tb=Cs(),Joe=an();function sm(e,t){let n=Ps.isScalar(t)?t.value:t;for(let i of e)if(Ps.isPair(i)&&(i.key===t||i.key===n||Ps.isScalar(i.key)&&i.key.value===n))return i}var RE=class extends Koe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ps.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(t),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||r)&&s.items.push(Tb.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let i;Ps.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Tb.Pair(t,t?.value):i=new Tb.Pair(t.key,t.value);let r=sm(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ps.isScalar(r.value)&&Joe.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(t){let n=sm(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=sm(this.items,t)?.value;return(!n&&Ps.isScalar(r)?r.value:r)??void 0}has(t){return!!sm(this.items,t)}set(t,n){this.add(new Tb.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)Hoe.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!Ps.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Woe.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};NE.YAMLMap=RE;NE.findPair=sm});var vu=q(Tj=>{"use strict";var Zoe=Ze(),Ej=Ds(),Yoe={collection:"map",default:!0,nodeClass:Ej.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return Zoe.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ej.YAMLMap.from(e,t,n)};Tj.map=Yoe});var Os=q(Ij=>{"use strict";var Qoe=Xf(),Xoe=AE(),ese=pb(),Ab=Ze(),tse=an(),nse=Is(),CE=class extends ese.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ab.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ib(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=Ib(t);if(typeof i!="number")return;let r=this.items[i];return!n&&Ab.isScalar(r)?r.value:r}has(t){let n=Ib(t);return typeof n=="number"&&n=0?t:null}Ij.YAMLSeq=CE});var wu=q(Rj=>{"use strict";var rse=Ze(),Aj=Os(),ise={collection:"seq",default:!0,nodeClass:Aj.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return rse.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Aj.YAMLSeq.from(e,t,n)};Rj.seq=ise});var am=q(Nj=>{"use strict";var ose=rm(),sse={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),ose.stringifyString(e,t,n,i)}};Nj.string=sse});var Rb=q(Dj=>{"use strict";var Cj=an(),Pj={identify:e=>e==null,createNode:()=>new Cj.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Cj.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Pj.test.test(e)?e:t.options.nullStr};Dj.nullTag=Pj});var PE=q(Mj=>{"use strict";var ase=an(),Oj={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ase.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Oj.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};Mj.boolTag=Oj});var ku=q(Lj=>{"use strict";function cse({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Lj.stringifyNumber=cse});var OE=q(Nb=>{"use strict";var lse=an(),DE=ku(),use={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:DE.stringifyNumber},dse={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():DE.stringifyNumber(e)}},pse={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 lse.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:DE.stringifyNumber};Nb.float=pse;Nb.floatExp=dse;Nb.floatNaN=use});var LE=q(Pb=>{"use strict";var Fj=ku(),Cb=e=>typeof e=="bigint"||Number.isInteger(e),ME=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Uj(e,t,n){let{value:i}=e;return Cb(i)&&i>=0?n+i.toString(t):Fj.stringifyNumber(e)}var fse={identify:e=>Cb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ME(e,2,8,n),stringify:e=>Uj(e,8,"0o")},mse={identify:Cb,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ME(e,0,10,n),stringify:Fj.stringifyNumber},gse={identify:e=>Cb(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ME(e,2,16,n),stringify:e=>Uj(e,16,"0x")};Pb.int=mse;Pb.intHex=gse;Pb.intOct=fse});var zj=q(jj=>{"use strict";var hse=vu(),yse=Rb(),bse=wu(),vse=am(),wse=PE(),FE=OE(),UE=LE(),kse=[hse.map,bse.seq,vse.string,yse.nullTag,wse.boolTag,UE.intOct,UE.int,UE.intHex,FE.floatNaN,FE.floatExp,FE.float];jj.schema=kse});var Bj=q(Vj=>{"use strict";var $se=an(),_se=vu(),Sse=wu();function Gj(e){return typeof e=="bigint"||Number.isInteger(e)}var Db=({value:e})=>JSON.stringify(e),xse=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Db},{identify:e=>e==null,createNode:()=>new $se.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Db},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Db},{identify:Gj,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Gj(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:Db}],Ese={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Tse=[_se.map,Sse.seq].concat(xse,Ese);Vj.schema=Tse});var zE=q(qj=>{"use strict";var cm=require("buffer"),jE=an(),Ise=rm(),Ase={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof cm.Buffer=="function")return cm.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r{"use strict";var Ob=Ze(),GE=Cs(),Rse=an(),Nse=Os();function Wj(e,t){if(Ob.isSeq(e))for(let n=0;n1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new GE.Pair(new Rse.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} +${r}${f}`}else return`${p}${s}${d.join(" ")}${s}${f}`}function Pb({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=Nb.indentComment(t(i),e);n.push(o.trimStart())}}Pj.stringifyCollection=Joe});var Ds=q(FE=>{"use strict";var Qoe=ME(),Xoe=DE(),ese=vb(),Ps=Ze(),Db=Ns(),tse=sn();function am(e,t){let n=Ps.isScalar(t)?t.value:t;for(let i of e)if(Ps.isPair(i)&&(i.key===t||i.key===n||Ps.isScalar(i.key)&&i.key.value===n))return i}var LE=class extends ese.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ps.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,s=new this(t),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||r)&&s.items.push(Db.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){let i;Ps.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Db.Pair(t,t?.value):i=new Db.Pair(t.key,t.value);let r=am(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Ps.isScalar(r.value)&&tse.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(t){let n=am(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=am(this.items,t)?.value;return(!n&&Ps.isScalar(r)?r.value:r)??void 0}has(t){return!!am(this.items,t)}set(t,n){this.add(new Db.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)Xoe.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!Ps.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Qoe.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};FE.YAMLMap=LE;FE.findPair=am});var ku=q(Oj=>{"use strict";var nse=Ze(),Dj=Ds(),rse={collection:"map",default:!0,nodeClass:Dj.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return nse.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Dj.YAMLMap.from(e,t,n)};Oj.map=rse});var Os=q(Mj=>{"use strict";var ise=em(),ose=ME(),sse=vb(),Mb=Ze(),ase=sn(),cse=Is(),UE=class extends sse.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Mb.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Ob(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=Ob(t);if(typeof i!="number")return;let r=this.items[i];return!n&&Mb.isScalar(r)?r.value:r}has(t){let n=Ob(t);return typeof n=="number"&&n=0?t:null}Mj.YAMLSeq=UE});var _u=q(Fj=>{"use strict";var lse=Ze(),Lj=Os(),use={collection:"seq",default:!0,nodeClass:Lj.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return lse.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Lj.YAMLSeq.from(e,t,n)};Fj.seq=use});var cm=q(Uj=>{"use strict";var dse=im(),pse={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),dse.stringifyString(e,t,n,i)}};Uj.string=pse});var Lb=q(Gj=>{"use strict";var jj=sn(),zj={identify:e=>e==null,createNode:()=>new jj.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new jj.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&zj.test.test(e)?e:t.options.nullStr};Gj.nullTag=zj});var jE=q(Bj=>{"use strict";var fse=sn(),Vj={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new fse.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Vj.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};Bj.boolTag=Vj});var $u=q(qj=>{"use strict";function mse({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=t-(o.length-s-1);for(;a-- >0;)o+="0"}return o}qj.stringifyNumber=mse});var GE=q(Fb=>{"use strict";var gse=sn(),zE=$u(),hse={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:zE.stringifyNumber},yse={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():zE.stringifyNumber(e)}},bse={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 gse.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:zE.stringifyNumber};Fb.float=bse;Fb.floatExp=yse;Fb.floatNaN=hse});var BE=q(jb=>{"use strict";var Wj=$u(),Ub=e=>typeof e=="bigint"||Number.isInteger(e),VE=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Kj(e,t,n){let{value:i}=e;return Ub(i)&&i>=0?n+i.toString(t):Wj.stringifyNumber(e)}var vse={identify:e=>Ub(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>VE(e,2,8,n),stringify:e=>Kj(e,8,"0o")},wse={identify:Ub,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>VE(e,0,10,n),stringify:Wj.stringifyNumber},kse={identify:e=>Ub(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>VE(e,2,16,n),stringify:e=>Kj(e,16,"0x")};jb.int=wse;jb.intHex=kse;jb.intOct=vse});var Jj=q(Hj=>{"use strict";var _se=ku(),$se=Lb(),Sse=_u(),xse=cm(),Ese=jE(),qE=GE(),WE=BE(),Tse=[_se.map,Sse.seq,xse.string,$se.nullTag,Ese.boolTag,WE.intOct,WE.int,WE.intHex,qE.floatNaN,qE.floatExp,qE.float];Hj.schema=Tse});var Qj=q(Yj=>{"use strict";var Ise=sn(),Ase=ku(),Rse=_u();function Zj(e){return typeof e=="bigint"||Number.isInteger(e)}var zb=({value:e})=>JSON.stringify(e),Cse=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:zb},{identify:e=>e==null,createNode:()=>new Ise.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zb},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:zb},{identify:Zj,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Zj(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:zb}],Nse={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Pse=[Ase.map,Rse.seq].concat(Cse,Nse);Yj.schema=Pse});var HE=q(Xj=>{"use strict";var lm=require("buffer"),KE=sn(),Dse=im(),Ose={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof lm.Buffer=="function")return lm.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r{"use strict";var Gb=Ze(),JE=Ns(),Mse=sn(),Lse=Os();function ez(e,t){if(Gb.isSeq(e))for(let n=0;n1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new JE.Pair(new Mse.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} ${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment} -${o.comment}`:i.comment}i=r}e.items[n]=Ob.isPair(i)?i:new GE.Pair(i)}}else t("Expected a sequence for this tag");return e}function Hj(e,t,n){let{replacer:i}=n,r=new Nse.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof i=="function"&&(s=i.call(t,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;r.items.push(GE.createPair(a,c,n))}return r}var Cse={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Wj,createNode:Hj};Mb.createPairs=Hj;Mb.pairs=Cse;Mb.resolvePairs=Wj});var qE=q(BE=>{"use strict";var Kj=Ze(),VE=Is(),lm=Ds(),Pse=Os(),Jj=Lb(),dc=class e extends Pse.YAMLSeq{constructor(){super(),this.add=lm.YAMLMap.prototype.add.bind(this),this.delete=lm.YAMLMap.prototype.delete.bind(this),this.get=lm.YAMLMap.prototype.get.bind(this),this.has=lm.YAMLMap.prototype.has.bind(this),this.set=lm.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(Kj.isPair(r)?(o=VE.toJS(r.key,"",n),s=VE.toJS(r.value,o,n)):o=VE.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(t,n,i){let r=Jj.createPairs(t,n,i),o=new this;return o.items=r.items,o}};dc.tag="tag:yaml.org,2002:omap";var Dse={collection:"seq",identify:e=>e instanceof Map,nodeClass:dc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=Jj.resolvePairs(e,t),i=[];for(let{key:r}of n.items)Kj.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new dc,n)},createNode:(e,t,n)=>dc.from(e,t,n)};BE.YAMLOMap=dc;BE.omap=Dse});var ez=q(WE=>{"use strict";var Zj=an();function Yj({value:e,source:t},n){return t&&(e?Qj:Xj).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Qj={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 Zj.Scalar(!0),stringify:Yj},Xj={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 Zj.Scalar(!1),stringify:Yj};WE.falseTag=Xj;WE.trueTag=Qj});var tz=q(Fb=>{"use strict";var Ose=an(),HE=ku(),Mse={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:HE.stringifyNumber},Lse={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():HE.stringifyNumber(e)}},Fse={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 Ose.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:HE.stringifyNumber};Fb.float=Fse;Fb.floatExp=Lse;Fb.floatNaN=Mse});var rz=q(dm=>{"use strict";var nz=ku(),um=e=>typeof e=="bigint"||Number.isInteger(e);function Ub(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return r==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return r==="-"?-1*o:o}function KE(e,t,n){let{value:i}=e;if(um(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return nz.stringifyNumber(e)}var Use={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Ub(e,2,2,n),stringify:e=>KE(e,2,"0b")},jse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Ub(e,1,8,n),stringify:e=>KE(e,8,"0")},zse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Ub(e,0,10,n),stringify:nz.stringifyNumber},Gse={identify:um,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Ub(e,2,16,n),stringify:e=>KE(e,16,"0x")};dm.int=zse;dm.intBin=Use;dm.intHex=Gse;dm.intOct=jse});var ZE=q(JE=>{"use strict";var Gb=Ze(),jb=Cs(),zb=Ds(),pc=class e extends zb.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Gb.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new jb.Pair(t.key,null):n=new jb.Pair(t,null),zb.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=zb.findPair(this.items,t);return!n&&Gb.isPair(i)?Gb.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=zb.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new jb.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(jb.createPair(s,null,i));return o}};pc.tag="tag:yaml.org,2002:set";var Vse={collection:"map",identify:e=>e instanceof Set,nodeClass:pc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>pc.from(e,t,n),resolve(e,t){if(Gb.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new pc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};JE.YAMLSet=pc;JE.set=Vse});var QE=q(Vb=>{"use strict";var Bse=ku();function YE(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=s=>t?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function iz(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return Bse.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var qse={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:n})=>YE(e,n),stringify:iz},Wse={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=>YE(e,!1),stringify:iz},oz={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(oz.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,s||0,a||0,c),u=t[8];if(u&&u!=="Z"){let d=YE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vb.floatTime=Wse;Vb.intTime=qse;Vb.timestamp=oz});var cz=q(az=>{"use strict";var Hse=vu(),Kse=Rb(),Jse=wu(),Zse=am(),Yse=zE(),sz=ez(),XE=tz(),Bb=rz(),Qse=$b(),Xse=qE(),eae=Lb(),tae=ZE(),eT=QE(),nae=[Hse.map,Jse.seq,Zse.string,Kse.nullTag,sz.trueTag,sz.falseTag,Bb.intBin,Bb.intOct,Bb.int,Bb.intHex,XE.floatNaN,XE.floatExp,XE.float,Yse.binary,Qse.merge,Xse.omap,eae.pairs,tae.set,eT.intTime,eT.floatTime,eT.timestamp];az.schema=nae});var bz=q(rT=>{"use strict";var pz=vu(),rae=Rb(),fz=wu(),iae=am(),oae=PE(),tT=OE(),nT=LE(),sae=zj(),aae=Bj(),mz=zE(),pm=$b(),gz=qE(),hz=Lb(),lz=cz(),yz=ZE(),qb=QE(),uz=new Map([["core",sae.schema],["failsafe",[pz.map,fz.seq,iae.string]],["json",aae.schema],["yaml11",lz.schema],["yaml-1.1",lz.schema]]),dz={binary:mz.binary,bool:oae.boolTag,float:tT.float,floatExp:tT.floatExp,floatNaN:tT.floatNaN,floatTime:qb.floatTime,int:nT.int,intHex:nT.intHex,intOct:nT.intOct,intTime:qb.intTime,map:pz.map,merge:pm.merge,null:rae.nullTag,omap:gz.omap,pairs:hz.pairs,seq:fz.seq,set:yz.set,timestamp:qb.timestamp},cae={"tag:yaml.org,2002:binary":mz.binary,"tag:yaml.org,2002:merge":pm.merge,"tag:yaml.org,2002:omap":gz.omap,"tag:yaml.org,2002:pairs":hz.pairs,"tag:yaml.org,2002:set":yz.set,"tag:yaml.org,2002:timestamp":qb.timestamp};function lae(e,t,n){let i=uz.get(t);if(i&&!e)return n&&!i.includes(pm.merge)?i.concat(pm.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(uz.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(pm.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?dz[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(dz).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}rT.coreKnownTags=cae;rT.getTags=lae});var sT=q(vz=>{"use strict";var iT=Ze(),uae=vu(),dae=wu(),pae=am(),Wb=bz(),fae=(e,t)=>e.keyt.key?1:0,oT=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?Wb.getTags(t,"compat"):t?Wb.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?Wb.coreKnownTags:{},this.tags=Wb.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,iT.MAP,{value:uae.map}),Object.defineProperty(this,iT.SCALAR,{value:pae.string}),Object.defineProperty(this,iT.SEQ,{value:dae.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?fae:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};vz.Schema=oT});var kz=q(wz=>{"use strict";var mae=Ze(),aT=im(),fm=em();function gae(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=aT.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=o(e.commentBefore);n.unshift(fm.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(mae.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(fm.indentComment(u,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=aT.stringify(e.contents,r,()=>a=null,c);a&&(l+=fm.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(aT.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);c.includes(` -`)?(n.push("..."),n.push(fm.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(fm.indentComment(o(c),"")))}return n.join(` +${o.comment}`:i.comment}i=r}e.items[n]=Gb.isPair(i)?i:new JE.Pair(i)}}else t("Expected a sequence for this tag");return e}function tz(e,t,n){let{replacer:i}=n,r=new Lse.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof i=="function"&&(s=i.call(t,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;r.items.push(JE.createPair(a,c,n))}return r}var Fse={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ez,createNode:tz};Vb.createPairs=tz;Vb.pairs=Fse;Vb.resolvePairs=ez});var QE=q(YE=>{"use strict";var nz=Ze(),ZE=Is(),um=Ds(),Use=Os(),rz=Bb(),dc=class e extends Use.YAMLSeq{constructor(){super(),this.add=um.YAMLMap.prototype.add.bind(this),this.delete=um.YAMLMap.prototype.delete.bind(this),this.get=um.YAMLMap.prototype.get.bind(this),this.has=um.YAMLMap.prototype.has.bind(this),this.set=um.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,s;if(nz.isPair(r)?(o=ZE.toJS(r.key,"",n),s=ZE.toJS(r.value,o,n)):o=ZE.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(t,n,i){let r=rz.createPairs(t,n,i),o=new this;return o.items=r.items,o}};dc.tag="tag:yaml.org,2002:omap";var jse={collection:"seq",identify:e=>e instanceof Map,nodeClass:dc,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=rz.resolvePairs(e,t),i=[];for(let{key:r}of n.items)nz.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new dc,n)},createNode:(e,t,n)=>dc.from(e,t,n)};YE.YAMLOMap=dc;YE.omap=jse});var cz=q(XE=>{"use strict";var iz=sn();function oz({value:e,source:t},n){return t&&(e?sz:az).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var sz={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 iz.Scalar(!0),stringify:oz},az={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 iz.Scalar(!1),stringify:oz};XE.falseTag=az;XE.trueTag=sz});var lz=q(qb=>{"use strict";var zse=sn(),eT=$u(),Gse={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:eT.stringifyNumber},Vse={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():eT.stringifyNumber(e)}},Bse={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 zse.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:eT.stringifyNumber};qb.float=Bse;qb.floatExp=Vse;qb.floatNaN=Gse});var dz=q(pm=>{"use strict";var uz=$u(),dm=e=>typeof e=="bigint"||Number.isInteger(e);function Wb(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return r==="-"?BigInt(-1)*s:s}let o=parseInt(e,n);return r==="-"?-1*o:o}function tT(e,t,n){let{value:i}=e;if(dm(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return uz.stringifyNumber(e)}var qse={identify:dm,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Wb(e,2,2,n),stringify:e=>tT(e,2,"0b")},Wse={identify:dm,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Wb(e,1,8,n),stringify:e=>tT(e,8,"0")},Kse={identify:dm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Wb(e,0,10,n),stringify:uz.stringifyNumber},Hse={identify:dm,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Wb(e,2,16,n),stringify:e=>tT(e,16,"0x")};pm.int=Kse;pm.intBin=qse;pm.intHex=Hse;pm.intOct=Wse});var rT=q(nT=>{"use strict";var Jb=Ze(),Kb=Ns(),Hb=Ds(),pc=class e extends Hb.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Jb.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Kb.Pair(t.key,null):n=new Kb.Pair(t,null),Hb.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=Hb.findPair(this.items,t);return!n&&Jb.isPair(i)?Jb.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=Hb.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Kb.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof r=="function"&&(s=r.call(n,s,s)),o.items.push(Kb.createPair(s,null,i));return o}};pc.tag="tag:yaml.org,2002:set";var Jse={collection:"map",identify:e=>e instanceof Set,nodeClass:pc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>pc.from(e,t,n),resolve(e,t){if(Jb.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new pc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};nT.YAMLSet=pc;nT.set=Jse});var oT=q(Zb=>{"use strict";var Zse=$u();function iT(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=s=>t?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*r(60)+r(a),r(0));return n==="-"?r(-1)*o:o}function pz(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return Zse.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Yse={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:n})=>iT(e,n),stringify:pz},Qse={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=>iT(e,!1),stringify:pz},fz={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(fz.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,s||0,a||0,c),u=t[8];if(u&&u!=="Z"){let d=iT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Zb.floatTime=Qse;Zb.intTime=Yse;Zb.timestamp=fz});var hz=q(gz=>{"use strict";var Xse=ku(),eae=Lb(),tae=_u(),nae=cm(),rae=HE(),mz=cz(),sT=lz(),Yb=dz(),iae=Ab(),oae=QE(),sae=Bb(),aae=rT(),aT=oT(),cae=[Xse.map,tae.seq,nae.string,eae.nullTag,mz.trueTag,mz.falseTag,Yb.intBin,Yb.intOct,Yb.int,Yb.intHex,sT.floatNaN,sT.floatExp,sT.float,rae.binary,iae.merge,oae.omap,sae.pairs,aae.set,aT.intTime,aT.floatTime,aT.timestamp];gz.schema=cae});var Ez=q(uT=>{"use strict";var wz=ku(),lae=Lb(),kz=_u(),uae=cm(),dae=jE(),cT=GE(),lT=BE(),pae=Jj(),fae=Qj(),_z=HE(),fm=Ab(),$z=QE(),Sz=Bb(),yz=hz(),xz=rT(),Qb=oT(),bz=new Map([["core",pae.schema],["failsafe",[wz.map,kz.seq,uae.string]],["json",fae.schema],["yaml11",yz.schema],["yaml-1.1",yz.schema]]),vz={binary:_z.binary,bool:dae.boolTag,float:cT.float,floatExp:cT.floatExp,floatNaN:cT.floatNaN,floatTime:Qb.floatTime,int:lT.int,intHex:lT.intHex,intOct:lT.intOct,intTime:Qb.intTime,map:wz.map,merge:fm.merge,null:lae.nullTag,omap:$z.omap,pairs:Sz.pairs,seq:kz.seq,set:xz.set,timestamp:Qb.timestamp},mae={"tag:yaml.org,2002:binary":_z.binary,"tag:yaml.org,2002:merge":fm.merge,"tag:yaml.org,2002:omap":$z.omap,"tag:yaml.org,2002:pairs":Sz.pairs,"tag:yaml.org,2002:set":xz.set,"tag:yaml.org,2002:timestamp":Qb.timestamp};function gae(e,t,n){let i=bz.get(t);if(i&&!e)return n&&!i.includes(fm.merge)?i.concat(fm.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(bz.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(fm.merge)),r.reduce((o,s)=>{let a=typeof s=="string"?vz[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(vz).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}uT.coreKnownTags=mae;uT.getTags=gae});var fT=q(Tz=>{"use strict";var dT=Ze(),hae=ku(),yae=_u(),bae=cm(),Xb=Ez(),vae=(e,t)=>e.keyt.key?1:0,pT=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?Xb.getTags(t,"compat"):t?Xb.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?Xb.coreKnownTags:{},this.tags=Xb.getTags(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,dT.MAP,{value:hae.map}),Object.defineProperty(this,dT.SCALAR,{value:bae.string}),Object.defineProperty(this,dT.SEQ,{value:yae.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?vae:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};Tz.Schema=pT});var Az=q(Iz=>{"use strict";var wae=Ze(),mT=om(),mm=tm();function kae(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=mT.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=o(e.commentBefore);n.unshift(mm.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(wae.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let u=o(e.contents.commentBefore);n.push(mm.indentComment(u,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,l=mT.stringify(e.contents,r,()=>a=null,c);a&&(l+=mm.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(mT.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);c.includes(` +`)?(n.push("..."),n.push(mm.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(mm.indentComment(o(c),"")))}return n.join(` `)+` -`}wz.stringifyDocument=gae});var mm=q($z=>{"use strict";var hae=Qf(),$u=pb(),ai=Ze(),yae=Cs(),bae=Is(),vae=sT(),wae=kz(),cT=cb(),kae=pE(),$ae=Xf(),lT=dE(),uT=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ai.NODE_TYPE,{value:ai.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new lT.Directives({version:s}),this.setSchema(s,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[ai.NODE_TYPE]:{value:ai.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ai.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){_u(this.contents)&&this.contents.add(t)}addIn(t,n){_u(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=cT.anchorNames(this);t.anchor=!n||i.has(n)?cT.findNewAnchor(n||"a",i):n}return new hae.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let h=y=>typeof y=="number"||y instanceof String||y instanceof Number,b=n.filter(h).map(String);b.length>0&&(n=n.concat(b)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:f}=cT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:f},g=$ae.createNode(t,u,m);return a&&ai.isCollection(g)&&(g.flow=!0),p(),g}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new yae.Pair(r,o)}delete(t){return _u(this.contents)?this.contents.delete(t):!1}deleteIn(t){return $u.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):_u(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ai.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return $u.isEmptyPath(t)?!n&&ai.isScalar(this.contents)?this.contents.value:this.contents:ai.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ai.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return $u.isEmptyPath(t)?this.contents!==void 0:ai.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=$u.collectionFromPath(this.schema,[t],n):_u(this.contents)&&this.contents.set(t,n)}setIn(t,n){$u.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=$u.collectionFromPath(this.schema,Array.from(t),n):_u(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new lT.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new lT.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new vae.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=bae.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?kae.applyReviver(s,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return wae.stringifyDocument(this,t)}};function _u(e){if(ai.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}$z.Document=uT});var ym=q(hm=>{"use strict";var gm=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},dT=class extends gm{constructor(t,n,i){super("YAMLParseError",t,n,i)}},pT=class extends gm{constructor(t,n,i){super("YAMLWarning",t,n,i)}},_ae=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`}Iz.stringifyDocument=kae});var gm=q(Rz=>{"use strict";var _ae=Xf(),Su=vb(),si=Ze(),$ae=Ns(),Sae=Is(),xae=fT(),Eae=Az(),gT=gb(),Tae=vE(),Iae=em(),hT=bE(),yT=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,si.NODE_TYPE,{value:si.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new hT.Directives({version:s}),this.setSchema(s,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[si.NODE_TYPE]:{value:si.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=si.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){xu(this.contents)&&this.contents.add(t)}addIn(t,n){xu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=gT.anchorNames(this);t.anchor=!n||i.has(n)?gT.findNewAnchor(n||"a",i):n}return new _ae.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let h=y=>typeof y=="number"||y instanceof String||y instanceof Number,b=n.filter(h).map(String);b.length>0&&(n=n.concat(b)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=i??{},{onAnchor:d,setAnchors:p,sourceObjects:f}=gT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:f},g=Iae.createNode(t,u,m);return a&&si.isCollection(g)&&(g.flow=!0),p(),g}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new $ae.Pair(r,o)}delete(t){return xu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Su.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):xu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return si.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Su.isEmptyPath(t)?!n&&si.isScalar(this.contents)?this.contents.value:this.contents:si.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return si.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Su.isEmptyPath(t)?this.contents!==void 0:si.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Su.collectionFromPath(this.schema,[t],n):xu(this.contents)&&this.contents.set(t,n)}setIn(t,n){Su.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Su.collectionFromPath(this.schema,Array.from(t),n):xu(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new hT.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new hT.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new xae.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Sae.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Tae.applyReviver(s,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Eae.stringifyDocument(this,t)}};function xu(e){if(si.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}Rz.Document=yT});var bm=q(ym=>{"use strict";var hm=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},bT=class extends hm{constructor(t,n,i){super("YAMLParseError",t,n,i)}},vT=class extends hm{constructor(t,n,i){super("YAMLWarning",t,n,i)}},Aae=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,s=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===i&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`: ${s} ${l} -`}};hm.YAMLError=gm;hm.YAMLParseError=dT;hm.YAMLWarning=pT;hm.prettifyError=_ae});var bm=q(_z=>{"use strict";function Sae(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",f=!1,m=!1,g=null,h=null,b=null,y=null,w=null,k=null,_=null;for(let E of e)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&o(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(l&&E.type!=="comment"&&E.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&E.source.includes(" ")&&(g=E),u=!0;break;case"comment":{u||o(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=E.source.substring(1)||" ";d?d+=p+T:d=T,p="",l=!1;break}case"newline":l?d?d+=E.source:(!k||n!=="seq-item-ind")&&(c=!0):p+=E.source,l=!0,f=!0,(h||b)&&(y=E),u=!0;break;case"anchor":h&&o(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&o(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=E,_??(_=E.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,_??(_=E.offset),l=!1,u=!1,m=!0;break}case n:(h||b)&&o(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),k&&o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=E,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){w&&o(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=E,l=!1,u=!1;break}default:o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}let S=e[e.length-1],x=S?S.offset+S.source.length:r;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:c,comment:d,hasNewline:f,anchor:h,tag:b,newlineAfterProp:y,end:x,start:_??x}}_z.resolveProps=Sae});var Hb=q(Sz=>{"use strict";function fT(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))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 n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(fT(t.key)||fT(t.value))return!0}return!1;default:return!0}}Sz.containsNewline=fT});var mT=q(xz=>{"use strict";var xae=Hb();function Eae(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&xae.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}xz.flowIndentCheck=Eae});var gT=q(Tz=>{"use strict";var Ez=Ze();function Tae(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||Ez.isScalar(o)&&Ez.isScalar(s)&&o.value===s.value;return t.some(o=>r(o.key,n))}Tz.mapIncludes=Tae});var Pz=q(Cz=>{"use strict";var Iz=Cs(),Iae=Ds(),Az=bm(),Aae=Hb(),Rz=mT(),Rae=gT(),Nz="All mapping items must start at the same column";function Nae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Iae.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:d,key:p,sep:f,value:m}=u,g=Az.resolveProps(d,{indicator:"explicit-key-ind",next:p??f?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),h=!g.found;if(h){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(c,"BAD_INDENT",Nz)),!g.anchor&&!g.tag&&!f){l=g.end,g.comment&&(a.comment?a.comment+=` -`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Aae.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(c,"BAD_INDENT",Nz);n.atKey=!0;let b=g.end,y=p?e(n,p,g,r):t(n,b,d,null,g,r);n.schema.compat&&Rz.flowIndentCheck(i.indent,p,r),n.atKey=!1,Rae.mapIncludes(n,a.items,y)&&r(b,"DUPLICATE_KEY","Map keys must be unique");let w=Az.resolveProps(f??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=w.end,w.found){h&&(m?.type==="block-map"&&!w.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start{"use strict";var Cae=Os(),Pae=bm(),Dae=mT();function Oae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Cae.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:d}of i.items){let p=Pae.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let f=d?e(n,d,p,r):t(n,p.end,u,null,p,r);n.schema.compat&&Dae.flowIndentCheck(i.indent,d,r),c=f.range[2],a.items.push(f)}return a.range=[i.offset,c,l??c],a}Dz.resolveBlockSeq=Oae});var Su=q(Mz=>{"use strict";function Mae(e,t,n,i){let r="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=c),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:r,offset:t}}Mz.resolveEnd=Mae});var jz=q(Uz=>{"use strict";var Lae=Ze(),Fae=Cs(),Lz=Ds(),Uae=Os(),jae=Su(),Fz=bm(),zae=Hb(),Gae=gT(),hT="Block collections are not allowed within flow collections",yT=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Vae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Lz.YAMLMap:Uae.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset+i.start.source.length;for(let h=0;h0){let h=jae.resolveEnd(m,g,n.options.strict,r);h.comment&&(l.comment?l.comment+=` -`+h.comment:l.comment=h.comment),l.range=[i.offset,g,h.offset]}else l.range=[i.offset,g,g];return l}Uz.resolveFlowCollection=Vae});var Gz=q(zz=>{"use strict";var Bae=Ze(),qae=an(),Wae=Ds(),Hae=Os(),Kae=Pz(),Jae=Oz(),Zae=jz();function bT(e,t,n,i,r,o){let s=n.type==="block-map"?Kae.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?Jae.resolveBlockSeq(e,t,n,i,o):Zae.resolveFlowCollection(e,t,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function Yae(e,t,n,i,r){let o=i.tag,s=o?t.directives.tagName(o.source,p=>r(o,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:f}=i,m=p&&o?p.offset>o.offset?p:o:p??o;m&&(!f||f.offsetp.tag===s&&p.collection===a);if(!c){let p=t.schema.knownTags[s];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?r(o,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),bT(e,t,n,r,s)}let l=bT(e,t,n,r,s,c),u=c.resolve?.(l,p=>r(o,"TAG_RESOLVE_FAILED",p),t.options)??l,d=Bae.isNode(u)?u:new qae.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}zz.composeCollection=Yae});var wT=q(Vz=>{"use strict";var vT=an();function Qae(e,t,n){let i=t.offset,r=Xae(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?vT.Scalar.BLOCK_FOLDED:vT.Scalar.BLOCK_LITERAL,s=t.source?ece(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=r.chomp==="+"&&s.length>0?` +`}};ym.YAMLError=hm;ym.YAMLParseError=bT;ym.YAMLWarning=vT;ym.prettifyError=Aae});var vm=q(Cz=>{"use strict";function Rae(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",p="",f=!1,m=!1,g=null,h=null,b=null,y=null,w=null,k=null,$=null;for(let E of e)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&o(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(l&&E.type!=="comment"&&E.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&E.source.includes(" ")&&(g=E),u=!0;break;case"comment":{u||o(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let T=E.source.substring(1)||" ";d?d+=p+T:d=T,p="",l=!1;break}case"newline":l?d?d+=E.source:(!k||n!=="seq-item-ind")&&(c=!0):p+=E.source,l=!0,f=!0,(h||b)&&(y=E),u=!0;break;case"anchor":h&&o(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&o(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=E,$??($=E.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,$??($=E.offset),l=!1,u=!1,m=!0;break}case n:(h||b)&&o(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),k&&o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),k=E,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(t){w&&o(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=E,l=!1,u=!1;break}default:o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}let S=e[e.length-1],x=S?S.offset+S.source.length:r;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:k,spaceBefore:c,comment:d,hasNewline:f,anchor:h,tag:b,newlineAfterProp:y,end:x,start:$??x}}Cz.resolveProps=Rae});var ev=q(Nz=>{"use strict";function wT(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))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 n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(wT(t.key)||wT(t.value))return!0}return!1;default:return!0}}Nz.containsNewline=wT});var kT=q(Pz=>{"use strict";var Cae=ev();function Nae(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&Cae.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Pz.flowIndentCheck=Nae});var _T=q(Oz=>{"use strict";var Dz=Ze();function Pae(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,s)=>o===s||Dz.isScalar(o)&&Dz.isScalar(s)&&o.value===s.value;return t.some(o=>r(o.key,n))}Oz.mapIncludes=Pae});var zz=q(jz=>{"use strict";var Mz=Ns(),Dae=Ds(),Lz=vm(),Oae=ev(),Fz=kT(),Mae=_T(),Uz="All mapping items must start at the same column";function Lae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Dae.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let u of i.items){let{start:d,key:p,sep:f,value:m}=u,g=Lz.resolveProps(d,{indicator:"explicit-key-ind",next:p??f?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),h=!g.found;if(h){if(p&&(p.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&r(c,"BAD_INDENT",Uz)),!g.anchor&&!g.tag&&!f){l=g.end,g.comment&&(a.comment?a.comment+=` +`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Oae.containsNewline(p))&&r(p??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(c,"BAD_INDENT",Uz);n.atKey=!0;let b=g.end,y=p?e(n,p,g,r):t(n,b,d,null,g,r);n.schema.compat&&Fz.flowIndentCheck(i.indent,p,r),n.atKey=!1,Mae.mapIncludes(n,a.items,y)&&r(b,"DUPLICATE_KEY","Map keys must be unique");let w=Lz.resolveProps(f??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=w.end,w.found){h&&(m?.type==="block-map"&&!w.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start{"use strict";var Fae=Os(),Uae=vm(),jae=kT();function zae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=o?.nodeClass??Fae.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:u,value:d}of i.items){let p=Uae.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||d)d?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=p.end,p.comment&&(a.comment=p.comment);continue}let f=d?e(n,d,p,r):t(n,p.end,u,null,p,r);n.schema.compat&&jae.flowIndentCheck(i.indent,d,r),c=f.range[2],a.items.push(f)}return a.range=[i.offset,c,l??c],a}Gz.resolveBlockSeq=zae});var Eu=q(Bz=>{"use strict";function Gae(e,t,n,i){let r="";if(e){let o=!1,s="";for(let a of e){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";r?r+=s+u:r=u,s="";break}case"newline":r&&(s+=c),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:r,offset:t}}Bz.resolveEnd=Gae});var Hz=q(Kz=>{"use strict";var Vae=Ze(),Bae=Ns(),qz=Ds(),qae=Os(),Wae=Eu(),Wz=vm(),Kae=ev(),Hae=_T(),$T="Block collections are not allowed within flow collections",ST=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Jae({composeNode:e,composeEmptyNode:t},n,i,r,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?qz.YAMLMap:qae.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset+i.start.source.length;for(let h=0;h0){let h=Wae.resolveEnd(m,g,n.options.strict,r);h.comment&&(l.comment?l.comment+=` +`+h.comment:l.comment=h.comment),l.range=[i.offset,g,h.offset]}else l.range=[i.offset,g,g];return l}Kz.resolveFlowCollection=Jae});var Zz=q(Jz=>{"use strict";var Zae=Ze(),Yae=sn(),Qae=Ds(),Xae=Os(),ece=zz(),tce=Vz(),nce=Hz();function xT(e,t,n,i,r,o){let s=n.type==="block-map"?ece.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?tce.resolveBlockSeq(e,t,n,i,o):nce.resolveFlowCollection(e,t,n,i,o),a=s.constructor;return r==="!"||r===a.tagName?(s.tag=a.tagName,s):(r&&(s.tag=r),s)}function rce(e,t,n,i,r){let o=i.tag,s=o?t.directives.tagName(o.source,p=>r(o,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:f}=i,m=p&&o?p.offset>o.offset?p:o:p??o;m&&(!f||f.offsetp.tag===s&&p.collection===a);if(!c){let p=t.schema.knownTags[s];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?r(o,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),xT(e,t,n,r,s)}let l=xT(e,t,n,r,s,c),u=c.resolve?.(l,p=>r(o,"TAG_RESOLVE_FAILED",p),t.options)??l,d=Zae.isNode(u)?u:new Yae.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}Jz.composeCollection=rce});var TT=q(Yz=>{"use strict";var ET=sn();function ice(e,t,n){let i=t.offset,r=oce(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?ET.Scalar.BLOCK_FOLDED:ET.Scalar.BLOCK_LITERAL,s=t.source?sce(t.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let h=s[g][1];if(h===""||h==="\r")a=g;else break}if(a===0){let g=r.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",h=i+r.length;return t.source&&(h+=t.source.length),{value:g,type:o,comment:r.comment,range:[i,h,h]}}let c=t.indent+r.indent,l=t.offset+r.length,u=0;for(let g=0;gc&&(c=h.length);else{h.length=a;--g)s[g][0].length>c&&(a=g+1);let d="",p="",f=!1;for(let g=0;gc||b[0]===" "?(p===" "?p=` `:!f&&p===` `&&(p=` @@ -81,85 +81,85 @@ ${l} `+s[g][0].slice(c);d[d.length-1]!==` `&&(d+=` `);break;default:d+=` -`}let m=i+r.length+t.source.length;return{value:d,type:o,comment:r.comment,range:[i,m,m]}}function Xae({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=t[0],o=r[0],s=0,a="",c=-1;for(let p=1;p{"use strict";var kT=an(),tce=Su();function nce(e,t,n){let{offset:i,type:r,source:o,end:s}=e,a,c,l=(p,f,m)=>n(i+p,f,m);switch(r){case"scalar":a=kT.Scalar.PLAIN,c=rce(o,l);break;case"single-quoted-scalar":a=kT.Scalar.QUOTE_SINGLE,c=ice(o,l);break;case"double-quoted-scalar":a=kT.Scalar.QUOTE_DOUBLE,c=oce(o,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,d=tce.resolveEnd(s,u,t,n);return{value:c,type:a,comment:d.comment,range:[i,u,d.offset]}}function rce(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Bz(e)}function ice(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Bz(e.slice(1,-1)).replace(/''/g,"'")}function Bz(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let i,r;try{i=new RegExp("(?{"use strict";var IT=sn(),ace=Eu();function cce(e,t,n){let{offset:i,type:r,source:o,end:s}=e,a,c,l=(p,f,m)=>n(i+p,f,m);switch(r){case"scalar":a=IT.Scalar.PLAIN,c=lce(o,l);break;case"single-quoted-scalar":a=IT.Scalar.QUOTE_SINGLE,c=uce(o,l);break;case"double-quoted-scalar":a=IT.Scalar.QUOTE_DOUBLE,c=dce(o,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,d=ace.resolveEnd(s,u,t,n);return{value:c,type:a,comment:d.comment,range:[i,u,d.offset]}}function lce(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Qz(e)}function uce(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Qz(e.slice(1,-1)).replace(/''/g,"'")}function Qz(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let i,r;try{i=new RegExp("(?o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function sce(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` +`)&&(n+=i>o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function pce(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` `||i==="\r")&&!(i==="\r"&&e[t+2]!==` `);)i===` `&&(n+=` -`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}var ace={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function cce(e,t,n,i){let r=e.substr(t,n),s=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}qz.resolveFlowScalar=nce});var Kz=q(Hz=>{"use strict";var fc=Ze(),Wz=an(),lce=wT(),uce=$T();function dce(e,t,n,i){let{value:r,type:o,comment:s,range:a}=t.type==="block-scalar"?lce.resolveBlockScalar(e,t,i):uce.resolveFlowScalar(t,e.options.strict,i),c=n?e.directives.tagName(n.source,d=>i(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[fc.SCALAR]:c?l=pce(e.schema,r,c,n,i):t.type==="scalar"?l=fce(e,r,t,i):l=e.schema[fc.SCALAR];let u;try{let d=l.resolve(r,p=>i(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=fc.isScalar(d)?d:new Wz.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(n??t,"TAG_RESOLVE_FAILED",p),u=new Wz.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function pce(e,t,n,i,r){if(n==="!")return e[fc.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[fc.SCALAR])}function fce({atKey:e,directives:t,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[fc.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[fc.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}Hz.composeScalar=dce});var Zz=q(Jz=>{"use strict";function mce(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}Jz.emptyScalarPosition=mce});var Xz=q(ST=>{"use strict";var gce=Qf(),hce=Ze(),yce=Gz(),Yz=Kz(),bce=Su(),vce=Zz(),wce={composeNode:Qz,composeEmptyNode:_T};function Qz(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=kce(e,t,i),(a||c)&&i(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":l=Yz.composeScalar(e,t,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=yce.composeCollection(wce,e,t,n,i),a&&(l.anchor=a.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);i(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=_T(e,t.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!hce.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?l.comment=s:l.commentBefore=s),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function _T(e,t,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:vce.emptyScalarPosition(t,n,i),indent:-1,source:""},d=Yz.composeScalar(e,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function kce({options:e},{offset:t,source:n,end:i},r){let o=new gce.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=bce.resolveEnd(i,s,e.strict,r);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}ST.composeEmptyNode=_T;ST.composeNode=Qz});var nG=q(tG=>{"use strict";var $ce=mm(),eG=Xz(),_ce=Su(),Sce=bm();function xce(e,t,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:t},e),c=new $ce.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Sce.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?eG.composeNode(l,r,u,s):eG.composeEmptyNode(l,u.end,i,null,u,s);let d=c.contents.range[2],p=_ce.resolveEnd(o,d,!1,s);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}tG.composeDoc=xce});var ET=q(oG=>{"use strict";var Ece=require("process"),Tce=dE(),Ice=mm(),vm=ym(),rG=Ze(),Ace=nG(),Rce=Su();function wm(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:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function iG(e){let t="",n=!1,i=!1;for(let r=0;r{"use strict";var fc=Ze(),eG=sn(),gce=TT(),hce=AT();function yce(e,t,n,i){let{value:r,type:o,comment:s,range:a}=t.type==="block-scalar"?gce.resolveBlockScalar(e,t,i):hce.resolveFlowScalar(t,e.options.strict,i),c=n?e.directives.tagName(n.source,d=>i(n,"TAG_RESOLVE_FAILED",d)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[fc.SCALAR]:c?l=bce(e.schema,r,c,n,i):t.type==="scalar"?l=vce(e,r,t,i):l=e.schema[fc.SCALAR];let u;try{let d=l.resolve(r,p=>i(n??t,"TAG_RESOLVE_FAILED",p),e.options);u=fc.isScalar(d)?d:new eG.Scalar(d)}catch(d){let p=d instanceof Error?d.message:String(d);i(n??t,"TAG_RESOLVE_FAILED",p),u=new eG.Scalar(r)}return u.range=a,u.source=r,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function bce(e,t,n,i,r){if(n==="!")return e[fc.SCALAR];let o=[];for(let a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(t))return a;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[fc.SCALAR])}function vce({atKey:e,directives:t,schema:n},i,r,o){let s=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[fc.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(i))??n[fc.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(r,"TAG_RESOLVE_FAILED",u,!0)}}return s}tG.composeScalar=yce});var iG=q(rG=>{"use strict";function wce(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}rG.emptyScalarPosition=wce});var aG=q(CT=>{"use strict";var kce=Xf(),_ce=Ze(),$ce=Zz(),oG=nG(),Sce=Eu(),xce=iG(),Ece={composeNode:sG,composeEmptyNode:RT};function sG(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(t.type){case"alias":l=Tce(e,t,i),(a||c)&&i(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":l=oG.composeScalar(e,t,c,i),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=$ce.composeCollection(Ece,e,t,n,i),a&&(l.anchor=a.source.substring(1))}catch(d){let p=d instanceof Error?d.message:String(d);i(t,"RESOURCE_EXHAUSTION",p)}break;default:{let d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=RT(e,t.offset,void 0,null,n,i)),a&&l.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!_ce.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(t.type==="scalar"&&t.source===""?l.comment=s:l.commentBefore=s),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function RT(e,t,n,i,{spaceBefore:r,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:xce.emptyScalarPosition(t,n,i),indent:-1,source:""},d=oG.composeScalar(e,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Tce({options:e},{offset:t,source:n,end:i},r){let o=new kce.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+n.length,a=Sce.resolveEnd(i,s,e.strict,r);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}CT.composeEmptyNode=RT;CT.composeNode=sG});var uG=q(lG=>{"use strict";var Ice=gm(),cG=aG(),Ace=Eu(),Rce=vm();function Cce(e,t,{offset:n,start:i,value:r,end:o},s){let a=Object.assign({_directives:t},e),c=new Ice.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Rce.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?cG.composeNode(l,r,u,s):cG.composeEmptyNode(l,u.end,i,null,u,s);let d=c.contents.range[2],p=Ace.resolveEnd(o,d,!1,s);return p.comment&&(c.comment=p.comment),c.range=[n,d,p.offset],c}lG.composeDoc=Cce});var PT=q(fG=>{"use strict";var Nce=require("process"),Pce=bE(),Dce=gm(),wm=bm(),dG=Ze(),Oce=uG(),Mce=Eu();function km(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:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function pG(e){let t="",n=!1,i=!1;for(let r=0;r{let s=wm(n);o?this.warnings.push(new vm.YAMLWarning(s,i,r)):this.errors.push(new vm.YAMLParseError(s,i,r))},this.directives=new Tce.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=iG(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment} -${i}`:i;else if(r||t.directives.docStart||!o)t.commentBefore=i;else if(rG.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];rG.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i} +`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}var NT=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let s=km(n);o?this.warnings.push(new wm.YAMLWarning(s,i,r)):this.errors.push(new wm.YAMLParseError(s,i,r))},this.directives=new Pce.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=pG(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment} +${i}`:i;else if(r||t.directives.docStart||!o)t.commentBefore=i;else if(dG.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];dG.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i} ${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i} -${s}`:i}}if(n){for(let o=0;o{let o=wm(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Ace.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Rce.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new vm.YAMLParseError(wm(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new Ice.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};oG.Composer=xT});var cG=q(Kb=>{"use strict";var Nce=wT(),Cce=$T(),Pce=ym(),sG=rm();function Dce(e,t=!0,n){if(e){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new Pce.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Cce.resolveFlowScalar(e,t,i);case"block-scalar":return Nce.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function Oce(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=t,a=sG.stringifyString({type:s,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:i,source:` +${s}`:i}}if(n){for(let o=0;o{let o=km(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=Oce.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new wm.YAMLParseError(km(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new wm.YAMLParseError(km(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Mce.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new wm.YAMLParseError(km(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new Dce.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};fG.Composer=NT});var hG=q(tv=>{"use strict";var Lce=TT(),Fce=AT(),Uce=bm(),mG=im();function jce(e,t=!0,n){if(e){let i=(r,o,s)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(a,o,s);else throw new Uce.YAMLParseError([a,a+1],o,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Fce.resolveFlowScalar(e,t,i);case"block-scalar":return Lce.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function zce(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:s="PLAIN"}=t,a=mG.stringifyString({type:s,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:i,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` -`,p=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return aG(p,c)||p.push({type:"newline",offset:-1,indent:i,source:` -`}),{type:"block-scalar",offset:o,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:c};default:return{type:"scalar",offset:o,indent:i,source:a,end:c}}}function Mce(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=sG.stringifyString({type:s,value:t},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Lce(e,c);break;case'"':TT(e,c,"double-quoted-scalar");break;case"'":TT(e,c,"single-quoted-scalar");break;default:TT(e,c,"scalar")}}function Lce(e,t){let n=t.indexOf(` +`,p=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return gG(p,c)||p.push({type:"newline",offset:-1,indent:i,source:` +`}),{type:"block-scalar",offset:o,indent:i,props:p,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:c};default:return{type:"scalar",offset:o,indent:i,source:a,end:c}}}function Gce(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:s}=n,a="indent"in e?e.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=mG.stringifyString({type:s,value:t},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Vce(e,c);break;case'"':DT(e,c,"double-quoted-scalar");break;case"'":DT(e,c,"single-quoted-scalar");break;default:DT(e,c,"scalar")}}function Vce(e,t){let n=t.indexOf(` `),i=t.substring(0,n),r=t.substring(n+1)+` -`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,e.source=r}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];aG(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` -`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:r})}}function aG(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function TT(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let i=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let o of i)o.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` -`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}Kb.createScalarToken=Oce;Kb.resolveAsScalar=Dce;Kb.setScalarValue=Mce});var uG=q(lG=>{"use strict";var Fce=e=>"type"in e?Zb(e):Jb(e);function Zb(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=Zb(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=Jb(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=Jb(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=Jb(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function Jb({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=Zb(t)),n)for(let o of n)r+=o.source;return i&&(r+=Zb(i)),r}lG.stringify=Fce});var mG=q(fG=>{"use strict";var IT=Symbol("break visit"),Uce=Symbol("skip children"),dG=Symbol("remove item");function mc(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),pG(Object.freeze([]),e,t)}mc.BREAK=IT;mc.SKIP=Uce;mc.REMOVE=dG;mc.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};mc.parentCollection=(e,t)=>{let n=mc.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function pG(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let s=0;s{"use strict";var AT=cG(),jce=uG(),zce=mG(),RT="\uFEFF",NT="",CT="",PT="",Gce=e=>!!e&&"items"in e,Vce=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Bce(e){switch(e){case RT:return"";case NT:return"";case CT:return"";case PT:return"";default:return JSON.stringify(e)}}function qce(e){switch(e){case RT:return"byte-order-mark";case NT:return"doc-mode";case CT:return"flow-error-end";case PT:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,e.source=r}else{let{offset:o}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];gG(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` +`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:r})}}function gG(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function DT(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let i=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let o of i)o.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` +`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}tv.createScalarToken=zce;tv.resolveAsScalar=jce;tv.setScalarValue=Gce});var bG=q(yG=>{"use strict";var Bce=e=>"type"in e?rv(e):nv(e);function rv(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=rv(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=nv(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=nv(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=nv(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function nv({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=rv(t)),n)for(let o of n)r+=o.source;return i&&(r+=rv(i)),r}yG.stringify=Bce});var _G=q(kG=>{"use strict";var OT=Symbol("break visit"),qce=Symbol("skip children"),vG=Symbol("remove item");function mc(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),wG(Object.freeze([]),e,t)}mc.BREAK=OT;mc.SKIP=qce;mc.REMOVE=vG;mc.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};mc.parentCollection=(e,t)=>{let n=mc.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function wG(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let s=0;s{"use strict";var MT=hG(),Wce=bG(),Kce=_G(),LT="\uFEFF",FT="",UT="",jT="",Hce=e=>!!e&&"items"in e,Jce=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Zce(e){switch(e){case LT:return"";case FT:return"";case UT:return"";case jT:return"";default:return JSON.stringify(e)}}function Yce(e){switch(e){case LT:return"byte-order-mark";case FT:return"doc-mode";case UT:return"flow-error-end";case jT:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`: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" ":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}xr.createScalarToken=AT.createScalarToken;xr.resolveAsScalar=AT.resolveAsScalar;xr.setScalarValue=AT.setScalarValue;xr.stringify=jce.stringify;xr.visit=zce.visit;xr.BOM=RT;xr.DOCUMENT=NT;xr.FLOW_END=CT;xr.SCALAR=PT;xr.isCollection=Gce;xr.isScalar=Vce;xr.prettyToken=Bce;xr.tokenType=qce});var MT=q(hG=>{"use strict";var km=Yb();function Li(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var gG=new Set("0123456789ABCDEFabcdef"),Wce=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qb=new Set(",[]{}"),Hce=new Set(` ,[]{} -\r `),DT=e=>!e||Hce.has(e),OT=class{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(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`: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" ":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}$r.createScalarToken=MT.createScalarToken;$r.resolveAsScalar=MT.resolveAsScalar;$r.setScalarValue=MT.setScalarValue;$r.stringify=Wce.stringify;$r.visit=Kce.visit;$r.BOM=LT;$r.DOCUMENT=FT;$r.FLOW_END=UT;$r.SCALAR=jT;$r.isCollection=Hce;$r.isScalar=Jce;$r.prettyToken=Zce;$r.tokenType=Yce});var VT=q(SG=>{"use strict";var _m=iv();function Li(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var $G=new Set("0123456789ABCDEFabcdef"),Qce=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ov=new Set(",[]{}"),Xce=new Set(` ,[]{} +\r `),zT=e=>!e||Xce.has(e),GT=class{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(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){let r=this.buffer[i+t+1];if(r===` `||!r&&!this.atEnd)return t+i+1}return n===` `||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&Li(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Li(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Li(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);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(DT),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&ithis.indentValue&&!Li(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Li(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);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(zT),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Li(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case` `:t=o,n=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(` `,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===` `;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let o=t-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===` -`&&o>=this.pos&&o+1+n>a)t=o;else break}while(!0);return yield km.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(Li(o)||t&&Qb.has(o))break;n=i}else if(Li(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===` +`&&o>=this.pos&&o+1+n>a)t=o;else break}while(!0);return yield _m.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(Li(o)||t&&ov.has(o))break;n=i}else if(Li(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===` `?(i+=1,r=` -`,o=this.buffer[i+1]):n=i),o==="#"||t&&Qb.has(o))break;if(r===` -`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(t&&Qb.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield km.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(DT),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(Li(i)||n&&Qb.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Li(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Wce.has(n))n=this.buffer[++t];else if(n==="%"&&gG.has(this.buffer[t+1])&&gG.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===` +`,o=this.buffer[i+1]):n=i),o==="#"||t&&ov.has(o))break;if(r===` +`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(t&&ov.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield _m.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(zT),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(Li(i)||n&&ov.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Li(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Qce.has(n))n=this.buffer[++t];else if(n==="%"&&$G.has(this.buffer[t+1])&&$G.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};hG.Lexer=OT});var FT=q(yG=>{"use strict";var LT=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[o]{"use strict";var Kce=require("process"),bG=Yb(),Jce=MT();function Ms(e,t){for(let n=0;n=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ev(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&wG(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&vG(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};SG.Lexer=GT});var qT=q(xG=>{"use strict";var BT=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[o]{"use strict";var ele=require("process"),EG=iv(),tle=VT();function Ms(e,t){for(let n=0;n=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function av(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&IG(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&TG(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent=t.indent){let i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let a=0;at.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):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(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ms(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(kG(n.key)&&!Ms(n.sep,"newline")){let s=xu(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ms(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=xu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ms(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ms(n.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 i&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){ev(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ms(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Xb(i),o=xu(r);wG(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){av(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let s=[];for(let a=0;at.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):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(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ms(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(AG(n.key)&&!Ms(n.sep,"newline")){let s=Tu(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ms(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=Tu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Ms(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);r||n.value?(t.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(t);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ms(n.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 i&&t.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){av(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ms(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=sv(i),o=Tu(r);IG(t);let s=t.end.splice(1,t.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){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 n=Xb(t),i=xu(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Xb(t),i=xu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){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;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};$G.Parser=UT});var TG=q(_m=>{"use strict";var _G=ET(),Zce=mm(),$m=ym(),Yce=SE(),Qce=Ze(),Xce=FT(),SG=jT();function xG(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Xce.LineCounter||null,prettyErrors:t}}function ele(e,t={}){let{lineCounter:n,prettyErrors:i}=xG(t),r=new SG.Parser(n?.addNewLine),o=new _G.Composer(t),s=Array.from(o.compose(r.parse(e)));if(i&&n)for(let a of s)a.errors.forEach($m.prettifyError(e,n)),a.warnings.forEach($m.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function EG(e,t={}){let{lineCounter:n,prettyErrors:i}=xG(t),r=new SG.Parser(n?.addNewLine),o=new _G.Composer(t),s=null;for(let a of o.compose(r.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new $m.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach($m.prettifyError(e,n)),s.warnings.forEach($m.prettifyError(e,n))),s}function tle(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=EG(e,n);if(!r)return null;if(r.warnings.forEach(o=>Yce.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function nle(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return Qce.isDocument(e)&&!i?e.toString(n):new Zce.Document(e,i,n).toString(n)}_m.parse=tle;_m.parseAllDocuments=ele;_m.parseDocument=EG;_m.stringify=nle});var gc=q(lt=>{"use strict";var rle=ET(),ile=mm(),ole=sT(),zT=ym(),sle=Qf(),Ls=Ze(),ale=Cs(),cle=an(),lle=Ds(),ule=Os(),dle=Yb(),ple=MT(),fle=FT(),mle=jT(),tv=TG(),IG=Kf();lt.Composer=rle.Composer;lt.Document=ile.Document;lt.Schema=ole.Schema;lt.YAMLError=zT.YAMLError;lt.YAMLParseError=zT.YAMLParseError;lt.YAMLWarning=zT.YAMLWarning;lt.Alias=sle.Alias;lt.isAlias=Ls.isAlias;lt.isCollection=Ls.isCollection;lt.isDocument=Ls.isDocument;lt.isMap=Ls.isMap;lt.isNode=Ls.isNode;lt.isPair=Ls.isPair;lt.isScalar=Ls.isScalar;lt.isSeq=Ls.isSeq;lt.Pair=ale.Pair;lt.Scalar=cle.Scalar;lt.YAMLMap=lle.YAMLMap;lt.YAMLSeq=ule.YAMLSeq;lt.CST=dle;lt.Lexer=ple.Lexer;lt.LineCounter=fle.LineCounter;lt.Parser=mle.Parser;lt.parse=tv.parse;lt.parseAllDocuments=tv.parseAllDocuments;lt.parseDocument=tv.parseDocument;lt.stringify=tv.stringify;lt.visit=IG.visit;lt.visitAsync=IG.visitAsync});var hd=q((kKe,S4)=>{"use strict";var dge="2.0.0",pge=Number.MAX_SAFE_INTEGER||9007199254740991,fge=16,mge=250,gge=["major","premajor","minor","preminor","patch","prepatch","prerelease"];S4.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fge,MAX_SAFE_BUILD_LENGTH:mge,MAX_SAFE_INTEGER:pge,RELEASE_TYPES:gge,SEMVER_SPEC_VERSION:dge,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vg=q(($Ke,x4)=>{"use strict";var hge=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};x4.exports=hge});var yd=q((ho,E4)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:OC,MAX_SAFE_BUILD_LENGTH:yge,MAX_LENGTH:bge}=hd(),vge=vg();ho=E4.exports={};var wge=ho.re=[],kge=ho.safeRe=[],ue=ho.src=[],$ge=ho.safeSrc=[],de=ho.t={},_ge=0,MC="[a-zA-Z0-9-]",Sge=[["\\s",1],["\\d",bge],[MC,yge]],xge=e=>{for(let[t,n]of Sge)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},Fe=(e,t,n)=>{let i=xge(t),r=_ge++;vge(e,r,t),de[e]=r,ue[r]=t,$ge[r]=i,wge[r]=new RegExp(t,n?"g":void 0),kge[r]=new RegExp(i,n?"g":void 0)};Fe("NUMERICIDENTIFIER","0|[1-9]\\d*");Fe("NUMERICIDENTIFIERLOOSE","\\d+");Fe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${MC}*`);Fe("MAINVERSION",`(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})`);Fe("MAINVERSIONLOOSE",`(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASEIDENTIFIER",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIER]})`);Fe("PRERELEASEIDENTIFIERLOOSE",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIERLOOSE]})`);Fe("PRERELEASE",`(?:-(${ue[de.PRERELEASEIDENTIFIER]}(?:\\.${ue[de.PRERELEASEIDENTIFIER]})*))`);Fe("PRERELEASELOOSE",`(?:-?(${ue[de.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ue[de.PRERELEASEIDENTIFIERLOOSE]})*))`);Fe("BUILDIDENTIFIER",`${MC}+`);Fe("BUILD",`(?:\\+(${ue[de.BUILDIDENTIFIER]}(?:\\.${ue[de.BUILDIDENTIFIER]})*))`);Fe("FULLPLAIN",`v?${ue[de.MAINVERSION]}${ue[de.PRERELEASE]}?${ue[de.BUILD]}?`);Fe("FULL",`^${ue[de.FULLPLAIN]}$`);Fe("LOOSEPLAIN",`[v=\\s]*${ue[de.MAINVERSIONLOOSE]}${ue[de.PRERELEASELOOSE]}?${ue[de.BUILD]}?`);Fe("LOOSE",`^${ue[de.LOOSEPLAIN]}$`);Fe("GTLT","((?:<|>)?=?)");Fe("XRANGEIDENTIFIERLOOSE",`${ue[de.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Fe("XRANGEIDENTIFIER",`${ue[de.NUMERICIDENTIFIER]}|x|X|\\*`);Fe("XRANGEPLAIN",`[v=\\s]*(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:${ue[de.PRERELEASE]})?${ue[de.BUILD]}?)?)?`);Fe("XRANGEPLAINLOOSE",`[v=\\s]*(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:${ue[de.PRERELEASELOOSE]})?${ue[de.BUILD]}?)?)?`);Fe("XRANGE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAIN]}$`);Fe("XRANGELOOSE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAINLOOSE]}$`);Fe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${OC}})(?:\\.(\\d{1,${OC}}))?(?:\\.(\\d{1,${OC}}))?`);Fe("COERCE",`${ue[de.COERCEPLAIN]}(?:$|[^\\d])`);Fe("COERCEFULL",ue[de.COERCEPLAIN]+`(?:${ue[de.PRERELEASE]})?(?:${ue[de.BUILD]})?(?:$|[^\\d])`);Fe("COERCERTL",ue[de.COERCE],!0);Fe("COERCERTLFULL",ue[de.COERCEFULL],!0);Fe("LONETILDE","(?:~>?)");Fe("TILDETRIM",`(\\s*)${ue[de.LONETILDE]}\\s+`,!0);ho.tildeTrimReplace="$1~";Fe("TILDE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAIN]}$`);Fe("TILDELOOSE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAINLOOSE]}$`);Fe("LONECARET","(?:\\^)");Fe("CARETTRIM",`(\\s*)${ue[de.LONECARET]}\\s+`,!0);ho.caretTrimReplace="$1^";Fe("CARET",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAIN]}$`);Fe("CARETLOOSE",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAINLOOSE]}$`);Fe("COMPARATORLOOSE",`^${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]})$|^$`);Fe("COMPARATOR",`^${ue[de.GTLT]}\\s*(${ue[de.FULLPLAIN]})$|^$`);Fe("COMPARATORTRIM",`(\\s*)${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]}|${ue[de.XRANGEPLAIN]})`,!0);ho.comparatorTrimReplace="$1$2$3";Fe("HYPHENRANGE",`^\\s*(${ue[de.XRANGEPLAIN]})\\s+-\\s+(${ue[de.XRANGEPLAIN]})\\s*$`);Fe("HYPHENRANGELOOSE",`^\\s*(${ue[de.XRANGEPLAINLOOSE]})\\s+-\\s+(${ue[de.XRANGEPLAINLOOSE]})\\s*$`);Fe("STAR","(<|>)?=?\\s*\\*");Fe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Fe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gk=q((_Ke,T4)=>{"use strict";var Ege=Object.freeze({loose:!0}),Tge=Object.freeze({}),Ige=e=>e?typeof e!="object"?Ege:e:Tge;T4.exports=Ige});var LC=q((SKe,R4)=>{"use strict";var I4=/^[0-9]+$/,A4=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eA4(t,e);R4.exports={compareIdentifiers:A4,rcompareIdentifiers:Age}});var On=q((xKe,C4)=>{"use strict";var hk=vg(),{MAX_LENGTH:N4,MAX_SAFE_INTEGER:yk}=hd(),{safeRe:bk,t:vk}=yd(),Rge=gk(),{compareIdentifiers:FC}=LC(),Nge=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let i=0;iN4)throw new TypeError(`version is longer than ${N4} characters`);hk("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=t.trim().match(n.loose?bk[vk.LOOSE]:bk[vk.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>yk||this.major<0)throw new TypeError("Invalid major version");if(this.minor>yk||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>yk||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let o=+r;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],r=t.prerelease[n];if(hk("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return FC(i,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let i=this.build[n],r=t.build[n];if(hk("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return FC(i,r)}while(++n)}inc(t,n,i){if(t.startsWith("pre")){if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let r=`-${n}`.match(this.options.loose?bk[vk.PRERELEASELOOSE]:bk[vk.PRERELEASE]);if(!r||r[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let r=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];if(i===!1&&(o=[n]),Nge(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};C4.exports=UC});var Xs=q((EKe,D4)=>{"use strict";var P4=On(),Cge=(e,t,n=!1)=>{if(e instanceof P4)return e;try{return new P4(e,t)}catch(i){if(!n)return null;throw i}};D4.exports=Cge});var M4=q((TKe,O4)=>{"use strict";var Pge=Xs(),Dge=(e,t)=>{let n=Pge(e,t);return n?n.version:null};O4.exports=Dge});var F4=q((IKe,L4)=>{"use strict";var Oge=Xs(),Mge=(e,t)=>{let n=Oge(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};L4.exports=Mge});var z4=q((AKe,j4)=>{"use strict";var U4=On(),Lge=(e,t,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new U4(e instanceof U4?e.version:e,n).inc(t,i,r).version}catch{return null}};j4.exports=Lge});var B4=q((RKe,V4)=>{"use strict";var G4=Xs(),Fge=(e,t)=>{let n=G4(e,null,!0),i=G4(t,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return n.major!==i.major?u+"major":n.minor!==i.minor?u+"minor":n.patch!==i.patch?u+"patch":"prerelease"};V4.exports=Fge});var W4=q((NKe,q4)=>{"use strict";var Uge=On(),jge=(e,t)=>new Uge(e,t).major;q4.exports=jge});var K4=q((CKe,H4)=>{"use strict";var zge=On(),Gge=(e,t)=>new zge(e,t).minor;H4.exports=Gge});var Z4=q((PKe,J4)=>{"use strict";var Vge=On(),Bge=(e,t)=>new Vge(e,t).patch;J4.exports=Bge});var Q4=q((DKe,Y4)=>{"use strict";var qge=Xs(),Wge=(e,t)=>{let n=qge(e,t);return n&&n.prerelease.length?n.prerelease:null};Y4.exports=Wge});var ui=q((OKe,e6)=>{"use strict";var X4=On(),Hge=(e,t,n)=>new X4(e,n).compare(new X4(t,n));e6.exports=Hge});var n6=q((MKe,t6)=>{"use strict";var Kge=ui(),Jge=(e,t,n)=>Kge(t,e,n);t6.exports=Jge});var i6=q((LKe,r6)=>{"use strict";var Zge=ui(),Yge=(e,t)=>Zge(e,t,!0);r6.exports=Yge});var wk=q((FKe,s6)=>{"use strict";var o6=On(),Qge=(e,t,n)=>{let i=new o6(e,n),r=new o6(t,n);return i.compare(r)||i.compareBuild(r)};s6.exports=Qge});var c6=q((UKe,a6)=>{"use strict";var Xge=wk(),ehe=(e,t)=>e.sort((n,i)=>Xge(n,i,t));a6.exports=ehe});var u6=q((jKe,l6)=>{"use strict";var the=wk(),nhe=(e,t)=>e.sort((n,i)=>the(i,n,t));l6.exports=nhe});var wg=q((zKe,d6)=>{"use strict";var rhe=ui(),ihe=(e,t,n)=>rhe(e,t,n)>0;d6.exports=ihe});var kk=q((GKe,p6)=>{"use strict";var ohe=ui(),she=(e,t,n)=>ohe(e,t,n)<0;p6.exports=she});var jC=q((VKe,f6)=>{"use strict";var ahe=ui(),che=(e,t,n)=>ahe(e,t,n)===0;f6.exports=che});var zC=q((BKe,m6)=>{"use strict";var lhe=ui(),uhe=(e,t,n)=>lhe(e,t,n)!==0;m6.exports=uhe});var $k=q((qKe,g6)=>{"use strict";var dhe=ui(),phe=(e,t,n)=>dhe(e,t,n)>=0;g6.exports=phe});var _k=q((WKe,h6)=>{"use strict";var fhe=ui(),mhe=(e,t,n)=>fhe(e,t,n)<=0;h6.exports=mhe});var GC=q((HKe,y6)=>{"use strict";var ghe=jC(),hhe=zC(),yhe=wg(),bhe=$k(),vhe=kk(),whe=_k(),khe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return ghe(e,n,i);case"!=":return hhe(e,n,i);case">":return yhe(e,n,i);case">=":return bhe(e,n,i);case"<":return vhe(e,n,i);case"<=":return whe(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};y6.exports=khe});var v6=q((KKe,b6)=>{"use strict";var $he=On(),_he=Xs(),{safeRe:Sk,t:xk}=yd(),She=(e,t)=>{if(e instanceof $he)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Sk[xk.COERCEFULL]:Sk[xk.COERCE]);else{let c=t.includePrerelease?Sk[xk.COERCERTLFULL]:Sk[xk.COERCERTL],l;for(;(l=c.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||l.index+l[0].length!==n.index+n[0].length)&&(n=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(n===null)return null;let i=n[2],r=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return _he(`${i}.${r}.${o}${s}${a}`,t)};b6.exports=She});var k6=q((JKe,w6)=>{"use strict";var xhe=Xs(),Ehe=hd(),The=On(),Ihe=(e,t,n)=>{if(!Ehe.RELEASE_TYPES.includes(t))return null;let i=Ahe(e,n);return i&&Rhe(i,t)},Ahe=(e,t)=>{let n=e instanceof The?e.version:e;return xhe(n,t)},Rhe=(e,t)=>{if(Nhe(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Nhe=e=>e.startsWith("pre");w6.exports=Ihe});var _6=q((ZKe,$6)=>{"use strict";var VC=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}};$6.exports=VC});var di=q((YKe,T6)=>{"use strict";var Che=/\s+/g,BC=class e{constructor(t,n){if(n=Dhe(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof qC)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(Che," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!x6(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&Vhe(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let n=this.set[t];for(let i=0;i0&&(this.formatted+=" "),this.formatted+=n[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(Ghe,"");let i=((this.options.includePrerelease&&jhe)|(this.options.loose&&zhe))+":"+t,r=S6.get(i);if(r)return r;let o=this.options.loose,s=o?cr[Mn.HYPHENRANGELOOSE]:cr[Mn.HYPHENRANGE];t=t.replace(s,eye(this.options.includePrerelease)),Tt("hyphen replace",t),t=t.replace(cr[Mn.COMPARATORTRIM],Lhe),Tt("comparator trim",t),t=t.replace(cr[Mn.TILDETRIM],Fhe),Tt("tilde trim",t),t=t.replace(cr[Mn.CARETTRIM],Uhe),Tt("caret trim",t);let a=t.split(" ").map(d=>Bhe(d,this.options)).join(" ").split(/\s+/).map(d=>Xhe(d,this.options));o&&(a=a.filter(d=>(Tt("loose invalid filter",d,this.options),!!d.match(cr[Mn.COMPARATORLOOSE])))),Tt("range list",a);let c=new Map,l=a.map(d=>new qC(d,this.options));for(let d of l){if(x6(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return S6.set(i,u),u}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>E6(i,n)&&t.set.some(r=>E6(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Ohe(t,this.options)}catch{return!1}for(let n=0;ne.value==="<0.0.0-0",Vhe=e=>e.value==="",E6=(e,t)=>{let n=!0,i=e.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,t)),r=i.pop();return n},Bhe=(e,t)=>(e=e.replace(cr[Mn.BUILD],""),Tt("comp",e,t),e=Khe(e,t),Tt("caret",e),e=Whe(e,t),Tt("tildes",e),e=Zhe(e,t),Tt("xrange",e),e=Qhe(e,t),Tt("stars",e),e),bn=e=>!e||e.toLowerCase()==="x"||e==="*",qhe=(e,t,n)=>bn(e)&&!bn(t)||bn(t)&&n&&!bn(n),Whe=(e,t)=>e.trim().split(/\s+/).map(n=>Hhe(n,t)).join(" "),Hhe=(e,t)=>{let n=t.loose?cr[Mn.TILDELOOSE]:cr[Mn.TILDE],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("tilde",e,r,o,s,a,c);let l;return bn(o)?l="":bn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:bn(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(Tt("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Tt("tilde return",l),l})},Khe=(e,t)=>e.trim().split(/\s+/).map(n=>Jhe(n,t)).join(" "),Jhe=(e,t)=>{Tt("caret",e,t);let n=t.loose?cr[Mn.CARETLOOSE]:cr[Mn.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("caret",e,r,o,s,a,c);let l;return bn(o)?l="":bn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:bn(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(Tt("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Tt("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Tt("caret return",l),l})},Zhe=(e,t)=>(Tt("replaceXRanges",e,t),e.split(/\s+/).map(n=>Yhe(n,t)).join(" ")),Yhe=(e,t)=>{e=e.trim();let n=t.loose?cr[Mn.XRANGELOOSE]:cr[Mn.XRANGE];return e.replace(n,(i,r,o,s,a,c)=>{if(Tt("xRange",e,i,r,o,s,a,c),qhe(o,s,a))return e;let l=bn(o),u=l||bn(s),d=u||bn(a),p=d;return r==="="&&p&&(r=""),c=t.includePrerelease?"-0":"",l?r===">"||r==="<"?i="<0.0.0-0":i="*":r&&p?(u&&(s=0),a=0,r===">"?(r=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",u?o=+o+1:s=+s+1),r==="<"&&(c="-0"),i=`${r+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Tt("xRange return",i),i})},Qhe=(e,t)=>(Tt("replaceStars",e,t),e.trim().replace(cr[Mn.STAR],"")),Xhe=(e,t)=>(Tt("replaceGTE0",e,t),e.trim().replace(cr[t.includePrerelease?Mn.GTE0PRE:Mn.GTE0],"")),eye=e=>(t,n,i,r,o,s,a,c,l,u,d,p)=>(bn(i)?n="":bn(r)?n=`>=${i}.0.0${e?"-0":""}`:bn(o)?n=`>=${i}.${r}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,bn(l)?c="":bn(u)?c=`<${+l+1}.0.0-0`:bn(d)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${d}-${p}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),tye=(e,t,n)=>{for(let i=0;i0){let r=e[i].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}});var kg=q((QKe,P6)=>{"use strict";var $g=Symbol("SemVer ANY"),KC=class e{static get ANY(){return $g}constructor(t,n){if(n=I6(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),HC("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===$g?this.value="":this.value=this.operator+this.semver.version,HC("comp",this)}parse(t){let n=this.options.loose?A6[R6.COMPARATORLOOSE]:A6[R6.COMPARATOR],i=t.match(n);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new N6(i[2],this.options.loose):this.semver=$g}toString(){return this.value}test(t){if(HC("Comparator.test",t,this.options.loose),this.semver===$g||t===$g)return!0;if(typeof t=="string")try{t=new N6(t,this.options)}catch{return!1}return WC(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new C6(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new C6(this.value,n).test(t.semver):(n=I6(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||WC(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||WC(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};P6.exports=KC;var I6=gk(),{safeRe:A6,t:R6}=yd(),WC=GC(),HC=vg(),N6=On(),C6=di()});var _g=q((XKe,D6)=>{"use strict";var nye=di(),rye=(e,t,n)=>{try{t=new nye(t,n)}catch{return!1}return t.test(e)};D6.exports=rye});var M6=q((eJe,O6)=>{"use strict";var iye=di(),oye=(e,t)=>new iye(e,t).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));O6.exports=oye});var F6=q((tJe,L6)=>{"use strict";var sye=On(),aye=di(),cye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new aye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new sye(i,n))}),i};L6.exports=cye});var j6=q((nJe,U6)=>{"use strict";var lye=On(),uye=di(),dye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new uye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new lye(i,n))}),i};U6.exports=dye});var V6=q((rJe,G6)=>{"use strict";var JC=On(),pye=di(),z6=wg(),fye=(e,t)=>{e=new pye(e,t);let n=new JC("0.0.0");if(e.test(n)||(n=new JC("0.0.0-0"),e.test(n)))return n;n=null;for(let i=0;i{let a=new JC(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||z6(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||z6(n,o))&&(n=o)}return n&&e.test(n)?n:null};G6.exports=fye});var q6=q((iJe,B6)=>{"use strict";var mye=di(),gye=(e,t)=>{try{return new mye(e,t).range||"*"}catch{return null}};B6.exports=gye});var Ek=q((oJe,J6)=>{"use strict";var hye=On(),K6=kg(),{ANY:yye}=K6,bye=di(),vye=_g(),W6=wg(),H6=kk(),wye=_k(),kye=$k(),$ye=(e,t,n,i)=>{e=new hye(e,i),t=new bye(t,i);let r,o,s,a,c;switch(n){case">":r=W6,o=wye,s=H6,a=">",c=">=";break;case"<":r=H6,o=kye,s=W6,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vye(e,t,i))return!1;for(let l=0;l{f.semver===yye&&(f=new K6(">=0.0.0")),d=d||f,p=p||f,r(f.semver,d.semver,i)?d=f:s(f.semver,p.semver,i)&&(p=f)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};J6.exports=$ye});var Y6=q((sJe,Z6)=>{"use strict";var _ye=Ek(),Sye=(e,t,n)=>_ye(e,t,">",n);Z6.exports=Sye});var X6=q((aJe,Q6)=>{"use strict";var xye=Ek(),Eye=(e,t,n)=>xye(e,t,"<",n);Q6.exports=Eye});var nW=q((cJe,tW)=>{"use strict";var eW=di(),Tye=(e,t,n)=>(e=new eW(e,n),t=new eW(t,n),e.intersects(t,n));tW.exports=Tye});var iW=q((lJe,rW)=>{"use strict";var Iye=_g(),Aye=ui();rW.exports=(e,t,n)=>{let i=[],r=null,o=null,s=e.sort((u,d)=>Aye(u,d,n));for(let u of s)Iye(u,t,n)?(o=u,r||(r=u)):(o&&i.push([r,o]),o=null,r=null);r&&i.push([r,null]);let a=[];for(let[u,d]of i)u===d?a.push(u):!d&&u===s[0]?a.push("*"):d?u===s[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var oW=di(),QC=kg(),{ANY:ZC}=QC,YC=_g(),XC=ui(),Rye=(e,t,n={})=>{if(e===t)return!0;e=new oW(e,n),t=new oW(t,n);let i=!1;e:for(let r of e.set){for(let o of t.set){let s=Cye(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},Nye=[new QC(">=0.0.0-0")],sW=[new QC(">=0.0.0")],Cye=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ZC){if(t.length===1&&t[0].semver===ZC)return!0;n.includePrerelease?e=Nye:e=sW}if(t.length===1&&t[0].semver===ZC){if(n.includePrerelease)return!0;t=sW}let i=new Set,r,o;for(let f of e)f.operator===">"||f.operator===">="?r=aW(r,f,n):f.operator==="<"||f.operator==="<="?o=cW(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=XC(r.semver,o.semver,n),s>0)return null;if(s===0&&(r.operator!==">="||o.operator!=="<="))return null}for(let f of i){if(r&&!YC(f,String(r),n)||o&&!YC(f,String(o),n))return null;for(let m of t)if(!YC(f,String(m),n))return!1;return!0}let a,c,l,u,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",r){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator===">"||f.operator===">="){if(a=aW(r,f,n),a===f&&a!==r)return!1}else if(r.operator===">="&&!f.test(r.semver))return!1}if(o){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=cW(o,f,n),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||r)&&s!==0)return!1}return!(r&&l&&!o&&s!==0||o&&u&&!r&&s!==0||p||d)},aW=(e,t,n)=>{if(!e)return t;let i=XC(e.semver,t.semver,n);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},cW=(e,t,n)=>{if(!e)return t;let i=XC(e.semver,t.semver,n);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};lW.exports=Rye});var Dc=q((dJe,fW)=>{"use strict";var eP=yd(),dW=hd(),Pye=On(),pW=LC(),Dye=Xs(),Oye=M4(),Mye=F4(),Lye=z4(),Fye=B4(),Uye=W4(),jye=K4(),zye=Z4(),Gye=Q4(),Vye=ui(),Bye=n6(),qye=i6(),Wye=wk(),Hye=c6(),Kye=u6(),Jye=wg(),Zye=kk(),Yye=jC(),Qye=zC(),Xye=$k(),ebe=_k(),tbe=GC(),nbe=v6(),rbe=k6(),ibe=kg(),obe=di(),sbe=_g(),abe=M6(),cbe=F6(),lbe=j6(),ube=V6(),dbe=q6(),pbe=Ek(),fbe=Y6(),mbe=X6(),gbe=nW(),hbe=iW(),ybe=uW();fW.exports={parse:Dye,valid:Oye,clean:Mye,inc:Lye,diff:Fye,major:Uye,minor:jye,patch:zye,prerelease:Gye,compare:Vye,rcompare:Bye,compareLoose:qye,compareBuild:Wye,sort:Hye,rsort:Kye,gt:Jye,lt:Zye,eq:Yye,neq:Qye,gte:Xye,lte:ebe,cmp:tbe,coerce:nbe,truncate:rbe,Comparator:ibe,Range:obe,satisfies:sbe,toComparators:abe,maxSatisfying:cbe,minSatisfying:lbe,minVersion:ube,validRange:dbe,outside:pbe,gtr:fbe,ltr:mbe,intersects:gbe,simplifyRange:hbe,subset:ybe,SemVer:Pye,re:eP.re,src:eP.src,tokens:eP.t,SEMVER_SPEC_VERSION:dW.SEMVER_SPEC_VERSION,RELEASE_TYPES:dW.RELEASE_TYPES,compareIdentifiers:pW.compareIdentifiers,rcompareIdentifiers:pW.rcompareIdentifiers}});var AZ=q((qtt,IZ)=>{IZ.exports=require("util").inspect});var JZ=q((Wtt,KZ)=>{var KD=typeof Map=="function"&&Map.prototype,UD=Object.getOwnPropertyDescriptor&&KD?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,D$=KD&&UD&&typeof UD.get=="function"?UD.get:null,RZ=KD&&Map.prototype.forEach,JD=typeof Set=="function"&&Set.prototype,jD=Object.getOwnPropertyDescriptor&&JD?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,O$=JD&&jD&&typeof jD.get=="function"?jD.get:null,NZ=JD&&Set.prototype.forEach,fEe=typeof WeakMap=="function"&&WeakMap.prototype,dh=fEe?WeakMap.prototype.has:null,mEe=typeof WeakSet=="function"&&WeakSet.prototype,ph=mEe?WeakSet.prototype.has:null,gEe=typeof WeakRef=="function"&&WeakRef.prototype,CZ=gEe?WeakRef.prototype.deref:null,hEe=Boolean.prototype.valueOf,yEe=Object.prototype.toString,bEe=Function.prototype.toString,vEe=String.prototype.match,ZD=String.prototype.slice,Ia=String.prototype.replace,wEe=String.prototype.toUpperCase,PZ=String.prototype.toLowerCase,GZ=RegExp.prototype.test,DZ=Array.prototype.concat,xo=Array.prototype.join,kEe=Array.prototype.slice,OZ=Math.floor,VD=typeof BigInt=="function"?BigInt.prototype.valueOf:null,zD=Object.getOwnPropertySymbols,BD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Qn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Wd||!0)?Symbol.toStringTag:null,VZ=Object.prototype.propertyIsEnumerable,MZ=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function LZ(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||GZ.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var i=e<0?-OZ(-e):OZ(e);if(i!==e){var r=String(i),o=ZD.call(t,r.length+1);return Ia.call(r,n,"$&_")+"."+Ia.call(Ia.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ia.call(t,n,"$&_")}var qD=AZ(),FZ=qD.custom,UZ=qZ(FZ)?FZ:null;KZ.exports=function e(t,n,i,r){var o=n||{};if(Ta(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ta(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Ta(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ta(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ta(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return HZ(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?LZ(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?LZ(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof t=="object")return WD(t)?"[Array]":"[Object]";var d=UEe(o,i);if(typeof r>"u")r=[];else if(WZ(r,t)>=0)return"[Circular]";function p(K,te,D){if(te&&(r=kEe.call(r),r.push(te)),D){var X={depth:o.depth};return Ta(o,"quoteStyle")&&(X.quoteStyle=o.quoteStyle),e(K,X,i+1,r)}return e(K,o,i+1,r)}if(typeof t=="function"&&!jZ(t)){var f=REe(t),m=P$(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(m.length>0?" { "+xo.call(m,", ")+" }":"")}if(qZ(t)){var g=Wd?Ia.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):BD.call(t);return typeof t=="object"&&!Wd?uh(g):g}if(MEe(t)){for(var h="<"+PZ.call(String(t.nodeName)),b=t.attributes||[],y=0;y",h}if(WD(t)){if(t.length===0)return"[]";var w=P$(t,p);return d&&!FEe(w)?"["+HD(w,d)+"]":"[ "+xo.call(w,", ")+" ]"}if(SEe(t)){var k=P$(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!VZ.call(t,"cause")?"{ ["+String(t)+"] "+xo.call(DZ.call("[cause]: "+p(t.cause),k),", ")+" }":k.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+xo.call(k,", ")+" }"}if(typeof t=="object"&&s){if(UZ&&typeof t[UZ]=="function"&&qD)return qD(t,{depth:u-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(NEe(t)){var _=[];return RZ&&RZ.call(t,function(K,te){_.push(p(te,t,!0)+" => "+p(K,t))}),zZ("Map",D$.call(t),_,d)}if(DEe(t)){var S=[];return NZ&&NZ.call(t,function(K){S.push(p(K,t))}),zZ("Set",O$.call(t),S,d)}if(CEe(t))return GD("WeakMap");if(OEe(t))return GD("WeakSet");if(PEe(t))return GD("WeakRef");if(EEe(t))return uh(p(Number(t)));if(IEe(t))return uh(p(VD.call(t)));if(TEe(t))return uh(hEe.call(t));if(xEe(t))return uh(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!_Ee(t)&&!jZ(t)){var x=P$(t,p),E=MZ?MZ(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",A=!E&&Qn&&Object(t)===t&&Qn in t?ZD.call(Aa(t),8,-1):T?"Object":"",L=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",F=L+(A||T?"["+xo.call(DZ.call([],A||[],T||[]),": ")+"] ":"");return x.length===0?F+"{}":d?F+"{"+HD(x,d)+"}":F+"{ "+xo.call(x,", ")+" }"}return String(t)};function BZ(e,t,n){var i=(n.quoteStyle||t)==="double"?'"':"'";return i+e+i}function $Ee(e){return Ia.call(String(e),/"/g,""")}function WD(e){return Aa(e)==="[object Array]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function _Ee(e){return Aa(e)==="[object Date]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function jZ(e){return Aa(e)==="[object RegExp]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function SEe(e){return Aa(e)==="[object Error]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function xEe(e){return Aa(e)==="[object String]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function EEe(e){return Aa(e)==="[object Number]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function TEe(e){return Aa(e)==="[object Boolean]"&&(!Qn||!(typeof e=="object"&&Qn in e))}function qZ(e){if(Wd)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!BD)return!1;try{return BD.call(e),!0}catch{}return!1}function IEe(e){if(!e||typeof e!="object"||!VD)return!1;try{return VD.call(e),!0}catch{}return!1}var AEe=Object.prototype.hasOwnProperty||function(e){return e in this};function Ta(e,t){return AEe.call(e,t)}function Aa(e){return yEe.call(e)}function REe(e){if(e.name)return e.name;var t=vEe.call(bEe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function WZ(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return HZ(ZD.call(e,0,t.maxStringLength),t)+i}var r=Ia.call(Ia.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,LEe);return BZ(r,"single",t)}function LEe(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+wEe.call(t.toString(16))}function uh(e){return"Object("+e+")"}function GD(e){return e+" { ? }"}function zZ(e,t,n,i){var r=i?HD(n,i):xo.call(n,", ");return e+" ("+t+") {"+r+"}"}function FEe(e){for(var t=0;t=0)return!1;return!0}function UEe(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=xo.call(Array(e.indent+1)," ");else return null;return{base:n,prev:xo.call(Array(t+1),n)}}function HD(e,t){if(e.length===0)return"";var n=` +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){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 n=sv(t),i=Tu(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=sv(t),i=Tu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){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;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};RG.Parser=WT});var OG=q(Sm=>{"use strict";var CG=PT(),nle=gm(),$m=bm(),rle=CE(),ile=Ze(),ole=qT(),NG=KT();function PG(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new ole.LineCounter||null,prettyErrors:t}}function sle(e,t={}){let{lineCounter:n,prettyErrors:i}=PG(t),r=new NG.Parser(n?.addNewLine),o=new CG.Composer(t),s=Array.from(o.compose(r.parse(e)));if(i&&n)for(let a of s)a.errors.forEach($m.prettifyError(e,n)),a.warnings.forEach($m.prettifyError(e,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function DG(e,t={}){let{lineCounter:n,prettyErrors:i}=PG(t),r=new NG.Parser(n?.addNewLine),o=new CG.Composer(t),s=null;for(let a of o.compose(r.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new $m.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(s.errors.forEach($m.prettifyError(e,n)),s.warnings.forEach($m.prettifyError(e,n))),s}function ale(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=DG(e,n);if(!r)return null;if(r.warnings.forEach(o=>rle.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function cle(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return ile.isDocument(e)&&!i?e.toString(n):new nle.Document(e,i,n).toString(n)}Sm.parse=ale;Sm.parseAllDocuments=sle;Sm.parseDocument=DG;Sm.stringify=cle});var gc=q(at=>{"use strict";var lle=PT(),ule=gm(),dle=fT(),HT=bm(),ple=Xf(),Ls=Ze(),fle=Ns(),mle=sn(),gle=Ds(),hle=Os(),yle=iv(),ble=VT(),vle=qT(),wle=KT(),cv=OG(),MG=Jf();at.Composer=lle.Composer;at.Document=ule.Document;at.Schema=dle.Schema;at.YAMLError=HT.YAMLError;at.YAMLParseError=HT.YAMLParseError;at.YAMLWarning=HT.YAMLWarning;at.Alias=ple.Alias;at.isAlias=Ls.isAlias;at.isCollection=Ls.isCollection;at.isDocument=Ls.isDocument;at.isMap=Ls.isMap;at.isNode=Ls.isNode;at.isPair=Ls.isPair;at.isScalar=Ls.isScalar;at.isSeq=Ls.isSeq;at.Pair=fle.Pair;at.Scalar=mle.Scalar;at.YAMLMap=gle.YAMLMap;at.YAMLSeq=hle.YAMLSeq;at.CST=yle;at.Lexer=ble.Lexer;at.LineCounter=vle.LineCounter;at.Parser=wle.Parser;at.parse=cv.parse;at.parseAllDocuments=cv.parseAllDocuments;at.parseDocument=cv.parseDocument;at.stringify=cv.stringify;at.visit=MG.visit;at.visitAsync=MG.visitAsync});var yd=q((IHe,R4)=>{"use strict";var bge="2.0.0",vge=Number.MAX_SAFE_INTEGER||9007199254740991,wge=16,kge=250,_ge=["major","premajor","minor","preminor","patch","prepatch","prerelease"];R4.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:wge,MAX_SAFE_BUILD_LENGTH:kge,MAX_SAFE_INTEGER:vge,RELEASE_TYPES:_ge,SEMVER_SPEC_VERSION:bge,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Eg=q((AHe,C4)=>{"use strict";var $ge=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};C4.exports=$ge});var bd=q((ho,N4)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:VN,MAX_SAFE_BUILD_LENGTH:Sge,MAX_LENGTH:xge}=yd(),Ege=Eg();ho=N4.exports={};var Tge=ho.re=[],Ige=ho.safeRe=[],ue=ho.src=[],Age=ho.safeSrc=[],de=ho.t={},Rge=0,BN="[a-zA-Z0-9-]",Cge=[["\\s",1],["\\d",xge],[BN,Sge]],Nge=e=>{for(let[t,n]of Cge)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},Le=(e,t,n)=>{let i=Nge(t),r=Rge++;Ege(e,r,t),de[e]=r,ue[r]=t,Age[r]=i,Tge[r]=new RegExp(t,n?"g":void 0),Ige[r]=new RegExp(i,n?"g":void 0)};Le("NUMERICIDENTIFIER","0|[1-9]\\d*");Le("NUMERICIDENTIFIERLOOSE","\\d+");Le("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${BN}*`);Le("MAINVERSION",`(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})\\.(${ue[de.NUMERICIDENTIFIER]})`);Le("MAINVERSIONLOOSE",`(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})\\.(${ue[de.NUMERICIDENTIFIERLOOSE]})`);Le("PRERELEASEIDENTIFIER",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIER]})`);Le("PRERELEASEIDENTIFIERLOOSE",`(?:${ue[de.NONNUMERICIDENTIFIER]}|${ue[de.NUMERICIDENTIFIERLOOSE]})`);Le("PRERELEASE",`(?:-(${ue[de.PRERELEASEIDENTIFIER]}(?:\\.${ue[de.PRERELEASEIDENTIFIER]})*))`);Le("PRERELEASELOOSE",`(?:-?(${ue[de.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ue[de.PRERELEASEIDENTIFIERLOOSE]})*))`);Le("BUILDIDENTIFIER",`${BN}+`);Le("BUILD",`(?:\\+(${ue[de.BUILDIDENTIFIER]}(?:\\.${ue[de.BUILDIDENTIFIER]})*))`);Le("FULLPLAIN",`v?${ue[de.MAINVERSION]}${ue[de.PRERELEASE]}?${ue[de.BUILD]}?`);Le("FULL",`^${ue[de.FULLPLAIN]}$`);Le("LOOSEPLAIN",`[v=\\s]*${ue[de.MAINVERSIONLOOSE]}${ue[de.PRERELEASELOOSE]}?${ue[de.BUILD]}?`);Le("LOOSE",`^${ue[de.LOOSEPLAIN]}$`);Le("GTLT","((?:<|>)?=?)");Le("XRANGEIDENTIFIERLOOSE",`${ue[de.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Le("XRANGEIDENTIFIER",`${ue[de.NUMERICIDENTIFIER]}|x|X|\\*`);Le("XRANGEPLAIN",`[v=\\s]*(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:\\.(${ue[de.XRANGEIDENTIFIER]})(?:${ue[de.PRERELEASE]})?${ue[de.BUILD]}?)?)?`);Le("XRANGEPLAINLOOSE",`[v=\\s]*(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ue[de.XRANGEIDENTIFIERLOOSE]})(?:${ue[de.PRERELEASELOOSE]})?${ue[de.BUILD]}?)?)?`);Le("XRANGE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAIN]}$`);Le("XRANGELOOSE",`^${ue[de.GTLT]}\\s*${ue[de.XRANGEPLAINLOOSE]}$`);Le("COERCEPLAIN",`(^|[^\\d])(\\d{1,${VN}})(?:\\.(\\d{1,${VN}}))?(?:\\.(\\d{1,${VN}}))?`);Le("COERCE",`${ue[de.COERCEPLAIN]}(?:$|[^\\d])`);Le("COERCEFULL",ue[de.COERCEPLAIN]+`(?:${ue[de.PRERELEASE]})?(?:${ue[de.BUILD]})?(?:$|[^\\d])`);Le("COERCERTL",ue[de.COERCE],!0);Le("COERCERTLFULL",ue[de.COERCEFULL],!0);Le("LONETILDE","(?:~>?)");Le("TILDETRIM",`(\\s*)${ue[de.LONETILDE]}\\s+`,!0);ho.tildeTrimReplace="$1~";Le("TILDE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAIN]}$`);Le("TILDELOOSE",`^${ue[de.LONETILDE]}${ue[de.XRANGEPLAINLOOSE]}$`);Le("LONECARET","(?:\\^)");Le("CARETTRIM",`(\\s*)${ue[de.LONECARET]}\\s+`,!0);ho.caretTrimReplace="$1^";Le("CARET",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAIN]}$`);Le("CARETLOOSE",`^${ue[de.LONECARET]}${ue[de.XRANGEPLAINLOOSE]}$`);Le("COMPARATORLOOSE",`^${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]})$|^$`);Le("COMPARATOR",`^${ue[de.GTLT]}\\s*(${ue[de.FULLPLAIN]})$|^$`);Le("COMPARATORTRIM",`(\\s*)${ue[de.GTLT]}\\s*(${ue[de.LOOSEPLAIN]}|${ue[de.XRANGEPLAIN]})`,!0);ho.comparatorTrimReplace="$1$2$3";Le("HYPHENRANGE",`^\\s*(${ue[de.XRANGEPLAIN]})\\s+-\\s+(${ue[de.XRANGEPLAIN]})\\s*$`);Le("HYPHENRANGELOOSE",`^\\s*(${ue[de.XRANGEPLAINLOOSE]})\\s+-\\s+(${ue[de.XRANGEPLAINLOOSE]})\\s*$`);Le("STAR","(<|>)?=?\\s*\\*");Le("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Le("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var _k=q((RHe,P4)=>{"use strict";var Pge=Object.freeze({loose:!0}),Dge=Object.freeze({}),Oge=e=>e?typeof e!="object"?Pge:e:Dge;P4.exports=Oge});var qN=q((CHe,M4)=>{"use strict";var D4=/^[0-9]+$/,O4=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eO4(t,e);M4.exports={compareIdentifiers:O4,rcompareIdentifiers:Mge}});var Dn=q((NHe,F4)=>{"use strict";var $k=Eg(),{MAX_LENGTH:L4,MAX_SAFE_INTEGER:Sk}=yd(),{safeRe:xk,t:Ek}=bd(),Lge=_k(),{compareIdentifiers:WN}=qN(),Fge=(e,t)=>{let n=t.split(".");if(n.length>e.length)return!1;for(let i=0;iL4)throw new TypeError(`version is longer than ${L4} characters`);$k("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=t.trim().match(n.loose?xk[Ek.LOOSE]:xk[Ek.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Sk||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Sk||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Sk||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let o=+r;if(o>=0&&ot.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],r=t.prerelease[n];if($k("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return WN(i,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let i=this.build[n],r=t.build[n];if($k("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return WN(i,r)}while(++n)}inc(t,n,i){if(t.startsWith("pre")){if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let r=`-${n}`.match(this.options.loose?xk[Ek.PRERELEASELOOSE]:xk[Ek.PRERELEASE]);if(!r||r[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let r=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];if(i===!1&&(o=[n]),Fge(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};F4.exports=KN});var Xs=q((PHe,j4)=>{"use strict";var U4=Dn(),Uge=(e,t,n=!1)=>{if(e instanceof U4)return e;try{return new U4(e,t)}catch(i){if(!n)return null;throw i}};j4.exports=Uge});var G4=q((DHe,z4)=>{"use strict";var jge=Xs(),zge=(e,t)=>{let n=jge(e,t);return n?n.version:null};z4.exports=zge});var B4=q((OHe,V4)=>{"use strict";var Gge=Xs(),Vge=(e,t)=>{let n=Gge(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};V4.exports=Vge});var K4=q((MHe,W4)=>{"use strict";var q4=Dn(),Bge=(e,t,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new q4(e instanceof q4?e.version:e,n).inc(t,i,r).version}catch{return null}};W4.exports=Bge});var Z4=q((LHe,J4)=>{"use strict";var H4=Xs(),qge=(e,t)=>{let n=H4(e,null,!0),i=H4(t,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return n.major!==i.major?u+"major":n.minor!==i.minor?u+"minor":n.patch!==i.patch?u+"patch":"prerelease"};J4.exports=qge});var Q4=q((FHe,Y4)=>{"use strict";var Wge=Dn(),Kge=(e,t)=>new Wge(e,t).major;Y4.exports=Kge});var e6=q((UHe,X4)=>{"use strict";var Hge=Dn(),Jge=(e,t)=>new Hge(e,t).minor;X4.exports=Jge});var n6=q((jHe,t6)=>{"use strict";var Zge=Dn(),Yge=(e,t)=>new Zge(e,t).patch;t6.exports=Yge});var i6=q((zHe,r6)=>{"use strict";var Qge=Xs(),Xge=(e,t)=>{let n=Qge(e,t);return n&&n.prerelease.length?n.prerelease:null};r6.exports=Xge});var ui=q((GHe,s6)=>{"use strict";var o6=Dn(),ehe=(e,t,n)=>new o6(e,n).compare(new o6(t,n));s6.exports=ehe});var c6=q((VHe,a6)=>{"use strict";var the=ui(),nhe=(e,t,n)=>the(t,e,n);a6.exports=nhe});var u6=q((BHe,l6)=>{"use strict";var rhe=ui(),ihe=(e,t)=>rhe(e,t,!0);l6.exports=ihe});var Tk=q((qHe,p6)=>{"use strict";var d6=Dn(),ohe=(e,t,n)=>{let i=new d6(e,n),r=new d6(t,n);return i.compare(r)||i.compareBuild(r)};p6.exports=ohe});var m6=q((WHe,f6)=>{"use strict";var she=Tk(),ahe=(e,t)=>e.sort((n,i)=>she(n,i,t));f6.exports=ahe});var h6=q((KHe,g6)=>{"use strict";var che=Tk(),lhe=(e,t)=>e.sort((n,i)=>che(i,n,t));g6.exports=lhe});var Tg=q((HHe,y6)=>{"use strict";var uhe=ui(),dhe=(e,t,n)=>uhe(e,t,n)>0;y6.exports=dhe});var Ik=q((JHe,b6)=>{"use strict";var phe=ui(),fhe=(e,t,n)=>phe(e,t,n)<0;b6.exports=fhe});var HN=q((ZHe,v6)=>{"use strict";var mhe=ui(),ghe=(e,t,n)=>mhe(e,t,n)===0;v6.exports=ghe});var JN=q((YHe,w6)=>{"use strict";var hhe=ui(),yhe=(e,t,n)=>hhe(e,t,n)!==0;w6.exports=yhe});var Ak=q((QHe,k6)=>{"use strict";var bhe=ui(),vhe=(e,t,n)=>bhe(e,t,n)>=0;k6.exports=vhe});var Rk=q((XHe,_6)=>{"use strict";var whe=ui(),khe=(e,t,n)=>whe(e,t,n)<=0;_6.exports=khe});var ZN=q((eJe,$6)=>{"use strict";var _he=HN(),$he=JN(),She=Tg(),xhe=Ak(),Ehe=Ik(),The=Rk(),Ihe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return _he(e,n,i);case"!=":return $he(e,n,i);case">":return She(e,n,i);case">=":return xhe(e,n,i);case"<":return Ehe(e,n,i);case"<=":return The(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};$6.exports=Ihe});var x6=q((tJe,S6)=>{"use strict";var Ahe=Dn(),Rhe=Xs(),{safeRe:Ck,t:Nk}=bd(),Che=(e,t)=>{if(e instanceof Ahe)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Ck[Nk.COERCEFULL]:Ck[Nk.COERCE]);else{let c=t.includePrerelease?Ck[Nk.COERCERTLFULL]:Ck[Nk.COERCERTL],l;for(;(l=c.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||l.index+l[0].length!==n.index+n[0].length)&&(n=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(n===null)return null;let i=n[2],r=n[3]||"0",o=n[4]||"0",s=t.includePrerelease&&n[5]?`-${n[5]}`:"",a=t.includePrerelease&&n[6]?`+${n[6]}`:"";return Rhe(`${i}.${r}.${o}${s}${a}`,t)};S6.exports=Che});var T6=q((nJe,E6)=>{"use strict";var Nhe=Xs(),Phe=yd(),Dhe=Dn(),Ohe=(e,t,n)=>{if(!Phe.RELEASE_TYPES.includes(t))return null;let i=Mhe(e,n);return i&&Lhe(i,t)},Mhe=(e,t)=>{let n=e instanceof Dhe?e.version:e;return Nhe(n,t)},Lhe=(e,t)=>{if(Fhe(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Fhe=e=>e.startsWith("pre");E6.exports=Ohe});var A6=q((rJe,I6)=>{"use strict";var YN=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}};I6.exports=YN});var di=q((iJe,P6)=>{"use strict";var Uhe=/\s+/g,QN=class e{constructor(t,n){if(n=zhe(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof XN)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(Uhe," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!C6(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&Zhe(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let n=this.set[t];for(let i=0;i0&&(this.formatted+=" "),this.formatted+=n[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(Jhe,"");let i=((this.options.includePrerelease&&Khe)|(this.options.loose&&Hhe))+":"+t,r=R6.get(i);if(r)return r;let o=this.options.loose,s=o?sr[On.HYPHENRANGELOOSE]:sr[On.HYPHENRANGE];t=t.replace(s,aye(this.options.includePrerelease)),Tt("hyphen replace",t),t=t.replace(sr[On.COMPARATORTRIM],Bhe),Tt("comparator trim",t),t=t.replace(sr[On.TILDETRIM],qhe),Tt("tilde trim",t),t=t.replace(sr[On.CARETTRIM],Whe),Tt("caret trim",t);let a=t.split(" ").map(d=>Yhe(d,this.options)).join(" ").split(/\s+/).map(d=>sye(d,this.options));o&&(a=a.filter(d=>(Tt("loose invalid filter",d,this.options),!!d.match(sr[On.COMPARATORLOOSE])))),Tt("range list",a);let c=new Map,l=a.map(d=>new XN(d,this.options));for(let d of l){if(C6(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return R6.set(i,u),u}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(i=>N6(i,n)&&t.set.some(r=>N6(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Ghe(t,this.options)}catch{return!1}for(let n=0;ne.value==="<0.0.0-0",Zhe=e=>e.value==="",N6=(e,t)=>{let n=!0,i=e.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,t)),r=i.pop();return n},Yhe=(e,t)=>(e=e.replace(sr[On.BUILD],""),Tt("comp",e,t),e=tye(e,t),Tt("caret",e),e=Xhe(e,t),Tt("tildes",e),e=rye(e,t),Tt("xrange",e),e=oye(e,t),Tt("stars",e),e),yn=e=>!e||e.toLowerCase()==="x"||e==="*",Qhe=(e,t,n)=>yn(e)&&!yn(t)||yn(t)&&n&&!yn(n),Xhe=(e,t)=>e.trim().split(/\s+/).map(n=>eye(n,t)).join(" "),eye=(e,t)=>{let n=t.loose?sr[On.TILDELOOSE]:sr[On.TILDE],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("tilde",e,r,o,s,a,c);let l;return yn(o)?l="":yn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:yn(a)?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c?(Tt("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Tt("tilde return",l),l})},tye=(e,t)=>e.trim().split(/\s+/).map(n=>nye(n,t)).join(" "),nye=(e,t)=>{Tt("caret",e,t);let n=t.loose?sr[On.CARETLOOSE]:sr[On.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,(r,o,s,a,c)=>{Tt("caret",e,r,o,s,a,c);let l;return yn(o)?l="":yn(s)?l=`>=${o}.0.0${i} <${+o+1}.0.0-0`:yn(a)?o==="0"?l=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(Tt("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Tt("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Tt("caret return",l),l})},rye=(e,t)=>(Tt("replaceXRanges",e,t),e.split(/\s+/).map(n=>iye(n,t)).join(" ")),iye=(e,t)=>{e=e.trim();let n=t.loose?sr[On.XRANGELOOSE]:sr[On.XRANGE];return e.replace(n,(i,r,o,s,a,c)=>{if(Tt("xRange",e,i,r,o,s,a,c),Qhe(o,s,a))return e;let l=yn(o),u=l||yn(s),d=u||yn(a),p=d;return r==="="&&p&&(r=""),c=t.includePrerelease?"-0":"",l?r===">"||r==="<"?i="<0.0.0-0":i="*":r&&p?(u&&(s=0),a=0,r===">"?(r=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",u?o=+o+1:s=+s+1),r==="<"&&(c="-0"),i=`${r+o}.${s}.${a}${c}`):u?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Tt("xRange return",i),i})},oye=(e,t)=>(Tt("replaceStars",e,t),e.trim().replace(sr[On.STAR],"")),sye=(e,t)=>(Tt("replaceGTE0",e,t),e.trim().replace(sr[t.includePrerelease?On.GTE0PRE:On.GTE0],"")),aye=e=>(t,n,i,r,o,s,a,c,l,u,d,p)=>(yn(i)?n="":yn(r)?n=`>=${i}.0.0${e?"-0":""}`:yn(o)?n=`>=${i}.${r}.0${e?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,yn(l)?c="":yn(u)?c=`<${+l+1}.0.0-0`:yn(d)?c=`<${l}.${+u+1}.0-0`:p?c=`<=${l}.${u}.${d}-${p}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),cye=(e,t,n)=>{for(let i=0;i0){let r=e[i].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}});var Ig=q((oJe,U6)=>{"use strict";var Ag=Symbol("SemVer ANY"),nP=class e{static get ANY(){return Ag}constructor(t,n){if(n=D6(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),tP("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===Ag?this.value="":this.value=this.operator+this.semver.version,tP("comp",this)}parse(t){let n=this.options.loose?O6[M6.COMPARATORLOOSE]:O6[M6.COMPARATOR],i=t.match(n);if(!i)throw new TypeError(`Invalid comparator: ${t}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new L6(i[2],this.options.loose):this.semver=Ag}toString(){return this.value}test(t){if(tP("Comparator.test",t,this.options.loose),this.semver===Ag||t===Ag)return!0;if(typeof t=="string")try{t=new L6(t,this.options)}catch{return!1}return eP(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new F6(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new F6(this.value,n).test(t.semver):(n=D6(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||eP(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||eP(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};U6.exports=nP;var D6=_k(),{safeRe:O6,t:M6}=bd(),eP=ZN(),tP=Eg(),L6=Dn(),F6=di()});var Rg=q((sJe,j6)=>{"use strict";var lye=di(),uye=(e,t,n)=>{try{t=new lye(t,n)}catch{return!1}return t.test(e)};j6.exports=uye});var G6=q((aJe,z6)=>{"use strict";var dye=di(),pye=(e,t)=>new dye(e,t).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));z6.exports=pye});var B6=q((cJe,V6)=>{"use strict";var fye=Dn(),mye=di(),gye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new mye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new fye(i,n))}),i};V6.exports=gye});var W6=q((lJe,q6)=>{"use strict";var hye=Dn(),yye=di(),bye=(e,t,n)=>{let i=null,r=null,o=null;try{o=new yye(t,n)}catch{return null}return e.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new hye(i,n))}),i};q6.exports=bye});var J6=q((uJe,H6)=>{"use strict";var rP=Dn(),vye=di(),K6=Tg(),wye=(e,t)=>{e=new vye(e,t);let n=new rP("0.0.0");if(e.test(n)||(n=new rP("0.0.0-0"),e.test(n)))return n;n=null;for(let i=0;i{let a=new rP(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||K6(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||K6(n,o))&&(n=o)}return n&&e.test(n)?n:null};H6.exports=wye});var Y6=q((dJe,Z6)=>{"use strict";var kye=di(),_ye=(e,t)=>{try{return new kye(e,t).range||"*"}catch{return null}};Z6.exports=_ye});var Pk=q((pJe,tW)=>{"use strict";var $ye=Dn(),eW=Ig(),{ANY:Sye}=eW,xye=di(),Eye=Rg(),Q6=Tg(),X6=Ik(),Tye=Rk(),Iye=Ak(),Aye=(e,t,n,i)=>{e=new $ye(e,i),t=new xye(t,i);let r,o,s,a,c;switch(n){case">":r=Q6,o=Tye,s=X6,a=">",c=">=";break;case"<":r=X6,o=Iye,s=Q6,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Eye(e,t,i))return!1;for(let l=0;l{f.semver===Sye&&(f=new eW(">=0.0.0")),d=d||f,p=p||f,r(f.semver,d.semver,i)?d=f:s(f.semver,p.semver,i)&&(p=f)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0};tW.exports=Aye});var rW=q((fJe,nW)=>{"use strict";var Rye=Pk(),Cye=(e,t,n)=>Rye(e,t,">",n);nW.exports=Cye});var oW=q((mJe,iW)=>{"use strict";var Nye=Pk(),Pye=(e,t,n)=>Nye(e,t,"<",n);iW.exports=Pye});var cW=q((gJe,aW)=>{"use strict";var sW=di(),Dye=(e,t,n)=>(e=new sW(e,n),t=new sW(t,n),e.intersects(t,n));aW.exports=Dye});var uW=q((hJe,lW)=>{"use strict";var Oye=Rg(),Mye=ui();lW.exports=(e,t,n)=>{let i=[],r=null,o=null,s=e.sort((u,d)=>Mye(u,d,n));for(let u of s)Oye(u,t,n)?(o=u,r||(r=u)):(o&&i.push([r,o]),o=null,r=null);r&&i.push([r,null]);let a=[];for(let[u,d]of i)u===d?a.push(u):!d&&u===s[0]?a.push("*"):d?u===s[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{"use strict";var dW=di(),sP=Ig(),{ANY:iP}=sP,oP=Rg(),aP=ui(),Lye=(e,t,n={})=>{if(e===t)return!0;e=new dW(e,n),t=new dW(t,n);let i=!1;e:for(let r of e.set){for(let o of t.set){let s=Uye(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},Fye=[new sP(">=0.0.0-0")],pW=[new sP(">=0.0.0")],Uye=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===iP){if(t.length===1&&t[0].semver===iP)return!0;n.includePrerelease?e=Fye:e=pW}if(t.length===1&&t[0].semver===iP){if(n.includePrerelease)return!0;t=pW}let i=new Set,r,o;for(let f of e)f.operator===">"||f.operator===">="?r=fW(r,f,n):f.operator==="<"||f.operator==="<="?o=mW(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=aP(r.semver,o.semver,n),s>0)return null;if(s===0&&(r.operator!==">="||o.operator!=="<="))return null}for(let f of i){if(r&&!oP(f,String(r),n)||o&&!oP(f,String(o),n))return null;for(let m of t)if(!oP(f,String(m),n))return!1;return!0}let a,c,l,u,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",r){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator===">"||f.operator===">="){if(a=fW(r,f,n),a===f&&a!==r)return!1}else if(r.operator===">="&&!f.test(r.semver))return!1}if(o){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=mW(o,f,n),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||r)&&s!==0)return!1}return!(r&&l&&!o&&s!==0||o&&u&&!r&&s!==0||p||d)},fW=(e,t,n)=>{if(!e)return t;let i=aP(e.semver,t.semver,n);return i>0?e:i<0||t.operator===">"&&e.operator===">="?t:e},mW=(e,t,n)=>{if(!e)return t;let i=aP(e.semver,t.semver,n);return i<0?e:i>0||t.operator==="<"&&e.operator==="<="?t:e};gW.exports=Lye});var Mc=q((bJe,vW)=>{"use strict";var cP=bd(),yW=yd(),jye=Dn(),bW=qN(),zye=Xs(),Gye=G4(),Vye=B4(),Bye=K4(),qye=Z4(),Wye=Q4(),Kye=e6(),Hye=n6(),Jye=i6(),Zye=ui(),Yye=c6(),Qye=u6(),Xye=Tk(),ebe=m6(),tbe=h6(),nbe=Tg(),rbe=Ik(),ibe=HN(),obe=JN(),sbe=Ak(),abe=Rk(),cbe=ZN(),lbe=x6(),ube=T6(),dbe=Ig(),pbe=di(),fbe=Rg(),mbe=G6(),gbe=B6(),hbe=W6(),ybe=J6(),bbe=Y6(),vbe=Pk(),wbe=rW(),kbe=oW(),_be=cW(),$be=uW(),Sbe=hW();vW.exports={parse:zye,valid:Gye,clean:Vye,inc:Bye,diff:qye,major:Wye,minor:Kye,patch:Hye,prerelease:Jye,compare:Zye,rcompare:Yye,compareLoose:Qye,compareBuild:Xye,sort:ebe,rsort:tbe,gt:nbe,lt:rbe,eq:ibe,neq:obe,gte:sbe,lte:abe,cmp:cbe,coerce:lbe,truncate:ube,Comparator:dbe,Range:pbe,satisfies:fbe,toComparators:mbe,maxSatisfying:gbe,minSatisfying:hbe,minVersion:ybe,validRange:bbe,outside:vbe,gtr:wbe,ltr:kbe,intersects:_be,simplifyRange:$be,subset:Sbe,SemVer:jye,re:cP.re,src:cP.src,tokens:cP.t,SEMVER_SPEC_VERSION:yW.SEMVER_SPEC_VERSION,RELEASE_TYPES:yW.RELEASE_TYPES,compareIdentifiers:bW.compareIdentifiers,rcompareIdentifiers:bW.rcompareIdentifiers}});var OZ=q((Qtt,DZ)=>{DZ.exports=require("util").inspect});var t3=q((Xtt,e3)=>{var nO=typeof Map=="function"&&Map.prototype,KD=Object.getOwnPropertyDescriptor&&nO?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,z_=nO&&KD&&typeof KD.get=="function"?KD.get:null,MZ=nO&&Map.prototype.forEach,rO=typeof Set=="function"&&Set.prototype,HD=Object.getOwnPropertyDescriptor&&rO?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,G_=rO&&HD&&typeof HD.get=="function"?HD.get:null,LZ=rO&&Set.prototype.forEach,wEe=typeof WeakMap=="function"&&WeakMap.prototype,bh=wEe?WeakMap.prototype.has:null,kEe=typeof WeakSet=="function"&&WeakSet.prototype,vh=kEe?WeakSet.prototype.has:null,_Ee=typeof WeakRef=="function"&&WeakRef.prototype,FZ=_Ee?WeakRef.prototype.deref:null,$Ee=Boolean.prototype.valueOf,SEe=Object.prototype.toString,xEe=Function.prototype.toString,EEe=String.prototype.match,iO=String.prototype.slice,Ia=String.prototype.replace,TEe=String.prototype.toUpperCase,UZ=String.prototype.toLowerCase,HZ=RegExp.prototype.test,jZ=Array.prototype.concat,xo=Array.prototype.join,IEe=Array.prototype.slice,zZ=Math.floor,YD=typeof BigInt=="function"?BigInt.prototype.valueOf:null,JD=Object.getOwnPropertySymbols,QD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Kd=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Yn=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Kd||!0)?Symbol.toStringTag:null,JZ=Object.prototype.propertyIsEnumerable,GZ=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function VZ(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||HZ.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var i=e<0?-zZ(-e):zZ(e);if(i!==e){var r=String(i),o=iO.call(t,r.length+1);return Ia.call(r,n,"$&_")+"."+Ia.call(Ia.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ia.call(t,n,"$&_")}var XD=OZ(),BZ=XD.custom,qZ=YZ(BZ)?BZ:null;e3.exports=function e(t,n,i,r){var o=n||{};if(Ta(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ta(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Ta(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ta(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ta(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return XZ(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?VZ(t,c):c}if(typeof t=="bigint"){var l=String(t)+"n";return a?VZ(t,l):l}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof t=="object")return eO(t)?"[Array]":"[Object]";var d=WEe(o,i);if(typeof r>"u")r=[];else if(QZ(r,t)>=0)return"[Circular]";function p(H,te,D){if(te&&(r=IEe.call(r),r.push(te)),D){var X={depth:o.depth};return Ta(o,"quoteStyle")&&(X.quoteStyle=o.quoteStyle),e(H,X,i+1,r)}return e(H,o,i+1,r)}if(typeof t=="function"&&!WZ(t)){var f=LEe(t),m=j_(t,p);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(m.length>0?" { "+xo.call(m,", ")+" }":"")}if(YZ(t)){var g=Kd?Ia.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):QD.call(t);return typeof t=="object"&&!Kd?yh(g):g}if(VEe(t)){for(var h="<"+UZ.call(String(t.nodeName)),b=t.attributes||[],y=0;y",h}if(eO(t)){if(t.length===0)return"[]";var w=j_(t,p);return d&&!qEe(w)?"["+tO(w,d)+"]":"[ "+xo.call(w,", ")+" ]"}if(CEe(t)){var k=j_(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!JZ.call(t,"cause")?"{ ["+String(t)+"] "+xo.call(jZ.call("[cause]: "+p(t.cause),k),", ")+" }":k.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+xo.call(k,", ")+" }"}if(typeof t=="object"&&s){if(qZ&&typeof t[qZ]=="function"&&XD)return XD(t,{depth:u-i});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(FEe(t)){var $=[];return MZ&&MZ.call(t,function(H,te){$.push(p(te,t,!0)+" => "+p(H,t))}),KZ("Map",z_.call(t),$,d)}if(zEe(t)){var S=[];return LZ&&LZ.call(t,function(H){S.push(p(H,t))}),KZ("Set",G_.call(t),S,d)}if(UEe(t))return ZD("WeakMap");if(GEe(t))return ZD("WeakSet");if(jEe(t))return ZD("WeakRef");if(PEe(t))return yh(p(Number(t)));if(OEe(t))return yh(p(YD.call(t)));if(DEe(t))return yh($Ee.call(t));if(NEe(t))return yh(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!REe(t)&&!WZ(t)){var x=j_(t,p),E=GZ?GZ(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",A=!E&&Yn&&Object(t)===t&&Yn in t?iO.call(Aa(t),8,-1):T?"Object":"",L=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",F=L+(A||T?"["+xo.call(jZ.call([],A||[],T||[]),": ")+"] ":"");return x.length===0?F+"{}":d?F+"{"+tO(x,d)+"}":F+"{ "+xo.call(x,", ")+" }"}return String(t)};function ZZ(e,t,n){var i=(n.quoteStyle||t)==="double"?'"':"'";return i+e+i}function AEe(e){return Ia.call(String(e),/"/g,""")}function eO(e){return Aa(e)==="[object Array]"&&(!Yn||!(typeof e=="object"&&Yn in e))}function REe(e){return Aa(e)==="[object Date]"&&(!Yn||!(typeof e=="object"&&Yn in e))}function WZ(e){return Aa(e)==="[object RegExp]"&&(!Yn||!(typeof e=="object"&&Yn in e))}function CEe(e){return Aa(e)==="[object Error]"&&(!Yn||!(typeof e=="object"&&Yn in e))}function NEe(e){return Aa(e)==="[object String]"&&(!Yn||!(typeof e=="object"&&Yn in e))}function PEe(e){return Aa(e)==="[object Number]"&&(!Yn||!(typeof e=="object"&&Yn in e))}function DEe(e){return Aa(e)==="[object Boolean]"&&(!Yn||!(typeof e=="object"&&Yn in e))}function YZ(e){if(Kd)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!QD)return!1;try{return QD.call(e),!0}catch{}return!1}function OEe(e){if(!e||typeof e!="object"||!YD)return!1;try{return YD.call(e),!0}catch{}return!1}var MEe=Object.prototype.hasOwnProperty||function(e){return e in this};function Ta(e,t){return MEe.call(e,t)}function Aa(e){return SEe.call(e)}function LEe(e){if(e.name)return e.name;var t=EEe.call(xEe.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function QZ(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return XZ(iO.call(e,0,t.maxStringLength),t)+i}var r=Ia.call(Ia.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,BEe);return ZZ(r,"single",t)}function BEe(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+TEe.call(t.toString(16))}function yh(e){return"Object("+e+")"}function ZD(e){return e+" { ? }"}function KZ(e,t,n,i){var r=i?tO(n,i):xo.call(n,", ");return e+" ("+t+") {"+r+"}"}function qEe(e){for(var t=0;t=0)return!1;return!0}function WEe(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=xo.call(Array(e.indent+1)," ");else return null;return{base:n,prev:xo.call(Array(t+1),n)}}function tO(e,t){if(e.length===0)return"";var n=` `+t.prev+t.base;return n+xo.call(e,","+n)+` -`+t.prev}function P$(e,t){var n=WD(e),i=[];if(n){i.length=e.length;for(var r=0;ree,decodeFieldSignature:()=>k9,decodeMethodSignature:()=>w9,readAssembly:()=>s_});function sNe(e){if(e.length<64||e.readUInt16LE(0)!==23117)return null;let t=e.readUInt32LE(60);if(t+24>e.length||e.readUInt32LE(t)!==17744)return null;let n=e.readUInt16LE(t+6),i=e.readUInt16LE(t+20),r=t+24;if(i===0)return null;let o=e.readUInt16LE(r),s=r+(o===523?112:96),a=[],c=r+i;for(let f=0;fe.length)break;a.push({virtualSize:e.readUInt32LE(m+8),virtualAddress:e.readUInt32LE(m+12),rawAddress:e.readUInt32LE(m+20)})}let l=e.readUInt32LE(s+112);if(l===0)return null;let u=g9(l,a);if(u===null||u+16>e.length)return null;let d=e.readUInt32LE(u+8),p=g9(d,a);return p===null?null:{offset:p,sections:a}}function g9(e,t){for(let n of t)if(e>=n.virtualAddress&&ee.length||e.readUInt32LE(t)!==1112167234)return null;let n=e.readUInt32LE(t+12),i=t+16+n+2,r=e.readUInt16LE(i);i+=2;let o=new Map;for(let c=0;c"||h.startsWith("<"))continue;let b=$Ne(i,r,l,f),y=v9(i,m[3]),w=[],k=[];for(let _ of y9(m[4],f,r,4,o.length)){let S=o[_];if(!h9(S[0]))continue;let x=i.string(S[1]);x.startsWith("<")||(w.push(x),k.push(`${x}: ${k9(i,i.blob(S[2]))}`))}for(let _ of y9(m[5],f,r,5,s.length)){let S=s[_];if(!h9(S[2]))continue;let x=i.string(S[3]);x.startsWith("<")||/^(get_|set_|add_|remove_)/.test(x)||(w.push(x),k.push(`${x}${w9(i,i.blob(S[4]))}`))}for(let _ of u.get(f+1)??[]){let S=i.string(a[_][1]);S.startsWith("<")||(w.push(S),k.push(`${S} { get; set; }`))}for(let _ of d.get(f+1)??[]){let S=i.string(c[_][1]);S.startsWith("<")||(w.push(S),k.push(`event ${S}`))}p.push({fullName:b,kind:kNe(g,y),members:[...new Set(w)],signatures:[...new Set(k)]})}return p}function kNe(e,t){return e&gNe?"interface":t==="System.Enum"?"enum":t==="System.ValueType"?"struct":t==="System.MulticastDelegate"||t==="System.Delegate"?"delegate":"class"}function $Ne(e,t,n,i){let r=[],o=i;for(let s=0;s<16;s++){let a=t[o];if(!a)break;r.unshift(e.string(a[1]));let c=n.get(o+1);if(c===void 0){let l=e.string(a[2]);return l?`${l}.${r.join("+")}`:r.join("+")}o=c-1}return r.join("+")}function v9(e,t){let n=t&3,i=t>>2;if(i===0)return null;if(n===0){let r=e.table(ee.TypeDef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}if(n===1){let r=e.table(ee.TypeRef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}return null}function y9(e,t,n,i,r){let o=n[t+1]?.[i]??r+1,s=[];for(let a=e;a`}let o=No(t,n);n+=o.width;let s=Ji(e,t,n);n=s.offset;let a=[];for(let c=0;c=t.length);c++){let l=Ji(e,t,n);n=l.offset,a.push(l.text)}return`${r}(${a.join(", ")}): ${s.text}`}function k9(e,t){return t.length<2?"?":Ji(e,t,1).text}function Ji(e,t,n){let i=n,r=t[i++];if(r===void 0)return{text:"?",offset:i};let o=_Ne[r];if(o)return{text:o,offset:i};switch(r){case 15:{let s=Ji(e,t,i);return{text:`${s.text}*`,offset:s.offset}}case 16:{let s=Ji(e,t,i);return{text:`ref ${s.text}`,offset:s.offset}}case 29:{let s=Ji(e,t,i);return{text:`${s.text}[]`,offset:s.offset}}case 69:{let s=Ji(e,t,i);return{text:s.text,offset:s.offset}}case 17:case 18:{let s=No(t,i);return i+=s.width,{text:v9(e,s.value)??"object",offset:i}}case 19:case 30:{let s=No(t,i);return i+=s.width,{text:`${r===19?"T":"M"}${s.value}`,offset:i}}case 21:{let s=Ji(e,t,i);i=s.offset;let a=No(t,i);i+=a.width;let c=[];for(let l=0;l`,offset:i}}case 20:{let s=Ji(e,t,i);i=s.offset;let a=No(t,i);i+=a.width;for(let c of["sizes","lowBounds"]){let l=No(t,i);i+=l.width;for(let u=0;u{"use strict";Ut={type:"u16"},Ct={type:"u32"},Ht={type:"string"},DO={type:"guid"},mr={type:"blob"},Pt=e=>({type:"rid",table:e}),wn=e=>({type:"coded",family:e}),ee={Module:0,TypeRef:1,TypeDef:2,Field:4,MethodDef:6,Param:8,InterfaceImpl:9,MemberRef:10,Constant:11,CustomAttribute:12,FieldMarshal:13,DeclSecurity:14,ClassLayout:15,FieldLayout:16,StandAloneSig:17,EventMap:18,Event:20,PropertyMap:21,Property:23,MethodSemantics:24,MethodImpl:25,ModuleRef:26,TypeSpec:27,ImplMap:28,FieldRVA:29,Assembly:32,AssemblyRef:35,File:38,ExportedType:39,ManifestResource:40,NestedClass:41,GenericParam:42,MethodSpec:43,GenericParamConstraint:44},cNe={TypeDefOrRef:[ee.TypeDef,ee.TypeRef,ee.TypeSpec],HasConstant:[ee.Field,ee.Param,ee.Property],HasCustomAttribute:[ee.MethodDef,ee.Field,ee.TypeRef,ee.TypeDef,ee.Param,ee.InterfaceImpl,ee.MemberRef,ee.Module,ee.DeclSecurity,ee.Property,ee.Event,ee.StandAloneSig,ee.ModuleRef,ee.TypeSpec,ee.Assembly,ee.AssemblyRef,ee.File,ee.ExportedType,ee.ManifestResource,ee.GenericParam,ee.GenericParamConstraint,ee.MethodSpec],HasFieldMarshal:[ee.Field,ee.Param],HasDeclSecurity:[ee.TypeDef,ee.MethodDef,ee.Assembly],MemberRefParent:[ee.TypeDef,ee.TypeRef,ee.ModuleRef,ee.MethodDef,ee.TypeSpec],HasSemantics:[ee.Event,ee.Property],MethodDefOrRef:[ee.MethodDef,ee.MemberRef],MemberForwarded:[ee.Field,ee.MethodDef],Implementation:[ee.File,ee.AssemblyRef,ee.ExportedType],CustomAttributeType:[null,null,ee.MethodDef,ee.MemberRef,null],ResolutionScope:[ee.Module,ee.ModuleRef,ee.AssemblyRef,ee.TypeRef],TypeOrMethodDef:[ee.TypeDef,ee.MethodDef]},lNe={0:[Ut,Ht,DO,DO,DO],1:[wn("ResolutionScope"),Ht,Ht],2:[Ct,Ht,Ht,wn("TypeDefOrRef"),Pt(ee.Field),Pt(ee.MethodDef)],3:[Pt(ee.Field)],4:[Ut,Ht,mr],5:[Pt(ee.MethodDef)],6:[Ct,Ut,Ut,Ht,mr,Pt(ee.Param)],7:[Pt(ee.Param)],8:[Ut,Ut,Ht],9:[Pt(ee.TypeDef),wn("TypeDefOrRef")],10:[wn("MemberRefParent"),Ht,mr],11:[Ut,wn("HasConstant"),mr],12:[wn("HasCustomAttribute"),wn("CustomAttributeType"),mr],13:[wn("HasFieldMarshal"),mr],14:[Ut,wn("HasDeclSecurity"),mr],15:[Ut,Ct,Pt(ee.TypeDef)],16:[Ct,Pt(ee.Field)],17:[mr],18:[Pt(ee.TypeDef),Pt(ee.Event)],19:[Pt(ee.Event)],20:[Ut,Ht,wn("TypeDefOrRef")],21:[Pt(ee.TypeDef),Pt(ee.Property)],22:[Pt(ee.Property)],23:[Ut,Ht,mr],24:[Ut,Pt(ee.MethodDef),wn("HasSemantics")],25:[Pt(ee.TypeDef),wn("MethodDefOrRef"),wn("MethodDefOrRef")],26:[Ht],27:[mr],28:[Ut,wn("MemberForwarded"),Ht,Pt(ee.ModuleRef)],29:[Ct,Pt(ee.Field)],30:[Ct,Ct],31:[Ct],32:[Ct,Ut,Ut,Ut,Ut,Ct,mr,Ht,Ht],33:[Ct],34:[Ct,Ct,Ct],35:[Ut,Ut,Ut,Ut,Ct,mr,Ht,Ht,mr],36:[Ct,Pt(ee.AssemblyRef)],37:[Ct,Ct,Ct,Pt(ee.AssemblyRef)],38:[Ct,Ht,mr],39:[Ct,Ct,Ht,Ht,wn("Implementation")],40:[Ct,Ct,Ht,wn("Implementation")],41:[Pt(ee.TypeDef),Pt(ee.TypeDef)],42:[Ut,Ut,wn("TypeOrMethodDef"),Ht],43:[wn("MethodDefOrRef"),mr],44:[Pt(ee.GenericParam),wn("TypeDefOrRef")]},OO=class{constructor(t,n,i){this.strings=t;this.blobs=n;let r=i.readUInt8(6),o=i.readBigUInt64LE(8),s=new Map,a=24;for(let u=0;u<64;u++)o>>BigInt(u)&1n&&(s.set(u,i.readUInt32LE(a)),a+=4);let c={string:r&1?4:2,guid:r&2?4:2,blob:r&4?4:2},l=u=>{switch(u.type){case"u16":return 2;case"u32":return 4;case"string":return c.string;case"guid":return c.guid;case"blob":return c.blob;case"rid":return(s.get(u.table)??0)<65536?2:4;case"coded":{let d=cNe[u.family],p=Math.ceil(Math.log2(d.length));return Math.max(...d.map(m=>m===null?0:s.get(m)??0))<1<<16-p?2:4}}};for(let[u,d]of s){let p=lNe[u];if(!p)break;let f=p.map(l),m=f.reduce((h,b)=>h+b,0),g=[];for(let h=0;hi.length);h++){let b=[],y=a;for(let w of f)b.push(w===2?i.readUInt16LE(y):i.readUInt32LE(y)),y+=w;g.push(b),a+=m}this.rows.set(u,g)}}strings;blobs;rows=new Map;table(t){return this.rows.get(t)??[]}string(t){if(t>=this.strings.length)return"";let n=t;for(;n=this.blobs.length)return Buffer.alloc(0);let{value:n,width:i}=No(this.blobs,t);return this.blobs.subarray(t+i,t+i+n)}};uNe=7,dNe=1,pNe=2,fNe=4,mNe=7,gNe=32,hNe=7,yNe=4,bNe=6,vNe=5;_Ne={1:"void",2:"bool",3:"char",4:"sbyte",5:"byte",6:"short",7:"ushort",8:"int",9:"uint",10:"long",11:"ulong",12:"float",13:"double",14:"string",22:"TypedReference",24:"IntPtr",25:"UIntPtr",28:"object"}});function M(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function v(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}var gr=j(()=>{});function Yr(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var pl,Da=j(()=>{pl=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{let t=Object.prototype.toString.call(e);if(t==="[object Error]"||t==="[object DOMException]"){let n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)}});var J,Dt,In,Zi,fl,ap,ml,gl,hl,yl,bl,vl,wl,kl,kt=j(()=>{Da();J=class extends Error{},Dt=class e extends J{constructor(t,n,i,r,o){super(`${e.makeMessage(t,n,i)}`),this.status=t,this.headers=r,this.requestID=r?.get("request-id"),this.workspaceID=r?.get("anthropic-workspace-id"),this.error=n,this.type=o??null}static makeMessage(t,n,i){let r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return t&&r?`${t} ${r}`:t?`${t} status code (no body)`:r||"(no status code or body)"}static generate(t,n,i,r){if(!t||!r)return new Zi({message:i,cause:pl(n)});let o=n,s=o?.error?.type;return t===400?new ml(t,o,i,r,s):t===401?new gl(t,o,i,r,s):t===403?new hl(t,o,i,r,s):t===404?new yl(t,o,i,r,s):t===409?new bl(t,o,i,r,s):t===422?new vl(t,o,i,r,s):t===429?new wl(t,o,i,r,s):t>=500?new kl(t,o,i,r,s):new e(t,o,i,r,s)}},In=class extends Dt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},Zi=class extends Dt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},fl=class extends Zi{constructor({message:t}={}){super({message:t??"Request timed out."})}},ap=class extends J{constructor(t,{cause:n}={}){super(t??"Retryable error."),n!==void 0&&(this.cause=n)}},ml=class extends Dt{},gl=class extends Dt{},hl=class extends Dt{},yl=class extends Dt{},bl=class extends Dt{},vl=class extends Dt{},wl=class extends Dt{},kl=class extends Dt{}});function Ih(e){return typeof e!="object"?{}:e??{}}function VO(e){if(!e)return!0;for(let t in e)return!1;return!0}function m5(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BO(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var hCe,f5,er,GO,d_,$l,hr=j(()=>{kt();hCe=/^[a-z][a-z0-9+.-]*:/i,f5=e=>hCe.test(e),er=e=>(er=Array.isArray,er(e)),GO=er;d_=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new J(`${e} must be an integer`);if(t<0)throw new J(`${e} must be a positive integer`);return t},$l=e=>{try{return JSON.parse(e)}catch{return}}});var Yi,cp=j(()=>{Yi=(e,t)=>new Promise(n=>{if(t?.aborted)return n();let i=()=>{clearTimeout(r),n()},r=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e);t?.addEventListener("abort",i,{once:!0})})});var Si,Ah=j(()=>{Si="0.125.0"});function yCe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function vCe(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:n}of e){let i=n.exec(navigator.userAgent);if(i){let r=i[1]||0,o=i[2]||0,s=i[3]||0;return{browser:t,version:`${r}.${o}.${s}`}}}return null}var b5,bCe,g5,h5,y5,Rh,p_=j(()=>{Ah();b5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";bCe=()=>{let e=yCe();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":h5(Deno.build.os),"X-Stainless-Arch":g5(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":h5(globalThis.process.platform??"unknown"),"X-Stainless-Arch":g5(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=vCe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};g5=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",h5=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),Rh=()=>y5??(y5=bCe())});function wCe(e,t){return()=>e.removeEventListener("abort",t)}function w5(e,t,n){f_.set(e,wCe(t,n))}function k5(e,t){f_.has(t)&&v5?.register(e,t,t)}function Co(e){let t=f_.get(e);t&&(f_.delete(e),v5?.unregister(e),t())}var f_,v5,m_=j(()=>{f_=new WeakMap,v5=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(e=>Co(e)):null});function $5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function qO(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function g_(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return qO({start(){},async pull(n){let{done:i,value:r}=await t.next();i?n.close():n.enqueue(r)},async cancel(){await t.return?.()}})}function Nh(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function _5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var lp=j(()=>{});var Ch,S5,WO=j(()=>{Ch=class{},S5=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)})});var HO,KO,JO,x5,ZO=j(()=>{HO="RFC3986",KO=e=>String(e),JO={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:KO},x5="RFC1738"});function T5(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function QO(e,t){if(er(e)){let n=[];for(let i=0;i{ZO();hr();h_=(e,t)=>(h_=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),h_(e,t)),Po=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),YO=1024,E5=(e,t,n,i,r)=>{if(e.length===0)return e;let o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=YO?o.slice(a,a+YO):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||r===x5&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Po[d];continue}if(d<2048){l[l.length]=Po[192|d>>6]+Po[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Po[224|d>>12]+Po[128|d>>6&63]+Po[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Po[240|d>>18]+Po[128|d>>12&63]+Po[128|d>>6&63]+Po[128|d&63]}s+=l.join("")}return s}});function _Ce(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}function C5(e,t,n,i,r,o,s,a,c,l,u,d,p,f,m,g,h,b){let y=e,w=b,k=0,_=!1;for(;(w=w.get(XO))!==void 0&&!_;){let A=w.get(e);if(k+=1,typeof A<"u"){if(A===k)throw new RangeError("Cyclic object value");_=!0}typeof w.get(XO)>"u"&&(k=0)}if(typeof l=="function"?y=l(t,y):y instanceof Date?y=p?.(y):n==="comma"&&er(y)&&(y=QO(y,function(A){return A instanceof Date?p?.(A):A})),y===null){if(o)return c&&!g?c(t,kn.encoder,h,"key",f):t;y=""}if(_Ce(y)||T5(y)){if(c){let A=g?t:c(t,kn.encoder,h,"key",f);return[m?.(A)+"="+m?.(c(y,kn.encoder,h,"value",f))]}return[m?.(t)+"="+m?.(String(y))]}let S=[];if(typeof y>"u")return S;let x;if(n==="comma"&&er(y))g&&c&&(y=QO(y,c)),x=[{value:y.length>0?y.join(",")||null:void 0}];else if(er(l))x=l;else{let A=Object.keys(y);x=u?A.sort(u):A}let E=a?String(t).replace(/\./g,"%2E"):String(t),T=i&&er(y)&&y.length===1?E+"[]":E;if(r&&er(y)&&y.length===0)return T+"[]";for(let A=0;A"u"?e.encodeDotInKeys?!0:kn.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:kn.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:kn.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:kn.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?kn.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:kn.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:kn.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:kn.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:kn.encodeValuesOnly,filter:r,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:kn.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:kn.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:kn.strictNullHandling}}function P5(e,t={}){let n=e,i=SCe(t),r,o;typeof i.filter=="function"?(o=i.filter,n=o("",n)):er(i.filter)&&(o=i.filter,r=o);let s=[];if(typeof n!="object"||n===null)return"";let a=R5[i.arrayFormat],c=a==="comma"&&i.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);let l=new WeakMap;for(let p=0;p0?d+u:""}var R5,N5,A5,kn,XO,D5=j(()=>{I5();ZO();hr();R5={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},N5=function(e,t){Array.prototype.push.apply(e,er(t)?t:[t])},kn={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:E5,encodeValuesOnly:!1,format:HO,formatter:KO,indices:!1,serializeDate(e){return(A5??(A5=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};XO={}});function O5(e){return P5(e,{arrayFormat:"brackets"})}var eM=j(()=>{D5()});var Do={};_r(Do,{child_process:()=>tM,crypto:()=>Oa,fs:()=>fs,os:()=>ECe,path:()=>xe,stream:()=>y_,util:()=>nM});var tM,Oa,fs,ECe,xe,y_,nM,Mr=j(()=>{tM=gt(require("node:child_process"),1),Oa=gt(require("node:crypto"),1),fs=gt(require("node:fs"),1),ECe=gt(require("node:os"),1),xe=gt(require("node:path"),1),y_=gt(require("node:stream"),1),nM=gt(require("node:util"),1)});function v_(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new dt(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new dt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function w_(e,t){let n=await ICe(e),i;try{i=JSON.parse(n)}catch{throw new dt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Lr(n),t)}if(!i.access_token)throw new dt(`Token endpoint response missing access_token: ${JSON.stringify(Lr(i))}`,e.status,Lr(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new dt(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,Lr(i),t);return i}function Lr(e){if(e==null)return e;if(typeof e=="string"){let t;try{t=JSON.parse(e)}catch{return e.length<=rM?e:e.slice(0,rM)+`... <${e.length-rM} more chars>`}return JSON.stringify(Lr(t))}if(typeof e=="object"&&!Array.isArray(e)){let t={};for(let[n,i]of Object.entries(e))TCe.has(n)&&(t[n]=i);return t}return null}async function k_(e,t=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(Mr(),Do)),i=e,r;try{i=await n.promises.realpath(e),r=await n.promises.stat(i)}catch{return}let o=r.mode&511;if(o&18)throw new dt(`Credentials file at ${i} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(o&36)throw new dt(`Credentials file at ${i} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);typeof process.getuid=="function"&&r.uid!==process.getuid()&&t(`credentials file at ${i} is owned by uid ${r.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function $_(e,t){let{fs:n,path:i}=await Promise.resolve().then(()=>(Mr(),Do)),r=i.dirname(e);await n.promises.mkdir(r,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await n.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await n.promises.rename(o,e)}catch(s){throw await n.promises.unlink(o).catch(()=>{}),s}try{let s=await n.promises.open(r,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function ICe(e){if(!e.body)return"";let t=e.body.getReader(),n=[],i=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(i+s.length>M5){let a=M5-i;a>0&&n.push(s.subarray(0,a)),await t.cancel();break}n.push(s),i+=s.length}let r;if(n.length===1)r=n[0];else{r=new Uint8Array(n.reduce((s,a)=>s+a.length,0));let o=0;for(let s of n)r.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(r)}var L5,F5,b_,_l,U5,j5,up,z5,M5,rM,TCe,dt,dp=j(()=>{kt();L5="urn:ietf:params:oauth:grant-type:jwt-bearer",F5="refresh_token",b_="/v1/oauth/token",_l="oauth-2025-04-20",U5="oidc-federation-2026-04-01",j5=120,up=30,z5=5,M5=1<<20;rM=2e3,TCe=new Set(["error","error_description","error_uri"]);dt=class extends J{constructor(t,n=null,i=null,r=null){super(t),this.statusCode=n,this.body=i,this.requestId=r}}});function Qi(){return Math.floor(Date.now()/1e3)}var Ph=j(()=>{});var __,G5=j(()=>{dp();Ph();__=class{constructor(t,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=t,this.onAdvisoryRefreshError=n}async getToken(){let t=this.nextForce;this.nextForce=!1;let n=this.cached;if(t||n==null)return(await this.refresh(t)).token;if(n.expiresAt==null)return n.token;let i=n.expiresAt-Qi();return i>j5?n.token:i>up?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(t=!1){return this.pendingRefresh&&!t?this.pendingRefresh:this.doRefresh(t)}backgroundRefresh(){this.pendingRefresh||Qi()-this.lastAdvisoryError{this.lastAdvisoryError=Qi(),this.onAdvisoryRefreshError?.(t)})}doRefresh(t=!1){return this.pendingRefresh=this.provider(t?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var ze,pp=j(()=>{ze=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0}});function q5(e){let t=0;for(let r of e)t+=r.length;let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.length;return n}function Ma(e){let t;return(V5??(t=new globalThis.TextEncoder,V5=t.encode.bind(t)))(e)}function Sl(e){let t;return(B5??(t=new globalThis.TextDecoder,B5=t.decode.bind(t)))(e)}var V5,B5,xl=j(()=>{});var W5,iM=j(()=>{kt();xl();W5=e=>{if(typeof globalThis.Buffer<"u"){let t=globalThis.Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof atob<"u"){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;ix_[n]?Dh:t[e].bind(t)}function sM(e,t){let n=H5.get(e);if(n&&n[0]===t)return n[1];let i={error:S_("error",e,t),warn:S_("warn",e,t),info:S_("info",e,t),debug:S_("debug",e,t)};return H5.set(e,[t,i]),i}function qe(e){let t=e.logger,n=e.logLevel??"off";return t?sM(t,n):ACe}function J5(){let e=ze("ANTHROPIC_LOG");return(!oM||e!==K5)&&(K5=e,oM=sM(console,E_(e,"process.env['ANTHROPIC_LOG']",sM(console,Oh))??Oh)),oM}var Oh,x_,E_,ACe,H5,K5,oM,Oo,Xi=j(()=>{hr();pp();Oh="warn",x_={off:0,error:200,warn:300,info:400,debug:500},E_=(e,t,n)=>{if(e){if(m5(x_,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(x_))}`)}};ACe={error:Dh,warn:Dh,info:Dh,debug:Dh},H5=new WeakMap;Oo=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)});var T_,aM=j(()=>{T_=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return T_=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))}});var cM=j(()=>{hr();iM();pp();Xi();aM();cp();eM()});function Z5(e){if(!e)throw new Error("profile name is empty");if(e==="."||e==="..")throw new Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw new Error(`profile name "${e}" must not contain path separators`);if(!RCe.test(e))throw new Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var I_,RCe,Y5,Q5,lM,NCe,X5,uM=j(()=>{p_();cM();I_="1.0",RCe=/^[A-Za-z0-9_.-]+$/;Y5=async e=>{var t,n;let i=await lM();if(i===null)return null;let r=e??await X5();if(r===null)return null;Z5(r);let{fs:o,path:s}=await Promise.resolve().then(()=>(Mr(),Do)),a=s.join(i,"configs",`${r}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=ze("ANTHROPIC_ORGANIZATION_ID"),p=ze("ANTHROPIC_IDENTITY_TOKEN_FILE"),f=ze("ANTHROPIC_FEDERATION_RULE_ID");return f&&d?{fromFile:!1,config:{organization_id:d,workspace_id:ze("ANTHROPIC_WORKSPACE_ID"),base_url:ze("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:f,service_account_id:ze("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:p?{source:"file",path:p}:void 0,scope:ze("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=ze("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=ze("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=ze("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=ze("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=ze("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=l.authentication).service_account_id??(n.service_account_id=ze("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},Q5=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await lM();if(!n)return null;let i=t??await X5();if(!i)return null;Z5(i);let{path:r}=await Promise.resolve().then(()=>(Mr(),Do));return r.join(n,"credentials",`${i}.json`)},lM=async()=>{if(!NCe())return null;let{path:e}=await Promise.resolve().then(()=>(Mr(),Do)),t=ze("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Rh()["X-Stainless-OS"]==="Windows"){let o=ze("APPDATA");if(o)return e.join(o,"Anthropic");let s=ze("USERPROFILE");return s?e.join(s,"AppData","Roaming","Anthropic"):null}let i=ze("XDG_CONFIG_HOME");if(i)return e.join(i,"anthropic");let r=ze("HOME");return r?e.join(r,".config","anthropic"):null},NCe=()=>{let e=Rh()["X-Stainless-Runtime"];return e==="node"||e==="deno"},X5=async()=>{let e=await lM();if(!e)return null;let t=ze("ANTHROPIC_PROFILE");if(t)return t;let{fs:n,path:i}=await Promise.resolve().then(()=>(Mr(),Do)),r=i.join(e,"active_config");try{return(await n.promises.readFile(r,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${r}: ${o}`);return"default"}}});function dM(e){if(!e)throw new J("Identity token file path is empty");return async()=>{let{fs:t}=await Promise.resolve().then(()=>(Mr(),Do)),n;try{n=await t.promises.readFile(e,"utf-8")}catch(r){throw new J(`Failed to read identity token file at ${e}: ${r}`)}let i=n.trim();if(!i)throw new J(`Identity token file at ${e} is empty`);return i}}function eQ(e){if(!e)throw new J("Identity token value is empty");return()=>e}var tQ=j(()=>{kt()});function nQ(e){return async()=>{v_(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16*1024)throw new dt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:L5,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};e.serviceAccountId&&(n.service_account_id=e.serviceAccountId),e.workspaceId&&(n.workspace_id=e.workspaceId);let i=`${e.baseURL}${b_}`,r;try{r=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${_l},${U5}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Si} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new dt(`Failed to reach token endpoint ${i}: ${c}`)}let o=r.headers.get("Request-Id");if(!r.ok){let c=await r.text().catch(()=>""),l=Lr(c),u="";throw r.status===401&&(u=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new dt(`Token exchange failed with status ${r.status}${o?` (request-id ${o})`:""}: ${l}${u}`,r.status,l,o)}let s=await w_(r,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new dt(`Token endpoint response missing required fields: ${JSON.stringify(Lr(s))}`,r.status,Lr(s),o);return{token:s.access_token,expiresAt:Qi()+a}}}var rQ=j(()=>{dp();Ph();Ah()});function iQ(e){return async t=>{let{fs:n}=await Promise.resolve().then(()=>(Mr(),Do));await k_(e.credentialsPath,e.onSafetyWarning);let i;try{i=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(h){throw new dt(`Credentials file not found at ${e.credentialsPath}: ${h}`)}let r;try{r=JSON.parse(i)}catch(h){throw new dt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${h}`)}let o=r.access_token;if(!o)throw new dt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=r.expires_at;if(!t?.forceRefresh&&(s==null||Qi()"");throw new dt(`User OAuth refresh failed (HTTP ${u.status}): ${Lr(h)}`,u.status,Lr(h),d)}let p=await w_(u,d),f=Number(p.expires_in);if(!Number.isFinite(f))throw new dt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Lr(p))}`,u.status,Lr(p),d);let m=Qi()+f,g=p.refresh_token||a;return await $_(e.credentialsPath,{...r,version:I_,type:"oauth_token",access_token:p.access_token,expires_at:m,refresh_token:g}),{token:p.access_token,expiresAt:m}}}var oQ=j(()=>{uM();dp();Ph();Ah()});function pM(e,t){let n=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),r=CCe(e,n,i,t),o={};return e.workspace_id&&e.authentication.type==="user_oauth"&&(o["anthropic-workspace-id"]=e.workspace_id),{provider:r,extraHeaders:o,baseURL:e.base_url||void 0}}async function sQ(e,t){let n=await Y5(t);if(!n)return null;let{config:i,fromFile:r}=n,o=i.authentication.credentials_path||!r?i:{...i,authentication:{...i.authentication,credentials_path:await Q5(i,t)??void 0}};return pM(o,e)}function CCe(e,t,n,i){switch(e.authentication.type){case"oidc_federation":{let r=e.authentication,o=PCe(r);if(!o)throw new dt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!r.federation_rule_id)throw new dt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new dt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=nQ({identityTokenProvider:o,federationRuleId:r.federation_rule_id,organizationId:e.organization_id,serviceAccountId:r.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent});return t?DCe(s,t,i.onCacheWriteError,i.onSafetyWarning):s}case"user_oauth":{if(!t)throw new dt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return iQ({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let r=e.authentication.type;throw new dt(`authentication.type "${r}" is not a known authentication type`)}}}function PCe(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new dt(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new dt('identity_token.source "file" requires a non-empty path');return dM(e.identity_token.path)}let t=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return dM(t);let n=ze("ANTHROPIC_IDENTITY_TOKEN");return n?eQ(n):null}function DCe(e,t,n,i){return async r=>{let{fs:o}=await Promise.resolve().then(()=>(Mr(),Do));await k_(t,i);let s;try{let c=await o.promises.readFile(t,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!r?.forceRefresh){let u=s?.expires_at;if(u==null||Qi(){pp();uM();dp();Ph();tQ();rQ();oQ()});function OCe(e,t){for(let r=t??0;r{gr();xl();ms=class{constructor(){Qr.set(this,void 0),Xr.set(this,void 0),M(this,Qr,new Uint8Array,"f"),M(this,Xr,null,"f")}decode(t){if(t==null)return[];let n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Ma(t):t;M(this,Qr,q5([v(this,Qr,"f"),n]),"f");let i=[],r;for(;(r=OCe(v(this,Qr,"f"),v(this,Xr,"f")))!=null;){if(r.carriage&&v(this,Xr,"f")==null){M(this,Xr,r.index,"f");continue}if(v(this,Xr,"f")!=null&&(r.index!==v(this,Xr,"f")+1||r.carriage)){i.push(Sl(v(this,Qr,"f").subarray(0,v(this,Xr,"f")-1))),M(this,Qr,v(this,Qr,"f").subarray(v(this,Xr,"f")),"f"),M(this,Xr,null,"f");continue}let o=v(this,Xr,"f")!==null?r.preceding-1:r.preceding,s=Sl(v(this,Qr,"f").subarray(0,o));i.push(s),M(this,Qr,v(this,Qr,"f").subarray(r.index),"f"),M(this,Xr,null,"f")}return i}flush(){return v(this,Qr,"f").length?this.decode(` -`):[]}};Qr=new WeakMap,Xr=new WeakMap;ms.NEWLINE_CHARS=new Set([` -`,"\r"]);ms.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*lQ(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new J("Attempted to iterate over a response with no body");let n=new mM,i=new ms,r=Nh(e.body);for await(let o of MCe(r))for(let s of i.decode(o)){let a=n.decode(s);a&&(yield a)}for(let o of i.flush()){let s=n.decode(o);s&&(yield s)}}async function*MCe(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Ma(n):n,r=new Uint8Array(t.length+i.length);r.set(t),r.set(i,t.length),t=r;let o;for(;(o=cQ(t))!==-1;)yield t.subarray(0,o),t=t.subarray(o)}t.length>0&&(yield t)}function LCe(e,t){let n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}var Mh,Fr,mM,Lh=j(()=>{gr();kt();lp();fM();lp();Da();hr();xl();Xi();kt();m_();Fr=class e{constructor(t,n,i){this.iterator=t,Mh.set(this,void 0),this.controller=n,M(this,Mh,i,"f")}static rawEvents(t,n=new AbortController){return lQ(t,n)}static fromSSEResponse(t,n,i){let r=!1,o=i?qe(i):console;async function*s(){if(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of lQ(t,n)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop"||c.event==="message"||c.event==="user.message"||c.event==="user.interrupt"||c.event==="user.tool_confirmation"||c.event==="user.custom_tool_result"||c.event==="user.tool_result"||c.event==="agent.message"||c.event==="agent.thinking"||c.event==="agent.tool_use"||c.event==="agent.tool_result"||c.event==="agent.mcp_tool_use"||c.event==="agent.mcp_tool_result"||c.event==="agent.custom_tool_use"||c.event==="agent.thread_context_compacted"||c.event==="session.status_running"||c.event==="session.status_idle"||c.event==="session.status_rescheduled"||c.event==="session.status_terminated"||c.event==="session.error"||c.event==="session.deleted"||c.event==="session.updated"||c.event==="span.model_request_start"||c.event==="span.model_request_end"||c.event==="span.outcome_evaluation_start"||c.event==="span.outcome_evaluation_ongoing"||c.event==="span.outcome_evaluation_end"||c.event==="user.define_outcome"||c.event==="agent.thread_message_received"||c.event==="agent.thread_message_sent"||c.event==="agent.session_thread_message_received"||c.event==="agent.session_thread_message_sent"||c.event==="session.thread_created"||c.event==="session.thread_status_created"||c.event==="session.thread_status_running"||c.event==="session.thread_status_idle"||c.event==="session.thread_status_rescheduled"||c.event==="session.thread_status_terminated"||c.event==="event_start"||c.event==="event_delta"||c.event==="system.message")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event!=="ping"&&c.event==="error"){let l=$l(c.data)??c.data,u=l?.error?.type;throw new Dt(void 0,l,void 0,t.headers,u)}}a=!0}catch(c){if(Yr(c))return;throw c}finally{a||n.abort(),Co(n)}}return new e(s,n,i)}static fromReadableStream(t,n,i){let r=!1;async function*o(){let a=new ms,c=Nh(t);for await(let l of c)for(let u of a.decode(l))yield u;for(let l of a.flush())yield l}async function*s(){if(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(Yr(c))return;throw c}finally{a||n.abort(),Co(n)}}return new e(s,n,i)}[(Mh=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],i=this.iterator(),r=o=>({next:()=>{if(o.length===0){let s=i.next();t.push(s),n.push(s)}return o.shift()}});return[new e(()=>r(t),this.controller,v(this,Mh,"f")),new e(()=>r(n),this.controller,v(this,Mh,"f"))]}toReadableStream(){let t=this,n;return qO({async start(){n=t[Symbol.asyncIterator]()},async pull(i){try{let{value:r,done:o}=await n.next();if(o)return i.close();let s=Ma(JSON.stringify(r)+` -`);i.enqueue(s)}catch(r){i.error(r)}},async cancel(){await n.return?.()}})}};mM=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,i,r]=LCe(t,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}}});async function A_(e,t){let{response:n,requestLogID:i,retryOfRequestLogID:r,startTime:o}=t,s=await(async()=>{if(t.options.stream)return qe(e).debug("response",n.status,n.url,n.headers,n.body),Fr.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let p=await n.json();return Fh(p,n)}return await n.text()})().finally(()=>{!t.options.stream&&!t.options.__binaryResponse&&Co(t.controller)});return qe(e).debug(`[${i}] response parsed`,Oo({retryOfRequestLogID:r,url:n.url,status:n.status,body:s,durationMs:Date.now()-o})),s}function Fh(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperties(e,{_request_id:{value:t.headers.get("request-id"),enumerable:!1},_workspace_id:{value:t.headers.get("anthropic-workspace-id"),enumerable:!1}})}var R_=j(()=>{Lh();Xi();m_()});function gM(e){return typeof e=="object"&&e!==null&&dQ.has(e)}function pQ(e){let t=new Set;for(;typeof e=="object"&&e!==null&&!t.has(e);){if(t.add(e),gM(e)||Yr(e)||e instanceof Zi||e instanceof ap)return!0;e=e.cause}return!1}function hM(e,t,n,i){return async(r,o={})=>{if(t.length===0)return e.call(void 0,r,o);let s=o.headers instanceof Headers?o.headers:new Headers(o.headers),a=await UCe(e,t,n,i)({...o,headers:s,url:typeof r=="string"?r:r instanceof URL?r.href:r.url});if(a.bodyUsed||a.body?.locked)throw new J("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function FCe(e,t){let n=new WeakMap;return{options:e,logger:t?qe(t):J5(),parse(i){if(e?.stream&&i.ok)return uQ(i,e,t);let r=n.get(i);return r||(r=uQ(i,e,t),n.set(i,r)),r}}}async function uQ(e,t,n){if(e.bodyUsed||e.body?.locked)throw new J("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return Fr.fromSSEResponse(e.clone(),new AbortController,n);if(e.status===204)return null;if(t?.__binaryResponse)return e;let r=e.headers.get("content-type")?.split(";")[0]?.trim();return r?.includes("application/json")||r?.endsWith("+json")?e.headers.get("content-length")==="0"?void 0:Fh(await e.clone().json(),e):await e.clone().text()}function UCe(e,t,n,i){let r=async({url:s,...a})=>{try{return await e.call(void 0,s,a)}catch(c){let l=pl(c);throw dQ.add(l),l}},o=FCe(n,i);for(let s=t.length-1;s>=0;s--){let a=t[s],c=r;r=async l=>a(l,c,o)}return r}var dQ,fQ=j(()=>{Da();R_();Xi();kt();Lh();dQ=new WeakSet});var Uh,La,N_=j(()=>{gr();R_();La=class e extends Promise{constructor(t,n,i=A_){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=i,Uh.set(this,void 0),M(this,Uh,t,"f")}_thenUnwrap(t){return new e(v(this,Uh,"f"),this.responsePromise,async(n,i)=>Fh(t(await this.parseResponse(n,i),i),i.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(v(this,Uh,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};Uh=new WeakMap});var C_,jh,fp,pn,le,P_,De=j(()=>{gr();kt();R_();N_();hr();jh=class{constructor(t,n,i,r){C_.set(this,void 0),M(this,C_,t,"f"),this.options=r,this.response=n,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new J("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await v(this,C_,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(C_=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let n of t.getPaginatedItems())yield n}},fp=class extends La{constructor(t,n,i){super(t,n,async(r,o)=>new i(r,o.response,await A_(r,o),o.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let n of t)yield n}},pn=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.has_more=i.has_more||!1,this.first_id=i.first_id||null,this.last_id=i.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...Ih(this.options.query),before_id:n}}:null}let t=this.last_id;return t?{...this.options,query:{...Ih(this.options.query),after_id:t}}:null}},le=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Ih(this.options.query),page:t}}:null}},P_=class extends jh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null,this.prev_page=i.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Ih(this.options.query),page:t}}:null}}});function El(e,t,n){return bM(),new File(e,t??"unknown_file",n)}function zh(e,t){let n=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function zCe(e){let t=typeof e=="function"?e:e.fetch,n=mQ.get(t);if(n)return n;let i=(async()=>{try{let r="Response"in t?t.Response:(await t("data:,")).constructor,o=new FormData;return o.toString()!==await new r(o).text()}catch{return!0}})();return mQ.set(t,i),i}var bM,vM,xi,mQ,GCe,yM,gs=j(()=>{lp();bM=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};vM=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",xi=async(e,t,n=!0)=>({...e,body:await GCe(e.body,t,n)}),mQ=new WeakMap;GCe=async(e,t,n=!0)=>{if(!await zCe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let i=new FormData;return await Promise.all(Object.entries(e||{}).map(([r,o])=>yM(i,r,o,n))),i},yM=async(e,t,n,i)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,El([await n.blob()],zh(n,i),r))}else if(vM(n))e.append(t,El([await new Response(g_(n)).blob()],zh(n,i)));else if(n instanceof Blob)e.append(t,El([n],zh(n,i)||void 0,{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(r=>yM(e,t+"[]",r,i)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${t}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${t}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,o])=>yM(e,`${t}[${r}]`,o,i)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});async function Gh(e,t,n){if(bM(),e=await e,t||(t=zh(e,!0)),VCe(e))return e instanceof File&&t==null&&n==null?e:El([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(BCe(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),El(await wM(r),t,n)}let i=await wM(e);if(!n?.type){let r=i.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof r=="string"&&(n={...n,type:r})}return El(i,t,n)}async function wM(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(gQ(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(vM(e))for await(let n of e)t.push(...await wM(n));else{let n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${qCe(e)}`)}return t}function qCe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}var gQ,VCe,BCe,hQ=j(()=>{gs();gs();gQ=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",VCe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&gQ(e),BCe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function"});var kM=j(()=>{hQ()});var yQ=j(()=>{});var Z,Se=j(()=>{Z=class{constructor(t){this._client=t}}});function*HCe(e){if(!e)return;if(bQ in e){let{values:i,nulls:r}=e;yield*i.entries();for(let o of r)yield[o,null];return}let t=!1,n;e instanceof Headers?n=e.entries():GO(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let i of n){let r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");let o=GO(i[1])?i[1]:[i[1]],s=!1;for(let a of o)a!==void 0&&(t&&!s&&(s=!0,yield[r,D_]),yield[r,a])}}var bQ,D_,KCe,$M,I,Ne=j(()=>{hr();bQ=Symbol.for("brand.privateNullableHeaders");D_=Symbol("clear"),KCe=new Set(["x-stainless-helper"]),$M=(e,t)=>{let n=e?e.split(",").map(i=>i.trim()).filter(Boolean):[];for(let i of t.split(",").map(r=>r.trim()))i&&!n.includes(i)&&n.push(i);return n.join(", ")},I=e=>{let t=new Headers,n=new Set;for(let i of e){let r=new Set;for(let[o,s]of HCe(i)){let a=o.toLowerCase();if(KCe.has(a)){if(s===D_)continue;s===null?(t.delete(o),n.add(a)):(t.set(o,$M(t.get(o),s)),n.delete(a));continue}(s===D_||!r.has(a))&&(t.delete(o),r.add(a),s===D_)||(s===null?(t.delete(o),n.add(a)):(t.append(o,s),n.delete(a)))}}return{[bQ]:!0,values:t,nulls:n}}});function wQ(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var vQ,JCe,N,Me=j(()=>{kt();vQ=Object.freeze(Object.create(null)),JCe=(e=wQ)=>function(n,...i){if(n.length===1)return n[0];let r=!1,o=[],s=n.reduce((u,d,p)=>{/[?#]/.test(d)&&(r=!0);let f=i[p],m=(r?encodeURIComponent:e)(""+f);return p!==i.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??vQ)??vQ)?.toString)&&(m=f+"",o.push({start:u.length+d.length,length:m.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),u+d+(p===i.length?"":m)},""),a=s.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(a))!==null;)o.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(o.sort((u,d)=>u.start-d.start),o.length>0){let u=0,d=o.reduce((p,f)=>{let m=" ".repeat(f.start-u),g="^".repeat(f.length);return u=f.start+f.length,p+m+g},"");throw new J(`Path parameters result in path with invalid segments: +`+t.prev}function j_(e,t){var n=eO(e),i=[];if(n){i.length=e.length;for(var r=0;ree,decodeFieldSignature:()=>T9,decodeMethodSignature:()=>E9,readAssembly:()=>f$});function fCe(e){if(e.length<64||e.readUInt16LE(0)!==23117)return null;let t=e.readUInt32LE(60);if(t+24>e.length||e.readUInt32LE(t)!==17744)return null;let n=e.readUInt16LE(t+6),i=e.readUInt16LE(t+20),r=t+24;if(i===0)return null;let o=e.readUInt16LE(r),s=r+(o===523?112:96),a=[],c=r+i;for(let f=0;fe.length)break;a.push({virtualSize:e.readUInt32LE(m+8),virtualAddress:e.readUInt32LE(m+12),rawAddress:e.readUInt32LE(m+20)})}let l=e.readUInt32LE(s+112);if(l===0)return null;let u=k9(l,a);if(u===null||u+16>e.length)return null;let d=e.readUInt32LE(u+8),p=k9(d,a);return p===null?null:{offset:p,sections:a}}function k9(e,t){for(let n of t)if(e>=n.virtualAddress&&ee.length||e.readUInt32LE(t)!==1112167234)return null;let n=e.readUInt32LE(t+12),i=t+16+n+2,r=e.readUInt16LE(i);i+=2;let o=new Map;for(let c=0;c"||h.startsWith("<"))continue;let b=ACe(i,r,l,f),y=x9(i,m[3]),w=[],k=[];for(let $ of $9(m[4],f,r,4,o.length)){let S=o[$];if(!_9(S[0]))continue;let x=i.string(S[1]);x.startsWith("<")||(w.push(x),k.push(`${x}: ${T9(i,i.blob(S[2]))}`))}for(let $ of $9(m[5],f,r,5,s.length)){let S=s[$];if(!_9(S[2]))continue;let x=i.string(S[3]);x.startsWith("<")||/^(get_|set_|add_|remove_)/.test(x)||(w.push(x),k.push(`${x}${E9(i,i.blob(S[4]))}`))}for(let $ of u.get(f+1)??[]){let S=i.string(a[$][1]);S.startsWith("<")||(w.push(S),k.push(`${S} { get; set; }`))}for(let $ of d.get(f+1)??[]){let S=i.string(c[$][1]);S.startsWith("<")||(w.push(S),k.push(`event ${S}`))}p.push({fullName:b,kind:ICe(g,y),members:[...new Set(w)],signatures:[...new Set(k)]})}return p}function ICe(e,t){return e&_Ce?"interface":t==="System.Enum"?"enum":t==="System.ValueType"?"struct":t==="System.MulticastDelegate"||t==="System.Delegate"?"delegate":"class"}function ACe(e,t,n,i){let r=[],o=i;for(let s=0;s<16;s++){let a=t[o];if(!a)break;r.unshift(e.string(a[1]));let c=n.get(o+1);if(c===void 0){let l=e.string(a[2]);return l?`${l}.${r.join("+")}`:r.join("+")}o=c-1}return r.join("+")}function x9(e,t){let n=t&3,i=t>>2;if(i===0)return null;if(n===0){let r=e.table(ee.TypeDef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}if(n===1){let r=e.table(ee.TypeRef)[i-1];if(!r)return null;let o=e.string(r[2]),s=e.string(r[1]);return o?`${o}.${s}`:s}return null}function $9(e,t,n,i,r){let o=n[t+1]?.[i]??r+1,s=[];for(let a=e;a`}let o=Co(t,n);n+=o.width;let s=Ji(e,t,n);n=s.offset;let a=[];for(let c=0;c=t.length);c++){let l=Ji(e,t,n);n=l.offset,a.push(l.text)}return`${r}(${a.join(", ")}): ${s.text}`}function T9(e,t){return t.length<2?"?":Ji(e,t,1).text}function Ji(e,t,n){let i=n,r=t[i++];if(r===void 0)return{text:"?",offset:i};let o=RCe[r];if(o)return{text:o,offset:i};switch(r){case 15:{let s=Ji(e,t,i);return{text:`${s.text}*`,offset:s.offset}}case 16:{let s=Ji(e,t,i);return{text:`ref ${s.text}`,offset:s.offset}}case 29:{let s=Ji(e,t,i);return{text:`${s.text}[]`,offset:s.offset}}case 69:{let s=Ji(e,t,i);return{text:s.text,offset:s.offset}}case 17:case 18:{let s=Co(t,i);return i+=s.width,{text:x9(e,s.value)??"object",offset:i}}case 19:case 30:{let s=Co(t,i);return i+=s.width,{text:`${r===19?"T":"M"}${s.value}`,offset:i}}case 21:{let s=Ji(e,t,i);i=s.offset;let a=Co(t,i);i+=a.width;let c=[];for(let l=0;l`,offset:i}}case 20:{let s=Ji(e,t,i);i=s.offset;let a=Co(t,i);i+=a.width;for(let c of["sizes","lowBounds"]){let l=Co(t,i);i+=l.width;for(let u=0;u{"use strict";Ut={type:"u16"},Nt={type:"u32"},Kt={type:"string"},GO={type:"guid"},pr={type:"blob"},Pt=e=>({type:"rid",table:e}),vn=e=>({type:"coded",family:e}),ee={Module:0,TypeRef:1,TypeDef:2,Field:4,MethodDef:6,Param:8,InterfaceImpl:9,MemberRef:10,Constant:11,CustomAttribute:12,FieldMarshal:13,DeclSecurity:14,ClassLayout:15,FieldLayout:16,StandAloneSig:17,EventMap:18,Event:20,PropertyMap:21,Property:23,MethodSemantics:24,MethodImpl:25,ModuleRef:26,TypeSpec:27,ImplMap:28,FieldRVA:29,Assembly:32,AssemblyRef:35,File:38,ExportedType:39,ManifestResource:40,NestedClass:41,GenericParam:42,MethodSpec:43,GenericParamConstraint:44},gCe={TypeDefOrRef:[ee.TypeDef,ee.TypeRef,ee.TypeSpec],HasConstant:[ee.Field,ee.Param,ee.Property],HasCustomAttribute:[ee.MethodDef,ee.Field,ee.TypeRef,ee.TypeDef,ee.Param,ee.InterfaceImpl,ee.MemberRef,ee.Module,ee.DeclSecurity,ee.Property,ee.Event,ee.StandAloneSig,ee.ModuleRef,ee.TypeSpec,ee.Assembly,ee.AssemblyRef,ee.File,ee.ExportedType,ee.ManifestResource,ee.GenericParam,ee.GenericParamConstraint,ee.MethodSpec],HasFieldMarshal:[ee.Field,ee.Param],HasDeclSecurity:[ee.TypeDef,ee.MethodDef,ee.Assembly],MemberRefParent:[ee.TypeDef,ee.TypeRef,ee.ModuleRef,ee.MethodDef,ee.TypeSpec],HasSemantics:[ee.Event,ee.Property],MethodDefOrRef:[ee.MethodDef,ee.MemberRef],MemberForwarded:[ee.Field,ee.MethodDef],Implementation:[ee.File,ee.AssemblyRef,ee.ExportedType],CustomAttributeType:[null,null,ee.MethodDef,ee.MemberRef,null],ResolutionScope:[ee.Module,ee.ModuleRef,ee.AssemblyRef,ee.TypeRef],TypeOrMethodDef:[ee.TypeDef,ee.MethodDef]},hCe={0:[Ut,Kt,GO,GO,GO],1:[vn("ResolutionScope"),Kt,Kt],2:[Nt,Kt,Kt,vn("TypeDefOrRef"),Pt(ee.Field),Pt(ee.MethodDef)],3:[Pt(ee.Field)],4:[Ut,Kt,pr],5:[Pt(ee.MethodDef)],6:[Nt,Ut,Ut,Kt,pr,Pt(ee.Param)],7:[Pt(ee.Param)],8:[Ut,Ut,Kt],9:[Pt(ee.TypeDef),vn("TypeDefOrRef")],10:[vn("MemberRefParent"),Kt,pr],11:[Ut,vn("HasConstant"),pr],12:[vn("HasCustomAttribute"),vn("CustomAttributeType"),pr],13:[vn("HasFieldMarshal"),pr],14:[Ut,vn("HasDeclSecurity"),pr],15:[Ut,Nt,Pt(ee.TypeDef)],16:[Nt,Pt(ee.Field)],17:[pr],18:[Pt(ee.TypeDef),Pt(ee.Event)],19:[Pt(ee.Event)],20:[Ut,Kt,vn("TypeDefOrRef")],21:[Pt(ee.TypeDef),Pt(ee.Property)],22:[Pt(ee.Property)],23:[Ut,Kt,pr],24:[Ut,Pt(ee.MethodDef),vn("HasSemantics")],25:[Pt(ee.TypeDef),vn("MethodDefOrRef"),vn("MethodDefOrRef")],26:[Kt],27:[pr],28:[Ut,vn("MemberForwarded"),Kt,Pt(ee.ModuleRef)],29:[Nt,Pt(ee.Field)],30:[Nt,Nt],31:[Nt],32:[Nt,Ut,Ut,Ut,Ut,Nt,pr,Kt,Kt],33:[Nt],34:[Nt,Nt,Nt],35:[Ut,Ut,Ut,Ut,Nt,pr,Kt,Kt,pr],36:[Nt,Pt(ee.AssemblyRef)],37:[Nt,Nt,Nt,Pt(ee.AssemblyRef)],38:[Nt,Kt,pr],39:[Nt,Nt,Kt,Kt,vn("Implementation")],40:[Nt,Nt,Kt,vn("Implementation")],41:[Pt(ee.TypeDef),Pt(ee.TypeDef)],42:[Ut,Ut,vn("TypeOrMethodDef"),Kt],43:[vn("MethodDefOrRef"),pr],44:[Pt(ee.GenericParam),vn("TypeDefOrRef")]},VO=class{constructor(t,n,i){this.strings=t;this.blobs=n;let r=i.readUInt8(6),o=i.readBigUInt64LE(8),s=new Map,a=24;for(let u=0;u<64;u++)o>>BigInt(u)&1n&&(s.set(u,i.readUInt32LE(a)),a+=4);let c={string:r&1?4:2,guid:r&2?4:2,blob:r&4?4:2},l=u=>{switch(u.type){case"u16":return 2;case"u32":return 4;case"string":return c.string;case"guid":return c.guid;case"blob":return c.blob;case"rid":return(s.get(u.table)??0)<65536?2:4;case"coded":{let d=gCe[u.family],p=Math.ceil(Math.log2(d.length));return Math.max(...d.map(m=>m===null?0:s.get(m)??0))<1<<16-p?2:4}}};for(let[u,d]of s){let p=hCe[u];if(!p)break;let f=p.map(l),m=f.reduce((h,b)=>h+b,0),g=[];for(let h=0;hi.length);h++){let b=[],y=a;for(let w of f)b.push(w===2?i.readUInt16LE(y):i.readUInt32LE(y)),y+=w;g.push(b),a+=m}this.rows.set(u,g)}}strings;blobs;rows=new Map;table(t){return this.rows.get(t)??[]}string(t){if(t>=this.strings.length)return"";let n=t;for(;n=this.blobs.length)return Buffer.alloc(0);let{value:n,width:i}=Co(this.blobs,t);return this.blobs.subarray(t+i,t+i+n)}};yCe=7,bCe=1,vCe=2,wCe=4,kCe=7,_Ce=32,$Ce=7,SCe=4,xCe=6,ECe=5;RCe={1:"void",2:"bool",3:"char",4:"sbyte",5:"byte",6:"short",7:"ushort",8:"int",9:"uint",10:"long",11:"ulong",12:"float",13:"double",14:"string",22:"TypedReference",24:"IntPtr",25:"UIntPtr",28:"object"}});function M(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function v(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}var fr=j(()=>{});function Zr(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var ml,Da=j(()=>{ml=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{let t=Object.prototype.toString.call(e);if(t==="[object Error]"||t==="[object DOMException]"){let n=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(n.stack=e.stack),e.cause&&!n.cause&&(n.cause=e.cause),e.name&&(n.name=e.name),n}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)}});var J,Dt,En,Zi,gl,cp,hl,yl,bl,vl,wl,kl,_l,$l,kt=j(()=>{Da();J=class extends Error{},Dt=class e extends J{constructor(t,n,i,r,o){super(`${e.makeMessage(t,n,i)}`),this.status=t,this.headers=r,this.requestID=r?.get("request-id"),this.workspaceID=r?.get("anthropic-workspace-id"),this.error=n,this.type=o??null}static makeMessage(t,n,i){let r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):i;return t&&r?`${t} ${r}`:t?`${t} status code (no body)`:r||"(no status code or body)"}static generate(t,n,i,r){if(!t||!r)return new Zi({message:i,cause:ml(n)});let o=n,s=o?.error?.type;return t===400?new hl(t,o,i,r,s):t===401?new yl(t,o,i,r,s):t===403?new bl(t,o,i,r,s):t===404?new vl(t,o,i,r,s):t===409?new wl(t,o,i,r,s):t===422?new kl(t,o,i,r,s):t===429?new _l(t,o,i,r,s):t>=500?new $l(t,o,i,r,s):new e(t,o,i,r,s)}},En=class extends Dt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},Zi=class extends Dt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},gl=class extends Zi{constructor({message:t}={}){super({message:t??"Request timed out."})}},cp=class extends J{constructor(t,{cause:n}={}){super(t??"Retryable error."),n!==void 0&&(this.cause=n)}},hl=class extends Dt{},yl=class extends Dt{},bl=class extends Dt{},vl=class extends Dt{},wl=class extends Dt{},kl=class extends Dt{},_l=class extends Dt{},$l=class extends Dt{}});function Oh(e){return typeof e!="object"?{}:e??{}}function YO(e){if(!e)return!0;for(let t in e)return!1;return!0}function w5(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function QO(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var $Ne,v5,Xn,ZO,b$,Sl,mr=j(()=>{kt();$Ne=/^[a-z][a-z0-9+.-]*:/i,v5=e=>$Ne.test(e),Xn=e=>(Xn=Array.isArray,Xn(e)),ZO=Xn;b$=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new J(`${e} must be an integer`);if(t<0)throw new J(`${e} must be a positive integer`);return t},Sl=e=>{try{return JSON.parse(e)}catch{return}}});var Yi,lp=j(()=>{Yi=(e,t)=>new Promise(n=>{if(t?.aborted)return n();let i=()=>{clearTimeout(r),n()},r=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e);t?.addEventListener("abort",i,{once:!0})})});var Si,Mh=j(()=>{Si="0.125.0"});function SNe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function ENe(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:n}of e){let i=n.exec(navigator.userAgent);if(i){let r=i[1]||0,o=i[2]||0,s=i[3]||0;return{browser:t,version:`${r}.${o}.${s}`}}}return null}var S5,xNe,k5,_5,$5,Lh,v$=j(()=>{Mh();S5=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";xNe=()=>{let e=SNe();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":_5(Deno.build.os),"X-Stainless-Arch":k5(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process?.version??"unknown"};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":_5(globalThis.process.platform??"unknown"),"X-Stainless-Arch":k5(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=ENe();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Si,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};k5=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",_5=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),Lh=()=>$5??($5=xNe())});function TNe(e,t){return()=>e.removeEventListener("abort",t)}function E5(e,t,n){w$.set(e,TNe(t,n))}function T5(e,t){w$.has(t)&&x5?.register(e,t,t)}function No(e){let t=w$.get(e);t&&(w$.delete(e),x5?.unregister(e),t())}var w$,x5,k$=j(()=>{w$=new WeakMap,x5=typeof globalThis.FinalizationRegistry=="function"?new globalThis.FinalizationRegistry(e=>No(e)):null});function I5(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function XO(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function _$(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return XO({start(){},async pull(n){let{done:i,value:r}=await t.next();i?n.close():n.enqueue(r)},async cancel(){await t.return?.()}})}function Fh(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function A5(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var up=j(()=>{});var Uh,R5,eM=j(()=>{Uh=class{},R5=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)})});var tM,nM,rM,C5,iM=j(()=>{tM="RFC3986",nM=e=>String(e),rM={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:nM},C5="RFC1738"});function P5(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function sM(e,t){if(Xn(e)){let n=[];for(let i=0;i{iM();mr();$$=(e,t)=>($$=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),$$(e,t)),Po=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),oM=1024,N5=(e,t,n,i,r)=>{if(e.length===0)return e;let o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=oM?o.slice(a,a+oM):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||r===C5&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Po[d];continue}if(d<2048){l[l.length]=Po[192|d>>6]+Po[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Po[224|d>>12]+Po[128|d>>6&63]+Po[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Po[240|d>>18]+Po[128|d>>12&63]+Po[128|d>>6&63]+Po[128|d&63]}s+=l.join("")}return s}});function RNe(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}function F5(e,t,n,i,r,o,s,a,c,l,u,d,p,f,m,g,h,b){let y=e,w=b,k=0,$=!1;for(;(w=w.get(aM))!==void 0&&!$;){let A=w.get(e);if(k+=1,typeof A<"u"){if(A===k)throw new RangeError("Cyclic object value");$=!0}typeof w.get(aM)>"u"&&(k=0)}if(typeof l=="function"?y=l(t,y):y instanceof Date?y=p?.(y):n==="comma"&&Xn(y)&&(y=sM(y,function(A){return A instanceof Date?p?.(A):A})),y===null){if(o)return c&&!g?c(t,wn.encoder,h,"key",f):t;y=""}if(RNe(y)||P5(y)){if(c){let A=g?t:c(t,wn.encoder,h,"key",f);return[m?.(A)+"="+m?.(c(y,wn.encoder,h,"value",f))]}return[m?.(t)+"="+m?.(String(y))]}let S=[];if(typeof y>"u")return S;let x;if(n==="comma"&&Xn(y))g&&c&&(y=sM(y,c)),x=[{value:y.length>0?y.join(",")||null:void 0}];else if(Xn(l))x=l;else{let A=Object.keys(y);x=u?A.sort(u):A}let E=a?String(t).replace(/\./g,"%2E"):String(t),T=i&&Xn(y)&&y.length===1?E+"[]":E;if(r&&Xn(y)&&y.length===0)return T+"[]";for(let A=0;A"u"?e.encodeDotInKeys?!0:wn.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:wn.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:wn.allowEmptyArrays,arrayFormat:o,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:wn.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?wn.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:wn.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:wn.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:wn.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:wn.encodeValuesOnly,filter:r,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:wn.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:wn.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:wn.strictNullHandling}}function U5(e,t={}){let n=e,i=CNe(t),r,o;typeof i.filter=="function"?(o=i.filter,n=o("",n)):Xn(i.filter)&&(o=i.filter,r=o);let s=[];if(typeof n!="object"||n===null)return"";let a=M5[i.arrayFormat],c=a==="comma"&&i.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);let l=new WeakMap;for(let p=0;p0?d+u:""}var M5,L5,O5,wn,aM,j5=j(()=>{D5();iM();mr();M5={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},L5=function(e,t){Array.prototype.push.apply(e,Xn(t)?t:[t])},wn={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:N5,encodeValuesOnly:!1,format:tM,formatter:nM,indices:!1,serializeDate(e){return(O5??(O5=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};aM={}});function z5(e){return U5(e,{arrayFormat:"brackets"})}var cM=j(()=>{j5()});var Do={};kr(Do,{child_process:()=>lM,crypto:()=>Oa,fs:()=>fs,os:()=>PNe,path:()=>xe,stream:()=>S$,util:()=>uM});var lM,Oa,fs,PNe,xe,S$,uM,Or=j(()=>{lM=gt(require("node:child_process"),1),Oa=gt(require("node:crypto"),1),fs=gt(require("node:fs"),1),PNe=gt(require("node:os"),1),xe=gt(require("node:path"),1),S$=gt(require("node:stream"),1),uM=gt(require("node:util"),1)});function E$(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new dt(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1")))throw new dt(`Refusing to send credential over non-https token endpoint "${e}"`)}async function T$(e,t){let n=await ONe(e),i;try{i=JSON.parse(n)}catch{throw new dt(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Mr(n),t)}if(!i.access_token)throw new dt(`Token endpoint response missing access_token: ${JSON.stringify(Mr(i))}`,e.status,Mr(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new dt(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,Mr(i),t);return i}function Mr(e){if(e==null)return e;if(typeof e=="string"){let t;try{t=JSON.parse(e)}catch{return e.length<=dM?e:e.slice(0,dM)+`... <${e.length-dM} more chars>`}return JSON.stringify(Mr(t))}if(typeof e=="object"&&!Array.isArray(e)){let t={};for(let[n,i]of Object.entries(e))DNe.has(n)&&(t[n]=i);return t}return null}async function I$(e,t=n=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let{fs:n}=await Promise.resolve().then(()=>(Or(),Do)),i=e,r;try{i=await n.promises.realpath(e),r=await n.promises.stat(i)}catch{return}let o=r.mode&511;if(o&18)throw new dt(`Credentials file at ${i} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(o&36)throw new dt(`Credentials file at ${i} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);typeof process.getuid=="function"&&r.uid!==process.getuid()&&t(`credentials file at ${i} is owned by uid ${r.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function A$(e,t){let{fs:n,path:i}=await Promise.resolve().then(()=>(Or(),Do)),r=i.dirname(e);await n.promises.mkdir(r,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await n.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await n.promises.rename(o,e)}catch(s){throw await n.promises.unlink(o).catch(()=>{}),s}try{let s=await n.promises.open(r,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function ONe(e){if(!e.body)return"";let t=e.body.getReader(),n=[],i=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(i+s.length>G5){let a=G5-i;a>0&&n.push(s.subarray(0,a)),await t.cancel();break}n.push(s),i+=s.length}let r;if(n.length===1)r=n[0];else{r=new Uint8Array(n.reduce((s,a)=>s+a.length,0));let o=0;for(let s of n)r.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(r)}var V5,B5,x$,xl,q5,W5,dp,K5,G5,dM,DNe,dt,pp=j(()=>{kt();V5="urn:ietf:params:oauth:grant-type:jwt-bearer",B5="refresh_token",x$="/v1/oauth/token",xl="oauth-2025-04-20",q5="oidc-federation-2026-04-01",W5=120,dp=30,K5=5,G5=1<<20;dM=2e3,DNe=new Set(["error","error_description","error_uri"]);dt=class extends J{constructor(t,n=null,i=null,r=null){super(t),this.statusCode=n,this.body=i,this.requestId=r}}});function Qi(){return Math.floor(Date.now()/1e3)}var jh=j(()=>{});var R$,H5=j(()=>{pp();jh();R$=class{constructor(t,n){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=t,this.onAdvisoryRefreshError=n}async getToken(){let t=this.nextForce;this.nextForce=!1;let n=this.cached;if(t||n==null)return(await this.refresh(t)).token;if(n.expiresAt==null)return n.token;let i=n.expiresAt-Qi();return i>W5?n.token:i>dp?(this.backgroundRefresh(),n.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(t=!1){return this.pendingRefresh&&!t?this.pendingRefresh:this.doRefresh(t)}backgroundRefresh(){this.pendingRefresh||Qi()-this.lastAdvisoryError{this.lastAdvisoryError=Qi(),this.onAdvisoryRefreshError?.(t)})}doRefresh(t=!1){return this.pendingRefresh=this.provider(t?{forceRefresh:!0}:void 0).then(n=>(this.cached=n,this.pendingRefresh=null,n),n=>{throw this.pendingRefresh=null,n}),this.pendingRefresh}}});var ze,fp=j(()=>{ze=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0}});function Y5(e){let t=0;for(let r of e)t+=r.length;let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.length;return n}function Ma(e){let t;return(J5??(t=new globalThis.TextEncoder,J5=t.encode.bind(t)))(e)}function El(e){let t;return(Z5??(t=new globalThis.TextDecoder,Z5=t.decode.bind(t)))(e)}var J5,Z5,Tl=j(()=>{});var Q5,pM=j(()=>{kt();Tl();Q5=e=>{if(typeof globalThis.Buffer<"u"){let t=globalThis.Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof atob<"u"){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;iN$[n]?zh:t[e].bind(t)}function mM(e,t){let n=X5.get(e);if(n&&n[0]===t)return n[1];let i={error:C$("error",e,t),warn:C$("warn",e,t),info:C$("info",e,t),debug:C$("debug",e,t)};return X5.set(e,[t,i]),i}function qe(e){let t=e.logger,n=e.logLevel??"off";return t?mM(t,n):MNe}function tQ(){let e=ze("ANTHROPIC_LOG");return(!fM||e!==eQ)&&(eQ=e,fM=mM(console,P$(e,"process.env['ANTHROPIC_LOG']",mM(console,Gh))??Gh)),fM}var Gh,N$,P$,MNe,X5,eQ,fM,Oo,Xi=j(()=>{mr();fp();Gh="warn",N$={off:0,error:200,warn:300,info:400,debug:500},P$=(e,t,n)=>{if(e){if(w5(N$,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(N$))}`)}};MNe={error:zh,warn:zh,info:zh,debug:zh},X5=new WeakMap;Oo=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)});var D$,gM=j(()=>{D$=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return D$=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,i=>(+i^n()&15>>+i/4).toString(16))}});var hM=j(()=>{mr();pM();fp();Xi();gM();lp();cM()});function nQ(e){if(!e)throw new Error("profile name is empty");if(e==="."||e==="..")throw new Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw new Error(`profile name "${e}" must not contain path separators`);if(!LNe.test(e))throw new Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var O$,LNe,rQ,iQ,yM,FNe,oQ,bM=j(()=>{v$();hM();O$="1.0",LNe=/^[A-Za-z0-9_.-]+$/;rQ=async e=>{var t,n;let i=await yM();if(i===null)return null;let r=e??await oQ();if(r===null)return null;nQ(r);let{fs:o,path:s}=await Promise.resolve().then(()=>(Or(),Do)),a=s.join(i,"configs",`${r}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=ze("ANTHROPIC_ORGANIZATION_ID"),p=ze("ANTHROPIC_IDENTITY_TOKEN_FILE"),f=ze("ANTHROPIC_FEDERATION_RULE_ID");return f&&d?{fromFile:!1,config:{organization_id:d,workspace_id:ze("ANTHROPIC_WORKSPACE_ID"),base_url:ze("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:f,service_account_id:ze("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:p?{source:"file",path:p}:void 0,scope:ze("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=ze("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=ze("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=ze("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=ze("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=ze("ANTHROPIC_FEDERATION_RULE_ID")??""),(n=l.authentication).service_account_id??(n.service_account_id=ze("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},iQ=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await yM();if(!n)return null;let i=t??await oQ();if(!i)return null;nQ(i);let{path:r}=await Promise.resolve().then(()=>(Or(),Do));return r.join(n,"credentials",`${i}.json`)},yM=async()=>{if(!FNe())return null;let{path:e}=await Promise.resolve().then(()=>(Or(),Do)),t=ze("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Lh()["X-Stainless-OS"]==="Windows"){let o=ze("APPDATA");if(o)return e.join(o,"Anthropic");let s=ze("USERPROFILE");return s?e.join(s,"AppData","Roaming","Anthropic"):null}let i=ze("XDG_CONFIG_HOME");if(i)return e.join(i,"anthropic");let r=ze("HOME");return r?e.join(r,".config","anthropic"):null},FNe=()=>{let e=Lh()["X-Stainless-Runtime"];return e==="node"||e==="deno"},oQ=async()=>{let e=await yM();if(!e)return null;let t=ze("ANTHROPIC_PROFILE");if(t)return t;let{fs:n,path:i}=await Promise.resolve().then(()=>(Or(),Do)),r=i.join(e,"active_config");try{return(await n.promises.readFile(r,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${r}: ${o}`);return"default"}}});function vM(e){if(!e)throw new J("Identity token file path is empty");return async()=>{let{fs:t}=await Promise.resolve().then(()=>(Or(),Do)),n;try{n=await t.promises.readFile(e,"utf-8")}catch(r){throw new J(`Failed to read identity token file at ${e}: ${r}`)}let i=n.trim();if(!i)throw new J(`Identity token file at ${e} is empty`);return i}}function sQ(e){if(!e)throw new J("Identity token value is empty");return()=>e}var aQ=j(()=>{kt()});function cQ(e){return async()=>{E$(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16*1024)throw new dt(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:V5,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};e.serviceAccountId&&(n.service_account_id=e.serviceAccountId),e.workspaceId&&(n.workspace_id=e.workspaceId);let i=`${e.baseURL}${x$}`,r;try{r=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${xl},${q5}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Si} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new dt(`Failed to reach token endpoint ${i}: ${c}`)}let o=r.headers.get("Request-Id");if(!r.ok){let c=await r.text().catch(()=>""),l=Mr(c),u="";throw r.status===401&&(u=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new dt(`Token exchange failed with status ${r.status}${o?` (request-id ${o})`:""}: ${l}${u}`,r.status,l,o)}let s=await T$(r,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new dt(`Token endpoint response missing required fields: ${JSON.stringify(Mr(s))}`,r.status,Mr(s),o);return{token:s.access_token,expiresAt:Qi()+a}}}var lQ=j(()=>{pp();jh();Mh()});function uQ(e){return async t=>{let{fs:n}=await Promise.resolve().then(()=>(Or(),Do));await I$(e.credentialsPath,e.onSafetyWarning);let i;try{i=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(h){throw new dt(`Credentials file not found at ${e.credentialsPath}: ${h}`)}let r;try{r=JSON.parse(i)}catch(h){throw new dt(`Credentials file at ${e.credentialsPath} is not valid JSON: ${h}`)}let o=r.access_token;if(!o)throw new dt(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=r.expires_at;if(!t?.forceRefresh&&(s==null||Qi()"");throw new dt(`User OAuth refresh failed (HTTP ${u.status}): ${Mr(h)}`,u.status,Mr(h),d)}let p=await T$(u,d),f=Number(p.expires_in);if(!Number.isFinite(f))throw new dt(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Mr(p))}`,u.status,Mr(p),d);let m=Qi()+f,g=p.refresh_token||a;return await A$(e.credentialsPath,{...r,version:O$,type:"oauth_token",access_token:p.access_token,expires_at:m,refresh_token:g}),{token:p.access_token,expiresAt:m}}}var dQ=j(()=>{bM();pp();jh();Mh()});function wM(e,t){let n=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),r=UNe(e,n,i,t),o={};return e.workspace_id&&e.authentication.type==="user_oauth"&&(o["anthropic-workspace-id"]=e.workspace_id),{provider:r,extraHeaders:o,baseURL:e.base_url||void 0}}async function pQ(e,t){let n=await rQ(t);if(!n)return null;let{config:i,fromFile:r}=n,o=i.authentication.credentials_path||!r?i:{...i,authentication:{...i.authentication,credentials_path:await iQ(i,t)??void 0}};return wM(o,e)}function UNe(e,t,n,i){switch(e.authentication.type){case"oidc_federation":{let r=e.authentication,o=jNe(r);if(!o)throw new dt("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!r.federation_rule_id)throw new dt("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new dt("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=cQ({identityTokenProvider:o,federationRuleId:r.federation_rule_id,organizationId:e.organization_id,serviceAccountId:r.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent});return t?zNe(s,t,i.onCacheWriteError,i.onSafetyWarning):s}case"user_oauth":{if(!t)throw new dt("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return uQ({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let r=e.authentication.type;throw new dt(`authentication.type "${r}" is not a known authentication type`)}}}function jNe(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new dt(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new dt('identity_token.source "file" requires a non-empty path');return vM(e.identity_token.path)}let t=ze("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return vM(t);let n=ze("ANTHROPIC_IDENTITY_TOKEN");return n?sQ(n):null}function zNe(e,t,n,i){return async r=>{let{fs:o}=await Promise.resolve().then(()=>(Or(),Do));await I$(t,i);let s;try{let c=await o.promises.readFile(t,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!r?.forceRefresh){let u=s?.expires_at;if(u==null||Qi(){fp();bM();pp();jh();aQ();lQ();dQ()});function GNe(e,t){for(let r=t??0;r{fr();Tl();ms=class{constructor(){Yr.set(this,void 0),Qr.set(this,void 0),M(this,Yr,new Uint8Array,"f"),M(this,Qr,null,"f")}decode(t){if(t==null)return[];let n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Ma(t):t;M(this,Yr,Y5([v(this,Yr,"f"),n]),"f");let i=[],r;for(;(r=GNe(v(this,Yr,"f"),v(this,Qr,"f")))!=null;){if(r.carriage&&v(this,Qr,"f")==null){M(this,Qr,r.index,"f");continue}if(v(this,Qr,"f")!=null&&(r.index!==v(this,Qr,"f")+1||r.carriage)){i.push(El(v(this,Yr,"f").subarray(0,v(this,Qr,"f")-1))),M(this,Yr,v(this,Yr,"f").subarray(v(this,Qr,"f")),"f"),M(this,Qr,null,"f");continue}let o=v(this,Qr,"f")!==null?r.preceding-1:r.preceding,s=El(v(this,Yr,"f").subarray(0,o));i.push(s),M(this,Yr,v(this,Yr,"f").subarray(r.index),"f"),M(this,Qr,null,"f")}return i}flush(){return v(this,Yr,"f").length?this.decode(` +`):[]}};Yr=new WeakMap,Qr=new WeakMap;ms.NEWLINE_CHARS=new Set([` +`,"\r"]);ms.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*gQ(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new J("Attempted to iterate over a response with no body");let n=new _M,i=new ms,r=Fh(e.body);for await(let o of VNe(r))for(let s of i.decode(o)){let a=n.decode(s);a&&(yield a)}for(let o of i.flush()){let s=n.decode(o);s&&(yield s)}}async function*VNe(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let i=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Ma(n):n,r=new Uint8Array(t.length+i.length);r.set(t),r.set(i,t.length),t=r;let o;for(;(o=mQ(t))!==-1;)yield t.subarray(0,o),t=t.subarray(o)}t.length>0&&(yield t)}function BNe(e,t){let n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}var Vh,Lr,_M,Bh=j(()=>{fr();kt();up();kM();up();Da();mr();Tl();Xi();kt();k$();Lr=class e{constructor(t,n,i){this.iterator=t,Vh.set(this,void 0),this.controller=n,M(this,Vh,i,"f")}static rawEvents(t,n=new AbortController){return gQ(t,n)}static fromSSEResponse(t,n,i){let r=!1,o=i?qe(i):console;async function*s(){if(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of gQ(t,n)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop"||c.event==="message"||c.event==="user.message"||c.event==="user.interrupt"||c.event==="user.tool_confirmation"||c.event==="user.custom_tool_result"||c.event==="user.tool_result"||c.event==="agent.message"||c.event==="agent.thinking"||c.event==="agent.tool_use"||c.event==="agent.tool_result"||c.event==="agent.mcp_tool_use"||c.event==="agent.mcp_tool_result"||c.event==="agent.custom_tool_use"||c.event==="agent.thread_context_compacted"||c.event==="session.status_running"||c.event==="session.status_idle"||c.event==="session.status_rescheduled"||c.event==="session.status_terminated"||c.event==="session.error"||c.event==="session.deleted"||c.event==="session.updated"||c.event==="span.model_request_start"||c.event==="span.model_request_end"||c.event==="span.outcome_evaluation_start"||c.event==="span.outcome_evaluation_ongoing"||c.event==="span.outcome_evaluation_end"||c.event==="user.define_outcome"||c.event==="agent.thread_message_received"||c.event==="agent.thread_message_sent"||c.event==="agent.session_thread_message_received"||c.event==="agent.session_thread_message_sent"||c.event==="session.thread_created"||c.event==="session.thread_status_created"||c.event==="session.thread_status_running"||c.event==="session.thread_status_idle"||c.event==="session.thread_status_rescheduled"||c.event==="session.thread_status_terminated"||c.event==="event_start"||c.event==="event_delta"||c.event==="system.message")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event!=="ping"&&c.event==="error"){let l=Sl(c.data)??c.data,u=l?.error?.type;throw new Dt(void 0,l,void 0,t.headers,u)}}a=!0}catch(c){if(Zr(c))return;throw c}finally{a||n.abort(),No(n)}}return new e(s,n,i)}static fromReadableStream(t,n,i){let r=!1;async function*o(){let a=new ms,c=Fh(t);for await(let l of c)for(let u of a.decode(l))yield u;for(let l of a.flush())yield l}async function*s(){if(r)throw new J("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(Zr(c))return;throw c}finally{a||n.abort(),No(n)}}return new e(s,n,i)}[(Vh=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],i=this.iterator(),r=o=>({next:()=>{if(o.length===0){let s=i.next();t.push(s),n.push(s)}return o.shift()}});return[new e(()=>r(t),this.controller,v(this,Vh,"f")),new e(()=>r(n),this.controller,v(this,Vh,"f"))]}toReadableStream(){let t=this,n;return XO({async start(){n=t[Symbol.asyncIterator]()},async pull(i){try{let{value:r,done:o}=await n.next();if(o)return i.close();let s=Ma(JSON.stringify(r)+` +`);i.enqueue(s)}catch(r){i.error(r)}},async cancel(){await n.return?.()}})}};_M=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,i,r]=BNe(t,":");return r.startsWith(" ")&&(r=r.substring(1)),n==="event"?this.event=r:n==="data"&&this.data.push(r),null}}});async function M$(e,t){let{response:n,requestLogID:i,retryOfRequestLogID:r,startTime:o}=t,s=await(async()=>{if(t.options.stream)return qe(e).debug("response",n.status,n.url,n.headers,n.body),Lr.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let p=await n.json();return qh(p,n)}return await n.text()})().finally(()=>{!t.options.stream&&!t.options.__binaryResponse&&No(t.controller)});return qe(e).debug(`[${i}] response parsed`,Oo({retryOfRequestLogID:r,url:n.url,status:n.status,body:s,durationMs:Date.now()-o})),s}function qh(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperties(e,{_request_id:{value:t.headers.get("request-id"),enumerable:!1},_workspace_id:{value:t.headers.get("anthropic-workspace-id"),enumerable:!1}})}var L$=j(()=>{Bh();Xi();k$()});function $M(e){return typeof e=="object"&&e!==null&&yQ.has(e)}function bQ(e){let t=new Set;for(;typeof e=="object"&&e!==null&&!t.has(e);){if(t.add(e),$M(e)||Zr(e)||e instanceof Zi||e instanceof cp)return!0;e=e.cause}return!1}function SM(e,t,n,i){return async(r,o={})=>{if(t.length===0)return e.call(void 0,r,o);let s=o.headers instanceof Headers?o.headers:new Headers(o.headers),a=await WNe(e,t,n,i)({...o,headers:s,url:typeof r=="string"?r:r instanceof URL?r.href:r.url});if(a.bodyUsed||a.body?.locked)throw new J("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function qNe(e,t){let n=new WeakMap;return{options:e,logger:t?qe(t):tQ(),parse(i){if(e?.stream&&i.ok)return hQ(i,e,t);let r=n.get(i);return r||(r=hQ(i,e,t),n.set(i,r)),r}}}async function hQ(e,t,n){if(e.bodyUsed||e.body?.locked)throw new J("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return Lr.fromSSEResponse(e.clone(),new AbortController,n);if(e.status===204)return null;if(t?.__binaryResponse)return e;let r=e.headers.get("content-type")?.split(";")[0]?.trim();return r?.includes("application/json")||r?.endsWith("+json")?e.headers.get("content-length")==="0"?void 0:qh(await e.clone().json(),e):await e.clone().text()}function WNe(e,t,n,i){let r=async({url:s,...a})=>{try{return await e.call(void 0,s,a)}catch(c){let l=ml(c);throw yQ.add(l),l}},o=qNe(n,i);for(let s=t.length-1;s>=0;s--){let a=t[s],c=r;r=async l=>a(l,c,o)}return r}var yQ,vQ=j(()=>{Da();L$();Xi();kt();Bh();yQ=new WeakSet});var Wh,La,F$=j(()=>{fr();L$();La=class e extends Promise{constructor(t,n,i=M$){super(r=>{r(null)}),this.responsePromise=n,this.parseResponse=i,Wh.set(this,void 0),M(this,Wh,t,"f")}_thenUnwrap(t){return new e(v(this,Wh,"f"),this.responsePromise,async(n,i)=>qh(t(await this.parseResponse(n,i),i),i.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("request-id"),workspace_id:n.headers.get("anthropic-workspace-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(v(this,Wh,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};Wh=new WeakMap});var U$,Kh,mp,dn,le,j$,Pe=j(()=>{fr();kt();L$();F$();mr();Kh=class{constructor(t,n,i,r){U$.set(this,void 0),M(this,U$,t,"f"),this.options=r,this.response=n,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new J("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await v(this,U$,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(U$=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let n of t.getPaginatedItems())yield n}},mp=class extends La{constructor(t,n,i){super(t,n,async(r,o)=>new i(r,o.response,await M$(r,o),o.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let n of t)yield n}},dn=class extends Kh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.has_more=i.has_more||!1,this.first_id=i.first_id||null,this.last_id=i.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let n=this.first_id;return n?{...this.options,query:{...Oh(this.options.query),before_id:n}}:null}let t=this.last_id;return t?{...this.options,query:{...Oh(this.options.query),after_id:t}}:null}},le=class extends Kh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Oh(this.options.query),page:t}}:null}},j$=class extends Kh{constructor(t,n,i,r){super(t,n,i,r),this.data=i.data||[],this.next_page=i.next_page||null,this.prev_page=i.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let t=this.next_page;return t?{...this.options,query:{...Oh(this.options.query),page:t}}:null}}});function Il(e,t,n){return EM(),new File(e,t??"unknown_file",n)}function Hh(e,t){let n=typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function HNe(e){let t=typeof e=="function"?e:e.fetch,n=wQ.get(t);if(n)return n;let i=(async()=>{try{let r="Response"in t?t.Response:(await t("data:,")).constructor,o=new FormData;return o.toString()!==await new r(o).text()}catch{return!0}})();return wQ.set(t,i),i}var EM,TM,xi,wQ,JNe,xM,gs=j(()=>{up();EM=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};TM=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",xi=async(e,t,n=!0)=>({...e,body:await JNe(e.body,t,n)}),wQ=new WeakMap;JNe=async(e,t,n=!0)=>{if(!await HNe(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let i=new FormData;return await Promise.all(Object.entries(e||{}).map(([r,o])=>xM(i,r,o,n))),i},xM=async(e,t,n,i)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,Il([await n.blob()],Hh(n,i),r))}else if(TM(n))e.append(t,Il([await new Response(_$(n)).blob()],Hh(n,i)));else if(n instanceof Blob)e.append(t,Il([n],Hh(n,i)||void 0,{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(r=>xM(e,t+"[]",r,i)));else{if(typeof n.then=="function")throw new TypeError(`Received a Promise for "${t}"; await it first, e.g. \`await toFile(...)\``);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))throw new TypeError(`Received ${n.constructor.name} for "${t}"; to upload raw bytes, wrap them with \`await toFile(bytes, 'filename')\``);if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,o])=>xM(e,`${t}[${r}]`,o,i)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}});async function Jh(e,t,n){if(EM(),e=await e,t||(t=Hh(e,!0)),ZNe(e))return e instanceof File&&t==null&&n==null?e:Il([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(YNe(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),Il(await IM(r),t,n)}let i=await IM(e);if(!n?.type){let r=i.find(o=>typeof o=="object"&&"type"in o&&o.type);typeof r=="string"&&(n={...n,type:r})}return Il(i,t,n)}async function IM(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(kQ(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(TM(e))for await(let n of e)t.push(...await IM(n));else{let n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${QNe(e)}`)}return t}function QNe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}var kQ,ZNe,YNe,_Q=j(()=>{gs();gs();kQ=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",ZNe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&kQ(e),YNe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function"});var AM=j(()=>{_Q()});var $Q=j(()=>{});var Z,Se=j(()=>{Z=class{constructor(t){this._client=t}}});function*ePe(e){if(!e)return;if(SQ in e){let{values:i,nulls:r}=e;yield*i.entries();for(let o of r)yield[o,null];return}let t=!1,n;e instanceof Headers?n=e.entries():ZO(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let i of n){let r=i[0];if(typeof r!="string")throw new TypeError("expected header name to be a string");let o=ZO(i[1])?i[1]:[i[1]],s=!1;for(let a of o)a!==void 0&&(t&&!s&&(s=!0,yield[r,z$]),yield[r,a])}}var SQ,z$,tPe,RM,I,Ce=j(()=>{mr();SQ=Symbol.for("brand.privateNullableHeaders");z$=Symbol("clear"),tPe=new Set(["x-stainless-helper"]),RM=(e,t)=>{let n=e?e.split(",").map(i=>i.trim()).filter(Boolean):[];for(let i of t.split(",").map(r=>r.trim()))i&&!n.includes(i)&&n.push(i);return n.join(", ")},I=e=>{let t=new Headers,n=new Set;for(let i of e){let r=new Set;for(let[o,s]of ePe(i)){let a=o.toLowerCase();if(tPe.has(a)){if(s===z$)continue;s===null?(t.delete(o),n.add(a)):(t.set(o,RM(t.get(o),s)),n.delete(a));continue}(s===z$||!r.has(a))&&(t.delete(o),r.add(a),s===z$)||(s===null?(t.delete(o),n.add(a)):(t.append(o,s),n.delete(a)))}}return{[SQ]:!0,values:t,nulls:n}}});function EQ(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var xQ,nPe,R,Me=j(()=>{kt();xQ=Object.freeze(Object.create(null)),nPe=(e=EQ)=>function(n,...i){if(n.length===1)return n[0];let r=!1,o=[],s=n.reduce((u,d,p)=>{/[?#]/.test(d)&&(r=!0);let f=i[p],m=(r?encodeURIComponent:e)(""+f);return p!==i.length&&(f==null||typeof f=="object"&&f.toString===Object.getPrototypeOf(Object.getPrototypeOf(f.hasOwnProperty??xQ)??xQ)?.toString)&&(m=f+"",o.push({start:u.length+d.length,length:m.length,error:`Value of type ${Object.prototype.toString.call(f).slice(8,-1)} is not a valid path parameter`})),u+d+(p===i.length?"":m)},""),a=s.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(a))!==null;)o.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(o.sort((u,d)=>u.start-d.start),o.length>0){let u=0,d=o.reduce((p,f)=>{let m=" ".repeat(f.start-u),g="^".repeat(f.length);return u=f.start+f.length,p+m+g},"");throw new J(`Path parameters result in path with invalid segments: ${o.map(p=>p.error).join(` `)} ${s} -${d}`)}return s},N=JCe(wQ)});var mp,_M=j(()=>{Se();De();Ne();Me();mp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/deployment_runs/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var gp,SM=j(()=>{Se();De();Ne();Me();gp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/deployments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/deployments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/deployments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}pause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/pause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}run(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/run?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}unpause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/deployments/${t}/unpause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var hp,xM=j(()=>{Se();De();Ne();Me();hp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/dreams?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/dreams/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/dreams?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/dreams/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/dreams/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});function Bh(e){return{[Mo]:e}}function O_(e){return typeof e=="object"&&e!==null&&Vh in e}function EM(e,t){let n=new Set;if(e)for(let i of e)O_(i)&&n.add(i[Vh]);if(t)for(let i of t){O_(i)&&n.add(i[Vh]);let r=i.content;if(Array.isArray(r))for(let o of r)O_(o)&&n.add(o[Vh])}return Array.from(n)}function L_(e,t){let n=EM(e,t);return n.length===0?{}:{[Mo]:n.join(", ")}}function F_(e){return O_(e)?{[Mo]:e[Vh]}:{}}var Mo,M_,Vh,eo=j(()=>{Mo="x-stainless-helper",M_="x-stainless-helper-method";Vh=Symbol("anthropic.sdk.stainlessHelper")});var yp,TM=j(()=>{Se();De();Ne();eo();gs();Me();yp=class extends Z{list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/files?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}download(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/files/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}upload(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/files?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},F_(o.file),n?.headers])},this._client))}}});var bp,IM=j(()=>{Se();De();Ne();Me();bp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/models/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models?beta=true",pn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var vp,AM=j(()=>{Se();De();Ne();Me();vp=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/user_profiles?beta=true",{body:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/user_profiles/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/user_profiles/${t}?beta=true`,{body:o,...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/user_profiles?beta=true",le,{query:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}createEnrollmentURL(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/user_profiles/${t}/enrollment_url?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}}});var _Q=q(ei=>{"use strict";var nPe=ei&&ei.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})();Object.defineProperty(ei,"__esModule",{value:!0});var fn=256,RM=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",i=0;i>>18&63),n+=this._encodeByte(r>>>12&63),n+=this._encodeByte(r>>>6&63),n+=this._encodeByte(r>>>0&63)}var o=t.length-i;if(o>0){var r=t[i]<<16|(o===2?t[i+1]<<8:0);n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),o===2?n+=this._encodeByte(r>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),i=t.length-n,r=new Uint8Array(this.maxDecodedLength(i)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,r[o++]=l<<4|u>>>2,r[o++]=u<<6|d,a|=c&fn,a|=l&fn,a|=u&fn,a|=d&fn;if(s>>4,a|=c&fn,a|=l&fn),s>>2,a|=u&fn),s>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=fn;return n+=(42-t&t-44)>>>8&-fn+t-43+62,n+=(46-t&t-48)>>>8&-fn+t-47+63,n+=(47-t&t-58)>>>8&-fn+t-48+52,n+=(64-t&t-91)>>>8&-fn+t-65+0,n+=(96-t&t-123)>>>8&-fn+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();ei.Coder=RM;var qh=new RM;function rPe(e){return qh.encode(e)}ei.encode=rPe;function iPe(e){return qh.decode(e)}ei.decode=iPe;var kQ=(function(e){nPe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var i=n;return i+=65,i+=25-n>>>8&6,i+=51-n>>>8&-75,i+=61-n>>>8&-13,i+=62-n>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(n){var i=fn;return i+=(44-n&n-46)>>>8&-fn+n-45+62,i+=(94-n&n-96)>>>8&-fn+n-95+63,i+=(47-n&n-58)>>>8&-fn+n-48+52,i+=(64-n&n-91)>>>8&-fn+n-65+0,i+=(96-n&n-123)>>>8&-fn+n-97+26,i},t})(RM);ei.URLSafeCoder=kQ;var $Q=new kQ;function oPe(e){return $Q.encode(e)}ei.encodeURLSafe=oPe;function sPe(e){return $Q.decode(e)}ei.decodeURLSafe=sPe;ei.encodedLength=function(e){return qh.encodedLength(e)};ei.maxDecodedLength=function(e){return qh.maxDecodedLength(e)};ei.decodedLength=function(e){return qh.decodedLength(e)}});var xQ=q((SQ,U_)=>{(function(e,t){var n={};t(n);var i=n.default;for(var r in n)i[r]=n[r];typeof U_=="object"&&typeof U_.exports=="object"?U_.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(SQ,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([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]);function n(d,p,f,m,g){for(var h,b,y,w,k,_,S,x,E,T,A,L,F;g>=64;){for(h=p[0],b=p[1],y=p[2],w=p[3],k=p[4],_=p[5],S=p[6],x=p[7],T=0;T<16;T++)A=m+T*4,d[T]=(f[A]&255)<<24|(f[A+1]&255)<<16|(f[A+2]&255)<<8|f[A+3]&255;for(T=16;T<64;T++)E=d[T-2],L=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=d[T-15],F=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,d[T]=(L+d[T-7]|0)+(F+d[T-16]|0);for(T=0;T<64;T++)L=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&_^~k&S)|0)+(x+(t[T]+d[T]|0)|0)|0,F=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&b^h&y^b&y)|0,x=S,S=_,_=k,k=w+L|0,w=y,y=b,b=h,h=L+F|0;p[0]+=h,p[1]+=b,p[2]+=y,p[3]+=w,p[4]+=k,p[5]+=_,p[6]+=S,p[7]+=x,m+=64,g-=64}return m}var i=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p0){for(;this.bufferLength<64&&f>0;)this.buffer[this.bufferLength++]=p[m++],f--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(f>=64&&(m=n(this.temp,this.state,p,m,f),f%=64);f>0;)this.buffer[this.bufferLength++]=p[m++],f--;return this},d.prototype.finish=function(p){if(!this.finished){var f=this.bytesHashed,m=this.bufferLength,g=f/536870912|0,h=f<<3,b=f%64<56?64:128;this.buffer[m]=128;for(var y=m+1;y>>24&255,this.buffer[b-7]=g>>>16&255,this.buffer[b-6]=g>>>8&255,this.buffer[b-5]=g>>>0&255,this.buffer[b-4]=h>>>24&255,this.buffer[b-3]=h>>>16&255,this.buffer[b-2]=h>>>8&255,this.buffer[b-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var y=0;y<8;y++)p[y*4+0]=this.state[y]>>>24&255,p[y*4+1]=this.state[y]>>>16&255,p[y*4+2]=this.state[y]>>>8&255,p[y*4+3]=this.state[y]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var f=0;fthis.blockSize)new i().update(p).finish(f).clean();else for(var m=0;m1&&p.update(d),f&&p.update(f),p.update(m),p.finish(d),m[0]++}var c=new Uint8Array(e.digestLength);function l(d,p,f,m){p===void 0&&(p=c),m===void 0&&(m=32);for(var g=new Uint8Array([1]),h=s(p,d),b=new r(h),y=new Uint8Array(b.digestLength),w=y.length,k=new Uint8Array(m),_=0;_>>24&255,b[1]=S>>>16&255,b[2]=S>>>8&255,b[3]=S>>>0&255,g.reset(),g.update(p),g.update(b),g.finish(w);for(var x=0;x{"use strict";Object.defineProperty(NM,"__esModule",{value:!0});NM.timingSafeEqual=aPe;function EQ(e,t=""){if(!e)throw new Error(t)}function aPe(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),EQ(e instanceof DataView),EQ(t instanceof DataView);let n=e.byteLength,i=0,r=-1;for(;++r{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.Webhook=wp.WebhookVerificationError=void 0;var IQ=_Q(),cPe=xQ(),lPe=TQ(),AQ=300,CM=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Fa=class e extends CM{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};wp.WebhookVerificationError=Fa;var j_=class e{constructor(t,n){if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=IQ.decode(t)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(t,n,i){var r;let o=(r=i?.jsonParse)!==null&&r!==void 0?r:!0,s={};for(let g of Object.keys(n))s[g.toLowerCase()]=n[g];let a=s["webhook-id"],c=s["webhook-signature"],l=s["webhook-timestamp"];if(!c||!a||!l)throw new Fa("Missing required headers");let u=this.verifyTimestamp(l),p=this.sign(a,u,t).split(",")[1],f=c.split(" "),m=new globalThis.TextEncoder;for(let g of f){let[h,b]=g.split(",");if(h==="v1"&&(0,lPe.timingSafeEqual)(m.encode(b),m.encode(p))){let y=t.toString();return y===""?void 0:o?JSON.parse(y):void 0}}throw new Fa("No matching signature found")}sign(t,n,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,o=Math.floor(n.getTime()/1e3),s=r.encode(`${t}.${o}.${i}`);return`v1,${IQ.encode(cPe.hmac(this.key,s))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(Number.isNaN(i))throw new Fa("Invalid Signature Headers");if(n-i>AQ)throw new Fa("Message timestamp too old");if(i>n+AQ)throw new Fa("Message timestamp too new");return new Date(i*1e3)}};wp.Webhook=j_;j_.prefix="whsec_"});var NQ,kp,PM=j(()=>{Se();NQ=gt(RQ(),1),kp=class extends Z{parseUnverified(t){return JSON.parse(t)}unwrap(t,n){let i=n?.headers;if(i==null)throw new Error("Webhook headers are required in order to verify the signature");let r=n.key===void 0?this._client.webhookKey:n.key;if(!r)throw new Error("Webhook key must not be null or empty in order to unwrap");return new NQ.Webhook(r).verify(t,i),JSON.parse(t)}}});var $p,DM=j(()=>{Se();De();Ne();Me();$p=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/agents/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var Tl,OM=j(()=>{Se();DM();DM();De();Ne();Me();Tl=class extends Z{constructor(){super(...arguments),this.versions=new $p(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/agents?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(N`/v1/agents/${t}?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/agents/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/agents?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/agents/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Tl.Versions=$p});function Ua(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}var z_=j(()=>{});function An(e,t){return e instanceof Dt&&e.status===t}function CQ(e){return e instanceof Dt&&typeof e.status=="number"&&e.status>=400&&e.status<500}function ja(e){return CQ(e)&&!An(e,408)&&!An(e,409)&&!An(e,429)}function G_(e,t,n){return Math.min(t*2**e,n)}function MM(e,t){return e+Math.random()*(t-e)}function V_(e){return e*(1-Math.random()*.25)}var _p=j(()=>{kt()});function B_(e,{authToken:t,helper:n}){if(!t)throw new J(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let i=e,r=i._options.defaultHeaders,o=i._authState?.extraHeaders,s=o?Object.fromEntries(Object.entries(o).filter(([c])=>{let l=c.toLowerCase();return l!=="authorization"&&l!=="x-api-key"})):void 0,a=I([s,r,{[Mo]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:a})}var LM=j(()=>{kt();Ne();eo()});function yPe(e){return G_(e,mPe,gPe)}function bPe(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${T_()}`:T_()}var Sp,q_,Ei,W_,H_,K_,Wh,Hh,xp,Ep,J_,Tp,Kh,fPe,mPe,gPe,hPe,za,FM,Z_=j(()=>{gr();kt();Xi();cp();aM();z_();Ne();_p();LM();_p();fPe=999,mPe=1e3,gPe=6e4,hPe=3e5,za=class{constructor(t){Sp.set(this,void 0),q_.set(this,!1),Ei.set(this,void 0),W_.set(this,void 0),H_.set(this,void 0),K_.set(this,void 0),Wh.set(this,void 0),Hh.set(this,void 0),xp.set(this,void 0),this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.workerId=t.workerId??bPe(),M(this,Sp,B_(t.client,{authToken:t.environmentKey,helper:"environments-work-poller"}),"f"),M(this,H_,t.autoStop??!0,"f"),M(this,K_,t.drain??!1,"f"),M(this,Wh,t.blockMs===void 0?fPe:t.blockMs,"f"),M(this,Hh,t.reclaimOlderThanMs??null,"f"),M(this,xp,t.requestOptions,"f"),M(this,Ei,new AbortController,"f"),M(this,W_,Ua(t.signal,v(this,Ei,"f")),"f")}get signal(){return v(this,Ei,"f").signal}abort(){v(this,Ei,"f").abort()}async*[(Sp=new WeakMap,q_=new WeakMap,Ei=new WeakMap,W_=new WeakMap,H_=new WeakMap,K_=new WeakMap,Wh=new WeakMap,Hh=new WeakMap,xp=new WeakMap,Symbol.asyncIterator)](){if(v(this,q_,"f"))throw new J("Cannot iterate over a consumed WorkPoller");M(this,q_,!0,"f");let t=qe(this.client);t.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let n=new FM(t,this.environmentId);try{let i=0;for(;!v(this,Ei,"f").signal.aborted;){let r;try{r=await v(this,Sp,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...v(this,Wh,"f")!==null?{block_ms:v(this,Wh,"f")}:{},...v(this,Hh,"f")!==null?{reclaim_older_than_ms:v(this,Hh,"f")}:{}},{headers:I([v(this,xp,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){if(v(this,Ei,"f").signal.aborted)return;if(ja(o))throw t.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=V_(yPe(i));t.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),i++,await Yi(s,v(this,Ei,"f").signal);continue}if(i=0,r==null){if(v(this,K_,"f"))return;n.onEmptyPoll(),await Yi(MM(1e3,3e3),v(this,Ei,"f").signal);continue}n.onClaim(),t.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:r.id,work_type:r.data.type});try{await v(this,Sp,"f").beta.environments.work.ack(r.id,{environment_id:r.environment_id},{headers:I([v(this,xp,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){t.error("ack failed",{work_id:r.id,error:String(o)});continue}try{yield r}finally{if(v(this,H_,"f"))try{await v(this,Sp,"f").beta.environments.work.stop(r.id,{environment_id:r.environment_id},{headers:I([v(this,xp,"f")?.headers])})}catch(o){An(o,409)||t.warn("stop failed",{work_id:r.id,error:String(o)})}}}}finally{v(this,W_,"f").call(this)}}};FM=class{constructor(t,n){Ep.set(this,void 0),J_.set(this,void 0),Tp.set(this,void 0),Kh.set(this,0),M(this,Ep,t,"f"),M(this,J_,n,"f")}onEmptyPoll(){let t=Date.now(),n={component:"work-poller",environment_id:v(this,J_,"f")};v(this,Tp,"f")===void 0?(M(this,Tp,M(this,Kh,t,"f"),"f"),v(this,Ep,"f").info("idle; polling for work",n)):t-v(this,Kh,"f")>=hPe?(M(this,Kh,t,"f"),v(this,Ep,"f").info(`still polling; idle for ${Math.round((t-v(this,Tp,"f"))/1e3)}s`,n)):v(this,Ep,"f").debug("poll returned no work",n)}onClaim(){M(this,Tp,void 0,"f")}};Ep=new WeakMap,J_=new WeakMap,Tp=new WeakMap,Kh=new WeakMap});var Ip,Ga,Ap,Y_,PQ=j(()=>{gr();Y_=class{constructor(){Ip.set(this,[]),Ga.set(this,[]),Ap.set(this,!1)}push(t){if(v(this,Ap,"f"))return!1;let n=v(this,Ga,"f").shift();return n?n({done:!1,value:t}):v(this,Ip,"f").push(t),!0}close(){if(!v(this,Ap,"f"))for(M(this,Ap,!0,"f");v(this,Ga,"f").length>0;)v(this,Ga,"f").shift()({done:!0,value:void 0})}next(t){return v(this,Ip,"f").length>0?Promise.resolve({done:!1,value:v(this,Ip,"f").shift()}):v(this,Ap,"f")||t?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(n=>{let i=o=>{t?.removeEventListener("abort",r),n(o)},r=()=>{let o=v(this,Ga,"f").indexOf(i);o>=0&&v(this,Ga,"f").splice(o,1),n({done:!0,value:void 0})};v(this,Ga,"f").push(i),t?.addEventListener("abort",r,{once:!0})})}tryShift(){return v(this,Ip,"f").shift()}};Ip=new WeakMap,Ga=new WeakMap,Ap=new WeakMap});var Ae,Il=j(()=>{Ae=class extends Error{constructor(t){let n=typeof t=="string"?t:t.map(i=>i.type==="text"?i.text:`[${i.type}]`).join(" ");super(n),this.name="ToolError",this.content=t}}});function UM(e){return"name"in e?e.name:"mcp_server_name"in e?e.mcp_server_name:e.type}function vPe(e){return e instanceof Ae?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function DQ(e,t,n){try{let i=e.parse?e.parse(t):t;return{content:await e.run(i,n),isError:!1}}catch(i){return{content:vPe(i),isError:!0}}}var OQ=j(()=>{Il()});function BQ(e){return e.type==="session.status_idle"&&e.stop_reason?.type==="end_turn"}function TPe(e,t,n){return e.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n}:{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function IPe(e){if(typeof e=="string")return[{type:"text",text:e||"(no output)"}];let t=e.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(i=>({type:"text",text:i.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return t.length>0?t:[{type:"text",text:"(no output)"}]}var Jh,rS,Rp,Al,to,Kt,Q_,jn,X_,Zh,iS,mn,Cp,ti,Pp,Va,Np,hs,oS,Yh,Ti,eS,GQ,MQ,LQ,FQ,jM,UQ,tS,nS,zM,jQ,VQ,zQ,wPe,kPe,$Pe,_Pe,SPe,xPe,EPe,GM,Ba,sS=j(()=>{gr();kt();Xi();cp();_p();z_();PQ();Ne();eo();OQ();zQ=500,wPe=1e4,kPe=12e4,$Pe=3e4,_Pe=1e3,SPe=3e4,xPe=5*6e4,EPe=6e4;GM=class{constructor(t,n){Jh.set(this,void 0),rS.set(this,void 0),Rp.set(this,new Set),Al.set(this,!1),to.set(this,void 0),M(this,Jh,t,"f"),M(this,rS,n,"f")}noteEvent(t){t.type!=="user.tool_confirmation"&&(BQ(t)?this.arm():this.disarm())}block(t){v(this,Rp,"f").add(t),v(this,to,"f")!==void 0&&(M(this,Al,!0,"f"),clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}unblock(t){v(this,Rp,"f").delete(t),v(this,Rp,"f").size===0&&v(this,Al,"f")&&this.arm()}arm(){if(!(v(this,Jh,"f")<=0)){if(v(this,Rp,"f").size>0){M(this,Al,!0,"f");return}M(this,Al,!1,"f"),v(this,to,"f")!==void 0&&clearTimeout(v(this,to,"f")),M(this,to,setTimeout(v(this,rS,"f"),v(this,Jh,"f")),"f")}}disarm(){M(this,Al,!1,"f"),v(this,to,"f")!==void 0&&(clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}};Jh=new WeakMap,rS=new WeakMap,Rp=new WeakMap,Al=new WeakMap,to=new WeakMap;Ba=class{constructor(t,n){Kt.add(this),Q_.set(this,!1),jn.set(this,void 0),X_.set(this,void 0),Zh.set(this,void 0),iS.set(this,void 0),mn.set(this,void 0),Cp.set(this,new Set),ti.set(this,new Set),Pp.set(this,new Map),Va.set(this,new Map),Np.set(this,new Y_),hs.set(this,0),oS.set(this,xPe),Yh.set(this,null),Ti.set(this,void 0),this.client=n.client,this.sessionId=t,this.tools=n.tools,this.maxIdleMs=n.maxIdleMs??EPe,M(this,mn,qe(n.client),"f"),M(this,iS,new Map(n.tools.map(i=>[UM(i),i])),"f"),M(this,jn,new AbortController,"f"),M(this,X_,Ua(n.signal,v(this,jn,"f")),"f"),M(this,Zh,n.requestOptions,"f"),M(this,Ti,new GM(this.maxIdleMs,()=>{v(this,mn,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),v(this,jn,"f").abort()}),"f")}get signal(){return v(this,jn,"f").signal}abort(){v(this,jn,"f").abort()}_setSendRetryWindow(t){M(this,oS,t,"f")}async*[(Q_=new WeakMap,jn=new WeakMap,X_=new WeakMap,Zh=new WeakMap,iS=new WeakMap,mn=new WeakMap,Cp=new WeakMap,ti=new WeakMap,Pp=new WeakMap,Va=new WeakMap,Np=new WeakMap,hs=new WeakMap,oS=new WeakMap,Yh=new WeakMap,Ti=new WeakMap,Kt=new WeakSet,Symbol.asyncIterator)](){if(v(this,Q_,"f"))throw new J("Cannot iterate over a consumed SessionToolRunner");M(this,Q_,!0,"f"),v(this,mn,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let t=v(this,Kt,"m",GQ).call(this).catch(n=>{v(this,jn,"f").signal.aborted||v(this,mn,"f").error("stream loop failed",{error:String(n)}),v(this,jn,"f").abort()});try{for(;;){let i=await v(this,Np,"f").next(v(this,jn,"f").signal);if(i.done)break;yield i.value}await t;let n;for(;(n=v(this,Np,"f").tryShift())!==void 0;)yield n}finally{v(this,jn,"f").abort(),v(this,Ti,"f").disarm(),await t;try{await v(this,Kt,"m",VQ).call(this)}catch(n){v(this,mn,"f").warn("drain failed",{error:String(n)})}v(this,Np,"f").close();for(let n of this.tools)try{await n.close?.()}catch(i){v(this,mn,"f").warn("tool.close failed",{tool:UM(n),error:String(i)})}v(this,X_,"f").call(this)}}};eS=function(){return{...v(this,Zh,"f"),headers:I([Bh("session-tool-runner"),v(this,Zh,"f")?.headers]),signal:v(this,jn,"f").signal}},GQ=async function(){let t=v(this,jn,"f"),n=zQ;for(;!t.signal.aborted;){try{let i=await this.client.beta.sessions.events.stream(this.sessionId,{},v(this,Kt,"m",eS).call(this));await v(this,Kt,"m",MQ).call(this);for await(let r of i)if(n=zQ,await v(this,Kt,"m",FQ).call(this,r))return}catch(i){if(t.signal.throwIfAborted(),ja(i))throw v(this,mn,"f").error("permanent stream failure, shutting down",{error:String(i)}),t.abort(),i;v(this,mn,"f").warn("stream disconnected, reconnecting",{error:String(i),backoff_ms:n})}t.signal.throwIfAborted(),await Yi(n,t.signal),n=Math.min(n*2,wPe)}},MQ=async function(){let t=v(this,jn,"f"),n=[],i=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},v(this,Kt,"m",eS).call(this)))v(this,Kt,"m",LQ).call(this,s,n),i=BQ(s)}catch(s){t.signal.throwIfAborted(),v(this,mn,"f").warn("reconcile list failed",{error:String(s)});for(let a of n)v(this,Cp,"f").delete(a.id);return}let r=n.filter(s=>!v(this,ti,"f").has(s.id));v(this,Ti,"f").disarm();for(let s of r)await v(this,Kt,"m",jM).call(this,s);for(let s of[...v(this,Va,"f").values()]){let a=v(this,Pp,"f").get(s.id);a!==void 0&&await v(this,Kt,"m",tS).call(this,s,a)}let o=r.filter(s=>!v(this,ti,"f").has(s.id)&&!v(this,Va,"f").has(s.id));i&&o.length===0?v(this,Ti,"f").arm():v(this,Ti,"f").disarm()},LQ=function(t,n){t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"?(v(this,Cp,"f").add(t.id),v(this,ti,"f").has(t.id)||n.push(t)):t.type==="user.tool_result"?v(this,ti,"f").add(t.tool_use_id):t.type==="user.custom_tool_result"?v(this,ti,"f").add(t.custom_tool_use_id):t.type==="user.tool_confirmation"&&(v(this,ti,"f").has(t.tool_use_id)||v(this,Pp,"f").set(t.tool_use_id,t.result))},FQ=async function(t){switch(v(this,Ti,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":return v(this,Cp,"f").has(t.id)||(v(this,Cp,"f").add(t.id),await v(this,Kt,"m",jM).call(this,t)),!1;case"user.tool_confirmation":return await v(this,Kt,"m",UQ).call(this,t),!1;case"user.tool_result":return v(this,ti,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return v(this,ti,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return v(this,mn,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),v(this,jn,"f").abort(),!0;default:return!1}},jM=async function(t){let n=t.evaluated_permission,i=n==="deny"?"deny":v(this,Pp,"f").get(t.id);if(i===void 0){n===void 0||n==="allow"?await v(this,Kt,"m",zM).call(this,t,void 0):v(this,Va,"f").has(t.id)||(v(this,mn,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Va,"f").set(t.id,t),v(this,Ti,"f").block(t.id));return}await v(this,Kt,"m",tS).call(this,t,i)},UQ=async function(t){v(this,Pp,"f").set(t.tool_use_id,t.result);let n=v(this,Va,"f").get(t.tool_use_id);n!==void 0&&await v(this,Kt,"m",tS).call(this,n,t.result)},tS=async function(t,n){let i=v(this,Va,"f").delete(t.id);if(n==="allow"){v(this,mn,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),i||v(this,Ti,"f").block(t.id);try{await v(this,Kt,"m",zM).call(this,t,"allow")}finally{v(this,Ti,"f").unblock(t.id)}return}i&&v(this,Ti,"f").unblock(t.id),v(this,ti,"f").add(t.id),v(this,mn,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Kt,"m",nS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},nS=function(t){v(this,Np,"f").push(t)},zM=async function(t,n){var i,r;if(!v(this,ti,"f").has(t.id)){v(this,mn,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),M(this,hs,(i=v(this,hs,"f"),i++,i),"f");try{let o=v(this,iS,"f").get(t.name);if(!o){v(this,mn,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Kt,"m",nS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:n});return}let s,a,c=new AbortController,l=Ua(v(this,jn,"f").signal,c),u=setTimeout(()=>c.abort(),kPe);try{let f=await DQ(o,t.input,{toolUse:t,toolUseBlock:t,signal:c.signal});s=f.content,a=f.isError}finally{clearTimeout(u),l()}let d=TPe(t,a,IPe(s)),p=await v(this,Kt,"m",jQ).call(this,d,t.id);v(this,Kt,"m",nS).call(this,{event:t,result:d,toolUseId:t.id,name:t.name,isError:a,posted:p,confirmation:n})}finally{M(this,hs,(r=v(this,hs,"f"),r--,r),"f"),v(this,hs,"f")===0&&v(this,Yh,"f")?.call(this)}}},jQ=async function(t,n){let i=v(this,jn,"f"),r=Date.now(),o,s=0;for(;;){s++,i.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},v(this,Kt,"m",eS).call(this)),v(this,ti,"f").add(n),!0}catch(a){if(o=a,ja(a))break;let c=v(this,oS,"f")-(Date.now()-r);if(c<=0)break;let l=Math.min(V_(G_(s-1,_Pe,SPe)),c);v(this,mn,"f").warn("tool result send failed; retrying",{tool_use_id:n,attempt:s,backoff_ms:l,error:String(a)}),await Yi(l,i.signal)}}return v(this,mn,"f").error("failed to send tool result",{tool_use_id:n,attempts:s,error:String(o)}),!1},VQ=async function(){v(this,hs,"f")!==0&&(await Promise.race([new Promise(t=>M(this,Yh,t,"f")),Yi($Pe)]),M(this,Yh,null,"f"),v(this,hs,"f")>0&&v(this,mn,"f").warn("drain timeout exceeded"))}});function aS(e,t){if(!(e>=Qh))throw new J(`${t} must be at least ${Qh}ms (got ${e}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var Xh,Qh,cS=j(()=>{kt();Xh=15e3,Qh=5e3});var qQ=j(()=>{cM()});function Rl(e){if(e.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:t=>t,...e.close?{close:e.close}:{}}}var WQ=j(()=>{VM();qQ()});function Dp(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}var BM=j(()=>{});function lS(e,t){let n=xe.relative(e,t);return n===""||!n.startsWith(".."+xe.sep)&&n!==".."&&!xe.isAbsolute(n)}async function qM(e,t){for(let n of e)if(lS(await ey(xe.resolve(n)),t))return n}function ny(e){let t=e?.code;return typeof t=="string"?t:void 0}async function ey(e){let t=[],n=e,i=0;for(;;){let r;try{r=await Nl.realpath(n)}catch(o){let s;try{s=(await Nl.lstat(n)).isSymbolicLink()}catch(a){let c=ny(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let l=xe.dirname(n);if(l===n)throw a;t.push(xe.basename(n)),n=l;continue}if(!s)throw o;if(++i>RPe)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=xe.resolve(xe.dirname(n),await Nl.readlink(n));continue}return t.length?xe.join(r,...t.reverse()):r}}async function HQ(e,t,n){let i=n?.allowedRoots??[],r=await ey(xe.resolve(e)),o;try{o=await ey(xe.resolve(r,t))}catch(a){throw new Ae(Op(a,`path ${JSON.stringify(t)}`))}if(lS(r,o)||await qM(i,o)!==void 0)return o;let s=i.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new Ae(`path ${JSON.stringify(t)} is outside ${s}`)}async function WM(e,t){let n=xe.dirname(e),i=xe.join(n,`.tmp-${process.pid}-${Oa.randomUUID()}`),r=await Nl.stat(e).then(s=>s.mode&511,()=>{}),o;try{o=await Nl.open(i,"wx",APe),r!==void 0&&await o.chmod(r),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await Nl.rename(i,e)}catch(s){throw o&&await o.close().catch(()=>{}),await Nl.unlink(i).catch(()=>{}),s}}function Op(e,t){let n=ny(e);switch(n){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var Nl,ty,APe,RPe,HM=j(()=>{Mr();Il();Nl=fs.promises,ty=448,APe=384;RPe=40});async function JQ(e){let{client:t,sessionId:n}=e;if(!t)return async()=>{};let i=qe(t),r=e.session;if(!r){if(n===void 0)return async()=>{};i.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),r=await t.beta.sessions.retrieve(n)}let o=xe.resolve(e.workdir,"skills"),s=[];for(let a of r.agent.skills)try{let c=await t.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),l=xe.basename(c.name.trim());(l===""||l==="."||l==="..")&&(l=a.skill_id);let u=xe.resolve(o,l);if(u!==o&&!u.startsWith(o+xe.sep)){i.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await t.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await Ii.rm(u,{recursive:!0,force:!0}),await Ii.mkdir(u,{recursive:!0,mode:ty}),s.push(u),await ZM(d,u),i.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:u})}catch(c){i.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of s)await Ii.rm(a,{recursive:!0,force:!0}).catch(c=>{i.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function CPe(e){for(let t of e){let n=t.trim();if(n&&(xe.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new J(`refusing to extract unsafe archive member: ${n}`)}}function KQ(e){let t=e.split(` -`);return t[t.length-1]===""&&t.pop(),t}function DPe(e,t){return/^[\x20-\x7E]+$/.test(t)&&!/[\\^#]/.test(t)&&!(e==="unzip"&&t.startsWith("-"))}function OPe(e,t,n){let i=KQ(t),r=KQ(n);if(i.length!==r.length)throw new J(JM);let o=[],s=[];return i.forEach((a,c)=>{if(PPe[e].has(r[c].charAt(0))){o.push(a);return}if(!DPe(e,a))throw new J(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);s.push(a)}),{plain:o,special:s}}async function ZQ(e){for(let t of await Ii.readdir(e,{withFileTypes:!0}))if(t.isDirectory())await ZQ(xe.join(e,t.name));else if(!t.isFile())throw new J(JM)}async function KM(e,t){try{let{stdout:n}=await NPe(e,t);return n}catch(n){throw ny(n)==="ENOENT"?new J(`skill extraction requires the \`${e}\` command, but it was not found on PATH`):n}}function MPe(e){let t,n=!1;for(let i of e){let r=i.trim().split("/").filter(s=>s!==""&&s!==".");if(r.length===0)continue;let o=r[0];if(t===void 0)t=o;else if(o!==t)return"";r.length>1&&(n=!0)}return t!==void 0&&n?t:""}async function ZM(e,t){let n=xe.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new J("skill download response had no body");await y_.promises.pipeline(y_.Readable.fromWeb(e.body),fs.createWriteStream(n));let i=xe.join(xe.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`),r=xe.join(xe.dirname(t),`.skill-exclude-${process.pid}-${Date.now()}`);try{let o=await FPe(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,a=s?"unzip":"tar",c=await KM(a,s?["-Z1",n]:["-tf",n]),l=await KM(a,s?["-Z","--h","--t",n]:["-tvf",n]),{plain:u,special:d}=OPe(a,c,l);CPe([...u,...d]);let p=MPe(u);await Ii.mkdir(i,{recursive:!0,mode:ty}),u.length>0&&await KM(a,await LPe(a,n,i,d,r)),await ZQ(i);let f=p?xe.join(i,p):i,m=await Ii.readdir(f).catch(g=>{throw ny(g)==="ENOENT"?new J(JM):g});for(let g of m)await Ii.rename(xe.join(f,g),xe.join(t,g))}finally{await Ii.rm(n,{force:!0}),await Ii.rm(r,{force:!0}),await Ii.rm(i,{recursive:!0,force:!0})}}async function LPe(e,t,n,i,r){let o=i.map(s=>s.replace(/[*?[\\]/g,"\\$&"));return e==="unzip"?["-oq",t,"-d",n,...o.length>0?["-x",...o]:[]]:o.length===0?["-xf",t,"-C",n]:(await Ii.writeFile(r,o.join(` +${d}`)}return s},R=nPe(EQ)});var gp,CM=j(()=>{Se();Pe();Ce();Me();gp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/deployment_runs/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var hp,NM=j(()=>{Se();Pe();Ce();Me();hp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/deployments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/deployments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/deployments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/deployments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/deployments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}pause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/deployments/${t}/pause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}run(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/deployments/${t}/run?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}unpause(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/deployments/${t}/unpause?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var yp,PM=j(()=>{Se();Pe();Ce();Me();yp=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/dreams?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/dreams/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/dreams?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"dreaming-2026-04-21"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/dreams/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/dreams/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});function Yh(e){return{[Mo]:e}}function G$(e){return typeof e=="object"&&e!==null&&Zh in e}function DM(e,t){let n=new Set;if(e)for(let i of e)G$(i)&&n.add(i[Zh]);if(t)for(let i of t){G$(i)&&n.add(i[Zh]);let r=i.content;if(Array.isArray(r))for(let o of r)G$(o)&&n.add(o[Zh])}return Array.from(n)}function B$(e,t){let n=DM(e,t);return n.length===0?{}:{[Mo]:n.join(", ")}}function q$(e){return G$(e)?{[Mo]:e[Zh]}:{}}var Mo,V$,Zh,eo=j(()=>{Mo="x-stainless-helper",V$="x-stainless-helper-method";Zh=Symbol("anthropic.sdk.stainlessHelper")});var bp,OM=j(()=>{Se();Pe();Ce();eo();gs();Me();bp=class extends Z{list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/files?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(R`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}download(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/files/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/files/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}upload(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/files?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},q$(o.file),n?.headers])},this._client))}}});var vp,MM=j(()=>{Se();Pe();Ce();Me();vp=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/models/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models?beta=true",dn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var wp,LM=j(()=>{Se();Pe();Ce();Me();wp=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/user_profiles?beta=true",{body:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(R`/v1/user_profiles/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(R`/v1/user_profiles/${t}?beta=true`,{body:o,...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/user_profiles?beta=true",le,{query:r,...n,headers:I([{"anthropic-beta":[...i??[],"user-profiles-2026-08-18"].toString()},n?.headers])})}createEnrollmentURL(t,n={},i){let{betas:r}=n??{};return this._client.post(R`/v1/user_profiles/${t}/enrollment_url?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"user-profiles-2026-08-18"].toString()},i?.headers])})}}});var AQ=q(Xr=>{"use strict";var lPe=Xr&&Xr.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})();Object.defineProperty(Xr,"__esModule",{value:!0});var pn=256,FM=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var n="",i=0;i>>18&63),n+=this._encodeByte(r>>>12&63),n+=this._encodeByte(r>>>6&63),n+=this._encodeByte(r>>>0&63)}var o=t.length-i;if(o>0){var r=t[i]<<16|(o===2?t[i+1]<<8:0);n+=this._encodeByte(r>>>18&63),n+=this._encodeByte(r>>>12&63),o===2?n+=this._encodeByte(r>>>6&63):n+=this._paddingCharacter||"",n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var n=this._getPaddingLength(t),i=t.length-n,r=new Uint8Array(this.maxDecodedLength(i)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,r[o++]=l<<4|u>>>2,r[o++]=u<<6|d,a|=c&pn,a|=l&pn,a|=u&pn,a|=d&pn;if(s>>4,a|=c&pn,a|=l&pn),s>>2,a|=u&pn),s>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=pn;return n+=(42-t&t-44)>>>8&-pn+t-43+62,n+=(46-t&t-48)>>>8&-pn+t-47+63,n+=(47-t&t-58)>>>8&-pn+t-48+52,n+=(64-t&t-91)>>>8&-pn+t-65+0,n+=(96-t&t-123)>>>8&-pn+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)n++;if(t.length<4||n>2)throw new Error("Base64Coder: incorrect padding")}return n},e})();Xr.Coder=FM;var Qh=new FM;function uPe(e){return Qh.encode(e)}Xr.encode=uPe;function dPe(e){return Qh.decode(e)}Xr.decode=dPe;var TQ=(function(e){lPe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var i=n;return i+=65,i+=25-n>>>8&6,i+=51-n>>>8&-75,i+=61-n>>>8&-13,i+=62-n>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(n){var i=pn;return i+=(44-n&n-46)>>>8&-pn+n-45+62,i+=(94-n&n-96)>>>8&-pn+n-95+63,i+=(47-n&n-58)>>>8&-pn+n-48+52,i+=(64-n&n-91)>>>8&-pn+n-65+0,i+=(96-n&n-123)>>>8&-pn+n-97+26,i},t})(FM);Xr.URLSafeCoder=TQ;var IQ=new TQ;function pPe(e){return IQ.encode(e)}Xr.encodeURLSafe=pPe;function fPe(e){return IQ.decode(e)}Xr.decodeURLSafe=fPe;Xr.encodedLength=function(e){return Qh.encodedLength(e)};Xr.maxDecodedLength=function(e){return Qh.maxDecodedLength(e)};Xr.decodedLength=function(e){return Qh.decodedLength(e)}});var CQ=q((RQ,W$)=>{(function(e,t){var n={};t(n);var i=n.default;for(var r in n)i[r]=n[r];typeof W$=="object"&&typeof W$.exports=="object"?W$.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(RQ,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([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]);function n(d,p,f,m,g){for(var h,b,y,w,k,$,S,x,E,T,A,L,F;g>=64;){for(h=p[0],b=p[1],y=p[2],w=p[3],k=p[4],$=p[5],S=p[6],x=p[7],T=0;T<16;T++)A=m+T*4,d[T]=(f[A]&255)<<24|(f[A+1]&255)<<16|(f[A+2]&255)<<8|f[A+3]&255;for(T=16;T<64;T++)E=d[T-2],L=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=d[T-15],F=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,d[T]=(L+d[T-7]|0)+(F+d[T-16]|0);for(T=0;T<64;T++)L=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&$^~k&S)|0)+(x+(t[T]+d[T]|0)|0)|0,F=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&b^h&y^b&y)|0,x=S,S=$,$=k,k=w+L|0,w=y,y=b,b=h,h=L+F|0;p[0]+=h,p[1]+=b,p[2]+=y,p[3]+=w,p[4]+=k,p[5]+=$,p[6]+=S,p[7]+=x,m+=64,g-=64}return m}var i=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var p=0;p0){for(;this.bufferLength<64&&f>0;)this.buffer[this.bufferLength++]=p[m++],f--;this.bufferLength===64&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(f>=64&&(m=n(this.temp,this.state,p,m,f),f%=64);f>0;)this.buffer[this.bufferLength++]=p[m++],f--;return this},d.prototype.finish=function(p){if(!this.finished){var f=this.bytesHashed,m=this.bufferLength,g=f/536870912|0,h=f<<3,b=f%64<56?64:128;this.buffer[m]=128;for(var y=m+1;y>>24&255,this.buffer[b-7]=g>>>16&255,this.buffer[b-6]=g>>>8&255,this.buffer[b-5]=g>>>0&255,this.buffer[b-4]=h>>>24&255,this.buffer[b-3]=h>>>16&255,this.buffer[b-2]=h>>>8&255,this.buffer[b-1]=h>>>0&255,n(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var y=0;y<8;y++)p[y*4+0]=this.state[y]>>>24&255,p[y*4+1]=this.state[y]>>>16&255,p[y*4+2]=this.state[y]>>>8&255,p[y*4+3]=this.state[y]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var f=0;fthis.blockSize)new i().update(p).finish(f).clean();else for(var m=0;m1&&p.update(d),f&&p.update(f),p.update(m),p.finish(d),m[0]++}var c=new Uint8Array(e.digestLength);function l(d,p,f,m){p===void 0&&(p=c),m===void 0&&(m=32);for(var g=new Uint8Array([1]),h=s(p,d),b=new r(h),y=new Uint8Array(b.digestLength),w=y.length,k=new Uint8Array(m),$=0;$>>24&255,b[1]=S>>>16&255,b[2]=S>>>8&255,b[3]=S>>>0&255,g.reset(),g.update(p),g.update(b),g.finish(w);for(var x=0;x{"use strict";Object.defineProperty(UM,"__esModule",{value:!0});UM.timingSafeEqual=mPe;function NQ(e,t=""){if(!e)throw new Error(t)}function mPe(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),NQ(e instanceof DataView),NQ(t instanceof DataView);let n=e.byteLength,i=0,r=-1;for(;++r{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.Webhook=kp.WebhookVerificationError=void 0;var DQ=AQ(),gPe=CQ(),hPe=PQ(),OQ=300,jM=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Fa=class e extends jM{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};kp.WebhookVerificationError=Fa;var K$=class e{constructor(t,n){if(n?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=DQ.decode(t)}if(this.key.length===0)throw new Error("Secret can't be empty.")}verify(t,n,i){var r;let o=(r=i?.jsonParse)!==null&&r!==void 0?r:!0,s={};for(let g of Object.keys(n))s[g.toLowerCase()]=n[g];let a=s["webhook-id"],c=s["webhook-signature"],l=s["webhook-timestamp"];if(!c||!a||!l)throw new Fa("Missing required headers");let u=this.verifyTimestamp(l),p=this.sign(a,u,t).split(",")[1],f=c.split(" "),m=new globalThis.TextEncoder;for(let g of f){let[h,b]=g.split(",");if(h==="v1"&&(0,hPe.timingSafeEqual)(m.encode(b),m.encode(p))){let y=t.toString();return y===""?void 0:o?JSON.parse(y):void 0}}throw new Fa("No matching signature found")}sign(t,n,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,o=Math.floor(n.getTime()/1e3),s=r.encode(`${t}.${o}.${i}`);return`v1,${DQ.encode(gPe.hmac(this.key,s))}`}verifyTimestamp(t){let n=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(Number.isNaN(i))throw new Fa("Invalid Signature Headers");if(n-i>OQ)throw new Fa("Message timestamp too old");if(i>n+OQ)throw new Fa("Message timestamp too new");return new Date(i*1e3)}};kp.Webhook=K$;K$.prefix="whsec_"});var LQ,_p,zM=j(()=>{Se();LQ=gt(MQ(),1),_p=class extends Z{parseUnverified(t){return JSON.parse(t)}unwrap(t,n){let i=n?.headers;if(i==null)throw new Error("Webhook headers are required in order to verify the signature");let r=n.key===void 0?this._client.webhookKey:n.key;if(!r)throw new Error("Webhook key must not be null or empty in order to unwrap");return new LQ.Webhook(r).verify(t,i),JSON.parse(t)}}});var $p,GM=j(()=>{Se();Pe();Ce();Me();$p=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/agents/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var Al,VM=j(()=>{Se();GM();GM();Pe();Ce();Me();Al=class extends Z{constructor(){super(...arguments),this.versions=new $p(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/agents?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(R`/v1/agents/${t}?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/agents/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/agents?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/agents/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Al.Versions=$p});function Ua(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}var H$=j(()=>{});function Tn(e,t){return e instanceof Dt&&e.status===t}function FQ(e){return e instanceof Dt&&typeof e.status=="number"&&e.status>=400&&e.status<500}function ja(e){return FQ(e)&&!Tn(e,408)&&!Tn(e,409)&&!Tn(e,429)}function J$(e,t,n){return Math.min(t*2**e,n)}function BM(e,t){return e+Math.random()*(t-e)}function Z$(e){return e*(1-Math.random()*.25)}var Sp=j(()=>{kt()});function Y$(e,{authToken:t,helper:n}){if(!t)throw new J(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let i=e,r=i._options.defaultHeaders,o=i._authState?.extraHeaders,s=o?Object.fromEntries(Object.entries(o).filter(([c])=>{let l=c.toLowerCase();return l!=="authorization"&&l!=="x-api-key"})):void 0,a=I([s,r,{[Mo]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:a})}var qM=j(()=>{kt();Ce();eo()});function SPe(e){return J$(e,kPe,_Pe)}function xPe(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${D$()}`:D$()}var xp,Q$,Ei,X$,eS,tS,Xh,ey,Ep,Tp,nS,Ip,ty,wPe,kPe,_Pe,$Pe,za,WM,rS=j(()=>{fr();kt();Xi();lp();gM();H$();Ce();Sp();qM();Sp();wPe=999,kPe=1e3,_Pe=6e4,$Pe=3e5,za=class{constructor(t){xp.set(this,void 0),Q$.set(this,!1),Ei.set(this,void 0),X$.set(this,void 0),eS.set(this,void 0),tS.set(this,void 0),Xh.set(this,void 0),ey.set(this,void 0),Ep.set(this,void 0),this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.workerId=t.workerId??xPe(),M(this,xp,Y$(t.client,{authToken:t.environmentKey,helper:"environments-work-poller"}),"f"),M(this,eS,t.autoStop??!0,"f"),M(this,tS,t.drain??!1,"f"),M(this,Xh,t.blockMs===void 0?wPe:t.blockMs,"f"),M(this,ey,t.reclaimOlderThanMs??null,"f"),M(this,Ep,t.requestOptions,"f"),M(this,Ei,new AbortController,"f"),M(this,X$,Ua(t.signal,v(this,Ei,"f")),"f")}get signal(){return v(this,Ei,"f").signal}abort(){v(this,Ei,"f").abort()}async*[(xp=new WeakMap,Q$=new WeakMap,Ei=new WeakMap,X$=new WeakMap,eS=new WeakMap,tS=new WeakMap,Xh=new WeakMap,ey=new WeakMap,Ep=new WeakMap,Symbol.asyncIterator)](){if(v(this,Q$,"f"))throw new J("Cannot iterate over a consumed WorkPoller");M(this,Q$,!0,"f");let t=qe(this.client);t.info("poller starting",{component:"work-poller",environment_id:this.environmentId});let n=new WM(t,this.environmentId);try{let i=0;for(;!v(this,Ei,"f").signal.aborted;){let r;try{r=await v(this,xp,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...v(this,Xh,"f")!==null?{block_ms:v(this,Xh,"f")}:{},...v(this,ey,"f")!==null?{reclaim_older_than_ms:v(this,ey,"f")}:{}},{headers:I([v(this,Ep,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){if(v(this,Ei,"f").signal.aborted)return;if(ja(o))throw t.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=Z$(SPe(i));t.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),i++,await Yi(s,v(this,Ei,"f").signal);continue}if(i=0,r==null){if(v(this,tS,"f"))return;n.onEmptyPoll(),await Yi(BM(1e3,3e3),v(this,Ei,"f").signal);continue}n.onClaim(),t.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:r.id,work_type:r.data.type});try{await v(this,xp,"f").beta.environments.work.ack(r.id,{environment_id:r.environment_id},{headers:I([v(this,Ep,"f")?.headers]),signal:v(this,Ei,"f").signal})}catch(o){t.error("ack failed",{work_id:r.id,error:String(o)});continue}try{yield r}finally{if(v(this,eS,"f"))try{await v(this,xp,"f").beta.environments.work.stop(r.id,{environment_id:r.environment_id},{headers:I([v(this,Ep,"f")?.headers])})}catch(o){Tn(o,409)||t.warn("stop failed",{work_id:r.id,error:String(o)})}}}}finally{v(this,X$,"f").call(this)}}};WM=class{constructor(t,n){Tp.set(this,void 0),nS.set(this,void 0),Ip.set(this,void 0),ty.set(this,0),M(this,Tp,t,"f"),M(this,nS,n,"f")}onEmptyPoll(){let t=Date.now(),n={component:"work-poller",environment_id:v(this,nS,"f")};v(this,Ip,"f")===void 0?(M(this,Ip,M(this,ty,t,"f"),"f"),v(this,Tp,"f").info("idle; polling for work",n)):t-v(this,ty,"f")>=$Pe?(M(this,ty,t,"f"),v(this,Tp,"f").info(`still polling; idle for ${Math.round((t-v(this,Ip,"f"))/1e3)}s`,n)):v(this,Tp,"f").debug("poll returned no work",n)}onClaim(){M(this,Ip,void 0,"f")}};Tp=new WeakMap,nS=new WeakMap,Ip=new WeakMap,ty=new WeakMap});var Ap,Ga,Rp,iS,UQ=j(()=>{fr();iS=class{constructor(){Ap.set(this,[]),Ga.set(this,[]),Rp.set(this,!1)}push(t){if(v(this,Rp,"f"))return!1;let n=v(this,Ga,"f").shift();return n?n({done:!1,value:t}):v(this,Ap,"f").push(t),!0}close(){if(!v(this,Rp,"f"))for(M(this,Rp,!0,"f");v(this,Ga,"f").length>0;)v(this,Ga,"f").shift()({done:!0,value:void 0})}next(t){return v(this,Ap,"f").length>0?Promise.resolve({done:!1,value:v(this,Ap,"f").shift()}):v(this,Rp,"f")||t?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(n=>{let i=o=>{t?.removeEventListener("abort",r),n(o)},r=()=>{let o=v(this,Ga,"f").indexOf(i);o>=0&&v(this,Ga,"f").splice(o,1),n({done:!0,value:void 0})};v(this,Ga,"f").push(i),t?.addEventListener("abort",r,{once:!0})})}tryShift(){return v(this,Ap,"f").shift()}};Ap=new WeakMap,Ga=new WeakMap,Rp=new WeakMap});var Ae,Rl=j(()=>{Ae=class extends Error{constructor(t){let n=typeof t=="string"?t:t.map(i=>i.type==="text"?i.text:`[${i.type}]`).join(" ");super(n),this.name="ToolError",this.content=t}}});function KM(e){return"name"in e?e.name:"mcp_server_name"in e?e.mcp_server_name:e.type}function EPe(e){return e instanceof Ae?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function jQ(e,t,n){try{let i=e.parse?e.parse(t):t;return{content:await e.run(i,n),isError:!1}}catch(i){return{content:EPe(i),isError:!0}}}var zQ=j(()=>{Rl()});function ZQ(e){return e.type==="session.status_idle"&&e.stop_reason?.type==="end_turn"}function DPe(e,t,n){return e.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n}:{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function OPe(e){if(typeof e=="string")return[{type:"text",text:e||"(no output)"}];let t=e.map(n=>n.type==="text"?{type:"text",text:n.text||"(no output)"}:n.type==="image"||n.type==="document"?n:n.type==="search_result"?{type:"search_result",source:n.source,title:n.title,content:n.content.map(i=>({type:"text",text:i.text})),citations:{enabled:n.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(n)});return t.length>0?t:[{type:"text",text:"(no output)"}]}var ny,uS,Cp,Cl,to,Ht,oS,Un,sS,ry,dS,fn,Pp,ei,Dp,Va,Np,hs,pS,iy,Ti,aS,HQ,GQ,VQ,BQ,HM,qQ,cS,lS,JM,WQ,JQ,KQ,TPe,IPe,APe,RPe,CPe,NPe,PPe,ZM,Ba,fS=j(()=>{fr();kt();Xi();lp();Sp();H$();UQ();Ce();eo();zQ();KQ=500,TPe=1e4,IPe=12e4,APe=3e4,RPe=1e3,CPe=3e4,NPe=5*6e4,PPe=6e4;ZM=class{constructor(t,n){ny.set(this,void 0),uS.set(this,void 0),Cp.set(this,new Set),Cl.set(this,!1),to.set(this,void 0),M(this,ny,t,"f"),M(this,uS,n,"f")}noteEvent(t){t.type!=="user.tool_confirmation"&&(ZQ(t)?this.arm():this.disarm())}block(t){v(this,Cp,"f").add(t),v(this,to,"f")!==void 0&&(M(this,Cl,!0,"f"),clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}unblock(t){v(this,Cp,"f").delete(t),v(this,Cp,"f").size===0&&v(this,Cl,"f")&&this.arm()}arm(){if(!(v(this,ny,"f")<=0)){if(v(this,Cp,"f").size>0){M(this,Cl,!0,"f");return}M(this,Cl,!1,"f"),v(this,to,"f")!==void 0&&clearTimeout(v(this,to,"f")),M(this,to,setTimeout(v(this,uS,"f"),v(this,ny,"f")),"f")}}disarm(){M(this,Cl,!1,"f"),v(this,to,"f")!==void 0&&(clearTimeout(v(this,to,"f")),M(this,to,void 0,"f"))}};ny=new WeakMap,uS=new WeakMap,Cp=new WeakMap,Cl=new WeakMap,to=new WeakMap;Ba=class{constructor(t,n){Ht.add(this),oS.set(this,!1),Un.set(this,void 0),sS.set(this,void 0),ry.set(this,void 0),dS.set(this,void 0),fn.set(this,void 0),Pp.set(this,new Set),ei.set(this,new Set),Dp.set(this,new Map),Va.set(this,new Map),Np.set(this,new iS),hs.set(this,0),pS.set(this,NPe),iy.set(this,null),Ti.set(this,void 0),this.client=n.client,this.sessionId=t,this.tools=n.tools,this.maxIdleMs=n.maxIdleMs??PPe,M(this,fn,qe(n.client),"f"),M(this,dS,new Map(n.tools.map(i=>[KM(i),i])),"f"),M(this,Un,new AbortController,"f"),M(this,sS,Ua(n.signal,v(this,Un,"f")),"f"),M(this,ry,n.requestOptions,"f"),M(this,Ti,new ZM(this.maxIdleMs,()=>{v(this,fn,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),v(this,Un,"f").abort()}),"f")}get signal(){return v(this,Un,"f").signal}abort(){v(this,Un,"f").abort()}_setSendRetryWindow(t){M(this,pS,t,"f")}async*[(oS=new WeakMap,Un=new WeakMap,sS=new WeakMap,ry=new WeakMap,dS=new WeakMap,fn=new WeakMap,Pp=new WeakMap,ei=new WeakMap,Dp=new WeakMap,Va=new WeakMap,Np=new WeakMap,hs=new WeakMap,pS=new WeakMap,iy=new WeakMap,Ti=new WeakMap,Ht=new WeakSet,Symbol.asyncIterator)](){if(v(this,oS,"f"))throw new J("Cannot iterate over a consumed SessionToolRunner");M(this,oS,!0,"f"),v(this,fn,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let t=v(this,Ht,"m",HQ).call(this).catch(n=>{v(this,Un,"f").signal.aborted||v(this,fn,"f").error("stream loop failed",{error:String(n)}),v(this,Un,"f").abort()});try{for(;;){let i=await v(this,Np,"f").next(v(this,Un,"f").signal);if(i.done)break;yield i.value}await t;let n;for(;(n=v(this,Np,"f").tryShift())!==void 0;)yield n}finally{v(this,Un,"f").abort(),v(this,Ti,"f").disarm(),await t;try{await v(this,Ht,"m",JQ).call(this)}catch(n){v(this,fn,"f").warn("drain failed",{error:String(n)})}v(this,Np,"f").close();for(let n of this.tools)try{await n.close?.()}catch(i){v(this,fn,"f").warn("tool.close failed",{tool:KM(n),error:String(i)})}v(this,sS,"f").call(this)}}};aS=function(){return{...v(this,ry,"f"),headers:I([Yh("session-tool-runner"),v(this,ry,"f")?.headers]),signal:v(this,Un,"f").signal}},HQ=async function(){let t=v(this,Un,"f"),n=KQ;for(;!t.signal.aborted;){try{let i=await this.client.beta.sessions.events.stream(this.sessionId,{},v(this,Ht,"m",aS).call(this));await v(this,Ht,"m",GQ).call(this);for await(let r of i)if(n=KQ,await v(this,Ht,"m",BQ).call(this,r))return}catch(i){if(t.signal.throwIfAborted(),ja(i))throw v(this,fn,"f").error("permanent stream failure, shutting down",{error:String(i)}),t.abort(),i;v(this,fn,"f").warn("stream disconnected, reconnecting",{error:String(i),backoff_ms:n})}t.signal.throwIfAborted(),await Yi(n,t.signal),n=Math.min(n*2,TPe)}},GQ=async function(){let t=v(this,Un,"f"),n=[],i=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},v(this,Ht,"m",aS).call(this)))v(this,Ht,"m",VQ).call(this,s,n),i=ZQ(s)}catch(s){t.signal.throwIfAborted(),v(this,fn,"f").warn("reconcile list failed",{error:String(s)});for(let a of n)v(this,Pp,"f").delete(a.id);return}let r=n.filter(s=>!v(this,ei,"f").has(s.id));v(this,Ti,"f").disarm();for(let s of r)await v(this,Ht,"m",HM).call(this,s);for(let s of[...v(this,Va,"f").values()]){let a=v(this,Dp,"f").get(s.id);a!==void 0&&await v(this,Ht,"m",cS).call(this,s,a)}let o=r.filter(s=>!v(this,ei,"f").has(s.id)&&!v(this,Va,"f").has(s.id));i&&o.length===0?v(this,Ti,"f").arm():v(this,Ti,"f").disarm()},VQ=function(t,n){t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"?(v(this,Pp,"f").add(t.id),v(this,ei,"f").has(t.id)||n.push(t)):t.type==="user.tool_result"?v(this,ei,"f").add(t.tool_use_id):t.type==="user.custom_tool_result"?v(this,ei,"f").add(t.custom_tool_use_id):t.type==="user.tool_confirmation"&&(v(this,ei,"f").has(t.tool_use_id)||v(this,Dp,"f").set(t.tool_use_id,t.result))},BQ=async function(t){switch(v(this,Ti,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":return v(this,Pp,"f").has(t.id)||(v(this,Pp,"f").add(t.id),await v(this,Ht,"m",HM).call(this,t)),!1;case"user.tool_confirmation":return await v(this,Ht,"m",qQ).call(this,t),!1;case"user.tool_result":return v(this,ei,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return v(this,ei,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return v(this,fn,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),v(this,Un,"f").abort(),!0;default:return!1}},HM=async function(t){let n=t.evaluated_permission,i=n==="deny"?"deny":v(this,Dp,"f").get(t.id);if(i===void 0){n===void 0||n==="allow"?await v(this,Ht,"m",JM).call(this,t,void 0):v(this,Va,"f").has(t.id)||(v(this,fn,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Va,"f").set(t.id,t),v(this,Ti,"f").block(t.id));return}await v(this,Ht,"m",cS).call(this,t,i)},qQ=async function(t){v(this,Dp,"f").set(t.tool_use_id,t.result);let n=v(this,Va,"f").get(t.tool_use_id);n!==void 0&&await v(this,Ht,"m",cS).call(this,n,t.result)},cS=async function(t,n){let i=v(this,Va,"f").delete(t.id);if(n==="allow"){v(this,fn,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),i||v(this,Ti,"f").block(t.id);try{await v(this,Ht,"m",JM).call(this,t,"allow")}finally{v(this,Ti,"f").unblock(t.id)}return}i&&v(this,Ti,"f").unblock(t.id),v(this,ei,"f").add(t.id),v(this,fn,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Ht,"m",lS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},lS=function(t){v(this,Np,"f").push(t)},JM=async function(t,n){var i,r;if(!v(this,ei,"f").has(t.id)){v(this,fn,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),M(this,hs,(i=v(this,hs,"f"),i++,i),"f");try{let o=v(this,dS,"f").get(t.name);if(!o){v(this,fn,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),v(this,Ht,"m",lS).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:n});return}let s,a,c=new AbortController,l=Ua(v(this,Un,"f").signal,c),u=setTimeout(()=>c.abort(),IPe);try{let f=await jQ(o,t.input,{toolUse:t,toolUseBlock:t,signal:c.signal});s=f.content,a=f.isError}finally{clearTimeout(u),l()}let d=DPe(t,a,OPe(s)),p=await v(this,Ht,"m",WQ).call(this,d,t.id);v(this,Ht,"m",lS).call(this,{event:t,result:d,toolUseId:t.id,name:t.name,isError:a,posted:p,confirmation:n})}finally{M(this,hs,(r=v(this,hs,"f"),r--,r),"f"),v(this,hs,"f")===0&&v(this,iy,"f")?.call(this)}}},WQ=async function(t,n){let i=v(this,Un,"f"),r=Date.now(),o,s=0;for(;;){s++,i.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},v(this,Ht,"m",aS).call(this)),v(this,ei,"f").add(n),!0}catch(a){if(o=a,ja(a))break;let c=v(this,pS,"f")-(Date.now()-r);if(c<=0)break;let l=Math.min(Z$(J$(s-1,RPe,CPe)),c);v(this,fn,"f").warn("tool result send failed; retrying",{tool_use_id:n,attempt:s,backoff_ms:l,error:String(a)}),await Yi(l,i.signal)}}return v(this,fn,"f").error("failed to send tool result",{tool_use_id:n,attempts:s,error:String(o)}),!1},JQ=async function(){v(this,hs,"f")!==0&&(await Promise.race([new Promise(t=>M(this,iy,t,"f")),Yi(APe)]),M(this,iy,null,"f"),v(this,hs,"f")>0&&v(this,fn,"f").warn("drain timeout exceeded"))}});function mS(e,t){if(!(e>=oy))throw new J(`${t} must be at least ${oy}ms (got ${e}); to run without memory sync, pass \`memorySyncIntervalMs: null\` to the worker instead`)}var sy,oy,gS=j(()=>{kt();sy=15e3,oy=5e3});var YQ=j(()=>{hM()});function Nl(e){if(e.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:t=>t,...e.close?{close:e.close}:{}}}var QQ=j(()=>{YM();YQ()});function Op(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}var QM=j(()=>{});function hS(e,t){let n=xe.relative(e,t);return n===""||!n.startsWith(".."+xe.sep)&&n!==".."&&!xe.isAbsolute(n)}async function XM(e,t){for(let n of e)if(hS(await ay(xe.resolve(n)),t))return n}function ly(e){let t=e?.code;return typeof t=="string"?t:void 0}async function ay(e){let t=[],n=e,i=0;for(;;){let r;try{r=await Pl.realpath(n)}catch(o){let s;try{s=(await Pl.lstat(n)).isSymbolicLink()}catch(a){let c=ly(a);if(c!=="ENOENT"&&c!=="ENOTDIR")throw a;let l=xe.dirname(n);if(l===n)throw a;t.push(xe.basename(n)),n=l;continue}if(!s)throw o;if(++i>LPe)throw Object.assign(new Error("too many levels of symbolic links"),{code:"ELOOP"});n=xe.resolve(xe.dirname(n),await Pl.readlink(n));continue}return t.length?xe.join(r,...t.reverse()):r}}async function XQ(e,t,n){let i=n?.allowedRoots??[],r=await ay(xe.resolve(e)),o;try{o=await ay(xe.resolve(r,t))}catch(a){throw new Ae(Mp(a,`path ${JSON.stringify(t)}`))}if(hS(r,o)||await XM(i,o)!==void 0)return o;let s=i.length?"the session's working directory and its other permitted directories":"the session's working directory";throw new Ae(`path ${JSON.stringify(t)} is outside ${s}`)}async function eL(e,t){let n=xe.dirname(e),i=xe.join(n,`.tmp-${process.pid}-${Oa.randomUUID()}`),r=await Pl.stat(e).then(s=>s.mode&511,()=>{}),o;try{o=await Pl.open(i,"wx",MPe),r!==void 0&&await o.chmod(r),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await Pl.rename(i,e)}catch(s){throw o&&await o.close().catch(()=>{}),await Pl.unlink(i).catch(()=>{}),s}}function Mp(e,t){let n=ly(e);switch(n){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${n!==void 0?`i/o error (${n})`:"i/o error"}`}}var Pl,cy,MPe,LPe,tL=j(()=>{Or();Rl();Pl=fs.promises,cy=448,MPe=384;LPe=40});async function tX(e){let{client:t,sessionId:n}=e;if(!t)return async()=>{};let i=qe(t),r=e.session;if(!r){if(n===void 0)return async()=>{};i.warn("AgentToolContext.sessionId is deprecated and costs an extra session fetch; fetch the session once and set `session` instead",{component:"agent-tool-context"}),r=await t.beta.sessions.retrieve(n)}let o=xe.resolve(e.workdir,"skills"),s=[];for(let a of r.agent.skills)try{let c=await t.beta.skills.versions.retrieve(a.version,{skill_id:a.skill_id}),l=xe.basename(c.name.trim());(l===""||l==="."||l==="..")&&(l=a.skill_id);let u=xe.resolve(o,l);if(u!==o&&!u.startsWith(o+xe.sep)){i.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:c.name});continue}let d=await t.beta.skills.versions.download(c.id,{skill_id:a.skill_id});await Ii.rm(u,{recursive:!0,force:!0}),await Ii.mkdir(u,{recursive:!0,mode:cy}),s.push(u),await iL(d,u),i.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c.id,dest:u})}catch(c){i.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of s)await Ii.rm(a,{recursive:!0,force:!0}).catch(c=>{i.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}function UPe(e){for(let t of e){let n=t.trim();if(n&&(xe.isAbsolute(n)||n.split(/[\\/]/).includes("..")))throw new J(`refusing to extract unsafe archive member: ${n}`)}}function eX(e){let t=e.split(` +`);return t[t.length-1]===""&&t.pop(),t}function zPe(e,t){return/^[\x20-\x7E]+$/.test(t)&&!/[\\^#]/.test(t)&&!(e==="unzip"&&t.startsWith("-"))}function GPe(e,t,n){let i=eX(t),r=eX(n);if(i.length!==r.length)throw new J(rL);let o=[],s=[];return i.forEach((a,c)=>{if(jPe[e].has(r[c].charAt(0))){o.push(a);return}if(!zPe(e,a))throw new J(`refusing to extract archive: cannot safely exclude member ${JSON.stringify(a)}`);s.push(a)}),{plain:o,special:s}}async function nX(e){for(let t of await Ii.readdir(e,{withFileTypes:!0}))if(t.isDirectory())await nX(xe.join(e,t.name));else if(!t.isFile())throw new J(rL)}async function nL(e,t){try{let{stdout:n}=await FPe(e,t);return n}catch(n){throw ly(n)==="ENOENT"?new J(`skill extraction requires the \`${e}\` command, but it was not found on PATH`):n}}function VPe(e){let t,n=!1;for(let i of e){let r=i.trim().split("/").filter(s=>s!==""&&s!==".");if(r.length===0)continue;let o=r[0];if(t===void 0)t=o;else if(o!==t)return"";r.length>1&&(n=!0)}return t!==void 0&&n?t:""}async function iL(e,t){let n=xe.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new J("skill download response had no body");await S$.promises.pipeline(S$.Readable.fromWeb(e.body),fs.createWriteStream(n));let i=xe.join(xe.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`),r=xe.join(xe.dirname(t),`.skill-exclude-${process.pid}-${Date.now()}`);try{let o=await qPe(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,a=s?"unzip":"tar",c=await nL(a,s?["-Z1",n]:["-tf",n]),l=await nL(a,s?["-Z","--h","--t",n]:["-tvf",n]),{plain:u,special:d}=GPe(a,c,l);UPe([...u,...d]);let p=VPe(u);await Ii.mkdir(i,{recursive:!0,mode:cy}),u.length>0&&await nL(a,await BPe(a,n,i,d,r)),await nX(i);let f=p?xe.join(i,p):i,m=await Ii.readdir(f).catch(g=>{throw ly(g)==="ENOENT"?new J(rL):g});for(let g of m)await Ii.rename(xe.join(f,g),xe.join(t,g))}finally{await Ii.rm(n,{force:!0}),await Ii.rm(r,{force:!0}),await Ii.rm(i,{recursive:!0,force:!0})}}async function BPe(e,t,n,i,r){let o=i.map(s=>s.replace(/[*?[\\]/g,"\\$&"));return e==="unzip"?["-oq",t,"-d",n,...o.length>0?["-x",...o]:[]]:o.length===0?["-xf",t,"-C",n]:(await Ii.writeFile(r,o.join(` `)+` -`,{flag:"wx",mode:384}),["-xf",t,"-C",n,"-X",r])}async function FPe(e,t){let n=await Ii.open(e,"r");try{let i=Buffer.alloc(t),{bytesRead:r}=await n.read(i,0,t,0);return i.subarray(0,r)}finally{await n.close()}}var Ii,NPe,JM,PPe,YQ=j(()=>{Mr();kt();Xi();HM();Ii=fs.promises,NPe=nM.promisify(tM.execFile);JM="skill archive listing is inconsistent; refusing to extract",PPe={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function QM(e){return e.startsWith("/")&&!e.split("/").includes("..")}function GPe(){return YM!==0}async function VPe(e){let t=[],n=e;for(;;){try{await $n.stat(n);break}catch(r){let o=r.code;if(o!=="ENOENT"&&o!=="ENOTDIR"&&o!=="ELOOP")throw r}t.push(n);let i=xe.dirname(n);if(i===n)break;n=i}for(let i of t.reverse())try{await $n.mkdir(i,{mode:tX})}catch(r){if(r.code!=="EEXIST")throw r}}async function QQ(e,t){let n=xe.relative(e,t);if(n==="")return;let i=e;for(let r of n.split(xe.sep)){i=xe.join(i,r);try{await $n.mkdir(i,{mode:tX})}catch(o){if(o.code!=="EEXIST")throw o}}}async function BPe(e,t,n){let i=n?jPe:UPe,r=xe.join(xe.dirname(e),`.fs-${Oa.randomBytes(8).toString("hex")}.tmp`),o;try{o=await $n.open(r,Mp.O_WRONLY|Mp.O_CREAT|Mp.O_EXCL|YM,i),await o.writeFile(t),await o.close(),o=void 0,await $n.rename(r,e)}catch(s){throw o&&await o.close().catch(()=>{}),await $n.unlink(r).catch(()=>{}),s}}async function nX(e,t){let n;try{n=await $n.open(t,Mp.O_RDONLY|YM|zPe)}catch(i){let r=i.code;throw r==="ELOOP"||r==="EMLINK"?new Je(Je.IS_A_SYMLINK,e):i}try{if(!(await n.stat()).isFile())throw new Je(Je.NOT_A_FILE,e)}catch(i){throw await n.close().catch(()=>{}),i}return n}async function qPe(e){let t=Oa.createHash("sha256"),n=await nX(xe.basename(e),e),i=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:r}=await n.read(i,0,i.length);if(r===0)break;t.update(i.subarray(0,r))}}finally{await n.close()}return t.digest("hex")}async function XQ(e,t,n){if(!await HPe(t,n))return[];let i=[];return await rX(n,(r,o)=>{o.isFile()&&i.push([xe.relative(e,r).split(xe.sep).join("/"),r])}),i.sort(),i}async function WPe(e,t,n){let i=s=>xe.relative(e,s).split(xe.sep).join("/"),r;try{r=await $n.lstat(n,{bigint:!0})}catch(s){let a=s.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw s}if(r.isSymbolicLink())return new Set([i(n)]);if(!r.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,t);let o=new Set;return await rX(n,(s,a)=>{a.isSymbolicLink()&&o.add(i(s))}),o}async function HPe(e,t){let n;try{n=await $n.lstat(t,{bigint:!0})}catch(i){let r=i.code;if(r==="ENOENT"||r==="ENOTDIR")return!1;throw i}if(!n.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,e);return!0}async function rX(e,t){let n=[e];for(;n.length;){let i=n.pop(),r;try{r=await $n.readdir(i,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")continue;throw o}for(let o of r){let s=xe.join(i,o.name);t(s,o),o.isDirectory()&&!o.isSymbolicLink()&&n.push(s)}}}function KPe(e,t){return t.mtimeNs===e.mtimeNs&&t.ctimeNs===e.ctimeNs&&t.size===e.size}function JPe(e,t){return(e.mtimeNs>e.ctimeNs?e.mtimeNs:e.ctimeNs){Mr();xl();$n=fs.promises,Mp=fs.constants,tX=448,UPe=384,jPe=448,YM=Mp.O_NOFOLLOW??0,zPe=Mp.O_NONBLOCK??0,Je=class extends Error{constructor(t,n){super(`path ${JSON.stringify(n)} ${t}`),this.name="FileStoreError",this.reason=t,this.relPath=n}};Je.ESCAPES_ROOT="escapes the store root";Je.IS_A_SYMLINK="is a symlink";Je.NOT_A_FILE="is not a regular file";Je.NOT_A_DIRECTORY="is not a directory";Je.NOT_UTF8="is not valid utf-8";Je.MOVE_DESTINATION_EXISTS="already exists";Lp=class e{constructor(t,n,i=!1){this.hashes=new Map,this.rootPath=t,this.removedOnDispose=n,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(t,n){if(!GPe())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await $n.lstat(t)}catch(r){if(r.code!=="ENOENT")throw r;i=!0}return new e(xe.resolve(t),i,n?.utf8??!1)}async createRoot(){await VPe(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await $n.rm(this.rootPath,{recursive:!0,force:!0})}async put(t,n,i){let r=t.replace(/\\/g,"/");if(r.endsWith("/")||r.endsWith("/.")||r===""||r===".")throw new Je(Je.NOT_A_FILE,t);let o=this.resolveUnderRoot(t),s=typeof n=="string"?Ma(n):n;this.requireUtf8(t,s),await QQ(this.rootPath,xe.dirname(o)),await BPe(o,s,i?.executable??!1)}async get(t){let n=this.resolveUnderRoot(t),i;try{i=await nX(t,n)}catch(o){if(o.code==="ENOENT")return null;throw o}let r;try{let o=await i.readFile();r=new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}finally{await i.close()}return this.requireUtf8(t,r),r}async ls(t="/"){let n=this.resolveUnderRoot(t);return new Set((await XQ(this.rootPath,t,n)).map(([i])=>i))}async findSymlinks(t="/"){let n=this.resolveUnderRoot(t);return WPe(this.rootPath,t,n)}async hashtree(t="/"){let n=this.resolveUnderRoot(t),i=uS.nowNs(),r=Object.create(null);for(let[o,s]of await XQ(this.rootPath,t,n)){let a=await this.hashViaCache(o,s,i);a!==null&&(r[o]=a)}return r}async hashFile(t){let n=this.resolveUnderRoot(t),i;try{i=await $n.lstat(n,{bigint:!0})}catch(o){if(o.code==="ENOENT")return null;throw o}if(i.isSymbolicLink())throw new Je(Je.IS_A_SYMLINK,t);if(!i.isFile())throw new Je(Je.NOT_A_FILE,t);let r=xe.relative(this.rootPath,n).split(xe.sep).join("/");return this.hashViaCache(r,n,uS.nowNs())}async move(t,n){let i=this.resolveUnderRoot(t),r=this.resolveUnderRoot(n);if(i===this.rootPath||r===this.rootPath)return;if(await $n.stat(r).then(()=>!0,()=>!1))throw new Je(Je.MOVE_DESTINATION_EXISTS,n);await QQ(this.rootPath,xe.dirname(r)),await $n.rename(i,r)}async remove(t){let n=this.resolveUnderRoot(t);if(n===this.rootPath)return;let i;try{i=await $n.lstat(n,{bigint:!0})}catch(r){if(r.code==="ENOENT")return;throw r}if(i.isDirectory())await $n.rm(n,{recursive:!0,force:!0});else try{await $n.unlink(n)}catch(r){if(r.code!=="ENOENT")throw r}}resolveUnderRoot(t){let n=t.replace(/\\/g,"/").replace(/^\/+/,""),i=n.split("/").filter(r=>r!==""&&r!==".");if(xe.posix.isAbsolute(n)||i.includes(".."))throw new Je(Je.ESCAPES_ROOT,t);return i.length===0?this.rootPath:xe.join(this.rootPath,...i)}requireUtf8(t,n){if(this.decoder)try{this.decoder.decode(n)}catch{throw new Je(Je.NOT_UTF8,t)}}async hashViaCache(t,n,i){let r;try{r=await $n.lstat(n,{bigint:!0})}catch(a){if(a.code==="ENOENT")return null;throw a}if(!r.isFile())return null;let o=this.hashes.get(t),s;if(o!==void 0&&KPe(o,r))s=o.sha;else try{s=await uS.hashFile(n)}catch(a){let c=a.code;if(c==="ENOENT"||a instanceof Je||c==="ELOOP"||c==="EMLINK")return null;throw a}return JPe(r,i)&&this.hashes.set(t,{mtimeNs:r.mtimeNs,ctimeNs:r.ctimeNs,size:r.size,sha:s}),s}};Lp.isPathLegal=QM;ZPe=2000000000n,uS={hashFile:qPe,timestampTrustMarginNs:ZPe,nowNs:()=>BigInt(Date.now())*1000000n},iX=Lp,eX=Symbol.asyncDispose;eX&&Object.defineProperty(Lp.prototype,eX,{value:Lp.prototype.dispose,configurable:!0,writable:!0})});function pX(e){return Oa.createHash("sha256").update(`version ${yX} -${e}`,"utf-8").digest("hex")}function Up(e){return typeof e=="object"&&e!==null&&typeof e.code=="string"}async function iDe(e,t){if(!t){await e;return}let n,i=new Promise(r=>{n=r,t.aborted&&r()});t.addEventListener("abort",n,{once:!0});try{await Promise.race([e,i])}finally{t.removeEventListener("abort",n)}}var $t,Wa,gS,ry,hS,ct,Fp,fS,qa,fX,mS,mX,gX,XM,tL,sX,aX,eL,cX,lX,dS,pS,uX,dX,hX,Cl,yX,YPe,QPe,XPe,eDe,tDe,nDe,rDe,ys,nL,yS,bX=j(()=>{gr();Mr();kt();Xi();xl();_p();oX();cS();cS();hX=3e4,Cl=".anthropic-memory-store",yX=1;YPe=3e4,QPe=100,XPe=20,eDe=16,tDe=32,nDe=8,rDe=50,ys=class extends J{constructor(t,n){super(t),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},nL=class{constructor(t,n,i){this.mode=t,this.cap=n,this.waiveWindow=i,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},yS=class{constructor(t,n){$t.add(this),Wa.set(this,void 0),gS.set(this,void 0),ry.set(this,void 0),hS.set(this,void 0),ct.set(this,void 0),Fp.set(this,void 0),fS.set(this,!1),qa.set(this,[]),M(this,Wa,t,"f"),M(this,gS,n.workdir,"f"),M(this,ry,n.syncIntervalMs??Xh,"f"),aS(v(this,ry,"f"),"syncIntervalMs"),M(this,hS,n.syncDeletions??"enabled","f"),M(this,ct,qe(t),"f"),M(this,Fp,Date.now(),"f")}get roots(){return v(this,qa,"f").map(t=>t.files.root().path)}get readOnlyRoots(){return v(this,qa,"f").filter(t=>t.readOnly).map(t=>t.files.root().path)}async download(t){for(let n of t.resources){if(n.type!=="memory_store")continue;let i=v(this,$t,"m",fX).call(this,n),r;try{if(r={memoryStoreId:n.memory_store_id,files:await iX.open(i,{utf8:!0}),readOnly:n.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!r.files.root().removedOnDispose)throw new ys(`something already exists at the memory store's path: ${i} (memory_store_id=${n.memory_store_id}); it must not exist when the session starts`);try{await r.files.createRoot()}catch(o){throw Up(o)?new ys(`cannot create the memory store's folder: ${i} (memory_store_id=${n.memory_store_id}): ${o}; the worker host must make this mount path writable`,o):o}await v(this,$t,"m",tL).call(this,r),v(this,ct,"f").info("downloaded memories",{count:r.baseline.size,memory_store_id:r.memoryStoreId,dest:r.files.root().path}),v(this,qa,"f").push(r)}catch(o){throw r&&await r.files.dispose().catch(()=>{}),o instanceof ys?o:new ys(`failed to download memory store memory_store_id=${n.memory_store_id}: ${o}`,o)}}M(this,Fp,Date.now(),"f")}async finish(){if(v(this,fS,"f"))throw new J("finish() was already called: it is the session's last sync and runs once");M(this,fS,!0,"f"),await this.syncAll(!0)}async syncAll(t){await Promise.all(v(this,qa,"f").map(n=>v(this,$t,"m",mX).call(this,n,t))),M(this,Fp,Date.now(),"f")}async syncIfDue(){Date.now()-v(this,Fp,"f")v(this,$t,"m",gX).call(this,n,t)))}async dispose(){for(let t of v(this,qa,"f")){let n=t.files.root();try{let i=await v(this,$t,"m",mS).call(this,t);if(!i.markerOk&&Object.keys(i.files).length>0){v(this,ct,"f").warn(`${i.distrustReason}; leaving the memory store folder on disk`,{root:n.path,memory_store_id:t.memoryStoreId});continue}await t.files.dispose()}catch(i){if(!(i instanceof Je)&&!Up(i))throw i;v(this,ct,"f").warn("failed to remove the memory store folder",{root:t.files.root().path,memory_store_id:t.memoryStoreId,error:String(i)});continue}n.removedOnDispose&&v(this,ct,"f").info("removed memory store dir",{dest:n.path,memory_store_id:t.memoryStoreId})}}};Wa=new WeakMap,gS=new WeakMap,ry=new WeakMap,hS=new WeakMap,ct=new WeakMap,Fp=new WeakMap,fS=new WeakMap,qa=new WeakMap,$t=new WeakSet,fX=function(t){if(t.mount_path){if(!QM(t.mount_path))throw new ys(`memory store mount_path is not a clean absolute path: ${JSON.stringify(t.mount_path)} (memory_store_id=${t.memory_store_id})`);return t.mount_path}return xe.join(v(this,gS,"f"),"memory",t.name||t.memory_store_id)},mS=async function(t){let n=await t.files.hashtree(),i=n[Cl];return delete n[Cl],i===pX(t.memoryStoreId)?{files:n,markerOk:!0,distrustReason:null}:{files:n,markerOk:!1,distrustReason:i!==void 0?"the marker file does not match this store":"the marker file is gone"}},mX=async function(t,n){try{let i=await v(this,$t,"m",mS).call(this,t),r=i.files;if(!i.markerOk){if(Object.keys(r).length>0){v(this,ct,"f").warn(`${i.distrustReason}; leaving the memory store folder as found and not syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}await v(this,$t,"m",XM).call(this,t,"the folder or its marker is gone");return}if(Object.keys(r).length===0&&t.baseline.size>1){await v(this,$t,"m",XM).call(this,t,"every memory file is gone at once");return}let o=new Map;for await(let[u,d]of v(this,$t,"m",dS).call(this,t.memoryStoreId))o.set(u,d);let s=new nL(v(this,hS,"f"),Math.max(nDe,Math.min(rDe,Math.floor(t.baseline.size/4))),n),a=[],c=new Map,l=[...new Set([...o.keys(),...Object.keys(r),...t.baseline.keys()])].sort();for(let u of l){let d=o.get(u),p=r[u],f=t.baseline.get(u),m;p===void 0&&f!==void 0&&d!==void 0&&d.content_sha256===f&&!t.readOnly?m=await v(this,$t,"m",uX).call(this,t,u,d,f,s):m=await v(this,$t,"m",sX).call(this,t,u,d,p,a),m!==void 0&&c.set(u,m)}t.baseline=c,await v(this,$t,"m",cX).call(this,t,a),s.suppressed>0&&v(this,ct,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:s.suppressed,memory_store_id:t.memoryStoreId}),s.capped>0&&v(this,ct,"f").warn(`delete cap reached: ${s.mode==="log_only"?"would send":"sent"} ${s.attempted} deletes, held ${s.capped} for later syncs`,{memory_store_id:t.memoryStoreId})}catch(i){v(this,ct,"f").warn("memory sync failed",{memory_store_id:t.memoryStoreId,error:String(i)})}},gX=async function(t,n){let i=new Map,r=new Set,o=async()=>{if(t.readOnly)return;let s=await v(this,$t,"m",mS).call(this,t);if(!s.markerOk){v(this,ct,"f").warn(`${s.distrustReason}; not uploading anything from the memory store folder`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}for(let[l,u]of Object.entries(s.files))u!==t.baseline.get(l)&&t.refusedShas.get(l)!==u&&(i.set(l,u),r.add(l));if(i.size===0||n?.aborted)return;let a=new Map;for await(let[l,u]of v(this,$t,"m",dS).call(this,t.memoryStoreId)){if(n?.aborted)return;a.set(l,u)}let c=[];for(let l of[...i.keys()].sort()){let u=i.get(l),d=t.baseline.get(l),p=a.get(l);if(p!==void 0&&p.content_sha256===u){t.baseline.set(l,p.content_sha256),r.delete(l);continue}if(p!==void 0&&p.content_sha256!==d){v(this,ct,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:l,memory_store_id:t.memoryStoreId}),r.delete(l);continue}c.push([l,u,p])}await v(this,$t,"m",lX).call(this,t,c,r,n)};try{await iDe(o(),n),n?.aborted&&r.size>0&&v(this,ct,"f").warn(`memory flush cut off part-way; ${r.size} of ${i.size} changed files had not finished uploading`,{memory_store_id:t.memoryStoreId})}catch(s){v(this,ct,"f").warn("memory flush failed",{memory_store_id:t.memoryStoreId,error:String(s)})}},XM=async function(t,n){v(this,ct,"f").warn(`${n}; re-downloading the memory store folder instead of syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId}),await t.files.createRoot(),await v(this,$t,"m",tL).call(this,t)},tL=async function(t){t.baseline=new Map,t.pendingDeletes.clear(),await t.files.put(Cl,`version ${yX} -${t.memoryStoreId}`);for await(let[n,i]of v(this,$t,"m",dS).call(this,t.memoryStoreId,"full"))await v(this,$t,"m",eL).call(this,t,n,i.content??"")&&t.baseline.set(n,i.content_sha256)},sX=async function(t,n,i,r,o){let s=t.baseline.get(n);if(r!==void 0&&t.pendingDeletes.delete(n),!i){if(r===void 0){t.pendingDeletes.delete(n);return}if(s!==void 0){if(r===s){let d=await v(this,$t,"m",aX).call(this,t,n,s);if(d===void 0)return;if(d===s)return s;r=d}t.readOnly?v(this,ct,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:n,memory_store_id:t.memoryStoreId}):t.refusedShas.get(n)!==r&&v(this,ct,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:n,memory_store_id:t.memoryStoreId})}return t.readOnly||t.refusedShas.get(n)===r?void 0:await v(this,$t,"m",pS).call(this,t,n,r,void 0)}let a=i.content_sha256,c=a!==s,l=r!==void 0&&r!==s&&r!==a,u=!t.readOnly&&l;return r===void 0&&s!==void 0?(c&&(v(this,ct,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:n,memory_store_id:t.memoryStoreId}),t.pendingDeletes.delete(n),o.push([n,i])),s):c?r===a?a:(l&&v(this,ct,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:n,memory_store_id:t.memoryStoreId}),o.push([n,i]),s):u?t.refusedShas.get(n)===r?a:await v(this,$t,"m",pS).call(this,t,n,r,i)??a:a},aX=async function(t,n,i){let r;try{r=await t.files.hashFile(n)}catch(o){if(!(o instanceof Je)&&!Up(o))throw o;return i}if(r!==null){if(r!==i)return r;try{await t.files.remove(n)}catch(o){if(!(o instanceof Je)&&!Up(o))throw o;return v(this,ct,"f").warn("failed to remove memory deleted remotely",{path:n,memory_store_id:t.memoryStoreId,error:String(o)}),i}}},eL=async function(t,n,i){try{await t.files.put(n,i)}catch(r){if(!(r instanceof Je)&&!Up(r))throw r;return v(this,ct,"f").warn("failed to write memory",{path:n,memory_store_id:t.memoryStoreId,error:String(r)}),!1}return!0},cX=async function(t,n){if(n.length===0)return;let i=async(s,a)=>{let c;try{c=await v(this,Wa,"f").beta.memoryStores.memories.retrieve(a.id,{memory_store_id:t.memoryStoreId,view:"full"})}catch(l){if(An(l,404))return;v(this,ct,"f").warn("failed to fetch memory content",{path:s,memory_store_id:t.memoryStoreId,error:String(l)});return}await v(this,$t,"m",eL).call(this,t,s,c.content??"")&&t.baseline.set(s,c.content_sha256)},r=n[Symbol.iterator](),o=async()=>{for(let[s,a]of r)await i(s,a)};await Promise.all(Array.from({length:Math.min(eDe,n.length)},o))},lX=async function(t,n,i,r){let o=n[Symbol.iterator](),s=async()=>{for(let[a,c,l]of o){if(r?.aborted)return;let u=await v(this,$t,"m",pS).call(this,t,a,c,l);i.delete(a),u!==void 0&&t.baseline.set(a,u)}};await Promise.all(Array.from({length:Math.min(tDe,n.length)},s))},dS=async function*(t,n="basic"){let i=n==="basic"?QPe:XPe;for await(let r of v(this,Wa,"f").beta.memoryStores.memories.list(t,{view:n,limit:i})){if(r.type!=="memory")continue;let o=r.path.replace(/^\/+/,"");if(o===Cl){v(this,ct,"f").warn("the server listed the reserved marker path; skipping",{path:r.path,memory_store_id:t});continue}yield[o,r]}},pS=async function e(t,n,i,r){try{let o=await t.files.get(n);if(o===null)return;let s=Sl(o),a=r?await v(this,Wa,"f").beta.memoryStores.memories.update(r.id,{memory_store_id:t.memoryStoreId,content:s,precondition:{type:"content_sha256",content_sha256:r.content_sha256}}):await v(this,Wa,"f").beta.memoryStores.memories.create(t.memoryStoreId,{path:"/"+n,content:s});return t.refusedShas.delete(n),a.content_sha256}catch(o){if(r&&An(o,404))return await v(this,$t,"m",e).call(this,t,n,i,void 0);let s=o instanceof Je||An(o,400)||An(o,413);r&&An(o,409)?v(this,ct,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:n,memory_store_id:t.memoryStoreId}):s&&i!==void 0?(t.refusedShas.set(n,i),v(this,ct,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:n,memory_store_id:t.memoryStoreId,rejection:String(o)})):v(this,ct,"f").warn("failed to upload memory",{path:n,memory_store_id:t.memoryStoreId,error:String(o)});return}},uX=async function(t,n,i,r,o){if(o.mode==="disabled")return o.suppressed++,r;let s=t.pendingDeletes.get(n);if(s===void 0&&(s=Date.now(),t.pendingDeletes.set(n,s)),!o.waiveWindow&&Date.now()-s_S,BashTimeoutError:()=>$S,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>Xh,MARKER_PATH:()=>Cl,MEMORY_FLUSH_TIMEOUT_MS:()=>hX,MIN_MEMORY_SYNC_INTERVAL_MS:()=>Qh,SessionMemoryError:()=>ys,SessionMemoryStores:()=>yS,betaAgentToolset20260401:()=>dDe,betaBashTool:()=>AX,betaEditTool:()=>CX,betaGlobTool:()=>PX,betaGrepTool:()=>DX,betaReadTool:()=>RX,betaWriteTool:()=>NX,extractSkillArchive:()=>ZM,resolvePath:()=>zp,setupSkills:()=>JQ});function TX(e){return e===void 0?oDe:e}function Ll(e){if(e!==void 0)throw new J("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function dDe(e){return[AX(e),RX(e),NX(e),CX(e),PX(e),DX(e)]}async function zp(e,t){return Ll(e.unrestrictedPaths),HQ(e.workdir,t,{allowedRoots:e.allowedRoots??[]})}function IX(e,t){return qM(e.readOnlyRoots??[],t)}function pDe(){let e={};for(let[t,n]of Object.entries(process.env))t.startsWith("ANTHROPIC_")||(e[t]=n);return e}function AX(e){Ll(e.unrestrictedPaths);let t,n=Promise.resolve();return Rl({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:i,restart:r,timeout_ms:o},s)=>{let a=n,c=Dp();n=c.promise;try{await a}catch{}try{if(r&&(t?.close(),t=void 0),!i){if(r)return"bash session restarted";throw new Ae("bash: command is required")}t??(t=new _S(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(i,{timeoutMs:o??EX,signal:s?.signal});if(u!==0)throw new Ae(l||`exit ${u}`);return l}catch(l){throw l instanceof Ae?l:(t.close(),t=void 0,new Ae(`bash: ${l instanceof Error?l.message:String(l)}`))}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function RX(e){return Ll(e.unrestrictedPaths),Rl({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new Ae("read: file_path is required");let i=await zp(e,t);if(n?.length&&n.length!==2)throw new Ae("read: view_range must be [start_line, end_line]");let r;try{let u=await Rn.stat(i);if(!u.isFile())throw new Ae(`read: ${t} is not a regular file`);let d=TX(e.maxFileBytes);if(d!==null&&u.size>d){if(!n?.length)throw new Ae(`read: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[p,f]=n;return await fDe(i,t,p,f,d)}r=await Rn.readFile(i,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`read: ${Op(u,t)}`)}if(!n?.length)return r;let[o,s]=n,a=r.split(` +`,{flag:"wx",mode:384}),["-xf",t,"-C",n,"-X",r])}async function qPe(e,t){let n=await Ii.open(e,"r");try{let i=Buffer.alloc(t),{bytesRead:r}=await n.read(i,0,t,0);return i.subarray(0,r)}finally{await n.close()}}var Ii,FPe,rL,jPe,rX=j(()=>{Or();kt();Xi();tL();Ii=fs.promises,FPe=uM.promisify(lM.execFile);rL="skill archive listing is inconsistent; refusing to extract",jPe={unzip:new Set(["-","d","?"]),tar:new Set(["-","d","C"])}});function sL(e){return e.startsWith("/")&&!e.split("/").includes("..")}function JPe(){return oL!==0}async function ZPe(e){let t=[],n=e;for(;;){try{await kn.stat(n);break}catch(r){let o=r.code;if(o!=="ENOENT"&&o!=="ENOTDIR"&&o!=="ELOOP")throw r}t.push(n);let i=xe.dirname(n);if(i===n)break;n=i}for(let i of t.reverse())try{await kn.mkdir(i,{mode:aX})}catch(r){if(r.code!=="EEXIST")throw r}}async function iX(e,t){let n=xe.relative(e,t);if(n==="")return;let i=e;for(let r of n.split(xe.sep)){i=xe.join(i,r);try{await kn.mkdir(i,{mode:aX})}catch(o){if(o.code!=="EEXIST")throw o}}}async function YPe(e,t,n){let i=n?KPe:WPe,r=xe.join(xe.dirname(e),`.fs-${Oa.randomBytes(8).toString("hex")}.tmp`),o;try{o=await kn.open(r,Lp.O_WRONLY|Lp.O_CREAT|Lp.O_EXCL|oL,i),await o.writeFile(t),await o.close(),o=void 0,await kn.rename(r,e)}catch(s){throw o&&await o.close().catch(()=>{}),await kn.unlink(r).catch(()=>{}),s}}async function cX(e,t){let n;try{n=await kn.open(t,Lp.O_RDONLY|oL|HPe)}catch(i){let r=i.code;throw r==="ELOOP"||r==="EMLINK"?new Je(Je.IS_A_SYMLINK,e):i}try{if(!(await n.stat()).isFile())throw new Je(Je.NOT_A_FILE,e)}catch(i){throw await n.close().catch(()=>{}),i}return n}async function QPe(e){let t=Oa.createHash("sha256"),n=await cX(xe.basename(e),e),i=new Uint8Array(1024*1024);try{for(;;){let{bytesRead:r}=await n.read(i,0,i.length);if(r===0)break;t.update(i.subarray(0,r))}}finally{await n.close()}return t.digest("hex")}async function oX(e,t,n){if(!await eDe(t,n))return[];let i=[];return await lX(n,(r,o)=>{o.isFile()&&i.push([xe.relative(e,r).split(xe.sep).join("/"),r])}),i.sort(),i}async function XPe(e,t,n){let i=s=>xe.relative(e,s).split(xe.sep).join("/"),r;try{r=await kn.lstat(n,{bigint:!0})}catch(s){let a=s.code;if(a==="ENOENT"||a==="ENOTDIR")return new Set;throw s}if(r.isSymbolicLink())return new Set([i(n)]);if(!r.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,t);let o=new Set;return await lX(n,(s,a)=>{a.isSymbolicLink()&&o.add(i(s))}),o}async function eDe(e,t){let n;try{n=await kn.lstat(t,{bigint:!0})}catch(i){let r=i.code;if(r==="ENOENT"||r==="ENOTDIR")return!1;throw i}if(!n.isDirectory())throw new Je(Je.NOT_A_DIRECTORY,e);return!0}async function lX(e,t){let n=[e];for(;n.length;){let i=n.pop(),r;try{r=await kn.readdir(i,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")continue;throw o}for(let o of r){let s=xe.join(i,o.name);t(s,o),o.isDirectory()&&!o.isSymbolicLink()&&n.push(s)}}}function tDe(e,t){return t.mtimeNs===e.mtimeNs&&t.ctimeNs===e.ctimeNs&&t.size===e.size}function nDe(e,t){return(e.mtimeNs>e.ctimeNs?e.mtimeNs:e.ctimeNs){Or();Tl();kn=fs.promises,Lp=fs.constants,aX=448,WPe=384,KPe=448,oL=Lp.O_NOFOLLOW??0,HPe=Lp.O_NONBLOCK??0,Je=class extends Error{constructor(t,n){super(`path ${JSON.stringify(n)} ${t}`),this.name="FileStoreError",this.reason=t,this.relPath=n}};Je.ESCAPES_ROOT="escapes the store root";Je.IS_A_SYMLINK="is a symlink";Je.NOT_A_FILE="is not a regular file";Je.NOT_A_DIRECTORY="is not a directory";Je.NOT_UTF8="is not valid utf-8";Je.MOVE_DESTINATION_EXISTS="already exists";Fp=class e{constructor(t,n,i=!1){this.hashes=new Map,this.rootPath=t,this.removedOnDispose=n,this.decoder=i?new TextDecoder("utf-8",{fatal:!0}):void 0}static async open(t,n){if(!JPe())throw new Error("FileStore requires O_NOFOLLOW support on this platform");let i=!1;try{await kn.lstat(t)}catch(r){if(r.code!=="ENOENT")throw r;i=!0}return new e(xe.resolve(t),i,n?.utf8??!1)}async createRoot(){await ZPe(this.rootPath)}root(){return{path:this.rootPath,removedOnDispose:this.removedOnDispose}}async dispose(){this.removedOnDispose&&await kn.rm(this.rootPath,{recursive:!0,force:!0})}async put(t,n,i){let r=t.replace(/\\/g,"/");if(r.endsWith("/")||r.endsWith("/.")||r===""||r===".")throw new Je(Je.NOT_A_FILE,t);let o=this.resolveUnderRoot(t),s=typeof n=="string"?Ma(n):n;this.requireUtf8(t,s),await iX(this.rootPath,xe.dirname(o)),await YPe(o,s,i?.executable??!1)}async get(t){let n=this.resolveUnderRoot(t),i;try{i=await cX(t,n)}catch(o){if(o.code==="ENOENT")return null;throw o}let r;try{let o=await i.readFile();r=new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}finally{await i.close()}return this.requireUtf8(t,r),r}async ls(t="/"){let n=this.resolveUnderRoot(t);return new Set((await oX(this.rootPath,t,n)).map(([i])=>i))}async findSymlinks(t="/"){let n=this.resolveUnderRoot(t);return XPe(this.rootPath,t,n)}async hashtree(t="/"){let n=this.resolveUnderRoot(t),i=yS.nowNs(),r=Object.create(null);for(let[o,s]of await oX(this.rootPath,t,n)){let a=await this.hashViaCache(o,s,i);a!==null&&(r[o]=a)}return r}async hashFile(t){let n=this.resolveUnderRoot(t),i;try{i=await kn.lstat(n,{bigint:!0})}catch(o){if(o.code==="ENOENT")return null;throw o}if(i.isSymbolicLink())throw new Je(Je.IS_A_SYMLINK,t);if(!i.isFile())throw new Je(Je.NOT_A_FILE,t);let r=xe.relative(this.rootPath,n).split(xe.sep).join("/");return this.hashViaCache(r,n,yS.nowNs())}async move(t,n){let i=this.resolveUnderRoot(t),r=this.resolveUnderRoot(n);if(i===this.rootPath||r===this.rootPath)return;if(await kn.stat(r).then(()=>!0,()=>!1))throw new Je(Je.MOVE_DESTINATION_EXISTS,n);await iX(this.rootPath,xe.dirname(r)),await kn.rename(i,r)}async remove(t){let n=this.resolveUnderRoot(t);if(n===this.rootPath)return;let i;try{i=await kn.lstat(n,{bigint:!0})}catch(r){if(r.code==="ENOENT")return;throw r}if(i.isDirectory())await kn.rm(n,{recursive:!0,force:!0});else try{await kn.unlink(n)}catch(r){if(r.code!=="ENOENT")throw r}}resolveUnderRoot(t){let n=t.replace(/\\/g,"/").replace(/^\/+/,""),i=n.split("/").filter(r=>r!==""&&r!==".");if(xe.posix.isAbsolute(n)||i.includes(".."))throw new Je(Je.ESCAPES_ROOT,t);return i.length===0?this.rootPath:xe.join(this.rootPath,...i)}requireUtf8(t,n){if(this.decoder)try{this.decoder.decode(n)}catch{throw new Je(Je.NOT_UTF8,t)}}async hashViaCache(t,n,i){let r;try{r=await kn.lstat(n,{bigint:!0})}catch(a){if(a.code==="ENOENT")return null;throw a}if(!r.isFile())return null;let o=this.hashes.get(t),s;if(o!==void 0&&tDe(o,r))s=o.sha;else try{s=await yS.hashFile(n)}catch(a){let c=a.code;if(c==="ENOENT"||a instanceof Je||c==="ELOOP"||c==="EMLINK")return null;throw a}return nDe(r,i)&&this.hashes.set(t,{mtimeNs:r.mtimeNs,ctimeNs:r.ctimeNs,size:r.size,sha:s}),s}};Fp.isPathLegal=sL;rDe=2000000000n,yS={hashFile:QPe,timestampTrustMarginNs:rDe,nowNs:()=>BigInt(Date.now())*1000000n},uX=Fp,sX=Symbol.asyncDispose;sX&&Object.defineProperty(Fp.prototype,sX,{value:Fp.prototype.dispose,configurable:!0,writable:!0})});function bX(e){return Oa.createHash("sha256").update(`version ${$X} +${e}`,"utf-8").digest("hex")}function jp(e){return typeof e=="object"&&e!==null&&typeof e.code=="string"}async function dDe(e,t){if(!t){await e;return}let n,i=new Promise(r=>{n=r,t.aborted&&r()});t.addEventListener("abort",n,{once:!0});try{await Promise.race([e,i])}finally{t.removeEventListener("abort",n)}}var _t,Wa,_S,uy,$S,st,Up,wS,qa,vX,kS,wX,kX,aL,lL,pX,fX,cL,mX,gX,bS,vS,hX,yX,_X,Dl,$X,iDe,oDe,sDe,aDe,cDe,lDe,uDe,ys,uL,SS,SX=j(()=>{fr();Or();kt();Xi();Tl();Sp();dX();gS();gS();_X=3e4,Dl=".anthropic-memory-store",$X=1;iDe=3e4,oDe=100,sDe=20,aDe=16,cDe=32,lDe=8,uDe=50,ys=class extends J{constructor(t,n){super(t),this.name="SessionMemoryError",n!==void 0&&(this.cause=n)}},uL=class{constructor(t,n,i){this.mode=t,this.cap=n,this.waiveWindow=i,this.attempted=0,this.capped=0,this.suppressed=0}takeSlot(){return this.attempted>=this.cap?(this.capped++,!1):(this.attempted++,!0)}},SS=class{constructor(t,n){_t.add(this),Wa.set(this,void 0),_S.set(this,void 0),uy.set(this,void 0),$S.set(this,void 0),st.set(this,void 0),Up.set(this,void 0),wS.set(this,!1),qa.set(this,[]),M(this,Wa,t,"f"),M(this,_S,n.workdir,"f"),M(this,uy,n.syncIntervalMs??sy,"f"),mS(v(this,uy,"f"),"syncIntervalMs"),M(this,$S,n.syncDeletions??"enabled","f"),M(this,st,qe(t),"f"),M(this,Up,Date.now(),"f")}get roots(){return v(this,qa,"f").map(t=>t.files.root().path)}get readOnlyRoots(){return v(this,qa,"f").filter(t=>t.readOnly).map(t=>t.files.root().path)}async download(t){for(let n of t.resources){if(n.type!=="memory_store")continue;let i=v(this,_t,"m",vX).call(this,n),r;try{if(r={memoryStoreId:n.memory_store_id,files:await uX.open(i,{utf8:!0}),readOnly:n.access==="read_only",baseline:new Map,refusedShas:new Map,pendingDeletes:new Map},!r.files.root().removedOnDispose)throw new ys(`something already exists at the memory store's path: ${i} (memory_store_id=${n.memory_store_id}); it must not exist when the session starts`);try{await r.files.createRoot()}catch(o){throw jp(o)?new ys(`cannot create the memory store's folder: ${i} (memory_store_id=${n.memory_store_id}): ${o}; the worker host must make this mount path writable`,o):o}await v(this,_t,"m",lL).call(this,r),v(this,st,"f").info("downloaded memories",{count:r.baseline.size,memory_store_id:r.memoryStoreId,dest:r.files.root().path}),v(this,qa,"f").push(r)}catch(o){throw r&&await r.files.dispose().catch(()=>{}),o instanceof ys?o:new ys(`failed to download memory store memory_store_id=${n.memory_store_id}: ${o}`,o)}}M(this,Up,Date.now(),"f")}async finish(){if(v(this,wS,"f"))throw new J("finish() was already called: it is the session's last sync and runs once");M(this,wS,!0,"f"),await this.syncAll(!0)}async syncAll(t){await Promise.all(v(this,qa,"f").map(n=>v(this,_t,"m",wX).call(this,n,t))),M(this,Up,Date.now(),"f")}async syncIfDue(){Date.now()-v(this,Up,"f")v(this,_t,"m",kX).call(this,n,t)))}async dispose(){for(let t of v(this,qa,"f")){let n=t.files.root();try{let i=await v(this,_t,"m",kS).call(this,t);if(!i.markerOk&&Object.keys(i.files).length>0){v(this,st,"f").warn(`${i.distrustReason}; leaving the memory store folder on disk`,{root:n.path,memory_store_id:t.memoryStoreId});continue}await t.files.dispose()}catch(i){if(!(i instanceof Je)&&!jp(i))throw i;v(this,st,"f").warn("failed to remove the memory store folder",{root:t.files.root().path,memory_store_id:t.memoryStoreId,error:String(i)});continue}n.removedOnDispose&&v(this,st,"f").info("removed memory store dir",{dest:n.path,memory_store_id:t.memoryStoreId})}}};Wa=new WeakMap,_S=new WeakMap,uy=new WeakMap,$S=new WeakMap,st=new WeakMap,Up=new WeakMap,wS=new WeakMap,qa=new WeakMap,_t=new WeakSet,vX=function(t){if(t.mount_path){if(!sL(t.mount_path))throw new ys(`memory store mount_path is not a clean absolute path: ${JSON.stringify(t.mount_path)} (memory_store_id=${t.memory_store_id})`);return t.mount_path}return xe.join(v(this,_S,"f"),"memory",t.name||t.memory_store_id)},kS=async function(t){let n=await t.files.hashtree(),i=n[Dl];return delete n[Dl],i===bX(t.memoryStoreId)?{files:n,markerOk:!0,distrustReason:null}:{files:n,markerOk:!1,distrustReason:i!==void 0?"the marker file does not match this store":"the marker file is gone"}},wX=async function(t,n){try{let i=await v(this,_t,"m",kS).call(this,t),r=i.files;if(!i.markerOk){if(Object.keys(r).length>0){v(this,st,"f").warn(`${i.distrustReason}; leaving the memory store folder as found and not syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}await v(this,_t,"m",aL).call(this,t,"the folder or its marker is gone");return}if(Object.keys(r).length===0&&t.baseline.size>1){await v(this,_t,"m",aL).call(this,t,"every memory file is gone at once");return}let o=new Map;for await(let[u,d]of v(this,_t,"m",bS).call(this,t.memoryStoreId))o.set(u,d);let s=new uL(v(this,$S,"f"),Math.max(lDe,Math.min(uDe,Math.floor(t.baseline.size/4))),n),a=[],c=new Map,l=[...new Set([...o.keys(),...Object.keys(r),...t.baseline.keys()])].sort();for(let u of l){let d=o.get(u),p=r[u],f=t.baseline.get(u),m;p===void 0&&f!==void 0&&d!==void 0&&d.content_sha256===f&&!t.readOnly?m=await v(this,_t,"m",hX).call(this,t,u,d,f,s):m=await v(this,_t,"m",pX).call(this,t,u,d,p,a),m!==void 0&&c.set(u,m)}t.baseline=c,await v(this,_t,"m",mX).call(this,t,a),s.suppressed>0&&v(this,st,"f").debug("remote deletes are disabled; locally deleted memories stay on the server",{count:s.suppressed,memory_store_id:t.memoryStoreId}),s.capped>0&&v(this,st,"f").warn(`delete cap reached: ${s.mode==="log_only"?"would send":"sent"} ${s.attempted} deletes, held ${s.capped} for later syncs`,{memory_store_id:t.memoryStoreId})}catch(i){v(this,st,"f").warn("memory sync failed",{memory_store_id:t.memoryStoreId,error:String(i)})}},kX=async function(t,n){let i=new Map,r=new Set,o=async()=>{if(t.readOnly)return;let s=await v(this,_t,"m",kS).call(this,t);if(!s.markerOk){v(this,st,"f").warn(`${s.distrustReason}; not uploading anything from the memory store folder`,{root:t.files.root().path,memory_store_id:t.memoryStoreId});return}for(let[l,u]of Object.entries(s.files))u!==t.baseline.get(l)&&t.refusedShas.get(l)!==u&&(i.set(l,u),r.add(l));if(i.size===0||n?.aborted)return;let a=new Map;for await(let[l,u]of v(this,_t,"m",bS).call(this,t.memoryStoreId)){if(n?.aborted)return;a.set(l,u)}let c=[];for(let l of[...i.keys()].sort()){let u=i.get(l),d=t.baseline.get(l),p=a.get(l);if(p!==void 0&&p.content_sha256===u){t.baseline.set(l,p.content_sha256),r.delete(l);continue}if(p!==void 0&&p.content_sha256!==d){v(this,st,"f").warn("memory changed both locally and remotely; the flush leaves the remote version",{path:l,memory_store_id:t.memoryStoreId}),r.delete(l);continue}c.push([l,u,p])}await v(this,_t,"m",gX).call(this,t,c,r,n)};try{await dDe(o(),n),n?.aborted&&r.size>0&&v(this,st,"f").warn(`memory flush cut off part-way; ${r.size} of ${i.size} changed files had not finished uploading`,{memory_store_id:t.memoryStoreId})}catch(s){v(this,st,"f").warn("memory flush failed",{memory_store_id:t.memoryStoreId,error:String(s)})}},aL=async function(t,n){v(this,st,"f").warn(`${n}; re-downloading the memory store folder instead of syncing`,{root:t.files.root().path,memory_store_id:t.memoryStoreId}),await t.files.createRoot(),await v(this,_t,"m",lL).call(this,t)},lL=async function(t){t.baseline=new Map,t.pendingDeletes.clear(),await t.files.put(Dl,`version ${$X} +${t.memoryStoreId}`);for await(let[n,i]of v(this,_t,"m",bS).call(this,t.memoryStoreId,"full"))await v(this,_t,"m",cL).call(this,t,n,i.content??"")&&t.baseline.set(n,i.content_sha256)},pX=async function(t,n,i,r,o){let s=t.baseline.get(n);if(r!==void 0&&t.pendingDeletes.delete(n),!i){if(r===void 0){t.pendingDeletes.delete(n);return}if(s!==void 0){if(r===s){let d=await v(this,_t,"m",fX).call(this,t,n,s);if(d===void 0)return;if(d===s)return s;r=d}t.readOnly?v(this,st,"f").warn("memory deleted remotely but edited locally; keeping the file, which a read-only store cannot push",{path:n,memory_store_id:t.memoryStoreId}):t.refusedShas.get(n)!==r&&v(this,st,"f").info("memory deleted remotely but edited locally; re-creating it from the file",{path:n,memory_store_id:t.memoryStoreId})}return t.readOnly||t.refusedShas.get(n)===r?void 0:await v(this,_t,"m",vS).call(this,t,n,r,void 0)}let a=i.content_sha256,c=a!==s,l=r!==void 0&&r!==s&&r!==a,u=!t.readOnly&&l;return r===void 0&&s!==void 0?(c&&(v(this,st,"f").warn("memory deleted locally but changed remotely; restoring the remote version",{path:n,memory_store_id:t.memoryStoreId}),t.pendingDeletes.delete(n),o.push([n,i])),s):c?r===a?a:(l&&v(this,st,"f").warn("memory changed both locally and remotely; keeping the remote version",{path:n,memory_store_id:t.memoryStoreId}),o.push([n,i]),s):u?t.refusedShas.get(n)===r?a:await v(this,_t,"m",vS).call(this,t,n,r,i)??a:a},fX=async function(t,n,i){let r;try{r=await t.files.hashFile(n)}catch(o){if(!(o instanceof Je)&&!jp(o))throw o;return i}if(r!==null){if(r!==i)return r;try{await t.files.remove(n)}catch(o){if(!(o instanceof Je)&&!jp(o))throw o;return v(this,st,"f").warn("failed to remove memory deleted remotely",{path:n,memory_store_id:t.memoryStoreId,error:String(o)}),i}}},cL=async function(t,n,i){try{await t.files.put(n,i)}catch(r){if(!(r instanceof Je)&&!jp(r))throw r;return v(this,st,"f").warn("failed to write memory",{path:n,memory_store_id:t.memoryStoreId,error:String(r)}),!1}return!0},mX=async function(t,n){if(n.length===0)return;let i=async(s,a)=>{let c;try{c=await v(this,Wa,"f").beta.memoryStores.memories.retrieve(a.id,{memory_store_id:t.memoryStoreId,view:"full"})}catch(l){if(Tn(l,404))return;v(this,st,"f").warn("failed to fetch memory content",{path:s,memory_store_id:t.memoryStoreId,error:String(l)});return}await v(this,_t,"m",cL).call(this,t,s,c.content??"")&&t.baseline.set(s,c.content_sha256)},r=n[Symbol.iterator](),o=async()=>{for(let[s,a]of r)await i(s,a)};await Promise.all(Array.from({length:Math.min(aDe,n.length)},o))},gX=async function(t,n,i,r){let o=n[Symbol.iterator](),s=async()=>{for(let[a,c,l]of o){if(r?.aborted)return;let u=await v(this,_t,"m",vS).call(this,t,a,c,l);i.delete(a),u!==void 0&&t.baseline.set(a,u)}};await Promise.all(Array.from({length:Math.min(cDe,n.length)},s))},bS=async function*(t,n="basic"){let i=n==="basic"?oDe:sDe;for await(let r of v(this,Wa,"f").beta.memoryStores.memories.list(t,{view:n,limit:i})){if(r.type!=="memory")continue;let o=r.path.replace(/^\/+/,"");if(o===Dl){v(this,st,"f").warn("the server listed the reserved marker path; skipping",{path:r.path,memory_store_id:t});continue}yield[o,r]}},vS=async function e(t,n,i,r){try{let o=await t.files.get(n);if(o===null)return;let s=El(o),a=r?await v(this,Wa,"f").beta.memoryStores.memories.update(r.id,{memory_store_id:t.memoryStoreId,content:s,precondition:{type:"content_sha256",content_sha256:r.content_sha256}}):await v(this,Wa,"f").beta.memoryStores.memories.create(t.memoryStoreId,{path:"/"+n,content:s});return t.refusedShas.delete(n),a.content_sha256}catch(o){if(r&&Tn(o,404))return await v(this,_t,"m",e).call(this,t,n,i,void 0);let s=o instanceof Je||Tn(o,400)||Tn(o,413);r&&Tn(o,409)?v(this,st,"f").warn("memory changed both locally and remotely; the upload was refused and the local edit loses",{path:n,memory_store_id:t.memoryStoreId}):s&&i!==void 0?(t.refusedShas.set(n,i),v(this,st,"f").warn("the server rejected this memory file, so it stays un-synced until its content changes",{path:n,memory_store_id:t.memoryStoreId,rejection:String(o)})):v(this,st,"f").warn("failed to upload memory",{path:n,memory_store_id:t.memoryStoreId,error:String(o)});return}},hX=async function(t,n,i,r,o){if(o.mode==="disabled")return o.suppressed++,r;let s=t.pendingDeletes.get(n);if(s===void 0&&(s=Date.now(),t.pendingDeletes.set(n,s)),!o.waiveWindow&&Date.now()-sRS,BashTimeoutError:()=>AS,DEFAULT_MEMORY_SYNC_INTERVAL_MS:()=>sy,MARKER_PATH:()=>Dl,MEMORY_FLUSH_TIMEOUT_MS:()=>_X,MIN_MEMORY_SYNC_INTERVAL_MS:()=>oy,SessionMemoryError:()=>ys,SessionMemoryStores:()=>SS,betaAgentToolset20260401:()=>bDe,betaBashTool:()=>OX,betaEditTool:()=>FX,betaGlobTool:()=>UX,betaGrepTool:()=>jX,betaReadTool:()=>MX,betaWriteTool:()=>LX,extractSkillArchive:()=>iL,resolvePath:()=>Gp,setupSkills:()=>tX});function PX(e){return e===void 0?pDe:e}function Ul(e){if(e!==void 0)throw new J("The `unrestrictedPaths` option you passed to the agent toolset (AgentToolContext) is no longer supported. The toolset's file tools (read, write, edit, glob, grep) are now always confined to the working directory plus the directories listed in `allowedRoots`. Remove `unrestrictedPaths` from your context; to let the file tools reach any other directory, add it to `allowedRoots`.")}function bDe(e){return[OX(e),MX(e),LX(e),FX(e),UX(e),jX(e)]}async function Gp(e,t){return Ul(e.unrestrictedPaths),XQ(e.workdir,t,{allowedRoots:e.allowedRoots??[]})}function DX(e,t){return XM(e.readOnlyRoots??[],t)}function vDe(){let e={};for(let[t,n]of Object.entries(process.env))t.startsWith("ANTHROPIC_")||(e[t]=n);return e}function OX(e){Ul(e.unrestrictedPaths);let t,n=Promise.resolve();return Nl({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:i,restart:r,timeout_ms:o},s)=>{let a=n,c=Op();n=c.promise;try{await a}catch{}try{if(r&&(t?.close(),t=void 0),!i){if(r)return"bash session restarted";throw new Ae("bash: command is required")}t??(t=new RS(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(i,{timeoutMs:o??NX,signal:s?.signal});if(u!==0)throw new Ae(l||`exit ${u}`);return l}catch(l){throw l instanceof Ae?l:(t.close(),t=void 0,new Ae(`bash: ${l instanceof Error?l.message:String(l)}`))}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function MX(e){return Ul(e.unrestrictedPaths),Nl({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new Ae("read: file_path is required");let i=await Gp(e,t);if(n?.length&&n.length!==2)throw new Ae("read: view_range must be [start_line, end_line]");let r;try{let u=await In.stat(i);if(!u.isFile())throw new Ae(`read: ${t} is not a regular file`);let d=PX(e.maxFileBytes);if(d!==null&&u.size>d){if(!n?.length)throw new Ae(`read: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. Use the view_range parameter to read specific line ranges, e.g. view_range: [1, 500].`);let[p,f]=n;return await wDe(i,t,p,f,d)}r=await In.readFile(i,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`read: ${Mp(u,t)}`)}if(!n?.length)return r;let[o,s]=n,a=r.split(` `),c=Math.max(0,o-1),l=s>0?s:a.length;return a.slice(c,l).join(` -`)}})}async function fDe(e,t,n,i,r){let o=new iL(t,n,i,r);if(o.rangeIsEmpty())return"";let s=cy.createReadStream(e,{highWaterMark:sDe});try{for await(let a of s)if(o.collectFrom(a),o.rangeIsCollected())break}finally{s.destroy()}return o.text()}function NX(e){return Ll(e.unrestrictedPaths),Rl({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new Ae("write: file_path is required");let i=await zp(e,t),r=await IX(e,i);if(r!==void 0)throw new Ae(`write: ${t} is inside read-only directory ${r}`);try{await Rn.mkdir(br.dirname(i),{recursive:!0,mode:ty}),await WM(i,n??"")}catch(o){throw new Ae(`write: ${Op(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function CX(e){return Ll(e.unrestrictedPaths),Rl({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:i,replace_all:r})=>{if(!t)throw new Ae("edit: file_path is required");if(!n)throw new Ae("edit: old_string is required");let o=await zp(e,t),s=await IX(e,o);if(s!==void 0)throw new Ae(`edit: ${t} is inside read-only directory ${s}`);let a;try{let u=await Rn.stat(o);if(!u.isFile())throw new Ae(`edit: ${t} is not a regular file`);let d=TX(e.maxFileBytes);if(d!==null&&u.size>d)throw new Ae(`edit: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await Rn.readFile(o,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`edit: ${Op(u,t)}`)}let c=a.split(n).length-1;if(c===0)throw new Ae(`edit: old_string not found in ${t}`);let l;if(r)l=a.split(n).join(i);else{if(c>1)throw new Ae(`edit: old_string appears ${c} times in ${t} (must be unique)`);l=a.replace(n,()=>i)}try{await WM(o,l)}catch(u){throw new Ae(`edit: write: ${Op(u,t)}`)}return`edited ${t} (${r?c:1} replacement(s))`}})}function mDe(e){return e.split(/[\\/{},]/).includes("..")}function PX(e){return Ll(e.unrestrictedPaths),Rl({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new Ae("glob: pattern is required");if(br.isAbsolute(t))throw new Ae("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(mDe(t))throw new Ae('glob: ".." is not permitted in the pattern');let i=n?await zp(e,n):br.resolve(e.workdir),r=n?i:await ey(i),o=[],s=OX;try{for await(let a of uDe(t,{cwd:i,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(s--<=0)break;if(!a.isFile())continue;let c=br.join(a.parentPath,a.name),l;try{l=await Rn.realpath(c)}catch{continue}if(!lS(r,l))continue;let u=0;try{u=(await Rn.stat(c)).mtimeMs}catch{}o.push({path:c,mtime:u})}}catch(a){throw new Ae(`glob: ${a instanceof Error?a.message:String(a)}`)}return o.length===0?"no matches":(o.sort((a,c)=>c.mtime-a.mtime),o.slice(0,cDe).map(a=>a.path).join(` -`))}})}function DX(e){return Ll(e.unrestrictedPaths),Rl({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},i)=>{if(!t)throw new Ae("grep: pattern is required");let r=br.resolve(e.workdir);n&&(r=await zp(e,n));let o=await vDe();return o?gDe(o,t,r,i?.signal):hDe(t,r,i?.signal)}})}function gDe(e,t,n,i){return new Promise((r,o)=>{let s=oL.spawn(e,["-n","--no-heading","-e",t,"--",n],{...i?{signal:i}:{}}),a="",c="",l=!1;s.stdout.on("data",u=>{l||(a+=u,a.length>ay&&(l=!0,a=a.slice(0,ay),s.kill("SIGKILL")))}),s.stderr.on("data",u=>c+=u),s.on("close",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));if(l)return r(a+` -[output truncated at ${ay} bytes]`);if(u===0)return r(a);if(u===1)return r("no matches");o(new Ae(`grep: rg failed: ${c||`exit ${u}`}`))}),s.on("error",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));o(new Ae(`grep: rg failed: ${u.message}`))})})}async function hDe(e,t,n){let i;try{i=new RegExp(e)}catch(c){throw new Ae(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let r=[],o=ay,s=c=>(o-=c.length+1,o<0?(r.push(`[output truncated at ${ay} bytes]`),!1):(r.push(c),!0));if((await Rn.stat(t).catch(()=>null))?.isFile()?await $X(t,i,s):await bDe(t,"",c=>$X(br.join(t,c),i,s),n),n?.aborted)throw new Ae("grep: aborted");return r.length===0?"no matches":r.join(` -`)}async function $X(e,t,n){let i=cy.createReadStream(e,{encoding:"utf8"}),r=xX.createInterface({input:i,crlfDelay:1/0}),o=0;try{for await(let s of r)if(o++,!(s.length>aDe)&&t.test(s)&&!n(`${e}:${o}:${s}`))return!1}catch{}finally{i.destroy()}return!0}async function bDe(e,t,n,i){let r=OX;async function o(s,a){if(a>yDe)return!0;if(i?.aborted)return!1;let c;try{c=await Rn.readdir(br.join(e,s),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(r--<=0||i?.aborted)return!1;let u=s?br.join(s,l.name):l.name;if(l.isDirectory()){if(!await o(u,a+1))return!1}else if(l.isFile()&&await n(u)===!1)return!1}return!0}await o(t,0)}async function vDe(){let e=(process.env.PATH??"").split(br.delimiter);for(let t of e){let n=br.join(t,"rg");try{return await Rn.access(n,cy.constants.X_OK),n}catch{}}return null}var Rn,cy,br,oL,SX,xX,bS,yr,Ur,iy,Pl,Ai,rL,vS,oy,wS,kS,Ol,Ml,jp,Dl,sy,Ha,_X,vX,wX,EX,oDe,sDe,kX,ay,aDe,cDe,$S,lDe,uDe,_S,iL,yDe,OX,LX=j(()=>{gr();Rn=gt(require("node:fs/promises"),1),cy=gt(require("node:fs"),1),br=gt(require("node:path"),1),oL=gt(require("node:child_process"),1),SX=gt(require("node:crypto"),1),xX=gt(require("node:readline"),1);kt();Il();WQ();BM();HM();YQ();bX();wX=100*1024,EX=12e4,oDe=256*1024,sDe=64*1024,kX=Buffer.from(` -`),ay=100*1024,aDe=2e3,cDe=200,$S=class extends J{constructor(t){super(`bash command timed out after ${t}ms`),this.name="BashTimeoutError",this.timeoutMs=t}},lDe=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,uDe=Rn.glob;_S=class{constructor(t,n=pDe()){bS.add(this),yr.set(this,void 0),Ur.set(this,""),iy.set(this,!1),Pl.set(this,!1),Ai.set(this,null),M(this,yr,oL.spawn("/bin/bash",["--noprofile","--norc"],{cwd:t,env:{...n,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),v(this,yr,"f").stdout.setEncoding("utf8"),v(this,yr,"f").stderr.setEncoding("utf8"),v(this,yr,"f").stdout.on("data",i=>v(this,bS,"m",rL).call(this,i)),v(this,yr,"f").stderr.on("data",i=>v(this,bS,"m",rL).call(this,i)),v(this,yr,"f").once("close",()=>{M(this,Pl,!0,"f");let i=v(this,Ai,"f");M(this,Ai,null,"f"),i?.resolve()})}get closed(){return v(this,Pl,"f")}async exec(t,n={}){if(v(this,Pl,"f"))throw new J("bash session terminated");let i=n.timeoutMs??EX,r=n.signal;r?.throwIfAborted(),M(this,Ur,"","f"),M(this,iy,!1,"f");let o=`__ANT_CMD_${SX.randomUUID()}_DONE__`,s=`${o.slice(0,8)}''${o.slice(8)}`,a=`{ ${t} +`)}})}async function wDe(e,t,n,i,r){let o=new pL(t,n,i,r);if(o.rangeIsEmpty())return"";let s=gy.createReadStream(e,{highWaterMark:fDe});try{for await(let a of s)if(o.collectFrom(a),o.rangeIsCollected())break}finally{s.destroy()}return o.text()}function LX(e){return Ul(e.unrestrictedPaths),Nl({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new Ae("write: file_path is required");let i=await Gp(e,t),r=await DX(e,i);if(r!==void 0)throw new Ae(`write: ${t} is inside read-only directory ${r}`);try{await In.mkdir(hr.dirname(i),{recursive:!0,mode:cy}),await eL(i,n??"")}catch(o){throw new Ae(`write: ${Mp(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function FX(e){return Ul(e.unrestrictedPaths),Nl({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:i,replace_all:r})=>{if(!t)throw new Ae("edit: file_path is required");if(!n)throw new Ae("edit: old_string is required");let o=await Gp(e,t),s=await DX(e,o);if(s!==void 0)throw new Ae(`edit: ${t} is inside read-only directory ${s}`);let a;try{let u=await In.stat(o);if(!u.isFile())throw new Ae(`edit: ${t} is not a regular file`);let d=PX(e.maxFileBytes);if(d!==null&&u.size>d)throw new Ae(`edit: ${t} is ${u.size} bytes, exceeds ${d}-byte limit. The edit tool loads the whole file and cannot modify a file this large.`);a=await In.readFile(o,"utf8")}catch(u){throw u instanceof Ae?u:new Ae(`edit: ${Mp(u,t)}`)}let c=a.split(n).length-1;if(c===0)throw new Ae(`edit: old_string not found in ${t}`);let l;if(r)l=a.split(n).join(i);else{if(c>1)throw new Ae(`edit: old_string appears ${c} times in ${t} (must be unique)`);l=a.replace(n,()=>i)}try{await eL(o,l)}catch(u){throw new Ae(`edit: write: ${Mp(u,t)}`)}return`edited ${t} (${r?c:1} replacement(s))`}})}function kDe(e){return e.split(/[\\/{},]/).includes("..")}function UX(e){return Ul(e.unrestrictedPaths),Nl({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new Ae("glob: pattern is required");if(hr.isAbsolute(t))throw new Ae("glob: absolute pattern not permitted; pass a relative pattern (and optionally path)");if(kDe(t))throw new Ae('glob: ".." is not permitted in the pattern');let i=n?await Gp(e,n):hr.resolve(e.workdir),r=n?i:await ay(i),o=[],s=zX;try{for await(let a of yDe(t,{cwd:i,withFileTypes:!0,exclude:c=>c.name===".git"||c.name==="node_modules"})){if(s--<=0)break;if(!a.isFile())continue;let c=hr.join(a.parentPath,a.name),l;try{l=await In.realpath(c)}catch{continue}if(!hS(r,l))continue;let u=0;try{u=(await In.stat(c)).mtimeMs}catch{}o.push({path:c,mtime:u})}}catch(a){throw new Ae(`glob: ${a instanceof Error?a.message:String(a)}`)}return o.length===0?"no matches":(o.sort((a,c)=>c.mtime-a.mtime),o.slice(0,gDe).map(a=>a.path).join(` +`))}})}function jX(e){return Ul(e.unrestrictedPaths),Nl({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},i)=>{if(!t)throw new Ae("grep: pattern is required");let r=hr.resolve(e.workdir);n&&(r=await Gp(e,n));let o=await EDe();return o?_De(o,t,r,i?.signal):$De(t,r,i?.signal)}})}function _De(e,t,n,i){return new Promise((r,o)=>{let s=fL.spawn(e,["-n","--no-heading","-e",t,"--",n],{...i?{signal:i}:{}}),a="",c="",l=!1;s.stdout.on("data",u=>{l||(a+=u,a.length>my&&(l=!0,a=a.slice(0,my),s.kill("SIGKILL")))}),s.stderr.on("data",u=>c+=u),s.on("close",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));if(l)return r(a+` +[output truncated at ${my} bytes]`);if(u===0)return r(a);if(u===1)return r("no matches");o(new Ae(`grep: rg failed: ${c||`exit ${u}`}`))}),s.on("error",u=>{if(i?.aborted)return o(new Ae("grep: aborted"));o(new Ae(`grep: rg failed: ${u.message}`))})})}async function $De(e,t,n){let i;try{i=new RegExp(e)}catch(c){throw new Ae(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let r=[],o=my,s=c=>(o-=c.length+1,o<0?(r.push(`[output truncated at ${my} bytes]`),!1):(r.push(c),!0));if((await In.stat(t).catch(()=>null))?.isFile()?await IX(t,i,s):await xDe(t,"",c=>IX(hr.join(t,c),i,s),n),n?.aborted)throw new Ae("grep: aborted");return r.length===0?"no matches":r.join(` +`)}async function IX(e,t,n){let i=gy.createReadStream(e,{encoding:"utf8"}),r=CX.createInterface({input:i,crlfDelay:1/0}),o=0;try{for await(let s of r)if(o++,!(s.length>mDe)&&t.test(s)&&!n(`${e}:${o}:${s}`))return!1}catch{}finally{i.destroy()}return!0}async function xDe(e,t,n,i){let r=zX;async function o(s,a){if(a>SDe)return!0;if(i?.aborted)return!1;let c;try{c=await In.readdir(hr.join(e,s),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(r--<=0||i?.aborted)return!1;let u=s?hr.join(s,l.name):l.name;if(l.isDirectory()){if(!await o(u,a+1))return!1}else if(l.isFile()&&await n(u)===!1)return!1}return!0}await o(t,0)}async function EDe(){let e=(process.env.PATH??"").split(hr.delimiter);for(let t of e){let n=hr.join(t,"rg");try{return await In.access(n,gy.constants.X_OK),n}catch{}}return null}var In,gy,hr,fL,RX,CX,xS,gr,Fr,dy,Ol,Ai,dL,ES,py,TS,IS,Ll,Fl,zp,Ml,fy,Ka,AX,xX,EX,NX,pDe,fDe,TX,my,mDe,gDe,AS,hDe,yDe,RS,pL,SDe,zX,VX=j(()=>{fr();In=gt(require("node:fs/promises"),1),gy=gt(require("node:fs"),1),hr=gt(require("node:path"),1),fL=gt(require("node:child_process"),1),RX=gt(require("node:crypto"),1),CX=gt(require("node:readline"),1);kt();Rl();QQ();QM();tL();rX();SX();EX=100*1024,NX=12e4,pDe=256*1024,fDe=64*1024,TX=Buffer.from(` +`),my=100*1024,mDe=2e3,gDe=200,AS=class extends J{constructor(t){super(`bash command timed out after ${t}ms`),this.name="BashTimeoutError",this.timeoutMs=t}},hDe=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,yDe=In.glob;RS=class{constructor(t,n=vDe()){xS.add(this),gr.set(this,void 0),Fr.set(this,""),dy.set(this,!1),Ol.set(this,!1),Ai.set(this,null),M(this,gr,fL.spawn("/bin/bash",["--noprofile","--norc"],{cwd:t,env:{...n,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),v(this,gr,"f").stdout.setEncoding("utf8"),v(this,gr,"f").stderr.setEncoding("utf8"),v(this,gr,"f").stdout.on("data",i=>v(this,xS,"m",dL).call(this,i)),v(this,gr,"f").stderr.on("data",i=>v(this,xS,"m",dL).call(this,i)),v(this,gr,"f").once("close",()=>{M(this,Ol,!0,"f");let i=v(this,Ai,"f");M(this,Ai,null,"f"),i?.resolve()})}get closed(){return v(this,Ol,"f")}async exec(t,n={}){if(v(this,Ol,"f"))throw new J("bash session terminated");let i=n.timeoutMs??NX,r=n.signal;r?.throwIfAborted(),M(this,Fr,"","f"),M(this,dy,!1,"f");let o=`__ANT_CMD_${RX.randomUUID()}_DONE__`,s=`${o.slice(0,8)}''${o.slice(8)}`,a=`{ ${t} } &1; printf '\\n${s}%d\\n' $? -`;if(v(this,yr,"f").stdin.write(a),v(this,Ur,"f").indexOf(o)<0){let{promise:f,resolve:m}=Dp();M(this,Ai,{sentinel:o,resolve:m},"f");let g,h;try{await Promise.race([f,new Promise((b,y)=>{g=setTimeout(()=>y(new $S(i)),i)}),new Promise((b,y)=>{r&&(h=()=>y(r.reason),r.addEventListener("abort",h,{once:!0}))})])}finally{g&&clearTimeout(g),h&&r&&r.removeEventListener("abort",h),M(this,Ai,null,"f")}}let c=v(this,Ur,"f").indexOf(o);if(c<0)throw new J("bash session terminated");let u=v(this,Ur,"f").slice(c+o.length).match(/^(-?\d+)/),d=u?parseInt(u[1],10):-1,p=v(this,Ur,"f").slice(0,c).replace(lDe,"").replace(/\n+$/,"");return v(this,iy,"f")&&(p=`[output truncated] -${p}`),{output:p,exitCode:d}}close(){if(v(this,Pl,"f"))return;M(this,Pl,!0,"f");let t=v(this,Ai,"f");M(this,Ai,null,"f"),t?.resolve(),v(this,yr,"f").stdout.destroy(),v(this,yr,"f").stderr.destroy(),v(this,yr,"f").stdin.destroy();try{process.kill(-v(this,yr,"f").pid,"SIGKILL")}catch{v(this,yr,"f").kill("SIGKILL")}v(this,yr,"f").unref()}};yr=new WeakMap,Ur=new WeakMap,iy=new WeakMap,Pl=new WeakMap,Ai=new WeakMap,bS=new WeakSet,rL=function(t){if(M(this,Ur,v(this,Ur,"f")+t,"f"),v(this,Ur,"f").length>wX&&(M(this,Ur,v(this,Ur,"f").slice(v(this,Ur,"f").length-wX),"f"),M(this,iy,!0,"f")),v(this,Ai,"f")&&v(this,Ur,"f").indexOf(v(this,Ai,"f").sentinel)>=0){let n=v(this,Ai,"f");M(this,Ai,null,"f"),n.resolve()}};iL=class{constructor(t,n,i,r){vS.add(this),oy.set(this,void 0),wS.set(this,void 0),kS.set(this,void 0),Ol.set(this,void 0),Ml.set(this,void 0),jp.set(this,void 0),Dl.set(this,0),sy.set(this,[]),Ha.set(this,0),M(this,oy,t,"f"),M(this,wS,n,"f"),M(this,kS,i,"f"),M(this,Ol,Math.max(0,n-1),"f"),M(this,Ml,i>0?i:1/0,"f"),M(this,jp,r,"f")}rangeIsEmpty(){return v(this,Ml,"f")<=v(this,Ol,"f")}rangeIsCollected(){return v(this,Dl,"f")>=v(this,Ml,"f")}collectFrom(t){var n;let i=0;for(;i=v(this,Ol,"f")&&v(this,vS,"m",_X).call(this,t.subarray(i,o),r>=0),r<0)break;M(this,Dl,(n=v(this,Dl,"f"),n++,n),"f"),i=r+1}}text(){return Buffer.concat(v(this,sy,"f"),v(this,Ha,"f")).toString("utf8")}};oy=new WeakMap,wS=new WeakMap,kS=new WeakMap,Ol=new WeakMap,Ml=new WeakMap,jp=new WeakMap,Dl=new WeakMap,sy=new WeakMap,Ha=new WeakMap,vS=new WeakSet,_X=function(t,n){if(v(this,sy,"f").push(t),M(this,Ha,v(this,Ha,"f")+t.length,"f"),n&&v(this,Dl,"f")+1v(this,jp,"f"))throw v(this,vS,"m",vX).call(this)},vX=function(){return v(this,Ml,"f")-v(this,Ol,"f")===1?new Ae(`read: line ${v(this,Ol,"f")+1} of ${v(this,oy,"f")} alone exceeds ${v(this,jp,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new Ae(`read: view_range [${v(this,wS,"f")}, ${v(this,kS,"f")}] of ${v(this,oy,"f")} exceeds ${v(this,jp,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)};yDe=40,OX=5e4});function $De(e){return e.resources.some(t=>t.type==="memory_store")}function _De(e){if(!e)return null;let t;try{let i=e.replace(/-/g,"+").replace(/_/g,"/"),r=i.padEnd(Math.ceil(i.length/4)*4,"=");t=JSON.parse(Sl(W5(r)))}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let n=t.sessions_token;return typeof n=="string"&&n!==""?n:null}async function UX(e,t){let n;try{return await Promise.race([e.then(()=>!1,()=>!1),new Promise(i=>{n=setTimeout(()=>i(!0),t)})])}finally{n!==void 0&&clearTimeout(n)}}async function SDe(e,t,n,i){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...i,headers:I([i?.headers])})}catch(r){An(r,409)||n.error("force-stop on exit failed",{work_id:t.id,error:String(r)})}}function xDe(e){let t=e instanceof Dt?e.error:void 0;for(let n of["error","details","current_state"]){if(!BO(t))return{};t=t[n]}return BO(t)?t:{}}async function EDe(e,t,n,i,r,o){let s=FX,a=wDe,c=Date.now(),l=kDe,u=async()=>{let d=new AbortController,p=Ua(n.signal,d),f=setTimeout(()=>d.abort(),s);try{let m=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:l},{...r,headers:I([r?.headers]),signal:d.signal});c=Date.now(),l=m.last_heartbeat,m.ttl_seconds>0&&(a=m.ttl_seconds*1e3,s=Math.max(1e3,Math.min(a/2,FX)),o?.(a)),(m.state==="stopping"||m.state==="stopped")&&(i.info("heartbeat signals shutdown",{work_id:t.id,state:m.state}),n.finish("control_plane_stop")),m.lease_extended||(i.warn("lease not extended, shutting down",{work_id:t.id}),n.finish("control_plane_stop"))}catch(m){if(n.signal.throwIfAborted(),An(m,412)){let g=xDe(m);i.error("lease lost: heartbeat precondition failed",{work_id:t.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(ja(m))throw i.error("permanent heartbeat failure",{work_id:t.id,error:String(m)}),n.finish("heartbeat_rejected"),m;if(Date.now()-c>a){i.error("lease assumed lost: no successful heartbeat in ttl",{work_id:t.id,ttl_ms:a,error:String(m)}),n.finish("assumed_lost");return}i.warn("transient heartbeat failure",{work_id:t.id,error:String(m)})}finally{clearTimeout(f),p()}};for(await u();!n.signal.aborted;)await Yi(s,n.signal),n.signal.throwIfAborted(),await u()}var SS,ly,sL,uy,Gp,FX,wDe,kDe,Vp,aL,cL=j(()=>{gr();kt();Xi();iM();xl();pp();cp();_p();z_();hr();Ne();sS();Z_();LM();cS();FX=3e4,wDe=9e4,kDe="NO_HEARTBEAT";Vp=class{constructor(t){if(SS.add(this),ly.set(this,void 0),t.unrestrictedPaths!==void 0)throw new J("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.tools=t.tools,this.workdir=t.workdir??process.cwd(),this.maxFileBytes=t.maxFileBytes,this.maxIdleMs=t.maxIdleMs,t.memorySyncIntervalMs!=null&&aS(t.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=t.memorySyncIntervalMs,this.memorySyncDeletions=t.memorySyncDeletions??"enabled",this.workerId=t.workerId,this.requestOptions=t.requestOptions,M(this,ly,t.signal,"f")}async run(t){let{environmentId:n,environmentKey:i}=this;if(n===void 0||i===void 0)throw new J("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let r=t??v(this,ly,"f"),o=new za({client:this.client,environmentId:n,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...r?{signal:r}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let s of o)try{await v(this,SS,"m",sL).call(this,s,i,o.signal)}catch(a){if(o.signal?.aborted)throw a;qe(this.client).error("work item failed",{work_id:s.id,error:String(a)})}}async handleItem(t){let n=t?.workId??ze("ANTHROPIC_WORK_ID"),i=t?.environmentId??ze("ANTHROPIC_ENVIRONMENT_ID"),r=t?.sessionId??ze("ANTHROPIC_SESSION_ID"),o=(t?.environmentKey??this.environmentKey??ze("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,s=t?.workSecret||ze("ANTHROPIC_WORK_SECRET")||null;if(!n)throw new J("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new J("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!r)throw new J("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!o&&!s)throw new J("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let a={id:n,environment_id:i,secret:s,data:{type:"session",id:r}};await v(this,SS,"m",sL).call(this,a,o,t?.signal??v(this,ly,"f"))}};ly=new WeakMap,SS=new WeakSet,sL=async function(t,n,i){let r=qe(this.client),o=_De(t.secret),s=o??n;if(s===void 0)throw new J("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");t.secret&&o===null&&r.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:t.id});let a=B_(this.client,{authToken:s,helper:"environments-worker"}),c=t.data.id,l=new AbortController,u=Ua(i,l),d=new aL(l),p=await Promise.resolve().then(()=>(LX(),MX)),f,m,g=EDe(a,t,d,r,this.requestOptions,w=>{f=w,m?._setSendRetryWindow(w)}).catch(w=>{l.signal.aborted||r.error("heartbeat loop failed",{work_id:t.id,error:String(w)}),l.abort()}),h=async()=>{},b,y=!1;try{if(t.data.type!=="session"){r.debug("skipping non-session work item",{work_id:t.id,type:t.data.type});return}let w=await a.beta.sessions.retrieve(c);if(o===null&&this.memorySyncIntervalMs!==null&&$De(w))throw new p.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${t.id}, session_id=${c}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let k={workdir:this.workdir,client:a,session:w,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{h=await p.setupSkills(k)}catch(S){r.warn("skill setup failed",{session_id:c,work_id:t.id,error:String(S)})}o!==null&&this.memorySyncIntervalMs!==null?(b=new p.SessionMemoryStores(a,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await b.download(w),k.allowedRoots=b.roots,k.readOnlyRoots=b.readOnlyRoots):r.debug("memory stores disabled for this item",{work_id:t.id});let _=typeof this.tools=="function"?this.tools(k):this.tools??p.betaAgentToolset20260401(k);m=new Ba(c,{client:a,tools:_,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:l.signal}),f!==void 0&&m._setSendRetryWindow(f);for await(let S of m)b&&await b.syncIfDue();y=!l.signal.aborted}finally{try{await h().catch(w=>{r.warn("skill cleanup failed",{session_id:c,work_id:t.id,error:String(w)})})}finally{if(b){let w=p.MEMORY_FLUSH_TIMEOUT_MS;y&&await UX(b.finish(),w)&&r.warn(`final memory sync cut off after ${w}ms; the flush that follows still uploads changed files`,{session_id:c,work_id:t.id});let k=new AbortController;await UX(b.flushWrites(k.signal),w)&&(k.abort(),r.warn(`memory flush cut off after ${w}ms; changed files it had not uploaded yet are not saved`,{session_id:c,work_id:t.id})),await b.dispose().catch(S=>{r.warn("memory store cleanup failed",{session_id:c,work_id:t.id,error:String(S)})})}}d.finish("runner_done"),u(),await g,d.lost?r.info("lease lost; released without stopping it",{session_id:c,work_id:t.id}):await SDe(a,t,r,this.requestOptions)}};aL=class{constructor(t){uy.set(this,void 0),Gp.set(this,void 0),M(this,uy,t,"f")}get signal(){return v(this,uy,"f").signal}finish(t){M(this,Gp,v(this,Gp,"f")??t,"f"),v(this,uy,"f").abort()}get lost(){return v(this,Gp,"f")==="lease_lost"||v(this,Gp,"f")==="assumed_lost"}};uy=new WeakMap,Gp=new WeakMap});var Ka,lL=j(()=>{Se();De();Ne();Me();Z_();cL();Z_();cL();Ka=class extends Z{retrieve(t,n,i){let{environment_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/environments/${r}/work/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/environments/${t}/work?beta=true`,le,{query:o,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(t,n,i){let{environment_id:r,betas:o}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/ack?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(t,n,i){let{environment_id:r,desired_ttl_seconds:o,expected_last_heartbeat:s,betas:a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/heartbeat?beta=true`,{query:{desired_ttl_seconds:o,expected_last_heartbeat:s},...i,headers:I([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(t,n={},i){let{betas:r,"Anthropic-Worker-ID":o,...s}=n??{};return this._client.get(N`/v1/environments/${t}/work/poll?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"Anthropic-Worker-ID":o}:void 0},i?.headers])})}stats(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/environments/${t}/work/stats?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stop(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/environments/${r}/work/${t}/stop?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}poller(t){return new za({...t,client:this._client})}worker(t){return new Vp({...t,client:this._client})}};Ka.WorkPoller=za;Ka.EnvironmentWorker=Vp});var Fl,uL=j(()=>{Se();lL();lL();De();Ne();Me();Fl=class extends Z{constructor(){super(...arguments),this.work=new Ka(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/environments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/environments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/environments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/environments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Fl.Work=Ka});var Bp,dL=j(()=>{Se();De();Ne();Me();Bp=class extends Z{create(t,n,i){let{view:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/memory_stores/${t}/memories?beta=true`,{query:{view:r},body:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{memory_store_id:r,view:o,betas:s,workspace_id:a,...c}=n;return this._client.post(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{view:o},body:c,...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/memory_stores/${t}/memories?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{memory_store_id:r,expected_content_sha256:o,betas:s,workspace_id:a}=n;return this._client.delete(N`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{expected_content_sha256:o},...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}}});var qp,pL=j(()=>{Se();De();Ne();Me();qp=class extends Z{retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/memory_stores/${r}/memory_versions/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/memory_stores/${t}/memory_versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}redact(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/memory_stores/${r}/memory_versions/${t}/redact?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Ja,fL=j(()=>{Se();dL();dL();pL();pL();De();Ne();Me();Ja=class extends Z{constructor(){super(...arguments),this.memories=new Bp(this._client),this.memoryVersions=new qp(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/memory_stores?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/memory_stores/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/memory_stores?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/memory_stores/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Ja.Memories=Bp;Ja.MemoryVersions=qp});var Wp=j(()=>{kt()});var Hp,mL=j(()=>{kt();lp();fM();Hp=class e{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){let t=new ms;for await(let n of this.iterator)for(let i of t.decode(n))yield JSON.parse(i);for(let n of t.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new J("Attempted to iterate over a response with no body");return new e(Nh(t.body),n)}}});var Kp,gL=j(()=>{Se();De();Ne();mL();Wp();Me();Kp=class extends Z{create(t,n){let{betas:i,user_profile_id:r,workspace_id:o,...s}=t;return this._client.post("/v1/messages/batches?beta=true",{body:s,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-user-profile-id":r}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",pn,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/messages/batches/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o,workspace_id:s}=n??{};return this._client.get(r.results_url,{...i,headers:I([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,c)=>Hp.fromResponse(c.response,c.controller))}}});var xS,hL=j(()=>{xS={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function jX(e){return e?.output_format??e?.output_config?.format}function yL(e,t,n){let i=jX(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>{if(r.type==="text"){let o=Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return r}),parsed_output:null}:bL(e,t,n)}function bL(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=PDe(t,o.text);i===null&&(i=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function PDe(e,t){let n=jX(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var vL=j(()=>{kt()});var wL=j(()=>{Lh()});var DDe,Jp,ODe,MDe,zX,GX=j(()=>{DDe=e=>{let t=0,n=[];for(;t{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),Jp(e);break;case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return e=e.slice(0,e.length-1),Jp(e);case"string":let i=e[e.length-2];if(i?.type==="delimiter")return e=e.slice(0,e.length-1),Jp(e);if(i?.type==="brace"&&i.value==="{")return e=e.slice(0,e.length-1),Jp(e);break;case"delimiter":return e=e.slice(0,e.length-1),Jp(e);break}return e},ODe=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},MDe=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},zX=e=>JSON.parse(MDe(ODe(Jp(DDe(e)))))});function ES(e,t){let n={};for(let o of Object.keys(e))o!=="input"&&(n[o]=e[o]);Object.defineProperty(n,Za,{value:t,enumerable:!1,writable:!0});let i,r=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return r||(i=t?zX(t):{},r=!0),i}}),n}var Za,kL=j(()=>{GX();Za="__json_buf"});function TL(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}var jr,Ya,Zp,dy,TS,py,fy,IS,my,Lo,gy,AS,RS,Ul,NS,CS,PS,hy,$L,VX,yy,_L,SL,xL,BX,EL,DS,WX=j(()=>{gr();eo();Wp();Da();hr();wL();vL();kL();DS=class e{constructor(t,n){jr.add(this),this.messages=[],this.receivedMessages=[],Ya.set(this,void 0),Zp.set(this,null),this.controller=new AbortController,dy.set(this,void 0),TS.set(this,()=>{}),py.set(this,()=>{}),fy.set(this,void 0),IS.set(this,()=>{}),my.set(this,()=>{}),Lo.set(this,{}),gy.set(this,!1),AS.set(this,!1),RS.set(this,!1),Ul.set(this,!1),NS.set(this,void 0),CS.set(this,void 0),PS.set(this,void 0),hy.set(this,void 0),yy.set(this,i=>{if(M(this,AS,!0,"f"),Yr(i)&&(i=new In),i instanceof In)return M(this,RS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,dy,new Promise((i,r)=>{M(this,TS,i,"f"),M(this,py,r,"f")}),"f"),M(this,fy,new Promise((i,r)=>{M(this,IS,i,"f"),M(this,my,r,"f")}),"f"),v(this,dy,"f").catch(()=>{}),v(this,fy,"f").catch(()=>{}),M(this,Zp,t,"f"),M(this,hy,n?.logger??console,"f")}get response(){return v(this,NS,"f")}get request_id(){return v(this,CS,"f")}get workspace_id(){return v(this,PS,"f")}async withResponse(){M(this,Ul,!0,"f");let t=await v(this,dy,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,Zp,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[M_]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,yy,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,jr,"m",_L).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,jr,"m",SL).call(this,c);if(a.controller.signal?.aborted)throw new In;v(this,jr,"m",xL).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,NS,t,"f"),M(this,CS,t?.headers.get("request-id"),"f"),M(this,PS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,TS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,gy,"f")}get errored(){return v(this,AS,"f")}get aborted(){return v(this,RS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Lo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,Ul,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,Ul,!0,"f"),await v(this,fy,"f")}get currentMessage(){return v(this,Ya,"f")}async finalMessage(){return await this.done(),v(this,jr,"m",$L).call(this)}async finalText(){return await this.done(),v(this,jr,"m",VX).call(this)}_emit(t,...n){if(v(this,gy,"f"))return;t==="end"&&(M(this,gy,!0,"f"),v(this,IS,"f").call(this));let i=v(this,Lo,"f")[t];if(i&&(v(this,Lo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,Ul,"f")&&!i?.length&&Promise.reject(r),v(this,py,"f").call(this,r),v(this,my,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,Ul,"f")&&!i?.length&&Promise.reject(r),v(this,py,"f").call(this,r),v(this,my,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,jr,"m",$L).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,jr,"m",_L).call(this),this._connected(null);let o=Fr.fromReadableStream(t,this.controller);for await(let s of o)v(this,jr,"m",SL).call(this,s);if(o.controller.signal?.aborted)throw new In;v(this,jr,"m",xL).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(Ya=new WeakMap,Zp=new WeakMap,dy=new WeakMap,TS=new WeakMap,py=new WeakMap,fy=new WeakMap,IS=new WeakMap,my=new WeakMap,Lo=new WeakMap,gy=new WeakMap,AS=new WeakMap,RS=new WeakMap,Ul=new WeakMap,NS=new WeakMap,CS=new WeakMap,PS=new WeakMap,hy=new WeakMap,yy=new WeakMap,jr=new WeakSet,$L=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},VX=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},_L=function(){this.ended||M(this,Ya,void 0,"f")},SL=function(n){if(this.ended)return;let i=v(this,jr,"m",BX).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{if(TL(r)&&v(this,Lo,"f").inputJson?.length){let o;try{o=r.input}catch(s){v(this,yy,"f").call(this,v(this,jr,"m",EL).call(this,r,s));break}this._emit("inputJson",n.delta.partial_json,o)}break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}case"compaction_delta":{r.type==="compaction"&&r.content&&this._emit("compaction",r.content);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(yL(i,v(this,Zp,"f"),{logger:v(this,hy,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,Ya,i,"f");break}case"content_block_start":case"message_delta":break}},xL=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,Ya,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,Ya,void 0,"f"),yL(n,v(this,Zp,"f"),{logger:v(this,hy,"f")})},BX=function(n){let i=v(this,Ya,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.context_management!=null&&(i.context_management=n.context_management),n.input_transformations!=null&&(i.input_transformations=n.input_transformations),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.iterations!=null&&(i.usage.iterations=n.usage.iterations),n.usage.fallback_credit!=null&&(i.usage.fallback_credit=n.usage.fallback_credit),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push(n.content_block),n.content_block.type==="fallback"&&(i.model=n.content_block.to.model),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&TL(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=ES(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}case"compaction_delta":{r?.type==="compaction"&&(i.content[n.index]={...r,content:(r.content||"")+n.delta.content,encrypted_content:n.delta.encrypted_content});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);if(r&&TL(r)&&Za in r){let o;try{o=r.input}catch(s){o={},v(this,yy,"f").call(this,v(this,jr,"m",EL).call(this,r,s))}Object.defineProperty(r,"input",{value:o,enumerable:!0,configurable:!0,writable:!0})}return i}}},EL=function(n,i){let r=n[Za];return new J(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${r}`)},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Fr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var HX,KX=j(()=>{HX=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +`;if(v(this,gr,"f").stdin.write(a),v(this,Fr,"f").indexOf(o)<0){let{promise:f,resolve:m}=Op();M(this,Ai,{sentinel:o,resolve:m},"f");let g,h;try{await Promise.race([f,new Promise((b,y)=>{g=setTimeout(()=>y(new AS(i)),i)}),new Promise((b,y)=>{r&&(h=()=>y(r.reason),r.addEventListener("abort",h,{once:!0}))})])}finally{g&&clearTimeout(g),h&&r&&r.removeEventListener("abort",h),M(this,Ai,null,"f")}}let c=v(this,Fr,"f").indexOf(o);if(c<0)throw new J("bash session terminated");let u=v(this,Fr,"f").slice(c+o.length).match(/^(-?\d+)/),d=u?parseInt(u[1],10):-1,p=v(this,Fr,"f").slice(0,c).replace(hDe,"").replace(/\n+$/,"");return v(this,dy,"f")&&(p=`[output truncated] +${p}`),{output:p,exitCode:d}}close(){if(v(this,Ol,"f"))return;M(this,Ol,!0,"f");let t=v(this,Ai,"f");M(this,Ai,null,"f"),t?.resolve(),v(this,gr,"f").stdout.destroy(),v(this,gr,"f").stderr.destroy(),v(this,gr,"f").stdin.destroy();try{process.kill(-v(this,gr,"f").pid,"SIGKILL")}catch{v(this,gr,"f").kill("SIGKILL")}v(this,gr,"f").unref()}};gr=new WeakMap,Fr=new WeakMap,dy=new WeakMap,Ol=new WeakMap,Ai=new WeakMap,xS=new WeakSet,dL=function(t){if(M(this,Fr,v(this,Fr,"f")+t,"f"),v(this,Fr,"f").length>EX&&(M(this,Fr,v(this,Fr,"f").slice(v(this,Fr,"f").length-EX),"f"),M(this,dy,!0,"f")),v(this,Ai,"f")&&v(this,Fr,"f").indexOf(v(this,Ai,"f").sentinel)>=0){let n=v(this,Ai,"f");M(this,Ai,null,"f"),n.resolve()}};pL=class{constructor(t,n,i,r){ES.add(this),py.set(this,void 0),TS.set(this,void 0),IS.set(this,void 0),Ll.set(this,void 0),Fl.set(this,void 0),zp.set(this,void 0),Ml.set(this,0),fy.set(this,[]),Ka.set(this,0),M(this,py,t,"f"),M(this,TS,n,"f"),M(this,IS,i,"f"),M(this,Ll,Math.max(0,n-1),"f"),M(this,Fl,i>0?i:1/0,"f"),M(this,zp,r,"f")}rangeIsEmpty(){return v(this,Fl,"f")<=v(this,Ll,"f")}rangeIsCollected(){return v(this,Ml,"f")>=v(this,Fl,"f")}collectFrom(t){var n;let i=0;for(;i=v(this,Ll,"f")&&v(this,ES,"m",AX).call(this,t.subarray(i,o),r>=0),r<0)break;M(this,Ml,(n=v(this,Ml,"f"),n++,n),"f"),i=r+1}}text(){return Buffer.concat(v(this,fy,"f"),v(this,Ka,"f")).toString("utf8")}};py=new WeakMap,TS=new WeakMap,IS=new WeakMap,Ll=new WeakMap,Fl=new WeakMap,zp=new WeakMap,Ml=new WeakMap,fy=new WeakMap,Ka=new WeakMap,ES=new WeakSet,AX=function(t,n){if(v(this,fy,"f").push(t),M(this,Ka,v(this,Ka,"f")+t.length,"f"),n&&v(this,Ml,"f")+1v(this,zp,"f"))throw v(this,ES,"m",xX).call(this)},xX=function(){return v(this,Fl,"f")-v(this,Ll,"f")===1?new Ae(`read: line ${v(this,Ll,"f")+1} of ${v(this,py,"f")} alone exceeds ${v(this,zp,"f")}-byte limit. The read tool cannot return part of a line, so view_range cannot narrow this further.`):new Ae(`read: view_range [${v(this,TS,"f")}, ${v(this,IS,"f")}] of ${v(this,py,"f")} exceeds ${v(this,zp,"f")}-byte limit. Narrow the view_range to read a smaller portion.`)};SDe=40,zX=5e4});function ADe(e){return e.resources.some(t=>t.type==="memory_store")}function RDe(e){if(!e)return null;let t;try{let i=e.replace(/-/g,"+").replace(/_/g,"/"),r=i.padEnd(Math.ceil(i.length/4)*4,"=");t=JSON.parse(El(Q5(r)))}catch{return null}if(t===null||typeof t!="object"||Array.isArray(t))return null;let n=t.sessions_token;return typeof n=="string"&&n!==""?n:null}async function qX(e,t){let n;try{return await Promise.race([e.then(()=>!1,()=>!1),new Promise(i=>{n=setTimeout(()=>i(!0),t)})])}finally{n!==void 0&&clearTimeout(n)}}async function CDe(e,t,n,i){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...i,headers:I([i?.headers])})}catch(r){Tn(r,409)||n.error("force-stop on exit failed",{work_id:t.id,error:String(r)})}}function NDe(e){let t=e instanceof Dt?e.error:void 0;for(let n of["error","details","current_state"]){if(!QO(t))return{};t=t[n]}return QO(t)?t:{}}async function PDe(e,t,n,i,r,o){let s=BX,a=TDe,c=Date.now(),l=IDe,u=async()=>{let d=new AbortController,p=Ua(n.signal,d),f=setTimeout(()=>d.abort(),s);try{let m=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:l},{...r,headers:I([r?.headers]),signal:d.signal});c=Date.now(),l=m.last_heartbeat,m.ttl_seconds>0&&(a=m.ttl_seconds*1e3,s=Math.max(1e3,Math.min(a/2,BX)),o?.(a)),(m.state==="stopping"||m.state==="stopped")&&(i.info("heartbeat signals shutdown",{work_id:t.id,state:m.state}),n.finish("control_plane_stop")),m.lease_extended||(i.warn("lease not extended, shutting down",{work_id:t.id}),n.finish("control_plane_stop"))}catch(m){if(n.signal.throwIfAborted(),Tn(m,412)){let g=NDe(m);i.error("lease lost: heartbeat precondition failed",{work_id:t.id,server_state:g.state,server_ttl_seconds:g.ttl_seconds,server_last_heartbeat:g.last_heartbeat}),n.finish("lease_lost");return}if(ja(m))throw i.error("permanent heartbeat failure",{work_id:t.id,error:String(m)}),n.finish("heartbeat_rejected"),m;if(Date.now()-c>a){i.error("lease assumed lost: no successful heartbeat in ttl",{work_id:t.id,ttl_ms:a,error:String(m)}),n.finish("assumed_lost");return}i.warn("transient heartbeat failure",{work_id:t.id,error:String(m)})}finally{clearTimeout(f),p()}};for(await u();!n.signal.aborted;)await Yi(s,n.signal),n.signal.throwIfAborted(),await u()}var CS,hy,mL,yy,Vp,BX,TDe,IDe,Bp,gL,hL=j(()=>{fr();kt();Xi();pM();Tl();fp();lp();Sp();H$();mr();Ce();fS();rS();qM();gS();BX=3e4,TDe=9e4,IDe="NO_HEARTBEAT";Bp=class{constructor(t){if(CS.add(this),hy.set(this,void 0),t.unrestrictedPaths!==void 0)throw new J("The `unrestrictedPaths` option you passed to EnvironmentWorker (or client.beta.environments.work.worker()) is no longer supported. The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a `tools` factory.");this.client=t.client,this.environmentId=t.environmentId,this.environmentKey=t.environmentKey,this.tools=t.tools,this.workdir=t.workdir??process.cwd(),this.maxFileBytes=t.maxFileBytes,this.maxIdleMs=t.maxIdleMs,t.memorySyncIntervalMs!=null&&mS(t.memorySyncIntervalMs,"memorySyncIntervalMs"),this.memorySyncIntervalMs=t.memorySyncIntervalMs,this.memorySyncDeletions=t.memorySyncDeletions??"enabled",this.workerId=t.workerId,this.requestOptions=t.requestOptions,M(this,hy,t.signal,"f")}async run(t){let{environmentId:n,environmentKey:i}=this;if(n===void 0||i===void 0)throw new J("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let r=t??v(this,hy,"f"),o=new za({client:this.client,environmentId:n,environmentKey:i,...this.workerId!==void 0?{workerId:this.workerId}:{},...r?{signal:r}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let s of o)try{await v(this,CS,"m",mL).call(this,s,i,o.signal)}catch(a){if(o.signal?.aborted)throw a;qe(this.client).error("work item failed",{work_id:s.id,error:String(a)})}}async handleItem(t){let n=t?.workId??ze("ANTHROPIC_WORK_ID"),i=t?.environmentId??ze("ANTHROPIC_ENVIRONMENT_ID"),r=t?.sessionId??ze("ANTHROPIC_SESSION_ID"),o=(t?.environmentKey??this.environmentKey??ze("ANTHROPIC_ENVIRONMENT_KEY"))||void 0,s=t?.workSecret||ze("ANTHROPIC_WORK_SECRET")||null;if(!n)throw new J("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!i)throw new J("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!r)throw new J("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!o&&!s)throw new J("handleItem: environmentKey is required when there is no work secret \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let a={id:n,environment_id:i,secret:s,data:{type:"session",id:r}};await v(this,CS,"m",mL).call(this,a,o,t?.signal??v(this,hy,"f"))}};hy=new WeakMap,CS=new WeakSet,mL=async function(t,n,i){let r=qe(this.client),o=RDe(t.secret),s=o??n;if(s===void 0)throw new J("handleItem: the work item carried a secret payload but no sessions token could be extracted, and there is no environment key to fall back to; the poller must issue a secret whose payload carries `sessions_token`, or provide the environment key (pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY)");t.secret&&o===null&&r.warn("work item carried a secret payload but no sessions token could be extracted; falling back to the environment key",{work_id:t.id});let a=Y$(this.client,{authToken:s,helper:"environments-worker"}),c=t.data.id,l=new AbortController,u=Ua(i,l),d=new gL(l),p=await Promise.resolve().then(()=>(VX(),GX)),f,m,g=PDe(a,t,d,r,this.requestOptions,w=>{f=w,m?._setSendRetryWindow(w)}).catch(w=>{l.signal.aborted||r.error("heartbeat loop failed",{work_id:t.id,error:String(w)}),l.abort()}),h=async()=>{},b,y=!1;try{if(t.data.type!=="session"){r.debug("skipping non-session work item",{work_id:t.id,type:t.data.type});return}let w=await a.beta.sessions.retrieve(c);if(o===null&&this.memorySyncIntervalMs!==null&&ADe(w))throw new p.SessionMemoryError(`cannot mount the session's memories: the work item carried no sessions token (work_id=${t.id}, session_id=${c}); the memory endpoints reject the environment key, so the poller must issue a per-item \`secret\` carrying \`sessions_token\`, or set \`memorySyncIntervalMs: null\` to run without memory`);let k={workdir:this.workdir,client:a,session:w,...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}};try{h=await p.setupSkills(k)}catch(S){r.warn("skill setup failed",{session_id:c,work_id:t.id,error:String(S)})}o!==null&&this.memorySyncIntervalMs!==null?(b=new p.SessionMemoryStores(a,{workdir:this.workdir,...this.memorySyncIntervalMs!==void 0?{syncIntervalMs:this.memorySyncIntervalMs}:{},syncDeletions:this.memorySyncDeletions}),await b.download(w),k.allowedRoots=b.roots,k.readOnlyRoots=b.readOnlyRoots):r.debug("memory stores disabled for this item",{work_id:t.id});let $=typeof this.tools=="function"?this.tools(k):this.tools??p.betaAgentToolset20260401(k);m=new Ba(c,{client:a,tools:$,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:l.signal}),f!==void 0&&m._setSendRetryWindow(f);for await(let S of m)b&&await b.syncIfDue();y=!l.signal.aborted}finally{try{await h().catch(w=>{r.warn("skill cleanup failed",{session_id:c,work_id:t.id,error:String(w)})})}finally{if(b){let w=p.MEMORY_FLUSH_TIMEOUT_MS;y&&await qX(b.finish(),w)&&r.warn(`final memory sync cut off after ${w}ms; the flush that follows still uploads changed files`,{session_id:c,work_id:t.id});let k=new AbortController;await qX(b.flushWrites(k.signal),w)&&(k.abort(),r.warn(`memory flush cut off after ${w}ms; changed files it had not uploaded yet are not saved`,{session_id:c,work_id:t.id})),await b.dispose().catch(S=>{r.warn("memory store cleanup failed",{session_id:c,work_id:t.id,error:String(S)})})}}d.finish("runner_done"),u(),await g,d.lost?r.info("lease lost; released without stopping it",{session_id:c,work_id:t.id}):await CDe(a,t,r,this.requestOptions)}};gL=class{constructor(t){yy.set(this,void 0),Vp.set(this,void 0),M(this,yy,t,"f")}get signal(){return v(this,yy,"f").signal}finish(t){M(this,Vp,v(this,Vp,"f")??t,"f"),v(this,yy,"f").abort()}get lost(){return v(this,Vp,"f")==="lease_lost"||v(this,Vp,"f")==="assumed_lost"}};yy=new WeakMap,Vp=new WeakMap});var Ha,yL=j(()=>{Se();Pe();Ce();Me();rS();hL();rS();hL();Ha=class extends Z{retrieve(t,n,i){let{environment_id:r,betas:o,workspace_id:s}=n;return this._client.get(R`/v1/environments/${r}/work/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(R`/v1/environments/${r}/work/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(R`/v1/environments/${t}/work?beta=true`,le,{query:o,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}ack(t,n,i){let{environment_id:r,betas:o}=n;return this._client.post(R`/v1/environments/${r}/work/${t}/ack?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}heartbeat(t,n,i){let{environment_id:r,desired_ttl_seconds:o,expected_last_heartbeat:s,betas:a}=n;return this._client.post(R`/v1/environments/${r}/work/${t}/heartbeat?beta=true`,{query:{desired_ttl_seconds:o,expected_last_heartbeat:s},...i,headers:I([{"anthropic-beta":[...a??[],"managed-agents-2026-04-01"].toString()},i?.headers])})}poll(t,n={},i){let{betas:r,"Anthropic-Worker-ID":o,...s}=n??{};return this._client.get(R`/v1/environments/${t}/work/poll?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"Anthropic-Worker-ID":o}:void 0},i?.headers])})}stats(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/environments/${t}/work/stats?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stop(t,n,i){let{environment_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(R`/v1/environments/${r}/work/${t}/stop?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}poller(t){return new za({...t,client:this._client})}worker(t){return new Bp({...t,client:this._client})}};Ha.WorkPoller=za;Ha.EnvironmentWorker=Bp});var jl,bL=j(()=>{Se();yL();yL();Pe();Ce();Me();jl=class extends Z{constructor(){super(...arguments),this.work=new Ha(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/environments?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/environments/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/environments?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(R`/v1/environments/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/environments/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};jl.Work=Ha});var qp,vL=j(()=>{Se();Pe();Ce();Me();qp=class extends Z{create(t,n,i){let{view:r,betas:o,workspace_id:s,...a}=n;return this._client.post(R`/v1/memory_stores/${t}/memories?beta=true`,{query:{view:r},body:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(R`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{memory_store_id:r,view:o,betas:s,workspace_id:a,...c}=n;return this._client.post(R`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{view:o},body:c,...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/memory_stores/${t}/memories?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{memory_store_id:r,expected_content_sha256:o,betas:s,workspace_id:a}=n;return this._client.delete(R`/v1/memory_stores/${r}/memories/${t}?beta=true`,{query:{expected_content_sha256:o},...i,headers:I([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString(),...a!=null?{"anthropic-workspace-id":a}:void 0},i?.headers])})}}});var Wp,wL=j(()=>{Se();Pe();Ce();Me();Wp=class extends Z{retrieve(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(R`/v1/memory_stores/${r}/memory_versions/${t}?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/memory_stores/${t}/memory_versions?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}redact(t,n,i){let{memory_store_id:r,betas:o,workspace_id:s}=n;return this._client.post(R`/v1/memory_stores/${r}/memory_versions/${t}/redact?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Ja,kL=j(()=>{Se();vL();vL();wL();wL();Pe();Ce();Me();Ja=class extends Z{constructor(){super(...arguments),this.memories=new qp(this._client),this.memoryVersions=new Wp(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/memory_stores?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/memory_stores/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/memory_stores?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"agent-memory-2026-07-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(R`/v1/memory_stores/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/memory_stores/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Ja.Memories=qp;Ja.MemoryVersions=Wp});var Kp=j(()=>{kt()});var Hp,_L=j(()=>{kt();up();kM();Hp=class e{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){let t=new ms;for await(let n of this.iterator)for(let i of t.decode(n))yield JSON.parse(i);for(let n of t.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new J("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new J("Attempted to iterate over a response with no body");return new e(Fh(t.body),n)}}});var Jp,$L=j(()=>{Se();Pe();Ce();_L();Kp();Me();Jp=class extends Z{create(t,n){let{betas:i,user_profile_id:r,workspace_id:o,...s}=t;return this._client.post("/v1/messages/batches?beta=true",{body:s,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-user-profile-id":r}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",dn,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(R`/v1/messages/batches/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}cancel(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/messages/batches/${t}/cancel?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o,workspace_id:s}=n??{};return this._client.get(r.results_url,{...i,headers:I([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,c)=>Hp.fromResponse(c.response,c.controller))}}});var NS,SL=j(()=>{NS={"claude-opus-4@20250514":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function WX(e){return e?.output_format??e?.output_config?.format}function xL(e,t,n){let i=WX(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>{if(r.type==="text"){let o=Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return r}),parsed_output:null}:EL(e,t,n)}function EL(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=jDe(t,o.text);i===null&&(i=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function jDe(e,t){let n=WX(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var TL=j(()=>{kt()});var IL=j(()=>{Bh()});var zDe,Zp,GDe,VDe,KX,HX=j(()=>{zDe=e=>{let t=0,n=[];for(;t{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),Zp(e);break;case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return e=e.slice(0,e.length-1),Zp(e);case"string":let i=e[e.length-2];if(i?.type==="delimiter")return e=e.slice(0,e.length-1),Zp(e);if(i?.type==="brace"&&i.value==="{")return e=e.slice(0,e.length-1),Zp(e);break;case"delimiter":return e=e.slice(0,e.length-1),Zp(e);break}return e},GDe=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},VDe=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},KX=e=>JSON.parse(VDe(GDe(Zp(zDe(e)))))});function PS(e,t){let n={};for(let o of Object.keys(e))o!=="input"&&(n[o]=e[o]);Object.defineProperty(n,Za,{value:t,enumerable:!1,writable:!0});let i,r=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){return r||(i=t?KX(t):{},r=!0),i}}),n}var Za,AL=j(()=>{HX();Za="__json_buf"});function OL(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}var Ur,Ya,Yp,by,DS,vy,wy,OS,ky,Lo,_y,MS,LS,zl,FS,US,jS,$y,RL,JX,Sy,CL,NL,PL,ZX,DL,zS,QX=j(()=>{fr();eo();Kp();Da();mr();IL();TL();AL();zS=class e{constructor(t,n){Ur.add(this),this.messages=[],this.receivedMessages=[],Ya.set(this,void 0),Yp.set(this,null),this.controller=new AbortController,by.set(this,void 0),DS.set(this,()=>{}),vy.set(this,()=>{}),wy.set(this,void 0),OS.set(this,()=>{}),ky.set(this,()=>{}),Lo.set(this,{}),_y.set(this,!1),MS.set(this,!1),LS.set(this,!1),zl.set(this,!1),FS.set(this,void 0),US.set(this,void 0),jS.set(this,void 0),$y.set(this,void 0),Sy.set(this,i=>{if(M(this,MS,!0,"f"),Zr(i)&&(i=new En),i instanceof En)return M(this,LS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,by,new Promise((i,r)=>{M(this,DS,i,"f"),M(this,vy,r,"f")}),"f"),M(this,wy,new Promise((i,r)=>{M(this,OS,i,"f"),M(this,ky,r,"f")}),"f"),v(this,by,"f").catch(()=>{}),v(this,wy,"f").catch(()=>{}),M(this,Yp,t,"f"),M(this,$y,n?.logger??console,"f")}get response(){return v(this,FS,"f")}get request_id(){return v(this,US,"f")}get workspace_id(){return v(this,jS,"f")}async withResponse(){M(this,zl,!0,"f");let t=await v(this,by,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,Yp,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[V$]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,Sy,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,Ur,"m",CL).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,Ur,"m",NL).call(this,c);if(a.controller.signal?.aborted)throw new En;v(this,Ur,"m",PL).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,FS,t,"f"),M(this,US,t?.headers.get("request-id"),"f"),M(this,jS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,DS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,_y,"f")}get errored(){return v(this,MS,"f")}get aborted(){return v(this,LS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Lo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Lo,"f")[t]||(v(this,Lo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,zl,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,zl,!0,"f"),await v(this,wy,"f")}get currentMessage(){return v(this,Ya,"f")}async finalMessage(){return await this.done(),v(this,Ur,"m",RL).call(this)}async finalText(){return await this.done(),v(this,Ur,"m",JX).call(this)}_emit(t,...n){if(v(this,_y,"f"))return;t==="end"&&(M(this,_y,!0,"f"),v(this,OS,"f").call(this));let i=v(this,Lo,"f")[t];if(i&&(v(this,Lo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,zl,"f")&&!i?.length&&Promise.reject(r),v(this,vy,"f").call(this,r),v(this,ky,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,zl,"f")&&!i?.length&&Promise.reject(r),v(this,vy,"f").call(this,r),v(this,ky,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,Ur,"m",RL).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,Ur,"m",CL).call(this),this._connected(null);let o=Lr.fromReadableStream(t,this.controller);for await(let s of o)v(this,Ur,"m",NL).call(this,s);if(o.controller.signal?.aborted)throw new En;v(this,Ur,"m",PL).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(Ya=new WeakMap,Yp=new WeakMap,by=new WeakMap,DS=new WeakMap,vy=new WeakMap,wy=new WeakMap,OS=new WeakMap,ky=new WeakMap,Lo=new WeakMap,_y=new WeakMap,MS=new WeakMap,LS=new WeakMap,zl=new WeakMap,FS=new WeakMap,US=new WeakMap,jS=new WeakMap,$y=new WeakMap,Sy=new WeakMap,Ur=new WeakSet,RL=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},JX=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},CL=function(){this.ended||M(this,Ya,void 0,"f")},NL=function(n){if(this.ended)return;let i=v(this,Ur,"m",ZX).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{if(OL(r)&&v(this,Lo,"f").inputJson?.length){let o;try{o=r.input}catch(s){v(this,Sy,"f").call(this,v(this,Ur,"m",DL).call(this,r,s));break}this._emit("inputJson",n.delta.partial_json,o)}break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}case"compaction_delta":{r.type==="compaction"&&r.content&&this._emit("compaction",r.content);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(xL(i,v(this,Yp,"f"),{logger:v(this,$y,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,Ya,i,"f");break}case"content_block_start":case"message_delta":break}},PL=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,Ya,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,Ya,void 0,"f"),xL(n,v(this,Yp,"f"),{logger:v(this,$y,"f")})},ZX=function(n){let i=v(this,Ya,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.context_management!=null&&(i.context_management=n.context_management),n.input_transformations!=null&&(i.input_transformations=n.input_transformations),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.iterations!=null&&(i.usage.iterations=n.usage.iterations),n.usage.fallback_credit!=null&&(i.usage.fallback_credit=n.usage.fallback_credit),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push(n.content_block),n.content_block.type==="fallback"&&(i.model=n.content_block.to.model),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&OL(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=PS(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}case"compaction_delta":{r?.type==="compaction"&&(i.content[n.index]={...r,content:(r.content||"")+n.delta.content,encrypted_content:n.delta.encrypted_content});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);if(r&&OL(r)&&Za in r){let o;try{o=r.input}catch(s){o={},v(this,Sy,"f").call(this,v(this,Ur,"m",DL).call(this,r,s))}Object.defineProperty(r,"input",{value:o,enumerable:!0,configurable:!0,writable:!0})}return i}}},DL=function(n,i){let r=n[Za];return new J(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${i}. JSON: ${r}`)},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Lr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var XX,e7=j(()=>{XX=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -181,46 +181,46 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`});async function FDe(e,t=e.messages.at(-1),n){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;let i=t.content.filter(s=>s.type==="tool_use");if(i.length===0)return null;let r=jDe(e);return{role:"user",content:await Promise.all(i.map(async s=>{let a=e.tools.find(c=>("name"in c?c.name:"mcp_server_name"in c?c.mcp_server_name:c.type)===s.name);if(!a||!("run"in a)||!r.has(s.name))return UDe(s);try{let c=s.input;"parse"in a&&a.parse&&(c=a.parse(c));let l=await a.run(c,{toolUse:s,toolUseBlock:s,signal:n?.signal});return{type:"tool_result",tool_use_id:s.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:s.id,content:c instanceof Ae?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function UDe(e){return{type:"tool_result",tool_use_id:e.id,content:`Error: Tool '${e.name}' not found`,is_error:!0}}function jDe(e){let t=new Set;for(let n of e.tools)"run"in n&&t.add(n.name);for(let n of e.messages)if(!(n.role!=="system"||typeof n.content=="string"))for(let i of n.content)zDe(i,t);return t}function zDe(e,t){switch(e.type){case"tool_removal":case"tool_addition":GDe(e,t);break}}function GDe(e,t){let n=VDe(e.tool);n!==void 0&&(e.type==="tool_removal"?t.delete(n):t.add(n))}function VDe(e){if(e.type==="tool_reference")return e.name}function BDe(e){if(e===null)return"stop";switch(e){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var by,Yp,jl,Jt,zr,ni,bs,Qa,vy,JX,IL,Qp,AL=j(()=>{gr();Il();kt();Ne();BM();hr();KX();eo();Qp=class{constructor(t,n,i){by.add(this),this.client=t,Yp.set(this,!1),jl.set(this,!1),Jt.set(this,void 0),zr.set(this,void 0),ni.set(this,void 0),bs.set(this,void 0),Qa.set(this,void 0),vy.set(this,0),M(this,Jt,{params:{...n,messages:structuredClone(n.messages)}},"f");let r=EM(n.tools,n.messages);M(this,zr,{...i,headers:I([Bh("BetaToolRunner"),r.length?{[Mo]:r.join(", ")}:void 0,i?.headers])},"f"),M(this,Qa,Dp(),"f"),n.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Yp=new WeakMap,jl=new WeakMap,Jt=new WeakMap,zr=new WeakMap,ni=new WeakMap,bs=new WeakMap,Qa=new WeakMap,vy=new WeakMap,by=new WeakSet,JX=async function(){let n=v(this,Jt,"f").params.compactionControl;if(!n||!n.enabled)return!1;let i=0;if(v(this,ni,"f")!==void 0)try{let l=await v(this,ni,"f");i=l.usage.input_tokens+(l.usage.cache_creation_input_tokens??0)+(l.usage.cache_read_input_tokens??0)+l.usage.output_tokens}catch{return!1}let r=n.contextTokenThreshold??1e5;if(id.type!=="tool_use");u.length===0?a.pop():l.content=u}}let c=await this.client.beta.messages.create({model:o,messages:[...a,{role:"user",content:[{type:"text",text:s}]}],max_tokens:v(this,Jt,"f").params.max_tokens},{signal:v(this,zr,"f").signal,headers:I([v(this,zr,"f").headers,Bh("compaction")])});if(c.content[0]?.type!=="text")throw new J("Expected text response for compaction");return v(this,Jt,"f").params.messages=[{role:"user",content:c.content}],!0},Symbol.asyncIterator)](){var t;if(v(this,Yp,"f"))throw new J("Cannot iterate over a consumed stream");M(this,Yp,!0,"f"),M(this,jl,!0,"f"),M(this,bs,void 0,"f");try{for(;;){let n;try{if(v(this,Jt,"f").params.max_iterations&&v(this,vy,"f")>=v(this,Jt,"f").params.max_iterations)break;M(this,jl,!1,"f"),M(this,bs,void 0,"f"),M(this,vy,(t=v(this,vy,"f"),t++,t),"f"),M(this,ni,void 0,"f");let{max_iterations:i,compactionControl:r,...o}=v(this,Jt,"f").params;if(o.stream?(n=this.client.beta.messages.stream({...o},v(this,zr,"f")),M(this,ni,n.finalMessage(),"f"),v(this,ni,"f").catch(()=>{}),yield n):(M(this,ni,this.client.beta.messages.create({...o,stream:!1},v(this,zr,"f")),"f"),yield v(this,ni,"f")),!await v(this,by,"m",JX).call(this)){if(!v(this,jl,"f")){let c=await v(this,ni,"f"),l=BDe(c.stop_reason);v(this,Jt,"f").params.messages.push({role:c.role,content:c.content});let{container:u}=v(this,Jt,"f").params;if(c.container&&(u==null?v(this,Jt,"f").params.container=c.container.id:typeof u=="object"&&u.id==null&&(v(this,Jt,"f").params.container={...u,id:c.container.id})),l==="stop")break;if(l==="resume")continue}let a=await v(this,by,"m",IL).call(this,v(this,Jt,"f").params.messages.at(-1));if(a)v(this,Jt,"f").params.messages.push(a);else if(!v(this,jl,"f"))break}}finally{n&&n.abort()}}if(!v(this,ni,"f"))throw new J("ToolRunner concluded without a message from the server");v(this,Qa,"f").resolve(await v(this,ni,"f"))}catch(n){throw M(this,Yp,!1,"f"),v(this,Qa,"f").promise.catch(()=>{}),v(this,Qa,"f").reject(n),M(this,Qa,Dp(),"f"),n}}setMessagesParams(t){typeof t=="function"?v(this,Jt,"f").params=t(v(this,Jt,"f").params):v(this,Jt,"f").params=t,M(this,jl,!0,"f"),M(this,bs,void 0,"f")}setRequestOptions(t){typeof t=="function"?M(this,zr,t(v(this,zr,"f")),"f"):M(this,zr,{...v(this,zr,"f"),...t},"f")}async generateToolResponse(t=v(this,zr,"f").signal){let n=await v(this,ni,"f")??this.params.messages.at(-1);return n?v(this,by,"m",IL).call(this,n,t):null}done(){return v(this,Qa,"f").promise}async runUntilDone(){if(!v(this,Yp,"f"))for await(let t of this);return this.done()}get params(){return v(this,Jt,"f").params}pushMessages(...t){this.setMessagesParams(n=>({...n,messages:[...n.messages,...t]}))}then(t,n){return this.runUntilDone().then(t,n)}};IL=async function(t,n=v(this,zr,"f").signal){return v(this,bs,"f")!==void 0?v(this,bs,"f"):(M(this,bs,FDe(v(this,Jt,"f").params,t,{...v(this,zr,"f"),signal:n}),"f"),v(this,bs,"f"))}});function YX(e){if(!e.output_format)return e;if(e.output_config?.format)throw new J("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var ZX,qDe,vs,RL=j(()=>{Wp();gL();Se();hL();Ne();eo();vL();WX();AL();Il();gL();AL();Il();ZX={},qDe=["claude-mythos-preview","claude-opus-4-6"],vs=class extends Z{constructor(){super(...arguments),this.batches=new Kp(this._client)}create(t,n){let i=YX(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;a.model in ZX&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${ZX[a.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),qDe.includes(a.model)&&a.thinking&&a.thinking.type==="enabled"&&console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=n?.timeout??this._client._options.timeout;if(!a.stream&&c==null){let u=xS[a.model]??void 0;c=this._client.calculateNonstreamingTimeout(a.max_tokens,u)}let l=L_(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:c??6e5,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},l,n?.headers]),stream:i.stream??!1})}parse(t,n){return n={...n,headers:I([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},n?.headers])},this.create(t,n).then(i=>bL(i,t,{logger:this._client.logger??console}))}stream(t,n){return DS.createMessage(this,t,n)}countTokens(t,n){let i=YX(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...n,headers:I([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString(),...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},n?.headers])})}toolRunner(t,n){return new Qp(this._client,t,n)}};vs.Batches=Kp;vs.BetaToolRunner=Qp;vs.ToolError=Ae});var Xp,NL=j(()=>{Se();De();Me();Xp=class extends Z{retrieve(t,n){return this._client.get(N`/v1/organizations/api_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/api_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",pn,{query:t,...n})}}});var ef,CL=j(()=>{Se();ef=class extends Z{retrieve(t){return this._client.get("/v1/organizations/compliance_settings?beta=true",t)}update(t,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:t,...n})}}});var tf,PL=j(()=>{Se();De();Me();tf=class extends Z{create(t,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(N`/v1/organizations/external_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/external_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",le,{query:t,...n})}delete(t,n){return this._client.delete(N`/v1/organizations/external_keys/${t}?beta=true`,n)}validate(t,n){return this._client.post(N`/v1/organizations/external_keys/${t}/validate?beta=true`,n)}}});var nf,DL=j(()=>{Se();De();Me();nf=class extends Z{create(t,n){return this._client.post("/v1/organizations/invites?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(N`/v1/organizations/invites/${t}?beta=true`,n)}list(t={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",pn,{query:t,...n})}delete(t,n){return this._client.delete(N`/v1/organizations/invites/${t}?beta=true`,n)}}});var rf,OL=j(()=>{Se();De();rf=class extends Z{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",le,{query:t,...n})}}});var of,ML=j(()=>{Se();De();Me();of=class extends Z{retrieve(t,n){return this._client.get(N`/v1/organizations/users/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/users/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",pn,{query:t,...n})}remove(t,n){return this._client.delete(N`/v1/organizations/users/${t}?beta=true`,n)}}});var sf,LL=j(()=>{Se();De();Ne();Me();sf=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/federation_issuers/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_issuers/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/federation_issuers/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}}});var af,FL=j(()=>{Se();De();Ne();Me();af=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{federation_rule_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/federation_rules/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var zl,UL=j(()=>{Se();FL();FL();De();Ne();Me();zl=class extends Z{constructor(){super(...arguments),this.workspaces=new af(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/federation_rules/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/federation_rules/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/federation_rules/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};zl.Workspaces=af});var Xa,jL=j(()=>{Se();LL();LL();UL();UL();Xa=class extends Z{constructor(){super(...arguments),this.issuers=new sf(this._client),this.rules=new zl(this._client)}};Xa.Issuers=sf;Xa.Rules=zl});var cf,zL=j(()=>{Se();De();Ne();Me();cf=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{service_account_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/service_accounts/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var Gl,GL=j(()=>{Se();zL();zL();De();Ne();Me();Gl=class extends Z{constructor(){super(...arguments),this.workspaces=new cf(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(N`/v1/organizations/service_accounts/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/service_accounts/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(N`/v1/organizations/service_accounts/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};Gl.Workspaces=cf});var lf,VL=j(()=>{Se();De();Me();lf=class extends Z{retrieve(t,n,i){let{workspace_id:r}=n;return this._client.get(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}update(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,{body:o,...i})}list(t,n={},i){return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/members?beta=true`,pn,{query:n,...i})}add(t,n,i){return this._client.post(N`/v1/organizations/workspaces/${t}/members?beta=true`,{body:n,...i})}remove(t,n,i){let{workspace_id:r}=n;return this._client.delete(N`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}}});var uf,BL=j(()=>{Se();De();Me();uf=class extends Z{list(t,n={},i){return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/rate_limits?beta=true`,le,{query:n,...i})}}});var df,qL=j(()=>{Se();De();Ne();Me();df=class extends Z{retrieve(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.get(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}update(t,n,i){let{workspace_id:r,betas:o,...s}=n;return this._client.post(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{body:s,...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(N`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(N`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.delete(N`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var ws,WL=j(()=>{Se();VL();VL();BL();BL();qL();qL();De();Ne();Me();ws=class extends Z{constructor(){super(...arguments),this.rateLimits=new uf(this._client),this.members=new lf(this._client),this.serviceAccounts=new df(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/workspaces?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n){return this._client.get(N`/v1/organizations/workspaces/${t}?beta=true`,n)}update(t,n,i){return this._client.post(N`/v1/organizations/workspaces/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",pn,{query:t,...n})}archive(t,n){return this._client.post(N`/v1/organizations/workspaces/${t}/archive?beta=true`,n)}};ws.RateLimits=uf;ws.Members=lf;ws.ServiceAccounts=df});var vr,HL=j(()=>{Se();NL();NL();CL();CL();PL();PL();DL();DL();OL();OL();ML();ML();jL();jL();GL();GL();WL();WL();vr=class extends Z{constructor(){super(...arguments),this.apiKeys=new Xp(this._client),this.externalKeys=new tf(this._client),this.federation=new Xa(this._client),this.invites=new nf(this._client),this.serviceAccounts=new Gl(this._client),this.users=new of(this._client),this.workspaces=new ws(this._client),this.rateLimits=new rf(this._client),this.complianceSettings=new ef(this._client)}retrieve(t){return this._client.get("/v1/organizations/me?beta=true",t)}};vr.APIKeys=Xp;vr.ExternalKeys=tf;vr.Federation=Xa;vr.Invites=nf;vr.ServiceAccounts=Gl;vr.Users=of;vr.Workspaces=ws;vr.RateLimits=rf;vr.ComplianceSettings=ef});var Vl,KL=j(()=>{Se();De();Ne();Me();sS();sS();Vl=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/events?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}send(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}/events?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stream(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(N`/v1/sessions/${t}/events/stream?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0})}toolRunner(t,n){return new Ba(t,{...n,client:this._client})}};Vl.SessionToolRunner=Ba});var pf,JL=j(()=>{Se();De();Ne();Me();pf=class extends Z{retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/sessions/${r}/resources/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/resources?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}add(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}/resources?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var ff,ZL=j(()=>{Se();De();Ne();Me();ff=class extends Z{list(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.getAPIList(N`/v1/sessions/${r}/threads/${t}/events?beta=true`,le,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}stream(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(N`/v1/sessions/${r}/threads/${t}/stream?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0})}}});var Bl,YL=j(()=>{Se();ZL();ZL();De();Ne();Me();Bl=class extends Z{constructor(){super(...arguments),this.events=new ff(this._client)}retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/sessions/${r}/threads/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/sessions/${t}/threads?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/sessions/${r}/threads/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}};Bl.Events=ff});var ks,QL=j(()=>{Se();KL();KL();JL();JL();YL();YL();De();Ne();Me();ks=class extends Z{constructor(){super(...arguments),this.events=new Vl(this._client),this.resources=new pf(this._client),this.threads=new Bl(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/sessions?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/sessions/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/sessions?beta=true",P_,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/sessions/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};ks.Events=Vl;ks.Resources=pf;ks.Threads=Bl});var mf,XL=j(()=>{Se();De();Ne();gs();Me();mf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/skills/${t}/versions?beta=true`,xi({body:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/skills/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}download(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__binaryResponse:!0})}}});var ql,eF=j(()=>{Se();XL();XL();De();Ne();gs();Me();ql=class extends Z{constructor(){super(...arguments),this.versions=new mf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/skills?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/skills?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};ql.Versions=mf});var gf,tF=j(()=>{Se();De();Ne();Me();gf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/tunnels/${t}/certificates?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/tunnels/${r}/certificates/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/tunnels/${t}/certificates?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/tunnels/${r}/certificates/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Wl,nF=j(()=>{Se();tF();tF();De();Ne();Me();Wl=class extends Z{constructor(){super(...arguments),this.certificates=new gf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/tunnels?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/tunnels/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/tunnels?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/tunnels/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}revealToken(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/tunnels/${t}/reveal_token?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}rotateToken(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/tunnels/${t}/rotate_token?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Wl.Certificates=gf});var hf,rF=j(()=>{Se();De();Ne();Me();hf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/vaults/${t}/credentials?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.get(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{vault_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(N`/v1/vaults/${t}/credentials?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.delete(N`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}mcpOAuthValidate(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(N`/v1/vaults/${r}/credentials/${t}/mcp_oauth_validate?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Hl,iF=j(()=>{Se();rF();rF();De();Ne();Me();Hl=class extends Z{constructor(){super(...arguments),this.credentials=new hf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/vaults?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(N`/v1/vaults/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/vaults?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(N`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(N`/v1/vaults/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Hl.Credentials=hf});var jt,oF=j(()=>{Se();_M();_M();SM();SM();xM();xM();TM();TM();IM();IM();AM();AM();PM();PM();OM();OM();uL();uL();fL();fL();RL();RL();HL();HL();QL();QL();eF();eF();nF();nF();iF();iF();jt=class extends Z{constructor(){super(...arguments),this.models=new bp(this._client),this.messages=new vs(this._client),this.agents=new Tl(this._client),this.environments=new Fl(this._client),this.sessions=new ks(this._client),this.deployments=new gp(this._client),this.deploymentRuns=new mp(this._client),this.vaults=new Hl(this._client),this.memoryStores=new Ja(this._client),this.files=new yp(this._client),this.skills=new ql(this._client),this.webhooks=new kp(this._client),this.userProfiles=new vp(this._client),this.dreams=new hp(this._client),this.tunnels=new Wl(this._client),this.organization=new vr(this._client)}};jt.Models=bp;jt.Messages=vs;jt.Agents=Tl;jt.Environments=Fl;jt.Sessions=ks;jt.Deployments=gp;jt.DeploymentRuns=mp;jt.Vaults=Hl;jt.MemoryStores=Ja;jt.Files=yp;jt.Skills=ql;jt.Webhooks=kp;jt.UserProfiles=vp;jt.Dreams=hp;jt.Tunnels=Wl;jt.Organization=vr});var Kl,sF=j(()=>{Se();Ne();Kl=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers]),stream:t.stream??!1})}}});var Jl,aF=j(()=>{Se();De();Ne();eo();gs();Me();Jl=class extends Z{list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/files",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}download(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/files/${t}/content`,{...i,headers:I([{Accept:"application/binary",...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}upload(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/files",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},F_(r.file),n?.headers])},this._client))}}});function QX(e){return e?.output_config?.format}function cF(e,t,n){let i=QX(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>r.type==="text"?Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1}):r),parsed_output:null}:lF(e,t,n)}function lF(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=kOe(t,o.text);return i===null&&(i=s),Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function kOe(e,t){let n=QX(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var uF=j(()=>{kt()});function hF(e){return e.type==="tool_use"||e.type==="server_tool_use"}var Ri,ec,yf,wy,OS,ky,$y,MS,_y,Fo,Sy,LS,FS,Zl,US,jS,zS,xy,dF,XX,pF,fF,mF,gF,e7,GS,t7=j(()=>{gr();eo();Da();hr();Wp();wL();uF();kL();GS=class e{constructor(t,n){Ri.add(this),this.messages=[],this.receivedMessages=[],ec.set(this,void 0),yf.set(this,null),this.controller=new AbortController,wy.set(this,void 0),OS.set(this,()=>{}),ky.set(this,()=>{}),$y.set(this,void 0),MS.set(this,()=>{}),_y.set(this,()=>{}),Fo.set(this,{}),Sy.set(this,!1),LS.set(this,!1),FS.set(this,!1),Zl.set(this,!1),US.set(this,void 0),jS.set(this,void 0),zS.set(this,void 0),xy.set(this,void 0),pF.set(this,i=>{if(M(this,LS,!0,"f"),Yr(i)&&(i=new In),i instanceof In)return M(this,FS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,wy,new Promise((i,r)=>{M(this,OS,i,"f"),M(this,ky,r,"f")}),"f"),M(this,$y,new Promise((i,r)=>{M(this,MS,i,"f"),M(this,_y,r,"f")}),"f"),v(this,wy,"f").catch(()=>{}),v(this,$y,"f").catch(()=>{}),M(this,yf,t,"f"),M(this,xy,n?.logger??console,"f")}get response(){return v(this,US,"f")}get request_id(){return v(this,jS,"f")}get workspace_id(){return v(this,zS,"f")}async withResponse(){M(this,Zl,!0,"f");let t=await v(this,wy,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,yf,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[M_]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,pF,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,Ri,"m",fF).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,Ri,"m",mF).call(this,c);if(a.controller.signal?.aborted)throw new In;v(this,Ri,"m",gF).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,US,t,"f"),M(this,jS,t?.headers.get("request-id"),"f"),M(this,zS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,OS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,Sy,"f")}get errored(){return v(this,LS,"f")}get aborted(){return v(this,FS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Fo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,Zl,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,Zl,!0,"f"),await v(this,$y,"f")}get currentMessage(){return v(this,ec,"f")}async finalMessage(){return await this.done(),v(this,Ri,"m",dF).call(this)}async finalText(){return await this.done(),v(this,Ri,"m",XX).call(this)}_emit(t,...n){if(v(this,Sy,"f"))return;t==="end"&&(M(this,Sy,!0,"f"),v(this,MS,"f").call(this));let i=v(this,Fo,"f")[t];if(i&&(v(this,Fo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,Zl,"f")&&!i?.length&&Promise.reject(r),v(this,ky,"f").call(this,r),v(this,_y,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,Zl,"f")&&!i?.length&&Promise.reject(r),v(this,ky,"f").call(this,r),v(this,_y,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,Ri,"m",dF).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,Ri,"m",fF).call(this),this._connected(null);let o=Fr.fromReadableStream(t,this.controller);for await(let s of o)v(this,Ri,"m",mF).call(this,s);if(o.controller.signal?.aborted)throw new In;v(this,Ri,"m",gF).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(ec=new WeakMap,yf=new WeakMap,wy=new WeakMap,OS=new WeakMap,ky=new WeakMap,$y=new WeakMap,MS=new WeakMap,_y=new WeakMap,Fo=new WeakMap,Sy=new WeakMap,LS=new WeakMap,FS=new WeakMap,Zl=new WeakMap,US=new WeakMap,jS=new WeakMap,zS=new WeakMap,xy=new WeakMap,pF=new WeakMap,Ri=new WeakSet,dF=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},XX=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},fF=function(){this.ended||M(this,ec,void 0,"f")},mF=function(n){if(this.ended)return;let i=v(this,Ri,"m",e7).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{hF(r)&&v(this,Fo,"f").inputJson?.length&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(cF(i,v(this,yf,"f"),{logger:v(this,xy,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,ec,i,"f");break}case"content_block_start":case"message_delta":break}},gF=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,ec,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,ec,void 0,"f"),cF(n,v(this,yf,"f"),{logger:v(this,xy,"f")})},e7=function(n){let i=v(this,ec,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push({...n.content_block}),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&hF(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=ES(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);return r&&hF(r)&&Za in r&&Object.defineProperty(r,"input",{value:r.input,enumerable:!0,configurable:!0,writable:!0}),i}}},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Fr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var bf,yF=j(()=>{Se();De();Ne();mL();Wp();Me();bf=class extends Z{create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/batches",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/messages/batches",pn,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}cancel(t,n={},i){let{workspace_id:r}=n??{};return this._client.post(N`/v1/messages/batches/${t}/cancel`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{workspace_id:o}=n??{};return this._client.get(r.results_url,{...i,headers:I([{Accept:"application/binary",...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>Hp.fromResponse(a.response,a.controller))}}});var tc,n7,_Oe,bF=j(()=>{Se();Ne();eo();t7();uF();yF();yF();hL();tc=class extends Z{constructor(){super(...arguments),this.batches=new bf(this._client)}create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;o.model in n7&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${n7[o.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),_Oe.includes(o.model)&&o.thinking&&o.thinking.type==="enabled"&&console.warn(`Using Claude with ${o.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let s=n?.timeout??this._client._options.timeout;if(!o.stream&&s==null){let c=xS[o.model]??void 0;s=this._client.calculateNonstreamingTimeout(o.max_tokens,c)}let a=L_(o.tools,o.messages);return this._client.post("/v1/messages",{body:o,timeout:s??6e5,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},a,n?.headers]),stream:t.stream??!1})}parse(t,n){return this.create(t,n).then(i=>lF(i,t,{logger:this._client.logger??console}))}stream(t,n){return GS.createMessage(this,t,n,{logger:this._client.logger??console})}countTokens(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/count_tokens",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}},n7={},_Oe=["claude-mythos-preview","claude-opus-4-6"];tc.Batches=bf});var Yl,vF=j(()=>{Se();De();Ne();Me();Yl=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(N`/v1/models/${t}`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models",pn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var vf,wF=j(()=>{Se();De();Ne();gs();Me();vf=class extends Z{create(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(N`/v1/skills/${t}/versions`,xi({body:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.get(N`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t,n={},i){let{workspace_id:r,...o}=n??{};return this._client.getAPIList(N`/v1/skills/${t}/versions`,le,{query:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.delete(N`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var nc,kF=j(()=>{Se();wF();wF();De();Ne();gs();Me();nc=class extends Z{constructor(){super(...arguments),this.versions=new vf(this._client)}create(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/skills",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(N`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/skills",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(N`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}};nc.Versions=vf});var r7=j(()=>{yQ();oF();sF();aF();bF();vF();kF()});var $F,_F,VS,i7,SF,xF,Ot,no,EF=j(()=>{gr();hr();cp();Da();p_();m_();lp();WO();eM();Ah();kt();dp();G5();aQ();fQ();De();kM();r7();N_();sF();aF();vF();oF();bF();kF();p_();Ne();pp();Xi();hr();SF="\\n\\nHuman:",xF="\\n\\nAssistant:",Ot=class{get credentials(){return this._authState.provider}constructor({baseURL:t=ze("ANTHROPIC_BASE_URL"),apiKey:n,authToken:i,webhookKey:r=ze("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...o}={}){if($F.add(this),this._requestAuthFlags=new WeakMap,VS.set(this,void 0),n===void 0&&(n=o.profile!=null?null:ze("ANTHROPIC_API_KEY")??null),i===void 0&&(i=o.profile!=null?null:ze("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:n,authToken:i,webhookKey:r,...o,baseURL:t||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&b5())throw new J(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function qDe(e,t=e.messages.at(-1),n){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;let i=t.content.filter(s=>s.type==="tool_use");if(i.length===0)return null;let r=KDe(e);return{role:"user",content:await Promise.all(i.map(async s=>{let a=e.tools.find(c=>("name"in c?c.name:"mcp_server_name"in c?c.mcp_server_name:c.type)===s.name);if(!a||!("run"in a)||!r.has(s.name))return WDe(s);try{let c=s.input;"parse"in a&&a.parse&&(c=a.parse(c));let l=await a.run(c,{toolUse:s,toolUseBlock:s,signal:n?.signal});return{type:"tool_result",tool_use_id:s.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:s.id,content:c instanceof Ae?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function WDe(e){return{type:"tool_result",tool_use_id:e.id,content:`Error: Tool '${e.name}' not found`,is_error:!0}}function KDe(e){let t=new Set;for(let n of e.tools)"run"in n&&t.add(n.name);for(let n of e.messages)if(!(n.role!=="system"||typeof n.content=="string"))for(let i of n.content)HDe(i,t);return t}function HDe(e,t){switch(e.type){case"tool_removal":case"tool_addition":JDe(e,t);break}}function JDe(e,t){let n=ZDe(e.tool);n!==void 0&&(e.type==="tool_removal"?t.delete(n):t.add(n))}function ZDe(e){if(e.type==="tool_reference")return e.name}function YDe(e){if(e===null)return"stop";switch(e){case"tool_use":return"run_tools";case"pause_turn":case"compaction":return"resume";case"end_turn":case"stop_sequence":case"max_tokens":case"model_context_window_exceeded":case"refusal":return"stop";default:return"stop"}}var xy,Qp,Gl,Jt,jr,ti,bs,Qa,Ey,t7,ML,Xp,LL=j(()=>{fr();Rl();kt();Ce();QM();mr();e7();eo();Xp=class{constructor(t,n,i){xy.add(this),this.client=t,Qp.set(this,!1),Gl.set(this,!1),Jt.set(this,void 0),jr.set(this,void 0),ti.set(this,void 0),bs.set(this,void 0),Qa.set(this,void 0),Ey.set(this,0),M(this,Jt,{params:{...n,messages:structuredClone(n.messages)}},"f");let r=DM(n.tools,n.messages);M(this,jr,{...i,headers:I([Yh("BetaToolRunner"),r.length?{[Mo]:r.join(", ")}:void 0,i?.headers])},"f"),M(this,Qa,Op(),"f"),n.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Qp=new WeakMap,Gl=new WeakMap,Jt=new WeakMap,jr=new WeakMap,ti=new WeakMap,bs=new WeakMap,Qa=new WeakMap,Ey=new WeakMap,xy=new WeakSet,t7=async function(){let n=v(this,Jt,"f").params.compactionControl;if(!n||!n.enabled)return!1;let i=0;if(v(this,ti,"f")!==void 0)try{let l=await v(this,ti,"f");i=l.usage.input_tokens+(l.usage.cache_creation_input_tokens??0)+(l.usage.cache_read_input_tokens??0)+l.usage.output_tokens}catch{return!1}let r=n.contextTokenThreshold??1e5;if(id.type!=="tool_use");u.length===0?a.pop():l.content=u}}let c=await this.client.beta.messages.create({model:o,messages:[...a,{role:"user",content:[{type:"text",text:s}]}],max_tokens:v(this,Jt,"f").params.max_tokens},{signal:v(this,jr,"f").signal,headers:I([v(this,jr,"f").headers,Yh("compaction")])});if(c.content[0]?.type!=="text")throw new J("Expected text response for compaction");return v(this,Jt,"f").params.messages=[{role:"user",content:c.content}],!0},Symbol.asyncIterator)](){var t;if(v(this,Qp,"f"))throw new J("Cannot iterate over a consumed stream");M(this,Qp,!0,"f"),M(this,Gl,!0,"f"),M(this,bs,void 0,"f");try{for(;;){let n;try{if(v(this,Jt,"f").params.max_iterations&&v(this,Ey,"f")>=v(this,Jt,"f").params.max_iterations)break;M(this,Gl,!1,"f"),M(this,bs,void 0,"f"),M(this,Ey,(t=v(this,Ey,"f"),t++,t),"f"),M(this,ti,void 0,"f");let{max_iterations:i,compactionControl:r,...o}=v(this,Jt,"f").params;if(o.stream?(n=this.client.beta.messages.stream({...o},v(this,jr,"f")),M(this,ti,n.finalMessage(),"f"),v(this,ti,"f").catch(()=>{}),yield n):(M(this,ti,this.client.beta.messages.create({...o,stream:!1},v(this,jr,"f")),"f"),yield v(this,ti,"f")),!await v(this,xy,"m",t7).call(this)){if(!v(this,Gl,"f")){let c=await v(this,ti,"f"),l=YDe(c.stop_reason);v(this,Jt,"f").params.messages.push({role:c.role,content:c.content});let{container:u}=v(this,Jt,"f").params;if(c.container&&(u==null?v(this,Jt,"f").params.container=c.container.id:typeof u=="object"&&u.id==null&&(v(this,Jt,"f").params.container={...u,id:c.container.id})),l==="stop")break;if(l==="resume")continue}let a=await v(this,xy,"m",ML).call(this,v(this,Jt,"f").params.messages.at(-1));if(a)v(this,Jt,"f").params.messages.push(a);else if(!v(this,Gl,"f"))break}}finally{n&&n.abort()}}if(!v(this,ti,"f"))throw new J("ToolRunner concluded without a message from the server");v(this,Qa,"f").resolve(await v(this,ti,"f"))}catch(n){throw M(this,Qp,!1,"f"),v(this,Qa,"f").promise.catch(()=>{}),v(this,Qa,"f").reject(n),M(this,Qa,Op(),"f"),n}}setMessagesParams(t){typeof t=="function"?v(this,Jt,"f").params=t(v(this,Jt,"f").params):v(this,Jt,"f").params=t,M(this,Gl,!0,"f"),M(this,bs,void 0,"f")}setRequestOptions(t){typeof t=="function"?M(this,jr,t(v(this,jr,"f")),"f"):M(this,jr,{...v(this,jr,"f"),...t},"f")}async generateToolResponse(t=v(this,jr,"f").signal){let n=await v(this,ti,"f")??this.params.messages.at(-1);return n?v(this,xy,"m",ML).call(this,n,t):null}done(){return v(this,Qa,"f").promise}async runUntilDone(){if(!v(this,Qp,"f"))for await(let t of this);return this.done()}get params(){return v(this,Jt,"f").params}pushMessages(...t){this.setMessagesParams(n=>({...n,messages:[...n.messages,...t]}))}then(t,n){return this.runUntilDone().then(t,n)}};ML=async function(t,n=v(this,jr,"f").signal){return v(this,bs,"f")!==void 0?v(this,bs,"f"):(M(this,bs,qDe(v(this,Jt,"f").params,t,{...v(this,jr,"f"),signal:n}),"f"),v(this,bs,"f"))}});function r7(e){if(!e.output_format)return e;if(e.output_config?.format)throw new J("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var n7,QDe,vs,FL=j(()=>{Kp();$L();Se();SL();Ce();eo();TL();QX();LL();Rl();$L();LL();Rl();n7={},QDe=["claude-mythos-preview","claude-opus-4-6"],vs=class extends Z{constructor(){super(...arguments),this.batches=new Jp(this._client)}create(t,n){let i=r7(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;a.model in n7&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${n7[a.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),QDe.includes(a.model)&&a.thinking&&a.thinking.type==="enabled"&&console.warn(`Using Claude with ${a.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=n?.timeout??this._client._options.timeout;if(!a.stream&&c==null){let u=NS[a.model]??void 0;c=this._client.calculateNonstreamingTimeout(a.max_tokens,u)}let l=B$(a.tools,a.messages);return this._client.post("/v1/messages?beta=true",{body:a,timeout:c??6e5,...n,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},l,n?.headers]),stream:i.stream??!1})}parse(t,n){return n={...n,headers:I([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-12-15"].toString()},n?.headers])},this.create(t,n).then(i=>EL(i,t,{logger:this._client.logger??console}))}stream(t,n){return zS.createMessage(this,t,n)}countTokens(t,n){let i=r7(t),{betas:r,user_profile_id:o,workspace_id:s,...a}=i;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...n,headers:I([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString(),...o!=null?{"anthropic-user-profile-id":o}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},n?.headers])})}toolRunner(t,n){return new Xp(this._client,t,n)}};vs.Batches=Jp;vs.BetaToolRunner=Xp;vs.ToolError=Ae});var ef,UL=j(()=>{Se();Pe();Me();ef=class extends Z{retrieve(t,n){return this._client.get(R`/v1/organizations/api_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(R`/v1/organizations/api_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/api_keys?beta=true",dn,{query:t,...n})}}});var tf,jL=j(()=>{Se();tf=class extends Z{retrieve(t){return this._client.get("/v1/organizations/compliance_settings?beta=true",t)}update(t,n){return this._client.post("/v1/organizations/compliance_settings?beta=true",{body:t,...n})}}});var nf,zL=j(()=>{Se();Pe();Me();nf=class extends Z{create(t,n){return this._client.post("/v1/organizations/external_keys?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(R`/v1/organizations/external_keys/${t}?beta=true`,n)}update(t,n,i){return this._client.post(R`/v1/organizations/external_keys/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/external_keys?beta=true",le,{query:t,...n})}delete(t,n){return this._client.delete(R`/v1/organizations/external_keys/${t}?beta=true`,n)}validate(t,n){return this._client.post(R`/v1/organizations/external_keys/${t}/validate?beta=true`,n)}}});var rf,GL=j(()=>{Se();Pe();Me();rf=class extends Z{create(t,n){return this._client.post("/v1/organizations/invites?beta=true",{body:t,...n})}retrieve(t,n){return this._client.get(R`/v1/organizations/invites/${t}?beta=true`,n)}list(t={},n){return this._client.getAPIList("/v1/organizations/invites?beta=true",dn,{query:t,...n})}delete(t,n){return this._client.delete(R`/v1/organizations/invites/${t}?beta=true`,n)}}});var of,VL=j(()=>{Se();Pe();of=class extends Z{list(t={},n){return this._client.getAPIList("/v1/organizations/rate_limits?beta=true",le,{query:t,...n})}}});var sf,BL=j(()=>{Se();Pe();Me();sf=class extends Z{retrieve(t,n){return this._client.get(R`/v1/organizations/users/${t}?beta=true`,n)}update(t,n,i){return this._client.post(R`/v1/organizations/users/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/users?beta=true",dn,{query:t,...n})}remove(t,n){return this._client.delete(R`/v1/organizations/users/${t}?beta=true`,n)}}});var af,qL=j(()=>{Se();Pe();Ce();Me();af=class extends Z{create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_issuers?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(R`/v1/organizations/federation_issuers/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(R`/v1/organizations/federation_issuers/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_issuers?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(R`/v1/organizations/federation_issuers/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}}});var cf,WL=j(()=>{Se();Pe();Ce();Me();cf=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(R`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(R`/v1/organizations/federation_rules/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{federation_rule_id:r,betas:o}=n;return this._client.delete(R`/v1/organizations/federation_rules/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var Vl,KL=j(()=>{Se();WL();WL();Pe();Ce();Me();Vl=class extends Z{constructor(){super(...arguments),this.workspaces=new cf(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/federation_rules?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(R`/v1/organizations/federation_rules/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(R`/v1/organizations/federation_rules/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/federation_rules?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(R`/v1/organizations/federation_rules/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};Vl.Workspaces=cf});var Xa,HL=j(()=>{Se();qL();qL();KL();KL();Xa=class extends Z{constructor(){super(...arguments),this.issuers=new af(this._client),this.rules=new Vl(this._client)}};Xa.Issuers=af;Xa.Rules=Vl});var lf,JL=j(()=>{Se();Pe();Ce();Me();lf=class extends Z{list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(R`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(R`/v1/organizations/service_accounts/${t}/workspaces?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{service_account_id:r,betas:o}=n;return this._client.delete(R`/v1/organizations/service_accounts/${r}/workspaces/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var Bl,ZL=j(()=>{Se();JL();JL();Pe();Ce();Me();Bl=class extends Z{constructor(){super(...arguments),this.workspaces=new lf(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/service_accounts?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r}=n??{};return this._client.get(R`/v1/organizations/service_accounts/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}update(t,n,i){let{betas:r,...o}=n;return this._client.post(R`/v1/organizations/service_accounts/${t}?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}list(t={},n){let{betas:i,...r}=t??{};return this._client.getAPIList("/v1/organizations/service_accounts?beta=true",le,{query:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r}=n??{};return this._client.post(R`/v1/organizations/service_accounts/${t}/archive?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}};Bl.Workspaces=lf});var uf,YL=j(()=>{Se();Pe();Me();uf=class extends Z{retrieve(t,n,i){let{workspace_id:r}=n;return this._client.get(R`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}update(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(R`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,{body:o,...i})}list(t,n={},i){return this._client.getAPIList(R`/v1/organizations/workspaces/${t}/members?beta=true`,dn,{query:n,...i})}add(t,n,i){return this._client.post(R`/v1/organizations/workspaces/${t}/members?beta=true`,{body:n,...i})}remove(t,n,i){let{workspace_id:r}=n;return this._client.delete(R`/v1/organizations/workspaces/${r}/members/${t}?beta=true`,i)}}});var df,QL=j(()=>{Se();Pe();Me();df=class extends Z{list(t,n={},i){return this._client.getAPIList(R`/v1/organizations/workspaces/${t}/rate_limits?beta=true`,le,{query:n,...i})}}});var pf,XL=j(()=>{Se();Pe();Ce();Me();pf=class extends Z{retrieve(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.get(R`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}update(t,n,i){let{workspace_id:r,betas:o,...s}=n;return this._client.post(R`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{body:s,...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,...o}=n??{};return this._client.getAPIList(R`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,le,{query:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}add(t,n,i){let{betas:r,...o}=n;return this._client.post(R`/v1/organizations/workspaces/${t}/service_accounts?beta=true`,{body:o,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},i?.headers])})}remove(t,n,i){let{workspace_id:r,betas:o}=n;return this._client.delete(R`/v1/organizations/workspaces/${r}/service_accounts/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},i?.headers])})}}});var ws,eF=j(()=>{Se();YL();YL();QL();QL();XL();XL();Pe();Ce();Me();ws=class extends Z{constructor(){super(...arguments),this.rateLimits=new df(this._client),this.members=new uf(this._client),this.serviceAccounts=new pf(this._client)}create(t,n){let{betas:i,...r}=t;return this._client.post("/v1/organizations/workspaces?beta=true",{body:r,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}retrieve(t,n){return this._client.get(R`/v1/organizations/workspaces/${t}?beta=true`,n)}update(t,n,i){return this._client.post(R`/v1/organizations/workspaces/${t}?beta=true`,{body:n,...i})}list(t={},n){return this._client.getAPIList("/v1/organizations/workspaces?beta=true",dn,{query:t,...n})}archive(t,n){return this._client.post(R`/v1/organizations/workspaces/${t}/archive?beta=true`,n)}};ws.RateLimits=df;ws.Members=uf;ws.ServiceAccounts=pf});var yr,tF=j(()=>{Se();UL();UL();jL();jL();zL();zL();GL();GL();VL();VL();BL();BL();HL();HL();ZL();ZL();eF();eF();yr=class extends Z{constructor(){super(...arguments),this.apiKeys=new ef(this._client),this.externalKeys=new nf(this._client),this.federation=new Xa(this._client),this.invites=new rf(this._client),this.serviceAccounts=new Bl(this._client),this.users=new sf(this._client),this.workspaces=new ws(this._client),this.rateLimits=new of(this._client),this.complianceSettings=new tf(this._client)}retrieve(t){return this._client.get("/v1/organizations/me?beta=true",t)}};yr.APIKeys=ef;yr.ExternalKeys=nf;yr.Federation=Xa;yr.Invites=rf;yr.ServiceAccounts=Bl;yr.Users=sf;yr.Workspaces=ws;yr.RateLimits=of;yr.ComplianceSettings=tf});var ql,nF=j(()=>{Se();Pe();Ce();Me();fS();fS();ql=class extends Z{list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/sessions/${t}/events?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}send(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/sessions/${t}/events?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}stream(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.get(R`/v1/sessions/${t}/events/stream?beta=true`,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0})}toolRunner(t,n){return new Ba(t,{...n,client:this._client})}};ql.SessionToolRunner=Ba});var ff,rF=j(()=>{Se();Pe();Ce();Me();ff=class extends Z{retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(R`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(R`/v1/sessions/${r}/resources/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/sessions/${t}/resources?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.delete(R`/v1/sessions/${r}/resources/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}add(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/sessions/${t}/resources?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var mf,iF=j(()=>{Se();Pe();Ce();Me();mf=class extends Z{list(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.getAPIList(R`/v1/sessions/${r}/threads/${t}/events?beta=true`,le,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}stream(t,n,i){let{session_id:r,betas:o,workspace_id:s,...a}=n;return this._client.get(R`/v1/sessions/${r}/threads/${t}/stream?beta=true`,{query:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),stream:!0})}}});var Wl,oF=j(()=>{Se();iF();iF();Pe();Ce();Me();Wl=class extends Z{constructor(){super(...arguments),this.events=new mf(this._client)}retrieve(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.get(R`/v1/sessions/${r}/threads/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/sessions/${t}/threads?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{session_id:r,betas:o,workspace_id:s}=n;return this._client.post(R`/v1/sessions/${r}/threads/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}};Wl.Events=mf});var ks,sF=j(()=>{Se();nF();nF();rF();rF();oF();oF();Pe();Ce();Me();ks=class extends Z{constructor(){super(...arguments),this.events=new ql(this._client),this.resources=new ff(this._client),this.threads=new Wl(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/sessions?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/sessions/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/sessions?beta=true",j$,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(R`/v1/sessions/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/sessions/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};ks.Events=ql;ks.Resources=ff;ks.Threads=Wl});var gf,aF=j(()=>{Se();Pe();Ce();gs();Me();gf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/skills/${t}/versions?beta=true`,xi({body:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(R`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/skills/${t}/versions?beta=true`,le,{query:s,...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.delete(R`/v1/skills/${r}/versions/${t}?beta=true`,{...i,headers:I([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}download(t,n,i){let{skill_id:r,betas:o,workspace_id:s}=n;return this._client.get(R`/v1/skills/${r}/versions/${t}/content?beta=true`,{...i,headers:I([{Accept:"application/binary",...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0,...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers]),__binaryResponse:!0})}}});var Kl,cF=j(()=>{Se();aF();aF();Pe();Ce();gs();Me();Kl=class extends Z{constructor(){super(...arguments),this.versions=new gf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/skills?beta=true",xi({body:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/skills?beta=true",le,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(R`/v1/skills/${t}?beta=true`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Kl.Versions=gf});var hf,lF=j(()=>{Se();Pe();Ce();Me();hf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/tunnels/${t}/certificates?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.get(R`/v1/tunnels/${r}/certificates/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/tunnels/${t}/certificates?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n,i){let{tunnel_id:r,betas:o,workspace_id:s}=n;return this._client.post(R`/v1/tunnels/${r}/certificates/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Hl,uF=j(()=>{Se();lF();lF();Pe();Ce();Me();Hl=class extends Z{constructor(){super(...arguments),this.certificates=new hf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/tunnels?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/tunnels/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/tunnels?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"mcp-tunnels-2026-06-22"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/tunnels/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}revealToken(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/tunnels/${t}/reveal_token?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}rotateToken(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/tunnels/${t}/rotate_token?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Hl.Certificates=hf});var yf,dF=j(()=>{Se();Pe();Ce();Me();yf=class extends Z{create(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/vaults/${t}/credentials?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}retrieve(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.get(R`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}update(t,n,i){let{vault_id:r,betas:o,workspace_id:s,...a}=n;return this._client.post(R`/v1/vaults/${r}/credentials/${t}?beta=true`,{body:a,...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}list(t,n={},i){let{betas:r,workspace_id:o,...s}=n??{};return this._client.getAPIList(R`/v1/vaults/${t}/credentials?beta=true`,le,{query:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}delete(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.delete(R`/v1/vaults/${r}/credentials/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}archive(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(R`/v1/vaults/${r}/credentials/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}mcpOAuthValidate(t,n,i){let{vault_id:r,betas:o,workspace_id:s}=n;return this._client.post(R`/v1/vaults/${r}/credentials/${t}/mcp_oauth_validate?beta=true`,{...i,headers:I([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"anthropic-workspace-id":s}:void 0},i?.headers])})}}});var Jl,pF=j(()=>{Se();dF();dF();Pe();Ce();Me();Jl=class extends Z{constructor(){super(...arguments),this.credentials=new yf(this._client)}create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/vaults?beta=true",{body:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}update(t,n,i){let{betas:r,workspace_id:o,...s}=n;return this._client.post(R`/v1/vaults/${t}?beta=true`,{body:s,...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/vaults?beta=true",le,{query:o,...n,headers:I([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString(),...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}delete(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.delete(R`/v1/vaults/${t}?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}archive(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.post(R`/v1/vaults/${t}/archive?beta=true`,{...i,headers:I([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}};Jl.Credentials=yf});var jt,fF=j(()=>{Se();CM();CM();NM();NM();PM();PM();OM();OM();MM();MM();LM();LM();zM();zM();VM();VM();bL();bL();kL();kL();FL();FL();tF();tF();sF();sF();cF();cF();uF();uF();pF();pF();jt=class extends Z{constructor(){super(...arguments),this.models=new vp(this._client),this.messages=new vs(this._client),this.agents=new Al(this._client),this.environments=new jl(this._client),this.sessions=new ks(this._client),this.deployments=new hp(this._client),this.deploymentRuns=new gp(this._client),this.vaults=new Jl(this._client),this.memoryStores=new Ja(this._client),this.files=new bp(this._client),this.skills=new Kl(this._client),this.webhooks=new _p(this._client),this.userProfiles=new wp(this._client),this.dreams=new yp(this._client),this.tunnels=new Hl(this._client),this.organization=new yr(this._client)}};jt.Models=vp;jt.Messages=vs;jt.Agents=Al;jt.Environments=jl;jt.Sessions=ks;jt.Deployments=hp;jt.DeploymentRuns=gp;jt.Vaults=Jl;jt.MemoryStores=Ja;jt.Files=bp;jt.Skills=Kl;jt.Webhooks=_p;jt.UserProfiles=wp;jt.Dreams=yp;jt.Tunnels=Hl;jt.Organization=yr});var Zl,mF=j(()=>{Se();Ce();Zl=class extends Z{create(t,n){let{betas:i,workspace_id:r,...o}=t;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers]),stream:t.stream??!1})}}});var Yl,gF=j(()=>{Se();Pe();Ce();eo();gs();Me();Yl=class extends Z{list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/files",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(R`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}download(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(R`/v1/files/${t}/content`,{...i,headers:I([{Accept:"application/binary",...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(R`/v1/files/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}upload(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/files",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},q$(r.file),n?.headers])},this._client))}}});function i7(e){return e?.output_config?.format}function hF(e,t,n){let i=i7(t);return!t||!("parse"in(i??{}))?{...e,content:e.content.map(r=>r.type==="text"?Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1}):r),parsed_output:null}:yF(e,t,n)}function yF(e,t,n){let i=null,r=e.content.map(o=>{if(o.type==="text"){let s=IOe(t,o.text);return i===null&&(i=s),Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1})}return o});return{...e,content:r,parsed_output:i}}function IOe(e,t){let n=i7(e);if(n?.type!=="json_schema")return null;try{return"parse"in n?n.parse(t):JSON.parse(t)}catch(i){throw new J(`Failed to parse structured output: ${i}`)}}var bF=j(()=>{kt()});function SF(e){return e.type==="tool_use"||e.type==="server_tool_use"}var Ri,ec,bf,Ty,GS,Iy,Ay,VS,Ry,Fo,Cy,BS,qS,Ql,WS,KS,HS,Ny,vF,o7,wF,kF,_F,$F,s7,JS,a7=j(()=>{fr();eo();Da();mr();Kp();IL();bF();AL();JS=class e{constructor(t,n){Ri.add(this),this.messages=[],this.receivedMessages=[],ec.set(this,void 0),bf.set(this,null),this.controller=new AbortController,Ty.set(this,void 0),GS.set(this,()=>{}),Iy.set(this,()=>{}),Ay.set(this,void 0),VS.set(this,()=>{}),Ry.set(this,()=>{}),Fo.set(this,{}),Cy.set(this,!1),BS.set(this,!1),qS.set(this,!1),Ql.set(this,!1),WS.set(this,void 0),KS.set(this,void 0),HS.set(this,void 0),Ny.set(this,void 0),wF.set(this,i=>{if(M(this,BS,!0,"f"),Zr(i)&&(i=new En),i instanceof En)return M(this,qS,!0,"f"),this._emit("abort",i);if(i instanceof J)return this._emit("error",i);if(i instanceof Error){let r=new J(i.message);return r.cause=i,this._emit("error",r)}return this._emit("error",new J(String(i)))}),M(this,Ty,new Promise((i,r)=>{M(this,GS,i,"f"),M(this,Iy,r,"f")}),"f"),M(this,Ay,new Promise((i,r)=>{M(this,VS,i,"f"),M(this,Ry,r,"f")}),"f"),v(this,Ty,"f").catch(()=>{}),v(this,Ay,"f").catch(()=>{}),M(this,bf,t,"f"),M(this,Ny,n?.logger??console,"f")}get response(){return v(this,WS,"f")}get request_id(){return v(this,KS,"f")}get workspace_id(){return v(this,HS,"f")}async withResponse(){M(this,Ql,!0,"f");let t=await v(this,Ty,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id"),workspace_id:t.headers.get("anthropic-workspace-id")}}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,i,{logger:r}={}){let o=new e(n,{logger:r});for(let s of n.messages)o._addMessageParam(s);return M(o,bf,{...n,stream:!0},"f"),o._run(()=>o._createMessage(t,{...n,stream:!0},{...i,headers:{...i?.headers,[V$]:"stream"}})),o}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},v(this,wF,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,i){let r=i?.signal,o;r&&(r.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o));try{v(this,Ri,"m",kF).call(this);let{response:s,data:a}=await t.create({...n,stream:!0},{...i,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)v(this,Ri,"m",_F).call(this,c);if(a.controller.signal?.aborted)throw new En;v(this,Ri,"m",$F).call(this)}finally{r&&o&&r.removeEventListener("abort",o)}}_connected(t){this.ended||(M(this,WS,t,"f"),M(this,KS,t?.headers.get("request-id"),"f"),M(this,HS,t?.headers.get("anthropic-workspace-id"),"f"),v(this,GS,"f").call(this,t),this._emit("connect"))}get ended(){return v(this,Cy,"f")}get errored(){return v(this,BS,"f")}get aborted(){return v(this,qS,"f")}abort(){this.controller.abort()}on(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n}),this}off(t,n){let i=v(this,Fo,"f")[t];if(!i)return this;let r=i.findIndex(o=>o.listener===n);return r>=0&&i.splice(r,1),this}once(t,n){return(v(this,Fo,"f")[t]||(v(this,Fo,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,i)=>{M(this,Ql,!0,"f"),t!=="error"&&this.once("error",i),this.once(t,n)})}async done(){M(this,Ql,!0,"f"),await v(this,Ay,"f")}get currentMessage(){return v(this,ec,"f")}async finalMessage(){return await this.done(),v(this,Ri,"m",vF).call(this)}async finalText(){return await this.done(),v(this,Ri,"m",o7).call(this)}_emit(t,...n){if(v(this,Cy,"f"))return;t==="end"&&(M(this,Cy,!0,"f"),v(this,VS,"f").call(this));let i=v(this,Fo,"f")[t];if(i&&(v(this,Fo,"f")[t]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...n))),t==="abort"){let r=n[0];!v(this,Ql,"f")&&!i?.length&&Promise.reject(r),v(this,Iy,"f").call(this,r),v(this,Ry,"f").call(this,r),this._emit("end");return}if(t==="error"){let r=n[0];!v(this,Ql,"f")&&!i?.length&&Promise.reject(r),v(this,Iy,"f").call(this,r),v(this,Ry,"f").call(this,r),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",v(this,Ri,"m",vF).call(this))}async _fromReadableStream(t,n){let i=n?.signal,r;i&&(i.aborted&&this.controller.abort(),r=this.controller.abort.bind(this.controller),i.addEventListener("abort",r));try{v(this,Ri,"m",kF).call(this),this._connected(null);let o=Lr.fromReadableStream(t,this.controller);for await(let s of o)v(this,Ri,"m",_F).call(this,s);if(o.controller.signal?.aborted)throw new En;v(this,Ri,"m",$F).call(this)}finally{i&&r&&i.removeEventListener("abort",r)}}[(ec=new WeakMap,bf=new WeakMap,Ty=new WeakMap,GS=new WeakMap,Iy=new WeakMap,Ay=new WeakMap,VS=new WeakMap,Ry=new WeakMap,Fo=new WeakMap,Cy=new WeakMap,BS=new WeakMap,qS=new WeakMap,Ql=new WeakMap,WS=new WeakMap,KS=new WeakMap,HS=new WeakMap,Ny=new WeakMap,wF=new WeakMap,Ri=new WeakSet,vF=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},o7=function(){if(this.receivedMessages.length===0)throw new J("stream ended without producing a Message with role=assistant");let n=this.receivedMessages.at(-1).content.filter(i=>i.type==="text").map(i=>i.text);if(n.length===0)throw new J("stream ended without producing a content block with type=text");return n.join(" ")},kF=function(){this.ended||M(this,ec,void 0,"f")},_F=function(n){if(this.ended)return;let i=v(this,Ri,"m",s7).call(this,n);switch(this._emit("streamEvent",n,i),n.type){case"content_block_delta":{let r=i.content.at(-1);switch(n.delta.type){case"text_delta":{r.type==="text"&&this._emit("text",n.delta.text,r.text||"");break}case"citations_delta":{r.type==="text"&&this._emit("citation",n.delta.citation,r.citations??[]);break}case"input_json_delta":{SF(r)&&v(this,Fo,"f").inputJson?.length&&this._emit("inputJson",n.delta.partial_json,r.input);break}case"thinking_delta":{r.type==="thinking"&&this._emit("thinking",n.delta.thinking,r.thinking);break}case"signature_delta":{r.type==="thinking"&&this._emit("signature",r.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(i),this._addMessage(hF(i,v(this,bf,"f"),{logger:v(this,Ny,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",i.content.at(-1));break}case"message_start":{M(this,ec,i,"f");break}case"content_block_start":case"message_delta":break}},$F=function(){if(this.ended)throw new J("stream has ended, this shouldn't happen");let n=v(this,ec,"f");if(!n)throw new J("request ended without sending any chunks");return M(this,ec,void 0,"f"),hF(n,v(this,bf,"f"),{logger:v(this,Ny,"f")})},s7=function(n){let i=v(this,ec,"f");if(n.type==="message_start"){if(i)throw new J(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!i)throw new J(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return i;case"message_delta":return i.stop_reason=n.delta.stop_reason,i.stop_sequence=n.delta.stop_sequence,i.stop_details=n.delta.stop_details,i.usage.output_tokens=n.usage.output_tokens,n.delta.container!=null&&(i.container=n.delta.container),n.usage.input_tokens!=null&&(i.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(i.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(i.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(i.usage.server_tool_use=n.usage.server_tool_use),n.usage.output_tokens_details!=null&&(i.usage.output_tokens_details=n.usage.output_tokens_details),i;case"content_block_start":return i.content.push({...n.content_block}),i;case"content_block_delta":{let r=i.content.at(n.index);switch(n.delta.type){case"text_delta":{r?.type==="text"&&(i.content[n.index]={...r,text:(r.text||"")+n.delta.text});break}case"citations_delta":{r?.type==="text"&&(i.content[n.index]={...r,citations:[...r.citations??[],n.delta.citation]});break}case"input_json_delta":{if(r&&SF(r)){let o=(r[Za]||"")+n.delta.partial_json;i.content[n.index]=PS(r,o)}break}case"thinking_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,thinking:r.thinking+n.delta.thinking});break}case"signature_delta":{r?.type==="thinking"&&(i.content[n.index]={...r,signature:n.delta.signature});break}default:n.delta}return i}case"content_block_stop":{let r=i.content.at(n.index);return r&&SF(r)&&Za in r&&Object.defineProperty(r,"input",{value:r.input,enumerable:!0,configurable:!0,writable:!0}),i}}},Symbol.asyncIterator)](){let t=[],n=[],i=!1;return this.on("streamEvent",r=>{let o=n.shift();o?o.resolve(r):t.push(r)}),this.on("end",()=>{i=!0;for(let r of n)r.resolve(void 0);n.length=0}),this.on("abort",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),this.on("error",r=>{i=!0;for(let o of n)o.reject(r);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((o,s)=>n.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Lr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var vf,xF=j(()=>{Se();Pe();Ce();_L();Kp();Me();vf=class extends Z{create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/batches",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(R`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/messages/batches",dn,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(R`/v1/messages/batches/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}cancel(t,n={},i){let{workspace_id:r}=n??{};return this._client.post(R`/v1/messages/batches/${t}/cancel`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}async results(t,n={},i){let r=await this.retrieve(t,n,i);if(!r.results_url)throw new J(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{workspace_id:o}=n??{};return this._client.get(r.results_url,{...i,headers:I([{Accept:"application/binary",...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>Hp.fromResponse(a.response,a.controller))}}});var tc,c7,ROe,EF=j(()=>{Se();Ce();eo();a7();bF();xF();xF();SL();tc=class extends Z{constructor(){super(...arguments),this.batches=new vf(this._client)}create(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;o.model in c7&&console.warn(`The model '${o.model}' is deprecated and will reach end-of-life on ${c7[o.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),ROe.includes(o.model)&&o.thinking&&o.thinking.type==="enabled"&&console.warn(`Using Claude with ${o.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let s=n?.timeout??this._client._options.timeout;if(!o.stream&&s==null){let c=NS[o.model]??void 0;s=this._client.calculateNonstreamingTimeout(o.max_tokens,c)}let a=B$(o.tools,o.messages);return this._client.post("/v1/messages",{body:o,timeout:s??6e5,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},a,n?.headers]),stream:t.stream??!1})}parse(t,n){return this.create(t,n).then(i=>yF(i,t,{logger:this._client.logger??console}))}stream(t,n){return JS.createMessage(this,t,n,{logger:this._client.logger??console})}countTokens(t,n){let{user_profile_id:i,workspace_id:r,...o}=t;return this._client.post("/v1/messages/count_tokens",{body:o,...n,headers:I([{...i!=null?{"anthropic-user-profile-id":i}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}},c7={},ROe=["claude-mythos-preview","claude-opus-4-6"];tc.Batches=vf});var Xl,TF=j(()=>{Se();Pe();Ce();Me();Xl=class extends Z{retrieve(t,n={},i){let{betas:r,workspace_id:o}=n??{};return this._client.get(R`/v1/models/${t}`,{...i,headers:I([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t={},n){let{betas:i,workspace_id:r,...o}=t??{};return this._client.getAPIList("/v1/models",dn,{query:o,...n,headers:I([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0,...r!=null?{"anthropic-workspace-id":r}:void 0},n?.headers])})}}});var wf,IF=j(()=>{Se();Pe();Ce();gs();Me();wf=class extends Z{create(t,n,i){let{workspace_id:r,...o}=n;return this._client.post(R`/v1/skills/${t}/versions`,xi({body:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])},this._client,!1))}retrieve(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.get(R`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}list(t,n={},i){let{workspace_id:r,...o}=n??{};return this._client.getAPIList(R`/v1/skills/${t}/versions`,le,{query:o,...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}delete(t,n,i){let{skill_id:r,workspace_id:o}=n;return this._client.delete(R`/v1/skills/${r}/versions/${t}`,{...i,headers:I([{...o!=null?{"anthropic-workspace-id":o}:void 0},i?.headers])})}}});var nc,AF=j(()=>{Se();IF();IF();Pe();Ce();gs();Me();nc=class extends Z{constructor(){super(...arguments),this.versions=new wf(this._client)}create(t,n){let{workspace_id:i,...r}=t;return this._client.post("/v1/skills",xi({body:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])},this._client,!1))}retrieve(t,n={},i){let{workspace_id:r}=n??{};return this._client.get(R`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}list(t={},n){let{workspace_id:i,...r}=t??{};return this._client.getAPIList("/v1/skills",le,{query:r,...n,headers:I([{...i!=null?{"anthropic-workspace-id":i}:void 0},n?.headers])})}delete(t,n={},i){let{workspace_id:r}=n??{};return this._client.delete(R`/v1/skills/${t}`,{...i,headers:I([{...r!=null?{"anthropic-workspace-id":r}:void 0},i?.headers])})}};nc.Versions=wf});var l7=j(()=>{$Q();fF();mF();gF();EF();TF();AF()});var RF,CF,ZS,u7,NF,PF,Ot,no,DF=j(()=>{fr();mr();lp();Da();v$();k$();up();eM();cM();Mh();kt();pp();H5();fQ();vQ();Pe();AM();l7();F$();mF();gF();TF();fF();EF();AF();v$();Ce();fp();Xi();mr();NF="\\n\\nHuman:",PF="\\n\\nAssistant:",Ot=class{get credentials(){return this._authState.provider}constructor({baseURL:t=ze("ANTHROPIC_BASE_URL"),apiKey:n,authToken:i,webhookKey:r=ze("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...o}={}){if(RF.add(this),this._requestAuthFlags=new WeakMap,ZS.set(this,void 0),n===void 0&&(n=o.profile!=null?null:ze("ANTHROPIC_API_KEY")??null),i===void 0&&(i=o.profile!=null?null:ze("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:n,authToken:i,webhookKey:r,...o,baseURL:t||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&S5())throw new J(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!t,this.timeout=s.timeout??_F.DEFAULT_TIMEOUT,this.logger=s.logger??console,this.logLevel=Oh,this.logLevel=E_(s.logLevel,"ClientOptions.logLevel",qe(this))??E_(ze("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",qe(this))??Oh,this.fetchOptions=s.fetchOptions,this.maxRetries=d_("maxRetries",s.maxRetries??2),this.fetch=s.fetch??$5(),M(this,VS,S5,"f"),this.middleware=[...s.middleware??[]];let a=ze("ANTHROPIC_CUSTOM_HEADERS");if(a){let l={};for(let u of a.split(` -`)){let d=u.indexOf(":");d>=0&&(l[u.substring(0,d).trim()]=u.substring(d+1).trim())}s.defaultHeaders={...l,...s.defaultHeaders}}let c=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof n=="string"?n:null,this.authToken=i,this.webhookKey=r,c)this._authState=c,!this._baseURLIsExplicit&&c.baseURL&&(this.baseURL=c.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let l=s.credentials??null;if(l)this._authState.provider=l,this._authState.tokenCache=this._makeTokenCache(l);else if(s.config!=null){let u=pM(s.config,this._credentialResolverOptions());this._authState.provider=u.provider,this._authState.tokenCache=this._makeTokenCache(u.provider),this._authState.extraHeaders=u.extraHeaders,this._applyCredentialBaseURL(u.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(t){if(!t)return;let n=t.replace(/\/+$/,"");this._authState.baseURL=n,this._baseURLIsExplicit||(this.baseURL=n)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:t=>{qe(this).debug("credential cache write failed (best-effort)",t)},onSafetyWarning:t=>{qe(this).warn(t)}}}_credentialsFetch(){return hM(this.fetch,this.middleware,void 0,this)}_makeTokenCache(t){return new __(t,n=>{qe(this).debug("advisory token refresh failed; serving cached token",n)})}withOptions(t){let n="credentials"in t||"config"in t||"profile"in t,i="apiKey"in t||"authToken"in t||n,r={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...n?{credentials:void 0,config:void 0,profile:void 0}:{},...t,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in t?!0:this._baseURLIsExplicit};return new this.constructor(r)}async _resolveDefaultCredentials(t){try{let n=await sQ(this._credentialResolverOptions(),t);if(n)this._authState.provider=n.provider,this._authState.tokenCache=this._makeTokenCache(n.provider),this._authState.extraHeaders=n.extraHeaders,this._applyCredentialBaseURL(n.baseURL);else if(t!=null)throw new J(`Profile "${t}" could not be resolved (no /configs/${t}.json found).`)}catch(n){this._authState.error=n}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(t.get("x-api-key")||t.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&t.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(t){let n=this._requestAuthFlags.get(t);return n||(n={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(t,n)),n}async authHeaders(t){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let n=await this._authState.tokenCache.getToken();return this._authFlags(t).usedTokenCache=!0,I([{Authorization:`Bearer ${n}`}])}return I([await this.apiKeyAuth(t),await this.bearerAuth(t)])}}async apiKeyAuth(t){if(this.apiKey!=null)return I([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return I([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return O5(t)}getUserAgent(){return`Anthropic/JS ${Si}`}makeStatusError(t,n,i,r){return Dt.generate(t,n,i,r)}buildURL(t,n,i){let r=!v(this,$F,"m",i7).call(this)&&i||this.baseURL,o=f5(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery(),a=Object.fromEntries(o.searchParams);return(!VO(s)||!VO(a))&&(n={...a,...s,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(o.search=this.stringifyQuery(n)),o.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(t){}async prepareRequest(t,{url:n,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let r=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[s,a]of Object.entries(this._authState.extraHeaders))r.has(s)||r.set(s,a);r.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(_l)||r.append("anthropic-beta",_l),t.headers=r}}backendMiddleware(){return[]}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,i){return this.request(Promise.resolve(i).then(r=>({method:t,path:n,...r})))}request(t,n=null){return new La(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,i){let r=await t,o=d_("maxRetries",r.maxRetries??this.maxRetries);n==null&&(n=o,this._requestAuthFlags.delete(r)),await this.prepareOptions(r);let{req:s,url:a,timeout:c}=await this.buildRequest(r,{retryCount:o-n}),l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=i===void 0?"":`, retryOf: ${i}`,d=Date.now();if(r.signal?.aborted)throw new In;let p=new AbortController,f=await this.fetchWithTimeout(a,s,c,p,r,{requestLogID:l,retryOfRequestLogID:i}).catch(pl),m=Date.now();if(f instanceof globalThis.Error){Co(p);let b=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new In;let y=Yr(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):"")),w=this.middleware.length>0||!!r.middleware?.length||this.backendMiddleware().length>0;if(w&&!y&&!pQ(f))throw qe(this).info(`[${l}] middleware error (not retryable)`),qe(this).debug(`[${l}] middleware error (not retryable)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),f;if(n)return qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - ${b}`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (${b})`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),this.retryRequest(r,n,i??l);throw qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - error; no more retries left`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (error; no more retries left)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),y?new fl:w&&!gM(f)?f:new Zi({cause:f})}let g=[...f.headers.entries()].filter(([b])=>b==="request-id"||b==="anthropic-workspace-id").map(([b,y])=>", "+b+": "+JSON.stringify(y)).join(""),h=`[${l}${u}${g}] ${s.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${m-d}ms`;if(!f.ok){let b=await this.shouldRetry(f,r);if(n&&b){let x=`retrying, ${n} attempts remaining`;return await _5(f.body),Co(p),qe(this).info(`${h} - ${x}`),qe(this).debug(`[${l}] response error (${x})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),this.retryRequest(r,n,i??l,f.headers)}let y=b?"error; no more retries left":"error; not retryable";qe(this).info(`${h} - ${y}`);let w=await f.text().catch(x=>pl(x).message),k=$l(w),_=k?void 0:w;throw qe(this).debug(`[${l}] response error (${y})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,message:_,durationMs:Date.now()-d})),Co(p),this.makeStatusError(f.status,k,_,f.headers)}return qe(this).info(h),qe(this).debug(`[${l}] response start`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),k5(f.body??f,p),{response:f,options:r,controller:p,requestLogID:l,retryOfRequestLogID:i,startTime:d}}getAPIList(t,n,i){return this.requestAPIList(n,i&&"then"in i?i.then(r=>({method:"get",path:t,...r})):{method:"get",path:t,...i})}requestAPIList(t,n){let i=this.makeRequest(n,null,void 0);return new fp(this,i,t)}async fetchWithTimeout(t,n,i,r,o,s){let{signal:a,method:c,...l}=n||{},u=this._makeAbort(r);a&&(a.addEventListener("abort",u,{once:!0}),w5(r,a,u));let d=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,p={signal:r.signal,...d?{duplex:"half"}:{},method:"GET",...l};c&&(p.method=c.toUpperCase());let f=this.fetch,m=async(w,k)=>{let _=setTimeout(u,i);try{return await f.call(void 0,w,k)}finally{clearTimeout(_)}},g=o===void 0?m:(async(w,k={})=>{let _=typeof w=="string"?w:w instanceof URL?w.href:w.url;return k.headers=k.headers instanceof Headers?k.headers:new Headers(k.headers),await this.prepareRequest(k,{url:_,options:o}),s&&qe(this).debug(`[${s.requestLogID}] sending request`,Oo({retryOfRequestLogID:s.retryOfRequestLogID,method:k.method,url:_,options:o,headers:k.headers})),m(w,k)}),h=o?.middleware,b=this.backendMiddleware(),y=h?.length||b.length?[...this.middleware,...h??[],...b]:this.middleware;return await hM(g,y,o,this)(t,p)}async shouldRetry(t,n){let i=this._authFlags(n);if(t.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,i,r){let o,s=r?.get("retry-after-ms");if(s){let c=parseFloat(s);Number.isNaN(c)||(o=c)}let a=r?.get("retry-after");if(a&&!o){let c=parseFloat(a);Number.isNaN(c)?o=Date.parse(a)-Date.now():o=c*1e3}if(o===void 0||!(o>0&&o<=2**31-1)){let c=t.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(n,c)}return await Yi(o),this.makeRequest(t,n-1,i)}calculateDefaultRetryTimeoutMillis(t,n){let o=n-t,s=Math.min(.5*Math.pow(2,o),8),a=1-Math.random()*.25;return s*a*1e3}calculateNonstreamingTimeout(t,n){if(36e5*t/128e3>6e5||n!=null&&t>n)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:n=0}={}){let i={...t},{method:r,path:o,query:s,defaultBaseURL:a}=i;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let c=this.buildURL(o,s,a);"timeout"in i&&d_("timeout",i.timeout),i.timeout=i.timeout??this.timeout;let{bodyHeaders:l,body:u}=this.buildBody({options:i}),d=await this.buildHeaders({options:t,method:r,bodyHeaders:l,retryCount:n});return{req:{method:r,headers:d,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...i.fetchOptions??{}},url:c,timeout:i.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:i,retryCount:r}){let o=I([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...Rh(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,i,t.headers]);return this.validateHeaders(o),o.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};let i=I([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&i.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:g_(t)}:typeof t=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:v(this,VS,"f").call(this,{body:t,headers:i})}};_F=Ot,VS=new WeakMap,$F=new WeakSet,i7=function(){return this.baseURL!=="https://api.anthropic.com"};Ot.Anthropic=_F;Ot.HUMAN_PROMPT=SF;Ot.AI_PROMPT=xF;Ot.DEFAULT_TIMEOUT=6e5;Ot.AnthropicError=J;Ot.APIError=Dt;Ot.APIConnectionError=Zi;Ot.APIConnectionTimeoutError=fl;Ot.APIUserAbortError=In;Ot.NotFoundError=yl;Ot.ConflictError=bl;Ot.RateLimitError=wl;Ot.BadRequestError=ml;Ot.AuthenticationError=gl;Ot.InternalServerError=kl;Ot.PermissionDeniedError=hl;Ot.UnprocessableEntityError=vl;Ot.toFile=Gh;no=class extends Ot{constructor(){super(...arguments),this.completions=new Kl(this),this.messages=new tc(this),this.models=new Yl(this),this.files=new Jl(this),this.skills=new nc(this),this.beta=new jt(this)}};no.Completions=Kl;no.Messages=tc;no.Models=Yl;no.Files=Jl;no.Skills=nc;no.Beta=jt});function TOe(e){let t=e.messages.flatMap(n=>{if(!Array.isArray(n.content))return[n];let i=n.content.filter(r=>r.type!=="fallback");return i.length===n.content.length?[n]:i.length>0?[{...n,content:i}]:[]});return{...e,messages:t}}function o7(e,t){let n={...e};for(let[i,r]of Object.entries(t))if(i==="output_config"&&r!=null){let o={...n[i]??{}};for(let[s,a]of Object.entries(r))TF(o,s,a);TF(n,i,Object.keys(o).length?o:null)}else TF(n,i,r);return n}function TF(e,t,n){n!==void 0&&(n===null?delete e[t]:e[t]=n)}function u7(e,t={}){let n=!1;return async(i,r,o)=>{let[s,a]=(o.options?.path??"").split("?");if(e.length===0||o.options?.method!=="post"||s!=="/v1/messages"||new URLSearchParams(a).get("beta")!=="true"||typeof o.options.body!="object"||o.options.body==null)return r(i);if(o.options.body.fallbacks!=null)throw new J("Sending the `fallbacks:` request param is not supported when using the `betaRefusalFallbackMiddleware`. You should either remove the middleware and send `fallbacks:` with the `server-side-fallback-2026-07-01` beta header to let the API handle refusal fallbacks, or omit the `fallbacks:` param if you'd like `betaRefusalFallbackMiddleware` to handle fallbacks on the client side.");let c=t.onError??(S=>o.logger.error(`anthropic-sdk: betaRefusalFallbackMiddleware: ${S.message}`));i=COe(i,t.betas??EOe);let l=TOe(o.options.body),u=o.options.fallbackState,d=u?.index??-1;if(!Number.isInteger(d)||d<-1||d>=e.length)throw new J(`fallbackState.index ${d} is out of bounds for a chain of ${e.length} fallback(s); was the state shared with a different middleware?`);let p=S=>{u?u.index=S:n||(n=!0,o.logger.warn("anthropic-sdk: betaRefusalFallbackMiddleware fell back without a `fallbackState` request option; follow-up requests will retry models that already refused. Pass a shared `{ fallbackState: new BetaFallbackState() }` to pin them to the accepted model."))},f=d===-1?l:o7(l,e[d]),m=typeof i.body!="string"?i:{...i,body:JSON.stringify(f)},g=await r(m);if(!g.ok)return g;if(o.options.stream===!0){let S=d+1;return S>=e.length||typeof m.body!="string"?g:IOe({request:m,response:g,next:r,ctx:o,fallbacks:e,firstHop:S,onError:c,pin:p})}let h=d,b=g,y=f.model,w=[];for(;hnull);if(L===0&&E.status===400&&f.length){i.logger.warn(`anthropic-sdk: betaRefusalFallbackMiddleware: fallback request with the partial output appended was rejected (HTTP 400: ${JSON.stringify(K)}); retrying without it`),x=p,E=null;continue}T={kind:"request_failed",message:`fallback request failed: HTTP ${E.status}: ${JSON.stringify(K)}`,model:k,status:E.status,detail:K};break}if(T){if(s(T),_)continue;let L={...h,recommended_model:k};yield $s("message_delta",{type:"message_delta",context_management:null,delta:{stop_reason:"refusal",stop_sequence:null,container:null,stop_details:L},usage:g??{},...b!==void 0&&{input_transformations:b}}),yield $s("message_stop",{type:"message_stop"});return}let A=yield*s7({response:E,controller:c,indexBase:u,hasNext:_,onError:s,splice:{iterations:y,model:k}});if(!A.refused)return;d=A.refused.token,h=A.refused.stopDetails,b=A.refused.inputTransformations,p=x,f=A.refused.hasPrefillClaim?a7(A.blocks):[],y.push(AF("message",k,A.refused.usage)),g=A.refused.usage,m=k,u=A.nextIndex}}async function*s7(e){let{response:t,controller:n,indexBase:i,hasNext:r,onError:o,splice:s}=e,a=new IF(i),c,l=null,u;for await(let d of Fr.rawEvents(t,n)){let p=$l(d.data);switch(p?.type){case"message_start":{if(c=p.message.model,l=p.message.usage,"input_transformations"in p.message&&(u=p.message.input_transformations),s)continue;break}case"content_block_start":{if(a.start(p),s){yield $s(p.type,p);continue}break}case"content_block_delta":{if(a.delta(p),s){yield $s(p.type,p);continue}break}case"content_block_stop":{if(a.stop(p),s){yield $s(p.type,p);continue}break}case"message_delta":{if(p.delta.stop_reason==="refusal"){let f=p.delta.stop_details?.type==="refusal"?p.delta.stop_details:null;if(f?.fallback_credit_token&&r){let m=c7(p.usage,l);return yield*a.closeOpenBlocks(),{refused:{token:f.fallback_credit_token,hasPrefillClaim:f.fallback_has_prefill_claim===!0,usage:m,stopDetails:f,inputTransformations:s?u:void 0},model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}f?.fallback_credit_token?o({kind:"chain_exhausted",message:"refusal but no fallback entries remain",event:p}):o({kind:"no_credit_token",message:"refusal stop_details has no fallback_credit_token",event:p})}if(s){let f=c7(p.usage,l);f.iterations=[...s.iterations,AF("fallback_message",s.model,f)],p.usage=f,!("input_transformations"in p)&&u!==void 0&&(p.input_transformations=u),yield $s("message_delta",p);continue}break}}yield POe(d)}return{refused:null,model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}function d7(e){return{token:e,mode:"best_effort"}}function ROe(e,{model:t,creditToken:n,continuation:i}){let r=JSON.parse(e.body);return r.model=t,r.fallback_credit_token=d7(n),i.length&&(r.messages=[...r.messages,{role:"assistant",content:i}]),{...e,headers:new Headers(e.headers),body:JSON.stringify(r)}}function NOe(e,t,n){let i=e.find(r=>r.index===t)?.block;if(i)switch(n.type){case"text_delta":{i.text=(i.text??"")+n.text;break}case"input_json_delta":{i._partial_json=(i._partial_json??"")+n.partial_json;break}case"citations_delta":(i.citations??(i.citations=[])).push(n.citation);break;case"thinking_delta":{i.thinking=(i.thinking??"")+n.thinking;break}case"signature_delta":{i.signature=n.signature;break}case"compaction_delta":break;default:}}function a7(e){return e.map(t=>{if(typeof t?._partial_json!="string")return t;let{_partial_json:n,...i}=t;return{...i,input:$l(n)??i.input}})}function COe(e,t){let n=new Headers(e.headers),i=new Set(n.get("anthropic-beta")?.split(",").map(r=>r.trim()));for(let r of t)i.has(r)||(n.append("anthropic-beta",r),i.add(r));return n.set(Mo,$M(n.get(Mo),"fallback-refusal-middleware")),{...e,headers:n}}function $s(e,t){let n={event:e,data:JSON.stringify(t),raw:[]};return l7.encode(p7(n))}function POe(e){return l7.encode(e.raw.length?e.raw.join(` +`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!t,this.timeout=s.timeout??CF.DEFAULT_TIMEOUT,this.logger=s.logger??console,this.logLevel=Gh,this.logLevel=P$(s.logLevel,"ClientOptions.logLevel",qe(this))??P$(ze("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",qe(this))??Gh,this.fetchOptions=s.fetchOptions,this.maxRetries=b$("maxRetries",s.maxRetries??2),this.fetch=s.fetch??I5(),M(this,ZS,R5,"f"),this.middleware=[...s.middleware??[]];let a=ze("ANTHROPIC_CUSTOM_HEADERS");if(a){let l={};for(let u of a.split(` +`)){let d=u.indexOf(":");d>=0&&(l[u.substring(0,d).trim()]=u.substring(d+1).trim())}s.defaultHeaders={...l,...s.defaultHeaders}}let c=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof n=="string"?n:null,this.authToken=i,this.webhookKey=r,c)this._authState=c,!this._baseURLIsExplicit&&c.baseURL&&(this.baseURL=c.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let l=s.credentials??null;if(l)this._authState.provider=l,this._authState.tokenCache=this._makeTokenCache(l);else if(s.config!=null){let u=wM(s.config,this._credentialResolverOptions());this._authState.provider=u.provider,this._authState.tokenCache=this._makeTokenCache(u.provider),this._authState.extraHeaders=u.extraHeaders,this._applyCredentialBaseURL(u.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._shouldResolveDefaultCredentials()&&(this._authState.resolution=this._resolveDefaultCredentials())}}_shouldResolveDefaultCredentials(){return!0}_applyCredentialBaseURL(t){if(!t)return;let n=t.replace(/\/+$/,"");this._authState.baseURL=n,this._baseURLIsExplicit||(this.baseURL=n)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:t=>{qe(this).debug("credential cache write failed (best-effort)",t)},onSafetyWarning:t=>{qe(this).warn(t)}}}_credentialsFetch(){return SM(this.fetch,this.middleware,void 0,this)}_makeTokenCache(t){return new R$(t,n=>{qe(this).debug("advisory token refresh failed; serving cached token",n)})}withOptions(t){let n="credentials"in t||"config"in t||"profile"in t,i="apiKey"in t||"authToken"in t||n,r={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...n?{credentials:void 0,config:void 0,profile:void 0}:{},...t,__auth:i?void 0:this._authState,__baseURLIsExplicit:"baseURL"in t?!0:this._baseURLIsExplicit};return new this.constructor(r)}async _resolveDefaultCredentials(t){try{let n=await pQ(this._credentialResolverOptions(),t);if(n)this._authState.provider=n.provider,this._authState.tokenCache=this._makeTokenCache(n.provider),this._authState.extraHeaders=n.extraHeaders,this._applyCredentialBaseURL(n.baseURL);else if(t!=null)throw new J(`Profile "${t}" could not be resolved (no /configs/${t}.json found).`)}catch(n){this._authState.error=n}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(t.get("x-api-key")||t.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&t.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(t){let n=this._requestAuthFlags.get(t);return n||(n={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(t,n)),n}async authHeaders(t){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let n=await this._authState.tokenCache.getToken();return this._authFlags(t).usedTokenCache=!0,I([{Authorization:`Bearer ${n}`}])}return I([await this.apiKeyAuth(t),await this.bearerAuth(t)])}}async apiKeyAuth(t){if(this.apiKey!=null)return I([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return I([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return z5(t)}getUserAgent(){return`Anthropic/JS ${Si}`}makeStatusError(t,n,i,r){return Dt.generate(t,n,i,r)}buildURL(t,n,i){let r=!v(this,RF,"m",u7).call(this)&&i||this.baseURL,o=v5(t)?new URL(t):new URL(r+(r.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery(),a=Object.fromEntries(o.searchParams);return(!YO(s)||!YO(a))&&(n={...a,...s,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(o.search=this.stringifyQuery(n)),o.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(t){}async prepareRequest(t,{url:n,options:i}){if(this._authState.tokenCache&&this.apiKey==null){let r=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(let[s,a]of Object.entries(this._authState.extraHeaders))r.has(s)||r.set(s,a);r.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(xl)||r.append("anthropic-beta",xl),t.headers=r}}backendMiddleware(){return[]}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,i){return this.request(Promise.resolve(i).then(r=>({method:t,path:n,...r})))}request(t,n=null){return new La(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,i){let r=await t,o=b$("maxRetries",r.maxRetries??this.maxRetries);n==null&&(n=o,this._requestAuthFlags.delete(r)),await this.prepareOptions(r);let{req:s,url:a,timeout:c}=await this.buildRequest(r,{retryCount:o-n}),l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=i===void 0?"":`, retryOf: ${i}`,d=Date.now();if(r.signal?.aborted)throw new En;let p=new AbortController,f=await this.fetchWithTimeout(a,s,c,p,r,{requestLogID:l,retryOfRequestLogID:i}).catch(ml),m=Date.now();if(f instanceof globalThis.Error){No(p);let b=`retrying, ${n} attempts remaining`;if(r.signal?.aborted)throw new En;let y=Zr(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):"")),w=this.middleware.length>0||!!r.middleware?.length||this.backendMiddleware().length>0;if(w&&!y&&!bQ(f))throw qe(this).info(`[${l}] middleware error (not retryable)`),qe(this).debug(`[${l}] middleware error (not retryable)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),f;if(n)return qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - ${b}`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (${b})`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),this.retryRequest(r,n,i??l);throw qe(this).info(`[${l}] connection ${y?"timed out":"failed"} - error; no more retries left`),qe(this).debug(`[${l}] connection ${y?"timed out":"failed"} (error; no more retries left)`,Oo({retryOfRequestLogID:i,url:a,durationMs:m-d,message:f.message})),y?new gl:w&&!$M(f)?f:new Zi({cause:f})}let g=[...f.headers.entries()].filter(([b])=>b==="request-id"||b==="anthropic-workspace-id").map(([b,y])=>", "+b+": "+JSON.stringify(y)).join(""),h=`[${l}${u}${g}] ${s.method} ${a} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${m-d}ms`;if(!f.ok){let b=await this.shouldRetry(f,r);if(n&&b){let x=`retrying, ${n} attempts remaining`;return await A5(f.body),No(p),qe(this).info(`${h} - ${x}`),qe(this).debug(`[${l}] response error (${x})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),this.retryRequest(r,n,i??l,f.headers)}let y=b?"error; no more retries left":"error; not retryable";qe(this).info(`${h} - ${y}`);let w=await f.text().catch(x=>ml(x).message),k=Sl(w),$=k?void 0:w;throw qe(this).debug(`[${l}] response error (${y})`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,message:$,durationMs:Date.now()-d})),No(p),this.makeStatusError(f.status,k,$,f.headers)}return qe(this).info(h),qe(this).debug(`[${l}] response start`,Oo({retryOfRequestLogID:i,url:f.url,status:f.status,headers:f.headers,durationMs:m-d})),T5(f.body??f,p),{response:f,options:r,controller:p,requestLogID:l,retryOfRequestLogID:i,startTime:d}}getAPIList(t,n,i){return this.requestAPIList(n,i&&"then"in i?i.then(r=>({method:"get",path:t,...r})):{method:"get",path:t,...i})}requestAPIList(t,n){let i=this.makeRequest(n,null,void 0);return new mp(this,i,t)}async fetchWithTimeout(t,n,i,r,o,s){let{signal:a,method:c,...l}=n||{},u=this._makeAbort(r);a&&(a.addEventListener("abort",u,{once:!0}),E5(r,a,u));let d=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,p={signal:r.signal,...d?{duplex:"half"}:{},method:"GET",...l};c&&(p.method=c.toUpperCase());let f=this.fetch,m=async(w,k)=>{let $=setTimeout(u,i);try{return await f.call(void 0,w,k)}finally{clearTimeout($)}},g=o===void 0?m:(async(w,k={})=>{let $=typeof w=="string"?w:w instanceof URL?w.href:w.url;return k.headers=k.headers instanceof Headers?k.headers:new Headers(k.headers),await this.prepareRequest(k,{url:$,options:o}),s&&qe(this).debug(`[${s.requestLogID}] sending request`,Oo({retryOfRequestLogID:s.retryOfRequestLogID,method:k.method,url:$,options:o,headers:k.headers})),m(w,k)}),h=o?.middleware,b=this.backendMiddleware(),y=h?.length||b.length?[...this.middleware,...h??[],...b]:this.middleware;return await SM(g,y,o,this)(t,p)}async shouldRetry(t,n){let i=this._authFlags(n);if(t.status===401&&this._authState.tokenCache&&i.usedTokenCache&&!i.didRefreshFor401)return i.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,i,r){let o,s=r?.get("retry-after-ms");if(s){let c=parseFloat(s);Number.isNaN(c)||(o=c)}let a=r?.get("retry-after");if(a&&!o){let c=parseFloat(a);Number.isNaN(c)?o=Date.parse(a)-Date.now():o=c*1e3}if(o===void 0||!(o>0&&o<=2**31-1)){let c=t.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(n,c)}return await Yi(o),this.makeRequest(t,n-1,i)}calculateDefaultRetryTimeoutMillis(t,n){let o=n-t,s=Math.min(.5*Math.pow(2,o),8),a=1-Math.random()*.25;return s*a*1e3}calculateNonstreamingTimeout(t,n){if(36e5*t/128e3>6e5||n!=null&&t>n)throw new J("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:n=0}={}){let i={...t},{method:r,path:o,query:s,defaultBaseURL:a}=i;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let c=this.buildURL(o,s,a);"timeout"in i&&b$("timeout",i.timeout),i.timeout=i.timeout??this.timeout;let{bodyHeaders:l,body:u}=this.buildBody({options:i}),d=await this.buildHeaders({options:t,method:r,bodyHeaders:l,retryCount:n});return{req:{method:r,headers:d,...i.signal&&{signal:i.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...i.fetchOptions??{}},url:c,timeout:i.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:i,retryCount:r}){let o=I([{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...Lh(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,i,t.headers]);return this.validateHeaders(o),o.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};let i=I([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&i.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:_$(t)}:typeof t=="object"&&i.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:v(this,ZS,"f").call(this,{body:t,headers:i})}};CF=Ot,ZS=new WeakMap,RF=new WeakSet,u7=function(){return this.baseURL!=="https://api.anthropic.com"};Ot.Anthropic=CF;Ot.HUMAN_PROMPT=NF;Ot.AI_PROMPT=PF;Ot.DEFAULT_TIMEOUT=6e5;Ot.AnthropicError=J;Ot.APIError=Dt;Ot.APIConnectionError=Zi;Ot.APIConnectionTimeoutError=gl;Ot.APIUserAbortError=En;Ot.NotFoundError=vl;Ot.ConflictError=wl;Ot.RateLimitError=_l;Ot.BadRequestError=hl;Ot.AuthenticationError=yl;Ot.InternalServerError=$l;Ot.PermissionDeniedError=bl;Ot.UnprocessableEntityError=kl;Ot.toFile=Jh;no=class extends Ot{constructor(){super(...arguments),this.completions=new Zl(this),this.messages=new tc(this),this.models=new Xl(this),this.files=new Yl(this),this.skills=new nc(this),this.beta=new jt(this)}};no.Completions=Zl;no.Messages=tc;no.Models=Xl;no.Files=Yl;no.Skills=nc;no.Beta=jt});function DOe(e){let t=e.messages.flatMap(n=>{if(!Array.isArray(n.content))return[n];let i=n.content.filter(r=>r.type!=="fallback");return i.length===n.content.length?[n]:i.length>0?[{...n,content:i}]:[]});return{...e,messages:t}}function d7(e,t){let n={...e};for(let[i,r]of Object.entries(t))if(i==="output_config"&&r!=null){let o={...n[i]??{}};for(let[s,a]of Object.entries(r))OF(o,s,a);OF(n,i,Object.keys(o).length?o:null)}else OF(n,i,r);return n}function OF(e,t,n){n!==void 0&&(n===null?delete e[t]:e[t]=n)}function h7(e,t={}){let n=!1;return async(i,r,o)=>{let[s,a]=(o.options?.path??"").split("?");if(e.length===0||o.options?.method!=="post"||s!=="/v1/messages"||new URLSearchParams(a).get("beta")!=="true"||typeof o.options.body!="object"||o.options.body==null)return r(i);if(o.options.body.fallbacks!=null)throw new J("Sending the `fallbacks:` request param is not supported when using the `betaRefusalFallbackMiddleware`. You should either remove the middleware and send `fallbacks:` with the `server-side-fallback-2026-07-01` beta header to let the API handle refusal fallbacks, or omit the `fallbacks:` param if you'd like `betaRefusalFallbackMiddleware` to handle fallbacks on the client side.");let c=t.onError??(S=>o.logger.error(`anthropic-sdk: betaRefusalFallbackMiddleware: ${S.message}`));i=UOe(i,t.betas??POe);let l=DOe(o.options.body),u=o.options.fallbackState,d=u?.index??-1;if(!Number.isInteger(d)||d<-1||d>=e.length)throw new J(`fallbackState.index ${d} is out of bounds for a chain of ${e.length} fallback(s); was the state shared with a different middleware?`);let p=S=>{u?u.index=S:n||(n=!0,o.logger.warn("anthropic-sdk: betaRefusalFallbackMiddleware fell back without a `fallbackState` request option; follow-up requests will retry models that already refused. Pass a shared `{ fallbackState: new BetaFallbackState() }` to pin them to the accepted model."))},f=d===-1?l:d7(l,e[d]),m=typeof i.body!="string"?i:{...i,body:JSON.stringify(f)},g=await r(m);if(!g.ok)return g;if(o.options.stream===!0){let S=d+1;return S>=e.length||typeof m.body!="string"?g:OOe({request:m,response:g,next:r,ctx:o,fallbacks:e,firstHop:S,onError:c,pin:p})}let h=d,b=g,y=f.model,w=[];for(;hnull);if(L===0&&E.status===400&&f.length){i.logger.warn(`anthropic-sdk: betaRefusalFallbackMiddleware: fallback request with the partial output appended was rejected (HTTP 400: ${JSON.stringify(H)}); retrying without it`),x=p,E=null;continue}T={kind:"request_failed",message:`fallback request failed: HTTP ${E.status}: ${JSON.stringify(H)}`,model:k,status:E.status,detail:H};break}if(T){if(s(T),$)continue;let L={...h,recommended_model:k};yield _s("message_delta",{type:"message_delta",context_management:null,delta:{stop_reason:"refusal",stop_sequence:null,container:null,stop_details:L},usage:g??{},...b!==void 0&&{input_transformations:b}}),yield _s("message_stop",{type:"message_stop"});return}let A=yield*p7({response:E,controller:c,indexBase:u,hasNext:$,onError:s,splice:{iterations:y,model:k}});if(!A.refused)return;d=A.refused.token,h=A.refused.stopDetails,b=A.refused.inputTransformations,p=x,f=A.refused.hasPrefillClaim?f7(A.blocks):[],y.push(LF("message",k,A.refused.usage)),g=A.refused.usage,m=k,u=A.nextIndex}}async function*p7(e){let{response:t,controller:n,indexBase:i,hasNext:r,onError:o,splice:s}=e,a=new MF(i),c,l=null,u;for await(let d of Lr.rawEvents(t,n)){let p=Sl(d.data);switch(p?.type){case"message_start":{if(c=p.message.model,l=p.message.usage,"input_transformations"in p.message&&(u=p.message.input_transformations),s)continue;break}case"content_block_start":{if(a.start(p),s){yield _s(p.type,p);continue}break}case"content_block_delta":{if(a.delta(p),s){yield _s(p.type,p);continue}break}case"content_block_stop":{if(a.stop(p),s){yield _s(p.type,p);continue}break}case"message_delta":{if(p.delta.stop_reason==="refusal"){let f=p.delta.stop_details?.type==="refusal"?p.delta.stop_details:null;if(f?.fallback_credit_token&&r){let m=m7(p.usage,l);return yield*a.closeOpenBlocks(),{refused:{token:f.fallback_credit_token,hasPrefillClaim:f.fallback_has_prefill_claim===!0,usage:m,stopDetails:f,inputTransformations:s?u:void 0},model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}f?.fallback_credit_token?o({kind:"chain_exhausted",message:"refusal but no fallback entries remain",event:p}):o({kind:"no_credit_token",message:"refusal stop_details has no fallback_credit_token",event:p})}if(s){let f=m7(p.usage,l);f.iterations=[...s.iterations,LF("fallback_message",s.model,f)],p.usage=f,!("input_transformations"in p)&&u!==void 0&&(p.input_transformations=u),yield _s("message_delta",p);continue}break}}yield jOe(d)}return{refused:null,model:c,blocks:a.contentBlocks(),nextIndex:a.nextIndex}}function y7(e){return{token:e,mode:"best_effort"}}function LOe(e,{model:t,creditToken:n,continuation:i}){let r=JSON.parse(e.body);return r.model=t,r.fallback_credit_token=y7(n),i.length&&(r.messages=[...r.messages,{role:"assistant",content:i}]),{...e,headers:new Headers(e.headers),body:JSON.stringify(r)}}function FOe(e,t,n){let i=e.find(r=>r.index===t)?.block;if(i)switch(n.type){case"text_delta":{i.text=(i.text??"")+n.text;break}case"input_json_delta":{i._partial_json=(i._partial_json??"")+n.partial_json;break}case"citations_delta":(i.citations??(i.citations=[])).push(n.citation);break;case"thinking_delta":{i.thinking=(i.thinking??"")+n.thinking;break}case"signature_delta":{i.signature=n.signature;break}case"compaction_delta":break;default:}}function f7(e){return e.map(t=>{if(typeof t?._partial_json!="string")return t;let{_partial_json:n,...i}=t;return{...i,input:Sl(n)??i.input}})}function UOe(e,t){let n=new Headers(e.headers),i=new Set(n.get("anthropic-beta")?.split(",").map(r=>r.trim()));for(let r of t)i.has(r)||(n.append("anthropic-beta",r),i.add(r));return n.set(Mo,RM(n.get(Mo),"fallback-refusal-middleware")),{...e,headers:n}}function _s(e,t){let n={event:e,data:JSON.stringify(t),raw:[]};return g7.encode(b7(n))}function jOe(e){return g7.encode(e.raw.length?e.raw.join(` `)+` -`:p7(e))}function AF(e,t,n){return{type:e,model:t,input_tokens:n?.input_tokens??0,output_tokens:n?.output_tokens??0,cache_read_input_tokens:n?.cache_read_input_tokens??0,cache_creation_input_tokens:n?.cache_creation_input_tokens??0,cache_creation:n?.cache_creation??null}}function c7(e,t){let n={...t??{},...e??{}};for(let i of Object.keys(n))n[i]==null&&t?.[i]!=null&&(n[i]=t[i]);return n}function p7(e){let t="";e.event!==null&&(t+=`event: ${e.event} +`:b7(e))}function LF(e,t,n){return{type:e,model:t,input_tokens:n?.input_tokens??0,output_tokens:n?.output_tokens??0,cache_read_input_tokens:n?.cache_read_input_tokens??0,cache_creation_input_tokens:n?.cache_creation_input_tokens??0,cache_creation:n?.cache_creation??null}}function m7(e,t){let n={...t??{},...e??{}};for(let i of Object.keys(n))n[i]==null&&t?.[i]!=null&&(n[i]=t[i]);return n}function b7(e){let t="";e.event!==null&&(t+=`event: ${e.event} `);for(let n of e.data.split(` `))t+=`data: ${n} `;return t+` -`}function DOe(e,t){return()=>e.abort(t.reason)}var l7,EOe,IF,f7=j(()=>{kt();Lh();Da();Ne();eo();hr();WO();l7=new TextEncoder,EOe=["fallback-credit-2026-07-01"];IF=class{constructor(t=0){this.indexBase=t,this.blocks=[],this.open=[],this.nextIndex=t}contentBlocks(){return this.blocks.map(t=>t.block)}start(t){this.blocks.push({index:t.index,block:{...t.content_block}}),t.index+=this.indexBase,this.open.push(t.index),this.nextIndex=Math.max(this.nextIndex,t.index+1)}delta(t){NOe(this.blocks,t.index,t.delta),t.index+=this.indexBase}stop(t){t.index+=this.indexBase;let n=this.open.indexOf(t.index);n!==-1&&this.open.splice(n,1),this.nextIndex=Math.max(this.nextIndex,t.index+1)}*closeOpenBlocks(){for(let t of this.open)yield $s("content_block_stop",{type:"content_block_stop",index:t});this.open.length=0}}});var m7={};_r(m7,{AI_PROMPT:()=>xF,APIConnectionError:()=>Zi,APIConnectionTimeoutError:()=>fl,APIError:()=>Dt,APIPromise:()=>La,APIUserAbortError:()=>In,Anthropic:()=>no,AnthropicError:()=>J,AuthenticationError:()=>gl,BadRequestError:()=>ml,BaseAnthropic:()=>Ot,BetaFallbackState:()=>Ch,ConflictError:()=>bl,HUMAN_PROMPT:()=>SF,InternalServerError:()=>kl,NotFoundError:()=>yl,PagePromise:()=>fp,PermissionDeniedError:()=>hl,RateLimitError:()=>wl,RetryableError:()=>ap,UnprocessableEntityError:()=>vl,betaRefusalFallbackMiddleware:()=>u7,default:()=>no,toFile:()=>Gh});var VM=j(()=>{EF();kM();N_();f7();EF();De();kt()});var OU=require("node:fs/promises"),MU=require("node:fs/promises");var C2=gt(gc(),1);var U={};_r(U,{$brand:()=>nI,$input:()=>SA,$output:()=>_A,INVALID:()=>sr,NEVER:()=>tI,TimePrecision:()=>OA,ZodAny:()=>_N,ZodArray:()=>TN,ZodBase64:()=>Yw,ZodBase64URL:()=>Qw,ZodBigInt:()=>ud,ZodBigIntFormat:()=>tk,ZodBoolean:()=>ld,ZodCIDRv4:()=>Jw,ZodCIDRv6:()=>Zw,ZodCUID:()=>Gw,ZodCUID2:()=>Vw,ZodCatch:()=>KN,ZodCodec:()=>pg,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,ZodCreditCard:()=>gN,ZodCustom:()=>fg,ZodCustomStringFormat:()=>ad,ZodDate:()=>sg,ZodDefault:()=>GN,ZodDiscriminatedUnion:()=>AN,ZodE164:()=>Xw,ZodEmail:()=>Fw,ZodEmoji:()=>jw,ZodEnum:()=>od,ZodError:()=>Cfe,ZodExactOptional:()=>ok,ZodFile:()=>FN,ZodFirstPartyTypeKind:()=>uC,ZodFunction:()=>iC,ZodGUID:()=>Uw,ZodIBAN:()=>hN,ZodIPv4:()=>Hw,ZodIPv6:()=>Kw,ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>lC,ZodIntersection:()=>RN,ZodIssueCode:()=>Ofe,ZodJWT:()=>ek,ZodKSUID:()=>Ww,ZodLazy:()=>tC,ZodLiteral:()=>LN,ZodMAC:()=>mN,ZodMap:()=>ON,ZodNaN:()=>ZN,ZodNanoID:()=>zw,ZodNever:()=>xN,ZodNonOptional:()=>sk,ZodNull:()=>kN,ZodNullable:()=>zN,ZodNumber:()=>cd,ZodNumberFormat:()=>Nc,ZodObject:()=>cg,ZodOptional:()=>ug,ZodPipe:()=>dg,ZodPrefault:()=>BN,ZodPreprocess:()=>YN,ZodPromise:()=>rC,ZodProperties:()=>oC,ZodReadonly:()=>QN,ZodRealError:()=>Ar,ZodRecord:()=>id,ZodSet:()=>MN,ZodString:()=>sd,ZodStringFormat:()=>mt,ZodSuccess:()=>HN,ZodSymbol:()=>vN,ZodTemplateLiteral:()=>eC,ZodTransform:()=>UN,ZodTuple:()=>CN,ZodType:()=>Le,ZodULID:()=>Bw,ZodURL:()=>og,ZodUUID:()=>go,ZodUndefined:()=>wN,ZodUnion:()=>lg,ZodUnknown:()=>SN,ZodVoid:()=>EN,ZodXID:()=>qw,ZodXor:()=>IN,_ZodString:()=>Lw,_default:()=>VN,_function:()=>u2,any:()=>zq,array:()=>ag,base64:()=>$q,base64url:()=>_q,bigint:()=>Mq,boolean:()=>bN,catch:()=>JN,check:()=>d2,cidrv4:()=>wq,cidrv6:()=>kq,clone:()=>ot,codec:()=>s2,coerce:()=>pC,compile:()=>IA,config:()=>zt,core:()=>Zo,creditCard:()=>xq,cuid:()=>pq,cuid2:()=>fq,custom:()=>p2,date:()=>Vq,decode:()=>aN,decodeAsync:()=>lN,deepPartial:()=>x2,describe:()=>f2,discriminatedUnion:()=>Jq,e164:()=>Sq,email:()=>nq,emoji:()=>uq,encode:()=>sN,encodeAsync:()=>cN,endsWith:()=>Wu,enum:()=>rk,exactOptional:()=>jN,file:()=>n2,flattenError:()=>Cm,float32:()=>Cq,float64:()=>Pq,formatError:()=>Pm,fromJSONSchema:()=>_2,function:()=>u2,getDiscriminatedOption:()=>Z0,getErrorMap:()=>Lfe,globalRegistry:()=>Dn,gt:()=>fo,gte:()=>Vr,guid:()=>rq,hash:()=>Nq,hex:()=>Rq,hostname:()=>Aq,httpUrl:()=>lq,iban:()=>Eq,includes:()=>Bu,input:()=>T2,instanceof:()=>g2,int:()=>Ow,int32:()=>Dq,int64:()=>Lq,intersection:()=>NN,invertCodec:()=>a2,ipv4:()=>yq,ipv6:()=>vq,iso:()=>mg,json:()=>y2,jwt:()=>Tq,keyof:()=>Bq,ksuid:()=>hq,lazy:()=>nC,length:()=>Ic,literal:()=>t2,locales:()=>Zm,looseObject:()=>Hq,looseRecord:()=>Yq,lowercase:()=>Gu,lt:()=>po,lte:()=>Gr,mac:()=>bq,map:()=>Qq,maxLength:()=>Tc,maxSize:()=>Gs,memoizer:()=>Km,meta:()=>m2,mime:()=>Hu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>zs,nan:()=>o2,nanoid:()=>dq,nativeEnum:()=>e2,negative:()=>Sw,never:()=>nk,nonnegative:()=>Ew,nonoptional:()=>WN,nonpositive:()=>xw,normalize:()=>Ku,null:()=>$N,nullable:()=>ig,nullish:()=>r2,number:()=>yN,object:()=>qq,optional:()=>Rc,output:()=>I2,overwrite:()=>ji,parse:()=>nN,parseAsync:()=>rN,partialRecord:()=>Zq,pipe:()=>Mw,positive:()=>_w,prefault:()=>qN,preprocess:()=>b2,prettifyError:()=>aI,promise:()=>l2,properties:()=>sC,property:()=>Tw,readonly:()=>XN,record:()=>DN,refine:()=>aC,regex:()=>zu,regexes:()=>or,registry:()=>Xv,safeDecode:()=>dN,safeDecodeAsync:()=>fN,safeEncode:()=>uN,safeEncodeAsync:()=>pN,safeParse:()=>iN,safeParseAsync:()=>oN,set:()=>Xq,setErrorMap:()=>Mfe,size:()=>Ec,slugify:()=>Qu,startsWith:()=>qu,strictObject:()=>Wq,string:()=>rg,stringFormat:()=>Iq,stringbool:()=>h2,success:()=>i2,superRefine:()=>cC,symbol:()=>Uq,templateLiteral:()=>c2,toJSONSchema:()=>Nw,toLowerCase:()=>Zu,toUpperCase:()=>Yu,toZod:()=>Sm,transform:()=>ik,treeifyError:()=>sI,trim:()=>Ju,tuple:()=>PN,uint32:()=>Oq,uint64:()=>Fq,ulid:()=>mq,undefined:()=>jq,union:()=>dd,unknown:()=>Ac,uppercase:()=>Vu,url:()=>cq,util:()=>G,uuid:()=>iq,uuidv4:()=>oq,uuidv6:()=>sq,uuidv7:()=>aq,validate:()=>Dm,validateAsync:()=>Om,void:()=>Gq,withParser:()=>ew,xid:()=>gq,xor:()=>Kq});var Zo={};_r(Zo,{$ZodAny:()=>G0,$ZodArray:()=>H0,$ZodAsyncError:()=>Tr,$ZodBase64:()=>R0,$ZodBase64URL:()=>N0,$ZodBigInt:()=>Uv,$ZodBigIntFormat:()=>F0,$ZodBoolean:()=>Gm,$ZodCIDRv4:()=>I0,$ZodCIDRv6:()=>A0,$ZodCUID:()=>h0,$ZodCUID2:()=>y0,$ZodCatch:()=>pA,$ZodCheck:()=>ht,$ZodCheckBigIntFormat:()=>BI,$ZodCheckEndsWith:()=>n0,$ZodCheckGreaterThan:()=>$v,$ZodCheckIncludes:()=>e0,$ZodCheckLengthEquals:()=>ZI,$ZodCheckLessThan:()=>kv,$ZodCheckLowerCase:()=>QI,$ZodCheckMaxLength:()=>KI,$ZodCheckMaxSize:()=>qI,$ZodCheckMimeType:()=>i0,$ZodCheckMinLength:()=>JI,$ZodCheckMinSize:()=>WI,$ZodCheckMultipleOf:()=>GI,$ZodCheckNumberFormat:()=>VI,$ZodCheckOverwrite:()=>o0,$ZodCheckProperty:()=>r0,$ZodCheckRegex:()=>YI,$ZodCheckSizeEquals:()=>HI,$ZodCheckStartsWith:()=>t0,$ZodCheckStringFormat:()=>Mu,$ZodCheckUpperCase:()=>XI,$ZodCodec:()=>Bm,$ZodCreditCard:()=>P0,$ZodCustom:()=>vA,$ZodCustomStringFormat:()=>M0,$ZodCyclicError:()=>Wv,$ZodDate:()=>W0,$ZodDefault:()=>cA,$ZodDiscriminatedUnion:()=>Y0,$ZodE164:()=>C0,$ZodEmail:()=>u0,$ZodEmoji:()=>m0,$ZodEncodeError:()=>js,$ZodEnum:()=>nA,$ZodError:()=>oI,$ZodExactOptional:()=>sA,$ZodFile:()=>iA,$ZodFunction:()=>yA,$ZodGUID:()=>c0,$ZodIBAN:()=>D0,$ZodIPv4:()=>x0,$ZodIPv6:()=>E0,$ZodISODate:()=>$0,$ZodISODateTime:()=>k0,$ZodISODuration:()=>S0,$ZodISOTime:()=>_0,$ZodIntersection:()=>Q0,$ZodJWT:()=>O0,$ZodKSUID:()=>w0,$ZodLazy:()=>qm,$ZodLiteral:()=>rA,$ZodMAC:()=>T0,$ZodMap:()=>eA,$ZodNaN:()=>fA,$ZodNanoID:()=>g0,$ZodNever:()=>B0,$ZodNonOptional:()=>uA,$ZodNull:()=>z0,$ZodNullable:()=>aA,$ZodNumber:()=>Fv,$ZodNumberFormat:()=>L0,$ZodObject:()=>dV,$ZodObjectJIT:()=>K0,$ZodOptional:()=>zv,$ZodPipe:()=>Gv,$ZodPrefault:()=>lA,$ZodPreprocess:()=>mA,$ZodPromise:()=>bA,$ZodProperties:()=>wA,$ZodReadonly:()=>gA,$ZodRealError:()=>Ir,$ZodRecord:()=>X0,$ZodRegistry:()=>Qv,$ZodSet:()=>tA,$ZodString:()=>kc,$ZodStringFormat:()=>ut,$ZodSuccess:()=>dA,$ZodSymbol:()=>U0,$ZodTemplateLiteral:()=>hA,$ZodTransform:()=>oA,$ZodTuple:()=>jv,$ZodType:()=>Ce,$ZodULID:()=>b0,$ZodURL:()=>f0,$ZodUUID:()=>l0,$ZodUndefined:()=>j0,$ZodUnion:()=>Vm,$ZodUnknown:()=>V0,$ZodVoid:()=>q0,$ZodXID:()=>v0,$ZodXor:()=>J0,$brand:()=>nI,$constructor:()=>R,$input:()=>SA,$output:()=>_A,Doc:()=>wc,INVALID:()=>sr,JSONSchema:()=>XB,JSONSchemaGenerator:()=>Cw,NEVER:()=>tI,TimePrecision:()=>OA,URL_BAD_FORMAT:()=>d0,URL_UNPARSEABLE:()=>p0,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,_any:()=>QA,_array:()=>sR,_base64:()=>vw,_base64url:()=>ww,_bigint:()=>qA,_boolean:()=>VA,_catch:()=>vfe,_check:()=>LB,_cidrv4:()=>yw,_cidrv6:()=>bw,_coercedBigint:()=>WA,_coercedBoolean:()=>BA,_coercedDate:()=>rR,_coercedNumber:()=>LA,_coercedString:()=>NA,_creditCard:()=>PA,_cuid:()=>uw,_cuid2:()=>dw,_custom:()=>cR,_date:()=>nR,_decode:()=>dv,_decodeAsync:()=>fv,_default:()=>hfe,_discriminatedUnion:()=>ife,_e164:()=>kw,_email:()=>nw,_emoji:()=>cw,_encode:()=>uv,_encodeAsync:()=>pv,_endsWith:()=>Wu,_enum:()=>ufe,_file:()=>aR,_float32:()=>UA,_float64:()=>jA,_gt:()=>fo,_gte:()=>Vr,_guid:()=>rw,_iban:()=>DA,_includes:()=>Bu,_int:()=>FA,_int32:()=>zA,_int64:()=>HA,_intersection:()=>ofe,_ipv4:()=>gw,_ipv6:()=>hw,_isoDate:()=>Xm,_isoDateTime:()=>Qm,_isoDuration:()=>tg,_isoTime:()=>eg,_jwt:()=>$w,_ksuid:()=>mw,_lazy:()=>_fe,_length:()=>Ic,_literal:()=>pfe,_lowercase:()=>Gu,_lt:()=>po,_lte:()=>Gr,_mac:()=>CA,_map:()=>cfe,_max:()=>Gr,_maxLength:()=>Tc,_maxSize:()=>Gs,_mime:()=>Hu,_min:()=>Vr,_minLength:()=>Jo,_minSize:()=>mo,_multipleOf:()=>zs,_nan:()=>iR,_nanoid:()=>lw,_nativeEnum:()=>dfe,_negative:()=>Sw,_never:()=>eR,_nonnegative:()=>Ew,_nonoptional:()=>yfe,_nonpositive:()=>xw,_normalize:()=>Ku,_null:()=>YA,_nullable:()=>gfe,_number:()=>MA,_optional:()=>mfe,_overwrite:()=>ji,_parse:()=>Cu,_parseAsync:()=>Pu,_pipe:()=>wfe,_positive:()=>_w,_promise:()=>Sfe,_properties:()=>oR,_property:()=>Tw,_readonly:()=>kfe,_record:()=>afe,_refine:()=>lR,_regex:()=>zu,_safeDecode:()=>gv,_safeDecodeAsync:()=>yv,_safeEncode:()=>mv,_safeEncodeAsync:()=>hv,_safeParse:()=>Du,_safeParseAsync:()=>Ou,_set:()=>lfe,_size:()=>Ec,_slugify:()=>Qu,_startsWith:()=>qu,_string:()=>RA,_stringFormat:()=>Xu,_stringbool:()=>fR,_success:()=>bfe,_superRefine:()=>uR,_symbol:()=>JA,_templateLiteral:()=>$fe,_toLowerCase:()=>Zu,_toUpperCase:()=>Yu,_transform:()=>ffe,_trim:()=>Ju,_tuple:()=>sfe,_uint32:()=>GA,_uint64:()=>KA,_ulid:()=>pw,_undefined:()=>ZA,_union:()=>nfe,_unknown:()=>XA,_uppercase:()=>Vu,_url:()=>Ym,_uuid:()=>iw,_uuidv4:()=>ow,_uuidv6:()=>sw,_uuidv7:()=>aw,_void:()=>tR,_xid:()=>fw,_xor:()=>rfe,base64Charset:()=>Pv,base64urlCharset:()=>zm,clone:()=>ot,compile:()=>IA,compileFn:()=>tw,config:()=>zt,createStandardJSONSchemaMethod:()=>ed,createToJSONSchemaMethod:()=>gR,decode:()=>iue,decodeAsync:()=>sue,describe:()=>dR,encode:()=>rue,encodeAsync:()=>oue,extractDefs:()=>Bs,finalize:()=>qs,flattenError:()=>Cm,formatError:()=>Pm,getDiscriminatedOption:()=>Z0,globalConfig:()=>hn,globalRegistry:()=>Dn,handleUnrepresentable:()=>Zt,initializeContext:()=>Vs,isBackEdge:()=>Kv,isRecursiveSchema:()=>Hv,isTransforming:()=>xn,isValidBase64:()=>jm,isValidBase64URL:()=>Dv,isValidCIDRv6:()=>Cv,isValidCreditCard:()=>Ov,isValidIBAN:()=>Mv,isValidIPv6:()=>Um,isValidJWT:()=>Lv,locales:()=>Zm,memoizer:()=>Km,mergeValues:()=>Lu,meta:()=>pR,parse:()=>cv,parseAsync:()=>lv,parseURLObject:()=>Iv,prettifyError:()=>aI,process:()=>st,processSchema:()=>st,regexes:()=>or,registry:()=>Xv,safeDecode:()=>cue,safeDecodeAsync:()=>uue,safeEncode:()=>aue,safeEncodeAsync:()=>lue,safeParse:()=>Qle,safeParseAsync:()=>Xle,standardProps:()=>Tv,stripTabAndNewline:()=>Av,toDotPath:()=>jG,toJSONSchema:()=>Nw,toZod:()=>Sm,treeifyError:()=>sI,urlHostnameOk:()=>Rv,urlProtocolOk:()=>Nv,util:()=>G,validate:()=>Dm,validateAsync:()=>Om,version:()=>s0,withParser:()=>ew});var G={};_r(G,{BIGINT_FORMAT_RANGES:()=>Am,CONSTANT_CATCH:()=>sv,Class:()=>BT,NUMBER_FORMAT_RANGES:()=>Im,aborted:()=>rr,allowsEval:()=>HT,assert:()=>vle,assertEqual:()=>gle,assertIs:()=>yle,assertNever:()=>ble,assertNotEqual:()=>hle,assignProp:()=>Sn,attachSchema:()=>ov,base64ToUint8Array:()=>DG,base64urlToUint8Array:()=>Fle,cached:()=>Au,captureStackTrace:()=>rv,cleanEnum:()=>Lle,cleanRegex:()=>Ho,clone:()=>ot,cloneDef:()=>$le,codePointLength:()=>bc,constantCatch:()=>XT,createTransparentProxy:()=>Ile,defineLazy:()=>qT,defineLazyInternal:()=>Ue,derived:()=>Gle,esc:()=>nr,escapeRegex:()=>li,explicitlyAborted:()=>ZT,extend:()=>Nle,finalizeIssue:()=>Er,floatSafeRemainder:()=>xm,getElementAtPath:()=>_le,getEnumValues:()=>Tu,getLengthableOrigin:()=>Nm,getParsedType:()=>Tle,getSizableOrigin:()=>Rm,hexToUint8Array:()=>jle,hide:()=>QT,installLazyProp:()=>qle,isObject:()=>yc,isPlainObject:()=>ci,issue:()=>Nu,joinValues:()=>C,jsonStringifyReplacer:()=>Iu,members:()=>YT,merge:()=>Ple,mergeDefs:()=>Fi,normalizeParams:()=>Q,nullish:()=>nv,numKeys:()=>Ele,objectClone:()=>wle,omit:()=>Rle,optionalKeys:()=>JT,own:()=>Us,parsedType:()=>H,partial:()=>Dle,pick:()=>Ale,prefixIssues:()=>ir,primitiveTypes:()=>KT,promiseAllObject:()=>Sle,propertyKeyTypes:()=>Tm,randomString:()=>xle,rawShape:()=>Ru,required:()=>Ole,safeExtend:()=>Cle,shallowClone:()=>Em,slugify:()=>WT,stringifyPrimitive:()=>V,toZod:()=>Sm,uint8ArrayToBase64:()=>OG,uint8ArrayToBase64url:()=>Ule,uint8ArrayToHex:()=>zle,unwrapMessage:()=>Eu});function gle(e){return e}function hle(e){return e}function Sm(){return e=>e}function yle(e){}function ble(e){throw new Error("Unexpected value in exhaustive check")}function vle(e){}function Tu(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function C(e,t="|"){return e.map(n=>V(n)).join(t)}function Iu(e,t){return typeof t=="bigint"?t.toString():t}var VT=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Au(e){return new VT(e)}function nv(e){return e==null}function Ho(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function xm(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i){let a=t._zod.def.shape[o];return i?i(a,o):a}):CG(e,o,i?i(s.value,o):s.value))}}function kle(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?NG(e,n,()=>t[n]):CG(e,n,i.value))}}function Fi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function $le(e){return Fi(e._zod.def)}function _le(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function Sle(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o{};function yc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var HT=Au(()=>{if(hn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ci(e){if(yc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(yc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Em(e){return ci(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ele(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Tle=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Tm=new Set(["string","number","symbol"]),KT=new Set(["string","number","bigint","boolean","symbol","undefined"]);function li(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ot(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ile(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function V(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function JT(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Im={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Am={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ale(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return hc(o,e,iv(e,t)),ot(e,Fi(n,{shape:o,checks:[]}))}function iv(e,t){let n=Wo(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function Rle(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(iv(e,t)),s={};return hc(s,e,Reflect.ownKeys(Wo(e)).filter(a=>!o.has(a))),ot(e,Fi(n,{shape:s,checks:[]}))}function Nle(e,t){if(!ci(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=Wo(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ot(e,Fi(e._zod.def,{shape:PG(e,t)}))}function PG(e,t){let n={};return hc(n,e,Reflect.ownKeys(Wo(e))),kle(n,t),n}function Cle(e,t){if(!ci(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ot(e,Fi(e._zod.def,{shape:PG(e,t)}))}function Ple(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};hc(n,e,Reflect.ownKeys(Wo(e))),hc(n,t,Reflect.ownKeys(Wo(t)));let i=Fi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ot(e,i)}function Dle(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(iv(t,n)):void 0,c={};return hc(c,t,Reflect.ownKeys(Wo(t)),e&&((l,u)=>a&&!a.has(u)?l:new e({type:"optional",innerType:l}))),ot(t,Fi(t._zod.def,{shape:c,checks:[]}))}function Ole(e,t,n){let i=n?new Set(iv(t,n)):void 0,r={};return hc(r,t,Reflect.ownKeys(Wo(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ot(t,Fi(t._zod.def,{shape:r}))}function rr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Eu(e){return typeof e=="string"?e:e?.message}function ov(e,t,n){var i;for(let r=t;rNumber.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function DG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;it.toString(16).padStart(2,"0")).join("")}var BT=class{constructor(...t){}};function YT(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):RG(e,n,i.value)}for(let n of Object.getOwnPropertySymbols(t))RG(e,n,t[n])}function Us(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function QT(e,t,n){return Us(e,t,n,!1)}function Gle(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Us(this,n,i(this))},set(r){Us(this,n,r)}})}return t}function RG(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Us(this,t,n.bind(this))},set(i){Us(this,t,i)}})}function Vle(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var GT,Fs=!1,Ble={configurable:!0,get(){Fs=!0}};function Ue(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&>!==e._zod){GT=void 0;return}GT=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,Ble);let r=Fs;Fs=!1;try{let o=n(this);return Fs?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Fs=Fs||r,o}catch(o){throw delete this[t],Fs=Fs||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function qle(e,t,n,i){let r=Vle(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var sv="~constantCatch";function XT(e){let t=()=>e;return t[sv]=!0,t}var MG,tI=Object.freeze({status:"aborted"}),eI={value:void 0,enumerable:!1},LG="captureStackTrace"in Error?Error:null;function Wle(e){let t=LG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return LG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function R(e,t,n,i){let r={};function o(p){this.def=p,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function c(p,f){if(!p._zod){eI.value=new o(f);try{Object.defineProperty(p,"_zod",eI)}finally{eI.value=void 0}}if(p._zod.traits.has(e))return;if(p._zod.traits.add(e),t(p,f),a){let g=Object.getPrototypeOf(p),h=p._zod.constr.prototype,b=g;for(;b&&b!==h;)b=Object.getPrototypeOf(b);let y=b??g;a.has(y)||(a.add(y),YT(y,s))}let m=d.prototype;for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}let l=i?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(p){let f=i?.Parent?Wle(u):this;c(f,p);let m=f._zod.deferred;if(m){for(let h of m)h();f._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>i?.Parent&&p instanceof i.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var nI=Symbol("zod_brand"),Tr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},js=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(MG=globalThis).__zod_globalConfig??(MG.__zod_globalConfig={});var hn=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign(hn,e),hn}function Hle(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Iu,2)),e.message}function Kle(e){this._zod.message=e}var Jle={get:Hle,set:Kle,enumerable:!0,configurable:!0},iI={value:void 0,enumerable:!1},FG=new WeakSet([Object.prototype,Error.prototype]),UG=(e,t)=>{e.name="$ZodError",iI.value=t,Object.defineProperty(e,"issues",iI),iI.value=void 0,Object.defineProperty(e,"message",Jle);let n=Object.getPrototypeOf(e);FG.has(n)||(FG.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},oI=R("$ZodError",UG),Ir=R("$ZodError",UG,void 0,{Parent:Error});function Zle(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Cm(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?Zle(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Pm(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,l=0;for(;ln.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let l=n,u=0;for(;utypeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function aI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${jG(i.path)}`);return t.join(` -`)}function av(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Cu=e=>{let t=(n,i,r,o)=>{let s=r?{...r,async:!1}:{async:!1},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new Tr;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Er(l,s,zt())));throw rv(c,o?.callee??t),c}return a.value};return t},cv=Cu(Ir),Pu=e=>{let t=async(n,i,r,o)=>{let s=r?{...r,async:!0}:{async:!0},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>Er(l,s,zt())));throw rv(c,o?.callee??t),c}return a.value};return t},lv=Pu(Ir),Du=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Tr;return o.issues.length?zG(e,o.issues,r):{success:!0,data:o.value}},Qle=Du(Ir);function zG(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>Er(r,n,zt()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var Ou=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?zG(e,o.issues,r):{success:!0,data:o.value}},Xle=Ou(Ir),eue=Symbol.for("zod.compile.invalid"),tue=Symbol.for("zod.compile.fallback"),Dm=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==eue)return!0;if(i.definite===!0&&n===void 0)return!1}return nue(e,t,n)});function nue(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[tue]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new Tr;return o.issues.length===0}var Om=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},uv=e=>{let t=Cu(e),n=(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,a,av(n,s))};return n},rue=uv(Ir),dv=e=>{let t=Cu(e),n=(i,r,o,s)=>t(i,r,o,av(n,s));return n},iue=dv(Ir),pv=e=>{let t=Pu(e),n=async(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,a,av(n,s))};return n},oue=pv(Ir),fv=e=>{let t=Pu(e),n=async(i,r,o,s)=>await t(i,r,o,av(n,s));return n},sue=fv(Ir),mv=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Du(e)(t,n,r)},aue=mv(Ir),gv=e=>(t,n,i)=>Du(e)(t,n,i),cue=gv(Ir),hv=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ou(e)(t,n,r)},lue=hv(Ir),yv=e=>async(t,n,i)=>Ou(e)(t,n,i),uue=yv(Ir);var or={};_r(or,{anyString:()=>CI,base64:()=>xI,base64url:()=>EI,bigint:()=>DI,boolean:()=>OI,browserEmail:()=>bue,cidrv4:()=>_I,cidrv6:()=>SI,creditCard:()=>bv,cuid:()=>lI,cuid2:()=>uI,date:()=>AI,datetime:()=>NI,domain:()=>kue,duration:()=>hI,e164:()=>II,email:()=>bI,emoji:()=>vI,extendedDuration:()=>due,guid:()=>yI,hex:()=>_ue,hostname:()=>wue,html5Email:()=>gue,httpProtocol:()=>TI,iban:()=>vv,idnEmail:()=>yue,integer:()=>Mm,ipv4:()=>wI,ipv6:()=>kI,ksuid:()=>fI,lowercase:()=>FI,mac:()=>$I,md5_base64:()=>xue,md5_base64url:()=>Eue,md5_hex:()=>Sue,nanoid:()=>mI,nanoidOfLength:()=>gI,null:()=>MI,number:()=>Ko,rfc5322Email:()=>hue,sha1_base64:()=>Iue,sha1_base64url:()=>Aue,sha1_hex:()=>Tue,sha256_base64:()=>Nue,sha256_base64url:()=>Cue,sha256_hex:()=>Rue,sha384_base64:()=>Due,sha384_base64url:()=>Oue,sha384_hex:()=>Pue,sha512_base64:()=>Lue,sha512_base64url:()=>Fue,sha512_hex:()=>Mue,string:()=>PI,time:()=>RI,ulid:()=>dI,undefined:()=>LI,unicodeEmail:()=>GG,uppercase:()=>UI,uuid:()=>vc,uuid4:()=>pue,uuid6:()=>fue,uuid7:()=>mue,xid:()=>pI});var lI=/^[cC][0-9a-z]{6,}$/,uI=/^[0-9a-z]+$/,dI=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,pI=/^[0-9a-vA-V]{20}$/,fI=/^[A-Za-z0-9]{27}$/,mI=/^[a-zA-Z0-9_-]{21}$/;function gI(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var hI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,due=/^[-+]?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)?)??$/,yI=/^([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})$/,vc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,pue=vc(4),fue=vc(6),mue=vc(7),bI=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gue=/^[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])?)*$/,hue=/^(([^<>()\[\]\\.,;:\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,}))$/,GG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yue=GG,bue=/^[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])?)*$/,vue="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function vI(){return new RegExp(vue,"u")}var wI=/^(?:(?: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])$/,kI=/^(([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}|:))$/,$I=e=>{let t=li(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_I=/^((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])$/,SI=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,EI=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,wue=/^(?=.{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])?)*\.?$/,kue=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,TI=/^https?$/,II=/^\+[1-9]\d{6,14}$/,bv=/^\d(?:[ -]?\d){11,18}$/,vv=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,VG="(?:(?:\\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])))";function $ue(e){return new RegExp(`^${e}$`)}var AI=$ue(VG);function cI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function RI(e){return new RegExp(`^${cI(e)}$`)}function NI(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${cI({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${cI({precision:e.precision})}`:n;return new RegExp(`^${VG}T(?:${i})$`)}var CI=/^[\s\S]{0,}$/,PI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},DI=/^-?\d+n?$/,Mm=/^-?\d+$/,Ko=/^-?\d+(?:\.\d+)?$/,OI=/^(?:true|false)$/i,MI=/^null$/i;var LI=/^undefined$/i;var FI=/^[^A-Z]*$/,UI=/^[^a-z]*$/,_ue=/^[0-9a-fA-F]*$/;function Lm(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Fm(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Sue=/^[0-9a-fA-F]{32}$/,xue=Lm(22,"=="),Eue=Fm(22),Tue=/^[0-9a-fA-F]{40}$/,Iue=Lm(27,"="),Aue=Fm(27),Rue=/^[0-9a-fA-F]{64}$/,Nue=Lm(43,"="),Cue=Fm(43),Pue=/^[0-9a-fA-F]{96}$/,Due=Lm(64,""),Oue=Fm(64),Mue=/^[0-9a-fA-F]{128}$/,Lue=Lm(86,"=="),Fue=Fm(86);var ht=R("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jI=e=>{let t=e.value;return!nv(t)&&t.size!==void 0},zI=e=>{let t=e.value;return!nv(t)&&t.length!==void 0},wv={number:"number",bigint:"bigint",object:"date"},kv=R("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);let n=wv[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value{ht.init(e,t);let n=wv[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:wv[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),GI=R("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):xm(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),VI=R("$ZodCheckNumberFormat",(e,t)=>{ht.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Im[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){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:i,inclusive:!0,continue:!t.abort}):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:i,inclusive:!0,continue:!t.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),BI=R("$ZodCheckBigIntFormat",(e,t)=>{ht.init(e,t);let[n,i]=Am[t.format];e._zod.check=r=>{let o=r.value;oi&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),qI=R("$ZodCheckMaxSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Rm(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),WI=R("$ZodCheckMinSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Rm(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),HI=R("$ZodCheckSizeEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=jI),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:Rm(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),KI=R("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?bc(r):o)<=t.maximum)return;let a=Nm(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),JI=R("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o=t.minimum)return;let a=Nm(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ZI=R("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=zI),e._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=t.length&&o<=t.length*2?bc(r):o;if(s===t.length)return;let a=Nm(r),c=s>t.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Mu=R("$ZodCheckStringFormat",(e,t)=>{var n,i;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),YI=R("$ZodCheckRegex",(e,t)=>{Mu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),QI=R("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=FI),Mu.init(e,t)}),XI=R("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UI),Mu.init(e,t)}),e0=R("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);let n=li(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),t0=R("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`^${li(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),n0=R("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`.*${li(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function BG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues))}var r0=R("$ZodCheckProperty",(e,t)=>{ht.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>BG(r,n,t.property));BG(i,n,t.property)}}),i0=R("$ZodCheckMimeType",(e,t)=>{ht.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),o0=R("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var wc=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(` +`}function zOe(e,t){return()=>e.abort(t.reason)}var g7,POe,MF,v7=j(()=>{kt();Bh();Da();Ce();eo();mr();eM();g7=new TextEncoder,POe=["fallback-credit-2026-07-01"];MF=class{constructor(t=0){this.indexBase=t,this.blocks=[],this.open=[],this.nextIndex=t}contentBlocks(){return this.blocks.map(t=>t.block)}start(t){this.blocks.push({index:t.index,block:{...t.content_block}}),t.index+=this.indexBase,this.open.push(t.index),this.nextIndex=Math.max(this.nextIndex,t.index+1)}delta(t){FOe(this.blocks,t.index,t.delta),t.index+=this.indexBase}stop(t){t.index+=this.indexBase;let n=this.open.indexOf(t.index);n!==-1&&this.open.splice(n,1),this.nextIndex=Math.max(this.nextIndex,t.index+1)}*closeOpenBlocks(){for(let t of this.open)yield _s("content_block_stop",{type:"content_block_stop",index:t});this.open.length=0}}});var w7={};kr(w7,{AI_PROMPT:()=>PF,APIConnectionError:()=>Zi,APIConnectionTimeoutError:()=>gl,APIError:()=>Dt,APIPromise:()=>La,APIUserAbortError:()=>En,Anthropic:()=>no,AnthropicError:()=>J,AuthenticationError:()=>yl,BadRequestError:()=>hl,BaseAnthropic:()=>Ot,BetaFallbackState:()=>Uh,ConflictError:()=>wl,HUMAN_PROMPT:()=>NF,InternalServerError:()=>$l,NotFoundError:()=>vl,PagePromise:()=>mp,PermissionDeniedError:()=>bl,RateLimitError:()=>_l,RetryableError:()=>cp,UnprocessableEntityError:()=>kl,betaRefusalFallbackMiddleware:()=>h7,default:()=>no,toFile:()=>Jh});var YM=j(()=>{DF();AM();F$();v7();DF();Pe();kt()});var VU=require("node:fs/promises"),BU=require("node:fs/promises");var F2=gt(gc(),1);var U={};kr(U,{$brand:()=>cI,$input:()=>D0,$output:()=>P0,INVALID:()=>rr,NEVER:()=>aI,TimePrecision:()=>W0,ZodAny:()=>PC,ZodArray:()=>LC,ZodBase64:()=>ik,ZodBase64URL:()=>ok,ZodBigInt:()=>dd,ZodBigIntFormat:()=>ck,ZodBoolean:()=>ud,ZodCIDRv4:()=>nk,ZodCIDRv6:()=>rk,ZodCUID:()=>Jw,ZodCUID2:()=>Zw,ZodCatch:()=>iN,ZodCodec:()=>vg,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,ZodCreditCard:()=>xC,ZodCustom:()=>wg,ZodCustomStringFormat:()=>Nc,ZodDate:()=>fg,ZodDefault:()=>QC,ZodDiscriminatedUnion:()=>UC,ZodE164:()=>sk,ZodEmail:()=>qw,ZodEmoji:()=>Kw,ZodEnum:()=>ad,ZodError:()=>Ufe,ZodExactOptional:()=>pk,ZodFile:()=>HC,ZodFirstPartyTypeKind:()=>bN,ZodFunction:()=>mN,ZodGUID:()=>Ww,ZodIBAN:()=>EC,ZodIPv4:()=>ek,ZodIPv6:()=>tk,ZodISODate:()=>Hs,ZodISODateTime:()=>Ks,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>yN,ZodIntersection:()=>jC,ZodIssueCode:()=>Gfe,ZodJWT:()=>ak,ZodKSUID:()=>Xw,ZodLazy:()=>dN,ZodLiteral:()=>KC,ZodMAC:()=>SC,ZodMap:()=>qC,ZodNaN:()=>sN,ZodNanoID:()=>Hw,ZodNever:()=>OC,ZodNonOptional:()=>fk,ZodNull:()=>CC,ZodNullable:()=>YC,ZodNumber:()=>ld,ZodNumberFormat:()=>Pc,ZodObject:()=>gg,ZodOptional:()=>yg,ZodPipe:()=>bg,ZodPrefault:()=>eN,ZodPreprocess:()=>aN,ZodPromise:()=>fN,ZodReadonly:()=>cN,ZodRealError:()=>Ir,ZodRecord:()=>sd,ZodSet:()=>WC,ZodString:()=>cd,ZodStringFormat:()=>mt,ZodSuccess:()=>rN,ZodSymbol:()=>AC,ZodTemplateLiteral:()=>uN,ZodTransform:()=>JC,ZodTuple:()=>GC,ZodType:()=>Fe,ZodULID:()=>Yw,ZodURL:()=>pg,ZodUUID:()=>go,ZodUndefined:()=>RC,ZodUnion:()=>hg,ZodUnknown:()=>DC,ZodVoid:()=>MC,ZodXID:()=>Qw,ZodXor:()=>FC,_ZodString:()=>Bw,_default:()=>XC,_function:()=>h2,any:()=>Kq,array:()=>mg,base64:()=>Tq,base64url:()=>Iq,bigint:()=>Gq,boolean:()=>IC,catch:()=>oN,check:()=>y2,cidrv4:()=>xq,cidrv6:()=>Eq,clone:()=>ct,codec:()=>p2,coerce:()=>wN,compile:()=>F0,config:()=>zt,core:()=>Zo,creditCard:()=>Rq,cuid:()=>yq,cuid2:()=>bq,currencyCode:()=>Mq,custom:()=>b2,date:()=>Jq,decode:()=>yC,decodeAsync:()=>vC,deepPartial:()=>C2,describe:()=>v2,discriminatedUnion:()=>t2,e164:()=>Aq,email:()=>aq,emoji:()=>gq,encode:()=>hC,encodeAsync:()=>bC,endsWith:()=>Ju,enum:()=>uk,exactOptional:()=>ZC,file:()=>c2,flattenError:()=>Om,float32:()=>Fq,float64:()=>Uq,formatError:()=>Mm,fromJSONSchema:()=>A2,function:()=>h2,getDiscriminatedOption:()=>a0,getErrorMap:()=>Bfe,globalRegistry:()=>Pn,gt:()=>fo,gte:()=>Gr,guid:()=>cq,hash:()=>Lq,hex:()=>Oq,hostname:()=>Dq,httpUrl:()=>mq,iban:()=>Cq,includes:()=>Ku,input:()=>P2,instanceof:()=>k2,int:()=>Gw,int32:()=>jq,int64:()=>Vq,intersection:()=>zC,invertCodec:()=>f2,ipv4:()=>_q,ipv6:()=>Sq,iso:()=>kg,json:()=>$2,jwt:()=>Nq,keyof:()=>Zq,ksuid:()=>kq,lazy:()=>pN,length:()=>Tc,literal:()=>a2,locales:()=>ng,looseObject:()=>Xq,looseRecord:()=>r2,lowercase:()=>qu,lt:()=>po,lte:()=>zr,mac:()=>$q,map:()=>i2,maxLength:()=>Ec,maxSize:()=>Vs,memoizer:()=>eg,meta:()=>w2,mime:()=>Yu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>Gs,nan:()=>d2,nanoid:()=>hq,nativeEnum:()=>s2,negative:()=>Cw,never:()=>lk,nonnegative:()=>Pw,nonoptional:()=>nN,nonpositive:()=>Nw,normalize:()=>Qu,null:()=>NC,nullable:()=>dg,nullish:()=>l2,number:()=>TC,object:()=>Yq,optional:()=>Rc,output:()=>D2,overwrite:()=>ji,parse:()=>pC,parseAsync:()=>fC,partialRecord:()=>n2,pipe:()=>Vw,positive:()=>Rw,prefault:()=>tN,preprocess:()=>S2,prettifyError:()=>fI,promise:()=>g2,properties:()=>Zu,property:()=>Dw,readonly:()=>lN,record:()=>BC,refine:()=>gN,regex:()=>Bu,regexes:()=>li,registry:()=>ow,safeDecode:()=>kC,safeDecodeAsync:()=>$C,safeEncode:()=>wC,safeEncodeAsync:()=>_C,safeParse:()=>mC,safeParseAsync:()=>gC,set:()=>o2,setErrorMap:()=>Vfe,size:()=>xc,slugify:()=>nd,startsWith:()=>Hu,strictObject:()=>Qq,string:()=>ug,stringFormat:()=>Pq,stringbool:()=>_2,success:()=>u2,superRefine:()=>hN,symbol:()=>qq,templateLiteral:()=>m2,toJSONSchema:()=>Fw,toLowerCase:()=>ed,toUpperCase:()=>td,toZod:()=>xm,transform:()=>dk,treeifyError:()=>pI,trim:()=>Xu,tuple:()=>VC,uint32:()=>zq,uint64:()=>Bq,ulid:()=>vq,undefined:()=>Wq,union:()=>pd,unknown:()=>Ac,uppercase:()=>Wu,url:()=>fq,util:()=>G,uuid:()=>lq,uuidv4:()=>uq,uuidv6:()=>dq,uuidv7:()=>pq,validate:()=>Lm,validateAsync:()=>Fm,void:()=>Hq,withParser:()=>sw,xid:()=>wq,xor:()=>e2});var Zo={};kr(Zo,{$ZodAny:()=>QA,$ZodArray:()=>i0,$ZodAsyncError:()=>Er,$ZodBase64:()=>jA,$ZodBase64URL:()=>zA,$ZodBigInt:()=>qv,$ZodBigIntFormat:()=>HA,$ZodBoolean:()=>Hm,$ZodCIDRv4:()=>FA,$ZodCIDRv6:()=>UA,$ZodCUID:()=>EA,$ZodCUID2:()=>TA,$ZodCatch:()=>$0,$ZodCheck:()=>ht,$ZodCheckBigIntFormat:()=>XI,$ZodCheckEndsWith:()=>dA,$ZodCheckGreaterThan:()=>Av,$ZodCheckIncludes:()=>lA,$ZodCheckLengthEquals:()=>oA,$ZodCheckLessThan:()=>Iv,$ZodCheckLowerCase:()=>aA,$ZodCheckMaxLength:()=>rA,$ZodCheckMaxSize:()=>eA,$ZodCheckMimeType:()=>mA,$ZodCheckMinLength:()=>iA,$ZodCheckMinSize:()=>tA,$ZodCheckMultipleOf:()=>YI,$ZodCheckNumberFormat:()=>QI,$ZodCheckOverwrite:()=>gA,$ZodCheckProperties:()=>fA,$ZodCheckProperty:()=>pA,$ZodCheckRegex:()=>sA,$ZodCheckSizeEquals:()=>nA,$ZodCheckStartsWith:()=>uA,$ZodCheckStringFormat:()=>Uu,$ZodCheckUpperCase:()=>cA,$ZodCodec:()=>Zm,$ZodCreditCard:()=>VA,$ZodCustom:()=>R0,$ZodCustomStringFormat:()=>WA,$ZodCyclicError:()=>Qv,$ZodDate:()=>n0,$ZodDefault:()=>v0,$ZodDiscriminatedUnion:()=>c0,$ZodE164:()=>GA,$ZodEmail:()=>wA,$ZodEmoji:()=>SA,$ZodEncodeError:()=>js,$ZodEnum:()=>f0,$ZodError:()=>dI,$ZodExactOptional:()=>y0,$ZodFile:()=>g0,$ZodFunction:()=>I0,$ZodGUID:()=>bA,$ZodIBAN:()=>BA,$ZodIPv4:()=>OA,$ZodIPv6:()=>MA,$ZodISODate:()=>NA,$ZodISODateTime:()=>CA,$ZodISODuration:()=>DA,$ZodISOTime:()=>PA,$ZodIntersection:()=>l0,$ZodJWT:()=>qA,$ZodKSUID:()=>RA,$ZodLazy:()=>Ym,$ZodLiteral:()=>m0,$ZodMAC:()=>LA,$ZodMap:()=>d0,$ZodNaN:()=>S0,$ZodNanoID:()=>xA,$ZodNever:()=>e0,$ZodNonOptional:()=>k0,$ZodNull:()=>YA,$ZodNullable:()=>b0,$ZodNumber:()=>Bv,$ZodNumberFormat:()=>KA,$ZodObject:()=>yV,$ZodObjectJIT:()=>o0,$ZodOptional:()=>Kv,$ZodPipe:()=>Hv,$ZodPrefault:()=>w0,$ZodPreprocess:()=>x0,$ZodPromise:()=>A0,$ZodReadonly:()=>E0,$ZodRealError:()=>Tr,$ZodRecord:()=>u0,$ZodRegistry:()=>iw,$ZodSet:()=>p0,$ZodString:()=>kc,$ZodStringFormat:()=>lt,$ZodSuccess:()=>_0,$ZodSymbol:()=>JA,$ZodTemplateLiteral:()=>T0,$ZodTransform:()=>h0,$ZodTuple:()=>Wv,$ZodType:()=>Oe,$ZodULID:()=>IA,$ZodURL:()=>$A,$ZodUUID:()=>vA,$ZodUndefined:()=>ZA,$ZodUnion:()=>Jm,$ZodUnknown:()=>XA,$ZodVoid:()=>t0,$ZodXID:()=>AA,$ZodXor:()=>s0,$brand:()=>cI,$constructor:()=>C,$input:()=>D0,$output:()=>P0,Doc:()=>wc,INVALID:()=>rr,JSONSchema:()=>iq,JSONSchemaGenerator:()=>Uw,NEVER:()=>aI,TimePrecision:()=>W0,URL_BAD_FORMAT:()=>kA,URL_UNPARSEABLE:()=>Vm,ZodCompileAsyncError:()=>Ui,ZodCompileUnsupportedError:()=>Ve,_any:()=>lR,_array:()=>hR,_base64:()=>Ew,_base64url:()=>Tw,_bigint:()=>nR,_boolean:()=>eR,_catch:()=>Tfe,_check:()=>GB,_cidrv4:()=>Sw,_cidrv6:()=>xw,_coercedBigint:()=>rR,_coercedBoolean:()=>tR,_coercedDate:()=>mR,_coercedNumber:()=>H0,_coercedString:()=>G0,_creditCard:()=>B0,_cuid:()=>yw,_cuid2:()=>bw,_custom:()=>bR,_date:()=>fR,_decode:()=>yv,_decodeAsync:()=>vv,_default:()=>Sfe,_discriminatedUnion:()=>pfe,_e164:()=>Iw,_email:()=>lw,_emoji:()=>gw,_encode:()=>hv,_encodeAsync:()=>bv,_endsWith:()=>Ju,_enum:()=>bfe,_file:()=>yR,_float32:()=>Z0,_float64:()=>Y0,_gt:()=>fo,_gte:()=>Gr,_guid:()=>uw,_iban:()=>q0,_includes:()=>Ku,_int:()=>J0,_int32:()=>Q0,_int64:()=>iR,_intersection:()=>ffe,_ipv4:()=>_w,_ipv6:()=>$w,_isoDate:()=>og,_isoDateTime:()=>ig,_isoDuration:()=>ag,_isoTime:()=>sg,_jwt:()=>Aw,_ksuid:()=>kw,_lazy:()=>Cfe,_length:()=>Tc,_literal:()=>wfe,_lowercase:()=>qu,_lt:()=>po,_lte:()=>zr,_mac:()=>V0,_map:()=>hfe,_max:()=>zr,_maxLength:()=>Ec,_maxSize:()=>Vs,_mime:()=>Yu,_min:()=>Gr,_minLength:()=>Jo,_minSize:()=>mo,_multipleOf:()=>Gs,_nan:()=>gR,_nanoid:()=>hw,_nativeEnum:()=>vfe,_negative:()=>Cw,_never:()=>dR,_nonnegative:()=>Pw,_nonoptional:()=>xfe,_nonpositive:()=>Nw,_normalize:()=>Qu,_null:()=>cR,_nullable:()=>$fe,_number:()=>K0,_optional:()=>_fe,_overwrite:()=>ji,_parse:()=>Ou,_parseAsync:()=>Mu,_pipe:()=>Ife,_positive:()=>Rw,_promise:()=>Nfe,_properties:()=>Zu,_property:()=>Dw,_readonly:()=>Afe,_record:()=>gfe,_refine:()=>vR,_regex:()=>Bu,_safeDecode:()=>kv,_safeDecodeAsync:()=>$v,_safeEncode:()=>wv,_safeEncodeAsync:()=>_v,_safeParse:()=>Lu,_safeParseAsync:()=>Fu,_set:()=>yfe,_size:()=>xc,_slugify:()=>nd,_startsWith:()=>Hu,_string:()=>z0,_stringFormat:()=>Ic,_stringbool:()=>$R,_success:()=>Efe,_superRefine:()=>wR,_symbol:()=>sR,_templateLiteral:()=>Rfe,_toLowerCase:()=>ed,_toUpperCase:()=>td,_transform:()=>kfe,_trim:()=>Xu,_tuple:()=>mfe,_uint32:()=>X0,_uint64:()=>oR,_ulid:()=>vw,_undefined:()=>aR,_union:()=>ufe,_unknown:()=>uR,_uppercase:()=>Wu,_url:()=>rg,_uuid:()=>dw,_uuidv4:()=>pw,_uuidv6:()=>fw,_uuidv7:()=>mw,_void:()=>pR,_xid:()=>ww,_xor:()=>dfe,base64Charset:()=>Uv,base64urlCharset:()=>Km,canParseURL:()=>_A,clone:()=>ct,compile:()=>F0,compileFn:()=>aw,config:()=>zt,createStandardJSONSchemaMethod:()=>rd,createToJSONSchemaMethod:()=>xR,decode:()=>due,decodeAsync:()=>fue,describe:()=>kR,encode:()=>uue,encodeAsync:()=>pue,extractDefs:()=>qs,finalize:()=>Ws,flattenError:()=>Om,formatError:()=>Mm,getDiscriminatedOption:()=>a0,globalConfig:()=>$n,globalRegistry:()=>Pn,handleUnrepresentable:()=>gn,initializeContext:()=>Bs,isBackEdge:()=>ew,isRecursiveSchema:()=>Xv,isValidBase64:()=>Wm,isValidBase64URL:()=>jv,isValidCIDRv6:()=>Fv,isValidCreditCard:()=>zv,isValidIBAN:()=>Gv,isValidIPv6:()=>qm,isValidJWT:()=>Vv,locales:()=>ng,memoizer:()=>eg,mergeValues:()=>ju,meta:()=>_R,parse:()=>mv,parseAsync:()=>gv,parseURLObject:()=>mV,prettifyError:()=>fI,process:()=>ut,processSchema:()=>ut,regexes:()=>li,registry:()=>ow,safeDecode:()=>gue,safeDecodeAsync:()=>yue,safeEncode:()=>mue,safeEncodeAsync:()=>hue,safeParse:()=>oue,safeParseAsync:()=>sue,standardProps:()=>Dv,stripTabAndNewline:()=>Bm,toDotPath:()=>KG,toJSONSchema:()=>Fw,toZod:()=>xm,treeifyError:()=>pI,urlHostnameOk:()=>Mv,urlProtocolOk:()=>Lv,util:()=>G,validate:()=>Lm,validateAsync:()=>Fm,validateURL:()=>Ov,version:()=>hA,withParser:()=>sw});var G={};kr(G,{BIGINT_FORMAT_RANGES:()=>Rm,CONSTANT_CATCH:()=>pv,Class:()=>YT,NUMBER_FORMAT_RANGES:()=>Am,aborted:()=>nr,allowsEval:()=>eI,assert:()=>xle,assertEqual:()=>kle,assertIs:()=>$le,assertNever:()=>Sle,assertNotEqual:()=>_le,assignProp:()=>Nn,attachSchema:()=>Cm,base64ToUint8Array:()=>zG,base64urlToUint8Array:()=>Ble,cached:()=>Cu,captureStackTrace:()=>uv,cleanEnum:()=>Vle,cleanRegex:()=>Ko,clone:()=>ct,cloneDef:()=>Ile,codePointLength:()=>bc,constantCatch:()=>oI,createTransparentProxy:()=>Dle,defineLazy:()=>QT,defineLazyInternal:()=>Ue,derived:()=>Hle,esc:()=>tr,escapeRegex:()=>ci,explicitlyAborted:()=>rI,extend:()=>Lle,finalizeIssue:()=>xr,floatSafeRemainder:()=>Em,getElementAtPath:()=>Ale,getEnumValues:()=>Au,getLengthableOrigin:()=>Pm,getParsedType:()=>Ple,getSizableOrigin:()=>Nm,hexToUint8Array:()=>Wle,hide:()=>Dm,installLazyProp:()=>Qle,isObject:()=>yc,isPlainObject:()=>ai,issue:()=>Du,joinValues:()=>N,jsonStringifyReplacer:()=>Ru,members:()=>iI,merge:()=>Ule,mergeDefs:()=>Fi,normalizeParams:()=>Q,nullish:()=>lv,numKeys:()=>Nle,objectClone:()=>Ele,omit:()=>Mle,optionalKeys:()=>nI,own:()=>Us,parsedType:()=>K,partial:()=>jle,pick:()=>Ole,prefixIssues:()=>Sr,primitiveTypes:()=>tI,promiseAllObject:()=>Rle,propertyKeyTypes:()=>Im,randomString:()=>Cle,rawShape:()=>Nu,required:()=>zle,safeExtend:()=>Fle,shallowClone:()=>Tm,sizeCaps:()=>Pu,slugify:()=>XT,stringifyPrimitive:()=>V,toZod:()=>xm,uint8ArrayToBase64:()=>GG,uint8ArrayToBase64url:()=>qle,uint8ArrayToHex:()=>Kle,unwrapMessage:()=>Iu});function kle(e){return e}function _le(e){return e}function xm(){return e=>e}function $le(e){}function Sle(e){throw new Error("Unexpected value in exhaustive check")}function xle(e){}function Au(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function N(e,t="|"){return e.map(n=>V(n)).join(t)}function Ru(e,t){return typeof t=="bigint"?t.toString():t}var ZT=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Cu(e){return new ZT(e)}function lv(e){return e==null}function Ko(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Em(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i){let a=t._zod.def.shape[o];return i?i(a,o):a}):UG(e,o,i?i(s.value,o):s.value))}}function Tle(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?FG(e,n,()=>t[n]):UG(e,n,i.value))}}function Fi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function Ile(e){return Fi(e._zod.def)}function Ale(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function Rle(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o{};function yc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var eI=Cu(()=>{if($n.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ai(e){if(yc(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(yc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Tm(e){return ai(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Nle(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Ple=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Im=new Set(["string","number","symbol"]),tI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ci(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ct(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Dle(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function V(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function nI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Am={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Rm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ole(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return hc(o,e,dv(e,t)),ct(e,Fi(n,{shape:o,checks:[]}))}function dv(e,t){let n=Wo(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function Mle(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(dv(e,t)),s={};return hc(s,e,Reflect.ownKeys(Wo(e)).filter(a=>!o.has(a))),ct(e,Fi(n,{shape:s,checks:[]}))}function Lle(e,t){if(!ai(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=Wo(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ct(e,Fi(e._zod.def,{shape:jG(e,t)}))}function jG(e,t){let n={};return hc(n,e,Reflect.ownKeys(Wo(e))),Tle(n,t),n}function Fle(e,t){if(!ai(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ct(e,Fi(e._zod.def,{shape:jG(e,t)}))}function Ule(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};hc(n,e,Reflect.ownKeys(Wo(e))),hc(n,t,Reflect.ownKeys(Wo(t)));let i=Fi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ct(e,i)}function jle(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(dv(t,n)):void 0,c={};return hc(c,t,Reflect.ownKeys(Wo(t)),e&&((l,u)=>a&&!a.has(u)?l:new e({type:"optional",innerType:l}))),ct(t,Fi(t._zod.def,{shape:c,checks:[]}))}function zle(e,t,n){let i=n?new Set(dv(t,n)):void 0,r={};return hc(r,t,Reflect.ownKeys(Wo(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ct(t,Fi(t._zod.def,{shape:r}))}function nr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Iu(e){return typeof e=="string"?e:e?.message}function Pu(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function Cm(e,t,n){var i;for(let r=t;rNumber.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function zG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;it.toString(16).padStart(2,"0")).join("")}var YT=class{constructor(...t){}};function iI(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):Jle(e,n,i.value)}}function Us(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function Dm(e,t,n){return Us(e,t,n,!1)}function Hle(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Us(this,n,i(this))},set(r){Us(this,n,r)}})}return t}function Jle(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Us(this,t,n.bind(this))},set(i){Us(this,t,i)}})}function Zle(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var JT,Fs=!1,Yle={configurable:!0,get(){Fs=!0}};function Ue(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&JT!==e._zod){JT=void 0;return}JT=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,Yle);let r=Fs;Fs=!1;try{let o=n(this);return Fs?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),Fs=Fs||r,o}catch(o){throw delete this[t],Fs=Fs||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function Qle(e,t,n,i){let r=Zle(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var pv="~constantCatch";function oI(e){let t=()=>e;return t[pv]=!0,t}var VG,aI=Object.freeze({status:"aborted"}),sI={value:void 0,enumerable:!1},BG="captureStackTrace"in Error?Error:null;function Xle(e){let t=BG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return BG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function C(e,t,n,i){let r={};function o(p){this.def=p,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function c(p,f){if(p._zod){if(p._zod.traits.has(e))return}else{sI.value=new o(f);try{Object.defineProperty(p,"_zod",sI)}finally{sI.value=void 0}}if(p._zod.traits.add(e),t(p,f),a){let g=Object.getPrototypeOf(p),h=p._zod.constr.prototype,b=g;for(;b&&b!==h;)b=Object.getPrototypeOf(b);let y=b??g;a.has(y)||(a.add(y),iI(y,s))}let m=d.prototype;for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in p||(p[g]=m[g].bind(p)))}let l=i?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(p){let f=i?.Parent?Xle(u):this;c(f,p);let m=f._zod.deferred;if(m){for(let h of m)h();f._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(f),f}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>i?.Parent&&p instanceof i.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var cI=Symbol("zod_brand"),Er=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},js=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(VG=globalThis).__zod_globalConfig??(VG.__zod_globalConfig={});var $n=globalThis.__zod_globalConfig;function zt(e){return e&&Object.assign($n,e),$n}function eue(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Ru,2)),e.message}function tue(e){this._zod.message=e}var nue={get:eue,set:tue,enumerable:!0,configurable:!0},uI={value:void 0,enumerable:!1},qG=new WeakSet([Object.prototype,Error.prototype]),WG=(e,t)=>{e.name="$ZodError",uI.value=t,Object.defineProperty(e,"issues",uI),uI.value=void 0,Object.defineProperty(e,"message",nue);let n=Object.getPrototypeOf(e);qG.has(n)||(qG.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},dI=C("$ZodError",WG),Tr=C("$ZodError",WG,void 0,{Parent:Error});function rue(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Om(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?rue(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Mm(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,l=0;for(;ln.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let c=[...o,...a.path];if(c.length===0){n.errors.push(t(a));continue}let l=n,u=0;for(;utypeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function fI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${KG(i.path)}`);return t.join(` +`)}function fv(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ou=e=>{let t=(n,i,r,o)=>{let s=r?{...r,async:!1}:{async:!1},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new Er;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>xr(l,s,zt())));throw uv(c,o?.callee??t),c}return a.value};return t},mv=Ou(Tr),Mu=e=>{let t=async(n,i,r,o)=>{let s=r?{...r,async:!0}:{async:!0},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(l=>xr(l,s,zt())));throw uv(c,o?.callee??t),c}return a.value};return t},gv=Mu(Tr),Lu=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Er;return o.issues.length?HG(e,o.issues,r):{success:!0,data:o.value}},oue=Lu(Tr);function HG(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>xr(r,n,zt()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var Fu=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?HG(e,o.issues,r):{success:!0,data:o.value}},sue=Fu(Tr),aue=Symbol.for("zod.compile.invalid"),cue=Symbol.for("zod.compile.fallback"),Lm=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==aue)return!0;if(i.definite===!0&&n===void 0)return!1}return lue(e,t,n)});function lue(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[cue]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new Er;return o.issues.length===0}var Fm=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},hv=e=>{let t=Ou(e),n=(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,a,fv(n,s))};return n},uue=hv(Tr),yv=e=>{let t=Ou(e),n=(i,r,o,s)=>t(i,r,o,fv(n,s));return n},due=yv(Tr),bv=e=>{let t=Mu(e),n=async(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,a,fv(n,s))};return n},pue=bv(Tr),vv=e=>{let t=Mu(e),n=async(i,r,o,s)=>await t(i,r,o,fv(n,s));return n},fue=vv(Tr),wv=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Lu(e)(t,n,r)},mue=wv(Tr),kv=e=>(t,n,i)=>Lu(e)(t,n,i),gue=kv(Tr),_v=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Fu(e)(t,n,r)},hue=_v(Tr),$v=e=>async(t,n,i)=>Fu(e)(t,n,i),yue=$v(Tr);var li={};kr(li,{anyString:()=>jI,base64:()=>CI,base64url:()=>NI,bigint:()=>GI,boolean:()=>VI,browserEmail:()=>xue,cidrv4:()=>AI,cidrv6:()=>RI,creditCard:()=>Sv,cuid:()=>gI,cuid2:()=>hI,currencyCode:()=>MI,date:()=>LI,datetime:()=>UI,domain:()=>DI,duration:()=>_I,e164:()=>OI,email:()=>SI,emoji:()=>xI,extendedDuration:()=>bue,guid:()=>$I,hex:()=>HI,hostname:()=>PI,html5Email:()=>_ue,httpProtocol:()=>Um,iban:()=>xv,idnEmail:()=>Sue,integer:()=>jm,ipv4:()=>EI,ipv6:()=>TI,ksuid:()=>vI,lowercase:()=>WI,mac:()=>II,md5_base64:()=>Aue,md5_base64url:()=>Rue,md5_hex:()=>Iue,nanoid:()=>wI,nanoidOfLength:()=>kI,null:()=>BI,number:()=>Ho,rfc5322Email:()=>$ue,sha1_base64:()=>Nue,sha1_base64url:()=>Pue,sha1_hex:()=>Cue,sha256_base64:()=>Oue,sha256_base64url:()=>Mue,sha256_hex:()=>Due,sha384_base64:()=>Fue,sha384_base64url:()=>Uue,sha384_hex:()=>Lue,sha512_base64:()=>zue,sha512_base64url:()=>Gue,sha512_hex:()=>jue,string:()=>zI,time:()=>FI,ulid:()=>yI,undefined:()=>qI,unicodeEmail:()=>JG,uppercase:()=>KI,uuid:()=>vc,uuid4:()=>vue,uuid6:()=>wue,uuid7:()=>kue,xid:()=>bI});var gI=/^[cC][0-9a-z]{6,}$/,hI=/^[0-9a-z]+$/,yI=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,bI=/^[0-9a-vA-V]{20}$/,vI=/^[A-Za-z0-9]{27}$/,wI=/^[a-zA-Z0-9_-]{21}$/;function kI(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var _I=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bue=/^[-+]?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)?)??$/,$I=/^([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})$/,vc=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vue=vc(4),wue=vc(6),kue=vc(7),SI=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_ue=/^[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])?)*$/,$ue=/^(([^<>()\[\]\\.,;:\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,}))$/,JG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Sue=JG,xue=/^[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])?)*$/,Eue="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function xI(){return new RegExp(Eue,"u")}var EI=/^(?:(?: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])$/,TI=/^(([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}|:))$/,II=e=>{let t=ci(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},AI=/^((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])$/,RI=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,CI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,NI=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,PI=/^(?=.{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])?)*\.?$/,DI=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Um=/^https?$/,OI=/^\+[1-9]\d{6,14}$/,Sv=/^\d(?:[ -]?\d){11,18}$/,MI=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,xv=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,ZG="(?:(?:\\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])))";function Tue(e){return new RegExp(`^${e}$`)}var LI=Tue(ZG);function mI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function FI(e){return new RegExp(`^${mI(e)}$`)}function UI(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${mI({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${mI({precision:e.precision})}`:n;return new RegExp(`^${ZG}T(?:${i})$`)}var jI=/^[\s\S]{0,}$/,zI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},GI=/^-?\d+n?$/,jm=/^-?\d+$/,Ho=/^-?\d+(?:\.\d+)?$/,VI=/^(?:true|false)$/i,BI=/^null$/i;var qI=/^undefined$/i;var WI=/^[^A-Z]*$/,KI=/^[^a-z]*$/,HI=/^[0-9a-fA-F]*$/;function zm(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Gm(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Iue=/^[0-9a-fA-F]{32}$/,Aue=zm(22,"=="),Rue=Gm(22),Cue=/^[0-9a-fA-F]{40}$/,Nue=zm(27,"="),Pue=Gm(27),Due=/^[0-9a-fA-F]{64}$/,Oue=zm(43,"="),Mue=Gm(43),Lue=/^[0-9a-fA-F]{96}$/,Fue=zm(64,""),Uue=Gm(64),jue=/^[0-9a-fA-F]{128}$/,zue=zm(86,"=="),Gue=Gm(86);var ht=C("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),JI=e=>{let t=e.value;return!lv(t)&&t.size!==void 0},ZI=e=>{let t=e.value;return!lv(t)&&t.length!==void 0},Ev={number:"number",bigint:"bigint",object:"date"},Iv=C("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);let n=Ev[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value{ht.init(e,t);let n=Ev[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Ev[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),YI=C("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Em(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),QI=C("$ZodCheckNumberFormat",(e,t)=>{ht.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Am[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){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:i,inclusive:!0,continue:!t.abort}):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:i,inclusive:!0,continue:!t.abort});return}}ao&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),XI=C("$ZodCheckBigIntFormat",(e,t)=>{ht.init(e,t);let[n,i]=Rm[t.format];e._zod.check=r=>{let o=r.value;oi&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),eA=C("$ZodCheckMaxSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=JI),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Nm(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),tA=C("$ZodCheckMinSize",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=JI),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Nm(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nA=C("$ZodCheckSizeEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=JI),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:Nm(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),rA=C("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=ZI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?bc(r):o)<=t.maximum)return;let a=Pm(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),iA=C("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=ZI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o=t.minimum)return;let a=Pm(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),oA=C("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=ZI),e._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=t.length&&o<=t.length*2?bc(r):o;if(s===t.length)return;let a=Pm(r),c=s>t.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Uu=C("$ZodCheckStringFormat",(e,t)=>{var n,i;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),sA=C("$ZodCheckRegex",(e,t)=>{Uu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),aA=C("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=WI),Uu.init(e,t)}),cA=C("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=KI),Uu.init(e,t)}),lA=C("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);let n=ci(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),uA=C("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`^${ci(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),dA=C("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);let n=new RegExp(`.*${ci(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Tv(e,t,n){e.issues.length&&t.issues.push(...Sr(n,e.issues))}var pA=C("$ZodCheckProperty",(e,t)=>{ht.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Tv(r,n,t.property));Tv(i,n,t.property)}}),fA=C("$ZodCheckProperties",(e,t)=>{ht.init(e,t),Dm(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let r=i.value,o;for(let[s,a]of n){let c=a._zod.run({value:r[s],issues:[]},{});c instanceof Promise?(o??(o=[]),o.push(c.then(l=>Tv(l,i,s)))):Tv(c,i,s)}if(o)return Promise.all(o).then(()=>{})}}),mA=C("$ZodCheckMimeType",(e,t)=>{ht.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),gA=C("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var wc=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(` `).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { ${n.join(` `)} -};`)(...Object.values(this.closed))}};var s0={major:4,minor:6,patch:2};var Ce=R("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=s0;let i=e._zod.def.checks,r=e._zod.traits.has("$ZodCheck")?[e,...i??[]]:i?.length?[...i]:[];for(let o of r)for(let s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(a,c,l)=>{if(a.memo)return a;let u=rr(a),d;for(let p of c){if(p._zod.def.when){if(ZT(a)||!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new Tr;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==f&&(ov(a.issues,f,e),u||(u=rr(a,f)))});else{if(a.issues.length===f)continue;ov(a.issues,f,e),u||(u=rr(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(rr(a))return a.aborted=!0,a;let u=o(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Tr;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}let l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Tr;return l.then(u=>o(u,r,c))}return o(l,r,c)}}},{get"~standard"(){return QT(this,"~standard",Tv(this))},set"~standard"(e){Us(this,"~standard",e)}}),cV=(e,t)=>e.issues.length?{issues:e.issues.map(n=>Er(n,t,zt()))}:{value:e.value};async function Uue(e,t){let n={async:!0};return cV(await e._zod.run({value:t,issues:[]},n),n)}function Tv(e){return{validate:t=>{let n={async:!1};try{let i=e._zod.run({value:t,issues:[]},n);if(!(i instanceof Promise))return cV(i,n)}catch{}return Uue(e,t)},vendor:"zod",version:1}}var kc=R("$ZodString",(e,t)=>{Ce.init(e,t),e._zod.pattern=t.pattern??CI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ut=R("$ZodStringFormat",(e,t)=>{Mu.init(e,t),kc.init(e,t)}),c0=R("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=yI),ut.init(e,t)}),l0=R("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vc(i))}else t.pattern??(t.pattern=vc());ut.init(e,t)}),u0=R("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=bI),ut.init(e,t)}),d0=1,p0=2;function Iv(e,t){if(!t.normalize&&t.protocol?.source===TI.source&&!/^https?:\/\//i.test(e))return d0;try{return new URL(e)}catch{return p0}}var jue=/[\t\n\r]/g;function Av(e){return e.replace(jue,"")}function Rv(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nv(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var f0=R("$ZodURL",(e,t)=>{ut.init(e,t),e._zod.check=n=>{try{let i=n.value.trim(),r=Iv(i,t);if(r===d0){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(r===p0){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Rv(r,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Nv(r,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?r.href:Av(i);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),m0=R("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vI()),ut.init(e,t)}),g0=R("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?mI:gI(t.length)),ut.init(e,t)}),h0=R("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lI),ut.init(e,t)}),y0=R("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=uI),ut.init(e,t)}),b0=R("$ZodULID",(e,t)=>{t.pattern??(t.pattern=dI),ut.init(e,t)}),v0=R("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pI),ut.init(e,t)}),w0=R("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fI),ut.init(e,t)}),k0=R("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=NI(t)),ut.init(e,t)}),$0=R("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=AI),ut.init(e,t)}),_0=R("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RI(t)),ut.init(e,t)}),S0=R("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hI),ut.init(e,t)}),x0=R("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=wI),ut.init(e,t)}),zue=/^[0-9a-fA-F:.]+$/;function Um(e){if(!zue.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var E0=R("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kI),ut.init(e,t),e._zod.check=n=>{Um(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),T0=R("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=$I(t.delimiter)),ut.init(e,t)}),I0=R("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_I),ut.init(e,t)});function Cv(e){let t=e.split("/");if(t.length!==2)return!1;let[n,i]=t;if(!i)return!1;let r=Number(i);return`${r}`!==i||r<0||r>128?!1:Um(n)}var A0=R("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=SI),ut.init(e,t),e._zod.check=n=>{Cv(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function jm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Pv=/^[0-9a-zA-Z+/]*={0,2}$/,R0=R("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Pv),ut.init(e,t),e._zod.check=n=>{jm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),zm=/^[A-Za-z0-9_-]*$/;function Dv(e){if(!zm.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return jm(n)}var N0=R("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=zm),ut.init(e,t),e._zod.check=n=>{Dv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),C0=R("$ZodE164",(e,t)=>{t.pattern??(t.pattern=II),ut.init(e,t)}),Gue=/[- ]/g;function Vue(e){let t=e.length,n=1,i=0;for(;t;){let r=e.charCodeAt(--t)-48;n^=1,i+=n?[0,2,4,6,8,1,3,5,7,9][r]:r}return i%10===0}function Ov(e){return bv.test(e)?Vue(e.replace(Gue,"")):!1}var P0=R("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=bv),ut.init(e,t),e._zod.check=n=>{Ov(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function Bue(e){let t=0,n=e.length;for(let i=4;i=65?t*100+(r-55):t*10+(r-48))%97}for(let i=0;i<4;i++){let r=e.charCodeAt(i);t=(r>=65?t*100+(r-55):t*10+(r-48))%97}return t===1}function Mv(e){return vv.test(e)?Bue(e):!1}var D0=R("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=vv),ut.init(e,t),e._zod.check=n=>{Mv(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function Lv(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var O0=R("$ZodJWT",(e,t)=>{ut.init(e,t),e._zod.check=n=>{Lv(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),M0=R("$ZodCustomStringFormat",(e,t)=>{ut.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Fv=R("$ZodNumber",(e,t)=>{Ce.init(e,t),e._zod.pattern=Ko,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:String(r):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),L0=R("$ZodNumberFormat",(e,t)=>{VI.init(e,t),Fv.init(e,t)}),Gm=R("$ZodBoolean",(e,t)=>{Ce.init(e,t),e._zod.pattern=OI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Uv=R("$ZodBigInt",(e,t)=>{Ce.init(e,t),e._zod.pattern=DI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),F0=R("$ZodBigIntFormat",(e,t)=>{BI.init(e,t),Uv.init(e,t)}),U0=R("$ZodSymbol",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),j0=R("$ZodUndefined",(e,t)=>{Ce.init(e,t),e._zod.pattern=LI,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),z0=R("$ZodNull",(e,t)=>{Ce.init(e,t),e._zod.pattern=MI,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),G0=R("$ZodAny",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),V0=R("$ZodUnknown",(e,t)=>{Ce.init(e,t),e._zod.parse=n=>n}),B0=R("$ZodNever",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),q0=R("$ZodVoid",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),W0=R("$ZodDate",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),n}});function WG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues)),t.value[n]=e.value}var H0=R("$ZodArray",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),i;i.value=n?n.alloc(e,i,Array(o.length),r):Array(o.length);let s=[],a=r?.abortEarly;for(let c=0;cWG(d,i,c)));else if(WG(u,i,c),a&&u.issues.length!==0&&rr(u))break}return s.length?Promise.all(s).then(()=>i):i}});function Ev(e,t,n,i,r,o){let s=n in i,a=o==="optional";if(!(!s&&a&&r==="optional")){if(e.issues.length){if(r!==void 0&&a&&!s)return;t.issues.push(...ir(n,e.issues))}if(!s&&r===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||r==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var que=[];function lV(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),i=n.length?n:que,r=i.length?[...t,...i]:t;for(let s of r)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=JT(e.shape);return{...e,allKeys:r,symbolKeys:i,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function uV(e,t,n,i,r,o,s){let a=[],c=r.keySet,l=r.catchall._zod,u=l.def.type,d=l.optin,p=l.optout,f=0;for(let m in t){if(s&&n.issues.length!==f){if(rr(n,f))break;f=n.issues.length}if(c.has(m))continue;if(m==="__proto__"){u==="never"&&a.push(m);continue}if(u==="never"){a.push(m);continue}let g=l.run({value:t[m],issues:[]},i);g instanceof Promise?e.push(g.then(h=>Ev(h,n,m,t,d,p))):Ev(g,n,m,t,d,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var dV=R("$ZodObject",(e,t)=>{Ce.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let l=()=>{let u={...i};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=i,Object.defineProperty(t,"shape",{get:l})}let r=Au(()=>lV(t));Ue(e,"propValues",l=>{let u=l.def.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,p)||Sn(d,p,new Set);for(let m of f.values)d[p].add(m);f.optin!==void 0&&d[p].add(void 0)}}return d});let o=yc,s=t.catchall,a,c=hn.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{a??(a=r.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let p=[],f=a.shape,m=u?.abortEarly,g=l.issues.length;for(let h of a.allKeys){if(m&&l.issues.length!==g){if(rr(l,g))break;g=l.issues.length}if(h==="__proto__")continue;let b=f[h],y=b._zod.optin,w=b._zod.optout,k=b._zod.run({value:d[h],issues:[]},u);k instanceof Promise?p.push(k.then(_=>Ev(_,l,h,d,y,w))):Ev(k,l,h,d,y,w)}return s?uV(p,d,l,u,r.value,e,m===!0):p.length?Promise.all(p).then(()=>l):l}}),K0=R("$ZodObjectJIT",(e,t)=>{dV.init(e,t);let n=e._zod.parse,i=Au(()=>lV(t)),r=hn.memoizer,o=f=>{let m=i.value,g=m.symbolKeys,h=new wc(["payload","ctx"],{shape:f,inst:e,memo:r,syms:g}),b=_=>`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`,y=(_,S)=>` - let ${_}_ab = false; - for (let i = 0; i < ${_}.issues.length; i++) { - const iss = ${_}.issues[i]; +};`)(...Object.values(this.closed))}};var hA={major:4,minor:6,patch:7};var Oe=C("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hA;let i=e._zod.def.checks,r=e._zod.traits.has("$ZodCheck")?[e,...i??[]]:i?.length?[...i]:[];for(let o of r)for(let s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(a,c,l)=>{if(a.memo)return a;let u=nr(a),d;for(let p of c){if(p._zod.def.when){if(rI(a)||!p._zod.def.when(a))continue}else if(u)continue;let f=a.issues.length,m=p._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new Er;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==f&&(Cm(a.issues,f,e),u||(u=nr(a,f)))});else{if(a.issues.length===f)continue;Cm(a.issues,f,e),u||(u=nr(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(nr(a))return a.aborted=!0,a;let u=o(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Er;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}let l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Er;return l.then(u=>o(u,r,c))}return o(l,r,c)}}},{get"~standard"(){return Dm(this,"~standard",Dv(this))},set"~standard"(e){Us(this,"~standard",e)}}),fV=(e,t)=>e.issues.length?{issues:e.issues.map(n=>xr(n,t,zt()))}:{value:e.value};async function Vue(e,t){let n={async:!0};return fV(await e._zod.run({value:t,issues:[]},n),n)}function Dv(e){return{validate:t=>{let n={async:!1};try{let i=e._zod.run({value:t,issues:[]},n);if(!(i instanceof Promise))return fV(i,n)}catch{}return Vue(e,t)},vendor:"zod",version:1}}var kc=C("$ZodString",(e,t)=>{Oe.init(e,t),e._zod.pattern=t.pattern??jI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),lt=C("$ZodStringFormat",(e,t)=>{Uu.init(e,t),kc.init(e,t)}),bA=C("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$I),lt.init(e,t)}),vA=C("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vc(i))}else t.pattern??(t.pattern=vc());lt.init(e,t)}),wA=C("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=SI),lt.init(e,t)}),kA=1,Vm=2;function _A(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ov(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?_A(e)||Vm:mV(e,t)}function mV(e,t){if(!t.normalize&&t.protocol?.source===Um.source&&!/^https?:\/\//i.test(e))return kA;try{if(typeof URL<"u"){let n=URL;if(typeof n.parse=="function")return n.parse(e)??Vm}return new URL(e)}catch{return Vm}}var Bue=/[\t\n\r]/g;function Bm(e){return e.replace(Bue,"")}function Mv(e,t){return t.lastIndex=0,t.test(e.hostname)}function Lv(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var $A=C("$ZodURL",(e,t)=>{lt.init(e,t),e._zod.check=n=>{try{let i=n.value.trim(),r=Ov(i,t);if(r===kA){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(r===Vm){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(r===!0){n.value=Bm(i);return}t.hostname&&!Mv(r,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Lv(r,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?r.href:Bm(i);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),SA=C("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=xI()),lt.init(e,t)}),xA=C("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?wI:kI(t.length)),lt.init(e,t)}),EA=C("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gI),lt.init(e,t)}),TA=C("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=hI),lt.init(e,t)}),IA=C("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yI),lt.init(e,t)}),AA=C("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bI),lt.init(e,t)}),RA=C("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vI),lt.init(e,t)}),CA=C("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=UI(t)),lt.init(e,t)}),NA=C("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=LI),lt.init(e,t)}),PA=C("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=FI(t)),lt.init(e,t)}),DA=C("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_I),lt.init(e,t)}),OA=C("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=EI),lt.init(e,t)}),que=/^[0-9a-fA-F:.]+$/;function qm(e){return que.test(e)?_A(`http://[${e}]`):!1}var MA=C("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=TI),lt.init(e,t),e._zod.check=n=>{qm(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),LA=C("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=II(t.delimiter)),lt.init(e,t)}),FA=C("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=AI),lt.init(e,t)});function Fv(e){let t=e.split("/");if(t.length!==2)return!1;let[n,i]=t;if(!i)return!1;let r=Number(i);return`${r}`!==i||r<0||r>128?!1:qm(n)}var UA=C("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=RI),lt.init(e,t),e._zod.check=n=>{Fv(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Wm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Uv=/^[0-9a-zA-Z+/]*={0,2}$/,jA=C("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Uv),lt.init(e,t),e._zod.check=n=>{Wm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Km=/^[A-Za-z0-9_-]*$/;function jv(e){if(!Km.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Wm(n)}var zA=C("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Km),lt.init(e,t),e._zod.check=n=>{jv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),GA=C("$ZodE164",(e,t)=>{t.pattern??(t.pattern=OI),lt.init(e,t)}),Wue=/[- ]/g;function Kue(e){let t=e.length,n=1,i=0;for(;t;){let r=e.charCodeAt(--t)-48;n^=1,i+=n?[0,2,4,6,8,1,3,5,7,9][r]:r}return i%10===0}function zv(e){return Sv.test(e)?Kue(e.replace(Wue,"")):!1}var VA=C("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=Sv),lt.init(e,t),e._zod.check=n=>{zv(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function Hue(e){let t=0,n=e.length;for(let i=4;i=65?t*100+(r-55):t*10+(r-48))%97}for(let i=0;i<4;i++){let r=e.charCodeAt(i);t=(r>=65?t*100+(r-55):t*10+(r-48))%97}return t===1}function Gv(e){return xv.test(e)?Hue(e):!1}var BA=C("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=xv),lt.init(e,t),e._zod.check=n=>{Gv(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function Vv(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var qA=C("$ZodJWT",(e,t)=>{lt.init(e,t),e._zod.check=n=>{Vv(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),WA=C("$ZodCustomStringFormat",(e,t)=>{lt.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Bv=C("$ZodNumber",(e,t)=>{Oe.init(e,t),e._zod.pattern=Ho,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:String(r):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}}),KA=C("$ZodNumberFormat",(e,t)=>{QI.init(e,t),Bv.init(e,t)}),Hm=C("$ZodBoolean",(e,t)=>{Oe.init(e,t),e._zod.pattern=VI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),qv=C("$ZodBigInt",(e,t)=>{Oe.init(e,t),e._zod.pattern=GI,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),HA=C("$ZodBigIntFormat",(e,t)=>{XI.init(e,t),qv.init(e,t)}),JA=C("$ZodSymbol",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),ZA=C("$ZodUndefined",(e,t)=>{Oe.init(e,t),e._zod.pattern=qI,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),YA=C("$ZodNull",(e,t)=>{Oe.init(e,t),e._zod.pattern=BI,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),QA=C("$ZodAny",(e,t)=>{Oe.init(e,t),e._zod.parse=n=>n}),XA=C("$ZodUnknown",(e,t)=>{Oe.init(e,t),e._zod.parse=n=>n}),e0=C("$ZodNever",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),t0=C("$ZodVoid",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),n0=C("$ZodDate",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),n}});function r0(e,t){let n=Pu(e._zod.def.checks);if(!n.length)return;let i=Math.min(...n.map(o=>o[0])),r=e._zod.parse;e._zod.parse=(o,s)=>{let a=t(o.value);if(a>i&&!s?.skipChecks&&s?.direction!=="backward"){for(let[c,l]of Pu(e._zod.def.checks))if(a>c&&l._zod.def.when(o)){let u=o.issues.length;return l._zod.check(o),o.issues[u].continue=!1,Cm(o.issues,u,e),o}}return r(o,s)}}var Jue=e=>Array.isArray(e)?e.length:-1,Zue=e=>e instanceof Map?e.size:-1,Yue=e=>e instanceof Set?e.size:-1;function QG(e,t,n){e.issues.length&&t.issues.push(...Sr(n,e.issues)),t.value[n]=e.value}var i0=C("$ZodArray",(e,t)=>{Oe.init(e,t);let n=$n.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),i;i.value=n?n.alloc(e,i,Array(o.length),r):Array(o.length);let s=[],a=r?.abortEarly;for(let c=0;cQG(d,i,c)));else if(QG(u,i,c),a&&u.issues.length!==0&&nr(u))break}return s.length?Promise.all(s).then(()=>i):i},r0(e,Jue)});function Pv(e,t,n,i,r,o){let s=n in i,a=o==="optional";if(!(!s&&a&&r==="optional")){if(e.issues.length){if(r!==void 0&&a&&!s)return;t.issues.push(...Sr(n,e.issues))}if(!s&&r===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(s||r==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var Que=[];function gV(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),i=n.length?n:Que,r=i.length?[...t,...i]:t;for(let s of r)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let o=nI(e.shape);return{...e,allKeys:r,symbolKeys:i,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function hV(e,t,n,i,r,o,s){let a=[],c=r.keySet,l=r.catchall._zod,u=l.def.type,d=l.optin,p=l.optout,f=0;for(let m in t){if(s&&n.issues.length!==f){if(nr(n,f))break;f=n.issues.length}if(c.has(m))continue;if(m==="__proto__"){u==="never"&&a.push(m);continue}if(u==="never"){a.push(m);continue}let g=l.run({value:t[m],issues:[]},i);g instanceof Promise?e.push(g.then(h=>Pv(h,n,m,t,d,p))):Pv(g,n,m,t,d,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var yV=C("$ZodObject",(e,t)=>{Oe.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let l=()=>{let u={...i};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=i,Object.defineProperty(t,"shape",{get:l})}let r=Cu(()=>gV(t));Ue(e,"propValues",l=>{let u=l.def.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){Object.prototype.hasOwnProperty.call(d,p)||Nn(d,p,new Set);for(let m of f.values)d[p].add(m);f.optin!==void 0&&d[p].add(void 0)}}return d});let o=yc,s=t.catchall,a,c=$n.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{a??(a=r.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let p=[],f=a.shape,m=u?.abortEarly,g=l.issues.length;for(let h of a.allKeys){if(m&&l.issues.length!==g){if(nr(l,g))break;g=l.issues.length}if(h==="__proto__")continue;let b=f[h],y=b._zod.optin,w=b._zod.optout,k=b._zod.run({value:d[h],issues:[]},u);k instanceof Promise?p.push(k.then($=>Pv($,l,h,d,y,w))):Pv(k,l,h,d,y,w)}return s?hV(p,d,l,u,r.value,e,m===!0):p.length?Promise.all(p).then(()=>l):l}}),o0=C("$ZodObjectJIT",(e,t)=>{yV.init(e,t);let n=e._zod.parse,i=Cu(()=>gV(t)),r=$n.memoizer,o=f=>{let m=i.value,g=m.symbolKeys,h=new wc(["payload","ctx"],{shape:f,inst:e,memo:r,syms:g}),b=$=>`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`,y=($,S)=>` + let ${$}_ab = false; + for (let i = 0; i < ${$}.issues.length; i++) { + const iss = ${$}.issues[i]; iss.path = iss.path ? [${S}, ...iss.path] : [${S}]; payload.issues.push(iss); - if (iss.continue !== true) ${_}_ab = true; + if (iss.continue !== true) ${$}_ab = true; } - if (${_}_ab && ctx && ctx.abortEarly) { + if (${$}_ab && ctx && ctx.abortEarly) { payload.value = newResult; return payload; - }`;h.write("const input = payload.value;");let w=Object.create(null),k=0;for(let _ of m.allKeys)w[_]=`key_${k++}`;h.write(r?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let _ of m.allKeys){if(_==="__proto__")continue;let S=w[_],x=typeof _=="symbol"?`syms[${g.indexOf(_)}]`:nr(_),E=`${x} in input`,T=f[_],A=T?._zod?.optin,L=A!==void 0,F=T?._zod?.optout==="optional";if(h.write(`const ${S} = ${b(x)};`),L&&F){let K=A==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;h.write(` + }`;h.write("const input = payload.value;");let w=Object.create(null),k=0;for(let $ of m.allKeys)w[$]=`key_${k++}`;h.write(r?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let $ of m.allKeys){if($==="__proto__")continue;let S=w[$],x=typeof $=="symbol"?`syms[${g.indexOf($)}]`:tr($),E=`${x} in input`,T=f[$],A=T?._zod?.optin,L=A!==void 0,F=T?._zod?.optout==="optional";if(h.write(`const ${S} = ${b(x)};`),L&&F){let H=A==="optional"?`${S}_present`:`${S}.value !== undefined || ${S}_present`;h.write(` const ${S}_present = ${E}; if (!${S}.issues.length || ${S}_present) { if (${S}.issues.length) {${y(S,x)} } - if (${K}) { + if (${H}) { newResult[${x}] = ${S}.value; } } @@ -253,123 +253,123 @@ ${n.join(` newResult[${x}] = ${S}.value; } - `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},s,a=yc,c=!hn.jitless,u=c&&HT.value,d=t.catchall,p;e._zod.parse=(f,m)=>{p??(p=i.value);let g=f.value;return a(g)?c&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(t.shape)),f=s(f,m),d?uV([],g,f,m,p,e,m?.abortEarly===!0):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function HG(e,t,n,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let r=e.filter(o=>!rr(o));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(s=>Er(s,i,zt())))}),t)}var Vm=R("$ZodUnion",(e,t)=>{Ce.init(e,t),Ue(e,"optin",i=>i.def.options.some(r=>r._zod.optin==="defaulted")?"defaulted":i.def.options.some(r=>r._zod.optin!==void 0)?"optional":void 0),Ue(e,"optout",i=>i.def.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ue(e,"values",i=>{if(i.def.options.every(r=>r._zod.values))return new Set(i.def.options.flatMap(r=>Array.from(r._zod.values)))}),Ue(e,"pattern",i=>{if(i.def.options.every(r=>r._zod.pattern)){let r=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Ho(o.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>HG(a,i,e,r)):HG(s,i,e,r)}});function KG(e,t,n,i){let r=[];for(let o=0;oo.issues.map(s=>Er(s,i,zt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:r}),t)}var J0=R("$ZodXor",(e,t)=>{Vm.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>KG(a,i,e,r)):KG(s,i,e,r)}});function Z0(e,t){let n=e._zod,i=n.bag.optionsMap;i||(i=pV(n.def),n.bag.optionsMap=i);let r=i.get(t);if(r===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return r}function pV(e){let t=new Map;for(let n of e.options){let i=n._zod.propValues?.[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let r of i)if(t.has(r)){if(r!==void 0)throw new Error(`Duplicate discriminator value "${String(r)}"`);t.set(r,null)}else t.set(r,n)}return t}var Y0=R("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Vm.init(e,t);let n=e._zod.parse;Ue(e,"propValues",r=>{let o={},s=0;for(let a of r.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${r.def.options.indexOf(a)}"`);c[r.def.discriminator]?.has(void 0)&&s++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||Sn(o,l,new Set);for(let d of u)o[l].add(d)}}return!r.def.unionFallback&&s>1&&o[r.def.discriminator]?.delete(void 0),o}),t.options.forEach((r,o)=>{let s=Ru(r._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=Au(()=>pV(t));e._zod.parse=(r,o)=>{let s=r.value;if(!yc(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=s?.[t.discriminator],c=i.value.get(a);return c&&(a!==void 0||o.direction!=="backward")?c._zod.run(r,o):t.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:s,path:[t.discriminator],inst:e}),r)}}),Q0=R("$ZodIntersection",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value,o=t.left._zod.run({value:r,issues:[]},i),s=t.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>JG(n,c,l)):JG(n,o,s)}});function Lu(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(ci(e)&&ci(t)){let n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),r={...e,...t};Object.prototype.hasOwnProperty.call(r,"__proto__")&&delete r.__proto__;for(let o of i){if(o==="__proto__")continue;let s=Lu(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)r??(r=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),d=[p]}else return!1;for(let p of d)i.has(p)||i.set(p,{}),i.get(p)[u]=!0;return!0};for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of n.issues)s(l,"r")||e.issues.push(l);let a=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=r?a.filter(u=>r.keys.includes(u)):[];l.length&&e.issues.push({...r,keys:l});for(let u of a)!l.includes(u)&&o.has(u)&&e.issues.push(o.get(u))}let c=Lu(t.value,n.value);if(!c.valid){if(rr(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var jv=R("$ZodTuple",(e,t)=>{Ce.init(e,t);let n=t.items,i=hn.memoizer;i?.attach(e),e._zod.parse=(r,o)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=i?i.alloc(e,r,[],o):[];let a=[],c=ZG(n,"optin"),l=ZG(n,"optout");if(!t.rest){if(s.lengthn.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let u=new Array(n.length),d=t.rest?o?.abortEarly:void 0,p=!1;for(let f=0;f{u[f]=g})):(u[f]=m,d&&!p&&m.issues.length&&(p=rr(m)))}if(t.rest&&!p){let f=n.length-1,m=s.slice(n.length),g=r.issues.length;for(let h of m){if(d&&r.issues.length!==g){if(rr(r,g))break;g=r.issues.length}f++;let b=t.rest._zod.run({value:h,issues:[]},o);b instanceof Promise?a.push(b.then(y=>YG(y,r,f))):YG(b,r,f)}}return a.length?Promise.all(a).then(()=>QG(u,r,n,s,l)):QG(u,r,n,s,l)}});function ZG(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function YG(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues)),t.value[n]=e.value}function QG(e,t,n,i,r){for(let o=0;o=r&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(s.issues.length){if(!a&&o>=r){t.value.length=o;break}t.issues.push(...ir(o,s.issues))}t.value[o]=s.value}for(let o=t.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}var X0=R("$ZodRecord",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!ci(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),i;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){i.value=n?n.alloc(e,i,{},r):{};let c=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Er(m,r,zt())),input:u,path:[u],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[u],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...ir(u,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...ir(u,f.issues)),i.value[p]=f.value)}let l;for(let u in o)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;i.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{i.value=n?n.alloc(e,i,{},r):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ko.test(l)&&u.issues.length){let m=t.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){t.mode==="loose"?i.value[l]=o[l]:a?(c=c??[],c.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>Er(m,r,zt())),input:l,path:[l],inst:e});continue}let p=u.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[l],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...ir(l,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...ir(l,f.issues)),i.value[p]=f.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),eA=R("$ZodMap",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),i;let s=[];i.value=n?n.alloc(e,i,new Map,r):new Map;let a=r?.abortEarly,c=i.issues.length;for(let[l,u]of o){if(a&&i.issues.length!==c){if(rr(i,c))break;c=i.issues.length}let d=t.keyType._zod.run({value:l,issues:[]},r),p=t.valueType._zod.run({value:u,issues:[]},r);d instanceof Promise||p instanceof Promise?s.push(Promise.all([d,p]).then(([f,m])=>{XG(f,m,i,l,o,e,r)})):XG(d,p,i,l,o,e,r)}return s.length?Promise.all(s).then(()=>i):i}});function XG(e,t,n,i,r,o,s){e.issues.length&&(Tm.has(typeof i)?n.issues.push(...ir(i,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:e.issues.map(a=>Er(a,s,zt()))})),t.issues.length&&(Tm.has(typeof i)?n.issues.push(...ir(i,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:t.issues.map(a=>Er(a,s,zt()))})),n.value.set(e.value,t.value)}var tA=R("$ZodSet",(e,t)=>{Ce.init(e,t);let n=hn.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),i;let s=[];i.value=n?n.alloc(e,i,new Set,r):new Set;let a=r?.abortEarly,c=i.issues.length;for(let l of o){if(a&&i.issues.length!==c){if(rr(i,c))break;c=i.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},r);u instanceof Promise?s.push(u.then(d=>eV(d,i))):eV(u,i)}return s.length?Promise.all(s).then(()=>i):i}});function eV(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var nA=R("$ZodEnum",(e,t)=>{Ce.init(e,t);let n=Tu(t.entries),i=new Set(n);e._zod.values=i,Ue(e,"pattern",r=>{let o=Tu(r.def.entries).filter(s=>Tm.has(typeof s));return new RegExp(o.length?`^(${o.map(s=>li(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),rA=R("$ZodLiteral",(e,t)=>{Ce.init(e,t);let n=new Set(t.values);e._zod.values=n,Ue(e,"pattern",i=>{let r=i.def.values;return new RegExp(r.length?`^(${r.map(o=>typeof o=="string"?li(o):o?li(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),iA=R("$ZodFile",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),oA=R("$ZodTransform",(e,t)=>{Ce.init(e,t),e._zod.optin="optional",hn.memoizer?.guard(e),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);let r=t.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new Tr;return n.value=r,n}});function tV(e,t){return e.value=t.issues.length?void 0:t.value,e}var zv=R("$ZodOptional",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ho(i.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>tV(n,o)):tV(n,r)}return t.innerType._zod.run(n,i)}}),sA=R("$ZodExactOptional",(e,t)=>{zv.init(e,t),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),aA=R("$ZodNullable",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ho(i.source)}|null)$`):void 0}),Ue(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),cA=R("$ZodDefault",(e,t)=>{Ce.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>nV(o,t)):nV(r,t)}});function nV(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var lA=R("$ZodPrefault",(e,t)=>{Ce.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),uA=R("$ZodNonOptional",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,i)=>{let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>rV(o,e)):rV(r,e)}});function rV(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var dA=R("$ZodSuccess",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js("ZodSuccess");let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}});function iV(e,t,n,i){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(r=>Er(r,i,zt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var pA=R("$ZodCatch",(e,t)=>{Ce.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>iV(n,o,t,i)):iV(n,r,t,i)}}),fA=R("$ZodNaN",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Gv=R("$ZodPipe",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>_v(s,t.in,i)):_v(o,t.in,i)}let r=t.in._zod.run(n,i);return r instanceof Promise?r.then(o=>_v(o,t.out,i)):_v(r,t.out,i)}});function _v(e,t,n){return e.issues.some(i=>i.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Bm=R("$ZodCodec",(e,t)=>{Ce.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Sv(s,t,i)):Sv(o,t,i)}else{let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Sv(s,t,i)):Sv(o,t,i)}}});function Sv(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(o=>xv(e,o,t.out,n)):xv(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(o=>xv(e,o,t.in,n)):xv(e,r,t.in,n)}}function xv(e,t,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},i)}var mA=R("$ZodPreprocess",(e,t)=>{Gv.init(e,t)}),gA=R("$ZodReadonly",(e,t)=>{Ce.init(e,t),Ue(e,"propValues",n=>n.def.innerType._zod.propValues),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"optin",n=>n.def.innerType?._zod?.optin),Ue(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(oV):oV(r)}});function oV(e){return e.memo||(e.value=Object.freeze(e.value)),e}function Wue(e){let t=e._zod.def,n=t.pattern,i=!!t.format?.includes("int"),r,o;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(n=c.pattern),i||(i=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(r===void 0||l>r)&&(r=l),u!==void 0&&(o===void 0||uo)return"(?!)";if(r!==void 0||o!==void 0)return PI({minimum:r,maximum:o}).source;let s=e._zod.pattern;return(i&&s===Ko?Mm:s)?.source}function a0(e){let t=e._zod.def,n=e._zod.pattern?.source,i=t.innerType??e._zod.innerType;if(i){let r=i._zod.pattern?.source,o=a0(i);return n&&r&&o&&o!==r?n.replace(Ho(r),()=>Ho(o)):n}if(t.options){let r=t.options.map(a0);if(r.every(Boolean))return`^(${r.map(o=>Ho(o)).join("|")})$`}return Wue(e)}var hA=R("$ZodTemplateLiteral",(e,t)=>{Ce.init(e,t);let n=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){let r=a0(i);if(!r)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);n.push(Ho(r))}else if(i===null||KT.has(typeof i))n.push(li(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),yA=R("$ZodFunction",(e,t)=>(Ce.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let r=e._def.input?cv(e._def.input,i):i,o=Reflect.apply(n,this,r);return e._def.output?cv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let r=e._def.input?await lv(e._def.input,i):i,o=await Reflect.apply(n,this,r);return e._def.output?await lv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let i=e.constructor;return Array.isArray(n[0])?new i({type:"function",input:new jv({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new i({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:n})},e)),bA=R("$ZodPromise",(e,t)=>{Ce.init(e,t),e._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},i))}),qm=R("$ZodLazy",(e,t)=>{Ce.init(e,t),qT(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Ue(e,"pattern",n=>n.innerType?._zod?.pattern),Ue(e,"propValues",n=>n.innerType?._zod?.propValues),Ue(e,"optin",n=>n.innerType?._zod?.optin??void 0),Ue(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,i)=>e._zod.innerType._zod.run(n,i)}),vA=R("$ZodCustom",(e,t)=>{ht.init(e,t),Ce.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{let i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(o=>sV(o,n,i,e));sV(r,n,i,e)}});function sV(e,t,n,i){if(!e){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),t.issues.push(Nu(r))}}function aV(e,t,n){e.issues.length&&t.issues.push(...ir(n,e.issues))}var wA=R("$ZodProperties",(e,t)=>{Ce.init(e,t),ht.init(e,t);let n=hn.memoizer;n?.attach(e);let i,r=(o,s)=>{i??(i=Reflect.ownKeys(t.shape).map(l=>[l,t.shape[l]]));let a=o.value,c;for(let[l,u]of i){let d=u._zod.run({value:a[l],issues:[]},s);d instanceof Promise?(c??(c=[]),c.push(d.then(p=>aV(p,o,l)))):aV(d,o,l)}if(c)return Promise.all(c).then(()=>{})};e._zod.parse=(o,s)=>{let a=o.value;if(a===null||typeof a!="object"&&typeof a!="function")return o.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),o;s.direction==="backward"&&(s={...s,direction:"forward"}),n&&n.alloc(e,o,a,s);let c=r(o,s);return c instanceof Promise?c.then(()=>o):o},e._zod.check=o=>{if(o.value==null){o.issues.push({expected:"object",code:"invalid_type",input:o.value,inst:e});return}return r(o,{})}},{*[Symbol.iterator](){yield this}});var Wv=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},$A="~memo",mV=[];function gV(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function kA(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var hV=new WeakMap,Fu=0,qv=1,Wm=2;function Hm(e,t,n){let i=hV.get(e);if(i!==void 0)return i?Wm:Fu;if(t.has(e))return Wm;t.add(e);let r=Fu,o=u=>{if(r!==Wm&&u?._zod){let d=Hm(u,t,n);d>r&&(r=d)}},s=(u,d)=>{let p=Fu;for(let f of Reflect.ownKeys(u)){let m=Object.getOwnPropertyDescriptor(u,f);if(d&&!m.enumerable)continue;let g=m.get?qv:m.value?._zod?Hm(m.value,t,n):Fu;g>p&&(p=g)}return p},a=u=>{u>r&&(r=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=Ru(c);a(u?s(u,!0):qv),o(c.catchall);break}case"properties":a(s(c.shape,!1));break;case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(n?e._zod.innerType:void 0);a(u?Hm(u,t,!1):qv);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(let f of p)o(f)}}}return t.delete(e),Hue(e,r)}function Hue(e,t){return t!==qv&&hV.set(e,t===Wm),t}function Hv(e){return Hm(e,new Set,!0)!==Fu}function Kue(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Vv,Bv=[],Jue={alloc(e,t,n){let i=Vv;if(!i)return n;Vv=void 0;let r={value:n,issues:null};return i.set(t.value,r),Bv.push(r),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,i=(r,o)=>{if(o.direction!=="backward"&&Kv(o,r.value))throw new Wv;return n(r,o)};e._zod.parse=i,e._zod.run===n&&(e._zod.run=i)})},attach(e){var t;let n,i=!1,r,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,l)=>{if(n===void 0){let b=Hm(e,new Set,!1);if(b===Fu)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,l);b===Wm||i?n=!0:i=!0}let u=c.value;if(!gV(u))return s(c,l);let d=l[$A];d||(d={buckets:new WeakMap,backEdges:void 0},l[$A]=d);let p;r===l?p=o:(p=Kue(d,e),r=l,o=p);let f=p.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...kA(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;Vv=p;let m=Bv.length,g=s(c,l);Vv=void 0;let h=Bv.length>m?Bv.pop():void 0;return g instanceof Promise?g.then(b=>(h&&(h.issues=b.issues.length?kA(b.issues):mV),b)):(h&&(h.issues=g.issues.length?kA(g.issues):mV),g)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function Km(){return Jue}function Kv(e,t){let n=e[$A]?.backEdges;return n!==void 0&&gV(t)&&n.has(t)}var Zm={};_r(Zm,{ar:()=>yV,az:()=>bV,be:()=>wV,bg:()=>kV,bn:()=>$V,ca:()=>_V,ckb:()=>SV,cs:()=>xV,da:()=>EV,de:()=>TV,el:()=>IV,en:()=>Jv,eo:()=>AV,es:()=>RV,fa:()=>NV,fi:()=>CV,fr:()=>PV,frCA:()=>DV,gu:()=>OV,he:()=>MV,hi:()=>LV,hr:()=>FV,hu:()=>UV,hy:()=>zV,id:()=>GV,is:()=>VV,it:()=>BV,ja:()=>qV,ka:()=>WV,kh:()=>HV,km:()=>Zv,kn:()=>KV,ko:()=>JV,lt:()=>YV,mk:()=>QV,ms:()=>XV,ne:()=>eB,nl:()=>tB,nn:()=>nB,no:()=>rB,ota:()=>iB,pl:()=>sB,ps:()=>oB,pt:()=>aB,ptBR:()=>cB,ro:()=>lB,ru:()=>dB,sk:()=>pB,sl:()=>fB,sv:()=>mB,ta:()=>gB,tg:()=>hB,th:()=>yB,tk:()=>bB,tr:()=>vB,ua:()=>wB,uk:()=>Yv,ur:()=>kB,uz:()=>$B,vi:()=>_B,yo:()=>EB,zhCN:()=>SB,zhTW:()=>xB});var Zue=()=>{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"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n={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",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",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",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${C(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.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 ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function yV(){return{localeError:Zue()}}var Yue=()=>{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"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={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",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function bV(){return{localeError:Yue()}}function vV(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var Que=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=vV(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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=vV(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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function wV(){return{localeError:Que()}}var Xue=()=>{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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function kV(){return{localeError:Xue()}}var ede=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(r){return e[r]??null}let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${a}`}case"invalid_value":return r.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${V(r.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${C(r.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${r.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${r.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function $V(){return{localeError:ede()}}var tde=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={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",mac:"adre\xE7a MAC",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",credit_card:"n\xFAmero de targeta de cr\xE8dit",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${V(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${C(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function _V(){return{localeError:tde()}}var nde=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(r){return e[r]??null}let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>a.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(a);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${a}${l?"":c}`}case"invalid_value":return r.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${V(r.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${C(r.values,"|")}`;case"too_big":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??r.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${r.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${C(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${r.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function SV(){return{localeError:nde()}}var rde=()=>{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"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"\u010D\xEDslo kreditn\xED karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${C(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function xV(){return{localeError:rde()}}var ide=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function EV(){return{localeError:ide()}}var ode=()=>{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"},map:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={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",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function TV(){return{localeError:ode()}}var sde=()=>{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(r){return e[r]??null}let n={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",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\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 ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.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 ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function IV(){return{localeError:sde()}}var ade=()=>{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(o){return e[o]??null}let n={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",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function r(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):i[o]??o}return o=>{switch(o.code){case"invalid_type":{let s=r(o.expected),a=H(o.input),c=r(a,o.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${V(o.values[0])}`:`Invalid option: expected one of ${C(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",a=t(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",a=t(o.origin);return a?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${C(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(a=>`'${a}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Jv(){return{localeError:ade()}}var cde=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={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",mac:"MAC-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",credit_card:"kreditkarta numero",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function AV(){return{localeError:cde()}}var lde=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={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",mac:"direcci\xF3n MAC",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",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function RV(){return{localeError:lde()}}var ude=()=>{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"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\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 ${C(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.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 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${C(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.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 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function NV(){return{localeError:ude()}}var dde=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n={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",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${C(r.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"}}};function CV(){return{localeError:dde()}}var pde=()=>{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(r){return e[r]??null}let n={regex:"expression r\xE9guli\xE8re",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",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",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:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instance de ${r.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${V(r.values[0])} attendu`:`Option invalide : une valeur parmi ${C(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${C(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function PV(){return{localeError:pde()}}var fde=()=>{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"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={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",mac:"adresse MAC",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",credit_card:"num\xE9ro de carte de cr\xE9dit",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${V(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${C(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function DV(){return{localeError:fde()}}var mde=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(r){return e[r]??null}let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${a}`}case"invalid_value":return r.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${V(r.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${C(r.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${r.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${r.keys.length>1?"\u0A93":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function OV(){return{localeError:mde()}}var gde=()=>{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"}},n=l=>l?e[l]:void 0,i=l=>{let u=n(l);return u?u.label:l??e.unknown.label},r=l=>`\u05D4${i(l)}`,o=l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?t[l]??null: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"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",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"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",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"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",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 l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??i(u),p=H(l.input),f=c[p]??e[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.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 ${V(l.values[0])}`;let u=l.values.map(f=>V(f));if(l.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let h=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`}let g=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${m}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${C(l.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${r(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function MV(){return{localeError:gde()}}var hde=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${r.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum} \u0939\u094B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} \u092E\u0947\u0902 ${o}${r.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} ${o}${r.minimum} \u0939\u094B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${r.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${r.keys.length>1?"\u092F\u093E\u0901":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${r.origin} \u092E\u0947\u0902`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function LV(){return{localeError:hde()}}var yde=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={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",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"unos"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${V(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${C(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function FV(){return{localeError:yde()}}var bde=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"hitelk\xE1rtyasz\xE1m",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function UV(){return{localeError:bde()}}function jV(e,t,n){return Math.abs(e)===1?t:n}function Uu(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var vde=()=>{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"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[1])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=jV(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 ${Uu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.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 ${Uu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=jV(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 ${Uu(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.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 ${Uu(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.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 ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${C(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Uu(r.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 ${Uu(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function zV(){return{localeError:vde()}}var wde=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={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",mac:"alamat MAC",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",credit_card:"nomor kartu kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${V(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function GV(){return{localeError:wde()}}var kde=()=>{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"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}let n={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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${C(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function VV(){return{localeError:kde()}}var $de=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={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",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${V(r.values[0])}`:`Opzione non valida: atteso uno tra ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${C(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function BV(){return{localeError:$de()}}var _de=()=>{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"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n={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",mac:"MAC\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",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${C(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.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${r.keys.length>1?"\u7FA4":""}: ${C(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function qV(){return{localeError:_de()}}var Sde=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\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 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${C(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\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 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\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 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\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 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\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 "${o.includes}"-\u10E1`:o.format==="regex"?`\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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.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 ${r.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${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.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 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function WV(){return{localeError:Sde()}}var xde=()=>{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"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n={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",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",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",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${C(r.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 ${r.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 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Zv(){return{localeError:xde()}}function HV(){return Zv()}var Ede=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(r){return e[r]??null}let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",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 \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${a}`}case"invalid_value":return r.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${V(r.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${r.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${r.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function KV(){return{localeError:Ede()}}var Tde=()=>{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"},map:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${C(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${C(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function JV(){return{localeError:Tde()}}var Jm=e=>e.charAt(0).toUpperCase()+e.slice(1);function ZV(e){let t=Math.abs(e),n=t%10,i=t%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var Ide=()=>{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(r,o,s,a){let c=e[r]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let n={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",mac:"MAC 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",credit_card:"kredito kortel\u0117s numeris",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${V(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${C(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=t(r.origin,ZV(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Jm(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=t(r.origin,ZV(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Jm(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${C(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Jm(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function YV(){return{localeError:Ide()}}var Ade=()=>{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"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`Invalid ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`${r.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"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.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 ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function QV(){return{localeError:Ade()}}var Rde=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={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",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${V(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${C(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function XV(){return{localeError:Rde()}}var Nde=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} \u092E\u093E ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} ${o}${r.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${r.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${r.keys.length>1?"\u0939\u0930\u0942":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${r.origin} \u092E\u093E`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function eB(){return{localeError:Nde()}}var Cde=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={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",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${V(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function tB(){return{localeError:Cde()}}var Pde=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(r){return e[r]??null}let n={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-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventa instanceof ${r.expected}, fekk ${a}`:`Ugyldig input: forventa ${o}, fekk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventa ${V(r.values[0])}`:`Ugyldig val: forventa eitt av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function nB(){return{localeError:Pde()}}var Dde=()=>{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"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${V(r.values[0])}`:`Ugyldig valg: forventet en av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function rB(){return{localeError:Dde()}}var Ode=()=>{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"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${V(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function iB(){return{localeError:Ode()}}var Mde=()=>{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"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n={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",mac:"\u062F MAC \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",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${C(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${C(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.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 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function oB(){return{localeError:Mde()}}var Lde=()=>{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"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n={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",mac:"adres MAC",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",credit_card:"numer karty kredytowej",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${C(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function sB(){return{localeError:Lde()}}var Fde=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=H(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${C(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${C(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function aB(){return{localeError:Fde()}}var Ude=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=H(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${C(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${C(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function cB(){return{localeError:Ude()}}var jde=()=>{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(r){return e[r]??null}let n={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",credit_card:"num\u0103r de card de credit",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${V(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${C(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function lB(){return{localeError:jde()}}function uB(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var zde=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=uB(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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=uB(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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function dB(){return{localeError:zde()}}var Gde=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rny 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:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${r.expected}, obdr\u017Ean\xE9 ${a}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${V(r.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${C(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function pB(){return{localeError:Gde()}}var Vde=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={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",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${C(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function fB(){return{localeError:Vde()}}var Bde=()=>{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"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n={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-adress",ipv6:"IPv6-adress",mac:"MAC-adress",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",credit_card:"kreditkortsnummer",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${C(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function mB(){return{localeError:Bde()}}var qde=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${C(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.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`:`\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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\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 ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\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 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.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${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.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`${r.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"}}};function gB(){return{localeError:qde()}}var Wde=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},i={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${a} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return r.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${V(r.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${C(r.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${n[o.format]??r.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${r.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${r.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${C(r.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${r.options.map(s=>`'${s}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}};function hB(){return{localeError:Wde()}}var Hde=()=>{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"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n={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",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",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)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.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 ${r.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: ${C(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.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 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function yB(){return{localeError:Hde()}}var Kde=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(r){return e[r]??null}let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",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 sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${a} alyndy`}case"invalid_value":return r.values.length===1?`N\xE4dogry baha: ${V(r.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xE4dogry san: ${r.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${r.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function bB(){return{localeError:Kde()}}var Jde=()=>{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"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"kredi kart\u0131 numaras\u0131",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function vB(){return{localeError:Jde()}}var Zde=()=>{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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n={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",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${C(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Yv(){return{localeError:Zde()}}function wB(){return Yv()}var Yde=()=>{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"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n={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",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \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",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${C(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.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${r.keys.length>1?"\u0632":""}: ${C(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function kB(){return{localeError:Yde()}}var Qde=()=>{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(r){return e[r]??null}let n={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",credit_card:"kredit karta raqami",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${V(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function $B(){return{localeError:Qde()}}var Xde=()=>{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"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n={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",mac:"\u0111\u1ECBa ch\u1EC9 MAC",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",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${C(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.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 ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function _B(){return{localeError:Xde()}}var epe=()=>{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"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n={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",mac:"MAC\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",credit_card:"\u4FE1\u7528\u5361\u53F7",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${C(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function SB(){return{localeError:epe()}}var tpe=()=>{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"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u4FE1\u7528\u5361\u865F",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${C(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function xB(){return{localeError:tpe()}}var npe=()=>{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"},map:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n={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",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",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",credit_card:"n\u1ECDmba kaadi gbese",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=H(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${C(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${C(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.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 ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function EB(){return{localeError:npe()}}var TB,_A=Symbol("ZodOutput"),SA=Symbol("ZodInput"),Qv=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Xv(){return new Qv}(TB=globalThis).__zod_globalRegistry??(TB.__zod_globalRegistry=Xv());var Dn=globalThis.__zod_globalRegistry;var sr=Symbol.for("zod.compile.invalid"),IB=Symbol.for("zod.compile.fallback"),Ui=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Ve=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function ipe(e,t){try{return tw(e,{assertOnly:!0})}catch{return t}}function IA(e,t){try{let n=tw(e),i=ew(e,n);return i._zod.bag.validator=ipe(e,n),i}catch(n){if(t?.strict)throw n;return e}}function ew(e,t){if(Hv(e))throw new Ve("a schema whose subtree contains a reference cycle");let n=ot(e),i=e._zod.run,r=i.__originalRun??i,o=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[IB]||a&&Kv(a,s.value))return r(s,a);let c=t(s.value);return c!==sr?(s.value=c,s):(a&&(a[IB]=!0),r(s,a))};return o.__originalRun=r,n._zod.bag.fallbackRun=r,n._zod.bag.validator=t,n._zod.run=o,i.__originalRun||ope(n,e,t),n}function ope(e,t,n){let i=e,r=t;if(typeof r.safeParse=="function"){let o=r.safeParse;i.safeParse=(s,a)=>{let c=n(s);return c!==sr?{success:!0,data:c}:o(s,a)}}if(typeof r.parse=="function"){let o=r.parse;i.parse=(s,a)=>{let c=n(s);return c!==sr?c:o(s,a)}}}function tw(e,t){let n=!0;try{n=Hv(e)}catch{}if(n)throw new Ve("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},r=new wc(["input"]),o=Rt(r,i,e,"input",!t?.assertOnly);r.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...i.constants.keys()],a=[sr,...i.constants.values()],c=r.content.join(` + `)}return h.write("payload.value = newResult;"),h.write("return payload;"),h.compile()},s,a=yc,c=!$n.jitless,u=c&&eI.value,d=t.catchall,p;e._zod.parse=(f,m)=>{p??(p=i.value);let g=f.value;return a(g)?c&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(t.shape)),f=s(f,m),d?hV([],g,f,m,p,e,m?.abortEarly===!0):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});function XG(e,t,n,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let r=e.filter(o=>!nr(o));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(s=>xr(s,i,zt())))}),t)}var Jm=C("$ZodUnion",(e,t)=>{Oe.init(e,t),Ue(e,"optin",i=>i.def.options.some(r=>r._zod.optin==="defaulted")?"defaulted":i.def.options.some(r=>r._zod.optin!==void 0)?"optional":void 0),Ue(e,"optout",i=>i.def.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ue(e,"values",i=>{if(i.def.options.every(r=>r._zod.values))return new Set(i.def.options.flatMap(r=>Array.from(r._zod.values)))}),Ue(e,"pattern",i=>{if(i.def.options.every(r=>r._zod.pattern)){let r=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Ko(o.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>XG(a,i,e,r)):XG(s,i,e,r)}});function eV(e,t,n,i){let r=[];for(let o=0;oo.issues.map(s=>xr(s,i,zt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:r}),t)}var s0=C("$ZodXor",(e,t)=>{Jm.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of t.options){let c=a._zod.run({value:i.value,issues:[]},r);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>eV(a,i,e,r)):eV(s,i,e,r)}});function a0(e,t){let n=e._zod,i=n.bag.optionsMap;i||(i=bV(n.def),n.bag.optionsMap=i);let r=i.get(t);if(r===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return r}function bV(e){let t=new Map;for(let n of e.options){let i=n._zod.propValues?.[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let r of i)if(t.has(r)){if(r!==void 0)throw new Error(`Duplicate discriminator value "${String(r)}"`);t.set(r,null)}else t.set(r,n)}return t}var c0=C("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Jm.init(e,t);let n=e._zod.parse;Ue(e,"propValues",r=>{let o={},s=0;for(let a of r.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${r.def.options.indexOf(a)}"`);c[r.def.discriminator]?.has(void 0)&&s++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(o,l)||Nn(o,l,new Set);for(let d of u)o[l].add(d)}}return!r.def.unionFallback&&s>1&&o[r.def.discriminator]?.delete(void 0),o}),t.options.forEach((r,o)=>{let s=Nu(r._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${o}"`)});let i=Cu(()=>bV(t));e._zod.parse=(r,o)=>{let s=r.value;if(!yc(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=s?.[t.discriminator],c=i.value.get(a);return c&&(a!==void 0||o.direction!=="backward")?c._zod.run(r,o):t.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:s,path:[t.discriminator],inst:e}),r)}}),l0=C("$ZodIntersection",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value,o=t.left._zod.run({value:r,issues:[]},i),s=t.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>tV(n,c,l)):tV(n,o,s)}});function ju(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(ai(e)&&ai(t)){let n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),r={...e,...t};Object.prototype.hasOwnProperty.call(r,"__proto__")&&delete r.__proto__;for(let o of i){if(o==="__proto__")continue;let s=ju(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)r??(r=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let p=String(l.path[0]);o.has(p)||o.set(p,l),d=[p]}else return!1;for(let p of d)i.has(p)||i.set(p,{}),i.get(p)[u]=!0;return!0};for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of n.issues)s(l,"r")||e.issues.push(l);let a=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(a.length){let l=r?a.filter(u=>r.keys.includes(u)):[];l.length&&e.issues.push({...r,keys:l});for(let u of a)!l.includes(u)&&o.has(u)&&e.issues.push(o.get(u))}let c=ju(t.value,n.value);if(!c.valid){if(nr(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Wv=C("$ZodTuple",(e,t)=>{Oe.init(e,t);let n=t.items,i=$n.memoizer;i?.attach(e),e._zod.parse=(r,o)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=i?i.alloc(e,r,[],o):[];let a=[],c=nV(n,"optin"),l=nV(n,"optout");if(!t.rest){if(s.lengthn.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}let u=new Array(n.length),d=t.rest?o?.abortEarly:void 0,p=!1;for(let f=0;f{u[f]=g})):(u[f]=m,d&&!p&&m.issues.length&&(p=nr(m)))}if(t.rest&&!p){let f=n.length-1,m=s.slice(n.length),g=r.issues.length;for(let h of m){if(d&&r.issues.length!==g){if(nr(r,g))break;g=r.issues.length}f++;let b=t.rest._zod.run({value:h,issues:[]},o);b instanceof Promise?a.push(b.then(y=>rV(y,r,f))):rV(b,r,f)}}return a.length?Promise.all(a).then(()=>iV(u,r,n,s,l)):iV(u,r,n,s,l)}});function nV(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function rV(e,t,n){e.issues.length&&t.issues.push(...Sr(n,e.issues)),t.value[n]=e.value}function iV(e,t,n,i,r){for(let o=0;o=r&&n[o]._zod.optin==="optional"){t.value.length=o;break}if(s.issues.length){if(!a&&o>=r){t.value.length=o;break}t.issues.push(...Sr(o,s.issues))}t.value[o]=s.value}for(let o=t.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}var u0=C("$ZodRecord",(e,t)=>{Oe.init(e,t);let n=$n.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!ai(o))return i.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),i;let s=[],a=t.keyType._zod.values;if(a&&!t.partial){i.value=n?n.alloc(e,i,{},r):{};let c=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>xr(m,r,zt())),input:u,path:[u],inst:e});continue}let p=d.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[u],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...Sr(u,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...Sr(u,f.issues)),i.value[p]=f.value)}let l;for(let u in o)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;i.value[u]=o[u]}else l=l??[],l.push(u);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{i.value=n?n.alloc(e,i,{},r):{};let c;for(let l of Reflect.ownKeys(o)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ho.test(l)&&u.issues.length){let m=t.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){t.mode==="loose"?i.value[l]=o[l]:a?(c=c??[],c.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>xr(m,r,zt())),input:l,path:[l],inst:e});continue}let p=u.value;if(p==="__proto__")continue;let f=t.valueType._zod.run({value:o[l],issues:[]},r);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...Sr(l,m.issues)),i.value[p]=m.value})):(f.issues.length&&i.issues.push(...Sr(l,f.issues)),i.value[p]=f.value)}c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),d0=C("$ZodMap",(e,t)=>{Oe.init(e,t);let n=$n.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),i;let s=[];i.value=n?n.alloc(e,i,new Map,r):new Map;let a=r?.abortEarly,c=i.issues.length;for(let[l,u]of o){if(a&&i.issues.length!==c){if(nr(i,c))break;c=i.issues.length}let d=t.keyType._zod.run({value:l,issues:[]},r),p=t.valueType._zod.run({value:u,issues:[]},r);d instanceof Promise||p instanceof Promise?s.push(Promise.all([d,p]).then(([f,m])=>{oV(f,m,i,l,o,e,r)})):oV(d,p,i,l,o,e,r)}return s.length?Promise.all(s).then(()=>i):i},r0(e,Zue)});function oV(e,t,n,i,r,o,s){e.issues.length&&(Im.has(typeof i)?n.issues.push(...Sr(i,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:e.issues.map(a=>xr(a,s,zt()))})),t.issues.length&&(Im.has(typeof i)?n.issues.push(...Sr(i,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:t.issues.map(a=>xr(a,s,zt()))})),n.value.set(e.value,t.value)}var p0=C("$ZodSet",(e,t)=>{Oe.init(e,t);let n=$n.memoizer;n?.attach(e),e._zod.parse=(i,r)=>{let o=i.value;if(!(o instanceof Set))return i.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),i;let s=[];i.value=n?n.alloc(e,i,new Set,r):new Set;let a=r?.abortEarly,c=i.issues.length;for(let l of o){if(a&&i.issues.length!==c){if(nr(i,c))break;c=i.issues.length}let u=t.valueType._zod.run({value:l,issues:[]},r);u instanceof Promise?s.push(u.then(d=>sV(d,i))):sV(u,i)}return s.length?Promise.all(s).then(()=>i):i},r0(e,Yue)});function sV(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var f0=C("$ZodEnum",(e,t)=>{Oe.init(e,t);let n=Au(t.entries),i=new Set(n);e._zod.values=i,Ue(e,"pattern",r=>{let o=Au(r.def.entries).filter(s=>Im.has(typeof s));return new RegExp(o.length?`^(${o.map(s=>ci(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),m0=C("$ZodLiteral",(e,t)=>{Oe.init(e,t);let n=new Set(t.values);e._zod.values=n,Ue(e,"pattern",i=>{let r=i.def.values;return new RegExp(r.length?`^(${r.map(o=>typeof o=="string"?ci(o):o?ci(o.toString()):String(o)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),g0=C("$ZodFile",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),h0=C("$ZodTransform",(e,t)=>{Oe.init(e,t),e._zod.optin="optional",$n.memoizer?.guard(e),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);let r=t.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new Er;return n.value=r,n}});function aV(e,t){return e.value=t.issues.length?void 0:t.value,e}var Kv=C("$ZodOptional",(e,t)=>{Oe.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ko(i.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>aV(n,o)):aV(n,r)}return t.innerType._zod.run(n,i)}}),y0=C("$ZodExactOptional",(e,t)=>{Kv.init(e,t),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),b0=C("$ZodNullable",(e,t)=>{Oe.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"pattern",n=>{let i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${Ko(i.source)}|null)$`):void 0}),Ue(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),v0=C("$ZodDefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>cV(o,t)):cV(r,t)}});function cV(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var w0=C("$ZodPrefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),k0=C("$ZodNonOptional",(e,t)=>{Oe.init(e,t),Ue(e,"values",n=>{let i=n.def.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,i)=>{let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>lV(o,e)):lV(r,e)}});function lV(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var _0=C("$ZodSuccess",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js("ZodSuccess");let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}});function uV(e,t,n,i){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(r=>xr(r,i,zt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var $0=C("$ZodCatch",(e,t)=>{Oe.init(e,t),Ue(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ue(e,"optout",n=>n.def.innerType._zod.optout),Ue(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>uV(n,o,t,i)):uV(n,r,t,i)}}),S0=C("$ZodNaN",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Hv=C("$ZodPipe",(e,t)=>{Oe.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Rv(s,t.in,i)):Rv(o,t.in,i)}let r=t.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Rv(o,t.out,i)):Rv(r,t.out,i)}});function Rv(e,t,n){return e.issues.some(i=>i.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Zm=C("$ZodCodec",(e,t)=>{Oe.init(e,t),Ue(e,"values",n=>n.def.in._zod.values),Ue(e,"optin",n=>n.def.in._zod.optin),Ue(e,"optout",n=>n.def.out._zod.optout),Ue(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Cv(s,t,i)):Cv(o,t,i)}else{let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Cv(s,t,i)):Cv(o,t,i)}}});function Cv(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(o=>Nv(e,o,t.out,n)):Nv(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(o=>Nv(e,o,t.in,n)):Nv(e,r,t.in,n)}}function Nv(e,t,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},i)}var x0=C("$ZodPreprocess",(e,t)=>{Hv.init(e,t)}),E0=C("$ZodReadonly",(e,t)=>{Oe.init(e,t),Ue(e,"propValues",n=>n.def.innerType._zod.propValues),Ue(e,"values",n=>n.def.innerType._zod.values),Ue(e,"optin",n=>n.def.innerType?._zod?.optin),Ue(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(dV):dV(r)}});function dV(e){return e.memo||(e.value=Object.freeze(e.value)),e}function Xue(e){let t=e._zod.def,n=t.pattern,i=!!t.format?.includes("int"),r,o;for(let a of t.checks??[]){let c=a._zod.def;c.pattern&&(n=c.pattern),i||(i=!!c.format?.includes("int"));let l=c.minimum??c.length,u=c.maximum??c.length;l!==void 0&&(r===void 0||l>r)&&(r=l),u!==void 0&&(o===void 0||uo)return"(?!)";if(r!==void 0||o!==void 0)return zI({minimum:r,maximum:o}).source;let s=e._zod.pattern;return(i&&s===Ho?jm:s)?.source}function yA(e){let t=e._zod.def,n=e._zod.pattern?.source,i=t.innerType??e._zod.innerType;if(i){let r=i._zod.pattern?.source,o=yA(i);return n&&r&&o&&o!==r?n.replace(Ko(r),()=>Ko(o)):n}if(t.options){let r=t.options.map(yA);if(r.every(Boolean))return`^(${r.map(o=>Ko(o)).join("|")})$`}return Xue(e)}var T0=C("$ZodTemplateLiteral",(e,t)=>{Oe.init(e,t);let n=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){let r=yA(i);if(!r)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);n.push(Ko(r))}else if(i===null||tI.has(typeof i))n.push(ci(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),I0=C("$ZodFunction",(e,t)=>(Oe.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let r=e._def.input?mv(e._def.input,i):i,o=Reflect.apply(n,this,r);return e._def.output?mv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let r=e._def.input?await gv(e._def.input,i):i,o=await Reflect.apply(n,this,r);return e._def.output?await gv(e._def.output,o):o},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let i=e.constructor;return Array.isArray(n[0])?new i({type:"function",input:new Wv({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new i({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:n})},e)),A0=C("$ZodPromise",(e,t)=>{Oe.init(e,t),e._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},i))}),Ym=C("$ZodLazy",(e,t)=>{Oe.init(e,t),QT(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Ue(e,"pattern",n=>n.innerType?._zod?.pattern),Ue(e,"propValues",n=>n.innerType?._zod?.propValues),Ue(e,"optin",n=>n.innerType?._zod?.optin??void 0),Ue(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,i)=>e._zod.innerType._zod.run(n,i)}),R0=C("$ZodCustom",(e,t)=>{ht.init(e,t),Oe.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{let i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(o=>pV(o,n,i,e));pV(r,n,i,e)}});function pV(e,t,n,i){if(!e){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),t.issues.push(Du(r))}}var Qv=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},N0="~memo",wV=[];function kV(e){return e!==null&&typeof e=="object"}function C0(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var _V=new WeakMap,zu=0,Yv=1,Qm=2;function Xm(e,t,n){let i=_V.get(e);if(i!==void 0)return i?Qm:zu;if(t.has(e))return Qm;t.add(e);let r=zu,o=u=>{if(r!==Qm&&u?._zod){let d=Xm(u,t,n);d>r&&(r=d)}},s=(u,d)=>{let p=zu;for(let f of Reflect.ownKeys(u)){let m=Object.getOwnPropertyDescriptor(u,f);if(d&&!m.enumerable)continue;let g=m.get?Yv:m.value?._zod?Xm(m.value,t,n):zu;g>p&&(p=g)}return p},a=u=>{u>r&&(r=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=Nu(c);a(u?s(u,!0):Yv),o(c.catchall);break}case"array":o(c.element);break;case"tuple":for(let u of c.items)o(u);o(c.rest);break;case"record":case"map":o(c.keyType),o(c.valueType);break;case"set":o(c.valueType);break;case"union":for(let u of c.options)o(u);break;case"intersection":o(c.left),o(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(c.innerType);break;case"pipe":o(c.in),o(c.out);break;case"function":o(c.input),o(c.output);break;case"lazy":{let u=c._cachedInner??(n?e._zod.innerType:void 0);a(u?Xm(u,t,!1):Yv);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)o(p);else if(Array.isArray(p))for(let f of p)o(f)}}}return t.delete(e),ede(e,r)}function ede(e,t){return t!==Yv&&_V.set(e,t===Qm),t}function Xv(e){return Xm(e,new Set,!0)!==zu}function tde(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Jv,Zv=[],nde={alloc(e,t,n){let i=Jv;if(!i)return n;Jv=void 0;let r={value:n,issues:null};return i.set(t.value,r),Zv.push(r),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,i=(r,o)=>{if(o.direction!=="backward"&&ew(o,r.value))throw new Qv;return n(r,o)};e._zod.parse=i,e._zod.run===n&&(e._zod.run=i)})},attach(e){var t;let n,i=!1,r,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,a=(c,l)=>{if(n===void 0){let b=Xm(e,new Set,!1);if(b===zu)return e._zod.parse=s,e._zod.run===a&&(e._zod.run=s),s(c,l);b===Qm||i?n=!0:i=!0}let u=c.value;if(!kV(u))return s(c,l);let d=l[N0];d||(d={buckets:new WeakMap,backEdges:void 0},l[N0]=d);let p;r===l?p=o:(p=tde(d,e),r=l,o=p);let f=p.get(u);if(f)return c.value=f.value,f.issues?f.issues.length&&c.issues.push(...C0(f.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),c;Jv=p;let m=Zv.length,g=s(c,l);Jv=void 0;let h=Zv.length>m?Zv.pop():void 0;return g instanceof Promise?g.then(b=>(h&&(h.issues=b.issues.length?C0(b.issues):wV),b)):(h&&(h.issues=g.issues.length?C0(g.issues):wV),g)};e._zod.parse=a,e._zod.run===s&&(e._zod.run=a)})}};function eg(){return nde}function ew(e,t){let n=e[N0]?.backEdges;return n!==void 0&&kV(t)&&n.has(t)}var ng={};kr(ng,{ar:()=>$V,az:()=>SV,be:()=>EV,bg:()=>TV,bn:()=>IV,ca:()=>AV,ckb:()=>RV,cs:()=>CV,da:()=>NV,de:()=>PV,el:()=>DV,en:()=>tw,eo:()=>OV,es:()=>MV,fa:()=>LV,fi:()=>FV,fr:()=>UV,frCA:()=>jV,gu:()=>zV,he:()=>GV,hi:()=>VV,hr:()=>BV,hu:()=>qV,hy:()=>KV,id:()=>HV,is:()=>JV,it:()=>ZV,ja:()=>YV,ka:()=>QV,kh:()=>XV,km:()=>nw,kn:()=>eB,ko:()=>tB,lt:()=>rB,mk:()=>iB,ms:()=>oB,ne:()=>sB,nl:()=>aB,nn:()=>cB,no:()=>lB,ota:()=>uB,pl:()=>pB,ps:()=>dB,pt:()=>fB,ptBR:()=>mB,ro:()=>gB,ru:()=>yB,sk:()=>bB,sl:()=>vB,sv:()=>wB,ta:()=>kB,tg:()=>_B,th:()=>$B,tk:()=>SB,tr:()=>xB,ua:()=>EB,uk:()=>rw,ur:()=>TB,uz:()=>IB,vi:()=>AB,yo:()=>NB,zhCN:()=>RB,zhTW:()=>CB});var rde=()=>{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"},map:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n={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",mac:"\u0639\u0646\u0648\u0627\u0646 MAC",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",credit_card:"\u0631\u0642\u0645 \u0628\u0637\u0627\u0642\u0629 \u0627\u0644\u0627\u0626\u062A\u0645\u0627\u0646",currency_code:"\u0631\u0645\u0632 \u0627\u0644\u0639\u0645\u0644\u0629",iban:"IBAN",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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: ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${N(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.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 ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function $V(){return{localeError:rde()}}var ide=()=>{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"},map:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={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",credit_card:"kredit kart\u0131 n\xF6mr\u0259si",currency_code:"valyuta kodu",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function SV(){return{localeError:ide()}}function xV(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var ode=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u0443\u043C\u0430\u0440 \u043A\u0440\u044D\u0434\u044B\u0442\u043D\u0430\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=xV(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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=xV(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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${N(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function EV(){return{localeError:ode()}}var sde=()=>{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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${N(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function TV(){return{localeError:sde()}}var ade=()=>{let e={string:{unit:"\u0985\u0995\u09CD\u09B7\u09B0",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},file:{unit:"\u09AC\u09BE\u0987\u099F",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},array:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},set:{unit:"\u0986\u0987\u099F\u09C7\u09AE",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"},map:{unit:"\u098F\u09A8\u09CD\u099F\u09CD\u09B0\u09BF",verb:"\u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7"}};function t(r){return e[r]??null}let n={regex:"\u0987\u09A8\u09AA\u09C1\u099F",email:"\u0987\u09AE\u09C7\u0987\u09B2 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",url:"URL",emoji:"\u0987\u09AE\u09CB\u099C\u09BF",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u09A4\u09BE\u09B0\u09BF\u0996 \u0993 \u09B8\u09AE\u09AF\u09BC",date:"ISO \u09A4\u09BE\u09B0\u09BF\u0996",time:"ISO \u09B8\u09AE\u09AF\u09BC",duration:"ISO \u09B8\u09AE\u09AF\u09BC\u0995\u09BE\u09B2",ipv4:"IPv4 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",ipv6:"IPv6 \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",mac:"MAC \u09A0\u09BF\u0995\u09BE\u09A8\u09BE",cidrv4:"IPv4 \u09B0\u09C7\u099E\u09CD\u099C",cidrv6:"IPv6 \u09B0\u09C7\u099E\u09CD\u099C",base64:"base64-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",base64url:"base64url-\u098F\u09A8\u0995\u09CB\u09A1\u09C7\u09A1 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",json_string:"JSON \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982",e164:"E.164 \u09A8\u09AE\u09CD\u09AC\u09B0",credit_card:"\u0995\u09CD\u09B0\u09C7\u09A1\u09BF\u099F \u0995\u09BE\u09B0\u09CD\u09A1 \u09A8\u09AE\u09CD\u09AC\u09B0",currency_code:"\u09AE\u09C1\u09A6\u09CD\u09B0\u09BE \u0995\u09CB\u09A1",iban:"IBAN",jwt:"JWT",template_literal:"\u0987\u09A8\u09AA\u09C1\u099F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${o}, \u09AA\u09CD\u09B0\u09BE\u09AA\u09CD\u09A4 ${a}`}case"invalid_value":return r.values.length===1?`\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F: \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${V(r.values[0])}`:`\u0985\u09AC\u09C8\u09A7 \u0985\u09AA\u09B6\u09A8: ${N(r.values," | ")} \u098F\u09B0 \u09AE\u09A7\u09CD\u09AF\u09C7 \u098F\u0995\u099F\u09BF \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} ${s.unit??"\u098F\u09B2\u09BF\u09AE\u09C7\u09A8\u09CD\u099F"} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u09AC\u09A1\u09BC: ${r.origin??"\u09AE\u09BE\u09A8"} ${o}${r.maximum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09A8\u09C7\u0995 \u099B\u09CB\u099F: ${r.origin} ${o}${r.minimum.toString()} \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.prefix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C1\u09B0\u09C1 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="ends_with"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.suffix}" \u09A6\u09BF\u09AF\u09BC\u09C7 \u09B6\u09C7\u09B7 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="includes"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: "${o.includes}" \u0985\u09A8\u09CD\u09A4\u09B0\u09CD\u09AD\u09C1\u0995\u09CD\u09A4 \u09A5\u09BE\u0995\u09A4\u09C7 \u09B9\u09AC\u09C7`:o.format==="regex"?`\u0985\u09AC\u09C8\u09A7 \u09B8\u09CD\u099F\u09CD\u09B0\u09BF\u0982: ${o.pattern} \u09AA\u09CD\u09AF\u09BE\u099F\u09BE\u09B0\u09CD\u09A8 \u09AE\u09BF\u09B2\u09A4\u09C7 \u09B9\u09AC\u09C7`:`\u0985\u09AC\u09C8\u09A7 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0985\u09AC\u09C8\u09A7 \u09A8\u09AE\u09CD\u09AC\u09B0: ${r.divisor} \u098F\u09B0 \u0997\u09C1\u09A3\u09BF\u09A4\u0995 \u09B9\u09A4\u09C7 \u09B9\u09AC\u09C7`;case"unrecognized_keys":return`\u0985\u099A\u09C7\u09A8\u09BE \u0995\u09C0${r.keys.length>1?"\u0997\u09C1\u09B2\u09CB":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u0995\u09C0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0985\u09AC\u09C8\u09A7 \u09A1\u09BF\u09B8\u0995\u09CD\u09B0\u09BF\u09AE\u09BF\u09A8\u09C7\u099F\u09B0 \u09AE\u09BE\u09A8\u0964 \u09AA\u09CD\u09B0\u09A4\u09CD\u09AF\u09BE\u09B6\u09BF\u09A4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F";case"invalid_element":return`${r.origin} \u098F \u0985\u09AC\u09C8\u09A7 \u09AE\u09BE\u09A8`;default:return"\u0985\u09AC\u09C8\u09A7 \u0987\u09A8\u09AA\u09C1\u099F"}}};function IV(){return{localeError:ade()}}var cde=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={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",mac:"adre\xE7a MAC",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",credit_card:"n\xFAmero de targeta de cr\xE8dit",currency_code:"codi de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${V(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${N(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function AV(){return{localeError:cde()}}var lde=()=>{let e={string:{unit:"\u067E\u06CC\u062A",verb:"\u0628\u06CE\u062A"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u0628\u06CE\u062A"},array:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},set:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"},map:{unit:"\u062F\u0627\u0646\u06D5",verb:"\u0628\u06CE\u062A"}};function t(r){return e[r]??null}let n={regex:"regex",email:"\u0626\u06CC\u0645\u06D5\u06CC\u06B5",url:"\u0628\u06D5\u0633\u062A\u06D5\u0631 (URL)",emoji:"\u0626\u06CC\u0645\u06C6\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0695\u06CE\u06A9\u06D5\u0648\u062A \u0648 \u06A9\u0627\u062A",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",time:"\u06A9\u0627\u062A",duration:"\u0645\u0627\u0648\u06D5",ipv4:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv4",ipv6:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC IPv6",mac:"\u0646\u0627\u0648\u0646\u06CC\u0634\u0627\u0646\u06CC MAC",cidrv4:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv4",cidrv6:"\u0645\u06D5\u0648\u062F\u0627\u06CC IPv6",base64:"\u062F\u06D5\u0642\u06CC base64",base64url:"\u062F\u06D5\u0642\u06CC base64url",json_string:"\u062F\u06D5\u0642\u06CC JSON",e164:"\u0698\u0645\u0627\u0631\u06D5\u06CC E.164",credit_card:"\u0698\u0645\u0627\u0631\u06D5\u06CC \u06A9\u0627\u0631\u062A\u06CC \u06A9\u0631\u06CE\u062F\u06CC\u062A",currency_code:"\u06A9\u06C6\u062F\u06CC \u062F\u0631\u0627\u0648",iban:"IBAN",jwt:"JWT",template_literal:"\u062A\u06CE\u06A9\u0631\u062F\u06D5"},i={nan:"NaN",string:"\u0646\u0648\u0648\u0633\u06CC\u0646",number:"\u0698\u0645\u0627\u0631\u06D5",boolean:"boolean",array:"array",object:"object",date:"\u0695\u06CE\u06A9\u06D5\u0648\u062A",integer:"\u0698\u0645\u0627\u0631\u06D5",float:"\u0698\u0645\u0627\u0631\u06D5",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s,c=["\u0627","\u0648","\u06C6","\u0648\u0648","\u06D5","\u06CC","\u06CE"].some(u=>a.endsWith(u))?"\u06CC\u06D5":"\u06D5",l=/^[a-zA-Z]+$/.test(a);return s==="null"||s==="undefined"?"\u062F\u0627\u0648\u0627\u06A9\u0631\u0627\u0648\u06D5":`\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${o} \u0628\u06CE\u062A\u060C \u0628\u06D5\u06B5\u0627\u0645 ${a}${l?"":c}`}case"invalid_value":return r.values.length===1?`\u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0648\u0633\u062A\u06D5: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 ${V(r.values[0])} \u0628\u06CE\u062A`:`\u0647\u06D5\u06B5\u0628\u0698\u0627\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648\u06D5 \u06CC\u06D5\u06A9\u06CE\u06A9 \u0628\u06CE\u062A \u0644\u06D5 ${N(r.values,"|")}`;case"too_big":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u0632\u06C6\u0631\u06D5\u0648\u06D5 ${r.maximum.toString()} \u0628\u06CE\u062A`}case"too_small":{let o=t(r.origin);return o?`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} ${o.unit} ${o.verb}`:`\u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0628\u06D5 \u0644\u0627\u06CC\u06D5\u0646\u06CC \u06A9\u06D5\u0645\u06D5\u0648\u06D5 ${r.minimum.toString()} \u0628\u06CE\u062A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u062F\u06D5\u0633\u062A\u067E\u06CE\u0628\u06A9\u0627\u062A \u0628\u06D5 "${o.prefix}"`:o.format==="ends_with"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u06A9\u06C6\u062A\u0627\u06CC\u06CC\u0628\u06CE\u062A \u0628\u06D5 "${o.suffix}"`:o.format==="includes"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 "${o.includes}" \u0644\u06D5\u062E\u06C6\u0628\u06AF\u0631\u06CE\u062A`:o.format==="regex"?`\u062F\u06D5\u0642\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u067E\u06CE\u0648\u06CC\u0633\u062A\u06D5 \u0644\u06D5\u06AF\u06D5\u06B5 \u067E\u0627\u062A\u06CE\u0631\u0646\u06CC ${o.pattern} \u0628\u06AF\u0648\u0646\u062C\u06CE\u062A`:`\u0628\u06D5\u0647\u0627\u06CC ${n[o.format]??r.format} \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`}case"not_multiple_of":return`\u0698\u0645\u0627\u0631\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A: \u062F\u06D5\u0628\u06CE\u062A \u0686\u06D5\u0646\u062F \u0647\u06CE\u0646\u062F\u06D5 \u0628\u06CE\u062A \u0628\u06C6 ${r.divisor}`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648: ${N(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u0644\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A \u0644\u06D5 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0628\u06D5\u0647\u0627\u06CC \u0646\u06D5\u0646\u0627\u0633\u0631\u0627\u0648 \u0647\u06D5\u06CC\u06D5. \u0628\u06D5\u0647\u0627\u06CC \u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06A9\u0631\u0627\u0648: ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u06CC\u06D5\u06A9\u06AF\u0631\u062A\u0646\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A";case"invalid_element":return`${r.origin} \u0628\u06D5\u0647\u0627\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5`;default:return"\u062A\u06CE\u06A9\u0631\u062F\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A"}}};function RV(){return{localeError:lde()}}var ude=()=>{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"},map:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"\u010D\xEDslo kreditn\xED karty",currency_code:"k\xF3d m\u011Bny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${N(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function CV(){return{localeError:ude()}}var dde=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${N(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function NV(){return{localeError:dde()}}var pde=()=>{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"},map:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={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",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",currency_code:"W\xE4hrungscode",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${N(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function PV(){return{localeError:pde()}}var fde=()=>{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(r){return e[r]??null}let n={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",credit_card:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C0\u03B9\u03C3\u03C4\u03C9\u03C4\u03B9\u03BA\u03AE\u03C2 \u03BA\u03AC\u03C1\u03C4\u03B1\u03C2",currency_code:"\u03BA\u03C9\u03B4\u03B9\u03BA\u03CC\u03C2 \u03BD\u03BF\u03BC\u03AF\u03C3\u03BC\u03B1\u03C4\u03BF\u03C2",iban:"IBAN",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\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 ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${N(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.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 ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function DV(){return{localeError:fde()}}var mde=()=>{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(o){return e[o]??null}let n={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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function r(o,s){return o==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):i[o]??o}return o=>{switch(o.code){case"invalid_type":{let s=r(o.expected),a=K(o.input),c=r(a,o.input);return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${V(o.values[0])}`:`Invalid option: expected one of ${N(o.values,"|")}`;case"too_big":{let s=o.exact?"exactly ":o.inclusive?"<=":"<",a=t(o.origin);return a?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.exact?"exactly ":o.inclusive?">=":">",a=t(o.origin);return a?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${a.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${N(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(a=>`'${a}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function tw(){return{localeError:mde()}}var gde=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={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",mac:"MAC-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",credit_card:"kreditkarta numero",currency_code:"valuta kodo",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${N(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function OV(){return{localeError:gde()}}var hde=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={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",mac:"direcci\xF3n MAC",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",credit_card:"n\xFAmero de tarjeta de cr\xE9dito",currency_code:"c\xF3digo de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function MV(){return{localeError:hde()}}var yde=()=>{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"},map:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0634\u0645\u0627\u0631\u0647 \u06A9\u0627\u0631\u062A \u0627\u0639\u062A\u0628\u0627\u0631\u06CC",currency_code:"\u06A9\u062F \u0627\u0631\u0632",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\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 ${N(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.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 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${N(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.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 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function LV(){return{localeError:yde()}}var bde=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n={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",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",currency_code:"valuuttakoodi",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${N(r.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"}}};function FV(){return{localeError:bde()}}var vde=()=>{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(r){return e[r]??null}let n={regex:"expression r\xE9guli\xE8re",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",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne de caract\xE8res encod\xE9e en base64",base64url:"cha\xEEne de caract\xE8res encod\xE9e en base64url",json_string:"cha\xEEne de caract\xE8res JSON",e164:"num\xE9ro au format E.164",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne de caract\xE8res",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:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instance de ${r.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${V(r.values[0])} attendu`:`Option invalide : une valeur parmi ${N(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne de caract\xE8res invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne de caract\xE8res invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne de caract\xE8res invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne de caract\xE8res invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${N(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function UV(){return{localeError:vde()}}var wde=()=>{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"},map:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={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",mac:"adresse MAC",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",credit_card:"num\xE9ro de carte de cr\xE9dit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${V(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${N(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function jV(){return{localeError:wde()}}var kde=()=>{let e={string:{unit:"\u0A85\u0A95\u0ACD\u0AB7\u0AB0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},file:{unit:"\u0AAC\u0ABE\u0AAF\u0A9F",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},array:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},set:{unit:"\u0A86\u0A87\u0A9F\u0AAE",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"},map:{unit:"\u0A8F\u0AA8\u0ACD\u0A9F\u0ACD\u0AB0\u0AC0",verb:"\u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F"}};function t(r){return e[r]??null}let n={regex:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F",email:"\u0A88\u0AAE\u0AC7\u0A87\u0AB2 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",url:"URL",emoji:"\u0A87\u0AAE\u0ACB\u0A9C\u0AC0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96 \u0A85\u0AA8\u0AC7 \u0AB8\u0AAE\u0AAF",date:"ISO \u0AA4\u0ABE\u0AB0\u0AC0\u0A96",time:"ISO \u0AB8\u0AAE\u0AAF",duration:"ISO \u0A85\u0AB5\u0AA7\u0ABF",ipv4:"IPv4 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",ipv6:"IPv6 \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",mac:"MAC \u0A8F\u0AA1\u0ACD\u0AB0\u0AC7\u0AB8",cidrv4:"IPv4 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",cidrv6:"IPv6 \u0AB6\u0ACD\u0AB0\u0AC7\u0AA3\u0AC0",base64:"base64-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",base64url:"base64url-\u0A8F\u0AA8\u0ACD\u0A95\u0ACB\u0AA1\u0AC7\u0AA1 \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",json_string:"JSON \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97",e164:"E.164 \u0AA8\u0A82\u0AAC\u0AB0",credit_card:"\u0A95\u0ACD\u0AB0\u0AC7\u0AA1\u0ABF\u0A9F \u0A95\u0ABE\u0AB0\u0ACD\u0AA1 \u0AA8\u0A82\u0AAC\u0AB0",currency_code:"\u0A9A\u0AB2\u0AA3 \u0A95\u0ACB\u0AA1",iban:"IBAN",jwt:"JWT",template_literal:"\u0A87\u0AA8\u0AAA\u0AC1\u0A9F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${o}, \u0AAA\u0ACD\u0AB0\u0ABE\u0AAA\u0ACD\u0AA4 ${a}`}case"invalid_value":return r.values.length===1?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F: \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${V(r.values[0])}`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB5\u0ABF\u0A95\u0AB2\u0ACD\u0AAA: ${N(r.values," | ")} \u0AAE\u0ABE\u0AA7\u0ACD\u0AAF\u0AAE\u0AA5\u0AC0 \u0A8F\u0A95 \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} ${s.unit??"\u0A8F\u0AB2\u0ABF\u0AAE\u0AC7\u0AA8\u0ACD\u0A9F"} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AAE\u0ACB\u0A9F\u0AC1\u0A82: ${r.origin??"\u0AAE\u0AC2\u0AB2\u0ACD\u0AAF"} ${o}${r.maximum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0AB9\u0ACB\u0AB5\u0ABE \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A96\u0AC2\u0AAC \u0AA8\u0ABE\u0AA8\u0AC1\u0A82: ${r.origin} ${o}${r.minimum.toString()} \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.prefix}" \u0AA5\u0AC0 \u0AB6\u0AB0\u0AC2 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="ends_with"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.suffix}" \u0AAA\u0AB0 \u0AB8\u0AAE\u0ABE\u0AAA\u0ACD\u0AA4 \u0AA5\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="includes"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: "${o.includes}" \u0AB6\u0ABE\u0AAE\u0AC7\u0AB2 \u0AB9\u0ACB\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:o.format==="regex"?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AB8\u0ACD\u0A9F\u0ACD\u0AB0\u0ABF\u0A82\u0A97: \u0AAA\u0AC7\u0A9F\u0AB0\u0ACD\u0AA8 ${o.pattern} \u0AB8\u0ABE\u0AA5\u0AC7 \u0AAE\u0AC7\u0AB3 \u0A96\u0ABE\u0AB5\u0AC1\u0A82 \u0A9C\u0ACB\u0A88\u0A8F`:`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA8\u0A82\u0AAC\u0AB0: ${r.divisor} \u0AA8\u0ACB \u0A97\u0AC1\u0AA3\u0ABE\u0A82\u0A95 \u0AB9\u0ACB\u0AB5\u0ACB \u0A9C\u0ACB\u0A88\u0A8F`;case"unrecognized_keys":return`\u0A93\u0AB3\u0A96\u0AC0 \u0AB6\u0A95\u0ABE\u0AA4\u0ABE \u0AA8\u0AB9\u0AC0\u0A82 \u0AA4\u0AC7 \u0A95\u0AC0${r.keys.length>1?"\u0A93":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A95\u0AC0`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AA1\u0ABF\u0AB8\u0ACD\u0A95\u0ACD\u0AB0\u0ABF\u0AAE\u0ABF\u0AA8\u0AC7\u0A9F\u0AB0 \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF. \u0A85\u0AAA\u0AC7\u0A95\u0ACD\u0AB7\u0ABF\u0AA4 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F";case"invalid_element":return`${r.origin} \u0AAE\u0ABE\u0A82 \u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0AAE\u0AC2\u0AB2\u0ACD\u0AAF`;default:return"\u0A85\u0AAE\u0ABE\u0AA8\u0ACD\u0AAF \u0A87\u0AA8\u0AAA\u0AC1\u0A9F"}}};function zV(){return{localeError:kde()}}var _de=()=>{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"}},n=l=>l?e[l]:void 0,i=l=>{let u=n(l);return u?u.label:l??e.unknown.label},r=l=>`\u05D4${i(l)}`,o=l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?t[l]??null: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"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",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"},mac:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA MAC",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"},credit_card:{label:"\u05DE\u05E1\u05E4\u05E8 \u05DB\u05E8\u05D8\u05D9\u05E1 \u05D0\u05E9\u05E8\u05D0\u05D9",gender:"m"},currency_code:{label:"\u05E7\u05D5\u05D3 \u05DE\u05D8\u05D1\u05E2",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"\u05E7\u05DC\u05D8",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 l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??i(u),p=K(l.input),f=c[p]??e[p]?.label??p;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.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 ${V(l.values[0])}`;let u=l.values.map(f=>V(f));if(l.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=r(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let h=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`}let g=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let d=a[u.format],p=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${m}`}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 ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${N(l.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${r(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function GV(){return{localeError:_de()}}var $de=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},file:{unit:"\u092C\u093E\u0907\u091F\u094D\u0938",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F\u092F\u093E\u0901",verb:"\u0930\u0916\u0928\u0947 \u0915\u0947 \u0932\u093F\u090F"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0924\u093F\u0925\u093F \u0914\u0930 \u0938\u092E\u092F",date:"ISO \u0924\u093F\u0925\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u092A\u0924\u093E",ipv6:"IPv6 \u092A\u0924\u093E",mac:"MAC \u092A\u0924\u093E",cidrv4:"IPv4 \u0936\u094D\u0930\u0947\u0923\u0940",cidrv6:"IPv6 \u0936\u094D\u0930\u0947\u0923\u0940",base64:"Base64-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",base64url:"Base64URL-\u090F\u0928\u094D\u0915\u094B\u0921\u0947\u0921 \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917",e164:"E.164 \u0938\u0902\u0916\u094D\u092F\u093E",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0938\u0902\u0916\u094D\u092F\u093E",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u094B\u0902 \u092E\u0947\u0902 \u0938\u0947 \u090F\u0915 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} \u092E\u0947\u0902 ${o}${r.maximum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u092C\u0921\u093C\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum} \u0939\u094B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} \u092E\u0947\u0902 ${o}${r.minimum} ${s.unit} \u0939\u094B\u0902`:`\u092C\u0939\u0941\u0924 \u091B\u094B\u091F\u093E: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u0925\u093E \u0915\u093F ${r.origin} ${o}${r.minimum} \u0939\u094B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.prefix}" \u0938\u0947 \u0936\u0941\u0930\u0942 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: "${o.suffix}" \u092A\u0930 \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u0907\u0938\u092E\u0947\u0902 "${o.includes}" \u0936\u093E\u092E\u093F\u0932 \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0902\u0917: \u092A\u0948\u091F\u0930\u094D\u0928 ${o.pattern} \u0938\u0947 \u092E\u0947\u0932 \u0916\u093E\u0928\u093E \u091A\u093E\u0939\u093F\u090F`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: \u092F\u0939 ${r.divisor} \u0915\u093E \u0917\u0941\u0923\u091C \u0939\u094B\u0928\u093E \u091A\u093E\u0939\u093F\u090F`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u0902\u091C\u0940${r.keys.length>1?"\u092F\u093E\u0901":""}: ${N(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u0902\u091C\u0940: ${r.origin} \u092E\u0947\u0902`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u0947\u0902`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function VV(){return{localeError:$de()}}var Sde=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={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",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",currency_code:"kod valute",iban:"IBAN",jwt:"JWT",template_literal:"unos"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${V(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${N(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function BV(){return{localeError:Sde()}}var xde=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"hitelk\xE1rtyasz\xE1m",currency_code:"p\xE9nznemk\xF3d",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function qV(){return{localeError:xde()}}function WV(e,t,n){return Math.abs(e)===1?t:n}function Gu(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var Ede=()=>{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"},map:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u056F\u0580\u0565\u0564\u056B\u057F \u0584\u0561\u0580\u057F\u056B \u0570\u0561\u0574\u0561\u0580",currency_code:"\u0561\u0580\u056A\u0578\u0582\u0575\u0569\u056B \u056F\u0578\u0564",iban:"IBAN",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[1])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=WV(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 ${Gu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.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 ${Gu(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=WV(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 ${Gu(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.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 ${Gu(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.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 ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${N(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Gu(r.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 ${Gu(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function KV(){return{localeError:Ede()}}var Tde=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={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",mac:"alamat MAC",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",credit_card:"nomor kartu kredit",currency_code:"kode mata uang",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${V(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function HV(){return{localeError:Tde()}}var Ide=()=>{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"},map:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}let n={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",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",credit_card:"kreditkortan\xFAmer",currency_code:"gjaldmi\xF0ilsk\xF3\xF0i",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${N(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function JV(){return{localeError:Ide()}}var Ade=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={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",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",currency_code:"codice valuta",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${V(r.values[0])}`:`Opzione non valida: atteso uno tra ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${N(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function ZV(){return{localeError:Ade()}}var Rde=()=>{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"},map:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n={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",mac:"MAC\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",credit_card:"\u30AF\u30EC\u30B8\u30C3\u30C8\u30AB\u30FC\u30C9\u756A\u53F7",currency_code:"\u901A\u8CA8\u30B3\u30FC\u30C9",iban:"IBAN",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${N(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.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${r.keys.length>1?"\u7FA4":""}: ${N(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function YV(){return{localeError:Rde()}}var Cde=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u10E1\u10D0\u10D9\u10E0\u10D4\u10D3\u10D8\u10E2\u10DD \u10D1\u10D0\u10E0\u10D0\u10D7\u10D8\u10E1 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",currency_code:"\u10D5\u10D0\u10DA\u10E3\u10E2\u10D8\u10E1 \u10D9\u10DD\u10D3\u10D8",iban:"IBAN",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\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 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${N(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\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 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\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 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\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 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\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 "${o.includes}"-\u10E1`:o.format==="regex"?`\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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.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 ${r.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${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${N(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.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 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function QV(){return{localeError:Cde()}}var Nde=()=>{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"},map:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n={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",mac:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 MAC",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",credit_card:"\u179B\u17C1\u1781\u1794\u17D0\u178E\u17D2\u178E\u17A5\u178E\u1791\u17B6\u1793",currency_code:"\u1780\u17BC\u178A\u179A\u17BC\u1794\u17B7\u1799\u1794\u17D0\u178E\u17D2\u178E",iban:"IBAN",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${N(r.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 ${r.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 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function nw(){return{localeError:Nde()}}function XV(){return nw()}var Pde=()=>{let e={string:{unit:"\u0C85\u0C95\u0CCD\u0CB7\u0CB0\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},file:{unit:"\u0CAC\u0CC8\u0C9F\u0CCD\u200C\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},array:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},set:{unit:"\u0CB5\u0CB8\u0CCD\u0CA4\u0CC1\u0C97\u0CB3\u0CC1",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"},map:{unit:"entries",verb:"\u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1"}};function t(r){return e[r]??null}let n={regex:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD",email:"email \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",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 \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95\u0CA6 \u0CB8\u0CAE\u0CAF",date:"ISO \u0CA6\u0CBF\u0CA8\u0CBE\u0C82\u0C95",time:"ISO \u0CB8\u0CAE\u0CAF",duration:"ISO \u0C85\u0CB5\u0CA7\u0CBF",ipv4:"IPv4 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",ipv6:"IPv6 \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",mac:"MAC \u0CB5\u0CBF\u0CB3\u0CBE\u0CB8",cidrv4:"IPv4 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",cidrv6:"IPv6 \u0CB5\u0CCD\u0CAF\u0CBE\u0CAA\u0CCD\u0CA4\u0CBF\u0CAF",base64:"base64-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",base64url:"base64url-encoded\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",json_string:"JSON\u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD",e164:"E.164 \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",credit_card:"\u0C95\u0CCD\u0CB0\u0CC6\u0CA1\u0CBF\u0C9F\u0CCD \u0C95\u0CBE\u0CB0\u0CCD\u0CA1\u0CCD \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6",currency_code:"\u0C95\u0CB0\u0CC6\u0CA8\u0CCD\u0CB8\u0CBF \u0C95\u0CCB\u0CA1\u0CCD",iban:"IBAN",jwt:"JWT",template_literal:"\u0C87\u0CA8\u0CCD\u0CAA\u0CC1\u0C9F\u0CCD"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${o}, \u0CB8\u0CCD\u0CB5\u0CC0\u0C95\u0CB0\u0CBF\u0CB8\u0CBF\u0CA6\u0CA8\u0CC1 ${a}`}case"invalid_value":return r.values.length===1?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${V(r.values[0])}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C86\u0CAF\u0CCD\u0C95\u0CC6: \u0C87\u0CB5\u0CC1\u0C97\u0CB3\u0CB2\u0CCD\u0CB2\u0CBF \u0C92\u0C82\u0CA6\u0CA8\u0CCD\u0CA8\u0CC1 \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.maximum.toString()} ${s.unit??"\u0C85\u0C82\u0CB6\u0C97\u0CB3\u0CC1"}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0CA6\u0CCA\u0CA1\u0CCD\u0CA1\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin??"value"} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0CB9\u0CCA\u0C82\u0CA6\u0CB2\u0CC1 ${o}${r.minimum.toString()} ${s.unit}`:`\u0CA4\u0CC1\u0C82\u0CAC\u0CBE \u0C9A\u0CBF\u0C95\u0CCD\u0C95\u0CA6\u0CC1: \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.origin} \u0C8E\u0C82\u0CA6\u0CC1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CBE\u0CB0\u0C82\u0CAD\u0CBF\u0CB8\u0CAC\u0CC7\u0C95\u0CC1 "${o.prefix}"`:o.format==="ends_with"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C87\u0CA6\u0CB0\u0CCA\u0C82\u0CA6\u0CBF\u0C97\u0CC6 \u0C95\u0CCA\u0CA8\u0CC6\u0C97\u0CCA\u0CB3\u0CCD\u0CB3\u0CAC\u0CC7\u0C95\u0CC1 "${o.suffix}"`:o.format==="includes"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0C92\u0CB3\u0C97\u0CCA\u0C82\u0CA1\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 "${o.includes}"`:o.format==="regex"?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0CB8\u0CCD\u0C9F\u0CCD\u0CB0\u0CBF\u0C82\u0C97\u0CCD: \u0CAE\u0CBE\u0CA6\u0CB0\u0CBF\u0C97\u0CC6 \u0CB9\u0CCA\u0C82\u0CA6\u0CBF\u0C95\u0CC6\u0CAF\u0CBE\u0C97\u0CAC\u0CC7\u0C95\u0CC1 ${o.pattern}`:`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6: \u0CAC\u0CB9\u0CC1\u0CB8\u0C82\u0C96\u0CCD\u0CAF\u0CC6\u0CAF\u0CBE\u0C97\u0CBF\u0CB0\u0CAC\u0CC7\u0C95\u0CC1 ${r.divisor}`;case"unrecognized_keys":return`\u0C97\u0CC1\u0CB0\u0CC1\u0CA4\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CA6 \u0C95\u0CC0 ${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF\u0CB5\u0CBE\u0CA6 \u0C95\u0CC0 \u0C87\u0CA8\u0CCD ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CA4\u0CBE\u0CB0\u0CA4\u0CAE\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF. \u0CA8\u0CBF\u0CB0\u0CC0\u0C95\u0CCD\u0CB7\u0CBF\u0CB8\u0CB2\u0CBE\u0C97\u0CBF\u0CA6\u0CC6 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD";case"invalid_element":return`\u0CB0\u0CB2\u0CCD\u0CB2\u0CBF \u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0CAE\u0CCC\u0CB2\u0CCD\u0CAF ${r.origin}`;default:return"\u0C85\u0CAE\u0CBE\u0CA8\u0CCD\u0CAF \u0C87\u0CA8\u0CCD\u200C\u0CAA\u0CC1\u0C9F\u0CCD"}}};function eB(){return{localeError:Pde()}}var Dde=()=>{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"},map:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\uC2E0\uC6A9\uCE74\uB4DC \uBC88\uD638",currency_code:"\uD1B5\uD654 \uCF54\uB4DC",iban:"IBAN",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${N(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${N(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function tB(){return{localeError:Dde()}}var tg=e=>e.charAt(0).toUpperCase()+e.slice(1);function nB(e){let t=Math.abs(e),n=t%10,i=t%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var Ode=()=>{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(r,o,s,a){let c=e[r]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let n={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",mac:"MAC 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",credit_card:"kredito kortel\u0117s numeris",currency_code:"valiutos kodas",iban:"IBAN",jwt:"JWT",template_literal:"\u012Fvestis"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${V(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${N(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=t(r.origin,nB(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${tg(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${tg(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=t(r.origin,nB(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${tg(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${tg(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${N(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${tg(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function rB(){return{localeError:Ode()}}var Mde=()=>{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"},map:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0431\u0440\u043E\u0458 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u0430 \u043A\u0430\u0440\u0442\u0438\u0447\u043A\u0430",currency_code:"\u043A\u043E\u0434 \u043D\u0430 \u0432\u0430\u043B\u0443\u0442\u0430",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`Invalid ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`${r.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"}: ${N(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.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 ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function iB(){return{localeError:Mde()}}var Lde=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={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",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",currency_code:"kod mata wang",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${V(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${N(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function oB(){return{localeError:Lde()}}var Fde=()=>{let e={string:{unit:"\u0905\u0915\u094D\u0937\u0930",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},file:{unit:"\u092C\u093E\u0907\u091F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},array:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},set:{unit:"\u0924\u0924\u094D\u0935",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"},map:{unit:"\u092A\u094D\u0930\u0935\u093F\u0937\u094D\u091F\u093F",verb:"\u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B"}};function t(r){return e[r]??null}let n={regex:"\u0907\u0928\u092A\u0941\u091F",email:"\u0907\u092E\u0947\u0932 \u0920\u0947\u0917\u093E\u0928\u093E",url:"URL",emoji:"\u0907\u092E\u094B\u091C\u0940",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u092E\u093F\u0924\u093F \u0930 \u0938\u092E\u092F",date:"ISO \u092E\u093F\u0924\u093F",time:"ISO \u0938\u092E\u092F",duration:"ISO \u0905\u0935\u0927\u093F",ipv4:"IPv4 \u0920\u0947\u0917\u093E\u0928\u093E",ipv6:"IPv6 \u0920\u0947\u0917\u093E\u0928\u093E",mac:"MAC \u0920\u0947\u0917\u093E\u0928\u093E",cidrv4:"IPv4 \u0926\u093E\u092F\u0930\u093E",cidrv6:"IPv6 \u0926\u093E\u092F\u0930\u093E",base64:"base64-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",base64url:"base64url-\u0907\u0928\u094D\u0915\u094B\u0921 \u0917\u0930\u093F\u090F\u0915\u094B \u0938\u094D\u091F\u094D\u0930\u093F\u0919",json_string:"JSON \u0938\u094D\u091F\u094D\u0930\u093F\u0919",e164:"E.164 \u0928\u092E\u094D\u092C\u0930",credit_card:"\u0915\u094D\u0930\u0947\u0921\u093F\u091F \u0915\u093E\u0930\u094D\u0921 \u0928\u092E\u094D\u092C\u0930",currency_code:"\u092E\u0941\u0926\u094D\u0930\u093E \u0915\u094B\u0921",iban:"IBAN",jwt:"JWT",template_literal:"\u0907\u0928\u092A\u0941\u091F"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${o}, \u092A\u094D\u0930\u093E\u092A\u094D\u0924 ${a}`}case"invalid_value":return r.values.length===1?`\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${V(r.values[0])}`:`\u0905\u092E\u093E\u0928\u094D\u092F \u0935\u093F\u0915\u0932\u094D\u092A: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 \u092E\u093E\u0928\u0939\u0930\u0942 \u092E\u0927\u094D\u092F\u0947 \u090F\u0915 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} \u092E\u093E ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0920\u0942\u0932\u094B: ${r.origin??"\u092E\u093E\u0928"} ${o}${r.maximum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} \u092E\u093E ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0927\u0947\u0930\u0948 \u0938\u093E\u0928\u094B: ${r.origin} ${o}${r.minimum.toString()} \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.prefix}" \u092C\u093E\u091F \u0938\u0941\u0930\u0941 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="ends_with"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.suffix}" \u092E\u093E \u0938\u092E\u093E\u092A\u094D\u0924 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="includes"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: "${o.includes}" \u0938\u092E\u093E\u0935\u0947\u0936 \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`:o.format==="regex"?`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u094D\u091F\u094D\u0930\u093F\u0919: \u0922\u093E\u0901\u091A\u093E ${o.pattern} \u0938\u0901\u0917 \u092E\u0947\u0932 \u0916\u093E\u0928\u0941\u092A\u0930\u094D\u091B`:`\u0905\u092E\u093E\u0928\u094D\u092F ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0938\u0902\u0916\u094D\u092F\u093E: ${r.divisor} \u0915\u094B \u0917\u0941\u0923\u091C \u0939\u0941\u0928\u0941\u092A\u0930\u094D\u091B`;case"unrecognized_keys":return`\u0905\u092A\u0930\u093F\u091A\u093F\u0924 \u0915\u0941\u091E\u094D\u091C\u0940${r.keys.length>1?"\u0939\u0930\u0942":""}: ${N(r.keys,", ")}`;case"invalid_key":return`\u0905\u092E\u093E\u0928\u094D\u092F \u0915\u0941\u091E\u094D\u091C\u0940: ${r.origin} \u092E\u093E`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u0905\u092E\u093E\u0928\u094D\u092F \u0921\u093F\u0938\u094D\u0915\u094D\u0930\u093F\u092E\u093F\u0928\u0947\u091F\u0930 \u092E\u093E\u0928: \u0905\u092A\u0947\u0915\u094D\u0937\u093F\u0924 ${r.options.map(s=>`'${s}'`).join(" | ")}`:"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F";case"invalid_element":return`\u0905\u092E\u093E\u0928\u094D\u092F \u092E\u093E\u0928: ${r.origin} \u092E\u093E`;default:return"\u0905\u092E\u093E\u0928\u094D\u092F \u0907\u0928\u092A\u0941\u091F"}}};function sB(){return{localeError:Fde()}}var Ude=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={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",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",currency_code:"valutacode",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${V(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin),a=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin),a=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function aB(){return{localeError:Ude()}}var jde=()=>{let e={string:{unit:"teikn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"element",verb:"\xE5 innehalde"},set:{unit:"element",verb:"\xE5 innehalde"},map:{unit:"element",verb:"\xE5 innehalde"}};function t(r){return e[r]??null}let n={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-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tal",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventa instanceof ${r.expected}, fekk ${a}`:`Ugyldig input: forventa ${o}, fekk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventa ${V(r.values[0])}`:`Ugyldig val: forventa eitt av ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`For stor(t): forventa ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventa ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 slutte med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 innehalde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tal: m\xE5 vere eit multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjende n\xF8klar":"Ukjend n\xF8kkel"}: ${N(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function cB(){return{localeError:jde()}}var zde=()=>{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"},map:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n={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-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${V(r.values[0])}`:`Ugyldig valg: forventet en av ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${N(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function lB(){return{localeError:zde()}}var Gde=()=>{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"},map:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"i'tib\xE2r kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${V(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function uB(){return{localeError:Gde()}}var Vde=()=>{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"},map:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n={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",mac:"\u062F MAC \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",credit_card:"\u062F \u06A9\u0631\u06CC\u0689\u06CC\u067C \u06A9\u0627\u0631\u062A \u0634\u0645\u06CC\u0631\u0647",currency_code:"\u062F \u0627\u0633\u0639\u0627\u0631\u0648 \u06A9\u0648\u0689",iban:"IBAN",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${N(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${N(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.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 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function dB(){return{localeError:Vde()}}var Bde=()=>{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"},map:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n={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",mac:"adres MAC",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",credit_card:"numer karty kredytowej",currency_code:"kod waluty",iban:"IBAN",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${N(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function pB(){return{localeError:Bde()}}var qde=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"o intervalo de endere\xE7os IPv4",cidrv6:"o intervalo de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tuplo",articles:i.masculine},record:{name:"registo",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"ficheiro",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=K(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${N(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Demasiado grande: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Demasiado pequeno: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Demasiado pequeno: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar por "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${N(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function fB(){return{localeError:qde()}}var Wde=()=>{let e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(s){return e[s]??null}let n={regex:"a entrada",email:"o endere\xE7o de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a dura\xE7\xE3o ISO",ipv4:"o endere\xE7o IPv4",ipv6:"o endere\xE7o IPv6",mac:"o endere\xE7o MAC",cidrv4:"a faixa de endere\xE7os IPv4",cidrv6:"a faixa de endere\xE7os IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o n\xFAmero E.164",credit_card:"o n\xFAmero de cart\xE3o de cr\xE9dito",currency_code:"o c\xF3digo de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},i={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},r={string:{name:"texto",articles:i.masculine},number:{name:"n\xFAmero",articles:i.masculine},int:{name:"n\xFAmero inteiro",articles:i.masculine},boolean:{name:"valor booleano",articles:i.masculine},bigint:{name:"n\xFAmero bigint",articles:i.masculine},symbol:{name:"s\xEDmbolo",articles:i.masculine},undefined:{name:'valor "undefined"',articles:i.masculine},null:{name:'valor "nulo"',articles:i.masculine},never:{name:'valor "never"',articles:i.masculine},void:{name:'valor "void"',articles:i.masculine},date:{name:"data",articles:i.feminine},array:{name:"vetor",articles:i.masculine},object:{name:"objeto",articles:i.masculine},tuple:{name:"tupla",articles:i.feminine},record:{name:"registro",articles:i.masculine},map:{name:"mapa",articles:i.masculine},set:{name:"conjunto",articles:i.masculine},file:{name:"arquivo",articles:i.masculine},nonoptional:{name:"valor n\xE3o opcional",articles:i.masculine},nan:{name:'valor "NaN"',articles:i.masculine},function:{name:"fun\xE7\xE3o",articles:i.feminine}};function o(s,a){let c=r[s]??{name:`valor "${s}"`,articles:i.masculine};return`${c.articles[a]} ${c.name}`}return s=>{switch(s.code){case"invalid_type":{let a=o(s.expected,"indefinite"),c=K(s.input),l=o(c,"indefinite");return`Entrada inv\xE1lida: esperava ${a}, recebeu ${l}`}case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: esperava ${V(s.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperava uma das seguintes op\xE7\xF5es: ${N(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",c=t(s.origin);return c?`Grande demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.maximum.toString()} ${c.unit??"elementos"}`:`Grande demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",c=t(s.origin);return c?`Pequeno demais: esperava que ${o(s.origin,"definite")} tivesse ${a} ${s.minimum.toString()} ${c.unit??"elementos"}`:`Pequeno demais: esperava que ${o(s.origin,"definite")} fosse ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`Formato d${n[a.format]??s.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":{let a=s.keys.length>1?"s":"";return`Chave${a} inv\xE1lida${a}: ${N(s.keys,", ")}`}case"invalid_key":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Valor de discrimina\xE7\xE3o inv\xE1lido. Esperava ${s.options.map(c=>`'${c}'`).join(" | ")}`:"Entrada inv\xE1lida";case"invalid_element":return`Entrada inv\xE1lida n${o(s.origin,"definite")}`;default:return"Entrada inv\xE1lida"}}};function mB(){return{localeError:Wde()}}var Kde=()=>{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(r){return e[r]??null}let n={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",credit_card:"num\u0103r de card de credit",currency_code:"cod valutar",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${V(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${N(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function gB(){return{localeError:Kde()}}function hB(e,t,n,i){let r=Math.abs(e),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?t:o>=2&&o<=4?n:i}var Hde=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u044B",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=hB(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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=hB(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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${N(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function yB(){return{localeError:Hde()}}var Jde=()=>{let e={string:{unit:"znakov",verb:"ma\u0165"},file:{unit:"bajtov",verb:"ma\u0165"},array:{unit:"prvkov",verb:"ma\u0165"},set:{unit:"prvkov",verb:"ma\u0165"},map:{unit:"polo\u017Eiek",verb:"ma\u0165"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rny 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:"d\xE1tum a \u010Das vo form\xE1te ISO",date:"d\xE1tum vo form\xE1te ISO",time:"\u010Das vo form\xE1te ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64",base64url:"re\u0165azec zak\xF3dovan\xFD vo form\xE1te base64url",json_string:"re\u0165azec vo form\xE1te JSON",e164:"\u010D\xEDslo E.164",credit_card:"\u010D\xEDslo kreditnej karty",currency_code:"k\xF3d meny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"re\u0165azec",function:"funkcia",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 instanceof ${r.expected}, obdr\u017Ean\xE9 ${a}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${o}, obdr\u017Ean\xE9 ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dak\xE1van\xE9 ${V(r.values[0])}`:`Neplatn\xFD vstup: o\u010Dak\xE1van\xE1 jedna z hodn\xF4t ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.maximum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 ve\u013Ek\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED ma\u0165 ${o}${r.minimum.toString()} ${s.unit??"prvkov"}`:`Hodnota je pr\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED by\u0165 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD re\u0165azec: mus\xED za\u010D\xEDna\u0165 na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD re\u0165azec: mus\xED kon\u010Di\u0165 na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD re\u0165azec: mus\xED obsahova\u0165 "${o.includes}"`:o.format==="regex"?`Neplatn\xFD re\u0165azec: mus\xED zodpoveda\u0165 vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED by\u0165 n\xE1sobkom ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1me kl\xFA\u010De: ${N(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xFA\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function bB(){return{localeError:Jde()}}var Zde=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={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",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",credit_card:"\u0161tevilka kreditne kartice",currency_code:"koda valute",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${N(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function vB(){return{localeError:Zde()}}var Yde=()=>{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"},map:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n={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-adress",ipv6:"IPv6-adress",mac:"MAC-adress",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",credit_card:"kreditkortsnummer",currency_code:"valutakod",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${N(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function wB(){return{localeError:Yde()}}var Qde=()=>{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"},map:{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(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u0B95\u0B9F\u0BA9\u0BCD \u0B85\u0B9F\u0BCD\u0B9F\u0BC8 \u0B8E\u0BA3\u0BCD",currency_code:"\u0BA8\u0BBE\u0BA3\u0BAF\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BBF\u0BAF\u0BC0\u0B9F\u0BC1",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${N(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.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`:`\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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\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 ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\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 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.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${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.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`${r.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"}}};function kB(){return{localeError:Qde()}}var Xde=()=>{let e={string:{unit:"\u0430\u043B\u043E\u043C\u0430\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},file:{unit:"\u0431\u0430\u0439\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},array:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},set:{unit:"\u0443\u043D\u0441\u0443\u0440",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"},map:{unit:"\u0441\u0430\u0431\u0442",verb:"\u0434\u043E\u0448\u0442\u0430 \u0431\u043E\u0448\u0430\u0434"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0443\u0440\u0443\u0434",email:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 email",url:"URL",emoji:"\u044D\u043C\u043E\u04B7\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0441\u0430\u043D\u0430\u0432\u0443 \u0432\u0430\u049B\u0442\u0438 ISO",date:"\u0441\u0430\u043D\u0430\u0438 ISO",time:"\u0432\u0430\u049B\u0442\u0438 ISO",duration:"\u0434\u0430\u0432\u043E\u043C\u043D\u043E\u043A\u0438\u0438 ISO",ipv4:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv4",ipv6:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 IPv6",mac:"\u0441\u0443\u0440\u043E\u0493\u0430\u0438 MAC",cidrv4:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv4",cidrv6:"\u043C\u0430\u04B3\u0434\u0443\u0434\u0430\u0438 IPv6",base64:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64",base64url:"\u0441\u0430\u0442\u0440\u0438 \u0434\u0430\u0440 \u0444\u043E\u0440\u043C\u0430\u0442\u0438 base64url",json_string:"\u0441\u0430\u0442\u0440\u0438 JSON",e164:"\u0440\u0430\u049B\u0430\u043C\u0438 E.164",credit_card:"\u0440\u0430\u049B\u0430\u043C\u0438 \u043A\u043E\u0440\u0442\u0438 \u043A\u0440\u0435\u0434\u0438\u0442\u04E3",currency_code:"\u0440\u0430\u043C\u0437\u0438 \u0430\u0441\u044A\u043E\u0440",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0443\u0440\u0443\u0434"},i={nan:"NaN",number:"\u0440\u0430\u049B\u0430\u043C",string:"\u0441\u0430\u0442\u0440",array:"\u043C\u0430\u0441\u0441\u0438\u0432",object:"\u043E\u0431\u044A\u0435\u043A\u0442",date:"\u0441\u0430\u043D\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${o} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442, ${a} \u0433\u0438\u0440\u0438\u0444\u0442\u0430 \u0448\u0443\u0434`}case"invalid_value":return r.values.length===1?`\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: ${V(r.values[0])} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:`\u0418\u043D\u0442\u0438\u0445\u043E\u0431\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u044F\u043A\u0435 \u0430\u0437 ${N(r.values,"|")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u043A\u0430\u043B\u043E\u043D: ${r.origin??"\u049B\u0438\u043C\u0430\u0442"} \u0431\u043E\u044F\u0434 ${o}${r.maximum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`\u0425\u0435\u043B\u0435 \u0445\u0443\u0440\u0434: ${r.origin} \u0431\u043E\u044F\u0434 ${o}${r.minimum.toString()} \u0431\u043E\u0448\u0430\u0434`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.prefix}" \u043E\u0493\u043E\u0437 \u0448\u0430\u0432\u0430\u0434`:o.format==="ends_with"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u043E "${o.suffix}" \u0430\u043D\u04B7\u043E\u043C \u0451\u0431\u0430\u0434`:o.format==="includes"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 "${o.includes}"-\u0440\u043E \u0434\u0430\u0440 \u0431\u0430\u0440 \u0433\u0438\u0440\u0430\u0434`:o.format==="regex"?`\u0421\u0430\u0442\u0440\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 \u043D\u0430\u043C\u0443\u043D\u0430\u0438 ${o.pattern} \u043C\u0443\u0432\u043E\u0444\u0438\u049B\u0430\u0442 \u043A\u0443\u043D\u0430\u0434`:`${n[o.format]??r.format}-\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442`}case"not_multiple_of":return`\u0420\u0430\u049B\u0430\u043C\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442: \u0431\u043E\u044F\u0434 \u0431\u0430 ${r.divisor} \u0431\u0435 \u0431\u0430\u049B\u0438\u044F \u0442\u0430\u049B\u0441\u0438\u043C \u0448\u0430\u0432\u0430\u0434`;case"unrecognized_keys":return`\u041A\u0430\u043B\u0438\u0434${r.keys.length>1?"\u04B3\u043E\u0438":"\u0438"} \u043D\u043E\u043C\u0430\u044A\u043B\u0443\u043C: ${N(r.keys,", ")}`;case"invalid_key":return`\u041A\u0430\u043B\u0438\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442\u0438 \u0434\u0438\u0441\u043A\u0440\u0438\u043C\u0438\u043D\u0430\u0442\u043E\u0440: ${r.options.map(s=>`'${s}'`).join(" | ")} \u0438\u043D\u0442\u0438\u0437\u043E\u0440 \u043C\u0435\u0440\u0430\u0444\u0442`:"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442";case"invalid_element":return`\u049A\u0438\u043C\u0430\u0442\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442 \u0434\u0430\u0440 ${r.origin}`;default:return"\u0412\u0443\u0440\u0443\u0434\u0438 \u043D\u043E\u0434\u0443\u0440\u0443\u0441\u0442"}}};function _B(){return{localeError:Xde()}}var epe=()=>{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"},map:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n={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",mac:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 MAC",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)",credit_card:"\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15",currency_code:"\u0E23\u0E2B\u0E31\u0E2A\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19",iban:"IBAN",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.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 ${r.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: ${N(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.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 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function $B(){return{localeError:epe()}}var tpe=()=>{let e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"ba\xFDt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(r){return e[r]??null}let n={regex:"giri\u015F",email:"e-po\xE7ta salgysy",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 sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen \u015Fifrlenen setir",base64url:"base64url bilen \u015Fifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartyny\u0148 nomeri",currency_code:"wal\xFDuta kody",iban:"IBAN",jwt:"JWT",template_literal:"\u015Fablon"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return`N\xE4dogry baha: gara\u015Fylan ${o} \xFDerine ${a} alyndy`}case"invalid_value":return r.values.length===1?`N\xE4dogry baha: ${V(r.values[0])} bolmaly`:`N\xE4dogry sa\xFDlaw: a\u015Fakdakylardan biri bolmaly: ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()} ${s.unit??"element"}`:`Has uly: gara\u015Fyl\xFDan ${r.origin??"baha"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`Has ki\xE7i: gara\u015Fyl\xFDan ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`N\xE4dogry setir: "${o.prefix}" bilen ba\u015Flamaly`:o.format==="ends_with"?`N\xE4dogry setir: "${o.suffix}" bilen gutarmaly`:o.format==="includes"?`N\xE4dogry setir: "${o.includes}" saklamaly`:o.format==="regex"?`N\xE4dogry setir: ${o.pattern} nusga la\xFDyk bolmaly`:`N\xE4dogry ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xE4dogry san: ${r.divisor} bilen galyndysyz b\xF6l\xFCnmeli`;case"unrecognized_keys":return`Tanalma\xFDan a\xE7ar${r.keys.length>1?"lar":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde n\xE4dogry a\xE7ar`;case"invalid_union":return"N\xE4dogry baha";case"invalid_element":return`${r.origin} i\xE7inde n\xE4dogry baha`;default:return"N\xE4dogry baha"}}};function SB(){return{localeError:tpe()}}var npe=()=>{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"},map:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let n={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",mac:"MAC 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",credit_card:"kredi kart\u0131 numaras\u0131",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function xB(){return{localeError:npe()}}var rpe=()=>{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"},map:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n={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",mac:"\u0430\u0434\u0440\u0435\u0441\u0430 MAC",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",credit_card:"\u043D\u043E\u043C\u0435\u0440 \u043A\u0440\u0435\u0434\u0438\u0442\u043D\u043E\u0457 \u043A\u0430\u0440\u0442\u043A\u0438",currency_code:"\u043A\u043E\u0434 \u0432\u0430\u043B\u044E\u0442\u0438",iban:"IBAN",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\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 ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\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 ${V(r.values[0])}`:`\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 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\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 "${o.prefix}"`:o.format==="ends_with"?`\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 "${o.suffix}"`:o.format==="includes"?`\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 "${o.includes}"`:o.format==="regex"?`\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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${N(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function rw(){return{localeError:rpe()}}function EB(){return rw()}var ipe=()=>{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"},map:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n={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",mac:"\u0627\u06CC\u0645 \u0627\u06D2 \u0633\u06CC \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",credit_card:"\u06A9\u0631\u06CC\u0688\u0679 \u06A9\u0627\u0631\u0688 \u0646\u0645\u0628\u0631",currency_code:"\u06A9\u0631\u0646\u0633\u06CC \u06A9\u0648\u0688",iban:"IBAN",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${N(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.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${r.keys.length>1?"\u0632":""}: ${N(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function TB(){return{localeError:ipe()}}var ope=()=>{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(r){return e[r]??null}let n={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",credit_card:"kredit karta raqami",currency_code:"valyuta kodi",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${V(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function IB(){return{localeError:ope()}}var spe=()=>{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"},map:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n={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",mac:"\u0111\u1ECBa ch\u1EC9 MAC",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",credit_card:"s\u1ED1 th\u1EBB t\xEDn d\u1EE5ng",currency_code:"m\xE3 ti\u1EC1n t\u1EC7",iban:"IBAN",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${N(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.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 ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function AB(){return{localeError:spe()}}var ape=()=>{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"},map:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n={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",mac:"MAC\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",credit_card:"\u4FE1\u7528\u5361\u53F7",currency_code:"\u8D27\u5E01\u4EE3\u7801",iban:"IBAN",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${N(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function RB(){return{localeError:ape()}}var cpe=()=>{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"},map:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n={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",mac:"MAC \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",credit_card:"\u4FE1\u7528\u5361\u865F",currency_code:"\u8CA8\u5E63\u4EE3\u78BC",iban:"IBAN",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${N(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function CB(){return{localeError:cpe()}}var lpe=()=>{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"},map:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n={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",mac:"\xE0d\xEDr\u1EB9\u0301s\xEC MAC",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",credit_card:"n\u1ECDmba kaadi gbese",currency_code:"koodu ow\xF3",iban:"IBAN",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=K(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${N(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${N(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.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 ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function NB(){return{localeError:lpe()}}var PB,P0=Symbol("ZodOutput"),D0=Symbol("ZodInput"),iw=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ow(){return new iw}(PB=globalThis).__zod_globalRegistry??(PB.__zod_globalRegistry=ow());var Pn=globalThis.__zod_globalRegistry;var rr=Symbol.for("zod.compile.invalid"),DB=Symbol.for("zod.compile.fallback"),Ui=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},Ve=class extends Error{constructor(t,n=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=n}};function dpe(e,t){try{return aw(e,{assertOnly:!0})}catch{return t}}function F0(e,t){try{let n=aw(e),i=sw(e,n);return i._zod.bag.validator=dpe(e,n),i}catch(n){if(t?.strict)throw n;return e}}function sw(e,t){if(Xv(e))throw new Ve("a schema whose subtree contains a reference cycle");let n=ct(e),i=e._zod.run,r=i.__originalRun??i,o=(s,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[DB]||a&&ew(a,s.value))return r(s,a);let c=t(s.value);return c!==rr?(s.value=c,s):(a&&(a[DB]=!0),r(s,a))};return o.__originalRun=r,n._zod.bag.fallbackRun=r,n._zod.bag.validator=t,n._zod.run=o,i.__originalRun||ppe(n,e,t),n}function ppe(e,t,n){let i=e,r=t;if(typeof r.safeParse=="function"){let o=r.safeParse;i.safeParse=(s,a)=>{let c=n(s);return c!==rr?{success:!0,data:c}:o(s,a)}}if(typeof r.parse=="function"){let o=r.parse;i.parse=(s,a)=>{let c=n(s);return c!==rr?c:o(s,a)}}}function aw(e,t){let n=!0;try{n=Xv(e)}catch{}if(n)throw new Ve("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},r=new wc(["input"]),o=Rt(r,i,e,"input",!t?.assertOnly);r.write(o===null?"return true;":`return ${o};`);let s=["INVALID",...i.constants.keys()],a=[rr,...i.constants.values()],c=r.content.join(` `),l=t?.debug?s.length>0?`// Constants: ${s.join(", ")} ${c}`:c:"",u=Function,d=`return (input) => { ${c} -}`,p;try{p=new u(...s,d)(...a)}catch(f){throw new Ve(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(p.code=l),p.definite=i.definite,p}function Ie(e,t){for(let[i,r]of e.constants)if(r===t)return i;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function Sc(e,t){return e.definite=!1,Ie(e,t)}function we(e){return`v${e.varCounter++}`}function spe(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return sr;let i=n;return i.issues.length===0?i.value:sr}function Bn(e,t,n,i,r=!0){let o=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Rt(e,t,n,i,r)}catch(l){if(!(l instanceof Ve)||!l.islandable)throw l;if(e.content.length=o,t.constants.size>s){let u=Array.from(t.constants.keys()).slice(s);for(let d of u)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=c,ape(e,t,n,i)}}function ape(e,t,n,i){t.definite=!1;let r=Ie(t,n),o=Ie(t,spe),s=we(t);return e.write(`const ${s} = ${o}(${r}, ${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var cpe=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function lpe(e,t,n,i){let r=n._zod.def.checks;if(!r||r.length===0)return i;let o=i;for(let s of r){let a=s._zod.def;if(a.when&&!cpe.has(a.check))throw new Ve('check with a custom "when" condition');switch(a.check){case"greater_than":upe(e,t,a,o);break;case"less_than":dpe(e,t,a,o);break;case"multiple_of":ppe(e,t,a,o);break;case"number_format":DB(e,a,o);break;case"min_length":{let c=$c(a.minimum,"min_length"),l=xA(e,t,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=$c(a.maximum,"max_length"),l=xA(e,t,o,`${o}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=$c(a.length,"length_equals"),l=xA(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${$c(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${$c(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${$c(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=MB(e,t,a,o);break;case"custom":o=ype(e,t,s,o);break;case"bigint_format":fpe(e,a,o);break;case"mime_type":mpe(e,t,a,o);break;case"property":gpe(e,t,a,o);break;case"properties":OB(e,t,a,o,!1);break;case"overwrite":{let c=we(t);hpe(e,t,s,o,c),o=c;break}default:throw new Ve(`check type ${a.check}`)}}return o}function xA(e,t,n,i){let r=Ie(t,bc),o=we(t);return e.write(`const ${o} = typeof ${n} === "string" && ${i} ? ${r}(${n}) : ${n}.length;`),o}function $c(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Ve(`${t} bound of type ${typeof e}`);return`${e}`}function PB(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Ve("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Ve("comparison check with Invalid Date bound");return Ie(e,t)}throw new Ve(`comparison check bound of type ${typeof t}`)}function upe(e,t,n,i){let r=n.inclusive?"<":"<=";e.write(`if (${i} ${r} ${PB(t,n.value)}) return INVALID;`)}function dpe(e,t,n,i){let r=n.inclusive?">":">=";e.write(`if (${i} ${r} ${PB(t,n.value)}) return INVALID;`)}function ppe(e,t,n,i){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Ve("multiple_of check with a zero divisor");e.write(`if (${i} % ${n.value}n !== 0n) return INVALID;`)}else{let r=Ie(t,xm);e.write(`if (${r}(${i}, ${$c(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function DB(e,t,n){let i=t.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Ve(`number format ${i}`)}}function fpe(e,t,n){let i=t.format;if(i)switch(i){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Ve(`bigint format ${i}`)}}function mpe(e,t,n,i){let r=n.mime;if(r&&r.length>0){let o=Ie(t,new Set(r));e.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function OB(e,t,n,i,r){if(n.when)throw new Ve('check with a custom "when" condition');e.write(r?`if (${i} === null || (typeof ${i} !== "object" && typeof ${i} !== "function")) return INVALID;`:`if (${i} == null) return INVALID;`);let o=n.shape;for(let s of Reflect.ownKeys(o)){let a=typeof s=="symbol"?Ie(t,s):nr(s),c=we(t);e.write(`const ${c} = ${i}[${a}];`),Bn(e,t,o[s],c,!1)}}function gpe(e,t,n,i){let r=`${i}[${JSON.stringify(n.property)}]`;Rt(e,t,n.schema,r)}function hpe(e,t,n,i,r){let o=n._zod.def.tx;if(!o)throw new Ve("overwrite check without a transform function");if(xc(o))throw new Ui("z.compile: async overwrite transforms are not supported");let s=Ie(t,o);e.write(`const ${r} = ${s}(${i});`)}function EA(){throw new Tr}function AA(e){this.issues.push(e)}function ype(e,t,n,i){let r=n._zod.def;if(r.fn){if(xc(r.fn))throw new Ui("z.compile: async .refine() predicates are not supported");let o=Sc(t,r.fn),s=Ie(t,EA),a=we(t);return e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),i}if(n._zod.check){if(xc(n._zod.check))throw new Ui("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,a=Sc(t,l=>{let u={value:l,issues:[],addIssue:AA};return o(u)instanceof Promise&&EA(),u.issues.length===0?u.value:sr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new Ve("custom check without a predicate or check function")}var bpe=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function MB(e,t,n,i){let r=n.format;if(r==="base64"){let c=Ie(t,jm);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="base64url"){let c=Ie(t,Dv);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="jwt"){let c=Ie(t,Lv),l=Ie(t,n.alg??null);return e.write(`if (!${c}(${i}, ${l})) return INVALID;`),i}if(r==="ipv6"){let c=Ie(t,Um);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="cidrv6"){let c=Ie(t,Cv);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="credit_card"){let c=Ie(t,Ov);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(r==="iban"){let c=Ie(t,Mv);return e.write(`if (!${c}(${i})) return INVALID;`),i}let o=n;if(r==="url"||r==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let c=Ie(t,Iv),l=Ie(t,n),u=we(t),d=we(t);if(e.write(`const ${u} = ${i}.trim();`),e.write(`const ${d} = ${c}(${u}, ${l});`),e.write(`if (typeof ${d} === "number") return INVALID;`),o.hostname!==void 0){let m=Ie(t,Rv);e.write(`if (!${m}(${d}, ${l}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=Ie(t,Nv);e.write(`if (!${m}(${d}, ${l}.protocol)) return INVALID;`)}let p=we(t),f=o.normalize?`${d}.href`:`${Ie(t,Av)}(${u})`;return e.write(`const ${p} = ${f};`),p}let s=n.fn;if(s){if(xc(s))throw new Ve(`async string format ${r}`);let c=Ie(t,s);return e.write(`if (!${c}(${i})) return INVALID;`),i}if(bpe.has(r)&&n.pattern){let c=Ie(t,n.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${i})) return INVALID;`),i}let a=n.format;switch(a){case"regex":throw new Ve("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${nr(n.includes)})) return INVALID;`);break;case"starts_with":{let c=n.prefix;e.write(`if (${i}.slice(0, ${c.length}) !== ${nr(c)}) return INVALID;`);break}case"ends_with":{let c=n.suffix;e.write(`if (${i}.slice(-${c.length}) !== ${nr(c)}) return INVALID;`);break}default:throw new Ve(`string format ${a}`)}return i}function Rt(e,t,n,i,r=!0){let o=n._zod.def,s=o.type;if(o.coerce)throw new Ve(`coercion (z.coerce.${s}())`);let a=r||!!o.checks?.length,c;switch(s){case"string":c=vpe(e,t,n,i);break;case"number":c=wpe(e,n,i);break;case"boolean":c=kpe(e,i);break;case"bigint":c=$pe(e,n,i);break;case"symbol":c=_pe(e,i);break;case"undefined":c=Spe(e,i);break;case"null":c=xpe(e,i);break;case"any":case"unknown":c=i;break;case"never":e.write("return INVALID;"),c=i;break;case"void":c=Epe(e,i);break;case"nan":c=Tpe(e,i);break;case"date":c=Ipe(e,i);break;case"object":c=Ape(e,t,n,i,a);break;case"optional":c=Rpe(e,t,n,i,a);break;case"nullable":c=Ppe(e,t,n,i,a);break;case"array":c=Dpe(e,t,n,i,a);break;case"literal":c=Ope(e,t,n,i);break;case"enum":c=Mpe(e,t,n,i);break;case"readonly":{let l=RB(e,t,n,i),u=we(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":RB(e,t,n,i),c="true";break;case"default":case"prefault":c=Lpe(e,t,n,i);break;case"nonoptional":c=Fpe(e,t,n,i);break;case"tuple":c=Upe(e,t,n,i);break;case"union":c=jpe(e,t,n,i);break;case"intersection":c=Vpe(e,t,n,i);break;case"record":c=Bpe(e,t,n,i);break;case"map":c=Wpe(e,t,n,i);break;case"set":c=Hpe(e,t,n,i);break;case"file":c=Kpe(e,i);break;case"template_literal":c=Jpe(e,t,n,i);break;case"lazy":c=Zpe(e,t,n,i);break;case"pipe":c=Ype(e,t,n,i);break;case"custom":c=Qpe(e,t,n,i);break;case"properties":OB(e,t,n._zod.def,i,!0),c=i;break;case"transform":c=tfe(e,t,n,i);break;case"catch":c=efe(e,t,n,i);break;default:throw new Ve(`schema type ${s}`)}return c===null?null:lpe(e,t,n,c)}function vpe(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.def;return r.format===void 0?i:MB(e,t,r,i)}function wpe(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let i=t._zod.def;return i.check==="number_format"&&i.format&&DB(e,{format:i.format},n),n}function kpe(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function $pe(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let i=t._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function _pe(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Spe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function xpe(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Epe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Tpe(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Ipe(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function Ape(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let s=o.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,u=y=>typeof y=="symbol"?Ie(t,y):nr(y),d=y=>typeof y=="symbol"?`[${u(y)}]`:nr(y),p=s;if(a.includes("__proto__"))throw new Ve('object shape key "__proto__"');let f=new Map;for(let y of l){let w=p[y],k=u(y),_=we(t);if(e.write(`const ${_} = ${i}[${k}];`),w._zod.optin!==void 0){let S=we(t);e.write(`let ${S} = (() => {`),e.indented(x=>{let E=Bn(x,t,w,_);x.write(`return ${E};`)}),e.write("})();"),w._zod.optout==="optional"?(e.write(`if (${S} === INVALID) {`),e.indented(x=>{x.write(`if (${k} in ${i}) return INVALID;`),x.write(`${S} = undefined;`)}),e.write("}")):e.write(`if (${S} === INVALID) return INVALID;`),f.set(y,S)}else{Cpe(w)&&e.write(`if (!(${k} in ${i})) return INVALID;`);let S=Bn(e,t,w,_,r);S!==null&&f.set(y,S)}}let m=o.catchall,g="none";if(m){let y=m._zod.def.type;if(y==="never"){let w=a.map(k=>`k !== ${nr(k)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(k=>{k.write(`if (${w}) return INVALID;`)}),e.write("}")}else(y==="unknown"||y==="any")&&!m._zod.def.checks?.length?g="passthrough":g="schema"}let h=we(t),b=l.some(y=>AB(p[y])||TA(p[y]));if(!r){if(g==="schema"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`);let k=we(t);w.write(`const ${k} = ${i}[k];`),Bn(w,t,m,k,!1)}),e.write("}")}return null}if(b){e.write(`const ${h} = {};`);for(let y of l){let w=u(y),k=f.get(y);TA(p[y])?e.write(`if (${w} in ${i}) ${h}[${w}] = ${k};`):AB(p[y])?e.write(`if (${k} !== undefined || ${w} in ${i}) ${h}[${w}] = ${k};`):e.write(`${h}[${w}] = ${k};`)}}else{let y=l.map(w=>`${d(w)}: ${f.get(w)}`).join(", ");e.write(`const ${h} = { ${y} };`)}if(g!=="none"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{if(w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`),g==="passthrough")w.write(`${h}[k] = ${i}[k];`);else{let k=we(t);w.write(`const ${k} = ${i}[k];`);let _=Bn(w,t,m,k);w.write(`${h}[k] = ${_};`)}}),e.write("}")}return h}function Rpe(e,t,n,i,r=!0){let o=n._zod.def;if(Npe(n))return Rt(e,t,o.innerType,i,r);if(o.innerType._zod.optin==="defaulted"){let a=we(t),c=we(t);return e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=Rt(u,t,o.innerType,i);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=Rt(l,t,o.innerType,i);l.write(`${a} = ${u};`)}),e.write("}"),a}let s=r?we(t):null;return s&&e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Npe(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function Cpe(e){return e._zod.optin===void 0&&_c(e)}function _c(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?_c(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?_c(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(_c):!0;case"intersection":return!t.left||!t.right?!0:_c(t.left)&&_c(t.right);case"pipe":return t.in?_c(t.in):!0;default:return!0}}function TA(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function AB(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&ju(e)}function ju(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?ju(t.innerType):!0;case"union":return t.options?t.options.some(ju):!0;case"intersection":return!t.left||!t.right||ju(t.left)||ju(t.right);case"pipe":return t.out?ju(t.out):!0;default:return!0}}function Ppe(e,t,n,i,r=!0){let o=n._zod.def,s=r?we(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${i} !== null) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Dpe(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`);let s=r?we(t):null,a=we(t),c=we(t);return s&&e.write(`const ${s} = new Array(${i}.length);`),e.write(`for (let ${a} = 0; ${a} < ${i}.length; ${a}++) {`),e.indented(l=>{l.write(`const ${c} = ${i}[${a}];`);let u=Bn(l,t,o.element,c,r);s&&u!==null&&l.write(`${s}[${a}] = ${u};`)}),e.write("}"),s}function Ope(e,t,n,i){let o=n._zod.def.values;if(o.length!==1){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}if(typeof s=="string")e.write(`if (${i} !== ${nr(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${i} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${i} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${i} !== ${s}n) return INVALID;`);else throw new Ve(`literal type ${typeof s}`);return i}function Mpe(e,t,n,i){let r=n._zod.values;if(!r)throw new Ve("enum schema without enumerated values");let o=Ie(t,r);return e.write(`if (!${o}.has(${i})) return INVALID;`),i}function RB(e,t,n,i){let r=n._zod.def;return Rt(e,t,r.innerType,i)}function Lpe(e,t,n,i){let r=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Rt(e,t,r.innerType,i);let c=Ie(t,s),l=we(t);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${c}();`),Rt(e,t,r.innerType,l)}let a=we(t);if(s){let c=Ie(t,s),l=Ie(t,Em);e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(u=>{u.write(`${a} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let d=Rt(u,t,r.innerType,i);u.write(`${a} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let l=Rt(c,t,r.innerType,i);c.write(`${a} = ${l};`)}),e.write("}");return a}function Fpe(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.innerType,i),s=we(t);return e.write(`const ${s} = ${o};`),e.write(`if (${s} === undefined) return INVALID;`),s}function Upe(e,t,n,i){let r=n._zod.def,o=r.items,s=r.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let a=NB(o,"optin"),c=NB(o,"optout");s?e.write(`if (${i}.length < ${a}) return INVALID;`):e.write(`if (${i}.length < ${a} || ${i}.length > ${o.length}) return INVALID;`);let l=we(t);e.write(`const ${l} = [];`);for(let u=0;u=c)e.write(`if (${l}.length === ${u}) {`),e.indented(p=>{p.write(`if (${u} < ${i}.length) {`),p.indented(f=>{let m=we(t);f.write(`const ${m} = ${i}[${u}];`);let g=Bn(f,t,d,m);f.write(`${l}[${u}] = ${g};`)}),p.write("} else {"),p.indented(f=>{if(TA(d)){f.write(`${l}.length = ${u};`);return}let m=we(t),g=we(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(h=>{let b=Bn(h,t,d,m);h.write(`return ${b};`)}),f.write("})();"),f.write(`if (${g} === INVALID || ${g} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${g};`)}),p.write("}")}),e.write("}");else{let p=we(t);e.write(`const ${p} = ${i}[${u}];`);let f=Bn(e,t,d,p);e.write(`${l}[${u}] = ${f};`)}}if(s){let u=we(t),d=we(t);e.write(`for (let ${u} = ${o.length}; ${u} < ${i}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${d} = ${i}[${u}];`);let f=Bn(p,t,s,d);p.write(`${l}[${u}] = ${f};`)}),e.write("}")}return l}function NB(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function jpe(e,t,n,i){let r=n._zod.def,o=r.options;if(r.discriminator)return zpe(e,t,r,i);if(r.inclusive===!1)throw new Ve("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),i;if(o.length===1)return Rt(e,t,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=Ie(t,c);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let a=we(t);e.write(`let ${a};`);for(let c=0;c {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(u=>{let d=Rt(u,t,l,i);u.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function zpe(e,t,n,i){if(n.unionFallback)throw new Ve("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),i;let r=we(t),o=we(t);e.write(`const ${r} = ${i}?.[${nr(n.discriminator)}];`),e.write(`let ${o};`);let s=!0,a=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Ve("discriminated union option without static discriminator values");for(let p of l){if(a.has(p))throw new Ve(`duplicate discriminator value ${String(p)}`);a.add(p)}let u=Array.from(l,p=>Gpe(t,r,p)),d=s?"if":"else if";e.write(`${d} (${u.join(" || ")}) {`),e.indented(p=>{let f=Rt(p,t,c,i);p.write(`${o} = ${f};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),o}function Gpe(e,t,n){if(typeof n=="string")return`${t} === ${nr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let i=Ie(e,n);return`${t} === ${i}`}throw new Ve(`literal discriminator value ${String(n)}`)}function Vpe(e,t,n,i){let r=n._zod.def;t.definite=!1;let o=Bn(e,t,r.left,i),s=Bn(e,t,r.right,i),a=Ie(t,Lu),c=we(t);return e.write(`const ${c} = ${a}(${o}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Bpe(e,t,n,i){let r=n._zod.def,o=Ie(t,ci);e.write(`if (!${o}(${i})) return INVALID;`);let s=we(t),a=we(t),c=we(t);e.write(`const ${s} = {};`);let l=r,u=l.partial?void 0:r.keyType._zod.values;if(u){let f=[];for(let g of u){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new Ve(`record key value ${String(g)}`);let h=typeof g=="number"?g.toString():g;if(h==="__proto__")throw new Ve('record key "__proto__"');f.push(h);let b=Ie(t,g),y=Rt(e,t,r.keyType,b),w=we(t);e.write(`const ${w} = ${i}[${qpe(t,h)}];`);let k=Bn(e,t,r.valueType,w);e.write(`${s}[${y}] = ${k};`)}let m=Ie(t,new Set(f));return e.write(`for (const ${a} in ${i}) {`),e.indented(g=>{g.write(`if (${m}.has(${a})) continue;`),l.mode==="loose"?g.write(`if (${a} !== "__proto__") ${s}[${a}] = ${i}[${a}];`):g.write("return INVALID;")}),e.write("}"),s}let d=r.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=r.mode==="loose",m=tw(r.keyType);m.definite===!1&&(t.definite=!1);let g=Ie(t,m),h=Ie(t,Ko),b=we(t);return CB(e,t,i,a,y=>{y.write(`let ${b} = ${g}(${a});`),y.write(`if (${b} === INVALID && typeof ${a} === "string" && ${h}.test(${a})) ${b} = ${g}(Number(${a}));`),f?y.write(`if (${b} === INVALID) { ${s}[${a}] = ${i}[${a}]; continue; }`):y.write(`if (${b} === INVALID) return INVALID;`),y.write(`if (${b} === "__proto__") continue;`);let w=we(t);y.write(`const ${w} = ${i}[${a}];`);let k=Bn(y,t,r.valueType,w);y.write(`${s}[${b}] = ${k};`)}),s}return CB(e,t,i,a,f=>{f.write(`const ${c} = ${i}[${a}];`);let m=Bn(f,t,r.valueType,c);f.write(`${s}[${a}] = ${m};`)},"return INVALID;"),s}function CB(e,t,n,i,r,o){let s=Ie(t,Object.prototype.propertyIsEnumerable),a=we(t),c=we(t),l=we(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${c}[${l}];`),u.write(`if (${i} === "__proto__" || !${s}.call(${n}, ${i})) continue;`),r(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${a}[${l}];`),u.write(`if (!${s}.call(${n}, ${i})) continue;`),o?u.write(o):r(u)}),e.write("}")}function qpe(e,t){return typeof t=="string"?nr(t):Ie(e,t)}function Wpe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`);let o=we(t),s=we(t),a=we(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${s}, ${a}] of ${i}) {`),e.indented(c=>{let l=Rt(c,t,r.keyType,s),u=Rt(c,t,r.valueType,a);c.write(`${o}.set(${l}, ${u});`)}),e.write("}"),o}function Hpe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`);let o=we(t),s=we(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${s} of ${i}) {`),e.indented(a=>{let c=Rt(a,t,r.valueType,s);a.write(`${o}.add(${c});`)}),e.write("}"),o}function Kpe(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Jpe(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.pattern;if(r){let o=Ie(t,r);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function Zpe(e,t,n,i){let r=n._zod.def,o=Sc(t,r.getter),s=Ie(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=we(t);return e.write(`const ${a} = ${s}.parser(${i});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function Ype(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.in,i);if(r.transform){if(xc(r.transform))throw new Ui("z.compile: async transforms in pipes are not supported");let s=r.transform,c=Sc(t,u=>{let d={value:u,issues:[],addIssue:AA},p=s(u,d);return p instanceof Promise?sr:d.issues.length===0?p:sr}),l=we(t);return e.write(`const ${l} = ${c}(${o});`),e.write(`if (${l} === INVALID) return INVALID;`),Rt(e,t,r.out,l)}else return Rt(e,t,r.out,o)}function xc(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Qpe(e,t,n,i){let r=n._zod.def;if(r.fn){if(xc(r.fn))throw new Ui("z.compile: async custom predicates are not supported");let o=Sc(t,r.fn),s=Ie(t,EA),a=we(t);e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new Ve("custom schema without a predicate function");return i}function Xpe(e,t,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return sr;let r=i;return r.issues.length===0?r.value:t()}function efe(e,t,n,i){let r=n._zod.def;if(!r.catchValue[sv])throw new Ve("catch with a callback (only a constant catch value compiles)",!1);let o=we(t);e.write(`let ${o} = (() => {`),e.indented(l=>{let u=Bn(l,t,r.innerType,i);l.write(`return ${u};`)}),e.write("})();");let s=Ie(t,r.innerType),a=Sc(t,r.catchValue),c=Ie(t,Xpe);return e.write(`if (${o} === INVALID) {`),e.indented(l=>{l.write(`${o} = ${c}(${s}, ${a}, ${i});`),l.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function tfe(e,t,n,i){let r=n._zod.def;if(r.transform){if(xc(r.transform))throw new Ui("z.compile: async transforms are not supported");let o=r.transform,a=Sc(t,l=>{let u={value:l,issues:[],addIssue:AA},d=o(l,u);return d instanceof Promise?sr:u.issues.length===0?d:sr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return i}function RA(e,t){return new e({type:"string",...Q(t)})}function NA(e,t){return new e({type:"string",coerce:!0,...Q(t)})}function nw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Q(t)})}function rw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Q(t)})}function iw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Q(t)})}function ow(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Q(t)})}function sw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Q(t)})}function aw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Q(t)})}function Ym(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Q(t)})}function cw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Q(t)})}function lw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Q(t)})}function uw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Q(t)})}function dw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Q(t)})}function pw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Q(t)})}function fw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Q(t)})}function mw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Q(t)})}function gw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Q(t)})}function hw(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Q(t)})}function CA(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Q(t)})}function yw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Q(t)})}function bw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Q(t)})}function vw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Q(t)})}function ww(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Q(t)})}function kw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Q(t)})}function PA(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...Q(t)})}function DA(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...Q(t)})}function $w(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Q(t)})}var OA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Qm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Q(t)})}function Xm(e,t){return new e({type:"string",format:"date",check:"string_format",...Q(t)})}function eg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Q(t)})}function tg(e,t){return new e({type:"string",format:"duration",check:"string_format",...Q(t)})}function MA(e,t){return new e({type:"number",checks:[],...Q(t)})}function LA(e,t){return new e({type:"number",coerce:!0,checks:[],...Q(t)})}function FA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Q(t)})}function UA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Q(t)})}function jA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Q(t)})}function zA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Q(t)})}function GA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Q(t)})}function VA(e,t){return new e({type:"boolean",...Q(t)})}function BA(e,t){return new e({type:"boolean",coerce:!0,...Q(t)})}function qA(e,t){return new e({type:"bigint",...Q(t)})}function WA(e,t){return new e({type:"bigint",coerce:!0,...Q(t)})}function HA(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Q(t)})}function KA(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Q(t)})}function JA(e,t){return new e({type:"symbol",...Q(t)})}function ZA(e,t){return new e({type:"undefined",...Q(t)})}function YA(e,t){return new e({type:"null",...Q(t)})}function QA(e){return new e({type:"any"})}function XA(e){return new e({type:"unknown"})}function eR(e,t){return new e({type:"never",...Q(t)})}function tR(e,t){return new e({type:"void",...Q(t)})}function nR(e,t){return new e({type:"date",...Q(t)})}function rR(e,t){return new e({type:"date",coerce:!0,...Q(t)})}function iR(e,t){return new e({type:"nan",...Q(t)})}function po(e,t){return new kv({check:"less_than",...Q(t),value:e,inclusive:!1})}function Gr(e,t){return new kv({check:"less_than",...Q(t),value:e,inclusive:!0})}function fo(e,t){return new $v({check:"greater_than",...Q(t),value:e,inclusive:!1})}function Vr(e,t){return new $v({check:"greater_than",...Q(t),value:e,inclusive:!0})}function _w(e){return fo(0,e)}function Sw(e){return po(0,e)}function xw(e){return Gr(0,e)}function Ew(e){return Vr(0,e)}function zs(e,t){return new GI({check:"multiple_of",...Q(t),value:e})}function Gs(e,t){return new qI({check:"max_size",...Q(t),maximum:e})}function mo(e,t){return new WI({check:"min_size",...Q(t),minimum:e})}function Ec(e,t){return new HI({check:"size_equals",...Q(t),size:e})}function Tc(e,t){return new KI({check:"max_length",...Q(t),maximum:e})}function Jo(e,t){return new JI({check:"min_length",...Q(t),minimum:e})}function Ic(e,t){return new ZI({check:"length_equals",...Q(t),length:e})}function zu(e,t){return new YI({check:"string_format",format:"regex",...Q(t),pattern:e})}function Gu(e){return new QI({check:"string_format",format:"lowercase",...Q(e)})}function Vu(e){return new XI({check:"string_format",format:"uppercase",...Q(e)})}function Bu(e,t){return new e0({check:"string_format",format:"includes",...Q(t),includes:e})}function qu(e,t){return new t0({check:"string_format",format:"starts_with",...Q(t),prefix:e})}function Wu(e,t){return new n0({check:"string_format",format:"ends_with",...Q(t),suffix:e})}function Tw(e,t,n){return new r0({check:"property",property:e,schema:t,...Q(n)})}function oR(e,t,n){return new e({type:"properties",check:"properties",shape:t,...Q(n)})}function Hu(e,t){return new i0({check:"mime_type",mime:e,...Q(t)})}function ji(e){return new o0({check:"overwrite",tx:e})}function Ku(e){return ji(t=>t.normalize(e))}function Ju(){return ji(e=>e.trim())}function Zu(){return ji(e=>e.toLowerCase())}function Yu(){return ji(e=>e.toUpperCase())}function Qu(){return ji(e=>WT(e))}function sR(e,t,n){return new e({type:"array",element:t,...Q(n)})}function nfe(e,t,n){return new e({type:"union",options:t,...Q(n)})}function rfe(e,t,n){return new e({type:"union",options:t,inclusive:!1,...Q(n)})}function ife(e,t,n,i){return new e({type:"union",options:n,discriminator:t,...Q(i)})}function ofe(e,t,n){return new e({type:"intersection",left:t,right:n})}function sfe(e,t,n,i){let r=n instanceof Ce,o=r?i:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...Q(o)})}function afe(e,t,n,i){return new e({type:"record",keyType:t,valueType:n,...Q(i)})}function cfe(e,t,n,i){return new e({type:"map",keyType:t,valueType:n,...Q(i)})}function lfe(e,t,n){return new e({type:"set",valueType:t,...Q(n)})}function ufe(e,t,n){let i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:i,...Q(n)})}function dfe(e,t,n){return new e({type:"enum",entries:t,...Q(n)})}function pfe(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Q(n)})}function aR(e,t){return new e({type:"file",...Q(t)})}function ffe(e,t){return new e({type:"transform",transform:t})}function mfe(e,t){return new e({type:"optional",innerType:t})}function gfe(e,t){return new e({type:"nullable",innerType:t})}function hfe(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Em(n)}})}function yfe(e,t,n){return new e({type:"nonoptional",innerType:t,...Q(n)})}function bfe(e,t){return new e({type:"success",innerType:t})}function vfe(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:XT(n)})}function wfe(e,t,n){return new e({type:"pipe",in:t,out:n})}function kfe(e,t){return new e({type:"readonly",innerType:t})}function $fe(e,t,n){return new e({type:"template_literal",parts:t,...Q(n)})}function _fe(e,t){return new e({type:"lazy",getter:t})}function Sfe(e,t){return new e({type:"promise",innerType:t})}function cR(e,t,n){let i=Q(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function lR(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Q(n)})}function uR(e,t){let n=LB(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Nu(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Nu(o))}},e(i.value,i)),t);return n}function LB(e,t){let n=new ht({check:"custom",...Q(t)});return n._zod.check=e,n}function dR(e){let t=new ht({check:"describe"});return t._zod.onattach=[n=>{let i=Dn.get(n)??{};Dn.add(n,{...i,description:e})}],t._zod.check=()=>{},t}function pR(e){let t=new ht({check:"meta"});return t._zod.onattach=[n=>{let i=Dn.get(n)??{};Dn.add(n,{...i,...e})}],t._zod.check=()=>{},t}function fR(e,t){let n=Q(t),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),a=e.Codec??Bm,c=e.Boolean??Gm,l=e.String??kc,u=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let g=f;return n.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return p._zod.bag.truthy=i,p._zod.bag.falsy=r,p._zod.bag.case=n.case??"insensitive",p}function Xu(e,t,n,i={}){let r=Q(i),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(o.pattern=n),new e(o)}function ng(e,...t){for(let n of t)for(let i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Sn(e,i,n[i]);return e}function Vs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Dn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Zt(e,t,n,i,r){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:i.path,message:r}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}function st(e,t,n={path:[],schemaPath:[]}){var i;let r=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let p=s.schema,f=t.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(e,t,p,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),st(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&ng(s.schema,c),t.io==="input"&&xn(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function FB(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Bs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let r=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${FB(f)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+FB(u)}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=r(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ +}`,p;try{p=new u(...s,d)(...a)}catch(f){throw new Ve(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(p.code=l),p.definite=i.definite,p}function Ie(e,t){for(let[i,r]of e.constants)if(r===t)return i;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function $c(e,t){return e.definite=!1,Ie(e,t)}function we(e){return`v${e.varCounter++}`}function fpe(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return rr;let i=n;return i.issues.length===0?i.value:rr}function Vn(e,t,n,i,r=!0){let o=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return Rt(e,t,n,i,r)}catch(l){if(!(l instanceof Ve)||!l.islandable)throw l;if(e.content.length=o,t.constants.size>s){let u=Array.from(t.constants.keys()).slice(s);for(let d of u)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=c,mpe(e,t,n,i)}}function mpe(e,t,n,i){t.definite=!1;let r=Ie(t,n),o=Ie(t,fpe),s=we(t);return e.write(`const ${s} = ${o}(${r}, ${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var gpe=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function hpe(e,t,n,i){let r=n._zod.def.checks;if(!r||r.length===0)return i;let o=i;for(let s of r){let a=s._zod.def;if(a.when&&!gpe.has(a.check))throw new Ve('check with a custom "when" condition');switch(a.check){case"greater_than":ype(e,t,a,o);break;case"less_than":bpe(e,t,a,o);break;case"multiple_of":vpe(e,t,a,o);break;case"number_format":jB(e,a,o);break;case"min_length":{let c=zs(a.minimum,"min_length"),l=O0(e,t,o,`${o}.length >= ${c} && ${o}.length < ${a.minimum*2}`);e.write(`if (${l} < ${c}) return INVALID;`);break}case"max_length":{let c=zs(a.maximum,"max_length"),l=O0(e,t,o,`${o}.length > ${c}`);e.write(`if (${l} > ${c}) return INVALID;`);break}case"length_equals":{let c=zs(a.length,"length_equals"),l=O0(e,t,o,`${o}.length >= ${c} && ${o}.length <= ${a.length*2}`);e.write(`if (${l} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${zs(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${zs(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${zs(a.size,"size_equals")}) return INVALID;`);break;case"string_format":o=zB(e,t,a,o);break;case"custom":o=xpe(e,t,s,o);break;case"bigint_format":wpe(e,a,o);break;case"mime_type":kpe(e,t,a,o);break;case"property":$pe(e,t,a,o);break;case"properties":_pe(e,t,a,o);break;case"overwrite":{let c=we(t);Spe(e,t,s,o,c),o=c;break}default:throw new Ve(`check type ${a.check}`)}}return o}function O0(e,t,n,i){let r=Ie(t,bc),o=we(t);return e.write(`const ${o} = typeof ${n} === "string" && ${i} ? ${r}(${n}) : ${n}.length;`),o}function zs(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Ve(`${t} bound of type ${typeof e}`);return`${e}`}function UB(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Ve("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Ve("comparison check with Invalid Date bound");return Ie(e,t)}throw new Ve(`comparison check bound of type ${typeof t}`)}function ype(e,t,n,i){let r=n.inclusive?"<":"<=";e.write(`if (${i} ${r} ${UB(t,n.value)}) return INVALID;`)}function bpe(e,t,n,i){let r=n.inclusive?">":">=";e.write(`if (${i} ${r} ${UB(t,n.value)}) return INVALID;`)}function vpe(e,t,n,i){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Ve("multiple_of check with a zero divisor");e.write(`if (${i} % ${n.value}n !== 0n) return INVALID;`)}else{let r=Ie(t,Em);e.write(`if (${r}(${i}, ${zs(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function jB(e,t,n){let i=t.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Ve(`number format ${i}`)}}function wpe(e,t,n){let i=t.format;if(i)switch(i){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Ve(`bigint format ${i}`)}}function kpe(e,t,n,i){let r=n.mime;if(r&&r.length>0){let o=Ie(t,new Set(r));e.write(`if (!${o}.has(${i}.type)) return INVALID;`)}}function _pe(e,t,n,i){if(n.when)throw new Ve('check with a custom "when" condition');e.write(`if (${i} == null) return INVALID;`);let r=n.shape;for(let o of Reflect.ownKeys(r)){let s=typeof o=="symbol"?Ie(t,o):tr(o),a=we(t);e.write(`const ${a} = ${i}[${s}];`),Vn(e,t,r[o],a,!1)}}function $pe(e,t,n,i){let r=`${i}[${JSON.stringify(n.property)}]`;Rt(e,t,n.schema,r)}function Spe(e,t,n,i,r){let o=n._zod.def.tx;if(!o)throw new Ve("overwrite check without a transform function");if(Sc(o))throw new Ui("z.compile: async overwrite transforms are not supported");let s=Ie(t,o);e.write(`const ${r} = ${s}(${i});`)}function M0(){throw new Er}function U0(e){this.issues.push(e)}function xpe(e,t,n,i){let r=n._zod.def;if(r.fn){if(Sc(r.fn))throw new Ui("z.compile: async .refine() predicates are not supported");let o=$c(t,r.fn),s=Ie(t,M0),a=we(t);return e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),i}if(n._zod.check){if(Sc(n._zod.check))throw new Ui("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,a=$c(t,l=>{let u={value:l,issues:[],addIssue:U0};return o(u)instanceof Promise&&M0(),u.issues.length===0?u.value:rr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new Ve("custom check without a predicate or check function")}var Epe=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function zB(e,t,n,i,r=!0){let o=n.format;if(o==="base64"){let l=Ie(t,Wm);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="base64url"){let l=Ie(t,jv);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="jwt"){let l=Ie(t,Vv),u=Ie(t,n.alg??null);return e.write(`if (!${l}(${i}, ${u})) return INVALID;`),i}if(o==="ipv6"){let l=Ie(t,qm);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="cidrv6"){let l=Ie(t,Fv);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="credit_card"){let l=Ie(t,zv);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(o==="iban"){let l=Ie(t,Gv);return e.write(`if (!${l}(${i})) return INVALID;`),i}let s=n;if(o==="url"||o==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let l=Ie(t,Ov),u=Ie(t,n),d=we(t),p=we(t);if(e.write(`const ${d} = ${i}.trim();`),e.write(`const ${p} = ${l}(${d}, ${u});`),e.write(`if (typeof ${p} === "number") return INVALID;`),s.hostname!==void 0){let g=Ie(t,Mv);e.write(`if (!${g}(${p}, ${u}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let g=Ie(t,Lv);e.write(`if (!${g}(${p}, ${u}.protocol)) return INVALID;`)}if(!r)return null;let f=we(t),m=s.normalize?`${p}.href`:`${Ie(t,Bm)}(${d})`;return e.write(`const ${f} = ${m};`),f}let a=n.fn;if(a){if(Sc(a))throw new Ve(`async string format ${o}`);let l=Ie(t,a);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(Epe.has(o)&&n.pattern){let l=Ie(t,n.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${i})) return INVALID;`),i}let c=n.format;switch(c){case"regex":throw new Ve("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${tr(n.includes)})) return INVALID;`);break;case"starts_with":{let l=n.prefix;e.write(`if (${i}.slice(0, ${l.length}) !== ${tr(l)}) return INVALID;`);break}case"ends_with":{let l=n.suffix;e.write(`if (${i}.slice(-${l.length}) !== ${tr(l)}) return INVALID;`);break}default:throw new Ve(`string format ${c}`)}return i}function Rt(e,t,n,i,r=!0){let o=n._zod.def,s=o.type;if(o.coerce)throw new Ve(`coercion (z.coerce.${s}())`);let a=r||!!o.checks?.length,c;switch(s){case"string":c=Tpe(e,t,n,i,a);break;case"number":c=Ipe(e,n,i);break;case"boolean":c=Ape(e,i);break;case"bigint":c=Rpe(e,n,i);break;case"symbol":c=Cpe(e,i);break;case"undefined":c=Npe(e,i);break;case"null":c=Ppe(e,i);break;case"any":case"unknown":c=i;break;case"never":e.write("return INVALID;"),c=i;break;case"void":c=Dpe(e,i);break;case"nan":c=Ope(e,i);break;case"date":c=Mpe(e,i);break;case"object":c=Lpe(e,t,n,i,a);break;case"optional":c=Fpe(e,t,n,i,a);break;case"nullable":c=zpe(e,t,n,i,a);break;case"array":c=Gpe(e,t,n,i,a);break;case"literal":c=Vpe(e,t,n,i);break;case"enum":c=Bpe(e,t,n,i);break;case"readonly":{let l=MB(e,t,n,i),u=we(t);e.write(`const ${u} = Object.freeze(${l});`),c=u;break}case"success":MB(e,t,n,i),c="true";break;case"default":case"prefault":c=qpe(e,t,n,i);break;case"nonoptional":c=Wpe(e,t,n,i);break;case"tuple":c=Kpe(e,t,n,i);break;case"union":c=Hpe(e,t,n,i);break;case"intersection":c=Ype(e,t,n,i);break;case"record":c=Qpe(e,t,n,i);break;case"map":c=efe(e,t,n,i);break;case"set":c=tfe(e,t,n,i);break;case"file":c=nfe(e,i);break;case"template_literal":c=rfe(e,t,n,i);break;case"lazy":c=ife(e,t,n,i);break;case"pipe":c=ofe(e,t,n,i);break;case"custom":c=sfe(e,t,n,i);break;case"transform":c=lfe(e,t,n,i);break;case"catch":c=cfe(e,t,n,i);break;default:throw new Ve(`schema type ${s}`)}return c===null?null:hpe(e,t,n,c)}function Tpe(e,t,n,i,r=!0){e.write(`if (typeof ${i} !== "string") return INVALID;`);let o=n._zod.def;return o.format===void 0?i:zB(e,t,o,i,r)}function Ipe(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let i=t._zod.def;return i.check==="number_format"&&i.format&&jB(e,{format:i.format},n),n}function Ape(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Rpe(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let i=t._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function Cpe(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Npe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Ppe(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function Dpe(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Ope(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function Mpe(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function Lpe(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let s=o.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),l=c.length?[...a,...c]:a,u=y=>typeof y=="symbol"?Ie(t,y):tr(y),d=y=>typeof y=="symbol"?`[${u(y)}]`:tr(y),p=s;if(a.includes("__proto__"))throw new Ve('object shape key "__proto__"');let f=new Map;for(let y of l){let w=p[y],k=u(y),$=we(t);if(e.write(`const ${$} = ${i}[${k}];`),w._zod.optin!==void 0){let S=we(t);e.write(`let ${S} = (() => {`),e.indented(x=>{let E=Vn(x,t,w,$);x.write(`return ${E};`)}),e.write("})();"),w._zod.optout==="optional"?(e.write(`if (${S} === INVALID) {`),e.indented(x=>{x.write(`if (${k} in ${i}) return INVALID;`),x.write(`${S} = undefined;`)}),e.write("}")):e.write(`if (${S} === INVALID) return INVALID;`),f.set(y,S)}else{jpe(w)&&e.write(`if (!(${k} in ${i})) return INVALID;`);let S=Vn(e,t,w,$,r);S!==null&&f.set(y,S)}}let m=o.catchall,g="none";if(m){let y=m._zod.def.type;if(y==="never"){let w=a.map(k=>`k !== ${tr(k)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(k=>{k.write(`if (${w}) return INVALID;`)}),e.write("}")}else(y==="unknown"||y==="any")&&!m._zod.def.checks?.length?g="passthrough":g="schema"}let h=we(t),b=l.some(y=>OB(p[y])||L0(p[y]));if(!r){if(g==="schema"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`);let k=we(t);w.write(`const ${k} = ${i}[k];`),Vn(w,t,m,k,!1)}),e.write("}")}return null}if(b){e.write(`const ${h} = {};`);for(let y of l){let w=u(y),k=f.get(y);L0(p[y])?e.write(`if (${w} in ${i}) ${h}[${w}] = ${k};`):OB(p[y])?e.write(`if (${k} !== undefined || ${w} in ${i}) ${h}[${w}] = ${k};`):e.write(`${h}[${w}] = ${k};`)}}else{let y=l.map(w=>`${d(w)}: ${f.get(w)}`).join(", ");e.write(`const ${h} = { ${y} };`)}if(g!=="none"){let y=a.length>0?Ie(t,new Set(a)):null;e.write(`for (const k in ${i}) {`),e.indented(w=>{if(w.write('if (k === "__proto__") continue;'),y&&w.write(`if (${y}.has(k)) continue;`),g==="passthrough")w.write(`${h}[k] = ${i}[k];`);else{let k=we(t);w.write(`const ${k} = ${i}[k];`);let $=Vn(w,t,m,k);w.write(`${h}[k] = ${$};`)}}),e.write("}")}return h}function Fpe(e,t,n,i,r=!0){let o=n._zod.def;if(Upe(n))return Rt(e,t,o.innerType,i,r);if(o.innerType._zod.optin==="defaulted"){let a=we(t),c=we(t);return e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`const ${c} = (() => {`),l.indented(u=>{let d=Rt(u,t,o.innerType,i);u.write(`return ${d};`)}),l.write("})();"),l.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(l=>{let u=Rt(l,t,o.innerType,i);l.write(`${a} = ${u};`)}),e.write("}"),a}let s=r?we(t):null;return s&&e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function Upe(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function jpe(e){return e._zod.optin===void 0&&_c(e)}function _c(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?_c(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?_c(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(_c):!0;case"intersection":return!t.left||!t.right?!0:_c(t.left)&&_c(t.right);case"pipe":return t.in?_c(t.in):!0;default:return!0}}function L0(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function OB(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&Vu(e)}function Vu(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?Vu(t.innerType):!0;case"union":return t.options?t.options.some(Vu):!0;case"intersection":return!t.left||!t.right||Vu(t.left)||Vu(t.right);case"pipe":return t.out?Vu(t.out):!0;default:return!0}}function zpe(e,t,n,i,r=!0){let o=n._zod.def,s=r?we(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${i} !== null) {`),e.indented(a=>{let c=Rt(a,t,o.innerType,i,r);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function j0(e,t,n){for(let[i,r]of Pu(t._zod.def.checks))e.write(`if (${n} > ${zs(i,r._zod.def.check)}) return INVALID;`)}function Gpe(e,t,n,i,r=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`),j0(e,n,`${i}.length`);let s=r?we(t):null,a=we(t),c=we(t);return s&&e.write(`const ${s} = new Array(${i}.length);`),e.write(`for (let ${a} = 0; ${a} < ${i}.length; ${a}++) {`),e.indented(l=>{l.write(`const ${c} = ${i}[${a}];`);let u=Vn(l,t,o.element,c,r);s&&u!==null&&l.write(`${s}[${a}] = ${u};`)}),e.write("}"),s}function Vpe(e,t,n,i){let o=n._zod.def.values;if(o.length!==1){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}let s=o[0];if(typeof s=="number"&&Number.isNaN(s)){let a=Ie(t,new Set(o));return e.write(`if (!${a}.has(${i})) return INVALID;`),i}if(typeof s=="string")e.write(`if (${i} !== ${tr(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${i} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${i} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${i} !== ${s}n) return INVALID;`);else throw new Ve(`literal type ${typeof s}`);return i}function Bpe(e,t,n,i){let r=n._zod.values;if(!r)throw new Ve("enum schema without enumerated values");let o=Ie(t,r);return e.write(`if (!${o}.has(${i})) return INVALID;`),i}function MB(e,t,n,i){let r=n._zod.def;return Rt(e,t,r.innerType,i)}function qpe(e,t,n,i){let r=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return Rt(e,t,r.innerType,i);let c=Ie(t,s),l=we(t);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${c}();`),Rt(e,t,r.innerType,l)}let a=we(t);if(s){let c=Ie(t,s),l=Ie(t,Tm);e.write(`let ${a};`),e.write(`if (${i} === undefined) {`),e.indented(u=>{u.write(`${a} = ${l}(${c}());`)}),e.write("} else {"),e.indented(u=>{let d=Rt(u,t,r.innerType,i);u.write(`${a} = ${d} === undefined ? ${l}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let l=Rt(c,t,r.innerType,i);c.write(`${a} = ${l};`)}),e.write("}");return a}function Wpe(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.innerType,i),s=we(t);return e.write(`const ${s} = ${o};`),e.write(`if (${s} === undefined) return INVALID;`),s}function Kpe(e,t,n,i){let r=n._zod.def,o=r.items,s=r.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let a=LB(o,"optin"),c=LB(o,"optout");s?e.write(`if (${i}.length < ${a}) return INVALID;`):e.write(`if (${i}.length < ${a} || ${i}.length > ${o.length}) return INVALID;`);let l=we(t);e.write(`const ${l} = [];`);for(let u=0;u=c)e.write(`if (${l}.length === ${u}) {`),e.indented(p=>{p.write(`if (${u} < ${i}.length) {`),p.indented(f=>{let m=we(t);f.write(`const ${m} = ${i}[${u}];`);let g=Vn(f,t,d,m);f.write(`${l}[${u}] = ${g};`)}),p.write("} else {"),p.indented(f=>{if(L0(d)){f.write(`${l}.length = ${u};`);return}let m=we(t),g=we(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(h=>{let b=Vn(h,t,d,m);h.write(`return ${b};`)}),f.write("})();"),f.write(`if (${g} === INVALID || ${g} === undefined) ${l}.length = ${u};`),f.write(`else ${l}[${u}] = ${g};`)}),p.write("}")}),e.write("}");else{let p=we(t);e.write(`const ${p} = ${i}[${u}];`);let f=Vn(e,t,d,p);e.write(`${l}[${u}] = ${f};`)}}if(s){let u=we(t),d=we(t);e.write(`for (let ${u} = ${o.length}; ${u} < ${i}.length; ${u}++) {`),e.indented(p=>{p.write(`const ${d} = ${i}[${u}];`);let f=Vn(p,t,s,d);p.write(`${l}[${u}] = ${f};`)}),e.write("}")}return l}function LB(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function Hpe(e,t,n,i){let r=n._zod.def,o=r.options;if(r.discriminator)return Jpe(e,t,r,i);if(r.inclusive===!1)throw new Ve("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),i;if(o.length===1)return Rt(e,t,o[0],i);if(o.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(o.flatMap(u=>u._zod.def.values)),l=Ie(t,c);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let a=we(t);e.write(`let ${a};`);for(let c=0;c {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(u=>{let d=Rt(u,t,l,i);u.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function Jpe(e,t,n,i){if(n.unionFallback)throw new Ve("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),i;let r=we(t),o=we(t);e.write(`const ${r} = ${i}?.[${tr(n.discriminator)}];`),e.write(`let ${o};`);let s=!0,a=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Ve("discriminated union option without static discriminator values");for(let p of l){if(a.has(p))throw new Ve(`duplicate discriminator value ${String(p)}`);a.add(p)}let u=Array.from(l,p=>Zpe(t,r,p)),d=s?"if":"else if";e.write(`${d} (${u.join(" || ")}) {`),e.indented(p=>{let f=Rt(p,t,c,i);p.write(`${o} = ${f};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),o}function Zpe(e,t,n){if(typeof n=="string")return`${t} === ${tr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let i=Ie(e,n);return`${t} === ${i}`}throw new Ve(`literal discriminator value ${String(n)}`)}function Ype(e,t,n,i){let r=n._zod.def;t.definite=!1;let o=Vn(e,t,r.left,i),s=Vn(e,t,r.right,i),a=Ie(t,ju),c=we(t);return e.write(`const ${c} = ${a}(${o}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Qpe(e,t,n,i){let r=n._zod.def,o=Ie(t,ai);e.write(`if (!${o}(${i})) return INVALID;`);let s=we(t),a=we(t),c=we(t);e.write(`const ${s} = {};`);let l=r,u=l.partial?void 0:r.keyType._zod.values;if(u){let f=[];for(let g of u){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new Ve(`record key value ${String(g)}`);let h=typeof g=="number"?g.toString():g;if(h==="__proto__")throw new Ve('record key "__proto__"');f.push(h);let b=Ie(t,g),y=Rt(e,t,r.keyType,b),w=we(t);e.write(`const ${w} = ${i}[${Xpe(t,h)}];`);let k=Vn(e,t,r.valueType,w);e.write(`${s}[${y}] = ${k};`)}let m=Ie(t,new Set(f));return e.write(`for (const ${a} in ${i}) {`),e.indented(g=>{g.write(`if (${m}.has(${a})) continue;`),l.mode==="loose"?g.write(`if (${a} !== "__proto__") ${s}[${a}] = ${i}[${a}];`):g.write("return INVALID;")}),e.write("}"),s}let d=r.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let f=r.mode==="loose",m=aw(r.keyType);m.definite===!1&&(t.definite=!1);let g=Ie(t,m),h=Ie(t,Ho),b=we(t);return FB(e,t,i,a,y=>{y.write(`let ${b} = ${g}(${a});`),y.write(`if (${b} === INVALID && typeof ${a} === "string" && ${h}.test(${a})) ${b} = ${g}(Number(${a}));`),f?y.write(`if (${b} === INVALID) { ${s}[${a}] = ${i}[${a}]; continue; }`):y.write(`if (${b} === INVALID) return INVALID;`),y.write(`if (${b} === "__proto__") continue;`);let w=we(t);y.write(`const ${w} = ${i}[${a}];`);let k=Vn(y,t,r.valueType,w);y.write(`${s}[${b}] = ${k};`)}),s}return FB(e,t,i,a,f=>{f.write(`const ${c} = ${i}[${a}];`);let m=Vn(f,t,r.valueType,c);f.write(`${s}[${a}] = ${m};`)},"return INVALID;"),s}function FB(e,t,n,i,r,o){let s=Ie(t,Object.prototype.propertyIsEnumerable),a=we(t),c=we(t),l=we(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${c}[${l}];`),u.write(`if (${i} === "__proto__" || !${s}.call(${n}, ${i})) continue;`),r(u)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${a}.length; ${l}++) {`),e.indented(u=>{u.write(`const ${i} = ${a}[${l}];`),u.write(`if (!${s}.call(${n}, ${i})) continue;`),o?u.write(o):r(u)}),e.write("}")}function Xpe(e,t){return typeof t=="string"?tr(t):Ie(e,t)}function efe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`),j0(e,n,`${i}.size`);let o=we(t),s=we(t),a=we(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${s}, ${a}] of ${i}) {`),e.indented(c=>{let l=Rt(c,t,r.keyType,s),u=Rt(c,t,r.valueType,a);c.write(`${o}.set(${l}, ${u});`)}),e.write("}"),o}function tfe(e,t,n,i){let r=n._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`),j0(e,n,`${i}.size`);let o=we(t),s=we(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${s} of ${i}) {`),e.indented(a=>{let c=Rt(a,t,r.valueType,s);a.write(`${o}.add(${c});`)}),e.write("}"),o}function nfe(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function rfe(e,t,n,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let r=n._zod.pattern;if(r){let o=Ie(t,r);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${i})) return INVALID;`)}return i}function ife(e,t,n,i){let r=n._zod.def,o=$c(t,r.getter),s=Ie(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${o}();`),c.write(`${s}.parser = function(input) {`),c.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=we(t);return e.write(`const ${a} = ${s}.parser(${i});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function ofe(e,t,n,i){let r=n._zod.def,o=Rt(e,t,r.in,i);if(r.transform){if(Sc(r.transform))throw new Ui("z.compile: async transforms in pipes are not supported");let s=r.transform,c=$c(t,u=>{let d={value:u,issues:[],addIssue:U0},p=s(u,d);return p instanceof Promise?rr:d.issues.length===0?p:rr}),l=we(t);return e.write(`const ${l} = ${c}(${o});`),e.write(`if (${l} === INVALID) return INVALID;`),Rt(e,t,r.out,l)}else return Rt(e,t,r.out,o)}function Sc(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function sfe(e,t,n,i){let r=n._zod.def;if(r.fn){if(Sc(r.fn))throw new Ui("z.compile: async custom predicates are not supported");let o=$c(t,r.fn),s=Ie(t,M0),a=we(t);e.write(`const ${a} = ${o}(${i});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new Ve("custom schema without a predicate function");return i}function afe(e,t,n){let i=e._zod.run({value:n,issues:[]},{});if(i&&typeof i.then=="function")return rr;let r=i;return r.issues.length===0?r.value:t()}function cfe(e,t,n,i){let r=n._zod.def;if(!r.catchValue[pv])throw new Ve("catch with a callback (only a constant catch value compiles)",!1);let o=we(t);e.write(`let ${o} = (() => {`),e.indented(l=>{let u=Vn(l,t,r.innerType,i);l.write(`return ${u};`)}),e.write("})();");let s=Ie(t,r.innerType),a=$c(t,r.catchValue),c=Ie(t,afe);return e.write(`if (${o} === INVALID) {`),e.indented(l=>{l.write(`${o} = ${c}(${s}, ${a}, ${i});`),l.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function lfe(e,t,n,i){let r=n._zod.def;if(r.transform){if(Sc(r.transform))throw new Ui("z.compile: async transforms are not supported");let o=r.transform,a=$c(t,l=>{let u={value:l,issues:[],addIssue:U0},d=o(l,u);return d instanceof Promise?rr:u.issues.length===0?d:rr}),c=we(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return i}function cw(e){return e.checks&&(e.checks=[...e.checks]),e}function z0(e,t){return new e(cw({type:"string",...Q(t)}))}function G0(e,t){return new e(cw({type:"string",coerce:!0,...Q(t)}))}function lw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Q(t)})}function uw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Q(t)})}function dw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Q(t)})}function pw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Q(t)})}function fw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Q(t)})}function mw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Q(t)})}function rg(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Q(t)})}function gw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Q(t)})}function hw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Q(t)})}function yw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Q(t)})}function bw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Q(t)})}function vw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Q(t)})}function ww(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Q(t)})}function kw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Q(t)})}function _w(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Q(t)})}function $w(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Q(t)})}function V0(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Q(t)})}function Sw(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Q(t)})}function xw(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Q(t)})}function Ew(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Q(t)})}function Tw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Q(t)})}function Iw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Q(t)})}function B0(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...Q(t)})}function q0(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...Q(t)})}function Aw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Q(t)})}var W0={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ig(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Q(t)})}function og(e,t){return new e({type:"string",format:"date",check:"string_format",...Q(t)})}function sg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Q(t)})}function ag(e,t){return new e({type:"string",format:"duration",check:"string_format",...Q(t)})}function K0(e,t){return new e(cw({type:"number",checks:[],...Q(t)}))}function H0(e,t){return new e(cw({type:"number",coerce:!0,checks:[],...Q(t)}))}function J0(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Q(t)})}function Z0(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Q(t)})}function Y0(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Q(t)})}function Q0(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Q(t)})}function X0(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Q(t)})}function eR(e,t){return new e({type:"boolean",...Q(t)})}function tR(e,t){return new e({type:"boolean",coerce:!0,...Q(t)})}function nR(e,t){return new e({type:"bigint",...Q(t)})}function rR(e,t){return new e({type:"bigint",coerce:!0,...Q(t)})}function iR(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Q(t)})}function oR(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Q(t)})}function sR(e,t){return new e({type:"symbol",...Q(t)})}function aR(e,t){return new e({type:"undefined",...Q(t)})}function cR(e,t){return new e({type:"null",...Q(t)})}function lR(e){return new e({type:"any"})}function uR(e){return new e({type:"unknown"})}function dR(e,t){return new e({type:"never",...Q(t)})}function pR(e,t){return new e({type:"void",...Q(t)})}function fR(e,t){return new e({type:"date",...Q(t)})}function mR(e,t){return new e({type:"date",coerce:!0,...Q(t)})}function gR(e,t){return new e({type:"nan",...Q(t)})}function po(e,t){return new Iv({check:"less_than",...Q(t),value:e,inclusive:!1})}function zr(e,t){return new Iv({check:"less_than",...Q(t),value:e,inclusive:!0})}function fo(e,t){return new Av({check:"greater_than",...Q(t),value:e,inclusive:!1})}function Gr(e,t){return new Av({check:"greater_than",...Q(t),value:e,inclusive:!0})}function Rw(e){return fo(0,e)}function Cw(e){return po(0,e)}function Nw(e){return zr(0,e)}function Pw(e){return Gr(0,e)}function Gs(e,t){return new YI({check:"multiple_of",...Q(t),value:e})}function Vs(e,t){return new eA({check:"max_size",...Q(t),maximum:e})}function mo(e,t){return new tA({check:"min_size",...Q(t),minimum:e})}function xc(e,t){return new nA({check:"size_equals",...Q(t),size:e})}function Ec(e,t){return new rA({check:"max_length",...Q(t),maximum:e})}function Jo(e,t){return new iA({check:"min_length",...Q(t),minimum:e})}function Tc(e,t){return new oA({check:"length_equals",...Q(t),length:e})}function Bu(e,t){return new sA({check:"string_format",format:"regex",...Q(t),pattern:e})}function qu(e){return new aA({check:"string_format",format:"lowercase",...Q(e)})}function Wu(e){return new cA({check:"string_format",format:"uppercase",...Q(e)})}function Ku(e,t){return new lA({check:"string_format",format:"includes",...Q(t),includes:e})}function Hu(e,t){return new uA({check:"string_format",format:"starts_with",...Q(t),prefix:e})}function Ju(e,t){return new dA({check:"string_format",format:"ends_with",...Q(t),suffix:e})}function Dw(e,t,n){return new pA({check:"property",property:e,schema:t,...Q(n)})}function Zu(e,t){return new fA({check:"properties",shape:e,...Q(t)})}function Yu(e,t){return new mA({check:"mime_type",mime:e,...Q(t)})}function ji(e){return new gA({check:"overwrite",tx:e})}function Qu(e){return ji(t=>t.normalize(e))}function Xu(){return ji(e=>e.trim())}function ed(){return ji(e=>e.toLowerCase())}function td(){return ji(e=>e.toUpperCase())}function nd(){return ji(e=>XT(e))}function hR(e,t,n){return new e({type:"array",element:t,...Q(n)})}function ufe(e,t,n){return new e({type:"union",options:t,...Q(n)})}function dfe(e,t,n){return new e({type:"union",options:t,inclusive:!1,...Q(n)})}function pfe(e,t,n,i){return new e({type:"union",options:n,discriminator:t,...Q(i)})}function ffe(e,t,n){return new e({type:"intersection",left:t,right:n})}function mfe(e,t,n,i){let r=n instanceof Oe,o=r?i:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...Q(o)})}function gfe(e,t,n,i){return new e({type:"record",keyType:t,valueType:n,...Q(i)})}function hfe(e,t,n,i){return new e({type:"map",keyType:t,valueType:n,...Q(i)})}function yfe(e,t,n){return new e({type:"set",valueType:t,...Q(n)})}function bfe(e,t,n){let i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:i,...Q(n)})}function vfe(e,t,n){return new e({type:"enum",entries:t,...Q(n)})}function wfe(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Q(n)})}function yR(e,t){return new e({type:"file",...Q(t)})}function kfe(e,t){return new e({type:"transform",transform:t})}function _fe(e,t){return new e({type:"optional",innerType:t})}function $fe(e,t){return new e({type:"nullable",innerType:t})}function Sfe(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Tm(n)}})}function xfe(e,t,n){return new e({type:"nonoptional",innerType:t,...Q(n)})}function Efe(e,t){return new e({type:"success",innerType:t})}function Tfe(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:oI(n)})}function Ife(e,t,n){return new e({type:"pipe",in:t,out:n})}function Afe(e,t){return new e({type:"readonly",innerType:t})}function Rfe(e,t,n){return new e({type:"template_literal",parts:t,...Q(n)})}function Cfe(e,t){return new e({type:"lazy",getter:t})}function Nfe(e,t){return new e({type:"promise",innerType:t})}function bR(e,t,n){let i=Q(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function vR(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Q(n)})}function wR(e,t){let n=GB(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Du(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Du(o))}},e(i.value,i)),t);return n}function GB(e,t){let n=new ht({check:"custom",...Q(t)});return n._zod.check=e,n}function kR(e){let t=new ht({check:"describe"});return t._zod.onattach=[n=>{let i=Pn.get(n)??{};Pn.add(n,{...i,description:e})}],t._zod.check=()=>{},t}function _R(e){let t=new ht({check:"meta"});return t._zod.onattach=[n=>{let i=Pn.get(n)??{};Pn.add(n,{...i,...e})}],t._zod.check=()=>{},t}function $R(e,t){let n=Q(t),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),a=e.Codec??Zm,c=e.Boolean??Hm,l=e.String??kc,u=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),p=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let g=f;return n.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return p._zod.bag.truthy=i,p._zod.bag.falsy=r,p._zod.bag.case=n.case??"insensitive",p}function Ic(e,t,n,i={}){let r=Q(i),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(o.pattern=n),new e(o)}function cg(e,...t){for(let n of t)for(let i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Nn(e,i,n[i]);return e}function Bs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Pn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function gn(e,t,n,i,r){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:i.path,message:r}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}function ut(e,t,n={path:[],schemaPath:[]}){var i;let r=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let p=s.schema,f=t.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(e,t,p,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),ut(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&cg(s.schema,c),t.io==="input"&&ir(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function VB(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function qs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0])}}let r=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${VB(f)}`}}let c="#",l=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+VB(u)}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=r(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ -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]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}a.count>1&&e.reused==="ref"&&o(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function zB(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let i of t){if(!i||typeof i!="object")return;zB(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let o=i.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var GB=new Set(["type","properties","required","additionalProperties"]),UB=["oneOf","anyOf"];function jB(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function mR(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!GB.has(s))return null;t.push(o)}let n={},i=new Set;for(let o of t){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let l of t){let u=l.properties?.[s]??jB(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:mR(a)??{allOf:a};Sn(n,s,c)}for(let s of o.required??[])i.add(s)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),t.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{let o=[];for(let s of t){let a=jB(s);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}function xfe(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let r of GB)if(r in e)return;let n=t.filter(r=>UB.some(o=>Array.isArray(r[o]))),i=null;if(!n.length)i=mR(t);else{let r=n[0],o=UB.find(c=>Array.isArray(r[c]));if(Object.keys(r).length!==1)return;let s=t.filter(c=>c!==r),a=r[o].map(c=>mR([...s,c]));if(a.some(c=>!c))return;i={[o]:a}}i&&(delete e.allOf,ng(e,i))}function qs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let f=e.seen.get(d),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):ng(l,m),ng(l,u),a._zod.parent===d)for(let h in l)h==="$ref"||h==="allOf"||h in u||delete l[h];if(m.$ref&&f.def)for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())i(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())zB(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=a.get(u);d?d.push(l):a.set(u,[l])}for(let c of e.intersections)for(let l of a.get(c)??[])xfe(l)}}let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}ng(r,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&r.id===o&&delete r.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Sn(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:ed(t,"input",e.processors),output:ed(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function xn(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return xn(i.element,n);if(i.type==="set")return xn(i.valueType,n);if(i.type==="lazy")return xn(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return xn(i.innerType,n);if(i.type==="intersection")return xn(i.left,n)||xn(i.right,n);if(i.type==="record"||i.type==="map")return xn(i.keyType,n)||xn(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:xn(i.in,n)||xn(i.out,n);if(i.type==="object"){for(let r in i.shape)if(xn(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(xn(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(xn(r,n))return!0;return!!(i.rest&&xn(i.rest,n))}return!1}var gR=(e,t={})=>n=>{let i=Vs({...n,processors:t});return st(e,i),Bs(i,e),qs(i,e)},ed=(e,t,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Vs({...r??{},target:o,io:t,processors:n});return st(e,s),Bs(s,e),qs(s,e)};var td=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},nd=(e,t,n)=>{(e[t]===void 0||n{td(e,"minimum",t),nd(e,"maximum",t)},HB=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},KB=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},JB=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},ZB=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},BB=(e,t)=>td(e,"minimum",t.minimum),qB=(e,t)=>nd(e,"maximum",t.maximum),WB=e=>(t,n)=>{ZB(t,n.format);let[i,r]=e[n.format];td(t,"minimum",i),nd(t,"maximum",r)},Efe={greater_than:(e,t)=>td(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>nd(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>HB(e,t.value),number_format:WB(Im),bigint_format:WB(Am),min_length:BB,max_length:qB,length_equals:(e,t)=>VB(e,t.length),min_size:BB,max_size:qB,size_equals:(e,t)=>VB(e,t.size),string_format:(e,t)=>{ZB(e,t.format),t.pattern&&KB(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>JB(e,t.mime)};function yn(e){let t={},n=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of i)Efe[o._zod.def.check]?.(t,o._zod.def);let r=e._zod.bag;r.minimum!==void 0&&td(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&td(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&nd(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&nd(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&HB(t,r.multipleOf),r.format!==void 0&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&JB(t,r.mime);for(let o of r.patterns??[])KB(t,o);return t}var Tfe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ife=new Map([[Pv,xI],[zm,EI]]),YB=e=>Ife.get(e)??e,bR=(e,t,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:u}=yn(e);if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),a&&(r.format=Tfe[a]??a,r.format===""&&delete r.format,(a==="time"||u)&&delete r.format),l&&(r.contentEncoding=l),c&&c.size>0){let d=[...c].map(YB);d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},vR=(e,t,n,i)=>{let r=n,{minimum:o,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=yn(e);r.type=u?"integer":"number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(d?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),p?f?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof s=="number"&&(r.maximum=s),a){let m=new Set;for(let b of a)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):Zt(e,t,r,i,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[g,...h]=m;g!==void 0&&(r.multipleOf=g),h.length&&(r.allOf=[...r.allOf??[],...h.map(b=>({multipleOf:b}))])}},wR=(e,t,n,i)=>{n.type="boolean"},kR=(e,t,n,i)=>{Zt(e,t,n,i,"BigInt cannot be represented in JSON Schema")},$R=(e,t,n,i)=>{Zt(e,t,n,i,"Symbols cannot be represented in JSON Schema")},_R=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},SR=(e,t,n,i)=>{Zt(e,t,n,i,"Undefined cannot be represented in JSON Schema")},xR=(e,t,n,i)=>{Zt(e,t,n,i,"Void cannot be represented in JSON Schema")},ER=(e,t,n,i)=>{n.not={}},TR=(e,t,n,i)=>{},IR=(e,t,n,i)=>{},AR=(e,t,n,i)=>{Zt(e,t,n,i,"Date cannot be represented in JSON Schema")},RR=(e,t,n,i)=>{let r=e._zod.def,o=Tu(r.entries);if(o.length===0){n.not={};return}o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},NR=(e,t,n,i)=>{let r=e._zod.def;if(r.values.length===0){n.not={};return}let o=[];for(let s of r.values)if(s===void 0){if(Zt(e,t,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Zt(e,t,n,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},CR=(e,t,n,i)=>{Zt(e,t,n,i,"NaN cannot be represented in JSON Schema")},PR=(e,t,n,i)=>{let r=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},DR=(e,t,n,i)=>{let r=n;r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:o,maximum:s,mime:a}=yn(e);o!==void 0&&(r.minLength=o),s!==void 0&&(r.maxLength=s),a&&(a.length===0?r.not={}:a.length===1?r.contentMediaType=a[0]:r.anyOf=a.map(c=>({contentMediaType:c})))},OR=(e,t,n,i)=>{n.type="boolean"},MR=(e,t,n,i)=>{Zt(e,t,n,i,"Custom types cannot be represented in JSON Schema")},LR=(e,t,n,i)=>{Zt(e,t,n,i,"Function types cannot be represented in JSON Schema")},FR=(e,t,n,i)=>{Zt(e,t,n,i,"Transforms cannot be represented in JSON Schema")},UR=(e,t,n,i)=>{Zt(e,t,n,i,"Map cannot be represented in JSON Schema")},jR=(e,t,n,i)=>{Zt(e,t,n,i,"Set cannot be represented in JSON Schema")},zR=(e,t,n,i)=>{let r=n,o=e._zod.def,{minimum:s,maximum:a}=yn(e);typeof s=="number"&&(r.minItems=s),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=st(o.element,t,{...i,path:[...i.path,"items"]})};function rd(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?rd(t.out):t.type==="catch"?rd(t.innerType):e._zod.optin}var GR=(e,t,n,i)=>{let r=n,o=e._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&Zt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let u in s)Sn(r.properties,u,st(s[u],t,{...i,path:[...i.path,"properties",u]}));let c=new Set(Object.keys(s)),l=new Set([...c].filter(u=>{let d=o.shape[u];return t.io==="input"?rd(d)===void 0:d._zod.optout===void 0}));l.size>0&&(r.required=Array.from(l)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=st(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},Afe=(e,t,n,i)=>{let r=n,o=e._zod.def;if(Object.getOwnPropertySymbols(o.shape).length&&Zt(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;if(t.io==="output"){for(let a in o.shape)if(xn(o.shape[a])&&Zt(e,t,r,i,`z.properties() returns its input, so the output of a transforming schema at key "${a}" cannot be represented in JSON Schema`))return}r.type="object",r.properties={};for(let a in o.shape)Sn(r.properties,a,st(o.shape[a],t,{...i,path:[...i.path,"properties",a]}));let s=Object.keys(o.shape).filter(a=>rd(o.shape[a])===void 0);s.length>0&&(r.required=s)},Aw=(e,t,n,i)=>{let r=e._zod.def,o=r.inclusive===!1,s=r.options.map((a,c)=>st(a,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},VR=(e,t,n,i)=>{let r=e._zod.def,o=st(r.left,t,{...i,path:[...i.path,"allOf",0]}),s=st(r.right,t,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},BR=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((g,h)=>st(g,t,{...i,path:[...i.path,s,h]})),l=o.rest?st(o.rest,t,{...i,path:[...i.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let g=o.items[u-1];if(!(t.io==="input"?rd(g)!==void 0:g._zod.optout==="optional"))break;u--}let d=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(r.prefixItems=c,p?r.items=!1:l&&(r.items=l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):t.target==="openapi-3.0"?(r.items={anyOf:c},l&&r.items.anyOf.push(l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):(r.items=c,p?r.additionalItems=!1:l&&(r.additionalItems=l),u>0&&(r.minItems=u),p&&(r.maxItems=d));let{minimum:f,maximum:m}=yn(e);typeof f=="number"&&(r.minItems=f),typeof m=="number"&&(r.maxItems=m)};function hR(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let g=hR(e,m,n);return g===m?t:g}for(let m of["anyOf","oneOf"]){let g=t[m];if(!Array.isArray(g))continue;let h=g.map(b=>hR(e,b,n));h.some((b,y)=>b!==g[y])&&(t={...t,[m]:h})}let i=Array.isArray(t.type)?t.type:[t.type],r=!i.includes("string")&&i.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!o?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:p,...f}=t;return f.enum?f.enum=f.enum.map(m=>typeof m=="number"?String(m):m):typeof f.const=="number"&&(f.const=String(f.const)),r&&(f.type="string",o||(f.pattern=(i.includes("number")?Ko:Mm).source)),f}var yR=new WeakMap;function Rfe(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let n=new Map;for(let i of yR.get(e)??[]){let r=e.seen.get(i),o=(r?.def??r?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let s=hR(t,o,new Set);s!==o&&n.set(o,s)}if(n.size)for(let i of e.seen.values())for(let r of[i.schema,i.def]){let o=r&&n.get(r.propertyNames);o&&(r.propertyNames=o)}}var qR=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object";let s=o.keyType,a=yn(s).patterns;if(o.mode==="loose"&&a&&a.size>0){let u=st(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of a)Sn(r.patternProperties,YB(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){r.propertyNames=st(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});let u=yR.get(t);u||(u=[],yR.set(t,u),t.deferred.push(()=>Rfe(t))),u.push(e)}r.additionalProperties=st(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let c=s._zod.values,l=t.io==="input"&&rd(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(r.required=u.map(String))}},WR=(e,t,n,i)=>{let r=e._zod.def,o=st(r.innerType,t,i),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},HR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},KR=Symbol();function QB(e,t,n,i,r){let o=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(Zt(t,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),KR):JSON.parse(s)}var JR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s=QB(r.defaultValue,e,t,n,i);s!==KR&&(n.default=s)},ZR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);if(o.ref=r.innerType,t.io!=="input")return;let s=QB(r.defaultValue,e,t,n,i);s!==KR&&(n._prefault=s)},YR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{Zt(e,t,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},QR=(e,t,n,i)=>{let r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?r.out:r.in:r.out;st(s,t,i);let a=t.seen.get(e);a.ref=s},XR=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.readOnly=!0},eN=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},Rw=(e,t,n,i)=>{let r=e._zod.def;st(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},tN=(e,t,n,i)=>{let r=e._zod.innerType;st(r,t,i);let o=t.seen.get(e);o.ref=r},Iw={string:bR,number:vR,boolean:wR,bigint:kR,symbol:$R,null:_R,undefined:SR,void:xR,never:ER,any:TR,unknown:IR,date:AR,enum:RR,literal:NR,nan:CR,template_literal:PR,file:DR,success:OR,custom:MR,properties:Afe,function:LR,transform:FR,map:UR,set:jR,array:zR,object:GR,union:Aw,intersection:VR,tuple:BR,record:qR,nullable:WR,nonoptional:HR,default:JR,prefault:ZR,catch:YR,pipe:QR,readonly:XR,promise:eN,optional:Rw,lazy:tN};function Nw(e,t){if("_idmap"in e){let i=e,r=Vs({...t,processors:Iw}),o={};for(let c of i._idmap.entries()){let[l,u]=c;st(u,r)}let s={},a={registry:i,uri:t?.uri,defs:o};r.external=a;for(let c of i._idmap.entries()){let[l,u]=c;Bs(r,u),Sn(s,l,qs(r,u))}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let n=Vs({...t,processors:Iw});return st(e,n),Bs(n,e),qs(n,e)}var Cw=class{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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Vs({processors:Iw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return st(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Bs(this.ctx,t);let i=qs(this.ctx,t),{"~standard":r,...o}=i;return o}};var XB={};var pd={};_r(pd,{ZodAny:()=>_N,ZodArray:()=>TN,ZodBase64:()=>Yw,ZodBase64URL:()=>Qw,ZodBigInt:()=>ud,ZodBigIntFormat:()=>tk,ZodBoolean:()=>ld,ZodCIDRv4:()=>Jw,ZodCIDRv6:()=>Zw,ZodCUID:()=>Gw,ZodCUID2:()=>Vw,ZodCatch:()=>KN,ZodCodec:()=>pg,ZodCreditCard:()=>gN,ZodCustom:()=>fg,ZodCustomStringFormat:()=>ad,ZodDate:()=>sg,ZodDefault:()=>GN,ZodDiscriminatedUnion:()=>AN,ZodE164:()=>Xw,ZodEmail:()=>Fw,ZodEmoji:()=>jw,ZodEnum:()=>od,ZodExactOptional:()=>ok,ZodFile:()=>FN,ZodFunction:()=>iC,ZodGUID:()=>Uw,ZodIBAN:()=>hN,ZodIPv4:()=>Hw,ZodIPv6:()=>Kw,ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>lC,ZodIntersection:()=>RN,ZodJWT:()=>ek,ZodKSUID:()=>Ww,ZodLazy:()=>tC,ZodLiteral:()=>LN,ZodMAC:()=>mN,ZodMap:()=>ON,ZodNaN:()=>ZN,ZodNanoID:()=>zw,ZodNever:()=>xN,ZodNonOptional:()=>sk,ZodNull:()=>kN,ZodNullable:()=>zN,ZodNumber:()=>cd,ZodNumberFormat:()=>Nc,ZodObject:()=>cg,ZodOptional:()=>ug,ZodPipe:()=>dg,ZodPrefault:()=>BN,ZodPreprocess:()=>YN,ZodPromise:()=>rC,ZodProperties:()=>oC,ZodReadonly:()=>QN,ZodRecord:()=>id,ZodSet:()=>MN,ZodString:()=>sd,ZodStringFormat:()=>mt,ZodSuccess:()=>HN,ZodSymbol:()=>vN,ZodTemplateLiteral:()=>eC,ZodTransform:()=>UN,ZodTuple:()=>CN,ZodType:()=>Le,ZodULID:()=>Bw,ZodURL:()=>og,ZodUUID:()=>go,ZodUndefined:()=>wN,ZodUnion:()=>lg,ZodUnknown:()=>SN,ZodVoid:()=>EN,ZodXID:()=>qw,ZodXor:()=>IN,_ZodString:()=>Lw,_default:()=>VN,_function:()=>u2,any:()=>zq,array:()=>ag,base64:()=>$q,base64url:()=>_q,bigint:()=>Mq,boolean:()=>bN,catch:()=>JN,check:()=>d2,cidrv4:()=>wq,cidrv6:()=>kq,codec:()=>s2,creditCard:()=>xq,cuid:()=>pq,cuid2:()=>fq,custom:()=>p2,date:()=>Vq,describe:()=>f2,discriminatedUnion:()=>Jq,e164:()=>Sq,email:()=>nq,emoji:()=>uq,enum:()=>rk,exactOptional:()=>jN,file:()=>n2,float32:()=>Cq,float64:()=>Pq,function:()=>u2,guid:()=>rq,hash:()=>Nq,hex:()=>Rq,hostname:()=>Aq,httpUrl:()=>lq,iban:()=>Eq,instanceof:()=>g2,int:()=>Ow,int32:()=>Dq,int64:()=>Lq,intersection:()=>NN,invertCodec:()=>a2,ipv4:()=>yq,ipv6:()=>vq,json:()=>y2,jwt:()=>Tq,keyof:()=>Bq,ksuid:()=>hq,lazy:()=>nC,literal:()=>t2,looseObject:()=>Hq,looseRecord:()=>Yq,mac:()=>bq,map:()=>Qq,meta:()=>m2,nan:()=>o2,nanoid:()=>dq,nativeEnum:()=>e2,never:()=>nk,nonoptional:()=>WN,null:()=>$N,nullable:()=>ig,nullish:()=>r2,number:()=>yN,object:()=>qq,optional:()=>Rc,partialRecord:()=>Zq,pipe:()=>Mw,prefault:()=>qN,preprocess:()=>b2,promise:()=>l2,properties:()=>sC,readonly:()=>XN,record:()=>DN,refine:()=>aC,set:()=>Xq,strictObject:()=>Wq,string:()=>rg,stringFormat:()=>Iq,stringbool:()=>h2,success:()=>i2,superRefine:()=>cC,symbol:()=>Uq,templateLiteral:()=>c2,transform:()=>ik,tuple:()=>PN,uint32:()=>Oq,uint64:()=>Fq,ulid:()=>mq,undefined:()=>jq,union:()=>dd,unknown:()=>Ac,url:()=>cq,uuid:()=>iq,uuidv4:()=>oq,uuidv6:()=>sq,uuidv7:()=>aq,void:()=>Gq,xid:()=>gq,xor:()=>Kq});var Pw={};_r(Pw,{endsWith:()=>Wu,gt:()=>fo,gte:()=>Vr,includes:()=>Bu,length:()=>Ic,lowercase:()=>Gu,lt:()=>po,lte:()=>Gr,maxLength:()=>Tc,maxSize:()=>Gs,mime:()=>Hu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>zs,negative:()=>Sw,nonnegative:()=>Ew,nonpositive:()=>xw,normalize:()=>Ku,overwrite:()=>ji,positive:()=>_w,property:()=>Tw,regex:()=>zu,size:()=>Ec,slugify:()=>Qu,startsWith:()=>qu,toLowerCase:()=>Zu,toUpperCase:()=>Yu,trim:()=>Ju,uppercase:()=>Vu});var eq=new WeakSet([Object.prototype,Error.prototype]);function Dw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var tq=(e,t)=>{oI.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);eq.has(n)||(eq.add(n),Dw(n,"format",i=>r=>Pm(i,r)),Dw(n,"flatten",i=>r=>Cm(i,r)),Dw(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,Iu,2)}),Dw(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,Iu,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Cfe=R("ZodError",tq),Ar=R("ZodError",tq,void 0,{Parent:Error});var nN=Cu(Ar),rN=Pu(Ar),iN=Du(Ar),oN=Ou(Ar),sN=uv(Ar),aN=dv(Ar),cN=pv(Ar),lN=fv(Ar),uN=mv(Ar),dN=gv(Ar),pN=hv(Ar),fN=yv(Ar);function Dfe(){hn.localeError||zt(Jv())}function Ws(){hn.memoizer||zt({memoizer:Km()})}var Le=R("ZodType",(e,t)=>(Dfe(),Ce.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ot(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(aC(e,t))},superRefine(e,t){return this.check(cC(e,t))},overwrite(e){return this.check(ji(e))},optional(){return Rc(this)},exactOptional(){return jN(this)},nullable(){return ig(this)},nullish(){return Rc(ig(this))},nonoptional(e){return WN(this,e)},array(){return ag(this)},or(e){return dd([this,e])},and(e){return NN(this,e)},transform(e){return Mw(this,ik(e))},default(e){return VN(this,e)},prefault(e){return qN(this,e)},catch(e){return JN(this,e)},pipe(e){return Mw(this,e)},readonly(){return XN(this)},describe(e){let t=this.clone();return Dn.add(t,{description:e}),t},meta(...e){if(e.length===0)return Dn.get(this);let t=this.clone();return Dn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...Tv(this),jsonSchema:{input:ed(this,"input"),output:ed(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return nN(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await rN(this,t,n,{callee:e})},safeParse(e,t){return iN(this,e,t)},async safeParseAsync(e,t){return oN(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},validate(e,t){return Dm(this,e,t)},validateAsync(e,t){return Om(this,e,t)},encode:function e(t,n){return sN(this,t,n,{callee:e})},decode:function e(t,n){return aN(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await cN(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await lN(this,t,n,{callee:e})},safeEncode(e,t){return uN(this,e,t)},safeDecode(e,t){return dN(this,e,t)},async safeEncodeAsync(e,t){return pN(this,e,t)},async safeDecodeAsync(e,t){return fN(this,e,t)},toJSONSchema(e){return gR(this,{})(e)},get description(){return Dn.get(this)?.description},get _def(){return this._zod.def}}),Lw=R("_ZodString",(e,t)=>{kc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>bR(e,n,i,r)},G.derived({format:e=>yn(e).format??null,minLength:e=>yn(e).minimum??null,maxLength:e=>yn(e).maximum??null},{regex(...e){return this.check(zu(...e))},includes(...e){return this.check(Bu(...e))},startsWith(...e){return this.check(qu(...e))},endsWith(...e){return this.check(Wu(...e))},min(...e){return this.check(Jo(...e))},max(...e){return this.check(Tc(...e))},length(...e){return this.check(Ic(...e))},nonempty(...e){return this.check(Jo(1,...e))},lowercase(e){return this.check(Gu(e))},uppercase(e){return this.check(Vu(e))},trim(){return this.check(Ju())},normalize(...e){return this.check(Ku(...e))},toLowerCase(){return this.check(Zu())},toUpperCase(){return this.check(Yu())},slugify(){return this.check(Qu())}})),sd=R("ZodString",(e,t)=>{kc.init(e,t),Lw.init(e,t)},{email(e){return this.check(nw(Fw,e))},url(e){return this.check(Ym(og,e))},jwt(e){return this.check($w(ek,e))},emoji(e){return this.check(cw(jw,e))},guid(e){return this.check(rw(Uw,e))},uuid(e){return this.check(iw(go,e))},uuidv4(e){return this.check(ow(go,e))},uuidv6(e){return this.check(sw(go,e))},uuidv7(e){return this.check(aw(go,e))},nanoid(e){return this.check(lw(zw,e))},cuid(e){return this.check(uw(Gw,e))},cuid2(e){return this.check(dw(Vw,e))},ulid(e){return this.check(pw(Bw,e))},base64(e){return this.check(vw(Yw,e))},base64url(e){return this.check(ww(Qw,e))},xid(e){return this.check(fw(qw,e))},ksuid(e){return this.check(mw(Ww,e))},ipv4(e){return this.check(gw(Hw,e))},ipv6(e){return this.check(hw(Kw,e))},cidrv4(e){return this.check(yw(Jw,e))},cidrv6(e){return this.check(bw(Zw,e))},e164(e){return this.check(kw(Xw,e))},datetime(e){return this.check(Qm(Hs,e))},date(e){return this.check(Xm(Ks,e))},time(e){return this.check(eg(Js,e))},duration(e){return this.check(tg(Zs,e))}});function rg(e){return RA(sd,e)}var mt=R("ZodStringFormat",(e,t)=>{ut.init(e,t),Lw.init(e,t)}),Hs=R("ZodISODateTime",(e,t)=>{k0.init(e,t),mt.init(e,t)}),Ks=R("ZodISODate",(e,t)=>{$0.init(e,t),mt.init(e,t)}),Js=R("ZodISOTime",(e,t)=>{_0.init(e,t),mt.init(e,t)}),Zs=R("ZodISODuration",(e,t)=>{S0.init(e,t),mt.init(e,t)}),Fw=R("ZodEmail",(e,t)=>{u0.init(e,t),mt.init(e,t)});function nq(e){return nw(Fw,e)}var Uw=R("ZodGUID",(e,t)=>{c0.init(e,t),mt.init(e,t)});function rq(e){return rw(Uw,e)}var go=R("ZodUUID",(e,t)=>{l0.init(e,t),mt.init(e,t)});function iq(e){return iw(go,e)}function oq(e){return ow(go,e)}function sq(e){return sw(go,e)}function aq(e){return aw(go,e)}var og=R("ZodURL",(e,t)=>{f0.init(e,t),mt.init(e,t)});function cq(e){return Ym(og,e)}function lq(e){return Ym(og,{protocol:or.httpProtocol,hostname:or.domain,...G.normalizeParams(e)})}var jw=R("ZodEmoji",(e,t)=>{m0.init(e,t),mt.init(e,t)});function uq(e){return cw(jw,e)}var zw=R("ZodNanoID",(e,t)=>{g0.init(e,t),mt.init(e,t)});function dq(e){return lw(zw,e)}var Gw=R("ZodCUID",(e,t)=>{h0.init(e,t),mt.init(e,t)});function pq(e){return uw(Gw,e)}var Vw=R("ZodCUID2",(e,t)=>{y0.init(e,t),mt.init(e,t)});function fq(e){return dw(Vw,e)}var Bw=R("ZodULID",(e,t)=>{b0.init(e,t),mt.init(e,t)});function mq(e){return pw(Bw,e)}var qw=R("ZodXID",(e,t)=>{v0.init(e,t),mt.init(e,t)});function gq(e){return fw(qw,e)}var Ww=R("ZodKSUID",(e,t)=>{w0.init(e,t),mt.init(e,t)});function hq(e){return mw(Ww,e)}var Hw=R("ZodIPv4",(e,t)=>{x0.init(e,t),mt.init(e,t)});function yq(e){return gw(Hw,e)}var mN=R("ZodMAC",(e,t)=>{T0.init(e,t),mt.init(e,t)});function bq(e){return CA(mN,e)}var Kw=R("ZodIPv6",(e,t)=>{E0.init(e,t),mt.init(e,t)});function vq(e){return hw(Kw,e)}var Jw=R("ZodCIDRv4",(e,t)=>{I0.init(e,t),mt.init(e,t)});function wq(e){return yw(Jw,e)}var Zw=R("ZodCIDRv6",(e,t)=>{A0.init(e,t),mt.init(e,t)});function kq(e){return bw(Zw,e)}var Yw=R("ZodBase64",(e,t)=>{R0.init(e,t),mt.init(e,t)});function $q(e){return vw(Yw,e)}var Qw=R("ZodBase64URL",(e,t)=>{N0.init(e,t),mt.init(e,t)});function _q(e){return ww(Qw,e)}var Xw=R("ZodE164",(e,t)=>{C0.init(e,t),mt.init(e,t)});function Sq(e){return kw(Xw,e)}var gN=R("ZodCreditCard",(e,t)=>{P0.init(e,t),mt.init(e,t)});function xq(e){return PA(gN,e)}var hN=R("ZodIBAN",(e,t)=>{D0.init(e,t),mt.init(e,t)});function Eq(e){return DA(hN,e)}var ek=R("ZodJWT",(e,t)=>{O0.init(e,t),mt.init(e,t)});function Tq(e){return $w(ek,e)}var ad=R("ZodCustomStringFormat",(e,t)=>{M0.init(e,t),mt.init(e,t)});function Iq(e,t,n={}){return Xu(ad,e,t,n)}function Aq(e){return Xu(ad,"hostname",or.hostname,e)}function Rq(e){return Xu(ad,"hex",or.hex,e)}function Nq(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=or[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return Xu(ad,i,r,t)}var cd=R("ZodNumber",(e,t)=>{Fv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>vR(e,n,i,r),e.isFinite=!0},G.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=yn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=yn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=yn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>yn(e).format??null},{gt(e,t){return this.check(fo(e,t))},gte(e,t){return this.check(Vr(e,t))},min(e,t){return this.check(Vr(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(Gr(e,t))},max(e,t){return this.check(Gr(e,t))},int(e){return this.check(Ow(e))},safe(e){return this.check(Ow(e))},positive(e){return this.check(fo(0,e))},nonnegative(e){return this.check(Vr(0,e))},negative(e){return this.check(po(0,e))},nonpositive(e){return this.check(Gr(0,e))},multipleOf(e,t){return this.check(zs(e,t))},step(e,t){return this.check(zs(e,t))},finite(){return this}}));function yN(e){return MA(cd,e)}var Nc=R("ZodNumberFormat",(e,t)=>{L0.init(e,t),cd.init(e,t)});function Ow(e){return FA(Nc,e)}function Cq(e){return UA(Nc,e)}function Pq(e){return jA(Nc,e)}function Dq(e){return zA(Nc,e)}function Oq(e){return GA(Nc,e)}var ld=R("ZodBoolean",(e,t)=>{Gm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>wR(e,n,i,r)});function bN(e){return VA(ld,e)}var ud=R("ZodBigInt",(e,t)=>{Uv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>kR(e,n,i,r)},G.derived({minValue:e=>yn(e).minimum??null,maxValue:e=>yn(e).maximum??null,format:e=>yn(e).format??null},{gte(e,t){return this.check(Vr(e,t))},min(e,t){return this.check(Vr(e,t))},gt(e,t){return this.check(fo(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(Gr(e,t))},max(e,t){return this.check(Gr(e,t))},positive(e){return this.check(fo(BigInt(0),e))},negative(e){return this.check(po(BigInt(0),e))},nonpositive(e){return this.check(Gr(BigInt(0),e))},nonnegative(e){return this.check(Vr(BigInt(0),e))},multipleOf(e,t){return this.check(zs(e,t))}}));function Mq(e){return qA(ud,e)}var tk=R("ZodBigIntFormat",(e,t)=>{F0.init(e,t),ud.init(e,t)});function Lq(e){return HA(tk,e)}function Fq(e){return KA(tk,e)}var vN=R("ZodSymbol",(e,t)=>{U0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>$R(e,n,i,r)});function Uq(e){return JA(vN,e)}var wN=R("ZodUndefined",(e,t)=>{j0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>SR(e,n,i,r)});function jq(e){return ZA(wN,e)}var kN=R("ZodNull",(e,t)=>{z0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_R(e,n,i,r)});function $N(e){return YA(kN,e)}var _N=R("ZodAny",(e,t)=>{G0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>TR(e,n,i,r)});function zq(){return QA(_N)}var SN=R("ZodUnknown",(e,t)=>{V0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>IR(e,n,i,r)});function Ac(){return XA(SN)}var xN=R("ZodNever",(e,t)=>{B0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ER(e,n,i,r)});function nk(e){return eR(xN,e)}var EN=R("ZodVoid",(e,t)=>{q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>xR(e,n,i,r)});function Gq(e){return tR(EN,e)}var sg=R("ZodDate",(e,t)=>{W0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>AR(e,n,i,r),e.min=(n,i)=>e.check(Vr(n,i)),e.max=(n,i)=>e.check(Gr(n,i))},G.derived({minDate:e=>{let{minimum:t}=yn(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=yn(e);return t?new Date(t):null}},{}));function Vq(e){return nR(sg,e)}var TN=R("ZodArray",(e,t)=>{Ws(),H0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>zR(e,n,i,r),e.element=t.element},{min(e,t){return this.check(Jo(e,t))},nonempty(e){return this.check(Jo(1,e))},max(e,t){return this.check(Tc(e,t))},length(e,t){return this.check(Ic(e,t))},unwrap(){return this.element}});function ag(e,t){return sR(TN,e,t)}function Bq(e){let t=e._zod.def.shape;return rk(Object.keys(t))}var cg=R("ZodObject",(e,t)=>{Ws(),K0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>GR(e,n,i,r),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return rk(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(G.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},loose(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},strict(){return this.clone(G.mergeDefs(this._zod.def,{catchall:nk()}))},strip(){return this.clone(G.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(ug,this,e[0])},exactPartial(...e){return G.partial(ok,this,e[0],"exactPartial")},required(...e){return G.required(sk,this,e[0])}});function qq(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new cg(n)}function Wq(e,t){return new cg({type:"object",shape:e,catchall:nk(),...G.normalizeParams(t)})}function Hq(e,t){return new cg({type:"object",shape:e,catchall:Ac(),...G.normalizeParams(t)})}var lg=R("ZodUnion",(e,t)=>{Vm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Aw(e,n,i,r),e.options=t.options});function dd(e,t){return new lg({type:"union",options:e,...G.normalizeParams(t)})}var IN=R("ZodXor",(e,t)=>{lg.init(e,t),J0.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Aw(e,n,i,r),e.options=t.options});function Kq(e,t){return new IN({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var AN=R("ZodDiscriminatedUnion",(e,t)=>{lg.init(e,t),Y0.init(e,t)});function Jq(e,t,n){return new AN({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var RN=R("ZodIntersection",(e,t)=>{Q0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>VR(e,n,i,r)});function NN(e,t){return new RN({type:"intersection",left:e,right:t})}var CN=R("ZodTuple",(e,t)=>{Ws(),jv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>BR(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new ug({type:"optional",innerType:t}))})}});function PN(e,t,n){let i=t instanceof Ce,r=i?n:t,o=i?t:null;return new CN({type:"tuple",items:e,rest:o,...G.normalizeParams(r)})}var id=R("ZodRecord",(e,t)=>{Ws(),X0.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>qR(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function DN(e,t,n){return!t||!t._zod?new id({type:"record",keyType:rg(),valueType:e,...G.normalizeParams(t)}):new id({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function Zq(e,t,n){return new id({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function Yq(e,t,n){return new id({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var ON=R("ZodMap",(e,t)=>{Ws(),eA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>UR(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Gs(...n)),e.size=(...n)=>e.check(Ec(...n))});function Qq(e,t,n){return new ON({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var MN=R("ZodSet",(e,t)=>{Ws(),tA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>jR(e,n,i,r),e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Gs(...n)),e.size=(...n)=>e.check(Ec(...n))});function Xq(e,t){return new MN({type:"set",valueType:e,...G.normalizeParams(t)})}var od=R("ZodEnum",(e,t)=>{nA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,r,o)=>RR(e,i,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new od({...t,checks:[],...G.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new od({...t,checks:[],...G.normalizeParams(r),entries:o})}});function rk(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new od({type:"enum",entries:n,...G.normalizeParams(t)})}function e2(e,t){return new od({type:"enum",entries:e,...G.normalizeParams(t)})}var LN=R("ZodLiteral",(e,t)=>{rA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>NR(e,n,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function t2(e,t){return new LN({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var FN=R("ZodFile",(e,t)=>{iA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>DR(e,n,i,r),e.min=(n,i)=>e.check(mo(n,i)),e.max=(n,i)=>e.check(Gs(n,i)),e.mime=(n,i)=>e.check(Hu(Array.isArray(n)?n:[n],i))});function n2(e){return aR(FN,e)}var UN=R("ZodTransform",(e,t)=>{Ws(),oA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>FR(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(G.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function ik(e){return new UN({type:"transform",transform:e})}var ug=R("ZodOptional",(e,t)=>{zv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new ug({type:"optional",innerType:e})}var ok=R("ZodExactOptional",(e,t)=>{sA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Rw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function jN(e){return new ok({type:"optional",innerType:e})}var zN=R("ZodNullable",(e,t)=>{aA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>WR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new zN({type:"nullable",innerType:e})}function r2(e){return Rc(ig(e))}var GN=R("ZodDefault",(e,t)=>{cA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>JR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VN(e,t){return new GN({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var BN=R("ZodPrefault",(e,t)=>{lA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ZR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function qN(e,t){return new BN({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var sk=R("ZodNonOptional",(e,t)=>{uA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>HR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function WN(e,t){return new sk({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var HN=R("ZodSuccess",(e,t)=>{dA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>OR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function i2(e){return new HN({type:"success",innerType:e})}var KN=R("ZodCatch",(e,t)=>{pA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>YR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function JN(e,t){return new KN({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var ZN=R("ZodNaN",(e,t)=>{fA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>CR(e,n,i,r)});function o2(e){return iR(ZN,e)}var dg=R("ZodPipe",(e,t)=>{Gv.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>QR(e,n,i,r),e.in=t.in,e.out=t.out});function Mw(e,t){return new dg({type:"pipe",in:e,out:t})}var pg=R("ZodCodec",(e,t)=>{dg.init(e,t),Bm.init(e,t)});function s2(e,t,n){return new pg({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function a2(e){let t=e._zod.def;return new pg({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var YN=R("ZodPreprocess",(e,t)=>{dg.init(e,t),mA.init(e,t)}),QN=R("ZodReadonly",(e,t)=>{gA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>XR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function XN(e){return new QN({type:"readonly",innerType:e})}var eC=R("ZodTemplateLiteral",(e,t)=>{hA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>PR(e,n,i,r)});function c2(e,t){return new eC({type:"template_literal",parts:e,...G.normalizeParams(t)})}var tC=R("ZodLazy",(e,t)=>{qm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>tN(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function nC(e){return new tC({type:"lazy",getter:e})}var rC=R("ZodPromise",(e,t)=>{bA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>eN(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function l2(e){return new rC({type:"promise",innerType:e})}var iC=R("ZodFunction",(e,t)=>{yA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>LR(e,n,i,r)});function u2(e){return new iC({type:"function",input:Array.isArray(e?.input)?PN(e?.input):e?.input??ag(Ac()),output:e?.output??Ac()})}var fg=R("ZodCustom",(e,t)=>{vA.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,i,r)=>MR(e,n,i,r)}),oC=R("ZodProperties",(e,t)=>{Ws(),wA.init(e,t),Le.init(e,t)});function sC(e,t){return oR(oC,e,t)}function d2(e){let t=new ht({check:"custom"});return t._zod.check=e,t}function p2(e,t){return cR(fg,e??(()=>!0),t)}function aC(e,t={}){return lR(fg,e,t)}function cC(e,t){return uR(e,t)}var f2=dR,m2=pR,lC=R("ZodInstanceOf",(e,t)=>{fg.init(e,t)},{properties(e,t){return this.check(sC(e,t))}});function g2(e,t={}){let n=new lC({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var h2=(...e)=>fR({Codec:pg,Boolean:ld,String:sd},...e);function y2(e){let t=nC(()=>dd([rg(e),yN(),bN(),$N(),ag(t),DN(rg(),t)]));return t}function b2(e,t){return new YN({type:"pipe",in:ik(e),out:t})}var Ofe={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 Mfe(e){zt({customError:e})}function Lfe(){return zt().customError}var uC;uC||(uC={});var mg={};_r(mg,{ZodISODate:()=>Ks,ZodISODateTime:()=>Hs,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,date:()=>Ufe,datetime:()=>Ffe,duration:()=>zfe,time:()=>jfe});function Ffe(e){return Qm(Hs,e)}function Ufe(e){return Xm(Ks,e)}function jfe(e){return eg(Js,e)}function zfe(e){return tg(Zs,e)}var oe={...pd,...Pw,iso:mg},Gfe=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"]);function Vfe(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function v2(e,t){return e.map((n,i)=>ii).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let o=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&o.length=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let s of o){let a=t.keySchema.safeParse(s);a.success||i.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function dC(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let s of e){let a=dC(s,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let o of i){let s=dC(e[o],t);if(s===null)return null;r.push(`${o.length}:${o}=${s}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}var Hfe=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),Kfe=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function gg(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(gg):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>Hfe.has(t)?gg(n):!Kfe.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(gg))}function w2(e){return e===1?"element":"elements"}function Jfe(e,t){return oe.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let o=new Map;for(let s=0;s=s)break;at.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${w2(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}function k2(e,t){if(e!==!1)return e===void 0||e===!0?oe.any():ar(e,t)}var Zfe=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function $2(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return oe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return oe.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=qfe(r,t),s=ar(o,t);return t.refs.set(r,s),t.processing.delete(r),s}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return oe.null();if(r.length===0)return oe.never();if(r.length===1)return oe.literal(r[0]);if(r.every(s=>typeof s=="string"))return oe.enum(r);let o=r.map(s=>oe.literal(s));return o.length<2?o[0]:oe.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return oe.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...e,type:o};return $2(s,t)});return r.length===0?oe.never():r.length===1?r[0]:oe.union(r)}if(!n)return oe.any();let i;switch(n){case"string":{let r=oe.string();if(e.format){let o=e.format;o==="email"?r=r.check(oe.email()):o==="uri"||o==="uri-reference"?r=r.check(oe.url()):o==="uuid"||o==="guid"?r=r.check(oe.uuid()):o==="date-time"?r=r.check(oe.iso.datetime({offset:!0})):o==="date"?r=r.check(oe.iso.date()):o==="time"?r=r.check(oe.regex(Zfe)):o==="duration"?r=r.check(oe.iso.duration()):o==="hostname"?r=r.check(oe.hostname()):o==="ipv4"?r=r.check(oe.ipv4()):o==="ipv6"?r=r.check(oe.ipv6()):o==="mac"?r=r.check(oe.mac()):o==="cidr"?r=r.check(oe.cidrv4()):o==="cidr-v6"?r=r.check(oe.cidrv6()):o==="base64"?r=r.check(oe.base64()):o==="base64url"?r=r.check(oe.base64url()):o==="e164"?r=r.check(oe.e164()):o==="credit_card"?r=r.check(oe.creditCard()):o==="iban"?r=r.check(oe.iban()):o==="jwt"?r=r.check(oe.jwt()):o==="emoji"?r=r.check(oe.emoji()):o==="nanoid"?r=r.check(oe.nanoid()):o==="cuid"?r=r.check(oe.cuid()):o==="cuid2"?r=r.check(oe.cuid2()):o==="ulid"?r=r.check(oe.ulid()):o==="xid"?r=r.check(oe.xid()):o==="ksuid"&&(r=r.check(oe.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?oe.number().int():oe.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=oe.boolean();break}case"null":{i=oe.null();break}case"object":{let r={},o=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?ar(e.additionalProperties,t):void 0;for(let[d,p]of Object.entries(o)){let f=ar(p,t);Sn(r,d,s.has(d)?f:f.optional())}if(e.patternProperties){let d=e.patternProperties,p=Object.keys(d),f=[];for(let g of p){let h=ar(d[g],t),b=oe.string().regex(new RegExp(g));f.push(oe.looseRecord(b,h))}let m=[];if(Object.keys(r).length>0&&m.push(oe.object(r).passthrough()),m.push(...f),m.length===0)i=oe.object({}).passthrough();else if(m.length===1)i=m[0];else{let g=oe.intersection(m[0],m[1]);for(let h=2;hnew RegExp(y)),b=i;i=i.check(y=>{if(!ci(y.value))return;let w=[];for(let k of Object.keys(y.value))g.includes(k)||h.some(_=>_.test(k))||w.push(k);w.length&&y.issues.push({code:"unrecognized_keys",keys:w,input:y.value,inst:b})})}}else{let d=oe.object(r);e.additionalProperties===!1?i=d.strict():a?i=d.catchall(a):i=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=ar(p,t)}i=Wfe(i,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let s=typeof e.minItems=="number"?e.minItems:0,a=r.map(d=>ar(d,t)),c=v2(a,s),l=Array.isArray(o)?void 0:k2(o,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>ar(d,t)),c=v2(a,s),l=k2(e.additionalItems,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(o!==void 0){let s=ar(o,t),a=oe.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),i=a}else i=oe.array(oe.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=Jfe(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ar(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}function ar(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n=$2(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>ar(l,t)),c=oe.union(a);n=i?oe.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>ar(l,t)),c=oe.xor(a);n=i?oe.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:oe.any();else{let a=i?n:ar(e.allOf[0],t),c=i?0:1;for(let l=c;l0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function _2(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=Vfe(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Dn};return ar(n,o)}var S2=Symbol("z.visit/resolving");function hg(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},i=new Map;function r(s){let a=i.get(s);if(a===S2)return new qm({type:"lazy",getter:()=>i.get(s)});if(a!==void 0)return a;i.set(s,S2);let c=o(s),l=n(c,c!==s);return i.set(s,l),l}function o(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let l=a.shape,u=Object.keys(l),d=!1,p={};for(let m of u){let g=r(l[m]);g!==l[m]&&(d=!0),p[m]=g}let f=a.catchall;return a.catchall&&(f=r(a.catchall),f!==a.catchall&&(d=!0)),d?ot(s,{...a,shape:p,catchall:f}):s}case"array":{let l=r(a.element);return l===a.element?s:ot(s,{...a,element:l})}case"tuple":{let l=a.items,u=!1,d=[];for(let f of l){let m=r(f);m!==f&&(u=!0),d.push(m)}let p=a.rest;return a.rest&&(p=r(a.rest),p!==a.rest&&(u=!0)),u?ot(s,{...a,items:d,rest:p}):s}case"record":case"map":{let l=r(a.keyType),u=r(a.valueType);return l===a.keyType&&u===a.valueType?s:ot(s,{...a,keyType:l,valueType:u})}case"set":{let l=r(a.valueType);return l===a.valueType?s:ot(s,{...a,valueType:l})}case"union":{let l=a.options,u=!1,d=[];for(let p of l){let f=r(p);f!==p&&(u=!0),d.push(f)}return u?ot(s,{...a,options:d}):s}case"intersection":{let l=r(a.left),u=r(a.right);return l===a.left&&u===a.right?s:ot(s,{...a,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=r(a.innerType);return l===a.innerType?s:ot(s,{...a,innerType:l})}case"pipe":{let l=r(a.in),u=r(a.out);return l===a.in&&u===a.out?s:ot(s,{...a,in:l,out:u})}case"function":{let l=r(a.input),u=r(a.output);return l===a.input&&u===a.output?s:ot(s,{...a,input:l,output:u})}case"lazy":{let l=a.getter,{_cachedInner:u,...d}=a;return ot(s,{...d,getter:()=>r(l())})}case"properties":{let l=a.shape,u=!1,d={};for(let p of Reflect.ownKeys(l)){let f=r(l[p]);f!==l[p]&&(u=!0),d[p]=f}return u?ot(s,{...a,shape:d}):s}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return r(e)}function x2(e){return hg(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:dd(n.options)}})}function Yfe(e,t){if(!t?.length)return e;let n=e._zod.def;return ot(e,Fi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function E2(e){return Yfe(e.out,e.checks)}function Qfe(e){return e.in._zod.traits.has("$ZodTransform")?E2(e):e.in}function T2(e){return hg(e,{pipe:t=>Qfe(t._zod.def),default:(t,n)=>n?Rc(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function I2(e){return hg(e,{pipe:t=>E2(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var pC={};_r(pC,{bigint:()=>nme,boolean:()=>tme,date:()=>rme,number:()=>eme,string:()=>Xfe});function Xfe(e){return NA(sd,e)}function eme(e){return LA(cd,e)}function tme(e){return BA(ld,e)}function nme(e){return WA(ud,e)}function rme(e){return rR(sg,e)}var A2=U.enum(["npm","pypi","go","cargo","maven","rubygems","nuget","packagist","hex","pub","swift","cocoapods","opam","conan","vcpkg","arduino"]),ime=U.string().trim().min(1),ome=U.enum(["low","medium","high","xhigh"]);var fC=U.object({mode:U.enum(["auto","approve"]).default("approve"),maxAutoRisk:U.enum(["none","low","medium","high"]).default("medium"),watchBranches:U.array(U.string()).default(["main","master","develop"]),ecosystems:U.array(A2).default([...A2.options]),ignore:U.array(U.string()).default([]),alwaysApprove:U.array(U.string()).default([]),triggerOn:U.object({major:U.boolean().default(!0),minor:U.boolean().default(!0),patch:U.boolean().default(!1),transitive:U.boolean().default(!1),dev:U.boolean().default(!0)}).prefault({}),evidence:U.object({githubReleases:U.boolean().default(!0),changelog:U.boolean().default(!0),typeSurface:U.boolean().default(!0),openapi:U.boolean().default(!0),openapiSpecs:U.array(U.string()).default([]),protobuf:U.boolean().default(!0),protobufSpecs:U.array(U.string()).default([]),graphql:U.boolean().default(!0),graphqlSchemas:U.array(U.string()).default([]),maxReleases:U.number().int().min(1).max(100).default(25)}).prefault({}),rationale:U.object({security:U.boolean().default(!0),maintenance:U.boolean().default(!0),summary:U.boolean().default(!0)}).prefault({}),licenses:U.object({enabled:U.boolean().default(!1),allow:U.array(U.string()).default([]),deny:U.array(U.string()).default([]),requireDeclared:U.boolean().default(!1)}).prefault({}),guardrails:U.object({protectedPaths:U.array(U.string()).default([".github/workflows/**","**/*.lock","infra/**","terraform/**","**/secrets/**"]),maxFilesChanged:U.number().int().min(1).default(50),maxDependenciesPerRun:U.number().int().min(1).default(10),requireEvidence:U.boolean().default(!0),minConfidence:U.enum(["low","medium","high"]).default("medium"),experimentalDispatchBelowMinConfidence:U.boolean().default(!1),forbidTestWeakening:U.boolean().default(!0)}).prefault({}),remediation:U.object({commitGranularity:U.enum(["per-breaking-change","per-dependency","single"]).default("per-breaking-change"),branchPrefix:U.string().default("drift/"),draftPr:U.boolean().optional(),model:U.string().optional(),agent:U.object({provider:ime.default("auto"),model:U.string().optional(),effort:ome.optional(),fast:U.boolean().default(!1),timeoutSeconds:U.number().int().min(30).max(1440*60).default(1800)}).prefault({}),customInstructions:U.string().default(""),awaitCompletion:U.object({enabled:U.boolean().default(!1),timeoutMinutes:U.number().int().min(1).max(360).default(20),pollIntervalSeconds:U.number().int().min(5).max(300).default(30)}).prefault({}),communityRecipes:U.boolean().default(!1),fixPlans:U.object({enabled:U.boolean().default(!1),minCoverage:U.number().min(0).max(1).default(.5),autoApply:U.enum(["review","proven","verified"]).default("review"),cache:U.boolean().default(!0)}).prefault({})}).prefault({}),verification:U.object({behavioural:U.object({enabled:U.boolean().default(!1),sandbox:U.literal("required").default("required"),maxSymbols:U.number().int().min(1).max(100).default(10),maxCasesPerSymbol:U.number().int().min(1).max(100).default(20),timeoutSeconds:U.number().int().min(1).max(1800).default(120),network:U.boolean().default(!1),memoryMb:U.number().int().min(128).max(16384).default(1024),cpuLimit:U.number().min(.1).max(32).default(1),retainArtifacts:U.boolean().default(!1)}).prefault({})}).prefault({}),telemetry:U.object({enabled:U.boolean().default(!1),endpoint:U.string().url().optional(),installationId:U.string().optional(),rotationSalt:U.string().optional(),retentionDays:U.number().int().min(1).max(730).default(180)}).prefault({}),pullRequest:U.object({enabled:U.boolean().default(!0),confirm:U.enum(["ask","never"]).default("ask"),base:U.enum(["branched-from","default-branch"]).default("branched-from"),draft:U.boolean().optional(),labels:U.array(U.string()).default([]),reviewers:U.array(U.string()).default([]),branchTemplate:U.string().default("{prefix}upgrade-{summary}-{date}"),titleTemplate:U.string().default("chore(deps): upgrade {summary}"),coAuthor:U.boolean().default(!0)}).prefault({}),llm:U.object({enabled:U.boolean().default(!1),provider:U.enum(["anthropic"]).default("anthropic"),model:U.string().default("claude-opus-5"),effort:U.enum(["low","medium","high","xhigh","max"]).default("medium"),apiKeyEnv:U.string().default("ANTHROPIC_API_KEY")}).prefault({}),codeScanning:U.object({enabled:U.boolean().default(!0),includeInformational:U.boolean().default(!1),granularity:U.enum(["package","breakingChange","affectedSite"]).default("package"),createIssuesPerAlert:U.boolean().default(!1)}).prefault({}),issueCreation:U.object({default:U.enum(["issue","branch","both"]).default("issue"),granularity:U.enum(["package","change"]).default("package"),assignees:U.array(U.string()).default([])}).prefault({}),outdated:U.object({enabled:U.boolean().default(!1)}).prefault({}),check:U.object({enabled:U.boolean().default(!1)}).prefault({}),tools:U.object({autoInstall:U.boolean().default(!0)}).prefault({}),verify:U.object({enabled:U.boolean().default(!0),checks:U.array(U.enum(["typecheck","build","test"])).default(["typecheck","build","test"]),timeoutMs:U.number().int().positive().default(15*6e4),generatedSourceGlobs:U.array(U.string()).default([])}).prefault({})}),fd=fC.parse({});function R2(e){return e.pullRequest.draft??e.remediation.draftPr??!0}var ak={none:0,low:1,medium:2,high:3};function mC(e,t){return ak[e]<=ak[t]}function N2(e,t){return ak[e]-ak[t]}var sme=[".github/drift.yml",".github/drift.yaml","drift.yml","drift.yaml"];function ame(e,t=null){let n=[];if(!e.trim())return{config:fd,path:t,problems:n};let i;try{i=(0,C2.parse)(e)}catch(c){return n.push(`Could not parse ${t??"config"} as YAML: ${c.message}`),{config:fd,path:t,problems:n}}if(i==null)return{config:fd,path:t,problems:n};let r=lme(i),o=cme(i),s=fC.safeParse(i);if(!s.success){for(let c of s.error.issues){let l=c.path.length?c.path.join("."):"(root)";n.push(`${l}: ${c.message}`)}return n.push("Falling back to Drift defaults (mode: approve)."),{config:fd,path:t,problems:n}}let a=s.data;return r&&!o&&(a.remediation.agent={...a.remediation.agent,provider:"copilot-cloud",model:r},n.push("`remediation.model` is deprecated and now treated as `remediation.agent.model` for `copilot-cloud`. Use `remediation.agent` for new configuration.")),{config:a,path:t,problems:n}}function cme(e){if(!ck(e))return!1;let t=e.remediation;return ck(t)&&t.agent!==void 0}function lme(e){if(!ck(e))return null;let t=e.remediation;return ck(t)&&typeof t.model=="string"&&t.model.trim()?t.model:null}function ck(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}async function lk(e){for(let t of sme){let n;try{n=await e(t)}catch{continue}if(n!==null)return ame(n,t)}return{config:fd,path:null,problems:[]}}var $4=require("node:zlib");function Ys(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}function uk(e,t,n,i){if(typeof n!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(t)?t.reverse().reduce((r,o)=>uk.bind(null,e,o,r,i),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((r,o)=>o.hook.bind(null,r,i),n)():n(i))}function P2(e,t,n,i){let r=i;e.registry[n]||(e.registry[n]=[]),t==="before"&&(i=(o,s)=>Promise.resolve().then(r.bind(null,s)).then(o.bind(null,s))),t==="after"&&(i=(o,s)=>{let a;return Promise.resolve().then(o.bind(null,s)).then(c=>(a=c,r(a,s))).then(()=>a)}),t==="error"&&(i=(o,s)=>Promise.resolve().then(o.bind(null,s)).catch(a=>r(a,s))),e.registry[n].push({hook:i,orig:r})}function D2(e,t,n){if(!e.registry[t])return;let i=e.registry[t].map(r=>r.orig).indexOf(n);i!==-1&&e.registry[t].splice(i,1)}var O2=Function.bind,M2=O2.bind(O2);function L2(e,t,n){let i=M2(D2,null).apply(null,n?[t,n]:[t]);e.api={remove:i},e.remove=i,["before","error","after","wrap"].forEach(r=>{let o=n?[t,r,n]:[t,r];e[r]=e.api[r]=M2(P2,null).apply(null,o)})}function ume(){let e=Symbol("Singular"),t={registry:{}},n=uk.bind(null,t,e);return L2(n,t,e),n}function dme(){let e={registry:{}},t=uk.bind(null,e);return L2(t,e),t}var F2={Singular:ume,Collection:dme};var pme="0.0.0-development",fme=`octokit-endpoint.js/${pme} ${Ys()}`,mme={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":fme},mediaType:{format:""}};function gme(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function hme(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function z2(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(i=>{hme(t[i])?i in e?n[i]=z2(e[i],t[i]):Object.assign(n,{[i]:t[i]}):Object.assign(n,{[i]:t[i]})}),n}function U2(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function hC(e,t,n){if(typeof t=="string"){let[r,o]=t.split(" ");n=Object.assign(o?{method:r,url:o}:{url:r},n)}else n=Object.assign({},t);n.headers=gme(n.headers),U2(n),U2(n.headers);let i=z2(e||{},n);return n.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(i.mediaType.previews=e.mediaType.previews.filter(r=>!i.mediaType.previews.includes(r)).concat(i.mediaType.previews)),i.mediaType.previews=(i.mediaType.previews||[]).map(r=>r.replace(/-preview/,""))),i}function yme(e,t){let n=/\?/.test(e)?"&":"?",i=Object.keys(t);return i.length===0?e:e+n+i.map(r=>r==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${r}=${encodeURIComponent(t[r])}`).join("&")}var bme=/\{[^{}}]+\}/g;function vme(e){return e.replace(/(?:^\W+)|(?:(?n.concat(i),[]):[]}function j2(e,t){let n={__proto__:null};for(let i of Object.keys(e))t.indexOf(i)===-1&&(n[i]=e[i]);return n}function G2(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function gd(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function yg(e,t,n){return t=e==="+"||e==="#"?G2(t):gd(t),n?gd(n)+"="+t:t}function md(e){return e!=null}function gC(e){return e===";"||e==="&"||e==="?"}function kme(e,t,n,i){var r=e[n],o=[];if(md(r)&&r!=="")if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"||typeof r=="boolean")r=r.toString(),i&&i!=="*"&&(r=r.substring(0,parseInt(i,10))),o.push(yg(t,r,gC(t)?n:""));else if(i==="*")Array.isArray(r)?r.filter(md).forEach(function(s){o.push(yg(t,s,gC(t)?n:""))}):Object.keys(r).forEach(function(s){md(r[s])&&o.push(yg(t,r[s],s))});else{let s=[];Array.isArray(r)?r.filter(md).forEach(function(a){s.push(yg(t,a))}):Object.keys(r).forEach(function(a){md(r[a])&&(s.push(gd(a)),s.push(yg(t,r[a].toString())))}),gC(t)?o.push(gd(n)+"="+s.join(",")):s.length!==0&&o.push(s.join(","))}else t===";"?md(r)&&o.push(gd(n)):r===""&&(t==="&"||t==="?")?o.push(gd(n)+"="):r===""&&o.push("");return o}function $me(e){return{expand:_me.bind(null,e)}}function _me(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,r,o){if(r){let a="",c=[];if(n.indexOf(r.charAt(0))!==-1&&(a=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(l){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(l);c.push(kme(t,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var s=",";return a==="?"?s="&":a!=="#"&&(s=a),(c.length!==0?a:"")+c.join(s)}else return c.join(",")}else return G2(o)}),e==="/"?e:e.replace(/\/$/,"")}function V2(e){let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},e.headers),r,o=j2(e,["method","baseUrl","url","headers","request","mediaType"]),s=wme(n);n=$me(n).expand(o),/^http/.test(n)||(n=e.baseUrl+n);let a=Object.keys(e).filter(u=>s.includes(u)).concat("baseUrl"),c=j2(o,a);if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=i.accept.match(/(?{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=yme(n,c):"data"in c?r=c.data:Object.keys(c).length&&(r=c),!i["content-type"]&&typeof r<"u"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof r>"u"&&(r=""),Object.assign({method:t,url:n,headers:i},typeof r<"u"?{body:r}:null,e.request?{request:e.request}:null)}function Sme(e,t,n){return V2(hC(e,t,n))}function B2(e,t){let n=hC(e,t),i=Sme.bind(null,n);return Object.assign(i,{DEFAULTS:n,defaults:B2.bind(null,n),merge:hC.bind(null,n),parse:V2})}var q2=B2(null,mme);var H2=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function K2(e,t){let n=t?.comma===!0?Tme:65536,i=e.length,r=bC(e,t?.start??0,i),o=r;r=yC(e,r,i,n);let s=vC(e,o,r),a=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:a,index:r,parameters:new H2}:Ime(e,a,r,i,n)}var J2=32,Z2=9,Y2=59,xme=61,W2=34,Eme=92,Tme=44;function Ime(e,t,n,i,r){let o=new H2;e:for(;nt;){let i=e.charCodeAt(n-1);if(i!==J2&&i!==Z2)break;n--}return n}var Ame=/^-?\d+$/,pk=/^-?\d+n+$/,Qs=JSON.stringify,wC=JSON.parse,n4=/^-?\d+n$/,Q2=/([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g,X2=/([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g,kC=e=>e===void 0||typeof e=="function"||typeof e=="symbol",$C=e=>e!==null&&typeof e=="object"&&e.constructor&&e.constructor.name==="RawJSON",Rme=(e,t,n)=>{let i="";typeof n=="number"?i=" ".repeat(Math.min(10,Math.max(0,Math.floor(n)))):typeof n=="string"&&(i=n.slice(0,10));let r=typeof t=="function",o=Array.isArray(t)?new Set(t.map(String)):null,s=(m,g,h)=>(h!==null&&typeof h=="object"&&typeof h.toJSON=="function"&&(h=h.toJSON(g)),typeof h=="string"&&pk.test(h)?h+"n":typeof h=="bigint"?"rawJSON"in JSON?JSON.rawJSON(h.toString()):h.toString()+"n":(r&&(h=t.call(m,g,h)),h!==null&&typeof h=="object"&&(h instanceof Number||h instanceof String||h instanceof Boolean)&&(h=h.valueOf()),h)),a=s({"":e},"",e);if(kC(a))return;let c=a===null||typeof a!="object",l=$C(a);if(c||l)return Qs(a);let u=[],d=0,p=[{parent:{"":a},key:"",val:a,isArray:Array.isArray(a),keys:Array.isArray(a)?null:Object.keys(a),index:0,first:!0}],f=new WeakSet([a]);for(;p.length>0;){let m=p[p.length-1];m.index===0&&(u.push(m.isArray?"[":"{"),d++);let g=!1;if(m.isArray)if(m.index=m.keys.length&&p[p.length-1]===m&&(g=!0)}g&&(d--,!m.first&&i&&u.push(` -`+i.repeat(d)),u.push(m.isArray?"]":"}"),f.delete(m.val),p.pop())}return u.join("")},r4=(e,t,n)=>{try{return"rawJSON"in JSON?Qs(e,(a,c)=>typeof c=="bigint"?JSON.rawJSON(c.toString()):typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n):e?Qs(e,(a,c)=>typeof c=="string"&&pk.test(c)||typeof c=="bigint"?c.toString()+"n":typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n).replace(Q2,"$1$2$3").replace(X2,"$1$2$3"):Qs(e,t,n)}catch(i){if(i instanceof RangeError){let r=Rme(e,t,n);return r===void 0?void 0:"rawJSON"in JSON?r:r.replace(Q2,"$1$2$3").replace(X2,"$1$2$3")}throw i}},dk=new Map,Nme=()=>{let e=JSON.parse.toString();if(dk.has(e))return dk.get(e);try{let t=JSON.parse("1",(n,i,r)=>!!r?.source&&r.source==="1");return dk.set(e,t),t}catch{return dk.set(e,!1),!1}},Cme=(e,t,n,i)=>typeof t=="string"&&n4.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&pk.test(t)?t.slice(0,-1):typeof i=="function"?i(e,t,n):t,Pme=(e,t)=>JSON.parse(e,(n,i,r)=>{let o=typeof i=="number",s=i>Number.MAX_SAFE_INTEGER||i{let n={"":e},i=[{parent:n,key:"",visited:!1}];for(;i.length>0;){let r=i[i.length-1];if(r.visited){let{parent:o,key:s}=r,a=o[s];typeof a=="string"&&(n4.test(a)?a=BigInt(a.slice(0,-1)):pk.test(a)&&(a=a.slice(0,-1))),typeof t=="function"&&(a=t.call(o,s,a)),a===void 0?delete o[s]:o[s]=a,i.pop()}else{r.visited=!0;let o=r.parent[r.key];if(o!==null&&typeof o=="object"){let a=Object.keys(o);for(let c=a.length-1;c>=0;c--)i.push({parent:o,key:a[c],visited:!1})}}}return n[""]},t4=e=>e.replace(Dme,(t,n,i,r)=>{let o=t[0]==='"';if(o&&Ome.test(t))return t.substring(0,t.length-1)+'n"';let a=i||r,c=n&&(n.length{if(!e)return wC(e,t);try{if(Nme())return Pme(e,t);let n=t4(e);return wC(n,(i,r,o)=>Cme(i,r,o,t))}catch(n){if(n instanceof RangeError){let i=t4(e),r=wC(i);return Mme(r,t)}throw n}};var Cc=class extends Error{name;status;request;response;constructor(t,n,i){super(t,{cause:i.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in i&&(this.response=i.response);let r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/(?"";async function a4(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let n=e.request?.log||console,i=e.request?.parseSuccessResponseBody!==!1,r=Ume(e.body)||Array.isArray(e.body)?r4(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([d,p])=>[d,String(p)])),s;try{s=await t(e.url,{method:e.method,body:r,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(d){let p="Unknown Error";if(d instanceof Error){if(d.name==="AbortError")throw d.status=500,d;p=d.message,d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?p=d.cause.message:typeof d.cause=="string"&&(p=d.cause))}let f=new Cc(p,500,{request:e});throw f.cause=d,f}let a=s.status,c=s.url,l={};for(let[d,p]of s.headers)l[d]=p;let u={url:c,status:a,headers:l,data:""};if("deprecation"in l){let d=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),p=d&&d.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${p?`. See ${p}`:""}`)}if(a===204||a===205)return u;if(e.method==="HEAD"){if(a<400)return u;throw new Cc(s.statusText,a,{response:u,request:e})}if(a===304)throw u.data=await _C(s),new Cc("Not modified",a,{response:u,request:e});if(a>=400)throw u.data=await _C(s),new Cc(zme(u.data),a,{response:u,request:e});return u.data=i?await _C(s):s.body,u}async function _C(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(s4);let n=K2(t);if(jme(n)){let i="";try{return i=await e.text(),o4(i)}catch{return i}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"&&n.type!=="application/octet-stream"?e.text().catch(s4):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function jme(e){return e.type==="application/json"||e.type==="application/scim+json"}function zme(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if(typeof e=="object"&&e!==null&&"message"in e){let t=e,n="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(i=>JSON.stringify(i)).join(", ")}${n}`:`${t.message}${n}`}return`Unknown error: ${JSON.stringify(e)}`}function SC(e,t){let n=e.defaults(t);return Object.assign(function(r,o){let s=n.merge(r,o);if(!s.request||!s.request.hook)return a4(n.parse(s));let a=(c,l)=>a4(n.parse(n.merge(c,l)));return Object.assign(a,{endpoint:n,defaults:SC.bind(null,n)}),s.request.hook(a,s)},{endpoint:n,defaults:SC.bind(null,n)})}var bg=SC(q2,Fme);var Gme="0.0.0-development";function Vme(e){return`Request failed due to following response errors: +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]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}a.count>1&&e.reused==="ref"&&o(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function WB(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let i of t){if(!i||typeof i!="object")return;WB(i);let r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;let o=i.type;for(let s of Array.isArray(o)?o:[o]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var KB=new Set(["type","properties","required","additionalProperties"]),BB=["oneOf","anyOf"];function qB(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function SR(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let s in o)if(!KB.has(s))return null;t.push(o)}let n={},i=new Set;for(let o of t){for(let s in o.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let l of t){let u=l.properties?.[s]??qB(l);u!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(u))||a.push(u))}let c=a.length===1?a[0]:SR(a)??{allOf:a};Nn(n,s,c)}for(let s of o.required??[])i.add(s)}let r={type:"object",properties:n};if(i.size&&(r.required=[...i]),t.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{let o=[];for(let s of t){let a=qB(s);a&&!o.some(c=>JSON.stringify(c)===JSON.stringify(a))&&o.push(a)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}function Pfe(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let r of KB)if(r in e)return;let n=t.filter(r=>BB.some(o=>Array.isArray(r[o]))),i=null;if(!n.length)i=SR(t);else{let r=n[0],o=BB.find(c=>Array.isArray(r[c]));if(Object.keys(r).length!==1)return;let s=t.filter(c=>c!==r),a=r[o].map(c=>SR([...s,c]));if(a.some(c=>!c))return;i={[o]:a}}i&&(delete e.allOf,cg(e,i))}function Ws(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=e.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let f=e.seen.get(d),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):cg(l,m),cg(l,u),a._zod.parent===d)for(let h in l)h==="$ref"||h==="allOf"||h in u||delete l[h];if(m.$ref&&f.def)for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}let p=a._zod.parent;if(p&&p!==d){i(p);let f=e.seen.get(p);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())i(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())WB(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=a.get(u);d?d.push(l):a.set(u,[l])}for(let c of e.intersections)for(let l of a.get(c)??[])Pfe(l)}}let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}cg(r,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&r.id===o&&delete r.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Nn(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:rd(t,"input",e.processors),output:rd(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ir(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ir(i.element,n);if(i.type==="set")return ir(i.valueType,n);if(i.type==="lazy")return ir(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return ir(i.innerType,n);if(i.type==="intersection")return ir(i.left,n)||ir(i.right,n);if(i.type==="record"||i.type==="map")return ir(i.keyType,n)||ir(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ir(i.in,n)||ir(i.out,n);if(i.type==="object"){for(let r in i.shape)if(ir(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(ir(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(ir(r,n))return!0;return!!(i.rest&&ir(i.rest,n))}return!1}var xR=(e,t={})=>n=>{let i=Bs({...n,processors:t});return ut(e,i),qs(i,e),Ws(i,e)},rd=(e,t,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Bs({...r??{},target:o,io:t,processors:n});return ut(e,s),qs(s,e),Ws(s,e)};var id=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},od=(e,t,n)=>{(e[t]===void 0||n{id(e,"minimum",t),od(e,"maximum",t)},QB=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},XB=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},eq=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},tq=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},JB=(e,t)=>id(e,"minimum",t.minimum),ZB=(e,t)=>od(e,"maximum",t.maximum),YB=e=>(t,n)=>{tq(t,n.format);let[i,r]=e[n.format];id(t,"minimum",i),od(t,"maximum",r)},Dfe={greater_than:(e,t)=>id(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>od(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>QB(e,t.value),number_format:YB(Am),bigint_format:YB(Rm),min_length:JB,max_length:ZB,length_equals:(e,t)=>HB(e,t.length),min_size:JB,max_size:ZB,size_equals:(e,t)=>HB(e,t.size),string_format:(e,t)=>{tq(e,t.format),t.pattern&&XB(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>eq(e,t.mime)};function hn(e){let t={},n=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let o of i)Dfe[o._zod.def.check]?.(t,o._zod.def);let r=e._zod.bag;r.minimum!==void 0&&id(t,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&id(t,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&od(t,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&od(t,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&QB(t,r.multipleOf),r.format!==void 0&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&eq(t,r.mime);for(let o of r.patterns??[])XB(t,o);return t}var Ofe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Mfe=new Map([[Uv,CI],[Km,NI]]),nq=e=>Mfe.get(e)??e,IR=(e,t,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l,laxFormat:u}=hn(e);if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),a&&(r.format=Ofe[a]??a,r.format===""&&delete r.format,(a==="time"||u)&&delete r.format),l&&(r.contentEncoding=l),c&&c.size>0){let d=[...c].map(nq);d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},AR=(e,t,n,i)=>{let r=n,{minimum:o,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=hn(e);r.type=u?"integer":"number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(d?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),p?f?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof s=="number"&&(r.maximum=s),a){let m=new Set;for(let b of a)Number.isFinite(b)&&b!==0?m.add(Math.abs(b)):gn(e,t,r,i,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[g,...h]=m;g!==void 0&&(r.multipleOf=g),h.length&&(r.allOf=[...r.allOf??[],...h.map(b=>({multipleOf:b}))])}},RR=(e,t,n,i)=>{n.type="boolean"},CR=(e,t,n,i)=>{gn(e,t,n,i,"BigInt cannot be represented in JSON Schema")},NR=(e,t,n,i)=>{gn(e,t,n,i,"Symbols cannot be represented in JSON Schema")},PR=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},DR=(e,t,n,i)=>{gn(e,t,n,i,"Undefined cannot be represented in JSON Schema")},OR=(e,t,n,i)=>{gn(e,t,n,i,"Void cannot be represented in JSON Schema")},MR=(e,t,n,i)=>{n.not={}},LR=(e,t,n,i)=>{},FR=(e,t,n,i)=>{},UR=(e,t,n,i)=>{gn(e,t,n,i,"Date cannot be represented in JSON Schema")},jR=(e,t,n,i)=>{let r=e._zod.def,o=Au(r.entries);if(o.length===0){n.not={};return}o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},zR=(e,t,n,i)=>{let r=e._zod.def;if(r.values.length===0){n.not={};return}let o=[];for(let s of r.values)if(s===void 0){if(gn(e,t,n,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(gn(e,t,n,i,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},GR=(e,t,n,i)=>{gn(e,t,n,i,"NaN cannot be represented in JSON Schema")},VR=(e,t,n,i)=>{let r=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},BR=(e,t,n,i)=>{let r=n;r.type="string",r.format="binary",r.contentEncoding="binary";let{minimum:o,maximum:s,mime:a}=hn(e);o!==void 0&&(r.minLength=o),s!==void 0&&(r.maxLength=s),a&&(a.length===0?r.not={}:a.length===1?r.contentMediaType=a[0]:r.anyOf=a.map(c=>({contentMediaType:c})))},qR=(e,t,n,i)=>{n.type="boolean"},WR=(e,t,n,i)=>{gn(e,t,n,i,"Custom types cannot be represented in JSON Schema")},KR=(e,t,n,i)=>{gn(e,t,n,i,"Function types cannot be represented in JSON Schema")},HR=(e,t,n,i)=>{gn(e,t,n,i,"Transforms cannot be represented in JSON Schema")},JR=(e,t,n,i)=>{gn(e,t,n,i,"Map cannot be represented in JSON Schema")},ZR=(e,t,n,i)=>{gn(e,t,n,i,"Set cannot be represented in JSON Schema")},YR=(e,t,n,i)=>{let r=n,o=e._zod.def,{minimum:s,maximum:a}=hn(e);typeof s=="number"&&(r.minItems=s),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=ut(o.element,t,{...i,path:[...i.path,"items"]})};function lg(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?lg(t.out):t.type==="catch"?lg(t.innerType):e._zod.optin}var QR=(e,t,n,i)=>{let r=n,o=e._zod.def,s=o.shape;if(Object.getOwnPropertySymbols(s).length&&gn(e,t,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(let l in s)Nn(r.properties,l,ut(s[l],t,{...i,path:[...i.path,"properties",l]}));let c=[];for(let l of Object.keys(s)){let u=o.shape[l];(t.io==="input"?lg(u)===void 0:u._zod.optout===void 0)&&c.push(l)}c.length>0&&(r.required=c),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=ut(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},Mw=(e,t,n,i)=>{let r=e._zod.def,o=r.inclusive===!1,s=r.options.map((a,c)=>ut(a,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},XR=(e,t,n,i)=>{let r=e._zod.def,o=ut(r.left,t,{...i,path:[...i.path,"allOf",0]}),s=ut(r.right,t,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},eC=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((g,h)=>ut(g,t,{...i,path:[...i.path,s,h]})),l=o.rest?ut(o.rest,t,{...i,path:[...i.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,u=o.items.length;for(;u>0;){let g=o.items[u-1];if(!(t.io==="input"?lg(g)!==void 0:g._zod.optout==="optional"))break;u--}let d=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(r.prefixItems=c,p?r.items=!1:l&&(r.items=l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):t.target==="openapi-3.0"?(r.items={anyOf:c},l&&r.items.anyOf.push(l),u>0&&(r.minItems=u),p&&(r.maxItems=d)):(r.items=c,p?r.additionalItems=!1:l&&(r.additionalItems=l),u>0&&(r.minItems=u),p&&(r.maxItems=d));let{minimum:f,maximum:m}=hn(e);typeof f=="number"&&(r.minItems=f),typeof m=="number"&&(r.maxItems=m)};function ER(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let g=ER(e,m,n);return g===m?t:g}for(let m of["anyOf","oneOf"]){let g=t[m];if(!Array.isArray(g))continue;let h=g.map(b=>ER(e,b,n));h.some((b,y)=>b!==g[y])&&(t={...t,[m]:h})}let i=Array.isArray(t.type)?t.type:[t.type],r=!i.includes("string")&&i.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!r&&!o?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:p,...f}=t;return f.enum?f.enum=f.enum.map(m=>typeof m=="number"?String(m):m):typeof f.const=="number"&&(f.const=String(f.const)),r&&(f.type="string",o||(f.pattern=(i.includes("number")?Ho:jm).source)),f}var TR=new WeakMap;function Lfe(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let n=new Map;for(let i of TR.get(e)??[]){let r=e.seen.get(i),o=(r?.def??r?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let s=ER(t,o,new Set);s!==o&&n.set(o,s)}if(n.size)for(let i of e.seen.values())for(let r of[i.schema,i.def]){let o=r&&n.get(r.propertyNames);o&&(r.propertyNames=o)}}var tC=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object";let s=o.keyType,a=hn(s).patterns;if(o.mode==="loose"&&a&&a.size>0){let u=ut(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of a)Nn(r.patternProperties,nq(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){r.propertyNames=ut(o.keyType,t,{...i,path:[...i.path,"propertyNames"]});let u=TR.get(t);u||(u=[],TR.set(t,u),t.deferred.push(()=>Lfe(t))),u.push(e)}r.additionalProperties=ut(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let c=s._zod.values,l=t.io==="input"&&lg(o.valueType)!==void 0;if(c&&!o.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(r.required=u.map(String))}},nC=(e,t,n,i)=>{let r=e._zod.def,o=ut(r.innerType,t,i),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},rC=(e,t,n,i)=>{let r=e._zod.def;ut(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},iC=Symbol();function rq(e,t,n,i,r){let o=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(o=!0,null));return o?(gn(t,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),iC):JSON.parse(s)}var oC=(e,t,n,i)=>{let r=e._zod.def;ut(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s=rq(r.defaultValue,e,t,n,i);s!==iC&&(n.default=s)},sC=(e,t,n,i)=>{let r=e._zod.def;ut(r.innerType,t,i);let o=t.seen.get(e);if(o.ref=r.innerType,t.io!=="input")return;let s=rq(r.defaultValue,e,t,n,i);s!==iC&&(n._prefault=s)},aC=(e,t,n,i)=>{let r=e._zod.def;ut(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{gn(e,t,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},cC=(e,t,n,i)=>{let r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?o?r.out:r.in:r.out;ut(s,t,i);let a=t.seen.get(e);a.ref=s},lC=(e,t,n,i)=>{let r=e._zod.def;ut(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.readOnly=!0},uC=(e,t,n,i)=>{let r=e._zod.def;ut(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},Lw=(e,t,n,i)=>{let r=e._zod.def;ut(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType},dC=(e,t,n,i)=>{let r=e._zod.innerType;ut(r,t,i);let o=t.seen.get(e);o.ref=r},Ow={string:IR,number:AR,boolean:RR,bigint:CR,symbol:NR,null:PR,undefined:DR,void:OR,never:MR,any:LR,unknown:FR,date:UR,enum:jR,literal:zR,nan:GR,template_literal:VR,file:BR,success:qR,custom:WR,function:KR,transform:HR,map:JR,set:ZR,array:YR,object:QR,union:Mw,intersection:XR,tuple:eC,record:tC,nullable:nC,nonoptional:rC,default:oC,prefault:sC,catch:aC,pipe:cC,readonly:lC,promise:uC,optional:Lw,lazy:dC};function Fw(e,t){if("_idmap"in e){let i=e,r=Bs({...t,processors:Ow}),o={};for(let c of i._idmap.entries()){let[l,u]=c;ut(u,r)}let s={},a={registry:i,uri:t?.uri,defs:o};r.external=a;for(let c of i._idmap.entries()){let[l,u]=c;qs(r,u),Nn(s,l,Ws(r,u))}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let n=Bs({...t,processors:Ow});return ut(e,n),qs(n,e),Ws(n,e)}var Uw=class{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(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Bs({processors:Ow,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ut(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,qs(this.ctx,t);let i=Ws(this.ctx,t),{"~standard":r,...o}=i;return o}};var iq={};var fd={};kr(fd,{ZodAny:()=>PC,ZodArray:()=>LC,ZodBase64:()=>ik,ZodBase64URL:()=>ok,ZodBigInt:()=>dd,ZodBigIntFormat:()=>ck,ZodBoolean:()=>ud,ZodCIDRv4:()=>nk,ZodCIDRv6:()=>rk,ZodCUID:()=>Jw,ZodCUID2:()=>Zw,ZodCatch:()=>iN,ZodCodec:()=>vg,ZodCreditCard:()=>xC,ZodCustom:()=>wg,ZodCustomStringFormat:()=>Nc,ZodDate:()=>fg,ZodDefault:()=>QC,ZodDiscriminatedUnion:()=>UC,ZodE164:()=>sk,ZodEmail:()=>qw,ZodEmoji:()=>Kw,ZodEnum:()=>ad,ZodExactOptional:()=>pk,ZodFile:()=>HC,ZodFunction:()=>mN,ZodGUID:()=>Ww,ZodIBAN:()=>EC,ZodIPv4:()=>ek,ZodIPv6:()=>tk,ZodISODate:()=>Hs,ZodISODateTime:()=>Ks,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,ZodInstanceOf:()=>yN,ZodIntersection:()=>jC,ZodJWT:()=>ak,ZodKSUID:()=>Xw,ZodLazy:()=>dN,ZodLiteral:()=>KC,ZodMAC:()=>SC,ZodMap:()=>qC,ZodNaN:()=>sN,ZodNanoID:()=>Hw,ZodNever:()=>OC,ZodNonOptional:()=>fk,ZodNull:()=>CC,ZodNullable:()=>YC,ZodNumber:()=>ld,ZodNumberFormat:()=>Pc,ZodObject:()=>gg,ZodOptional:()=>yg,ZodPipe:()=>bg,ZodPrefault:()=>eN,ZodPreprocess:()=>aN,ZodPromise:()=>fN,ZodReadonly:()=>cN,ZodRecord:()=>sd,ZodSet:()=>WC,ZodString:()=>cd,ZodStringFormat:()=>mt,ZodSuccess:()=>rN,ZodSymbol:()=>AC,ZodTemplateLiteral:()=>uN,ZodTransform:()=>JC,ZodTuple:()=>GC,ZodType:()=>Fe,ZodULID:()=>Yw,ZodURL:()=>pg,ZodUUID:()=>go,ZodUndefined:()=>RC,ZodUnion:()=>hg,ZodUnknown:()=>DC,ZodVoid:()=>MC,ZodXID:()=>Qw,ZodXor:()=>FC,_ZodString:()=>Bw,_default:()=>XC,_function:()=>h2,any:()=>Kq,array:()=>mg,base64:()=>Tq,base64url:()=>Iq,bigint:()=>Gq,boolean:()=>IC,catch:()=>oN,check:()=>y2,cidrv4:()=>xq,cidrv6:()=>Eq,codec:()=>p2,creditCard:()=>Rq,cuid:()=>yq,cuid2:()=>bq,currencyCode:()=>Mq,custom:()=>b2,date:()=>Jq,describe:()=>v2,discriminatedUnion:()=>t2,e164:()=>Aq,email:()=>aq,emoji:()=>gq,enum:()=>uk,exactOptional:()=>ZC,file:()=>c2,float32:()=>Fq,float64:()=>Uq,function:()=>h2,guid:()=>cq,hash:()=>Lq,hex:()=>Oq,hostname:()=>Dq,httpUrl:()=>mq,iban:()=>Cq,instanceof:()=>k2,int:()=>Gw,int32:()=>jq,int64:()=>Vq,intersection:()=>zC,invertCodec:()=>f2,ipv4:()=>_q,ipv6:()=>Sq,json:()=>$2,jwt:()=>Nq,keyof:()=>Zq,ksuid:()=>kq,lazy:()=>pN,literal:()=>a2,looseObject:()=>Xq,looseRecord:()=>r2,mac:()=>$q,map:()=>i2,meta:()=>w2,nan:()=>d2,nanoid:()=>hq,nativeEnum:()=>s2,never:()=>lk,nonoptional:()=>nN,null:()=>NC,nullable:()=>dg,nullish:()=>l2,number:()=>TC,object:()=>Yq,optional:()=>Rc,partialRecord:()=>n2,pipe:()=>Vw,prefault:()=>tN,preprocess:()=>S2,promise:()=>g2,readonly:()=>lN,record:()=>BC,refine:()=>gN,set:()=>o2,strictObject:()=>Qq,string:()=>ug,stringFormat:()=>Pq,stringbool:()=>_2,success:()=>u2,superRefine:()=>hN,symbol:()=>qq,templateLiteral:()=>m2,transform:()=>dk,tuple:()=>VC,uint32:()=>zq,uint64:()=>Bq,ulid:()=>vq,undefined:()=>Wq,union:()=>pd,unknown:()=>Ac,url:()=>fq,uuid:()=>lq,uuidv4:()=>uq,uuidv6:()=>dq,uuidv7:()=>pq,void:()=>Hq,xid:()=>wq,xor:()=>e2});var jw={};kr(jw,{endsWith:()=>Ju,gt:()=>fo,gte:()=>Gr,includes:()=>Ku,length:()=>Tc,lowercase:()=>qu,lt:()=>po,lte:()=>zr,maxLength:()=>Ec,maxSize:()=>Vs,mime:()=>Yu,minLength:()=>Jo,minSize:()=>mo,multipleOf:()=>Gs,negative:()=>Cw,nonnegative:()=>Pw,nonpositive:()=>Nw,normalize:()=>Qu,overwrite:()=>ji,positive:()=>Rw,properties:()=>Zu,property:()=>Dw,regex:()=>Bu,size:()=>xc,slugify:()=>nd,startsWith:()=>Hu,toLowerCase:()=>ed,toUpperCase:()=>td,trim:()=>Xu,uppercase:()=>Wu});var oq=new WeakSet([Object.prototype,Error.prototype]);function zw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=n(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var sq=(e,t)=>{dI.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);oq.has(n)||(oq.add(n),zw(n,"format",i=>r=>Mm(i,r)),zw(n,"flatten",i=>r=>Om(i,r)),zw(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,Ru,2)}),zw(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,Ru,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Ufe=C("ZodError",sq),Ir=C("ZodError",sq,void 0,{Parent:Error});var pC=Ou(Ir),fC=Mu(Ir),mC=Lu(Ir),gC=Fu(Ir),hC=hv(Ir),yC=yv(Ir),bC=bv(Ir),vC=vv(Ir),wC=wv(Ir),kC=kv(Ir),_C=_v(Ir),$C=$v(Ir);function zfe(){$n.localeError||zt(tw())}function Cc(){$n.memoizer||zt({memoizer:eg()})}var Fe=C("ZodType",(e,t)=>(zfe(),Oe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ct(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(gN(e,t))},superRefine(e,t){return this.check(hN(e,t))},overwrite(e){return this.check(ji(e))},optional(){return Rc(this)},exactOptional(){return ZC(this)},nullable(){return dg(this)},nullish(){return Rc(dg(this))},nonoptional(e){return nN(this,e)},array(){return mg(this)},or(e){return pd([this,e])},and(e){return zC(this,e)},transform(e){return Vw(this,dk(e))},default(e){return XC(this,e)},prefault(e){return tN(this,e)},catch(e){return oN(this,e)},pipe(e){return Vw(this,e)},readonly(){return lN(this)},describe(e){let t=this.clone();return Pn.add(t,{description:e}),t},meta(...e){if(e.length===0)return Pn.get(this);let t=this.clone();return Pn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...Dv(this),jsonSchema:{input:rd(this,"input"),output:rd(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return pC(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await fC(this,t,n,{callee:e})},safeParse(e,t){return mC(this,e,t)},async safeParseAsync(e,t){return gC(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},validate(e,t){return Lm(this,e,t)},validateAsync(e,t){return Fm(this,e,t)},encode:function e(t,n){return hC(this,t,n,{callee:e})},decode:function e(t,n){return yC(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await bC(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await vC(this,t,n,{callee:e})},safeEncode(e,t){return wC(this,e,t)},safeDecode(e,t){return kC(this,e,t)},async safeEncodeAsync(e,t){return _C(this,e,t)},async safeDecodeAsync(e,t){return $C(this,e,t)},toJSONSchema(e){return xR(this,{})(e)},get description(){return Pn.get(this)?.description},get _def(){return this._zod.def}}),Bw=C("_ZodString",(e,t)=>{kc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>IR(e,n,i,r)},G.derived({format:e=>hn(e).format??null,minLength:e=>hn(e).minimum??null,maxLength:e=>hn(e).maximum??null},{regex(...e){return this.check(Bu(...e))},includes(...e){return this.check(Ku(...e))},startsWith(...e){return this.check(Hu(...e))},endsWith(...e){return this.check(Ju(...e))},min(...e){return this.check(Jo(...e))},max(...e){return this.check(Ec(...e))},length(...e){return this.check(Tc(...e))},nonempty(...e){return this.check(Jo(1,...e))},lowercase(e){return this.check(qu(e))},uppercase(e){return this.check(Wu(e))},trim(){return this.check(Xu())},normalize(...e){return this.check(Qu(...e))},toLowerCase(){return this.check(ed())},toUpperCase(){return this.check(td())},slugify(){return this.check(nd())}})),cd=C("ZodString",(e,t)=>{kc.init(e,t),Bw.init(e,t)},{email(e){return this.check(lw(qw,e))},url(e){return this.check(rg(pg,e))},jwt(e){return this.check(Aw(ak,e))},emoji(e){return this.check(gw(Kw,e))},guid(e){return this.check(uw(Ww,e))},uuid(e){return this.check(dw(go,e))},uuidv4(e){return this.check(pw(go,e))},uuidv6(e){return this.check(fw(go,e))},uuidv7(e){return this.check(mw(go,e))},nanoid(e){return this.check(hw(Hw,e))},cuid(e){return this.check(yw(Jw,e))},cuid2(e){return this.check(bw(Zw,e))},ulid(e){return this.check(vw(Yw,e))},base64(e){return this.check(Ew(ik,e))},base64url(e){return this.check(Tw(ok,e))},xid(e){return this.check(ww(Qw,e))},ksuid(e){return this.check(kw(Xw,e))},ipv4(e){return this.check(_w(ek,e))},ipv6(e){return this.check($w(tk,e))},cidrv4(e){return this.check(Sw(nk,e))},cidrv6(e){return this.check(xw(rk,e))},e164(e){return this.check(Iw(sk,e))},datetime(e){return this.check(ig(Ks,e))},date(e){return this.check(og(Hs,e))},time(e){return this.check(sg(Js,e))},duration(e){return this.check(ag(Zs,e))}});function ug(e){return z0(cd,e)}var mt=C("ZodStringFormat",(e,t)=>{lt.init(e,t),Bw.init(e,t)}),Ks=C("ZodISODateTime",(e,t)=>{CA.init(e,t),mt.init(e,t)}),Hs=C("ZodISODate",(e,t)=>{NA.init(e,t),mt.init(e,t)}),Js=C("ZodISOTime",(e,t)=>{PA.init(e,t),mt.init(e,t)}),Zs=C("ZodISODuration",(e,t)=>{DA.init(e,t),mt.init(e,t)}),qw=C("ZodEmail",(e,t)=>{wA.init(e,t),mt.init(e,t)});function aq(e){return lw(qw,e)}var Ww=C("ZodGUID",(e,t)=>{bA.init(e,t),mt.init(e,t)});function cq(e){return uw(Ww,e)}var go=C("ZodUUID",(e,t)=>{vA.init(e,t),mt.init(e,t)});function lq(e){return dw(go,e)}function uq(e){return pw(go,e)}function dq(e){return fw(go,e)}function pq(e){return mw(go,e)}var pg=C("ZodURL",(e,t)=>{$A.init(e,t),mt.init(e,t)});function fq(e){return rg(pg,e)}function mq(e){return rg(pg,{protocol:Um,hostname:DI,...G.normalizeParams(e)})}var Kw=C("ZodEmoji",(e,t)=>{SA.init(e,t),mt.init(e,t)});function gq(e){return gw(Kw,e)}var Hw=C("ZodNanoID",(e,t)=>{xA.init(e,t),mt.init(e,t)});function hq(e){return hw(Hw,e)}var Jw=C("ZodCUID",(e,t)=>{EA.init(e,t),mt.init(e,t)});function yq(e){return yw(Jw,e)}var Zw=C("ZodCUID2",(e,t)=>{TA.init(e,t),mt.init(e,t)});function bq(e){return bw(Zw,e)}var Yw=C("ZodULID",(e,t)=>{IA.init(e,t),mt.init(e,t)});function vq(e){return vw(Yw,e)}var Qw=C("ZodXID",(e,t)=>{AA.init(e,t),mt.init(e,t)});function wq(e){return ww(Qw,e)}var Xw=C("ZodKSUID",(e,t)=>{RA.init(e,t),mt.init(e,t)});function kq(e){return kw(Xw,e)}var ek=C("ZodIPv4",(e,t)=>{OA.init(e,t),mt.init(e,t)});function _q(e){return _w(ek,e)}var SC=C("ZodMAC",(e,t)=>{LA.init(e,t),mt.init(e,t)});function $q(e){return V0(SC,e)}var tk=C("ZodIPv6",(e,t)=>{MA.init(e,t),mt.init(e,t)});function Sq(e){return $w(tk,e)}var nk=C("ZodCIDRv4",(e,t)=>{FA.init(e,t),mt.init(e,t)});function xq(e){return Sw(nk,e)}var rk=C("ZodCIDRv6",(e,t)=>{UA.init(e,t),mt.init(e,t)});function Eq(e){return xw(rk,e)}var ik=C("ZodBase64",(e,t)=>{jA.init(e,t),mt.init(e,t)});function Tq(e){return Ew(ik,e)}var ok=C("ZodBase64URL",(e,t)=>{zA.init(e,t),mt.init(e,t)});function Iq(e){return Tw(ok,e)}var sk=C("ZodE164",(e,t)=>{GA.init(e,t),mt.init(e,t)});function Aq(e){return Iw(sk,e)}var xC=C("ZodCreditCard",(e,t)=>{VA.init(e,t),mt.init(e,t)});function Rq(e){return B0(xC,e)}var EC=C("ZodIBAN",(e,t)=>{BA.init(e,t),mt.init(e,t)});function Cq(e){return q0(EC,e)}var ak=C("ZodJWT",(e,t)=>{qA.init(e,t),mt.init(e,t)});function Nq(e){return Aw(ak,e)}var Nc=C("ZodCustomStringFormat",(e,t)=>{WA.init(e,t),mt.init(e,t)});function Pq(e,t,n={}){return Ic(Nc,e,t,n)}function Dq(e){return Ic(Nc,"hostname",PI,e)}function Oq(e){return Ic(Nc,"hex",HI,e)}function Mq(e){return Ic(Nc,"currency_code",MI,e)}function Lq(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=li[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return Ic(Nc,i,r,t)}var ld=C("ZodNumber",(e,t)=>{Bv.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>AR(e,n,i,r),e.isFinite=!0},G.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=hn(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=hn(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=hn(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>hn(e).format??null},{gt(e,t){return this.check(fo(e,t))},gte(e,t){return this.check(Gr(e,t))},min(e,t){return this.check(Gr(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(zr(e,t))},max(e,t){return this.check(zr(e,t))},int(e){return this.check(Gw(e))},safe(e){return this.check(Gw(e))},positive(e){return this.check(fo(0,e))},nonnegative(e){return this.check(Gr(0,e))},negative(e){return this.check(po(0,e))},nonpositive(e){return this.check(zr(0,e))},multipleOf(e,t){return this.check(Gs(e,t))},step(e,t){return this.check(Gs(e,t))},finite(){return this}}));function TC(e){return K0(ld,e)}var Pc=C("ZodNumberFormat",(e,t)=>{KA.init(e,t),ld.init(e,t)});function Gw(e){return J0(Pc,e)}function Fq(e){return Z0(Pc,e)}function Uq(e){return Y0(Pc,e)}function jq(e){return Q0(Pc,e)}function zq(e){return X0(Pc,e)}var ud=C("ZodBoolean",(e,t)=>{Hm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>RR(e,n,i,r)});function IC(e){return eR(ud,e)}var dd=C("ZodBigInt",(e,t)=>{qv.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>CR(e,n,i,r)},G.derived({minValue:e=>hn(e).minimum??null,maxValue:e=>hn(e).maximum??null,format:e=>hn(e).format??null},{gte(e,t){return this.check(Gr(e,t))},min(e,t){return this.check(Gr(e,t))},gt(e,t){return this.check(fo(e,t))},lt(e,t){return this.check(po(e,t))},lte(e,t){return this.check(zr(e,t))},max(e,t){return this.check(zr(e,t))},positive(e){return this.check(fo(BigInt(0),e))},negative(e){return this.check(po(BigInt(0),e))},nonpositive(e){return this.check(zr(BigInt(0),e))},nonnegative(e){return this.check(Gr(BigInt(0),e))},multipleOf(e,t){return this.check(Gs(e,t))}}));function Gq(e){return nR(dd,e)}var ck=C("ZodBigIntFormat",(e,t)=>{HA.init(e,t),dd.init(e,t)});function Vq(e){return iR(ck,e)}function Bq(e){return oR(ck,e)}var AC=C("ZodSymbol",(e,t)=>{JA.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>NR(e,n,i,r)});function qq(e){return sR(AC,e)}var RC=C("ZodUndefined",(e,t)=>{ZA.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>DR(e,n,i,r)});function Wq(e){return aR(RC,e)}var CC=C("ZodNull",(e,t)=>{YA.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>PR(e,n,i,r)});function NC(e){return cR(CC,e)}var PC=C("ZodAny",(e,t)=>{QA.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>LR(e,n,i,r)});function Kq(){return lR(PC)}var DC=C("ZodUnknown",(e,t)=>{XA.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>FR(e,n,i,r)});function Ac(){return uR(DC)}var OC=C("ZodNever",(e,t)=>{e0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>MR(e,n,i,r)});function lk(e){return dR(OC,e)}var MC=C("ZodVoid",(e,t)=>{t0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>OR(e,n,i,r)});function Hq(e){return pR(MC,e)}var fg=C("ZodDate",(e,t)=>{n0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>UR(e,n,i,r),e.min=(n,i)=>e.check(Gr(n,i)),e.max=(n,i)=>e.check(zr(n,i))},G.derived({minDate:e=>{let{minimum:t}=hn(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=hn(e);return t?new Date(t):null}},{}));function Jq(e){return fR(fg,e)}var LC=C("ZodArray",(e,t)=>{Cc(),i0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>YR(e,n,i,r),e.element=t.element},{min(e,t){return this.check(Jo(e,t))},nonempty(e){return this.check(Jo(1,e))},max(e,t){return this.check(Ec(e,t))},length(e,t){return this.check(Tc(e,t))},unwrap(){return this.element}});function mg(e,t){return hR(LC,e,t)}function Zq(e){let t=e._zod.def.shape;return uk(Object.keys(t))}var gg=C("ZodObject",(e,t)=>{Cc(),o0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>QR(e,n,i,r),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return uk(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(G.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},loose(){return this.clone(G.mergeDefs(this._zod.def,{catchall:Ac()}))},strict(){return this.clone(G.mergeDefs(this._zod.def,{catchall:lk()}))},strip(){return this.clone(G.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(yg,this,e[0])},exactPartial(...e){return G.partial(pk,this,e[0],"exactPartial")},required(...e){return G.required(fk,this,e[0])}});function Yq(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new gg(n)}function Qq(e,t){return new gg({type:"object",shape:e,catchall:lk(),...G.normalizeParams(t)})}function Xq(e,t){return new gg({type:"object",shape:e,catchall:Ac(),...G.normalizeParams(t)})}var hg=C("ZodUnion",(e,t)=>{Jm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Mw(e,n,i,r),e.options=t.options});function pd(e,t){return new hg({type:"union",options:e,...G.normalizeParams(t)})}var FC=C("ZodXor",(e,t)=>{hg.init(e,t),s0.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Mw(e,n,i,r),e.options=t.options});function e2(e,t){return new FC({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var UC=C("ZodDiscriminatedUnion",(e,t)=>{hg.init(e,t),c0.init(e,t)});function t2(e,t,n){return new UC({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var jC=C("ZodIntersection",(e,t)=>{l0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>XR(e,n,i,r)});function zC(e,t){return new jC({type:"intersection",left:e,right:t})}var GC=C("ZodTuple",(e,t)=>{Cc(),Wv.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>eC(e,n,i,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new yg({type:"optional",innerType:t}))})}});function VC(e,t,n){let i=t instanceof Oe,r=i?n:t,o=i?t:null;return new GC({type:"tuple",items:e,rest:o,...G.normalizeParams(r)})}var sd=C("ZodRecord",(e,t)=>{Cc(),u0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>tC(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function BC(e,t,n){return!t||!t._zod?new sd({type:"record",keyType:ug(),valueType:e,...G.normalizeParams(t)}):new sd({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function n2(e,t,n){return new sd({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function r2(e,t,n){return new sd({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var qC=C("ZodMap",(e,t)=>{Cc(),d0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>JR(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Vs(...n)),e.size=(...n)=>e.check(xc(...n))});function i2(e,t,n){return new qC({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var WC=C("ZodSet",(e,t)=>{Cc(),p0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>ZR(e,n,i,r),e.min=(...n)=>e.check(mo(...n)),e.nonempty=n=>e.check(mo(1,n)),e.max=(...n)=>e.check(Vs(...n)),e.size=(...n)=>e.check(xc(...n))});function o2(e,t){return new WC({type:"set",valueType:e,...G.normalizeParams(t)})}var ad=C("ZodEnum",(e,t)=>{f0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(i,r,o)=>jR(e,i,r,o),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ad({...t,checks:[],...G.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new ad({...t,checks:[],...G.normalizeParams(r),entries:o})}});function uk(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ad({type:"enum",entries:n,...G.normalizeParams(t)})}function s2(e,t){return new ad({type:"enum",entries:e,...G.normalizeParams(t)})}var KC=C("ZodLiteral",(e,t)=>{m0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>zR(e,n,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function a2(e,t){return new KC({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var HC=C("ZodFile",(e,t)=>{g0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>BR(e,n,i,r),e.min=(n,i)=>e.check(mo(n,i)),e.max=(n,i)=>e.check(Vs(n,i)),e.mime=(n,i)=>e.check(Yu(Array.isArray(n)?n:[n],i))});function c2(e){return yR(HC,e)}var JC=C("ZodTransform",(e,t)=>{Cc(),h0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>HR(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new js(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(G.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function dk(e){return new JC({type:"transform",transform:e})}var yg=C("ZodOptional",(e,t)=>{Kv.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Lw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new yg({type:"optional",innerType:e})}var pk=C("ZodExactOptional",(e,t)=>{y0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>Lw(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ZC(e){return new pk({type:"optional",innerType:e})}var YC=C("ZodNullable",(e,t)=>{b0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>nC(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function dg(e){return new YC({type:"nullable",innerType:e})}function l2(e){return Rc(dg(e))}var QC=C("ZodDefault",(e,t)=>{v0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>oC(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function XC(e,t){return new QC({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var eN=C("ZodPrefault",(e,t)=>{w0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>sC(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function tN(e,t){return new eN({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var fk=C("ZodNonOptional",(e,t)=>{k0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>rC(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function nN(e,t){return new fk({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var rN=C("ZodSuccess",(e,t)=>{_0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>qR(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function u2(e){return new rN({type:"success",innerType:e})}var iN=C("ZodCatch",(e,t)=>{$0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>aC(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oN(e,t){return new iN({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var sN=C("ZodNaN",(e,t)=>{S0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>GR(e,n,i,r)});function d2(e){return gR(sN,e)}var bg=C("ZodPipe",(e,t)=>{Hv.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>cC(e,n,i,r),e.in=t.in,e.out=t.out});function Vw(e,t){return new bg({type:"pipe",in:e,out:t})}var vg=C("ZodCodec",(e,t)=>{bg.init(e,t),Zm.init(e,t)});function p2(e,t,n){return new vg({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function f2(e){let t=e._zod.def;return new vg({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var aN=C("ZodPreprocess",(e,t)=>{bg.init(e,t),x0.init(e,t)}),cN=C("ZodReadonly",(e,t)=>{E0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>lC(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function lN(e){return new cN({type:"readonly",innerType:e})}var uN=C("ZodTemplateLiteral",(e,t)=>{T0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>VR(e,n,i,r)});function m2(e,t){return new uN({type:"template_literal",parts:e,...G.normalizeParams(t)})}var dN=C("ZodLazy",(e,t)=>{Ym.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>dC(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function pN(e){return new dN({type:"lazy",getter:e})}var fN=C("ZodPromise",(e,t)=>{A0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>uC(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function g2(e){return new fN({type:"promise",innerType:e})}var mN=C("ZodFunction",(e,t)=>{I0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>KR(e,n,i,r)});function h2(e){return new mN({type:"function",input:Array.isArray(e?.input)?VC(e?.input):e?.input??mg(Ac()),output:e?.output??Ac()})}var wg=C("ZodCustom",(e,t)=>{R0.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,i,r)=>WR(e,n,i,r)});function y2(e){let t=new ht({check:"custom"});return t._zod.check=e,t}function b2(e,t){return bR(wg,e??(()=>!0),t)}function gN(e,t={}){return vR(wg,e,t)}function hN(e,t){return wR(e,t)}var v2=kR,w2=_R,yN=C("ZodInstanceOf",(e,t)=>{wg.init(e,t)},{properties(e,t){return this.check(Zu(e,t))}});function k2(e,t={}){let n=new yN({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var _2=(...e)=>$R({Codec:vg,Boolean:ud,String:cd},...e);function $2(e){let t=pN(()=>pd([ug(e),TC(),IC(),NC(),mg(t),BC(ug(),t)]));return t}function S2(e,t){return new aN({type:"pipe",in:dk(e),out:t})}var Gfe={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 Vfe(e){zt({customError:e})}function Bfe(){return zt().customError}var bN;bN||(bN={});var kg={};kr(kg,{ZodISODate:()=>Hs,ZodISODateTime:()=>Ks,ZodISODuration:()=>Zs,ZodISOTime:()=>Js,date:()=>Wfe,datetime:()=>qfe,duration:()=>Hfe,time:()=>Kfe});function qfe(e){return ig(Ks,e)}function Wfe(e){return og(Hs,e)}function Kfe(e){return sg(Js,e)}function Hfe(e){return ag(Zs,e)}var oe={...fd,...jw,iso:kg},Jfe=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"]);function Zfe(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function x2(e,t){return e.map((n,i)=>ii).check(i=>{let r=i.value;if(typeof r!="object"||r===null||Array.isArray(r))return;let o=Object.getOwnPropertyNames(r);if(t.minProperties!==void 0&&o.length=${t.minProperties} properties`,input:r,inst:e,continue:!0}),t.maxProperties!==void 0&&o.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:r,inst:e,continue:!0}),t.keySchema)for(let s of o){let a=t.keySchema.safeParse(s);a.success||i.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function vN(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let i=String(e);return`${n[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let o=[];for(let s of e){let a=vN(s,t);if(a===null)return null;o.push(a)}return`a${o.length}:[${o.join(",")}]`}let i=Object.keys(e).sort(),r=[];for(let o of i){let s=vN(e[o],t);if(s===null)return null;r.push(`${o.length}:${o}=${s}`)}return`o${r.length}:{${r.join(",")}}`}finally{t.delete(e)}}var eme=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),tme=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function _g(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(_g):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>eme.has(t)?_g(n):!tme.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(_g))}function E2(e){return e===1?"element":"elements"}function nme(e,t){return oe.transform(i=>i).check(i=>{let r=i.value;if(Array.isArray(r)){if(t.uniqueItems===!0){let o=new Map;for(let s=0;s=s)break;at.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${E2(t.maxContains)}`,input:r,continue:!0})}}}).pipe(e)}function T2(e,t){if(e!==!1)return e===void 0||e===!0?oe.any():or(e,t)}var rme=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function I2(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return oe.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return oe.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=Qfe(r,t),s=or(o,t);return t.refs.set(r,s),t.processing.delete(r),s}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return oe.null();if(r.length===0)return oe.never();if(r.length===1)return oe.literal(r[0]);if(r.every(s=>typeof s=="string"))return oe.enum(r);let o=r.map(s=>oe.literal(s));return o.length<2?o[0]:oe.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return oe.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...e,type:o};return I2(s,t)});return r.length===0?oe.never():r.length===1?r[0]:oe.union(r)}if(!n)return oe.any();let i;switch(n){case"string":{let r=oe.string();if(e.format){let o=e.format;o==="email"?r=r.check(oe.email()):o==="uri"||o==="uri-reference"?r=r.check(oe.url()):o==="uuid"||o==="guid"?r=r.check(oe.uuid()):o==="date-time"?r=r.check(oe.iso.datetime({offset:!0})):o==="date"?r=r.check(oe.iso.date()):o==="time"?r=r.check(oe.regex(rme)):o==="duration"?r=r.check(oe.iso.duration()):o==="hostname"?r=r.check(oe.hostname()):o==="ipv4"?r=r.check(oe.ipv4()):o==="ipv6"?r=r.check(oe.ipv6()):o==="mac"?r=r.check(oe.mac()):o==="cidr"?r=r.check(oe.cidrv4()):o==="cidr-v6"?r=r.check(oe.cidrv6()):o==="base64"?r=r.check(oe.base64()):o==="base64url"?r=r.check(oe.base64url()):o==="e164"?r=r.check(oe.e164()):o==="credit_card"?r=r.check(oe.creditCard()):o==="iban"?r=r.check(oe.iban()):o==="jwt"?r=r.check(oe.jwt()):o==="emoji"?r=r.check(oe.emoji()):o==="nanoid"?r=r.check(oe.nanoid()):o==="cuid"?r=r.check(oe.cuid()):o==="cuid2"?r=r.check(oe.cuid2()):o==="ulid"?r=r.check(oe.ulid()):o==="xid"?r=r.check(oe.xid()):o==="ksuid"&&(r=r.check(oe.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?oe.number().int():oe.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=oe.boolean();break}case"null":{i=oe.null();break}case"object":{let r={},o=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?or(e.additionalProperties,t):void 0;for(let[d,p]of Object.entries(o)){let f=or(p,t);Nn(r,d,s.has(d)?f:f.optional())}if(e.patternProperties){let d=e.patternProperties,p=Object.keys(d),f=[];for(let g of p){let h=or(d[g],t),b=oe.string().regex(new RegExp(g));f.push(oe.looseRecord(b,h))}let m=[];if(Object.keys(r).length>0&&m.push(oe.object(r).passthrough()),m.push(...f),m.length===0)i=oe.object({}).passthrough();else if(m.length===1)i=m[0];else{let g=oe.intersection(m[0],m[1]);for(let h=2;hnew RegExp(y)),b=i;i=i.check(y=>{if(!ai(y.value))return;let w=[];for(let k of Object.keys(y.value))g.includes(k)||h.some($=>$.test(k))||w.push(k);w.length&&y.issues.push({code:"unrecognized_keys",keys:w,input:y.value,inst:b})})}}else{let d=oe.object(r);e.additionalProperties===!1?i=d.strict():a?i=d.catchall(a):i=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,u=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||l!==void 0||u!==void 0){let d;if(c){let p=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=or(p,t)}i=Xfe(i,{keySchema:d,minProperties:l,maxProperties:u})}break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let s=typeof e.minItems=="number"?e.minItems:0,a=r.map(d=>or(d,t)),c=x2(a,s),l=Array.isArray(o)?void 0:T2(o,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>or(d,t)),c=x2(a,s),l=T2(e.additionalItems,t),u=oe.tuple(c);i=l?u.rest(l):u,typeof e.minItems=="number"&&(i=i.check(oe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(oe.maxLength(e.maxItems)))}else if(o!==void 0){let s=or(o,t),a=oe.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),i=a}else i=oe.array(oe.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=nme(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?or(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return i}function or(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n=I2(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>or(l,t)),c=oe.union(a);n=i?oe.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>or(l,t)),c=oe.xor(a);n=i?oe.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:oe.any();else{let a=i?n:or(e.allOf[0],t),c=i?0:1;for(let l=c;l0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function A2(e,t){if(typeof e=="boolean")return e?oe.any():oe.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=Zfe(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Pn};return or(n,o)}var R2=Symbol("z.visit/resolving");function $g(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},i=new Map;function r(s){let a=i.get(s);if(a===R2)return new Ym({type:"lazy",getter:()=>i.get(s)});if(a!==void 0)return a;i.set(s,R2);let c=o(s),l=n(c,c!==s);return i.set(s,l),l}function o(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let l=a.shape,u=Object.keys(l),d=!1,p={};for(let m of u){let g=r(l[m]);g!==l[m]&&(d=!0),p[m]=g}let f=a.catchall;return a.catchall&&(f=r(a.catchall),f!==a.catchall&&(d=!0)),d?ct(s,{...a,shape:p,catchall:f}):s}case"array":{let l=r(a.element);return l===a.element?s:ct(s,{...a,element:l})}case"tuple":{let l=a.items,u=!1,d=[];for(let f of l){let m=r(f);m!==f&&(u=!0),d.push(m)}let p=a.rest;return a.rest&&(p=r(a.rest),p!==a.rest&&(u=!0)),u?ct(s,{...a,items:d,rest:p}):s}case"record":case"map":{let l=r(a.keyType),u=r(a.valueType);return l===a.keyType&&u===a.valueType?s:ct(s,{...a,keyType:l,valueType:u})}case"set":{let l=r(a.valueType);return l===a.valueType?s:ct(s,{...a,valueType:l})}case"union":{let l=a.options,u=!1,d=[];for(let p of l){let f=r(p);f!==p&&(u=!0),d.push(f)}return u?ct(s,{...a,options:d}):s}case"intersection":{let l=r(a.left),u=r(a.right);return l===a.left&&u===a.right?s:ct(s,{...a,left:l,right:u})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=r(a.innerType);return l===a.innerType?s:ct(s,{...a,innerType:l})}case"pipe":{let l=r(a.in),u=r(a.out);return l===a.in&&u===a.out?s:ct(s,{...a,in:l,out:u})}case"function":{let l=r(a.input),u=r(a.output);return l===a.input&&u===a.output?s:ct(s,{...a,input:l,output:u})}case"lazy":{let l=a.getter,{_cachedInner:u,...d}=a;return ct(s,{...d,getter:()=>r(l())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return r(e)}function C2(e){return $g(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:pd(n.options)}})}function ime(e,t){if(!t?.length)return e;let n=e._zod.def;return ct(e,Fi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function N2(e){return ime(e.out,e.checks)}function ome(e){return e.in._zod.traits.has("$ZodTransform")?N2(e):e.in}function P2(e){return $g(e,{pipe:t=>ome(t._zod.def),default:(t,n)=>n?Rc(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function D2(e){return $g(e,{pipe:t=>N2(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var wN={};kr(wN,{bigint:()=>lme,boolean:()=>cme,date:()=>ume,number:()=>ame,string:()=>sme});function sme(e){return G0(cd,e)}function ame(e){return H0(ld,e)}function cme(e){return tR(ud,e)}function lme(e){return rR(dd,e)}function ume(e){return mR(fg,e)}var O2=U.enum(["npm","pypi","go","cargo","maven","rubygems","nuget","packagist","hex","pub","swift","cocoapods","opam","conan","vcpkg","arduino"]),dme=U.string().trim().min(1),pme=U.enum(["low","medium","high","xhigh"]);var kN=U.object({mode:U.enum(["auto","approve"]).default("approve"),maxAutoRisk:U.enum(["none","low","medium","high"]).default("medium"),watchBranches:U.array(U.string()).default(["main","master","develop"]),ecosystems:U.array(O2).default([...O2.options]),ignore:U.array(U.string()).default([]),alwaysApprove:U.array(U.string()).default([]),triggerOn:U.object({major:U.boolean().default(!0),minor:U.boolean().default(!0),patch:U.boolean().default(!1),transitive:U.boolean().default(!1),dev:U.boolean().default(!0)}).prefault({}),evidence:U.object({githubReleases:U.boolean().default(!0),changelog:U.boolean().default(!0),typeSurface:U.boolean().default(!0),openapi:U.boolean().default(!0),openapiSpecs:U.array(U.string()).default([]),protobuf:U.boolean().default(!0),protobufSpecs:U.array(U.string()).default([]),graphql:U.boolean().default(!0),graphqlSchemas:U.array(U.string()).default([]),maxReleases:U.number().int().min(1).max(100).default(25)}).prefault({}),rationale:U.object({security:U.boolean().default(!0),maintenance:U.boolean().default(!0),summary:U.boolean().default(!0)}).prefault({}),licenses:U.object({enabled:U.boolean().default(!1),allow:U.array(U.string()).default([]),deny:U.array(U.string()).default([]),requireDeclared:U.boolean().default(!1)}).prefault({}),guardrails:U.object({protectedPaths:U.array(U.string()).default([".github/workflows/**","**/*.lock","infra/**","terraform/**","**/secrets/**"]),maxFilesChanged:U.number().int().min(1).default(50),maxDependenciesPerRun:U.number().int().min(1).default(10),requireEvidence:U.boolean().default(!0),minConfidence:U.enum(["low","medium","high"]).default("medium"),experimentalDispatchBelowMinConfidence:U.boolean().default(!1),forbidTestWeakening:U.boolean().default(!0)}).prefault({}),remediation:U.object({commitGranularity:U.enum(["per-breaking-change","per-dependency","single"]).default("per-breaking-change"),branchPrefix:U.string().default("drift/"),draftPr:U.boolean().optional(),model:U.string().optional(),agent:U.object({provider:dme.default("auto"),model:U.string().optional(),effort:pme.optional(),fast:U.boolean().default(!1),timeoutSeconds:U.number().int().min(30).max(1440*60).default(1800)}).prefault({}),customInstructions:U.string().default(""),awaitCompletion:U.object({enabled:U.boolean().default(!1),timeoutMinutes:U.number().int().min(1).max(360).default(20),pollIntervalSeconds:U.number().int().min(5).max(300).default(30)}).prefault({}),communityRecipes:U.boolean().default(!1),fixPlans:U.object({enabled:U.boolean().default(!1),minCoverage:U.number().min(0).max(1).default(.5),autoApply:U.enum(["review","proven","verified"]).default("review"),cache:U.boolean().default(!0)}).prefault({})}).prefault({}),verification:U.object({behavioural:U.object({enabled:U.boolean().default(!1),sandbox:U.literal("required").default("required"),maxSymbols:U.number().int().min(1).max(100).default(10),maxCasesPerSymbol:U.number().int().min(1).max(100).default(20),timeoutSeconds:U.number().int().min(1).max(1800).default(120),network:U.boolean().default(!1),memoryMb:U.number().int().min(128).max(16384).default(1024),cpuLimit:U.number().min(.1).max(32).default(1),retainArtifacts:U.boolean().default(!1)}).prefault({})}).prefault({}),telemetry:U.object({enabled:U.boolean().default(!1),endpoint:U.string().url().optional(),installationId:U.string().optional(),rotationSalt:U.string().optional(),retentionDays:U.number().int().min(1).max(730).default(180)}).prefault({}),pullRequest:U.object({enabled:U.boolean().default(!0),confirm:U.enum(["ask","never"]).default("ask"),base:U.enum(["branched-from","default-branch"]).default("branched-from"),draft:U.boolean().optional(),labels:U.array(U.string()).default([]),reviewers:U.array(U.string()).default([]),branchTemplate:U.string().default("{prefix}upgrade-{summary}-{date}"),titleTemplate:U.string().default("chore(deps): upgrade {summary}"),coAuthor:U.boolean().default(!0)}).prefault({}),llm:U.object({enabled:U.boolean().default(!1),provider:U.enum(["anthropic"]).default("anthropic"),model:U.string().default("claude-opus-5"),effort:U.enum(["low","medium","high","xhigh","max"]).default("medium"),apiKeyEnv:U.string().default("ANTHROPIC_API_KEY")}).prefault({}),codeScanning:U.object({enabled:U.boolean().default(!0),includeInformational:U.boolean().default(!1),granularity:U.enum(["package","breakingChange","affectedSite"]).default("package"),createIssuesPerAlert:U.boolean().default(!1)}).prefault({}),issueCreation:U.object({default:U.enum(["issue","branch","both"]).default("issue"),granularity:U.enum(["package","change"]).default("package"),assignees:U.array(U.string()).default([])}).prefault({}),outdated:U.object({enabled:U.boolean().default(!1)}).prefault({}),check:U.object({enabled:U.boolean().default(!1)}).prefault({}),tools:U.object({autoInstall:U.boolean().default(!0)}).prefault({}),verify:U.object({enabled:U.boolean().default(!0),checks:U.array(U.enum(["typecheck","build","test"])).default(["typecheck","build","test"]),timeoutMs:U.number().int().positive().default(15*6e4),generatedSourceGlobs:U.array(U.string()).default([])}).prefault({})}),md=kN.parse({});function M2(e){return e.pullRequest.draft??e.remediation.draftPr??!0}var mk={none:0,low:1,medium:2,high:3};function _N(e,t){return mk[e]<=mk[t]}function L2(e,t){return mk[e]-mk[t]}var fme=[".github/drift.yml",".github/drift.yaml","drift.yml","drift.yaml"];function mme(e,t=null){let n=[];if(!e.trim())return{config:md,path:t,problems:n};let i;try{i=(0,F2.parse)(e)}catch(c){return n.push(`Could not parse ${t??"config"} as YAML: ${c.message}`),{config:md,path:t,problems:n}}if(i==null)return{config:md,path:t,problems:n};let r=hme(i),o=gme(i),s=kN.safeParse(i);if(!s.success){for(let c of s.error.issues){let l=c.path.length?c.path.join("."):"(root)";n.push(`${l}: ${c.message}`)}return n.push("Falling back to Drift defaults (mode: approve)."),{config:md,path:t,problems:n}}let a=s.data;return r&&!o&&(a.remediation.agent={...a.remediation.agent,provider:"copilot-cloud",model:r},n.push("`remediation.model` is deprecated and now treated as `remediation.agent.model` for `copilot-cloud`. Use `remediation.agent` for new configuration.")),{config:a,path:t,problems:n}}function gme(e){if(!gk(e))return!1;let t=e.remediation;return gk(t)&&t.agent!==void 0}function hme(e){if(!gk(e))return null;let t=e.remediation;return gk(t)&&typeof t.model=="string"&&t.model.trim()?t.model:null}function gk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}async function hk(e){for(let t of fme){let n;try{n=await e(t)}catch{continue}if(n!==null)return mme(n,t)}return{config:md,path:null,problems:[]}}var I4=require("node:zlib");function Ys(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}function yk(e,t,n,i){if(typeof n!="function")throw new Error("method for before hook must be a function");return i||(i={}),Array.isArray(t)?t.reverse().reduce((r,o)=>yk.bind(null,e,o,r,i),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((r,o)=>o.hook.bind(null,r,i),n)():n(i))}function U2(e,t,n,i){let r=i;e.registry[n]||(e.registry[n]=[]),t==="before"&&(i=(o,s)=>Promise.resolve().then(r.bind(null,s)).then(o.bind(null,s))),t==="after"&&(i=(o,s)=>{let a;return Promise.resolve().then(o.bind(null,s)).then(c=>(a=c,r(a,s))).then(()=>a)}),t==="error"&&(i=(o,s)=>Promise.resolve().then(o.bind(null,s)).catch(a=>r(a,s))),e.registry[n].push({hook:i,orig:r})}function j2(e,t,n){if(!e.registry[t])return;let i=e.registry[t].map(r=>r.orig).indexOf(n);i!==-1&&e.registry[t].splice(i,1)}var z2=Function.bind,G2=z2.bind(z2);function V2(e,t,n){let i=G2(j2,null).apply(null,n?[t,n]:[t]);e.api={remove:i},e.remove=i,["before","error","after","wrap"].forEach(r=>{let o=n?[t,r,n]:[t,r];e[r]=e.api[r]=G2(U2,null).apply(null,o)})}function yme(){let e=Symbol("Singular"),t={registry:{}},n=yk.bind(null,t,e);return V2(n,t,e),n}function bme(){let e={registry:{}},t=yk.bind(null,e);return V2(t,e),t}var B2={Singular:yme,Collection:bme};var vme="0.0.0-development",wme=`octokit-endpoint.js/${vme} ${Ys()}`,kme={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":wme},mediaType:{format:""}};function _me(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function $me(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function K2(e,t){let n=Object.assign({},e);return Object.keys(t).forEach(i=>{$me(t[i])?i in e?n[i]=K2(e[i],t[i]):Object.assign(n,{[i]:t[i]}):Object.assign(n,{[i]:t[i]})}),n}function q2(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function SN(e,t,n){if(typeof t=="string"){let[r,o]=t.split(" ");n=Object.assign(o?{method:r,url:o}:{url:r},n)}else n=Object.assign({},t);n.headers=_me(n.headers),q2(n),q2(n.headers);let i=K2(e||{},n);return n.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(i.mediaType.previews=e.mediaType.previews.filter(r=>!i.mediaType.previews.includes(r)).concat(i.mediaType.previews)),i.mediaType.previews=(i.mediaType.previews||[]).map(r=>r.replace(/-preview/,""))),i}function Sme(e,t){let n=/\?/.test(e)?"&":"?",i=Object.keys(t);return i.length===0?e:e+n+i.map(r=>r==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${r}=${encodeURIComponent(t[r])}`).join("&")}var xme=/\{[^{}}]+\}/g;function Eme(e){return e.replace(/(?:^\W+)|(?:(?n.concat(i),[]):[]}function W2(e,t){let n={__proto__:null};for(let i of Object.keys(e))t.indexOf(i)===-1&&(n[i]=e[i]);return n}function H2(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function hd(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Sg(e,t,n){return t=e==="+"||e==="#"?H2(t):hd(t),n?hd(n)+"="+t:t}function gd(e){return e!=null}function $N(e){return e===";"||e==="&"||e==="?"}function Ime(e,t,n,i){var r=e[n],o=[];if(gd(r)&&r!=="")if(typeof r=="string"||typeof r=="number"||typeof r=="bigint"||typeof r=="boolean")r=r.toString(),i&&i!=="*"&&(r=r.substring(0,parseInt(i,10))),o.push(Sg(t,r,$N(t)?n:""));else if(i==="*")Array.isArray(r)?r.filter(gd).forEach(function(s){o.push(Sg(t,s,$N(t)?n:""))}):Object.keys(r).forEach(function(s){gd(r[s])&&o.push(Sg(t,r[s],s))});else{let s=[];Array.isArray(r)?r.filter(gd).forEach(function(a){s.push(Sg(t,a))}):Object.keys(r).forEach(function(a){gd(r[a])&&(s.push(hd(a)),s.push(Sg(t,r[a].toString())))}),$N(t)?o.push(hd(n)+"="+s.join(",")):s.length!==0&&o.push(s.join(","))}else t===";"?gd(r)&&o.push(hd(n)):r===""&&(t==="&"||t==="?")?o.push(hd(n)+"="):r===""&&o.push("");return o}function Ame(e){return{expand:Rme.bind(null,e)}}function Rme(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(i,r,o){if(r){let a="",c=[];if(n.indexOf(r.charAt(0))!==-1&&(a=r.charAt(0),r=r.substr(1)),r.split(/,/g).forEach(function(l){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(l);c.push(Ime(t,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var s=",";return a==="?"?s="&":a!=="#"&&(s=a),(c.length!==0?a:"")+c.join(s)}else return c.join(",")}else return H2(o)}),e==="/"?e:e.replace(/\/$/,"")}function J2(e){let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),i=Object.assign({},e.headers),r,o=W2(e,["method","baseUrl","url","headers","request","mediaType"]),s=Tme(n);n=Ame(n).expand(o),/^http/.test(n)||(n=e.baseUrl+n);let a=Object.keys(e).filter(u=>s.includes(u)).concat("baseUrl"),c=W2(o,a);if(!/application\/octet-stream/i.test(i.accept)&&(e.mediaType.format&&(i.accept=i.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&e.mediaType.previews?.length)){let u=i.accept.match(/(?{let p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=Sme(n,c):"data"in c?r=c.data:Object.keys(c).length&&(r=c),!i["content-type"]&&typeof r<"u"&&(i["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof r>"u"&&(r=""),Object.assign({method:t,url:n,headers:i},typeof r<"u"?{body:r}:null,e.request?{request:e.request}:null)}function Cme(e,t,n){return J2(SN(e,t,n))}function Z2(e,t){let n=SN(e,t),i=Cme.bind(null,n);return Object.assign(i,{DEFAULTS:n,defaults:Z2.bind(null,n),merge:SN.bind(null,n),parse:J2})}var Y2=Z2(null,kme);var X2=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function e4(e,t){let n=t?.comma===!0?Dme:65536,i=e.length,r=EN(e,t?.start??0,i),o=r;r=xN(e,r,i,n);let s=TN(e,o,r),a=e.slice(o,s).toLowerCase();return t?.parameters===!1?{type:a,index:r,parameters:new X2}:Ome(e,a,r,i,n)}var t4=32,n4=9,r4=59,Nme=61,Q2=34,Pme=92,Dme=44;function Ome(e,t,n,i,r){let o=new X2;e:for(;nt;){let i=e.charCodeAt(n-1);if(i!==t4&&i!==n4)break;n--}return n}var Mme=/^-?\d+$/,vk=/^-?\d+n+$/,Qs=JSON.stringify,IN=JSON.parse,c4=/^-?\d+n$/,i4=/([\[:])?"(-?\d+)n"($|\s*[,\}\]])/g,o4=/([\[:])?("-?\d+n+)n("$|"\s*[,\}\]])/g,AN=e=>e===void 0||typeof e=="function"||typeof e=="symbol",RN=e=>e!==null&&typeof e=="object"&&e.constructor&&e.constructor.name==="RawJSON",Lme=(e,t,n)=>{let i="";typeof n=="number"?i=" ".repeat(Math.min(10,Math.max(0,Math.floor(n)))):typeof n=="string"&&(i=n.slice(0,10));let r=typeof t=="function",o=Array.isArray(t)?new Set(t.map(String)):null,s=(m,g,h)=>(h!==null&&typeof h=="object"&&typeof h.toJSON=="function"&&(h=h.toJSON(g)),typeof h=="string"&&vk.test(h)?h+"n":typeof h=="bigint"?"rawJSON"in JSON?JSON.rawJSON(h.toString()):h.toString()+"n":(r&&(h=t.call(m,g,h)),h!==null&&typeof h=="object"&&(h instanceof Number||h instanceof String||h instanceof Boolean)&&(h=h.valueOf()),h)),a=s({"":e},"",e);if(AN(a))return;let c=a===null||typeof a!="object",l=RN(a);if(c||l)return Qs(a);let u=[],d=0,p=[{parent:{"":a},key:"",val:a,isArray:Array.isArray(a),keys:Array.isArray(a)?null:Object.keys(a),index:0,first:!0}],f=new WeakSet([a]);for(;p.length>0;){let m=p[p.length-1];m.index===0&&(u.push(m.isArray?"[":"{"),d++);let g=!1;if(m.isArray)if(m.index=m.keys.length&&p[p.length-1]===m&&(g=!0)}g&&(d--,!m.first&&i&&u.push(` +`+i.repeat(d)),u.push(m.isArray?"]":"}"),f.delete(m.val),p.pop())}return u.join("")},l4=(e,t,n)=>{try{return"rawJSON"in JSON?Qs(e,(a,c)=>typeof c=="bigint"?JSON.rawJSON(c.toString()):typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n):e?Qs(e,(a,c)=>typeof c=="string"&&vk.test(c)||typeof c=="bigint"?c.toString()+"n":typeof t=="function"?t(a,c):(Array.isArray(t)&&t.includes(a),c),n).replace(i4,"$1$2$3").replace(o4,"$1$2$3"):Qs(e,t,n)}catch(i){if(i instanceof RangeError){let r=Lme(e,t,n);return r===void 0?void 0:"rawJSON"in JSON?r:r.replace(i4,"$1$2$3").replace(o4,"$1$2$3")}throw i}},bk=new Map,Fme=()=>{let e=JSON.parse.toString();if(bk.has(e))return bk.get(e);try{let t=JSON.parse("1",(n,i,r)=>!!r?.source&&r.source==="1");return bk.set(e,t),t}catch{return bk.set(e,!1),!1}},Ume=(e,t,n,i)=>typeof t=="string"&&c4.test(t)?BigInt(t.slice(0,-1)):typeof t=="string"&&vk.test(t)?t.slice(0,-1):typeof i=="function"?i(e,t,n):t,jme=(e,t)=>JSON.parse(e,(n,i,r)=>{let o=typeof i=="number",s=i>Number.MAX_SAFE_INTEGER||i{let n={"":e},i=[{parent:n,key:"",visited:!1}];for(;i.length>0;){let r=i[i.length-1];if(r.visited){let{parent:o,key:s}=r,a=o[s];typeof a=="string"&&(c4.test(a)?a=BigInt(a.slice(0,-1)):vk.test(a)&&(a=a.slice(0,-1))),typeof t=="function"&&(a=t.call(o,s,a)),a===void 0?delete o[s]:o[s]=a,i.pop()}else{r.visited=!0;let o=r.parent[r.key];if(o!==null&&typeof o=="object"){let a=Object.keys(o);for(let c=a.length-1;c>=0;c--)i.push({parent:o,key:a[c],visited:!1})}}}return n[""]},a4=e=>e.replace(zme,(t,n,i,r)=>{let o=t[0]==='"';if(o&&Gme.test(t))return t.substring(0,t.length-1)+'n"';let a=i||r,c=n&&(n.length{if(!e)return IN(e,t);try{if(Fme())return jme(e,t);let n=a4(e);return IN(n,(i,r,o)=>Ume(i,r,o,t))}catch(n){if(n instanceof RangeError){let i=a4(e),r=IN(i);return Vme(r,t)}throw n}};var Dc=class extends Error{name;status;request;response;constructor(t,n,i){super(t,{cause:i.cause}),this.name="HttpError",this.status=Number.parseInt(n),Number.isNaN(this.status)&&(this.status=0);"response"in i&&(this.response=i.response);let r=Object.assign({},i.request);i.request.headers.authorization&&(r.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/(?"";async function f4(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let n=e.request?.log||console,i=e.request?.parseSuccessResponseBody!==!1,r=Wme(e.body)||Array.isArray(e.body)?l4(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([d,p])=>[d,String(p)])),s;try{s=await t(e.url,{method:e.method,body:r,redirect:e.request?.redirect,headers:o,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(d){let p="Unknown Error";if(d instanceof Error){if(d.name==="AbortError")throw d.status=500,d;p=d.message,d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?p=d.cause.message:typeof d.cause=="string"&&(p=d.cause))}let f=new Dc(p,500,{request:e});throw f.cause=d,f}let a=s.status,c=s.url,l={};for(let[d,p]of s.headers)l[d]=p;let u={url:c,status:a,headers:l,data:""};if("deprecation"in l){let d=l.link&&l.link.match(/<([^<>]+)>; rel="deprecation"/),p=d&&d.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${l.sunset}${p?`. See ${p}`:""}`)}if(a===204||a===205)return u;if(e.method==="HEAD"){if(a<400)return u;throw new Dc(s.statusText,a,{response:u,request:e})}if(a===304)throw u.data=await CN(s),new Dc("Not modified",a,{response:u,request:e});if(a>=400)throw u.data=await CN(s),new Dc(Hme(u.data),a,{response:u,request:e});return u.data=i?await CN(s):s.body,u}async function CN(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(p4);let n=e4(t);if(Kme(n)){let i="";try{return i=await e.text(),d4(i)}catch{return i}}else return n.type.startsWith("text/")||n.parameters.charset?.toLowerCase()==="utf-8"&&n.type!=="application/octet-stream"?e.text().catch(p4):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function Kme(e){return e.type==="application/json"||e.type==="application/scim+json"}function Hme(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if(typeof e=="object"&&e!==null&&"message"in e){let t=e,n="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(i=>JSON.stringify(i)).join(", ")}${n}`:`${t.message}${n}`}return`Unknown error: ${JSON.stringify(e)}`}function NN(e,t){let n=e.defaults(t);return Object.assign(function(r,o){let s=n.merge(r,o);if(!s.request||!s.request.hook)return f4(n.parse(s));let a=(c,l)=>f4(n.parse(n.merge(c,l)));return Object.assign(a,{endpoint:n,defaults:NN.bind(null,n)}),s.request.hook(a,s)},{endpoint:n,defaults:NN.bind(null,n)})}var xg=NN(Y2,qme);var Jme="0.0.0-development";function Zme(e){return`Request failed due to following response errors: `+e.errors.map(t=>` - ${t.message}`).join(` -`)}var Bme=class extends Error{constructor(e,t,n){super(Vme(n)),this.request=e,this.headers=t,this.response=n,this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}request;headers;response;name="GraphqlResponseError";errors;data},qme=["method","baseUrl","url","headers","request","query","mediaType","operationName"],Wme=["query","method","url"],c4=/\/api\/v3\/?$/;function Hme(e,t,n){if(n){if(typeof t=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let s in n)if(Wme.includes(s))return Promise.reject(new Error(`[@octokit/graphql] "${s}" cannot be used as variable name`))}let i=typeof t=="string"?Object.assign({query:t},n):t,r=Object.keys(i).reduce((s,a)=>qme.includes(a)?(s[a]=i[a],s):(s.variables||(s.variables={}),s.variables[a]=i[a],s),{}),o=i.baseUrl||e.endpoint.DEFAULTS.baseUrl;return c4.test(o)&&(r.url=o.replace(c4,"/api/graphql")),e(r).then(s=>{if(s.data.errors){let a={};for(let c of Object.keys(s.headers))a[c]=s.headers[c];throw new Bme(r,a,s.data)}return s.data.data})}function xC(e,t){let n=e.defaults(t);return Object.assign((r,o)=>Hme(n,r,o),{defaults:xC.bind(null,n),endpoint:n.endpoint})}var UHe=xC(bg,{headers:{"user-agent":`octokit-graphql.js/${Gme} ${Ys()}`},method:"POST",url:"/graphql"});function l4(e){return xC(e,{method:"POST",url:"/graphql"})}var EC="(?:[a-zA-Z0-9_-]+)",u4="\\.",d4=new RegExp(`^${EC}${u4}${EC}${u4}${EC}$`),Kme=d4.test.bind(d4);async function Jme(e){let t=Kme(e),n=e.startsWith("v1.")||e.startsWith("ghs_"),i=e.startsWith("ghu_");return{type:"token",token:e,tokenType:t?"app":n?"installation":i?"user-to-server":"oauth"}}function Zme(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Yme(e,t,n,i){let r=t.endpoint.merge(n,i);return r.headers.authorization=Zme(e),t(r)}var p4=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(Jme.bind(null,t),{hook:Yme.bind(null,t)})};var TC="7.0.8";var f4=()=>{},Qme=console.warn.bind(console),Xme=console.error.bind(console);function ege(e={}){return typeof e.debug!="function"&&(e.debug=f4),typeof e.info!="function"&&(e.info=f4),typeof e.warn!="function"&&(e.warn=Qme),typeof e.error!="function"&&(e.error=Xme),e}var m4=`octokit-core.js/${TC} ${Ys()}`,fk=class{static VERSION=TC;static defaults(t){return class extends this{constructor(...i){let r=i[0]||{};if(typeof t=="function"){super(t(r));return}super(Object.assign({},t,r,r.userAgent&&t.userAgent?{userAgent:`${r.userAgent} ${t.userAgent}`}:null))}}}static plugins=[];static plugin(...t){let n=this.plugins;return class extends this{static plugins=n.concat(t.filter(r=>!n.includes(r)))}}constructor(t={}){let n=new F2.Collection,i={baseUrl:bg.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(i.headers["user-agent"]=t.userAgent?`${t.userAgent} ${m4}`:m4,t.baseUrl&&(i.baseUrl=t.baseUrl),t.previews&&(i.mediaType.previews=t.previews),t.timeZone&&(i.headers["time-zone"]=t.timeZone),this.request=bg.defaults(i),this.graphql=l4(this.request).defaults(i),this.log=ege(t.log),this.hook=n,t.authStrategy){let{authStrategy:o,...s}=t,a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let o=p4(t.auth);n.wrap("request",o.hook),this.auth=o}let r=this.constructor;for(let o=0;o{e.log.debug("request",n);let i=Date.now(),r=e.request.endpoint.parse(n),o=r.url.replace(n.baseUrl,"");return t(n).then(s=>{let a=s.headers["x-github-request-id"];return e.log.info(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s}).catch(s=>{let a=s.response?.headers["x-github-request-id"]||"UNKNOWN";throw e.log.error(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s})})}IC.VERSION=g4;var tge="0.0.0-development";function nge(e){if(!e.data)return{...e,data:[]};if(!(("total_count"in e.data||"total_commits"in e.data)&&!("url"in e.data)))return e;let n=e.data.incomplete_results,i=e.data.repository_selection,r=e.data.total_count,o=e.data.total_commits;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count,delete e.data.total_commits;let s=Object.keys(e.data)[0],a=e.data[s];return e.data=a,typeof n<"u"&&(e.data.incomplete_results=n),typeof i<"u"&&(e.data.repository_selection=i),e.data.total_count=r,e.data.total_commits=o,e}function AC(e,t,n){let i=typeof t=="function"?t.endpoint(n):e.request.endpoint(t,n),r=typeof t=="function"?t:e.request,o=i.method,s=i.headers,a=i.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{let c=await r({method:o,url:a,headers:s}),l=nge(c);if(a=((l.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!a&&"total_commits"in l.data){let u=new URL(l.url),d=u.searchParams,p=parseInt(d.get("page")||"1",10),f=parseInt(d.get("per_page")||"250",10);p*f{if(r.done)return t;let o=!1;function s(){o=!0}return t=t.concat(i?i(r.value,s):r.value.data),o?t:y4(e,t,n,i)})}var nKe=Object.assign(h4,{iterator:AC});function RC(e){return{paginate:Object.assign(h4.bind(null,e),{iterator:AC.bind(null,e)})}}RC.VERSION=tge;var NC="17.0.0";var rge={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},b4=rge;var Pc=new Map;for(let[e,t]of Object.entries(b4))for(let[n,i]of Object.entries(t)){let[r,o,s]=i,[a,c]=r.split(/ /),l=Object.assign({method:a,url:c},o);Pc.has(e)||Pc.set(e,new Map),Pc.get(e).set(n,{scope:e,methodName:n,endpointDefaults:l,decorations:s})}var ige={has({scope:e},t){return Pc.get(e).has(t)},getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty(e,t,n){return Object.defineProperty(e.cache,t,n),!0},deleteProperty(e,t){return delete e.cache[t],!0},ownKeys({scope:e}){return[...Pc.get(e).keys()]},set(e,t,n){return e.cache[t]=n},get({octokit:e,scope:t,cache:n},i){if(n[i])return n[i];let r=Pc.get(t).get(i);if(!r)return;let{endpointDefaults:o,decorations:s}=r;return s?n[i]=oge(e,t,i,o,s):n[i]=e.request.defaults(o),n[i]}};function CC(e){let t={};for(let n of Pc.keys())t[n]=new Proxy({octokit:e,scope:n,cache:{}},ige);return t}function oge(e,t,n,i,r){let o=e.request.defaults(i);function s(...a){let c=o.endpoint.merge(...a);if(r.mapToData)return c=Object.assign({},c,{data:c[r.mapToData],[r.mapToData]:void 0}),o(c);if(r.renamed){let[l,u]=r.renamed;e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${l}.${u}()`)}if(r.deprecated&&e.log.warn(r.deprecated),r.renamedParameters){let l=o.endpoint.merge(...a);for(let[u,d]of Object.entries(r.renamedParameters))u in l&&(e.log.warn(`"${u}" parameter is deprecated for "octokit.${t}.${n}()". Use "${d}" instead`),d in l||(l[d]=l[u]),delete l[u]);return o(l)}return o(...a)}return Object.assign(s,o)}function sge(e){return{rest:CC(e)}}sge.VERSION=NC;function PC(e){let t=CC(e);return{...t,rest:t}}PC.VERSION=NC;var v4="22.0.1";var w4=fk.plugin(IC,PC,RC).defaults({userAgent:`octokit-rest.js/${v4}`});var age="drift",mk=class{octokit;logger;selfLogin;constructor(t){this.octokit=new w4({auth:t.repoToken,baseUrl:t.baseUrl??"https://api.github.com",userAgent:"drift-bot/0.1"}),this.logger=t.logger}async readFile(t,n,i){try{let o=(await this.octokit.repos.getContent({owner:t.owner,repo:t.repo,path:n,ref:i})).data;return Array.isArray(o)||o.type!=="file"||!("content"in o)?null:Buffer.from(o.content,"base64").toString("utf8")}catch(r){if(k4(r))return null;throw this.logger.debug(`Failed to read ${n}@${i}: ${r.message}`),r}}async listFiles(t,n){try{let i=await this.octokit.git.getTree({owner:t.owner,repo:t.repo,tree_sha:n,recursive:"true"});return i.data.truncated?(this.logger.warn(`The file tree at ${n} is too large for GitHub to return in full, so path patterns cannot be expanded against it. List the contract documents by literal path instead.`),null):i.data.tree.filter(r=>r.type==="blob"&&typeof r.path=="string").map(r=>r.path)}catch(i){return this.logger.debug(`Could not list the tree at ${n}: ${i.message}`),null}}async changedFiles(t){try{let n=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`}),i=n.data.files??[],r=n.data.commits??[];return i.length>=300||r.lengths.filename)}catch(n){throw this.logger.warn(`Could not compare ${t.beforeSha}...${t.afterSha}: ${n.message}`),n}}async changedFilesByCommit(t){let n=new Set;for await(let r of this.octokit.paginate.iterator(this.octokit.repos.compareCommitsWithBasehead,{owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`,per_page:250})){let o=r.data;for(let s of o.commits??[])n.add(s.sha)}let i=new Set;for(let r of n)for await(let o of this.octokit.paginate.iterator(this.octokit.repos.getCommit,{owner:t.owner,repo:t.repo,ref:r,per_page:300})){let s=o.data;for(let a of s.files??[])i.add(a.filename)}return[...i]}async createBranch(t,n,i){try{return await this.octokit.git.createRef({owner:t.owner,repo:t.repo,ref:`refs/heads/${n}`,sha:i}),this.logger.info(`Created branch ${n} at ${i.slice(0,7)}`),!0}catch(r){if(lge(r)){let o=await this.getBranchHead(t,n);return o===i?(this.logger.info(`Branch ${n} already exists at ${i.slice(0,7)}; reusing it`),!0):o&&await this.isAncestor(t,i,o)?await this.commitsAreAllBots(t,i,o)?(this.logger.info(`Branch ${n} already exists ahead of ${i.slice(0,7)}; reusing it`),!0):(this.logger.error(`Branch ${n} already exists ahead of ${i.slice(0,7)} with commit(s) not made by Drift; refusing to reuse a branch that may carry manual changes`),!1):(this.logger.error(`Branch ${n} already exists but is not based on ${i.slice(0,7)} (current head: ${o??"unknown"}); refusing to reuse a stale branch`),!1)}return this.logger.error(`Could not create branch ${n}: ${r.message}`),!1}}async isAncestor(t,n,i){if(n===i)return!0;try{let r=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`});return r.data.status==="ahead"||r.data.status==="identical"}catch{return!1}}async commitsAreAllBots(t,n,i){try{let o=(await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`})).data.commits??[];return o.length===0?!0:o.every(s=>(s.author?.login??s.committer?.login??"").endsWith("[bot]"))}catch{return!1}}async commitFiles(t,n,i,r){if(i.length===0)return null;try{let s=(await this.octokit.git.getRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`})).data.object.sha,a=await this.octokit.git.getCommit({owner:t.owner,repo:t.repo,commit_sha:s}),c=await Promise.all(i.map(async d=>{let p=await this.octokit.git.createBlob({owner:t.owner,repo:t.repo,content:Buffer.from(d.content,"utf8").toString("base64"),encoding:"base64"});return{path:d.path,mode:"100644",type:"blob",sha:p.data.sha}})),l=await this.octokit.git.createTree({owner:t.owner,repo:t.repo,base_tree:a.data.tree.sha,tree:c}),u=await this.octokit.git.createCommit({owner:t.owner,repo:t.repo,message:r,tree:l.data.sha,parents:[s]});return await this.octokit.git.updateRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`,sha:u.data.sha}),this.logger.info(`Committed ${i.length} file(s) to ${n}: ${u.data.sha.slice(0,7)}`),{sha:u.data.sha}}catch(o){return this.logger.error(`Could not commit to ${n}: ${o.message}`),null}}async createIssue(t,n){try{let i=await this.octokit.issues.create({owner:t.owner,repo:t.repo,title:n.title,body:n.body,labels:n.labels,assignees:n.assignees});return{number:i.data.number,url:i.data.html_url}}catch(i){return this.logger.error(`Could not create issue: ${i.message}`),null}}async getCollaboratorPermission(t,n){try{let i=await this.octokit.repos.getCollaboratorPermissionLevel({owner:t.owner,repo:t.repo,username:n}),r=i.data.permission,s=(i.data.role_name??r??"").toLowerCase();switch(s){case"admin":case"maintain":case"write":case"triage":case"read":case"none":return s;case"push":return"write";case"pull":return"read";default:return this.logger.warn(`Unrecognised permission \`${s}\` for ${n}; treating it as unknown and refusing.`),null}}catch(i){return k4(i)?"none":(this.logger.warn(`Could not determine ${n}'s permission on ${t.owner}/${t.repo}: ${i.message}`),null)}}async getAuthenticatedLogin(){if(this.selfLogin!==void 0)return this.selfLogin;try{let t=await this.octokit.users.getAuthenticated();this.selfLogin=t.data.login}catch{this.selfLogin=null}return this.selfLogin}async getIssue(t,n){try{let i=await this.octokit.issues.get({owner:t.owner,repo:t.repo,issue_number:n});return{number:i.data.number,body:i.data.body??null,state:i.data.state,labels:i.data.labels.map(r=>typeof r=="string"?r:r.name??"").filter(Boolean),pullRequest:!!i.data.pull_request}}catch(i){return this.logger.warn(`Could not read issue #${n}: ${i.message}`),null}}async listIssueComments(t,n){try{return(await this.octokit.issues.listComments({owner:t.owner,repo:t.repo,issue_number:n,per_page:100})).data.map(r=>({id:r.id,body:r.body??null,authorLogin:r.user?.login??null}))}catch(i){throw this.logger.warn(`Could not list comments on #${n}: ${i.message}`),i}}async commitExists(t,n){try{return await this.octokit.repos.getCommit({owner:t.owner,repo:t.repo,ref:n}),!0}catch{return!1}}async getBranchHead(t,n){try{return(await this.octokit.repos.getBranch({owner:t.owner,repo:t.repo,branch:n})).data.commit.sha}catch{return null}}async commentOnIssue(t,n,i){try{return await this.octokit.issues.createComment({owner:t.owner,repo:t.repo,issue_number:n,body:i}),!0}catch(r){return this.logger.warn(`Could not comment on #${n}: ${r.message}`),!1}}async findOpenPlanIssue(t,n){try{return(await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open in:body "${n}"`,per_page:1})).data.items[0]?.number??null}catch{return null}}async findOpenAlertIssues(t){try{let n=await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open label:${age} "drift-alert:"`,per_page:100}),i=[];for(let r of n.data.items){let o=//.exec(r.body??"");o&&i.push({number:r.number,marker:o[1]})}return i}catch{return[]}}async updateIssueBody(t,n,i){try{await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,body:i})}catch(r){this.logger.warn(`Could not update issue #${n}: ${r.message}`)}}async updateIssueComment(t,n,i){try{await this.octokit.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:i})}catch(r){this.logger.warn(`Could not update comment ${n}: ${r.message}`)}}async closeIssue(t,n,i){try{i&&await this.commentOnIssue(t,n,i),await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,state:"closed"})}catch(r){this.logger.warn(`Could not close issue #${n}: ${r.message}`)}}async createCheckRun(t,n){try{await this.octokit.checks.create({owner:t.owner,repo:t.repo,name:n.name,head_sha:t.afterSha,status:"completed",conclusion:n.conclusion,output:{title:n.title,summary:n.summary,text:n.text}})}catch(i){this.logger.debug(`Could not create check run: ${i.message}`)}}async uploadSarif(t,n){let i=(0,$4.gzipSync)(Buffer.from(JSON.stringify(n.sarif),"utf8")),r=3;for(let o=1;o<=r;o++)try{return await this.octokit.codeScanning.uploadSarif({owner:t.owner,repo:t.repo,commit_sha:n.commitSha,ref:n.ref,sarif:i.toString("base64")}),this.logger.info("Uploaded SARIF results to code scanning."),!0}catch(s){let a=s?.status;if(a===403)return this.logger.warn("Could not upload code scanning results: the token is missing `security-events: write`. Add it to the workflow job's `permissions` to enable Drift's code scanning alerts."),!1;if((a===void 0||a>=500)&&os.includes("/")).map(s=>s.split("/").pop()),o=i.reviewers.filter(s=>!s.includes("/"));await this.octokit.pulls.requestReviewers({owner:t.owner,repo:t.repo,pull_number:n,reviewers:o,team_reviewers:r})}catch(r){this.logger.warn(`Could not request reviewers on #${n}: ${r.message}`)}}async updatePullRequestBody(t,n,i){try{await this.octokit.pulls.update({owner:t.owner,repo:t.repo,pull_number:n,body:i})}catch(r){this.logger.warn(`Could not update PR #${n}: ${r.message}`)}}async getDefaultBranch(t,n){try{return(await this.octokit.repos.get({owner:t,repo:n})).data.default_branch}catch{return null}}asRepoProvider(t){return{changedFiles:()=>this.changedFiles(t),readFile:(n,i)=>this.readFile(t,n,i),listFiles:n=>this.listFiles(t,n)}}get rest(){return this.octokit}};function cge(e){return new Promise(t=>setTimeout(t,e))}function k4(e){return e?.status===404}function lge(e){let t=e?.status,n=e?.message??"";return t===422&&/already exists/i.test(n)}var Cx=require("node:path"),Ff=require("node:fs/promises");function DC(e,t){return uge(e).test(t)}function Yo(e,t){return e.some(n=>DC(n,t))}var _4=new Map;function uge(e){let t=_4.get(e);if(t)return t;let n="^";for(let r=0;r{let c={kind:"list",items:[]};i.items.push(c),i=c,r.push(c)};for(let c=0;cs&&(i.items.length>0&&a(),i.items.push(vW(t.slice(s,c),!0)),s=c,a()),o=!0):(o&&c>s&&(i.items.push(Tk(!0,t.slice(s,c))),s=c,a()),o=!1)}for(t.length>s&&i.items.push(Tk(o,t.slice(s)));r.length;)$be(r.pop());return{items:n}}function hW(e,t){return Ik(e.items,t.items)}function yW(e){let t=[],n=e.items;for(;n;){let i=null;for(let r of n.items){if(r.kind==="int"){t.push(Number(r.value));continue}r.kind==="list"&&t.length>0&&(i=r);break}n=i}return t.length?t:null}function bW(e){let t=n=>n.items.some(i=>i.kind==="list"?t(i):i.kind!=="string"?!1:Sg(i.value)="0"&&e<="9"}function nP(e){return{kind:"int",value:e}}function Tk(e,t){if(e){let n=t.replace(/^0+/,"")||"0";return nP(BigInt(n))}return vW(t,!1)}function vW(e,t){let n=e;return t&&n.length===1&&(n=vbe.get(n)??n),{kind:"string",value:bbe.get(n)??n}}function Sg(e){let t=tP.indexOf(e);return t===-1?`${tP.length}-${e}`:String(t)}function kbe(e){switch(e.kind){case"int":return e.value===0n;case"string":return Sg(e.value)===rP;case"list":return e.items.length===0}}function $be(e){for(let t=e.items.length-1;t>=0;t--){let n=e.items[t];if(kbe(n))e.items.splice(t,1);else if(n.kind!=="list")break}}function mW(e,t){return et?1:0}function Ik(e,t){switch(e.kind){case"int":return _be(e,t);case"string":return Sbe(e,t);case"list":return xbe(e,t)}}function _be(e,t){if(t===null)return e.value===0n?0:1;switch(t.kind){case"int":return e.valuet.value?1:0;case"string":return 1;case"list":return 1}}function Sbe(e,t){if(t===null)return mW(Sg(e.value),rP);switch(t.kind){case"int":return-1;case"string":return mW(Sg(e.value),Sg(t.value));case"list":return-1}}function xbe(e,t){if(t===null)return e.items.length===0?0:Ik(e.items[0],null);switch(t.kind){case"int":return-1;case"string":return 1;case"list":{let n=Math.max(e.items.length,t.items.length);for(let i=0;iTe(t,e),compare:Qe,satisfies:(t,n)=>AW(t,n),sameCompatibilityLine:Ebe,classifyBump:sP,exactVersion:t=>RW(t,e)}}function Te(e,t){let n=e.trim();if(!n||/\s/.test(n))return null;if(SW.has(t)){let r=t==="go"||t==="swift"||t==="cocoapods"?n.replace(/^v(?=\d)/,""):n,o=ea.default.valid(r);if(!o){let a=/^(\d+(?:\.\d+){0,1})([-+][0-9A-Za-z.-]+)?$/.exec(r);if(a){let c=a[1].split(".");o=ea.default.valid(`${c.join(".")}${".0".repeat(3-c.length)}${a[2]??""}`)}}if(!o)return null;let s=ea.default.parse(o);return{raw:n,ecosystem:t,prerelease:s.prerelease.length>0,comparable:{kind:"semver",value:o},release:[s.major,s.minor,s.patch]}}if(t==="pypi"){let i=CW(n);return i?{raw:n,ecosystem:t,prerelease:i.pre!==null||i.dev!==null,comparable:{kind:"pep440",value:i},release:i.release}:null}if(t==="rubygems"){if(!/^\d[0-9A-Za-z._-]*$/.test(n))return null;let i=Pbe(n);return{raw:n,ecosystem:t,prerelease:i.some(r=>typeof r=="string"),comparable:{kind:"ruby",value:i},release:zbe(i)}}if(t==="maven"){if(!/^\d[0-9A-Za-z._+-]*$/.test(n))return null;let i=gW(n);return{raw:n,ecosystem:t,prerelease:bW(i),comparable:{kind:"maven",value:i},release:yW(i)}}if(t==="nuget"){let i=Mbe(n);return i?{raw:n,ecosystem:t,prerelease:i.prerelease!==null,comparable:{kind:"nuget",value:i},release:i.release}:null}if(t==="opam"){if(!/\d/.test(n))return null;let i=/^v?(\d+(?:\.\d+)*)/.exec(n)?.[1]?.split(".").map(Number)??null;return{raw:n,ecosystem:t,prerelease:/(?:^|[._+-])(?:alpha|beta|pre|preview|rc|dev)\d*/i.test(n),comparable:{kind:"opam",value:n},release:i}}return null}function Qe(e,t){if(e.ecosystem!==t.ecosystem||e.comparable.kind!==t.comparable.kind)return null;switch(e.comparable.kind){case"semver":return ea.default.compare(e.comparable.value,t.comparable.value);case"pep440":return zi(e.comparable.value,t.comparable.value);case"ruby":return Dbe(e.comparable.value,t.comparable.value);case"maven":return hW(e.comparable.value,t.comparable.value);case"nuget":return Lbe(e.comparable.value,t.comparable.value);case"opam":return Fbe(e.comparable.value,t.comparable.value)}}function Eg(e,t,n){if(NW(n)){let s=iP(e),a=iP(t);return s&&a&&s===a?0:null}let i=Gi(n),r=i.parse(e),o=i.parse(t);return r&&o?i.compare(r,o):null}function xW(e,t,n){let i=Te(e,n);return i?AW(i,t):null}function oP(e,t,n){if(e===null&&t!==null)return"added";if(e!==null&&t===null)return"removed";if(e===null||t===null)return"unknown";let i=Te(e,n),r=Te(t,n);return i&&r?sP(i,r):"unknown"}function EW(e,t,n){if(e===null||t===null)return oP(e,t,n);let i=kW(e,n),r=kW(t,n);return i&&r?sP(i,r):"unknown"}function TW(e,t,n){if(!e||!t)return null;let i=Eg(t,e,n);return i===null?null:i<0}function IW(e,t,n){if(!e||!t||!SW.has(n))return!1;let i=Te(e,n),r=Te(t,n);return!!(i?.release&&r?.release&&i.release[0]===0&&r.release[0]===0&&i.release[1]!==r.release[1])}function sP(e,t){let n=Qe(e,t);if(n===null||n===0)return"unknown";let i=e.release,r=t.release;return!i||!r?"unknown":(i[0]??0)!==(r[0]??0)?"major":(i[1]??0)!==(r[1]??0)?"minor":(i[2]??0)!==(r[2]??0)?"patch":e.prerelease||t.prerelease?"prerelease":"unknown"}function Ebe(e,t){if(e.ecosystem!==t.ecosystem||!e.release||!t.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let n=e.release[0]??0;return n===0?(t.release[0]??0)===0&&(t.release[1]??0)===(e.release[1]??0):(t.release[0]??0)===n}function AW(e,t){let n=t.trim();if(!n||n==="*")return!0;if(e.comparable.kind==="semver"){let i=n;e.ecosystem==="cargo"&&/^v?\d+(?:\.\d+){0,2}$/.test(n)&&(i=`^${n}`);let r=ea.default.validRange(i);return r?ea.default.satisfies(e.comparable.value,r):null}if(e.comparable.kind==="pep440")return Rbe(e.comparable.value,e.raw,n);if(e.comparable.kind==="ruby")return Obe(e,n);if(e.comparable.kind==="maven")return wW(e,n,/^([[(])\s*([^,]*)\s*,\s*([^\])]*?)\s*([\])])$/);if(e.comparable.kind==="nuget"){if(/^[[(]/.test(n))return wW(e,n,/^([[(])\s*([^,]*)\s*,?\s*([^\])]*?)\s*([\])])$/);let i=Te(n,"nuget"),r=i?Qe(e,i):null;return r===null?null:r>=0}return e.comparable.kind==="opam"?jbe(e,n):null}function wW(e,t,n){let i=n.exec(t);if(!i){let c=Te(t,e.ecosystem),l=c?Qe(e,c):null;return l===null?null:l===0}let[,r,o,s,a]=i;if(o){let c=Te(o,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l<0||l===0&&r==="(")return!1}if(s){let c=Te(s,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l>0||l===0&&a===")")return!1}return!0}function RW(e,t){let n=e.trim();if(NW(t))return iP(n);if(t==="npm")return ea.default.valid(n)?n:null;if(t==="cargo"){let i=/^=\s*(v?\d+(?:\.\d+){2}(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="pypi"){let i=/^==\s*([^,;\s]+)$/.exec(n);return i&&!i[1].includes("*")&&Te(i[1],t)?i[1]:null}if(t==="rubygems"){let i=/^(?:=|==)\s*([^,\s]+)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="nuget"){let i=/^\[\s*([^,\]]+)\s*\]$/.exec(n);return i&&Te(i[1],t)?i[1]:null}return Te(n,t)?n:null}function iP(e){let t=e.trim();return!t||/\s/.test(t)||/[\[\]<>~=^*,|&]/.test(t)?null:t}function NW(e){return e==="conan"||e==="vcpkg"}function kW(e,t){let n=RW(e,t);if(n)return Te(n,t);let i=e.trim().match(/(?:^|[<>=~^\[(,{"'\s])(v?\d+(?:!\d+)?(?:\.\d+)*(?:(?:a|b|rc)\d+|[-.](?:alpha|beta|rc)[-.]?\d*)?)/i);return i?Te(i[1],t):null}var Tbe=/^v?(?:(?:(\d+)!)?(\d+(?:\.\d+)*)(?:[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(\d+)?)?(?:(?:-(\d+))|(?:[-_.]?(post|rev|r)[-_.]?(\d+)?))?(?:[-_.]?(dev)[-_.]?(\d+)?)?)(?:\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$/;function CW(e){let t=Tbe.exec(e.trim().toLowerCase());if(!t)return null;let n=t[3],i=n?/^(a|alpha)$/.test(n)?0:/^(b|beta)$/.test(n)?1:2:null;return{epoch:Number(t[1]??0),release:t[2].split(".").map(Number),pre:i===null?null:[i,Number(t[4]??0)],post:t[5]!==void 0?Number(t[5]):t[6]?Number(t[7]??0):null,dev:t[8]?Number(t[9]??0):null,local:t[10]?t[10].split(/[-_.]/).map(r=>/^\d+$/.test(r)?Number(r):r):null}}function bd(e){return{epoch:e.epoch,release:e.release,pre:null,post:null,dev:null,local:null}}function xg(e){return e.local===null?e:{...e,local:null}}function $W(e){return e.pre!==null||e.dev!==null}function zi(e,t){let n=Rk(e.epoch,t.epoch)||Ak(e.release,t.release);return n||(n=Ibe(e,t),n)||(n=_W(e.post,t.post,-1),n)||(n=_W(e.dev,t.dev,1),n)?n:Abe(e.local,t.local)}function Ibe(e,t){let n=e.pre??(e.dev!==null&&e.post===null?[-1,0]:[3,0]),i=t.pre??(t.dev!==null&&t.post===null?[-1,0]:[3,0]);return Ak(n,i)}function Abe(e,t){if(!e||!t)return e?1:t?-1:0;let n=Math.max(e.length,t.length);for(let i=0;ir.trim()).filter(Boolean);if(!i.length)return!0;for(let r of i){let o=Nbe(e,t,r);if(o!==!0)return o}return!0}function Nbe(e,t,n){let i=/^(===|~=|==|!=|<=|>=|<|>)\s*(.+)$/.exec(n);if(!i)return null;let r=i[1],o=i[2].trim();if(r==="===")return t.trim().toLowerCase()===o.toLowerCase();if(o.endsWith(".*")){if(r!=="=="&&r!=="!=")return null;let a=Cbe(e,o.slice(0,-2));return a===null?null:r==="=="?a:!a}let s=CW(o);if(!s)return null;switch(r){case"==":return zi(s.local===null?xg(e):e,s)===0;case"!=":return zi(s.local===null?xg(e):e,s)!==0;case"<=":return zi(xg(e),s)<=0;case">=":return zi(xg(e),s)>=0;case"<":return!(zi(e,s)>=0||!$W(s)&&$W(e)&&zi(bd(e),bd(s))===0);case">":return!(zi(e,s)<=0||s.post===null&&e.post!==null&&zi(bd(e),bd(s))===0||e.local!==null&&zi(bd(e),bd(s))===0);case"~=":{if(s.local!==null)return null;let a=s.pre===null?s.release.length:s.release.length+1;if(a<2)return null;if(zi(xg(e),s)<0)return!1;let c=s.release.slice(0,Math.min(a-1,s.release.length));return e.epoch===s.epoch&&c.every((l,u)=>(e.release[u]??0)===l)}default:return null}}function Cbe(e,t){let n=/^v?(?:(\d+)!)?(\d+(?:\.\d+)*)$/.exec(t.trim());if(!n)return null;let i=Number(n[1]??0),r=n[2].split(".").map(Number);return e.epoch===i&&r.every((o,s)=>(e.release[s]??0)===o)}function Pbe(e){return e.replace(/-/g,".pre.").match(/[0-9]+|[A-Za-z]+/g)?.map(t=>/^\d+$/.test(t)?Number(t):t.toLowerCase())??[]}function Dbe(e,t){let n=Math.max(e.length,t.length);for(let i=0;ii.trim()).filter(Boolean);if(!n.length)return!0;for(let i of n){let r=/^(~>|>=|<=|>|<|=|==)?\s*([^\s]+)$/.exec(i);if(!r)return null;let o=r[1]??"=",s=Te(r[2],"rubygems");if(!s)return null;let a=Qe(e,s);if((o==="="||o==="==")&&a!==0||o===">="&&a<0||o===">"&&a<=0||o==="<="&&a>0||o==="<"&&a>=0)return!1;if(o==="~>"){if(a<0||!s.release)return!1;let c=r[2].match(/\d+/g)?.length??0,l=[...s.release],u=c>=3?1:0;if(l[u]=(l[u]??0)+1,l.splice(u+1),Ak(e.release??[],l)>=0)return!1}}return!0}function Mbe(e){let t=/^[vV]?(\d+(?:\.\d+){0,3})(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z.-]+)?$/.exec(e);return t?{release:t[1].split(".").map(Number),prerelease:t[2]?t[2].toLowerCase().split(".").map(n=>/^\d+$/.test(n)?Number(n):n):null}:null}function Lbe(e,t){let n=Ak(e.release,t.release);if(n)return n;if(!e.prerelease||!t.prerelease)return e.prerelease?-1:t.prerelease?1:0;let i=Math.max(e.prerelease.length,t.prerelease.length);for(let r=0;ri==="~"?-1:i===void 0?0:/[A-Za-z]/.test(i)?i.charCodeAt(0):i.charCodeAt(0)+256;return Rk(n(e),n(t))}function jbe(e,t){let i=t.trim().replace(/^\{\s*|\s*\}$/g,"").split(/\s*(?:&|&&)\s*/).filter(Boolean);if(!i.length)return null;for(let r of i){let o=/^(>=|<=|>|<|=)?\s*["']?([^"'\s]+)["']?$/.exec(r);if(!o)return null;let s=Te(o[2],"opam"),a=s?Qe(e,s):null;if(a===null)return null;let c=o[1]??"=";if(c==="="&&a!==0||c===">="&&a<0||c===">"&&a<=0||c==="<="&&a>0||c==="<"&&a>=0)return!1}return!0}function zbe(e){let t=[];for(let n of e){if(typeof n!="number")break;t.push(n)}return t.length?t:null}function Ak(e,t){let n=Math.max(e.length,t.length);for(let i=0;it?1:0}function Gbe(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=/^npm:(?:@[^/]+\/)?[^@]+@(.+)$/i.exec(t);if(n)t=n[1].trim();else if(/^(git|github|file|link|workspace|npm|https?):/i.test(t))return null;return t==="*"||t==="latest"||t===""?null:(t=t.split(/\|\||,/)[0].trim(),t=t.replace(/^[\^~><=!]+\s*/,"").replace(/^[[(]\s*/,""),t=t.split(/\s+/)[0].trim(),t=t.replace(/^v/i,"").replace(/[\])]$/,""),t=t.replace(/\+incompatible$/,""),t||null)}function Ck(e){let t=Gbe(e);return t?Nk.default.valid(t)??Nk.default.valid(Nk.default.coerce(t)??"")??null:null}function ta(e,t,n="npm"){return oP(e,t,n)}function Tg(e,t,n="npm"){return TW(e,t,n)===!0}function Ig(e,t,n="npm"){return IW(e,t,n)}function me(e){let t=e.split("/");return(t[t.length-1]??"").toLowerCase()}function Gt(e){try{return JSON.parse(e)}catch{return null}}var DW={ecosystem:"arduino",name:"arduino",handles(e){let t=me(e);return t==="library.properties"||t==="platformio.ini"},isLockfile(){return!1},parse(e,t){return me(t)==="platformio.ini"?qbe(e):Vbe(e)}};function Vbe(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim();if(i.startsWith("#"))continue;let r=/^depends\s*=\s*(.*)$/i.exec(i);if(r)for(let o of r[1].split(",")){let s=Bbe(o);s&&t.set(s.name,{version:s.version,kind:"runtime"})}}return t}function Bbe(e){let t=e.trim();if(!t)return null;let n=/^(.*?)\s*\(([^)]*)\)\s*$/.exec(t);if(n){let i=n[1].trim(),r=n[2].trim();return i?{name:i,version:r||null}:null}return{name:t,version:null}}function qbe(e){let t=new Map,n=e.split(` -`),i=!1;for(let r of n){let o=r.split(/\s+[;#]/)[0],s=o.trim();if(/^\[/.test(s)){i=!1;continue}let a=/^(lib_deps[\w.]*|lib_extra_dirs|lib_ignore)\s*=\s*(.*)$/.exec(s);if(a){i=a[1].startsWith("lib_deps"),i&&a[2]&&PW(t,a[2],"runtime");continue}if(i&&/^\s/.test(o)&&s!==""){PW(t,s,"runtime");continue}s!==""&&(i=!1)}return t}function PW(e,t,n){let i=t.trim();if(!i||/^[a-z+]+:\/\//i.test(i)||i.startsWith("file://")||i.startsWith(".")||i.includes("${")||/\.(git|zip|tar\.gz)$/i.test(i))return;let r=i.lastIndexOf("@"),o=r>0,s=o?i.slice(0,r):i,a=o?i.slice(r+1).trim():null,c=s.lastIndexOf("/"),l=(c===-1?s:s.slice(c+1)).trim();l&&e.set(l,{version:a||null,kind:n})}function pi(e){let t=[],n={header:"",entries:new Map,lines:[]};t.push(n);let i=e.split(` -`);for(let r=0;rvd(u,"]")){let d=vd(u,"[")-vd(u,"]");for(;d>0&&r+1n.header===t)}function Ag(e){let t=e.trim().replace(/^\[/,"").replace(/\]$/,""),n=[];for(let i of t.matchAll(/"((?:[^"\\]|\\.)*)"|'([^']*)'/g)){let r=i[1]??i[2];r!==void 0&&n.push(r)}return n}function wd(e){let t=e.trim();return t.startsWith("{")?/(?:^|[{,]\s*)version\s*=\s*"([^"]*)"/.exec(t)?.[1]??null:/^"([^"]*)"$/.exec(t)?.[1]??/^'([^']*)'$/.exec(t)?.[1]??null}function Pk(e){return e.replace(/^["']|["']$/g,"")}function OW(e){let t=!1,n=!1;for(let i=0;i<=!]*\s*\d[^"']*)["']/g)].map(f=>f[1].trim()).filter(f=>!/^https?:/.test(f)),d=/:(path|git|podspec|svn|hg)\s*(?:=>|:)/.test(c)||l.length===0?null:l.join(", "),p=n.some(f=>/test|spec|uitest/i.test(f))?"dev":"runtime";t.set(a,{version:d,kind:p})}return t}function rve(e){let t=new Map,n=!1;for(let i of e.split(` -`)){let r=i.replace(/\r$/,"");if(!r.trim())continue;if(/^[A-Z][A-Z ]*:\s*$/.test(r.trim())&&!/^\s/.test(r)){n=r.trim()==="PODS:";continue}if(!n)continue;let o=/^ {2}- "?([\w.+/-]+)"? \(([^)]+)\)/.exec(r);o&&t.set(o[1],{version:o[2],kind:"transitive"})}return t}function ive(e){let t=new Map,n=/\.dependency\s+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2]??null,kind:"runtime"});return t}function ove(e){let t=!1,n=!1;for(let i=0;iu.includes("indirect")?u:"").trim(),s=r.trim();if(/^require\s*\($/.test(s)){n=!0;continue}if(/^replace\s*\($/.test(s)||/^exclude\s*\($/.test(s)){i=!0;continue}if(s===")"){n=!1,i=!1;continue}if(i||s.startsWith("replace ")||s.startsWith("exclude "))continue;let a=/^require\s+(\S+)\s+(\S+)/.exec(s);if(a){t.set(a[1],{version:a[2],kind:"runtime"});continue}if(!n)continue;let c=/^(\S+)\s+(v\S+)/.exec(o||s);if(!c)continue;let l=s.includes("// indirect");t.set(c[1],{version:c[2],kind:l?"transitive":"runtime"})}return t}function lve(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim().split(/\s+/);if(i.length<3)continue;let[r,o]=i;o.endsWith("/go.mod")||t.set(r,{version:o,kind:"transitive"})}return t}var WW={ecosystem:"hex",name:"Mix",handles(e){let t=me(e);return t==="mix.exs"||t==="mix.lock"||t==="rebar.config"},isLockfile(e){return me(e)==="mix.lock"},parse(e,t){let n=me(t);return n==="mix.lock"?dve(e):n==="rebar.config"?pve(e):uve(e)}};function uve(e){let t=new Map;for(let n of e.matchAll(/\{\s*:([a-z_][a-zA-Z0-9_]*)\s*(,[^}]*)?\}/g)){let i=n[1],r=n[2]??"",o=/^,\s*"([^"]+)"/.exec(r)?.[1]??null,s=/\b(path|git|github|hg|svn):\s*/.test(r),a=s?null:o;if(!o&&!s&&!/\b(only|runtime|optional|app|manager):/.test(r))continue;let c=/\bonly:\s*(\[[^\]]*\]|:[a-z_]+)/.exec(r)?.[1]??"",l=/:(dev|test)\b/.test(c)?"dev":"runtime";t.set(i,{version:a,kind:l})}return t}function dve(e){let t=new Map,n=/"([a-z_][a-zA-Z0-9_]*)"\s*:\s*\{\s*:hex\s*,\s*:[a-zA-Z0-9_]+\s*,\s*"([^"]+)"/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2],kind:"transitive"});return t}function pve(e){let t=new Map,n=/\{\s*deps\s*,\s*\[/.exec(e);if(!n)return t;let i=1,r=n.index+n[0].length;for(;r0;r++)e[r]==="["?i+=1:e[r]==="]"&&(i-=1);let o=e.slice(n.index+n[0].length,r-1);for(let s of o.matchAll(/\{\s*([a-z_][a-zA-Z0-9_]*)\s*,\s*"([^"]+)"/g))t.set(s[1],{version:s[2],kind:"runtime"});for(let s of o.matchAll(/(?:^|[[,])\s*([a-z_][a-zA-Z0-9_]*)\s*(?=[,\]]|$)/g))t.has(s[1])||t.set(s[1],{version:null,kind:"runtime"});return t}var HW={ecosystem:"maven",name:"maven/gradle",handles(e){let t=me(e);return t==="pom.xml"||t==="build.gradle"||t==="build.gradle.kts"||t==="libs.versions.toml"||t==="gradle.lockfile"},isLockfile(e){return me(e)==="gradle.lockfile"},parse(e,t){let n=me(t);return n==="pom.xml"?fve(e):n==="gradle.lockfile"?bve(e):n==="libs.versions.toml"?yve(e):hve(e)}};function fve(e){let t=new Map,n=gve(e),i=mve(e,n);for(let r of e.matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId");if(!s||!a)continue;let c=`${s}:${a}`,u=KW(na(o,"version"),n)??i.get(c)??null,d=na(o,"scope"),f=na(o,"optional")==="true"?"optional":d==="test"||d==="provided"?"dev":"runtime",m=t.get(c);t.set(c,{version:u??m?.version??null,kind:f})}return t}function mve(e,t){let n=new Map;for(let i of e.matchAll(/([\s\S]*?)<\/dependencyManagement>/g))for(let r of i[1].matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId"),c=KW(na(o,"version"),t);s&&a&&c&&n.set(`${s}:${a}`,c)}return n}function gve(e){let t=new Map;for(let n of e.matchAll(/([\s\S]*?)<\/properties>/g))for(let i of n[1].matchAll(/<([\w.-]+)>([^<]*)<\/\1>/g))t.set(i[1],i[2].trim());return t}function KW(e,t){if(!e)return null;let n=e;for(let i=0;i<2;i++)n=n.replace(/\$\{([^}]+)\}/g,(r,o)=>t.get(o)??r);return n.includes("${")?null:n.trim()||null}function na(e,t){return new RegExp(`<${t}>([^<]*)`).exec(e)?.[1]?.trim()??null}function hve(e){let t=new Map,n="(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testCompileOnly|annotationProcessor|kapt|ksp)";for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*["']([^"']+:[^"']+)["']`,"g"))){let r=i[1].split(":");if(r.length<2)continue;let[o,s,a]=r,c=/test|androidTest/i.test(i[0]);t.set(`${o}:${s}`,{version:a??null,kind:c?"dev":"runtime"})}for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*group:\\s*["']([^"']+)["'],\\s*name:\\s*["']([^"']+)["'](?:,\\s*version:\\s*["']([^"']+)["'])?`,"g")))t.set(`${i[1]}:${i[2]}`,{version:i[3]??null,kind:/test/i.test(i[0])?"dev":"runtime"});return t}function yve(e){let t=new Map,n=new Map,i="";for(let r of e.split(` -`)){let o=r.split("#")[0].trim();if(!o)continue;let s=/^\[([^\]]+)\]$/.exec(o)?.[1];if(s){i=s;continue}if(i==="versions"){let m=/^([\w.-]+)\s*=\s*["']([^"']+)["']/.exec(o);m&&n.set(m[1],m[2]);continue}if(i!=="libraries")continue;let a=/module\s*=\s*["']([^"']+)["']/.exec(o)?.[1],c=/group\s*=\s*["']([^"']+)["']/.exec(o)?.[1],l=/name\s*=\s*["']([^"']+)["']/.exec(o)?.[1],u=a??(c&&l?`${c}:${l}`:null);if(!u)continue;let d=/version\s*=\s*["']([^"']+)["']/.exec(o)?.[1],p=/version\.ref\s*=\s*["']([^"']+)["']/.exec(o)?.[1],f=d??(p?n.get(p)??null:null);t.set(u,{version:f,kind:"runtime"})}return t}function bve(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trim();if(!i||i.startsWith("#"))continue;let o=i.split("=")[0].split(":");o.length<3||t.set(`${o[0]}:${o[1]}`,{version:o[2],kind:"transitive"})}return t}var ZW=gt(gc(),1);var vve=new Set(["package.json"]),JW=new Set(["package-lock.json","npm-shrinkwrap.json","yarn.lock","pnpm-lock.yaml","bun.lock"]),YW={ecosystem:"npm",name:"npm/yarn/pnpm",handles(e){let t=me(e);return e.includes("node_modules/")?!1:vve.has(t)||JW.has(t)},isLockfile(e){return JW.has(me(e))},parse(e,t){let n=me(t);return n==="package.json"?$ve(e):n==="yarn.lock"?Eve(e):n==="pnpm-lock.yaml"?Tve(e):n==="bun.lock"?wve(e):_ve(e)}};function wve(e){let t=new Map,n=Gt(kve(e));if(!n?.packages)return t;for(let i of Object.values(n.packages)){let r=Array.isArray(i)?i[0]:i;if(typeof r!="string")continue;let o=r.lastIndexOf("@");if(o<=0)continue;let s=r.slice(0,o),a=r.slice(o+1);/^\d/.test(a)&&t.set(s,{version:a,kind:"transitive"})}return t}function kve(e){let t="",n=!1;for(let i=0;iQme.includes(a)?(s[a]=i[a],s):(s.variables||(s.variables={}),s.variables[a]=i[a],s),{}),o=i.baseUrl||e.endpoint.DEFAULTS.baseUrl;return m4.test(o)&&(r.url=o.replace(m4,"/api/graphql")),e(r).then(s=>{if(s.data.errors){let a={};for(let c of Object.keys(s.headers))a[c]=s.headers[c];throw new Yme(r,a,s.data)}return s.data.data})}function PN(e,t){let n=e.defaults(t);return Object.assign((r,o)=>ege(n,r,o),{defaults:PN.bind(null,n),endpoint:n.endpoint})}var WKe=PN(xg,{headers:{"user-agent":`octokit-graphql.js/${Jme} ${Ys()}`},method:"POST",url:"/graphql"});function g4(e){return PN(e,{method:"POST",url:"/graphql"})}var DN="(?:[a-zA-Z0-9_-]+)",h4="\\.",y4=new RegExp(`^${DN}${h4}${DN}${h4}${DN}$`),tge=y4.test.bind(y4);async function nge(e){let t=tge(e),n=e.startsWith("v1.")||e.startsWith("ghs_"),i=e.startsWith("ghu_");return{type:"token",token:e,tokenType:t?"app":n?"installation":i?"user-to-server":"oauth"}}function rge(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function ige(e,t,n,i){let r=t.endpoint.merge(n,i);return r.headers.authorization=rge(e),t(r)}var b4=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(nge.bind(null,t),{hook:ige.bind(null,t)})};var ON="7.0.8";var v4=()=>{},oge=console.warn.bind(console),sge=console.error.bind(console);function age(e={}){return typeof e.debug!="function"&&(e.debug=v4),typeof e.info!="function"&&(e.info=v4),typeof e.warn!="function"&&(e.warn=oge),typeof e.error!="function"&&(e.error=sge),e}var w4=`octokit-core.js/${ON} ${Ys()}`,wk=class{static VERSION=ON;static defaults(t){return class extends this{constructor(...i){let r=i[0]||{};if(typeof t=="function"){super(t(r));return}super(Object.assign({},t,r,r.userAgent&&t.userAgent?{userAgent:`${r.userAgent} ${t.userAgent}`}:null))}}}static plugins=[];static plugin(...t){let n=this.plugins;return class extends this{static plugins=n.concat(t.filter(r=>!n.includes(r)))}}constructor(t={}){let n=new B2.Collection,i={baseUrl:xg.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(i.headers["user-agent"]=t.userAgent?`${t.userAgent} ${w4}`:w4,t.baseUrl&&(i.baseUrl=t.baseUrl),t.previews&&(i.mediaType.previews=t.previews),t.timeZone&&(i.headers["time-zone"]=t.timeZone),this.request=xg.defaults(i),this.graphql=g4(this.request).defaults(i),this.log=age(t.log),this.hook=n,t.authStrategy){let{authStrategy:o,...s}=t,a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:s},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{let o=b4(t.auth);n.wrap("request",o.hook),this.auth=o}let r=this.constructor;for(let o=0;o{e.log.debug("request",n);let i=Date.now(),r=e.request.endpoint.parse(n),o=r.url.replace(n.baseUrl,"");return t(n).then(s=>{let a=s.headers["x-github-request-id"];return e.log.info(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s}).catch(s=>{let a=s.response?.headers["x-github-request-id"]||"UNKNOWN";throw e.log.error(`${r.method} ${o} - ${s.status} with id ${a} in ${Date.now()-i}ms`),s})})}MN.VERSION=k4;var cge="0.0.0-development";function lge(e){if(!e.data)return{...e,data:[]};if(!(("total_count"in e.data||"total_commits"in e.data)&&!("url"in e.data)))return e;let n=e.data.incomplete_results,i=e.data.repository_selection,r=e.data.total_count,o=e.data.total_commits;delete e.data.incomplete_results,delete e.data.repository_selection,delete e.data.total_count,delete e.data.total_commits;let s=Object.keys(e.data)[0],a=e.data[s];return e.data=a,typeof n<"u"&&(e.data.incomplete_results=n),typeof i<"u"&&(e.data.repository_selection=i),e.data.total_count=r,e.data.total_commits=o,e}function LN(e,t,n){let i=typeof t=="function"?t.endpoint(n):e.request.endpoint(t,n),r=typeof t=="function"?t:e.request,o=i.method,s=i.headers,a=i.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{let c=await r({method:o,url:a,headers:s}),l=lge(c);if(a=((l.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!a&&"total_commits"in l.data){let u=new URL(l.url),d=u.searchParams,p=parseInt(d.get("page")||"1",10),f=parseInt(d.get("per_page")||"250",10);p*f{if(r.done)return t;let o=!1;function s(){o=!0}return t=t.concat(i?i(r.value,s):r.value.data),o?t:$4(e,t,n,i)})}var lHe=Object.assign(_4,{iterator:LN});function FN(e){return{paginate:Object.assign(_4.bind(null,e),{iterator:LN.bind(null,e)})}}FN.VERSION=cge;var UN="17.0.0";var uge={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},S4=uge;var Oc=new Map;for(let[e,t]of Object.entries(S4))for(let[n,i]of Object.entries(t)){let[r,o,s]=i,[a,c]=r.split(/ /),l=Object.assign({method:a,url:c},o);Oc.has(e)||Oc.set(e,new Map),Oc.get(e).set(n,{scope:e,methodName:n,endpointDefaults:l,decorations:s})}var dge={has({scope:e},t){return Oc.get(e).has(t)},getOwnPropertyDescriptor(e,t){return{value:this.get(e,t),configurable:!0,writable:!0,enumerable:!0}},defineProperty(e,t,n){return Object.defineProperty(e.cache,t,n),!0},deleteProperty(e,t){return delete e.cache[t],!0},ownKeys({scope:e}){return[...Oc.get(e).keys()]},set(e,t,n){return e.cache[t]=n},get({octokit:e,scope:t,cache:n},i){if(n[i])return n[i];let r=Oc.get(t).get(i);if(!r)return;let{endpointDefaults:o,decorations:s}=r;return s?n[i]=pge(e,t,i,o,s):n[i]=e.request.defaults(o),n[i]}};function jN(e){let t={};for(let n of Oc.keys())t[n]=new Proxy({octokit:e,scope:n,cache:{}},dge);return t}function pge(e,t,n,i,r){let o=e.request.defaults(i);function s(...a){let c=o.endpoint.merge(...a);if(r.mapToData)return c=Object.assign({},c,{data:c[r.mapToData],[r.mapToData]:void 0}),o(c);if(r.renamed){let[l,u]=r.renamed;e.log.warn(`octokit.${t}.${n}() has been renamed to octokit.${l}.${u}()`)}if(r.deprecated&&e.log.warn(r.deprecated),r.renamedParameters){let l=o.endpoint.merge(...a);for(let[u,d]of Object.entries(r.renamedParameters))u in l&&(e.log.warn(`"${u}" parameter is deprecated for "octokit.${t}.${n}()". Use "${d}" instead`),d in l||(l[d]=l[u]),delete l[u]);return o(l)}return o(...a)}return Object.assign(s,o)}function fge(e){return{rest:jN(e)}}fge.VERSION=UN;function zN(e){let t=jN(e);return{...t,rest:t}}zN.VERSION=UN;var x4="22.0.1";var E4=wk.plugin(MN,zN,FN).defaults({userAgent:`octokit-rest.js/${x4}`});var mge="drift",kk=class{octokit;logger;selfLogin;constructor(t){this.octokit=new E4({auth:t.repoToken,baseUrl:t.baseUrl??"https://api.github.com",userAgent:"drift-bot/0.1"}),this.logger=t.logger}async readFile(t,n,i){try{let o=(await this.octokit.repos.getContent({owner:t.owner,repo:t.repo,path:n,ref:i})).data;return Array.isArray(o)||o.type!=="file"||!("content"in o)?null:Buffer.from(o.content,"base64").toString("utf8")}catch(r){if(T4(r))return null;throw this.logger.debug(`Failed to read ${n}@${i}: ${r.message}`),r}}async listFiles(t,n){try{let i=await this.octokit.git.getTree({owner:t.owner,repo:t.repo,tree_sha:n,recursive:"true"});return i.data.truncated?(this.logger.warn(`The file tree at ${n} is too large for GitHub to return in full, so path patterns cannot be expanded against it. List the contract documents by literal path instead.`),null):i.data.tree.filter(r=>r.type==="blob"&&typeof r.path=="string").map(r=>r.path)}catch(i){return this.logger.debug(`Could not list the tree at ${n}: ${i.message}`),null}}async changedFiles(t){try{let n=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`}),i=n.data.files??[],r=n.data.commits??[];return i.length>=300||r.lengths.filename)}catch(n){throw this.logger.warn(`Could not compare ${t.beforeSha}...${t.afterSha}: ${n.message}`),n}}async changedFilesByCommit(t){let n=new Set;for await(let r of this.octokit.paginate.iterator(this.octokit.repos.compareCommitsWithBasehead,{owner:t.owner,repo:t.repo,basehead:`${t.beforeSha}...${t.afterSha}`,per_page:250})){let o=r.data;for(let s of o.commits??[])n.add(s.sha)}let i=new Set;for(let r of n)for await(let o of this.octokit.paginate.iterator(this.octokit.repos.getCommit,{owner:t.owner,repo:t.repo,ref:r,per_page:300})){let s=o.data;for(let a of s.files??[])i.add(a.filename)}return[...i]}async createBranch(t,n,i){try{return await this.octokit.git.createRef({owner:t.owner,repo:t.repo,ref:`refs/heads/${n}`,sha:i}),this.logger.info(`Created branch ${n} at ${i.slice(0,7)}`),!0}catch(r){if(hge(r)){let o=await this.getBranchHead(t,n);return o===i?(this.logger.info(`Branch ${n} already exists at ${i.slice(0,7)}; reusing it`),!0):o&&await this.isAncestor(t,i,o)?await this.commitsAreAllBots(t,i,o)?(this.logger.info(`Branch ${n} already exists ahead of ${i.slice(0,7)}; reusing it`),!0):(this.logger.error(`Branch ${n} already exists ahead of ${i.slice(0,7)} with commit(s) not made by Drift; refusing to reuse a branch that may carry manual changes`),!1):(this.logger.error(`Branch ${n} already exists but is not based on ${i.slice(0,7)} (current head: ${o??"unknown"}); refusing to reuse a stale branch`),!1)}return this.logger.error(`Could not create branch ${n}: ${r.message}`),!1}}async isAncestor(t,n,i){if(n===i)return!0;try{let r=await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`});return r.data.status==="ahead"||r.data.status==="identical"}catch{return!1}}async commitsAreAllBots(t,n,i){try{let o=(await this.octokit.repos.compareCommitsWithBasehead({owner:t.owner,repo:t.repo,basehead:`${n}...${i}`})).data.commits??[];return o.length===0?!0:o.every(s=>(s.author?.login??s.committer?.login??"").endsWith("[bot]"))}catch{return!1}}async commitFiles(t,n,i,r){if(i.length===0)return null;try{let s=(await this.octokit.git.getRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`})).data.object.sha,a=await this.octokit.git.getCommit({owner:t.owner,repo:t.repo,commit_sha:s}),c=await Promise.all(i.map(async d=>{let p=await this.octokit.git.createBlob({owner:t.owner,repo:t.repo,content:Buffer.from(d.content,"utf8").toString("base64"),encoding:"base64"});return{path:d.path,mode:"100644",type:"blob",sha:p.data.sha}})),l=await this.octokit.git.createTree({owner:t.owner,repo:t.repo,base_tree:a.data.tree.sha,tree:c}),u=await this.octokit.git.createCommit({owner:t.owner,repo:t.repo,message:r,tree:l.data.sha,parents:[s]});return await this.octokit.git.updateRef({owner:t.owner,repo:t.repo,ref:`heads/${n}`,sha:u.data.sha}),this.logger.info(`Committed ${i.length} file(s) to ${n}: ${u.data.sha.slice(0,7)}`),{sha:u.data.sha}}catch(o){return this.logger.error(`Could not commit to ${n}: ${o.message}`),null}}async createIssue(t,n){try{let i=await this.octokit.issues.create({owner:t.owner,repo:t.repo,title:n.title,body:n.body,labels:n.labels,assignees:n.assignees});return{number:i.data.number,url:i.data.html_url}}catch(i){return this.logger.error(`Could not create issue: ${i.message}`),null}}async getCollaboratorPermission(t,n){try{let i=await this.octokit.repos.getCollaboratorPermissionLevel({owner:t.owner,repo:t.repo,username:n}),r=i.data.permission,s=(i.data.role_name??r??"").toLowerCase();switch(s){case"admin":case"maintain":case"write":case"triage":case"read":case"none":return s;case"push":return"write";case"pull":return"read";default:return this.logger.warn(`Unrecognised permission \`${s}\` for ${n}; treating it as unknown and refusing.`),null}}catch(i){return T4(i)?"none":(this.logger.warn(`Could not determine ${n}'s permission on ${t.owner}/${t.repo}: ${i.message}`),null)}}async getAuthenticatedLogin(){if(this.selfLogin!==void 0)return this.selfLogin;try{let t=await this.octokit.users.getAuthenticated();this.selfLogin=t.data.login}catch{this.selfLogin=null}return this.selfLogin}async getIssue(t,n){try{let i=await this.octokit.issues.get({owner:t.owner,repo:t.repo,issue_number:n});return{number:i.data.number,body:i.data.body??null,state:i.data.state,labels:i.data.labels.map(r=>typeof r=="string"?r:r.name??"").filter(Boolean),pullRequest:!!i.data.pull_request}}catch(i){return this.logger.warn(`Could not read issue #${n}: ${i.message}`),null}}async listIssueComments(t,n){try{return(await this.octokit.issues.listComments({owner:t.owner,repo:t.repo,issue_number:n,per_page:100})).data.map(r=>({id:r.id,body:r.body??null,authorLogin:r.user?.login??null}))}catch(i){throw this.logger.warn(`Could not list comments on #${n}: ${i.message}`),i}}async commitExists(t,n){try{return await this.octokit.repos.getCommit({owner:t.owner,repo:t.repo,ref:n}),!0}catch{return!1}}async getBranchHead(t,n){try{return(await this.octokit.repos.getBranch({owner:t.owner,repo:t.repo,branch:n})).data.commit.sha}catch{return null}}async commentOnIssue(t,n,i){try{return await this.octokit.issues.createComment({owner:t.owner,repo:t.repo,issue_number:n,body:i}),!0}catch(r){return this.logger.warn(`Could not comment on #${n}: ${r.message}`),!1}}async findOpenPlanIssue(t,n){try{return(await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open in:body "${n}"`,per_page:1})).data.items[0]?.number??null}catch{return null}}async findOpenAlertIssues(t){try{let n=await this.octokit.search.issuesAndPullRequests({q:`repo:${t.owner}/${t.repo} is:issue is:open label:${mge} "drift-alert:"`,per_page:100}),i=[];for(let r of n.data.items){let o=//.exec(r.body??"");o&&i.push({number:r.number,marker:o[1]})}return i}catch{return[]}}async updateIssueBody(t,n,i){try{await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,body:i})}catch(r){this.logger.warn(`Could not update issue #${n}: ${r.message}`)}}async updateIssueComment(t,n,i){try{await this.octokit.issues.updateComment({owner:t.owner,repo:t.repo,comment_id:n,body:i})}catch(r){this.logger.warn(`Could not update comment ${n}: ${r.message}`)}}async closeIssue(t,n,i){try{i&&await this.commentOnIssue(t,n,i),await this.octokit.issues.update({owner:t.owner,repo:t.repo,issue_number:n,state:"closed"})}catch(r){this.logger.warn(`Could not close issue #${n}: ${r.message}`)}}async createCheckRun(t,n){try{await this.octokit.checks.create({owner:t.owner,repo:t.repo,name:n.name,head_sha:t.afterSha,status:"completed",conclusion:n.conclusion,output:{title:n.title,summary:n.summary,text:n.text}})}catch(i){this.logger.debug(`Could not create check run: ${i.message}`)}}async uploadSarif(t,n){let i=(0,I4.gzipSync)(Buffer.from(JSON.stringify(n.sarif),"utf8")),r=3;for(let o=1;o<=r;o++)try{return await this.octokit.codeScanning.uploadSarif({owner:t.owner,repo:t.repo,commit_sha:n.commitSha,ref:n.ref,sarif:i.toString("base64")}),this.logger.info("Uploaded SARIF results to code scanning."),!0}catch(s){let a=s?.status;if(a===403)return this.logger.warn("Could not upload code scanning results: the token is missing `security-events: write`. Add it to the workflow job's `permissions` to enable Drift's code scanning alerts."),!1;if((a===void 0||a>=500)&&os.includes("/")).map(s=>s.split("/").pop()),o=i.reviewers.filter(s=>!s.includes("/"));await this.octokit.pulls.requestReviewers({owner:t.owner,repo:t.repo,pull_number:n,reviewers:o,team_reviewers:r})}catch(r){this.logger.warn(`Could not request reviewers on #${n}: ${r.message}`)}}async updatePullRequestBody(t,n,i){try{await this.octokit.pulls.update({owner:t.owner,repo:t.repo,pull_number:n,body:i})}catch(r){this.logger.warn(`Could not update PR #${n}: ${r.message}`)}}async getDefaultBranch(t,n){try{return(await this.octokit.repos.get({owner:t,repo:n})).data.default_branch}catch{return null}}asRepoProvider(t){return{changedFiles:()=>this.changedFiles(t),readFile:(n,i)=>this.readFile(t,n,i),listFiles:n=>this.listFiles(t,n)}}get rest(){return this.octokit}};function gge(e){return new Promise(t=>setTimeout(t,e))}function T4(e){return e?.status===404}function hge(e){let t=e?.status,n=e?.message??"";return t===422&&/already exists/i.test(n)}var Ux=require("node:path"),Uf=require("node:fs/promises");function GN(e,t){return yge(e).test(t)}function Yo(e,t){return e.some(n=>GN(n,t))}var A4=new Map;function yge(e){let t=A4.get(e);if(t)return t;let n="^";for(let r=0;r{let c={kind:"list",items:[]};i.items.push(c),i=c,r.push(c)};for(let c=0;cs&&(i.items.length>0&&a(),i.items.push(xW(t.slice(s,c),!0)),s=c,a()),o=!0):(o&&c>s&&(i.items.push(Dk(!0,t.slice(s,c))),s=c,a()),o=!1)}for(t.length>s&&i.items.push(Dk(o,t.slice(s)));r.length;)Abe(r.pop());return{items:n}}function _W(e,t){return Ok(e.items,t.items)}function $W(e){let t=[],n=e.items;for(;n;){let i=null;for(let r of n.items){if(r.kind==="int"){t.push(Number(r.value));continue}r.kind==="list"&&t.length>0&&(i=r);break}n=i}return t.length?t:null}function SW(e){let t=n=>n.items.some(i=>i.kind==="list"?t(i):i.kind!=="string"?!1:Cg(i.value)="0"&&e<="9"}function uP(e){return{kind:"int",value:e}}function Dk(e,t){if(e){let n=t.replace(/^0+/,"")||"0";return uP(BigInt(n))}return xW(t,!1)}function xW(e,t){let n=e;return t&&n.length===1&&(n=Ebe.get(n)??n),{kind:"string",value:xbe.get(n)??n}}function Cg(e){let t=lP.indexOf(e);return t===-1?`${lP.length}-${e}`:String(t)}function Ibe(e){switch(e.kind){case"int":return e.value===0n;case"string":return Cg(e.value)===dP;case"list":return e.items.length===0}}function Abe(e){for(let t=e.items.length-1;t>=0;t--){let n=e.items[t];if(Ibe(n))e.items.splice(t,1);else if(n.kind!=="list")break}}function wW(e,t){return et?1:0}function Ok(e,t){switch(e.kind){case"int":return Rbe(e,t);case"string":return Cbe(e,t);case"list":return Nbe(e,t)}}function Rbe(e,t){if(t===null)return e.value===0n?0:1;switch(t.kind){case"int":return e.valuet.value?1:0;case"string":return 1;case"list":return 1}}function Cbe(e,t){if(t===null)return wW(Cg(e.value),dP);switch(t.kind){case"int":return-1;case"string":return wW(Cg(e.value),Cg(t.value));case"list":return-1}}function Nbe(e,t){if(t===null)return e.items.length===0?0:Ok(e.items[0],null);switch(t.kind){case"int":return-1;case"string":return 1;case"list":{let n=Math.max(e.items.length,t.items.length);for(let i=0;iTe(t,e),compare:Qe,satisfies:(t,n)=>OW(t,n),sameCompatibilityLine:Pbe,classifyBump:mP,exactVersion:t=>MW(t,e)}}function Te(e,t){let n=e.trim();if(!n||/\s/.test(n))return null;if(RW.has(t)){let r=t==="go"||t==="swift"||t==="cocoapods"?n.replace(/^v(?=\d)/,""):n,o=ea.default.valid(r);if(!o){let a=/^(\d+(?:\.\d+){0,1})([-+][0-9A-Za-z.-]+)?$/.exec(r);if(a){let c=a[1].split(".");o=ea.default.valid(`${c.join(".")}${".0".repeat(3-c.length)}${a[2]??""}`)}}if(!o)return null;let s=ea.default.parse(o);return{raw:n,ecosystem:t,prerelease:s.prerelease.length>0,comparable:{kind:"semver",value:o},release:[s.major,s.minor,s.patch]}}if(t==="pypi"){let i=FW(n);return i?{raw:n,ecosystem:t,prerelease:i.pre!==null||i.dev!==null,comparable:{kind:"pep440",value:i},release:i.release}:null}if(t==="rubygems"){if(!/^\d[0-9A-Za-z._-]*$/.test(n))return null;let i=jbe(n);return{raw:n,ecosystem:t,prerelease:i.some(r=>typeof r=="string"),comparable:{kind:"ruby",value:i},release:Hbe(i)}}if(t==="maven"){if(!/^\d[0-9A-Za-z._+-]*$/.test(n))return null;let i=kW(n);return{raw:n,ecosystem:t,prerelease:SW(i),comparable:{kind:"maven",value:i},release:$W(i)}}if(t==="nuget"){let i=Vbe(n);return i?{raw:n,ecosystem:t,prerelease:i.prerelease!==null,comparable:{kind:"nuget",value:i},release:i.release}:null}if(t==="opam"){if(!/\d/.test(n))return null;let i=/^v?(\d+(?:\.\d+)*)/.exec(n)?.[1]?.split(".").map(Number)??null;return{raw:n,ecosystem:t,prerelease:/(?:^|[._+-])(?:alpha|beta|pre|preview|rc|dev)\d*/i.test(n),comparable:{kind:"opam",value:n},release:i}}return null}function Qe(e,t){if(e.ecosystem!==t.ecosystem||e.comparable.kind!==t.comparable.kind)return null;switch(e.comparable.kind){case"semver":return ea.default.compare(e.comparable.value,t.comparable.value);case"pep440":return zi(e.comparable.value,t.comparable.value);case"ruby":return zbe(e.comparable.value,t.comparable.value);case"maven":return _W(e.comparable.value,t.comparable.value);case"nuget":return Bbe(e.comparable.value,t.comparable.value);case"opam":return qbe(e.comparable.value,t.comparable.value)}}function Pg(e,t,n){if(LW(n)){let s=pP(e),a=pP(t);return s&&a&&s===a?0:null}let i=Gi(n),r=i.parse(e),o=i.parse(t);return r&&o?i.compare(r,o):null}function CW(e,t,n){let i=Te(e,n);return i?OW(i,t):null}function fP(e,t,n){if(e===null&&t!==null)return"added";if(e!==null&&t===null)return"removed";if(e===null||t===null)return"unknown";let i=Te(e,n),r=Te(t,n);return i&&r?mP(i,r):"unknown"}function NW(e,t,n){if(e===null||t===null)return fP(e,t,n);let i=TW(e,n),r=TW(t,n);return i&&r?mP(i,r):"unknown"}function PW(e,t,n){if(!e||!t)return null;let i=Pg(t,e,n);return i===null?null:i<0}function DW(e,t,n){if(!e||!t||!RW.has(n))return!1;let i=Te(e,n),r=Te(t,n);return!!(i?.release&&r?.release&&i.release[0]===0&&r.release[0]===0&&i.release[1]!==r.release[1])}function mP(e,t){let n=Qe(e,t);if(n===null||n===0)return"unknown";let i=e.release,r=t.release;return!i||!r?"unknown":(i[0]??0)!==(r[0]??0)?"major":(i[1]??0)!==(r[1]??0)?"minor":(i[2]??0)!==(r[2]??0)?"patch":e.prerelease||t.prerelease?"prerelease":"unknown"}function Pbe(e,t){if(e.ecosystem!==t.ecosystem||!e.release||!t.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let n=e.release[0]??0;return n===0?(t.release[0]??0)===0&&(t.release[1]??0)===(e.release[1]??0):(t.release[0]??0)===n}function OW(e,t){let n=t.trim();if(!n||n==="*")return!0;if(e.comparable.kind==="semver"){let i=n;e.ecosystem==="cargo"&&/^v?\d+(?:\.\d+){0,2}$/.test(n)&&(i=`^${n}`);let r=ea.default.validRange(i);return r?ea.default.satisfies(e.comparable.value,r):null}if(e.comparable.kind==="pep440")return Lbe(e.comparable.value,e.raw,n);if(e.comparable.kind==="ruby")return Gbe(e,n);if(e.comparable.kind==="maven")return EW(e,n,/^([[(])\s*([^,]*)\s*,\s*([^\])]*?)\s*([\])])$/);if(e.comparable.kind==="nuget"){if(/^[[(]/.test(n))return EW(e,n,/^([[(])\s*([^,]*)\s*,?\s*([^\])]*?)\s*([\])])$/);let i=Te(n,"nuget"),r=i?Qe(e,i):null;return r===null?null:r>=0}return e.comparable.kind==="opam"?Kbe(e,n):null}function EW(e,t,n){let i=n.exec(t);if(!i){let c=Te(t,e.ecosystem),l=c?Qe(e,c):null;return l===null?null:l===0}let[,r,o,s,a]=i;if(o){let c=Te(o,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l<0||l===0&&r==="(")return!1}if(s){let c=Te(s,e.ecosystem),l=c?Qe(e,c):null;if(l===null)return null;if(l>0||l===0&&a===")")return!1}return!0}function MW(e,t){let n=e.trim();if(LW(t))return pP(n);if(t==="npm")return ea.default.valid(n)?n:null;if(t==="cargo"){let i=/^=\s*(v?\d+(?:\.\d+){2}(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="pypi"){let i=/^==\s*([^,;\s]+)$/.exec(n);return i&&!i[1].includes("*")&&Te(i[1],t)?i[1]:null}if(t==="rubygems"){let i=/^(?:=|==)\s*([^,\s]+)$/.exec(n);return i&&Te(i[1],t)?i[1]:null}if(t==="nuget"){let i=/^\[\s*([^,\]]+)\s*\]$/.exec(n);return i&&Te(i[1],t)?i[1]:null}return Te(n,t)?n:null}function pP(e){let t=e.trim();return!t||/\s/.test(t)||/[\[\]<>~=^*,|&]/.test(t)?null:t}function LW(e){return e==="conan"||e==="vcpkg"}function TW(e,t){let n=MW(e,t);if(n)return Te(n,t);let i=e.trim().match(/(?:^|[<>=~^\[(,{"'\s])(v?\d+(?:!\d+)?(?:\.\d+)*(?:(?:a|b|rc)\d+|[-.](?:alpha|beta|rc)[-.]?\d*)?)/i);return i?Te(i[1],t):null}var Dbe=/^v?(?:(?:(\d+)!)?(\d+(?:\.\d+)*)(?:[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(\d+)?)?(?:(?:-(\d+))|(?:[-_.]?(post|rev|r)[-_.]?(\d+)?))?(?:[-_.]?(dev)[-_.]?(\d+)?)?)(?:\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$/;function FW(e){let t=Dbe.exec(e.trim().toLowerCase());if(!t)return null;let n=t[3],i=n?/^(a|alpha)$/.test(n)?0:/^(b|beta)$/.test(n)?1:2:null;return{epoch:Number(t[1]??0),release:t[2].split(".").map(Number),pre:i===null?null:[i,Number(t[4]??0)],post:t[5]!==void 0?Number(t[5]):t[6]?Number(t[7]??0):null,dev:t[8]?Number(t[9]??0):null,local:t[10]?t[10].split(/[-_.]/).map(r=>/^\d+$/.test(r)?Number(r):r):null}}function vd(e){return{epoch:e.epoch,release:e.release,pre:null,post:null,dev:null,local:null}}function Ng(e){return e.local===null?e:{...e,local:null}}function IW(e){return e.pre!==null||e.dev!==null}function zi(e,t){let n=Lk(e.epoch,t.epoch)||Mk(e.release,t.release);return n||(n=Obe(e,t),n)||(n=AW(e.post,t.post,-1),n)||(n=AW(e.dev,t.dev,1),n)?n:Mbe(e.local,t.local)}function Obe(e,t){let n=e.pre??(e.dev!==null&&e.post===null?[-1,0]:[3,0]),i=t.pre??(t.dev!==null&&t.post===null?[-1,0]:[3,0]);return Mk(n,i)}function Mbe(e,t){if(!e||!t)return e?1:t?-1:0;let n=Math.max(e.length,t.length);for(let i=0;ir.trim()).filter(Boolean);if(!i.length)return!0;for(let r of i){let o=Fbe(e,t,r);if(o!==!0)return o}return!0}function Fbe(e,t,n){let i=/^(===|~=|==|!=|<=|>=|<|>)\s*(.+)$/.exec(n);if(!i)return null;let r=i[1],o=i[2].trim();if(r==="===")return t.trim().toLowerCase()===o.toLowerCase();if(o.endsWith(".*")){if(r!=="=="&&r!=="!=")return null;let a=Ube(e,o.slice(0,-2));return a===null?null:r==="=="?a:!a}let s=FW(o);if(!s)return null;switch(r){case"==":return zi(s.local===null?Ng(e):e,s)===0;case"!=":return zi(s.local===null?Ng(e):e,s)!==0;case"<=":return zi(Ng(e),s)<=0;case">=":return zi(Ng(e),s)>=0;case"<":return!(zi(e,s)>=0||!IW(s)&&IW(e)&&zi(vd(e),vd(s))===0);case">":return!(zi(e,s)<=0||s.post===null&&e.post!==null&&zi(vd(e),vd(s))===0||e.local!==null&&zi(vd(e),vd(s))===0);case"~=":{if(s.local!==null)return null;let a=s.pre===null?s.release.length:s.release.length+1;if(a<2)return null;if(zi(Ng(e),s)<0)return!1;let c=s.release.slice(0,Math.min(a-1,s.release.length));return e.epoch===s.epoch&&c.every((l,u)=>(e.release[u]??0)===l)}default:return null}}function Ube(e,t){let n=/^v?(?:(\d+)!)?(\d+(?:\.\d+)*)$/.exec(t.trim());if(!n)return null;let i=Number(n[1]??0),r=n[2].split(".").map(Number);return e.epoch===i&&r.every((o,s)=>(e.release[s]??0)===o)}function jbe(e){return e.replace(/-/g,".pre.").match(/[0-9]+|[A-Za-z]+/g)?.map(t=>/^\d+$/.test(t)?Number(t):t.toLowerCase())??[]}function zbe(e,t){let n=Math.max(e.length,t.length);for(let i=0;ii.trim()).filter(Boolean);if(!n.length)return!0;for(let i of n){let r=/^(~>|>=|<=|>|<|=|==)?\s*([^\s]+)$/.exec(i);if(!r)return null;let o=r[1]??"=",s=Te(r[2],"rubygems");if(!s)return null;let a=Qe(e,s);if((o==="="||o==="==")&&a!==0||o===">="&&a<0||o===">"&&a<=0||o==="<="&&a>0||o==="<"&&a>=0)return!1;if(o==="~>"){if(a<0||!s.release)return!1;let c=r[2].match(/\d+/g)?.length??0,l=[...s.release],u=c>=3?1:0;if(l[u]=(l[u]??0)+1,l.splice(u+1),Mk(e.release??[],l)>=0)return!1}}return!0}function Vbe(e){let t=/^[vV]?(\d+(?:\.\d+){0,3})(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z.-]+)?$/.exec(e);return t?{release:t[1].split(".").map(Number),prerelease:t[2]?t[2].toLowerCase().split(".").map(n=>/^\d+$/.test(n)?Number(n):n):null}:null}function Bbe(e,t){let n=Mk(e.release,t.release);if(n)return n;if(!e.prerelease||!t.prerelease)return e.prerelease?-1:t.prerelease?1:0;let i=Math.max(e.prerelease.length,t.prerelease.length);for(let r=0;ri==="~"?-1:i===void 0?0:/[A-Za-z]/.test(i)?i.charCodeAt(0):i.charCodeAt(0)+256;return Lk(n(e),n(t))}function Kbe(e,t){let i=t.trim().replace(/^\{\s*|\s*\}$/g,"").split(/\s*(?:&|&&)\s*/).filter(Boolean);if(!i.length)return null;for(let r of i){let o=/^(>=|<=|>|<|=)?\s*["']?([^"'\s]+)["']?$/.exec(r);if(!o)return null;let s=Te(o[2],"opam"),a=s?Qe(e,s):null;if(a===null)return null;let c=o[1]??"=";if(c==="="&&a!==0||c===">="&&a<0||c===">"&&a<=0||c==="<="&&a>0||c==="<"&&a>=0)return!1}return!0}function Hbe(e){let t=[];for(let n of e){if(typeof n!="number")break;t.push(n)}return t.length?t:null}function Mk(e,t){let n=Math.max(e.length,t.length);for(let i=0;it?1:0}function Jbe(e){if(!e)return null;let t=e.trim();if(!t)return null;let n=/^npm:(?:@[^/]+\/)?[^@]+@(.+)$/i.exec(t);if(n)t=n[1].trim();else if(/^(git|github|file|link|workspace|npm|https?):/i.test(t))return null;return t==="*"||t==="latest"||t===""?null:(t=t.split(/\|\||,/)[0].trim(),t=t.replace(/^[\^~><=!]+\s*/,"").replace(/^[[(]\s*/,""),t=t.split(/\s+/)[0].trim(),t=t.replace(/^v/i,"").replace(/[\])]$/,""),t=t.replace(/\+incompatible$/,""),t||null)}function Uk(e){let t=Jbe(e);return t?Fk.default.valid(t)??Fk.default.valid(Fk.default.coerce(t)??"")??null:null}function ta(e,t,n="npm"){return fP(e,t,n)}function Dg(e,t,n="npm"){return PW(e,t,n)===!0}function Og(e,t,n="npm"){return DW(e,t,n)}function me(e){let t=e.split("/");return(t[t.length-1]??"").toLowerCase()}function Gt(e){try{return JSON.parse(e)}catch{return null}}var jW={ecosystem:"arduino",name:"arduino",handles(e){let t=me(e);return t==="library.properties"||t==="platformio.ini"},isLockfile(){return!1},parse(e,t){return me(t)==="platformio.ini"?Qbe(e):Zbe(e)}};function Zbe(e){let t=new Map;for(let n of e.split(` +`)){let i=n.trim();if(i.startsWith("#"))continue;let r=/^depends\s*=\s*(.*)$/i.exec(i);if(r)for(let o of r[1].split(",")){let s=Ybe(o);s&&t.set(s.name,{version:s.version,kind:"runtime"})}}return t}function Ybe(e){let t=e.trim();if(!t)return null;let n=/^(.*?)\s*\(([^)]*)\)\s*$/.exec(t);if(n){let i=n[1].trim(),r=n[2].trim();return i?{name:i,version:r||null}:null}return{name:t,version:null}}function Qbe(e){let t=new Map,n=e.split(` +`),i=!1;for(let r of n){let o=r.split(/\s+[;#]/)[0],s=o.trim();if(/^\[/.test(s)){i=!1;continue}let a=/^(lib_deps[\w.]*|lib_extra_dirs|lib_ignore)\s*=\s*(.*)$/.exec(s);if(a){i=a[1].startsWith("lib_deps"),i&&a[2]&&UW(t,a[2],"runtime");continue}if(i&&/^\s/.test(o)&&s!==""){UW(t,s,"runtime");continue}s!==""&&(i=!1)}return t}function UW(e,t,n){let i=t.trim();if(!i||/^[a-z+]+:\/\//i.test(i)||i.startsWith("file://")||i.startsWith(".")||i.includes("${")||/\.(git|zip|tar\.gz)$/i.test(i))return;let r=i.lastIndexOf("@"),o=r>0,s=o?i.slice(0,r):i,a=o?i.slice(r+1).trim():null,c=s.lastIndexOf("/"),l=(c===-1?s:s.slice(c+1)).trim();l&&e.set(l,{version:a||null,kind:n})}function pi(e){let t=[],n={header:"",entries:new Map,lines:[]};t.push(n);let i=e.split(` +`);for(let r=0;rwd(u,"]")){let d=wd(u,"[")-wd(u,"]");for(;d>0&&r+1n.header===t)}function Mg(e){let t=e.trim().replace(/^\[/,"").replace(/\]$/,""),n=[];for(let i of t.matchAll(/"((?:[^"\\]|\\.)*)"|'([^']*)'/g)){let r=i[1]??i[2];r!==void 0&&n.push(r)}return n}function kd(e){let t=e.trim();return t.startsWith("{")?/(?:^|[{,]\s*)version\s*=\s*"([^"]*)"/.exec(t)?.[1]??null:/^"([^"]*)"$/.exec(t)?.[1]??/^'([^']*)'$/.exec(t)?.[1]??null}function jk(e){return e.replace(/^["']|["']$/g,"")}function zW(e){let t=!1,n=!1;for(let i=0;i<=!]*\s*\d[^"']*)["']/g)].map(f=>f[1].trim()).filter(f=>!/^https?:/.test(f)),d=/:(path|git|podspec|svn|hg)\s*(?:=>|:)/.test(c)||l.length===0?null:l.join(", "),p=n.some(f=>/test|spec|uitest/i.test(f))?"dev":"runtime";t.set(a,{version:d,kind:p})}return t}function uve(e){let t=new Map,n=!1;for(let i of e.split(` +`)){let r=i.replace(/\r$/,"");if(!r.trim())continue;if(/^[A-Z][A-Z ]*:\s*$/.test(r.trim())&&!/^\s/.test(r)){n=r.trim()==="PODS:";continue}if(!n)continue;let o=/^ {2}- "?([\w.+/-]+)"? \(([^)]+)\)/.exec(r);o&&t.set(o[1],{version:o[2],kind:"transitive"})}return t}function dve(e){let t=new Map,n=/\.dependency\s+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2]??null,kind:"runtime"});return t}function pve(e){let t=!1,n=!1;for(let i=0;iu.includes("indirect")?u:"").trim(),s=r.trim();if(/^require\s*\($/.test(s)){n=!0;continue}if(/^replace\s*\($/.test(s)||/^exclude\s*\($/.test(s)){i=!0;continue}if(s===")"){n=!1,i=!1;continue}if(i||s.startsWith("replace ")||s.startsWith("exclude "))continue;let a=/^require\s+(\S+)\s+(\S+)/.exec(s);if(a){t.set(a[1],{version:a[2],kind:"runtime"});continue}if(!n)continue;let c=/^(\S+)\s+(v\S+)/.exec(o||s);if(!c)continue;let l=s.includes("// indirect");t.set(c[1],{version:c[2],kind:l?"transitive":"runtime"})}return t}function hve(e){let t=new Map;for(let n of e.split(` +`)){let i=n.trim().split(/\s+/);if(i.length<3)continue;let[r,o]=i;o.endsWith("/go.mod")||t.set(r,{version:o,kind:"transitive"})}return t}var QW={ecosystem:"hex",name:"Mix",handles(e){let t=me(e);return t==="mix.exs"||t==="mix.lock"||t==="rebar.config"},isLockfile(e){return me(e)==="mix.lock"},parse(e,t){let n=me(t);return n==="mix.lock"?bve(e):n==="rebar.config"?vve(e):yve(e)}};function yve(e){let t=new Map;for(let n of e.matchAll(/\{\s*:([a-z_][a-zA-Z0-9_]*)\s*(,[^}]*)?\}/g)){let i=n[1],r=n[2]??"",o=/^,\s*"([^"]+)"/.exec(r)?.[1]??null,s=/\b(path|git|github|hg|svn):\s*/.test(r),a=s?null:o;if(!o&&!s&&!/\b(only|runtime|optional|app|manager):/.test(r))continue;let c=/\bonly:\s*(\[[^\]]*\]|:[a-z_]+)/.exec(r)?.[1]??"",l=/:(dev|test)\b/.test(c)?"dev":"runtime";t.set(i,{version:a,kind:l})}return t}function bve(e){let t=new Map,n=/"([a-z_][a-zA-Z0-9_]*)"\s*:\s*\{\s*:hex\s*,\s*:[a-zA-Z0-9_]+\s*,\s*"([^"]+)"/g;for(let i of e.matchAll(n))t.set(i[1],{version:i[2],kind:"transitive"});return t}function vve(e){let t=new Map,n=/\{\s*deps\s*,\s*\[/.exec(e);if(!n)return t;let i=1,r=n.index+n[0].length;for(;r0;r++)e[r]==="["?i+=1:e[r]==="]"&&(i-=1);let o=e.slice(n.index+n[0].length,r-1);for(let s of o.matchAll(/\{\s*([a-z_][a-zA-Z0-9_]*)\s*,\s*"([^"]+)"/g))t.set(s[1],{version:s[2],kind:"runtime"});for(let s of o.matchAll(/(?:^|[[,])\s*([a-z_][a-zA-Z0-9_]*)\s*(?=[,\]]|$)/g))t.has(s[1])||t.set(s[1],{version:null,kind:"runtime"});return t}var XW={ecosystem:"maven",name:"maven/gradle",handles(e){let t=me(e);return t==="pom.xml"||t==="build.gradle"||t==="build.gradle.kts"||t==="libs.versions.toml"||t==="gradle.lockfile"},isLockfile(e){return me(e)==="gradle.lockfile"},parse(e,t){let n=me(t);return n==="pom.xml"?wve(e):n==="gradle.lockfile"?xve(e):n==="libs.versions.toml"?Sve(e):$ve(e)}};function wve(e){let t=new Map,n=_ve(e),i=kve(e,n);for(let r of e.matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId");if(!s||!a)continue;let c=`${s}:${a}`,u=eK(na(o,"version"),n)??i.get(c)??null,d=na(o,"scope"),f=na(o,"optional")==="true"?"optional":d==="test"||d==="provided"?"dev":"runtime",m=t.get(c);t.set(c,{version:u??m?.version??null,kind:f})}return t}function kve(e,t){let n=new Map;for(let i of e.matchAll(/([\s\S]*?)<\/dependencyManagement>/g))for(let r of i[1].matchAll(/([\s\S]*?)<\/dependency>/g)){let o=r[1],s=na(o,"groupId"),a=na(o,"artifactId"),c=eK(na(o,"version"),t);s&&a&&c&&n.set(`${s}:${a}`,c)}return n}function _ve(e){let t=new Map;for(let n of e.matchAll(/([\s\S]*?)<\/properties>/g))for(let i of n[1].matchAll(/<([\w.-]+)>([^<]*)<\/\1>/g))t.set(i[1],i[2].trim());return t}function eK(e,t){if(!e)return null;let n=e;for(let i=0;i<2;i++)n=n.replace(/\$\{([^}]+)\}/g,(r,o)=>t.get(o)??r);return n.includes("${")?null:n.trim()||null}function na(e,t){return new RegExp(`<${t}>([^<]*)`).exec(e)?.[1]?.trim()??null}function $ve(e){let t=new Map,n="(?:implementation|api|compileOnly|runtimeOnly|testImplementation|testCompileOnly|annotationProcessor|kapt|ksp)";for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*["']([^"']+:[^"']+)["']`,"g"))){let r=i[1].split(":");if(r.length<2)continue;let[o,s,a]=r,c=/test|androidTest/i.test(i[0]);t.set(`${o}:${s}`,{version:a??null,kind:c?"dev":"runtime"})}for(let i of e.matchAll(new RegExp(`${n}\\s*\\(?\\s*group:\\s*["']([^"']+)["'],\\s*name:\\s*["']([^"']+)["'](?:,\\s*version:\\s*["']([^"']+)["'])?`,"g")))t.set(`${i[1]}:${i[2]}`,{version:i[3]??null,kind:/test/i.test(i[0])?"dev":"runtime"});return t}function Sve(e){let t=new Map,n=new Map,i="";for(let r of e.split(` +`)){let o=r.split("#")[0].trim();if(!o)continue;let s=/^\[([^\]]+)\]$/.exec(o)?.[1];if(s){i=s;continue}if(i==="versions"){let m=/^([\w.-]+)\s*=\s*["']([^"']+)["']/.exec(o);m&&n.set(m[1],m[2]);continue}if(i!=="libraries")continue;let a=/module\s*=\s*["']([^"']+)["']/.exec(o)?.[1],c=/group\s*=\s*["']([^"']+)["']/.exec(o)?.[1],l=/name\s*=\s*["']([^"']+)["']/.exec(o)?.[1],u=a??(c&&l?`${c}:${l}`:null);if(!u)continue;let d=/version\s*=\s*["']([^"']+)["']/.exec(o)?.[1],p=/version\.ref\s*=\s*["']([^"']+)["']/.exec(o)?.[1],f=d??(p?n.get(p)??null:null);t.set(u,{version:f,kind:"runtime"})}return t}function xve(e){let t=new Map;for(let n of e.split(` +`)){let i=n.trim();if(!i||i.startsWith("#"))continue;let o=i.split("=")[0].split(":");o.length<3||t.set(`${o[0]}:${o[1]}`,{version:o[2],kind:"transitive"})}return t}var nK=gt(gc(),1);var Eve=new Set(["package.json"]),tK=new Set(["package-lock.json","npm-shrinkwrap.json","yarn.lock","pnpm-lock.yaml","bun.lock"]),rK={ecosystem:"npm",name:"npm/yarn/pnpm",handles(e){let t=me(e);return e.includes("node_modules/")?!1:Eve.has(t)||tK.has(t)},isLockfile(e){return tK.has(me(e))},parse(e,t){let n=me(t);return n==="package.json"?Ave(e):n==="yarn.lock"?Pve(e):n==="pnpm-lock.yaml"?Dve(e):n==="bun.lock"?Tve(e):Rve(e)}};function Tve(e){let t=new Map,n=Gt(Ive(e));if(!n?.packages)return t;for(let i of Object.values(n.packages)){let r=Array.isArray(i)?i[0]:i;if(typeof r!="string")continue;let o=r.lastIndexOf("@");if(o<=0)continue;let s=r.slice(0,o),a=r.slice(o+1);/^\d/.test(a)&&t.set(s,{version:a,kind:"transitive"})}return t}function Ive(e){let t="",n=!1;for(let i=0;io.split(/[.+-]/).map(s=>Number.parseInt(s,10)),i=n(e),r=n(t);for(let o=0;oa}return!1}function Eve(e){let t=new Map,n=null;for(let i of e.split(` -`)){let r=i.replace(/\r$/,"");if(!r.trim()||r.startsWith("#"))continue;if(!/^\s/.test(r)){let s=r.replace(/:\s*$/,"").split(",")[0].trim().replace(/^"|"$/g,"");n=XW(s);continue}let o=/^\s+version:?\s+"?([^"\s]+)"?/.exec(r)?.[1];if(o&&n){let s=t.get(n);(!s||QW(o,s.version??""))&&t.set(n,{version:o,kind:"transitive"}),n=null}}return t}function Tve(e){let t=new Map,n;try{n=(0,ZW.parse)(e)}catch{return t}let i=n?.packages;if(!i||typeof i!="object")return t;for(let r of Object.keys(i)){let o=r.startsWith("/")?r.slice(1):r,s=XW(o),a=Ive(o);if(!s||!a)continue;let c=t.get(s);(!c||QW(a,c.version??""))&&t.set(s,{version:a,kind:"transitive"})}return t}function XW(e){let t=e.lastIndexOf("@");return t<=0?e||null:e.slice(0,t)||null}function Ive(e){let t=e.lastIndexOf("@");return t<=0?null:e.slice(t+1).split("(")[0]||null}var tH={ecosystem:"nuget",name:"NuGet",handles(e){let t=me(e);return/\.(cs|fs|vb)proj$/.test(t)||t==="directory.packages.props"||t==="directory.build.props"||t==="packages.lock.json"||t==="packages.config"||t.endsWith(".nuspec")},isLockfile(e){return me(e)==="packages.lock.json"},parse(e,t){let n=me(t);return n==="packages.lock.json"?Rve(e):n==="packages.config"?Nve(e):n.endsWith(".nuspec")?Cve(e):Ave(e)}};function Ave(e){let t=new Map,n=/<(PackageReference|PackageVersion|GlobalPackageReference)\b([^>]*?)(\/>|>([\s\S]*?)<\/\1>)/g;for(let i of e.matchAll(n)){let r=i[2]??"",o=i[4]??"",s=yo(r,"Include")??yo(r,"Update");if(!s)continue;let a=yo(r,"Version")??yo(r,"VersionOverride")??eH(o,"Version"),c=a&&!a.includes("$(")?a:null,u=(yo(r,"PrivateAssets")??eH(o,"PrivateAssets"))?.toLowerCase()==="all"?"dev":"runtime";t.set(s,{version:c,kind:u})}return t}function Rve(e){let t=new Map,n=Gt(e);if(!n?.dependencies)return t;for(let i of Object.values(n.dependencies))if(!(!i||typeof i!="object"))for(let[r,o]of Object.entries(i)){let s=o?.resolved??null;if(!s)continue;let a=o.type==="Direct"?"runtime":"transitive";t.get(r)?.kind==="runtime"&&a==="transitive"||t.set(r,{version:s,kind:a})}return t}function Nve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");if(!r)continue;let o=yo(i,"developmentDependency");t.set(r,{version:yo(i,"version"),kind:o?.toLowerCase()==="true"?"dev":"runtime"})}return t}function Cve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");r&&t.set(r,{version:yo(i,"version"),kind:"runtime"})}return t}function yo(e,t){let n=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return(n?.[2]??n?.[3])?.trim()||null}function eH(e,t){return new RegExp(`<${t}\\s*>([^<]*)`,"i").exec(e)?.[1]?.trim()||null}var nH={ecosystem:"opam",name:"opam",handles(e){let t=me(e);return t.endsWith(".opam")||t.endsWith(".opam.locked")||t==="dune-project"},isLockfile(e){return me(e).endsWith(".opam.locked")},parse(e,t){if(me(t)==="dune-project")return Pve(e);let n=me(t).endsWith(".opam.locked");return Fve(e,n)}};function Pve(e){let t=new Map;for(let n of Ove(e,"depends"))for(let i of Mve(n)){let r=/^\(\s*([\w.+-]+)([\s\S]*)\)$/.exec(i),o=r?.[1]??(/^[\w.+-]+$/.test(i)?i:void 0);if(!o)continue;let s=r?.[2]??"",a=/:with-test|:with-doc|:dev/.test(s)?"dev":"runtime";t.set(o,{version:Dve(s),kind:a})}return t}function Dve(e){let t=[...e.matchAll(/([<>=]+)\s*([\w.~+-]+)/g)].map(n=>`${n[1]} ${n[2]}`);return t.length===0?null:t.length===1&&t[0].startsWith("= ")?t[0].slice(2):t.join(" & ")}function Ove(e,t){let n=[],i=new RegExp(`\\(\\s*${t}\\b`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];c==="("?o+=1:c===")"&&(o-=1)}n.push(e.slice(a,s-1))}return n}function Mve(e){let t=[],n="",i=0;for(let r of e){if(r==="("?i+=1:r===")"&&(i-=1),i===0&&/\s/.test(r)){n.trim()&&t.push(n.trim()),n="";continue}n+=r}return n.trim()&&t.push(n.trim()),t}var Lve={depends:"runtime",depopts:"optional"};function Fve(e,t){let n=new Map;for(let[i,r]of Object.entries(Lve))for(let o of jve(e,i))for(let s of zve(o)){let a=/^"([^"]+)"/.exec(s)?.[1];if(!a)continue;let c=/\{([\s\S]*)\}/.exec(s)?.[1]??"",l=/\bwith-test\b|\bwith-doc\b|\bdev\b/.test(c)?"dev":r;n.set(a,{version:Uve(c),kind:t?"transitive":l})}return n}function Uve(e){if(!e.trim())return null;let t=[...e.matchAll(/([<>=!]+)\s*"([^"]+)"/g)].map(i=>`${i[1]} ${i[2]}`);return t.length===0?null:/^=\s/.exec(t[0])&&t.length===1?t[0].slice(2):t.join(" & ")}function jve(e,t){let n=[],i=new RegExp(`(?:^|\\n)\\s*${t}\\s*:\\s*\\[`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];if(c==='"'){for(s+=1;si))continue;if(c")return Dk(e);for(let r=n+1;r{r&&o&&t.set(r,{version:o,kind:s}),r=null,o=null,s="transitive"};for(let c of n){let l=cP(c.replace(/\r$/,""));if(!l.trim())continue;let u=l.length-l.trimStart().length;if(u===0){a(),i=/^packages\s*:/.test(l.trim());continue}if(!i)continue;if(u===2){a(),r=/^\s*"?([A-Za-z_][\w.-]*)"?\s*:/.exec(l)?.[1]??null;continue}if(!r)continue;let d=/^\s*([A-Za-z_][\w-]*)\s*:(.*)$/.exec(l);if(d){if(d[1]==="version")o=Dk(d[2].trim())||null;else if(d[1]==="dependency"){let p=Dk(d[2].trim());s=p.startsWith("direct dev")?"dev":p.startsWith("direct")?"runtime":"transitive"}}}return a(),t}function cP(e){let t=!1,n=!1;for(let i=0;io.split(/[.+-]/).map(s=>Number.parseInt(s,10)),i=n(e),r=n(t);for(let o=0;oa}return!1}function Pve(e){let t=new Map,n=null;for(let i of e.split(` +`)){let r=i.replace(/\r$/,"");if(!r.trim()||r.startsWith("#"))continue;if(!/^\s/.test(r)){let s=r.replace(/:\s*$/,"").split(",")[0].trim().replace(/^"|"$/g,"");n=oK(s);continue}let o=/^\s+version:?\s+"?([^"\s]+)"?/.exec(r)?.[1];if(o&&n){let s=t.get(n);(!s||iK(o,s.version??""))&&t.set(n,{version:o,kind:"transitive"}),n=null}}return t}function Dve(e){let t=new Map,n;try{n=(0,nK.parse)(e)}catch{return t}let i=n?.packages;if(!i||typeof i!="object")return t;for(let r of Object.keys(i)){let o=r.startsWith("/")?r.slice(1):r,s=oK(o),a=Ove(o);if(!s||!a)continue;let c=t.get(s);(!c||iK(a,c.version??""))&&t.set(s,{version:a,kind:"transitive"})}return t}function oK(e){let t=e.lastIndexOf("@");return t<=0?e||null:e.slice(0,t)||null}function Ove(e){let t=e.lastIndexOf("@");return t<=0?null:e.slice(t+1).split("(")[0]||null}var aK={ecosystem:"nuget",name:"NuGet",handles(e){let t=me(e);return/\.(cs|fs|vb)proj$/.test(t)||t==="directory.packages.props"||t==="directory.build.props"||t==="packages.lock.json"||t==="packages.config"||t.endsWith(".nuspec")},isLockfile(e){return me(e)==="packages.lock.json"},parse(e,t){let n=me(t);return n==="packages.lock.json"?Lve(e):n==="packages.config"?Fve(e):n.endsWith(".nuspec")?Uve(e):Mve(e)}};function Mve(e){let t=new Map,n=/<(PackageReference|PackageVersion|GlobalPackageReference)\b([^>]*?)(\/>|>([\s\S]*?)<\/\1>)/g;for(let i of e.matchAll(n)){let r=i[2]??"",o=i[4]??"",s=yo(r,"Include")??yo(r,"Update");if(!s)continue;let a=yo(r,"Version")??yo(r,"VersionOverride")??sK(o,"Version"),c=a&&!a.includes("$(")?a:null,u=(yo(r,"PrivateAssets")??sK(o,"PrivateAssets"))?.toLowerCase()==="all"?"dev":"runtime";t.set(s,{version:c,kind:u})}return t}function Lve(e){let t=new Map,n=Gt(e);if(!n?.dependencies)return t;for(let i of Object.values(n.dependencies))if(!(!i||typeof i!="object"))for(let[r,o]of Object.entries(i)){let s=o?.resolved??null;if(!s)continue;let a=o.type==="Direct"?"runtime":"transitive";t.get(r)?.kind==="runtime"&&a==="transitive"||t.set(r,{version:s,kind:a})}return t}function Fve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");if(!r)continue;let o=yo(i,"developmentDependency");t.set(r,{version:yo(i,"version"),kind:o?.toLowerCase()==="true"?"dev":"runtime"})}return t}function Uve(e){let t=new Map;for(let n of e.matchAll(/]*?)\/?>/g)){let i=n[1]??"",r=yo(i,"id");r&&t.set(r,{version:yo(i,"version"),kind:"runtime"})}return t}function yo(e,t){let n=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return(n?.[2]??n?.[3])?.trim()||null}function sK(e,t){return new RegExp(`<${t}\\s*>([^<]*)`,"i").exec(e)?.[1]?.trim()||null}var cK={ecosystem:"opam",name:"opam",handles(e){let t=me(e);return t.endsWith(".opam")||t.endsWith(".opam.locked")||t==="dune-project"},isLockfile(e){return me(e).endsWith(".opam.locked")},parse(e,t){if(me(t)==="dune-project")return jve(e);let n=me(t).endsWith(".opam.locked");return qve(e,n)}};function jve(e){let t=new Map;for(let n of Gve(e,"depends"))for(let i of Vve(n)){let r=/^\(\s*([\w.+-]+)([\s\S]*)\)$/.exec(i),o=r?.[1]??(/^[\w.+-]+$/.test(i)?i:void 0);if(!o)continue;let s=r?.[2]??"",a=/:with-test|:with-doc|:dev/.test(s)?"dev":"runtime";t.set(o,{version:zve(s),kind:a})}return t}function zve(e){let t=[...e.matchAll(/([<>=]+)\s*([\w.~+-]+)/g)].map(n=>`${n[1]} ${n[2]}`);return t.length===0?null:t.length===1&&t[0].startsWith("= ")?t[0].slice(2):t.join(" & ")}function Gve(e,t){let n=[],i=new RegExp(`\\(\\s*${t}\\b`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];c==="("?o+=1:c===")"&&(o-=1)}n.push(e.slice(a,s-1))}return n}function Vve(e){let t=[],n="",i=0;for(let r of e){if(r==="("?i+=1:r===")"&&(i-=1),i===0&&/\s/.test(r)){n.trim()&&t.push(n.trim()),n="";continue}n+=r}return n.trim()&&t.push(n.trim()),t}var Bve={depends:"runtime",depopts:"optional"};function qve(e,t){let n=new Map;for(let[i,r]of Object.entries(Bve))for(let o of Kve(e,i))for(let s of Hve(o)){let a=/^"([^"]+)"/.exec(s)?.[1];if(!a)continue;let c=/\{([\s\S]*)\}/.exec(s)?.[1]??"",l=/\bwith-test\b|\bwith-doc\b|\bdev\b/.test(c)?"dev":r;n.set(a,{version:Wve(c),kind:t?"transitive":l})}return n}function Wve(e){if(!e.trim())return null;let t=[...e.matchAll(/([<>=!]+)\s*"([^"]+)"/g)].map(i=>`${i[1]} ${i[2]}`);return t.length===0?null:/^=\s/.exec(t[0])&&t.length===1?t[0].slice(2):t.join(" & ")}function Kve(e,t){let n=[],i=new RegExp(`(?:^|\\n)\\s*${t}\\s*:\\s*\\[`,"g");for(let r of e.matchAll(i)){let o=1,s=r.index+r[0].length,a=s;for(;s0;s++){let c=e[s];if(c==='"'){for(s+=1;si))continue;if(c")return zk(e);for(let r=n+1;r{r&&o&&t.set(r,{version:o,kind:s}),r=null,o=null,s="transitive"};for(let c of n){let l=hP(c.replace(/\r$/,""));if(!l.trim())continue;let u=l.length-l.trimStart().length;if(u===0){a(),i=/^packages\s*:/.test(l.trim());continue}if(!i)continue;if(u===2){a(),r=/^\s*"?([A-Za-z_][\w.-]*)"?\s*:/.exec(l)?.[1]??null;continue}if(!r)continue;let d=/^\s*([A-Za-z_][\w-]*)\s*:(.*)$/.exec(l);if(d){if(d[1]==="version")o=zk(d[2].trim())||null;else if(d[1]==="dependency"){let p=zk(d[2].trim());s=p.startsWith("direct dev")?"dev":p.startsWith("direct")?"runtime":"transitive"}}}return a(),t}function hP(e){let t=!1,n=!1;for(let i=0;i=!~,(\[@]/.test(r)?null:{name:i,version:r||null}}function Ng(e){return e.trim().toLowerCase().replace(/[-_.]+/g,"-")}function Wve(e){let t=new Map,n=e.split(` -`),i=Ok(e),r=n.filter(s=>{let a=s.trim();return a!==""&&!a.startsWith("#")&&!a.startsWith("-")}),o=r.filter(s=>Rg(s)!==null).length;if(r.length>=5&&o/r.length<.7)return t;for(let s=0;so.length&&n.endsWith(o))return{version:n.slice(0,-o.length),platform:r}}let i=n.split("-");for(let r=1;r/^[a-z0-9_.]+$/.test(i))}var uH={ecosystem:"rubygems",name:"bundler",handles(e){let t=me(e);return t==="gemfile"||t==="gemfile.lock"||t.endsWith(".gemspec")},isLockfile(e){return me(e)==="gemfile.lock"},parse(e,t){let n=me(t);return n==="gemfile.lock"?nwe(e):n.endsWith(".gemspec")?rwe(e):twe(e)}};function twe(e){let t=new Map,n=[];for(let i of e.split(` -`)){let r=i.split("#")[0].trim();if(!r)continue;let o=/^group\s+(.+?)\s+do$/.exec(r);if(o){n.push(o[1]);continue}if(r==="end"&&n.length){n.pop();continue}let s=/^gem\s+["']([^"']+)["'](.*)$/.exec(r);if(!s)continue;let a=s[1],c=s[2]??"",l=[...c.matchAll(/["']([~><=!]*\s*[\d][^"']*)["']/g)].map(m=>m[1].trim()),u=l.length?l.join(", "):null,d=/\bgroups?:\s*\[?\s*:?([\w,\s:]+)/.exec(c)?.[1]??"",p=`${n.join(" ")} ${d}`,f=/development|test/.test(p)?"dev":"runtime";t.set(a,{version:u,kind:f})}return t}function nwe(e){let t=new Map,n=cH(e),i=!1;for(let r of e.split(` -`)){let o=r.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(o)){i=!0;continue}if(o.trim()&&!/^\s/.test(o)){i=!1;continue}if(!i)continue;let s=/^ {4}([A-Za-z0-9_.-]+) \(([^)]+)\)$/.exec(o);if(!s)continue;let a=lH(s[2],n);t.set(s[1],{version:a.version,kind:"transitive",...a.platform?{platform:a.platform}:{}})}return t}function rwe(e){let t=new Map,n=/add_(development_|runtime_)?dependency[\s(]+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[2],{version:i[3]??null,kind:i[1]==="development_"?"dev":"runtime"});return t}var dH={ecosystem:"maven",name:"sbt",handles(e){return me(e).endsWith(".sbt")?!0:/(^|\/)project\/[\w-]+\.scala$/.test(e.toLowerCase())},isLockfile(){return!1},parse(e){return owe(e)}};function iwe(e){let t=e.trim().split(".");return t[0]==="3"?"3":t.length>=2?`${t[0]}.${t[1]}`:e.trim()}function owe(e){let t=new Map,n=/\bscalaVersion\s*(?::=|\+=)\s*"([^"]+)"/.exec(e)?.[1],i=n?`_${iwe(n)}`:"",r=new Map;for(let s of e.matchAll(/\bval\s+([A-Za-z_]\w*)\s*=\s*"([^"]+)"/g))r.set(s[1],s[2]);let o=/"([\w.-]+)"\s*(%%%|%%|%)\s*"([\w.-]+)"\s*%\s*(?:"([^"]+)"|([A-Za-z_]\w*))((?:\s*%\s*"[A-Za-z]+")?)/g;for(let s of e.matchAll(o)){let a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],p=s[6]??"",f=c==="%%"?`${a}:${l}${i}`:`${a}:${l}`,m=u??(d?r.get(d)??null:null),g=/"(test|it)"/i.test(p)||/"provided"/i.test(p)?"dev":/"optional"/i.test(p)?"optional":"runtime";t.set(f,{version:m,kind:g})}for(let s of e.matchAll(/addSbtPlugin\s*\(\s*"([\w.-]+)"\s*%\s*"([\w.-]+)"\s*%\s*"([^"]+)"/g))t.set(`${s[1]}:${s[2]}`,{version:s[3],kind:"dev"});return t}var pH={ecosystem:"swift",name:"Swift Package Manager",handles(e){let t=me(e);return t==="package.resolved"||/^package(@swift-[\d.]+)?\.swift$/.test(t)},isLockfile(e){return me(e)==="package.resolved"},parse(e,t){return me(t)==="package.resolved"?cwe(e):swe(e)}};function swe(e){let t=new Map;for(let n of e.matchAll(/\.package\s*\(([\s\S]*?)\)\s*[,\]]/g)){let i=n[1]??"",r=/\burl\s*:\s*"([^"]+)"/.exec(i)?.[1],o=/\bpath\s*:\s*"([^"]+)"/.exec(i)?.[1];if(!r&&o)continue;let s=/\bid\s*:\s*"([^"]+)"/.exec(i)?.[1],a=r?fH(r):s;a&&t.set(a,{version:awe(i),kind:"runtime"})}return t}function awe(e){let t=/\bexact\s*:\s*"([^"]+)"/.exec(e)?.[1];if(t)return t;let n=/\bfrom\s*:\s*"([^"]+)"/.exec(e)?.[1];if(n)return`^${n}`;let i=/\.upToNextMajor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(i)return`^${i}`;let r=/\.upToNextMinor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(r)return`~${r}`;let o=/"([^"]+)"\s*\.\.[.<]\s*"([^"]+)"/.exec(e);return o?`>=${o[1]} <${o[2]}`:null}function cwe(e){let t=new Map,n=Gt(e);if(!n)return t;for(let i of n.pins??n.object?.pins??[]){let r=i.location??i.repositoryURL,o=r?fH(r):i.identity??i.package;if(!o)continue;let s=i.state?.version??null;t.set(o,{version:s,kind:"transitive"})}return t}function fH(e){let t=e.trim().replace(/\.git$/,"").replace(/\/+$/,"");if(!t)return null;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)$/.exec(t);return n?`${n[1]}/${n[2]}`:t.split("/").pop()||null}var mH={ecosystem:"vcpkg",name:"vcpkg",handles(e){let t=me(e);return t==="vcpkg.json"||t==="vcpkg-configuration.json"},isLockfile(){return!1},parse(e){let t=new Map,n=Gt(e);if(!n)return t;for(let r of n.dependencies??[]){if(typeof r=="string"){t.set(r,{version:null,kind:"runtime"});continue}r.name&&t.set(r.name,{version:r["version>="]?`>=${r["version>="]}`:null,kind:r.host?"dev":"runtime"})}for(let r of n.overrides??[]){if(!r.name)continue;let o=r.version??r["version-string"]??r["version-semver"]??null,s=t.get(r.name);t.set(r.name,{version:o,kind:s?.kind??"runtime"})}let i=n["builtin-baseline"]??n.registries?.find(r=>r.baseline)?.baseline;return i&&t.set(lwe,{version:i,kind:"transitive"}),t}},lwe="vcpkg-baseline";var gH=[YW,aH,qW,jW,dH,HW,uH,tH,VW,WW,iH,pH,GW,nH,zW,mH,DW];function hH(e){return gH.some(t=>t.handles(e))}function Mk(e){return gH.find(t=>t.handles(e))}function yH(e){let t=new Map;for(let n of e){let i=Mk(n.path);if(!i)continue;let r=n.before?i.parse(n.before,n.path):new Map,o=n.after?i.parse(n.after,n.path):new Map,s=i.isLockfile(n.path);for(let a of new Set([...r.keys(),...o.keys()])){let c=r.get(a),l=o.get(a),u=c?.version??null,d=l?.version??null;if(u===d)continue;let p=Gi(i.ecosystem),f=u===null?null:p.exactVersion(u),m=d===null?null:p.exactVersion(d);if((f&&m?Eg(f,m,i.ecosystem):null)===0)continue;if(i.ecosystem==="npm"&&!f&&!m){let _=Ck(u),S=Ck(d);if(_&&_===S)continue}let h=l?.kind??c?.kind??"runtime",b=s&&h==="runtime"?"transitive":h,y={name:a,ecosystem:i.ecosystem,from:f,to:m,kind:b,bump:f&&m?ta(f,m,i.ecosystem):EW(u,d,i.ecosystem),manifestPath:n.path,rawFrom:u,rawTo:d,source:s?"lockfile":"manifest"},w=`${i.ecosystem}:${uwe(n.path)}:${a}`,k=t.get(w);if(k&&k.source!==y.source){let _=k.source==="manifest"?k:y,S=k.source==="lockfile"?k:y,x=S.from??_.from,E=S.to??_.to;t.set(w,{..._,from:x,to:E,bump:ta(x,E,i.ecosystem)})}else(!k||dwe(k,y,s))&&t.set(w,y)}}return[...t.values()].sort((n,i)=>n.ecosystem.localeCompare(i.ecosystem)||n.name.localeCompare(i.name))}function uwe(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function dwe(e,t,n){let i=e.source==="lockfile";return i&&!n?!0:!i&&n?!1:t.from!==null&&t.to!==null&&(e.from===null||e.to===null)}function bH(e,t){let n=[],i=[],r=new Set(t.ecosystems);for(let o of e){let s=pwe(o,t,r);s?i.push({change:o,reason:s}):n.push(o)}return{actionable:n,skipped:i}}function pwe(e,t,n){if(!n.has(e.ecosystem))return`ecosystem "${e.ecosystem}" is not enabled in drift.yml`;if(Yo(t.ignore,e.name))return"matched an `ignore` pattern in drift.yml";if(e.rawTo!==null&&e.rawTo!==void 0&&e.to===null)return"target manifest range has no exact resolved registry version";if(e.rawFrom!==null&&e.rawFrom!==void 0&&e.from===null)return"previous manifest range has no exact resolved registry version";if(e.to===null)return"dependency was removed; removals need no compatibility fix";if(e.kind==="dev"&&!t.triggerOn.dev)return"dev dependency (enable `triggerOn.dev` to analyse these)";if(e.kind==="transitive"&&!t.triggerOn.transitive)return"transitive dependency (enable `triggerOn.transitive` to analyse these)";if(e.from===null)return"newly added dependency; there is no prior version to break against";let i=Ig(e.from,e.to,e.ecosystem);return e.bump==="major"&&!t.triggerOn.major?"major bumps are disabled in drift.yml (enable `triggerOn.major` to include these)":e.bump==="minor"&&!t.triggerOn.minor&&!i?"minor bumps are disabled in drift.yml (enable `triggerOn.minor` to include these)":e.bump==="patch"&&!t.triggerOn.patch?"patch bumps are disabled in drift.yml (enable `triggerOn.patch` to include these)":e.bump==="prerelease"&&!t.triggerOn.patch?"prerelease moves are disabled in drift.yml (enable `triggerOn.patch`)":null}var Mg=gt(Dc(),1);var _d=require("node:crypto"),Vi=require("node:fs/promises"),yP=require("node:path");var xH=require("node:fs"),ra=require("node:os");var vH=require("node:async_hooks");var fwe=[/\bAuthorization\s*:\s*[^\n]+/gi,/\bBearer\s+\S+/gi,/\bgh[oprsu]_[A-Za-z0-9]{10,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{10,}\b/g,/\bsk-[A-Za-z0-9][A-Za-z0-9_-]{9,}/g];function mwe(e){let t=e;for(let n of fwe)t=t.replace(n,"[REDACTED]");return t}function gwe(e){return mwe(e instanceof Error?e.message:String(e))}var wH=new vH.AsyncLocalStorage;function Qo(){return wH.getStore()}function Vt(){return Qo()?.state.now()??0}function Cg(){let e=Qo();return e!==void 0&&!e.state.finished}function kH(e){Qo()?.state.httpRequests.push(e)}function $H(e){Qo()?.state.httpAttempts.push(e)}function uP(e){Qo()?.state.execCommands.push(e)}function hwe(){return{hits:0,misses:0,writes:0,memoryHits:0,diskHits:0,coalescedHits:0,revalidated304:0}}function Rr(e,t,n=!1){let i=Qo()?.state;if(!i)return;let r=i.caches.get(e)??hwe();if(typeof t=="boolean"){t?r.hits+=1:r.misses+=1,n&&(r.writes+=1),i.caches.set(e,r);return}t==="memory_hit"?(r.memoryHits+=1,r.hits+=1):t==="disk_hit"?(r.diskHits+=1,r.hits+=1):t==="coalesced_hit"?(r.coalescedHits+=1,r.hits+=1):t==="revalidated_304"?r.revalidated304+=1:t==="miss"?r.misses+=1:t==="write"&&(r.writes+=1),i.caches.set(e,r)}function _H(e,t=1){let n=Qo()?.state;n&&n.counters.set(e,(n.counters.get(e)??0)+t)}var ywe=Object.freeze({end(){},fail(){}});function SH(e,t,n,i){let r=t!==null?e.spans.find(s=>s.id===t):void 0,o={id:e.nextSpanId++,parentId:t,depth:r?r.depth+1:0,name:n,startMs:e.now(),endMs:null,meta:{...i},status:"ok"};return e.spans.push(o),o}function Lk(e,t,n,i,r){e.endMs===null&&(e.endMs=t.now(),n==="error"?(e.status="error",e.error=gwe(i),Object.assign(e.meta,r)):Object.assign(e.meta,i))}function Mc(e,t){let n=Qo();if(!n||n.state.finished)return ywe;let{state:i}=n,r=SH(i,n.parentId,e,t),o=!1;return{end(s){o||(o=!0,Lk(r,i,"ok",s))},fail(s,a){o||(o=!0,Lk(r,i,"error",s,a))}}}async function Br(e,t,n){let i=Qo();if(!i||i.state.finished)return n();let{state:r}=i,o=SH(r,i.parentId,e,t);try{let s=await wH.run({state:r,parentId:o.id},n);return Lk(o,r,"ok"),s}catch(s){throw Lk(o,r,"error",s),s}}var bwe=Object.freeze({end(){}}),$d=process.env.DRIFT_PROFILE,bo=!!$d&&$d!=="0"&&$d!=="false",EH=[],pP=new Map,vwe=bo?Date.now():0,wwe=bo?performance.now():0;function fP(){return performance.now()-wwe}function Pg(){return bo}function kwe(e,t,n){return{operation:t,...new Set(["surface","surface-sources","surface-deps","evidence"]).has(e)?{package:t}:{},...n}}var dP=100,$we=50;function _we(){if(!Cg())return()=>{};let e=performance.now()+dP,t=setInterval(()=>{let n=performance.now(),i=Math.max(0,n-e);if(e=n+dP,i<$we||!Cg())return;Mc("event-loop.lag",{lagMs:Math.round(i)}).end()},dP);return t.unref(),()=>clearInterval(t)}function It(e,t,n){let i=Cg();if(!bo&&!i)return bwe;let r=bo?fP():0,o=i?Mc(`work.${e}`,kwe(e,t,n)):null,s=i&&e==="scan"&&t==="total"?_we():null,a=!1;return{end(c){a||(a=!0,bo&&EH.push({cat:e,name:t,start:r,end:fP(),...n||c?{meta:{...n,...c}}:{}}),o?.end(c),s?.())}}}async function En(e,t,n,i){let r=It(e,t,i);try{return await n()}finally{r.end()}}function nt(e,t=1){bo&&pP.set(e,(pP.get(e)??0)+t),Cg()&&_H(`profile.${e}`,t)}var mP=0;bo&&setInterval(()=>{mP=Math.max(mP,Math.round(process.memoryUsage.rss()/1048576))},250).unref();function Swe(){let e=["DRIFT_CONCURRENCY","DRIFT_NETWORK_CONCURRENCY","DRIFT_LOCAL_CONCURRENCY"];return{startedAt:new Date(vwe).toISOString(),durationMs:Math.round(fP()),spans:EH,counters:Object.fromEntries([...pP].sort(([t],[n])=>t.localeCompare(n))),machine:{platform:(0,ra.platform)(),arch:(0,ra.arch)(),cpus:(0,ra.cpus)().length,totalMemMb:Math.round((0,ra.totalmem)()/(1024*1024)),node:process.version},peakRssMb:Math.max(mP,Math.round(process.memoryUsage.rss()/(1024*1024))),env:Object.fromEntries(e.filter(t=>process.env[t]).map(t=>[t,process.env[t]]))}}function xwe(e){if(!bo)return;let t=e??($d&&$d!=="1"?$d:"drift-profile.json");try{(0,xH.writeFileSync)(t,JSON.stringify(Swe()),"utf8"),process.stderr.write(` +`))}var dK=new Set(["poetry.lock","pipfile.lock","uv.lock","requirements.lock"]),fK={ecosystem:"pypi",name:"pip/poetry/uv",handles(e){let t=me(e);return e.includes("site-packages/")||e.includes(".venv/")?!1:t==="pyproject.toml"||t==="setup.py"||t==="pipfile"||dK.has(t)||Lc(t)},isLockfile(e){return dK.has(me(e))},parse(e,t){let n=me(t);return n==="pyproject.toml"?ewe(e):n==="poetry.lock"||n==="uv.lock"?twe(e):n==="pipfile"?nwe(e):n==="setup.py"?rwe(e):Xve(e)}};function Lg(e){let t=e.trim();if(!t||t.startsWith("#")||t.startsWith("-")||/^[a-z+]+:\/\//i.test(t))return null;if(t=t.split(";")[0].trim(),t=t.replace(/\s+#.*$/,"").trim(),/\s@\s/.test(t)){let o=t.split("@")[0].trim();return o?{name:Fg(o),version:null}:null}let n=/^([A-Za-z0-9._-]+)\s*(\[[^\]]*\])?\s*(.*)$/.exec(t);if(!n)return null;let i=Fg(n[1]),r=(n[3]??"").trim();return r&&!/^[<>=!~,(\[@]/.test(r)?null:{name:i,version:r||null}}function Fg(e){return e.trim().toLowerCase().replace(/[-_.]+/g,"-")}function Xve(e){let t=new Map,n=e.split(` +`),i=Gk(e),r=n.filter(s=>{let a=s.trim();return a!==""&&!a.startsWith("#")&&!a.startsWith("-")}),o=r.filter(s=>Lg(s)!==null).length;if(r.length>=5&&o/r.length<.7)return t;for(let s=0;so.length&&n.endsWith(o))return{version:n.slice(0,-o.length),platform:r}}let i=n.split("-");for(let r=1;r/^[a-z0-9_.]+$/.test(i))}var hK={ecosystem:"rubygems",name:"bundler",handles(e){let t=me(e);return t==="gemfile"||t==="gemfile.lock"||t.endsWith(".gemspec")},isLockfile(e){return me(e)==="gemfile.lock"},parse(e,t){let n=me(t);return n==="gemfile.lock"?lwe(e):n.endsWith(".gemspec")?uwe(e):cwe(e)}};function cwe(e){let t=new Map,n=[];for(let i of e.split(` +`)){let r=i.split("#")[0].trim();if(!r)continue;let o=/^group\s+(.+?)\s+do$/.exec(r);if(o){n.push(o[1]);continue}if(r==="end"&&n.length){n.pop();continue}let s=/^gem\s+["']([^"']+)["'](.*)$/.exec(r);if(!s)continue;let a=s[1],c=s[2]??"",l=[...c.matchAll(/["']([~><=!]*\s*[\d][^"']*)["']/g)].map(m=>m[1].trim()),u=l.length?l.join(", "):null,d=/\bgroups?:\s*\[?\s*:?([\w,\s:]+)/.exec(c)?.[1]??"",p=`${n.join(" ")} ${d}`,f=/development|test/.test(p)?"dev":"runtime";t.set(a,{version:u,kind:f})}return t}function lwe(e){let t=new Map,n=mK(e),i=!1;for(let r of e.split(` +`)){let o=r.replace(/\r$/,"");if(/^\s*specs:\s*$/.test(o)){i=!0;continue}if(o.trim()&&!/^\s/.test(o)){i=!1;continue}if(!i)continue;let s=/^ {4}([A-Za-z0-9_.-]+) \(([^)]+)\)$/.exec(o);if(!s)continue;let a=gK(s[2],n);t.set(s[1],{version:a.version,kind:"transitive",...a.platform?{platform:a.platform}:{}})}return t}function uwe(e){let t=new Map,n=/add_(development_|runtime_)?dependency[\s(]+["']([^"']+)["'](?:\s*,\s*["']([^"']+)["'])?/g;for(let i of e.matchAll(n))t.set(i[2],{version:i[3]??null,kind:i[1]==="development_"?"dev":"runtime"});return t}var yK={ecosystem:"maven",name:"sbt",handles(e){return me(e).endsWith(".sbt")?!0:/(^|\/)project\/[\w-]+\.scala$/.test(e.toLowerCase())},isLockfile(){return!1},parse(e){return pwe(e)}};function dwe(e){let t=e.trim().split(".");return t[0]==="3"?"3":t.length>=2?`${t[0]}.${t[1]}`:e.trim()}function pwe(e){let t=new Map,n=/\bscalaVersion\s*(?::=|\+=)\s*"([^"]+)"/.exec(e)?.[1],i=n?`_${dwe(n)}`:"",r=new Map;for(let s of e.matchAll(/\bval\s+([A-Za-z_]\w*)\s*=\s*"([^"]+)"/g))r.set(s[1],s[2]);let o=/"([\w.-]+)"\s*(%%%|%%|%)\s*"([\w.-]+)"\s*%\s*(?:"([^"]+)"|([A-Za-z_]\w*))((?:\s*%\s*"[A-Za-z]+")?)/g;for(let s of e.matchAll(o)){let a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],p=s[6]??"",f=c==="%%"?`${a}:${l}${i}`:`${a}:${l}`,m=u??(d?r.get(d)??null:null),g=/"(test|it)"/i.test(p)||/"provided"/i.test(p)?"dev":/"optional"/i.test(p)?"optional":"runtime";t.set(f,{version:m,kind:g})}for(let s of e.matchAll(/addSbtPlugin\s*\(\s*"([\w.-]+)"\s*%\s*"([\w.-]+)"\s*%\s*"([^"]+)"/g))t.set(`${s[1]}:${s[2]}`,{version:s[3],kind:"dev"});return t}var bK={ecosystem:"swift",name:"Swift Package Manager",handles(e){let t=me(e);return t==="package.resolved"||/^package(@swift-[\d.]+)?\.swift$/.test(t)},isLockfile(e){return me(e)==="package.resolved"},parse(e,t){return me(t)==="package.resolved"?gwe(e):fwe(e)}};function fwe(e){let t=new Map;for(let n of e.matchAll(/\.package\s*\(([\s\S]*?)\)\s*[,\]]/g)){let i=n[1]??"",r=/\burl\s*:\s*"([^"]+)"/.exec(i)?.[1],o=/\bpath\s*:\s*"([^"]+)"/.exec(i)?.[1];if(!r&&o)continue;let s=/\bid\s*:\s*"([^"]+)"/.exec(i)?.[1],a=r?vK(r):s;a&&t.set(a,{version:mwe(i),kind:"runtime"})}return t}function mwe(e){let t=/\bexact\s*:\s*"([^"]+)"/.exec(e)?.[1];if(t)return t;let n=/\bfrom\s*:\s*"([^"]+)"/.exec(e)?.[1];if(n)return`^${n}`;let i=/\.upToNextMajor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(i)return`^${i}`;let r=/\.upToNextMinor\s*\(\s*from\s*:\s*"([^"]+)"/.exec(e)?.[1];if(r)return`~${r}`;let o=/"([^"]+)"\s*\.\.[.<]\s*"([^"]+)"/.exec(e);return o?`>=${o[1]} <${o[2]}`:null}function gwe(e){let t=new Map,n=Gt(e);if(!n)return t;for(let i of n.pins??n.object?.pins??[]){let r=i.location??i.repositoryURL,o=r?vK(r):i.identity??i.package;if(!o)continue;let s=i.state?.version??null;t.set(o,{version:s,kind:"transitive"})}return t}function vK(e){let t=e.trim().replace(/\.git$/,"").replace(/\/+$/,"");if(!t)return null;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)$/.exec(t);return n?`${n[1]}/${n[2]}`:t.split("/").pop()||null}var wK={ecosystem:"vcpkg",name:"vcpkg",handles(e){let t=me(e);return t==="vcpkg.json"||t==="vcpkg-configuration.json"},isLockfile(){return!1},parse(e){let t=new Map,n=Gt(e);if(!n)return t;for(let r of n.dependencies??[]){if(typeof r=="string"){t.set(r,{version:null,kind:"runtime"});continue}r.name&&t.set(r.name,{version:r["version>="]?`>=${r["version>="]}`:null,kind:r.host?"dev":"runtime"})}for(let r of n.overrides??[]){if(!r.name)continue;let o=r.version??r["version-string"]??r["version-semver"]??null,s=t.get(r.name);t.set(r.name,{version:o,kind:s?.kind??"runtime"})}let i=n["builtin-baseline"]??n.registries?.find(r=>r.baseline)?.baseline;return i&&t.set(hwe,{version:i,kind:"transitive"}),t}},hwe="vcpkg-baseline";var kK=[rK,fK,YW,WW,yK,XW,hK,aK,JW,QW,uK,bK,HW,cK,KW,wK,jW];function _K(e){return kK.some(t=>t.handles(e))}function Vk(e){return kK.find(t=>t.handles(e))}function $K(e){let t=new Map;for(let n of e){let i=Vk(n.path);if(!i)continue;let r=n.before?i.parse(n.before,n.path):new Map,o=n.after?i.parse(n.after,n.path):new Map,s=i.isLockfile(n.path);for(let a of new Set([...r.keys(),...o.keys()])){let c=r.get(a),l=o.get(a),u=c?.version??null,d=l?.version??null;if(u===d)continue;let p=Gi(i.ecosystem),f=u===null?null:p.exactVersion(u),m=d===null?null:p.exactVersion(d);if((f&&m?Pg(f,m,i.ecosystem):null)===0)continue;if(i.ecosystem==="npm"&&!f&&!m){let $=Uk(u),S=Uk(d);if($&&$===S)continue}let h=l?.kind??c?.kind??"runtime",b=s&&h==="runtime"?"transitive":h,y={name:a,ecosystem:i.ecosystem,from:f,to:m,kind:b,bump:f&&m?ta(f,m,i.ecosystem):NW(u,d,i.ecosystem),manifestPath:n.path,rawFrom:u,rawTo:d,source:s?"lockfile":"manifest"},w=`${i.ecosystem}:${ywe(n.path)}:${a}`,k=t.get(w);if(k&&k.source!==y.source){let $=k.source==="manifest"?k:y,S=k.source==="lockfile"?k:y,x=S.from??$.from,E=S.to??$.to;t.set(w,{...$,from:x,to:E,bump:ta(x,E,i.ecosystem)})}else(!k||bwe(k,y,s))&&t.set(w,y)}}return[...t.values()].sort((n,i)=>n.ecosystem.localeCompare(i.ecosystem)||n.name.localeCompare(i.name))}function ywe(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function bwe(e,t,n){let i=e.source==="lockfile";return i&&!n?!0:!i&&n?!1:t.from!==null&&t.to!==null&&(e.from===null||e.to===null)}function SK(e,t){let n=[],i=[],r=new Set(t.ecosystems);for(let o of e){let s=vwe(o,t,r);s?i.push({change:o,reason:s}):n.push(o)}return{actionable:n,skipped:i}}function vwe(e,t,n){if(!n.has(e.ecosystem))return`ecosystem "${e.ecosystem}" is not enabled in drift.yml`;if(Yo(t.ignore,e.name))return"matched an `ignore` pattern in drift.yml";if(e.rawTo!==null&&e.rawTo!==void 0&&e.to===null)return"target manifest range has no exact resolved registry version";if(e.rawFrom!==null&&e.rawFrom!==void 0&&e.from===null)return"previous manifest range has no exact resolved registry version";if(e.to===null)return"dependency was removed; removals need no compatibility fix";if(e.kind==="dev"&&!t.triggerOn.dev)return"dev dependency (enable `triggerOn.dev` to analyse these)";if(e.kind==="transitive"&&!t.triggerOn.transitive)return"transitive dependency (enable `triggerOn.transitive` to analyse these)";if(e.from===null)return"newly added dependency; there is no prior version to break against";let i=Og(e.from,e.to,e.ecosystem);return e.bump==="major"&&!t.triggerOn.major?"major bumps are disabled in drift.yml (enable `triggerOn.major` to include these)":e.bump==="minor"&&!t.triggerOn.minor&&!i?"minor bumps are disabled in drift.yml (enable `triggerOn.minor` to include these)":e.bump==="patch"&&!t.triggerOn.patch?"patch bumps are disabled in drift.yml (enable `triggerOn.patch` to include these)":e.bump==="prerelease"&&!t.triggerOn.patch?"prerelease moves are disabled in drift.yml (enable `triggerOn.patch`)":null}var Vg=gt(Mc(),1);var Sd=require("node:crypto"),Vi=require("node:fs/promises"),xP=require("node:path");var CK=require("node:fs"),ra=require("node:os");var xK=require("node:async_hooks");var wwe=[/\bAuthorization\s*:\s*[^\n]+/gi,/\bBearer\s+\S+/gi,/\bgh[oprsu]_[A-Za-z0-9]{10,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{10,}\b/g,/\bsk-[A-Za-z0-9][A-Za-z0-9_-]{9,}/g];function kwe(e){let t=e;for(let n of wwe)t=t.replace(n,"[REDACTED]");return t}function _we(e){return kwe(e instanceof Error?e.message:String(e))}var EK=new xK.AsyncLocalStorage;function Qo(){return EK.getStore()}function Vt(){return Qo()?.state.now()??0}function Ug(){let e=Qo();return e!==void 0&&!e.state.finished}function TK(e){Qo()?.state.httpRequests.push(e)}function IK(e){Qo()?.state.httpAttempts.push(e)}function bP(e){Qo()?.state.execCommands.push(e)}function $we(){return{hits:0,misses:0,writes:0,memoryHits:0,diskHits:0,coalescedHits:0,revalidated304:0}}function Ar(e,t,n=!1){let i=Qo()?.state;if(!i)return;let r=i.caches.get(e)??$we();if(typeof t=="boolean"){t?r.hits+=1:r.misses+=1,n&&(r.writes+=1),i.caches.set(e,r);return}t==="memory_hit"?(r.memoryHits+=1,r.hits+=1):t==="disk_hit"?(r.diskHits+=1,r.hits+=1):t==="coalesced_hit"?(r.coalescedHits+=1,r.hits+=1):t==="revalidated_304"?r.revalidated304+=1:t==="miss"?r.misses+=1:t==="write"&&(r.writes+=1),i.caches.set(e,r)}function AK(e,t=1){let n=Qo()?.state;n&&n.counters.set(e,(n.counters.get(e)??0)+t)}var Swe=Object.freeze({end(){},fail(){}});function RK(e,t,n,i){let r=t!==null?e.spans.find(s=>s.id===t):void 0,o={id:e.nextSpanId++,parentId:t,depth:r?r.depth+1:0,name:n,startMs:e.now(),endMs:null,meta:{...i},status:"ok"};return e.spans.push(o),o}function Bk(e,t,n,i,r){e.endMs===null&&(e.endMs=t.now(),n==="error"?(e.status="error",e.error=_we(i),Object.assign(e.meta,r)):Object.assign(e.meta,i))}function Fc(e,t){let n=Qo();if(!n||n.state.finished)return Swe;let{state:i}=n,r=RK(i,n.parentId,e,t),o=!1;return{end(s){o||(o=!0,Bk(r,i,"ok",s))},fail(s,a){o||(o=!0,Bk(r,i,"error",s,a))}}}async function Vr(e,t,n){let i=Qo();if(!i||i.state.finished)return n();let{state:r}=i,o=RK(r,i.parentId,e,t);try{let s=await EK.run({state:r,parentId:o.id},n);return Bk(o,r,"ok"),s}catch(s){throw Bk(o,r,"error",s),s}}var xwe=Object.freeze({end(){}}),$d=process.env.DRIFT_PROFILE,bo=!!$d&&$d!=="0"&&$d!=="false",NK=[],wP=new Map,Ewe=bo?Date.now():0,Twe=bo?performance.now():0;function kP(){return performance.now()-Twe}function jg(){return bo}function Iwe(e,t,n){return{operation:t,...new Set(["surface","surface-sources","surface-deps","evidence"]).has(e)?{package:t}:{},...n}}var vP=100,Awe=50;function Rwe(){if(!Ug())return()=>{};let e=performance.now()+vP,t=setInterval(()=>{let n=performance.now(),i=Math.max(0,n-e);if(e=n+vP,iclearInterval(t)}function It(e,t,n){let i=Ug();if(!bo&&!i)return xwe;let r=bo?kP():0,o=i?Fc(`work.${e}`,Iwe(e,t,n)):null,s=i&&e==="scan"&&t==="total"?Rwe():null,a=!1;return{end(c){a||(a=!0,bo&&NK.push({cat:e,name:t,start:r,end:kP(),...n||c?{meta:{...n,...c}}:{}}),o?.end(c),s?.())}}}async function Sn(e,t,n,i){let r=It(e,t,i);try{return await n()}finally{r.end()}}function nt(e,t=1){bo&&wP.set(e,(wP.get(e)??0)+t),Ug()&&AK(`profile.${e}`,t)}var _P=0;bo&&setInterval(()=>{_P=Math.max(_P,Math.round(process.memoryUsage.rss()/1048576))},250).unref();function Cwe(){let e=["DRIFT_CONCURRENCY","DRIFT_NETWORK_CONCURRENCY","DRIFT_LOCAL_CONCURRENCY"];return{startedAt:new Date(Ewe).toISOString(),durationMs:Math.round(kP()),spans:NK,counters:Object.fromEntries([...wP].sort(([t],[n])=>t.localeCompare(n))),machine:{platform:(0,ra.platform)(),arch:(0,ra.arch)(),cpus:(0,ra.cpus)().length,totalMemMb:Math.round((0,ra.totalmem)()/(1024*1024)),node:process.version},peakRssMb:Math.max(_P,Math.round(process.memoryUsage.rss()/(1024*1024))),env:Object.fromEntries(e.filter(t=>process.env[t]).map(t=>[t,process.env[t]]))}}function Nwe(e){if(!bo)return;let t=e??($d&&$d!=="1"?$d:"drift-profile.json");try{(0,CK.writeFileSync)(t,JSON.stringify(Cwe()),"utf8"),process.stderr.write(` drift: profile written to ${t} `)}catch(n){process.stderr.write(`drift: could not write profile: ${n.message} -`)}}bo&&process.on("exit",()=>xwe());var Ewe=1e4,Twe=1440*60*1e3,Iwe=6e4,Awe=360*60*1e3,Rwe="drift-bot/0.1 (+https://github.com/trydrift/drift)",hP=new Map,ia=new Map;function bP(e,t){let n=ia.get(e);if(n)return Rr("http","coalesced_hit"),n;let i=t().finally(()=>ia.delete(e));return ia.set(e,i),i}var Xo=null;function TH(e){let t=hP.get(e);return t?Date.now()>=t.expiresAt?(hP.delete(e),{hit:!1}):{hit:!0,value:t.value}:{hit:!1}}function vo(e,t){let n=t===null?Date.now()+Iwe:1/0;hP.set(e,{value:t,expiresAt:n})}function vP(e){if(!e)return"default";let t=Object.entries(e).filter(([i])=>/auth|token/i.test(i)||i.toLowerCase()==="accept").sort(([i],[r])=>i.localeCompare(r));if(t.length===0)return"default";let n=t.map(([i,r])=>`${i.toLowerCase()}=${r}`).join("&");return(0,_d.createHash)("sha256").update(n).digest("hex").slice(0,16)}function Fk(e,t){return(0,_d.createHash)("sha256").update(`${vP(t)}:${e}`).digest("hex").slice(0,10)}function IH(e,t){return(0,_d.createHash)("sha256").update(`${e}|${t.maxBytes??""}|${t.timeoutMs??""}|${t.retries??""}`).digest("hex").slice(0,10)}function oa(e){let t=e.indexOf("://");if(t<0)return"unknown";let n=e.slice(t+3),i=n.search(/[/?#]/);return(i<0?n:n.slice(0,i)).toLowerCase()}function sa(e){let t=e.indexOf("://");if(t<0)return e.split("?")[0];let n=e.slice(t+3),i=n.indexOf("/");return(i<0?"":n.slice(i)).split("?")[0]}function wP(e){return Math.max(0,Vt()-e)}function qr(e){let t={requestKey:e.requestKey,path:e.path,timeoutMs:Math.max(0,Math.round(e.timeoutMs))};return e.abortFiredAtMs!==null?(t.abortTimerFired=!0,t.abortDelayMs=Math.max(0,Math.round(e.abortFiredAtMs-e.attemptStartOffsetMs-e.timeoutMs))):t.abortTimerFired=!1,e.headersAtMs!==void 0&&e.headersAtMs!==null&&(t.headersMs=Math.max(0,Math.round(e.headersAtMs-e.attemptStartOffsetMs))),e.headersAtMs!==void 0&&e.headersAtMs!==null&&e.bodyDoneAtMs!==void 0&&e.bodyDoneAtMs!==null&&(t.bodyMs=Math.max(0,Math.round(e.bodyDoneAtMs-e.headersAtMs))),t}function Yt(e){kH({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status,cache:e.cache,bytes:e.bytes,retries:e.retries,backoffMs:e.backoffMs,failure:e.failure})}function Wr(e){$H({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status})}function AH(e){Xo=e}function Lc(){return Xo}function $e(e,t={}){let n=`json:${vP(t.headers)}:${e}`,i=TH(n);if(i.hit)return nt("http.cache.memory"),Rr("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);Pg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s={Accept:"application/json",...t.headers},a=Fk(e,s),c=o?It("http-coalesced-json",oa(e),{requestKey:a,path:sa(e)}):null,l=bP(n,()=>Nwe(e,n,t));return o?l.then(u=>(c?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"}),u)):l}async function Nwe(e,t,n){let i={Accept:"application/json",...n.headers},r=await rt(e,{...n,headers:i});if(r===null)return vo(t,null),null;let o=It("json-parse",oa(e),{requestKey:Fk(e,i),path:sa(e),bytes:r.length});try{let s=JSON.parse(r);return vo(t,s),s}catch{return vo(t,null),null}finally{o.end()}}function rt(e,t={}){let n=`text:${vP(t.headers)}:${e}`,i=TH(n);if(i.hit)return nt("http.cache.memory"),Rr("http","memory_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);Pg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s=Fk(e,t.headers),a=o?It("http-coalesced-text",oa(e),{requestKey:s,path:sa(e)}):null;return bP(n,()=>Cwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"})),c))}async function Cwe(e,t,n){let{timeoutMs:i=Ewe,headers:r={},retries:o=2}=n,s=oa(e),a=Fk(e,r),c=sa(e),l=It("disk-cache",s,{requestKey:a,path:c}),u=await Mwe(t);l.end({hit:u!==null});let d=n.cacheTtlMs??Twe,p=Date.now();if(u&&u.body!==null&&(u.immutable||n.immutable||p-u.fetchedAt{w=Vt(),y.abort()},i),_=It("http",s,{requestKey:a,path:c,timeoutMs:i,...h>0?{attempt:h}:{}});try{let S=await fetch(e,{signal:y.signal,headers:{"User-Agent":Rwe,...f,...r},redirect:"follow"}),x=Vt();if(S.status===304&&u)return _.end({status:304,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:304}),Yt({url:e,method:"GET",startOffsetMs:m,status:304,cache:"revalidated_304",retries:h,backoffMs:g}),nt("http.notModified"),Rr("http","revalidated_304"),Rr("http","write"),await gP(t,{...u,fetchedAt:p,immutable:u.immutable||n.immutable}),vo(t,u.body),u.body;if(S.ok){let A=await S.text(),L=Vt();return _.end({status:S.status,bytes:A.length,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x,bodyDoneAtMs:L})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",bytes:A.length,retries:h,backoffMs:g}),vo(t,A),Rr("http","write"),await gP(t,{key:t,body:A,etag:S.headers.get("etag")??void 0,fetchedAt:p,immutable:n.immutable}),A}if(S.status===404)return _.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g}),vo(t,null),Rr("http","write"),await gP(t,{key:t,body:null,absent:!0,fetchedAt:p,immutable:n.immutable}),null;if(S.status===403){if(!(S.headers.get("x-ratelimit-remaining")==="0"||S.headers.has("retry-after"))||h===o){_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,"rate-limited");let L=Dg(h,S.headers.get("retry-after"));g+=L,await Og(L);continue}if(!(S.status===429||S.status>=500)||h===o){_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Yt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}_.end({status:S.status,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),Wr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,S.status===429?"rate-limited":"server-error");let T=Dg(h,S.headers.get("retry-after"));g+=T,await Og(T)}catch(S){if(_.end({status:0,...qr({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w})}),Wr({url:e,method:"GET",startOffsetMs:b,status:null}),h===o){Yt({url:e,method:"GET",startOffsetMs:m,status:null,cache:"miss",retries:h,backoffMs:g,failure:S instanceof Error?S.name:"network-error"}),nt("http.error");break}nt("http.error"),n.onRetry?.(h+1,"network-error");let x=Dg(h,null);g+=x,await Og(x)}finally{clearTimeout(k)}}return vo(t,null),u?.body!==void 0?(vo(t,u.body),u.body):null}function Bt(e,t={}){let n=`archive:${e}`,i=`${n}|maxBytes=${t.maxBytes??""}|timeoutMs=${t.timeoutMs??""}|retries=${t.retries??""}`,r=Vt(),o=ia.has(i),s=IH(e,t),a=o?It("http-coalesced-archive",oa(e),{requestKey:s,path:sa(e)}):null;return bP(i,()=>Pwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(wP(r))}),Yt({url:e,method:"GET",startOffsetMs:r,status:c.ok?200:c.status,cache:"coalesced_hit"})),c))}async function Pwe(e,t,n){let i=oa(e),r=sa(e),o=IH(e,n),s=Owe(t),{retries:a=2,maxBytes:c}=n;if(s)try{let m=await(0,Vi.readFile)(s);if(c===void 0||m.length<=c)return nt("http.cache.archive"),Rr("http","disk_hit"),Yt({url:e,method:"GET",startOffsetMs:Vt(),status:200,cache:"disk_hit"}),{ok:!0,bytes:m}}catch{}Rr("http","miss");let l=n.timeoutMs??6e4,u=Date.now()+l,d=()=>u-Date.now();nt("http.archive");let p=Vt(),f=0;for(let m=0;m<=a;m++){let g=d();if(g<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:"timeout"}),{ok:!1,status:0,error:"Timed out before this attempt could start."};let h=Vt(),b=It("archive",i,{requestKey:o,path:r,timeoutMs:Math.max(0,Math.round(g)),...m>0?{attempt:m}:{}}),y=new AbortController,w=null,k=setTimeout(()=>{w=Vt(),y.abort()},g);try{let _=await fetch(e,{signal:y.signal}),S=Vt();if(!_.ok){b.end({status:_.status,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status});let A=_.status===429||_.status>=500,L=Math.min(Dg(m,_.headers.get("retry-after")),d());if(!A||m===a||L<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f}),{ok:!1,status:_.status};f+=L,await Og(L);continue}let x=Number(_.headers.get("content-length"));if(c!==void 0&&Number.isFinite(x)&&x>c)return b.end({status:_.status,bytes:x,oversized:!0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:_.status,error:`Response of ${x} bytes exceeds the ${c}-byte limit for this archive.`};let E=await Dwe(_,c,y),T=Vt();if(E==="oversized")return b.end({status:_.status,oversized:!0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:_.status,error:`Response exceeds the ${c}-byte limit for this archive.`};if(b.end({status:_.status,bytes:E.length,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),Wr({url:e,method:"GET",startOffsetMs:h,status:_.status}),Yt({url:e,method:"GET",startOffsetMs:p,status:_.status,cache:"miss",bytes:E.length,retries:m,backoffMs:f}),s)try{await(0,Vi.mkdir)(Xo,{recursive:!0});let A=`${s}.${process.pid}.partial`;await(0,Vi.writeFile)(A,E),await(0,Vi.rename)(A,s),Rr("http","write")}catch{}return{ok:!0,bytes:E}}catch(_){if(b.end({status:0,...qr({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w})}),Wr({url:e,method:"GET",startOffsetMs:h,status:null}),m===a)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:_ instanceof Error?_.name:"network-error"}),{ok:!1,status:0,error:_.message};let S=Math.min(Dg(m,null),d());if(S<=0)return Yt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:_ instanceof Error?_.name:"network-error"}),{ok:!1,status:0,error:_.message};f+=S,await Og(S)}finally{clearTimeout(k)}}return{ok:!1,status:0}}async function Dwe(e,t,n){if(t===void 0||!e.body)return Buffer.from(await e.arrayBuffer());let i=e.body.getReader(),r=[],o=0;for(;;){let{done:s,value:a}=await i.read();if(s)break;if(o+=a.byteLength,o>t)return n.abort(),"oversized";r.push(a)}return Buffer.concat(r)}function Owe(e){return Xo?(0,yP.join)(Xo,`${(0,_d.createHash)("sha256").update(e).digest("hex")}.bin`):null}async function Mwe(e){if(!Xo)return null;try{let t=await(0,Vi.readFile)(RH(e),"utf8"),n=JSON.parse(t);return n.key===e?n:null}catch{return null}}async function gP(e,t){if(Xo)try{await(0,Vi.mkdir)(Xo,{recursive:!0}),await(0,Vi.writeFile)(RH(e),JSON.stringify(t),"utf8")}catch{}}function RH(e){let t=(0,_d.createHash)("sha256").update(e).digest("hex");return(0,yP.join)(Xo,`${t}.json`)}function Dg(e,t){if(t){let i=Number(t);if(Number.isFinite(i)&&i>0)return Math.min(i*1e3,3e4)}return 400*2**e+Math.random()*200}function Og(e){return new Promise(t=>setTimeout(t,e))}async function qn(e,t,n){let i=new Array(e.length),r=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let s=r++;if(s>=e.length)return;i[s]=await n(e[s],s)}});return await Promise.all(o),i}var PH=require("node:crypto"),DH=require("node:zlib"),Sd=require("node:fs/promises"),$P=require("node:path");var OH="https://downloads.arduino.cc/libraries/library_index.json.gz",Lwe=1440*60*1e3,Fwe=12e4,NH=null;async function Uwe(){return NH??=jwe(),NH}async function Uk(e){return(await Uwe())?.get(e.toLowerCase())??null}async function jwe(){let e=await CH();if(e)return kP(e);let t=await zwe();if(!t){let i=await CH({ignoreAge:!0});return i?kP(i):null}let n=Gwe(t);return await Bwe(n),kP(n)}async function zwe(){try{let e=await fetch(OH,{signal:AbortSignal.timeout(Fwe),headers:{"User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"}});if(!e.ok)return null;let t=Buffer.from(await e.arrayBuffer()),n=t[0]===31&&t[1]===139?(0,DH.gunzipSync)(t):t;return JSON.parse(n.toString("utf8"))}catch{return null}}function Gwe(e){let t=new Map;for(let n of e.libraries??[]){if(!n.name||!n.version)continue;let i=n.name.toLowerCase(),r=t.get(i);r||(r={name:n.name,versions:[],githubRepo:null,website:null,description:null,archives:{}},t.set(i,r)),r.versions.includes(n.version)||r.versions.push(n.version),n.url&&(r.archives[n.version]=n.url),r.githubRepo=Vwe(n.repository)??r.githubRepo,r.website=n.website??r.website,r.description=n.sentence??r.description}return[...t.values()]}function Vwe(e){if(!e)return null;let t=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:null}function kP(e){return new Map(e.map(t=>[t.name.toLowerCase(),t]))}function MH(){let e=Lc();if(!e)return null;let t=(0,PH.createHash)("sha256").update(OH).digest("hex");return(0,$P.join)(e,`arduino-index-${t.slice(0,16)}.json`)}async function CH(e={}){let t=MH();if(!t)return null;try{let n=JSON.parse(await(0,Sd.readFile)(t,"utf8"));return!Array.isArray(n.libraries)||!e.ignoreAge&&Date.now()-n.fetchedAt>=Lwe?null:n.libraries}catch{return null}}async function Bwe(e){let t=MH();if(t)try{await(0,Sd.mkdir)((0,$P.join)(t,".."),{recursive:!0});let n={fetchedAt:Date.now(),libraries:[...e]};await(0,Sd.writeFile)(t,JSON.stringify(n),"utf8")}catch{}}var jH=require("node:crypto");var qwe=new Set(["sponsors","apps","marketplace","settings","about","pricing","features"]),LH=/^[A-Za-z0-9._-]+$/;function FH(e,t){let n=t.replace(/\.git$/i,"");return!e||!n||!LH.test(e)||!LH.test(n)||e==="."||e===".."||n==="."||n===".."||qwe.has(e.toLowerCase())?null:`${e}/${n}`}function UH(e){let t=e.toLowerCase();return t==="github.com"||t==="www.github.com"}function aa(e){if(!e)return null;let t=e.trim();if(!t)return null;t=t.replace(/^git\+/i,"");let n=/^(?:ssh:\/\/)?(?:[^@/\s]+@)?github\.com:(?[^/\s:]+)\/(?[^\s?#]+?)\/?$/i.exec(t);if(n?.groups)return UH("github.com")?FH(n.groups.owner,n.groups.repo):null;let i;try{i=new URL(t)}catch{return null}if(!["http:","https:","ssh:","git:"].includes(i.protocol)||!UH(i.hostname))return null;let r=i.pathname.split("/").filter(Boolean);return r.length<2?null:FH(r[0],r[1])}var _P=new Map;function Wwe(e,t){let n=(0,jH.createHash)("md5").update(e).digest("hex"),i=`${n[0]}/${n[1]}/${n[2]}`,r=encodeURIComponent(e);return`https://cdn.cocoapods.org/Specs/${i}/${r}/${encodeURIComponent(t)}/${r}.podspec.json`}function jk(e,t,n={}){let i=`${e}@${t}`,r=_P.get(i);if(r)return r;let o=Hwe(e,t,n).catch(()=>null);return _P.set(i,o),o.then(s=>{s||_P.delete(i)}),o}async function Hwe(e,t,n){let i=await $e(Wwe(e,t),{immutable:!0,...n.timeoutMs?{timeoutMs:n.timeoutMs}:{}});if(!i)return null;let r=i.source&&typeof i.source=="object"?Kwe(i.source):null;return{name:i.name??e,version:i.version??t,moduleName:typeof i.module_name=="string"&&i.module_name?i.module_name:null,source:r,homepage:SP(i.homepage),summary:SP(i.summary),description:SP(i.description)}}function Kwe(e){let t=n=>{let i=e[n];return typeof i=="string"&&i?i:void 0};return{git:t("git"),tag:t("tag"),http:t("http"),svn:t("svn")}}function SP(e){return typeof e=="string"&&e.trim()?e.trim():null}function zH(e){return aa(e.source?.git)??aa(e.homepage)}var Jwe=e=>`https://api.github.com/repos/ocaml/opam-repository/contents/packages/${encodeURIComponent(e)}`,Zwe="https://api.github.com/repos/ocaml/opam-repository/branches/master",GH=(e,t,n)=>`https://raw.githubusercontent.com/ocaml/opam-repository/${n}/packages/${encodeURIComponent(e)}/${encodeURIComponent(`${e}.${t}`)}/opam`;async function Ywe(e){let n=(await $e(Zwe,{...e?{headers:e}:{}}).catch(()=>null))?.commit?.sha;return typeof n=="string"&&/^[0-9a-f]{40}$/.test(n)?n:null}function BH(e){return/^[\w.+-]+$/.test(e)}async function zk(e,t={}){if(!BH(e))return null;let n=await $e(Jwe(e),{...t.headers?{headers:t.headers}:{}}).catch(()=>null);if(!Array.isArray(n))return null;let i=`${e}.`;return n.filter(r=>r.type==="dir"&&r.name?.startsWith(i)).map(r=>r.name.slice(i.length))}async function qH(e,t){if(!BH(e))return null;let n=await Ywe(),i=n?await rt(GH(e,t,n),{immutable:!0}).catch(()=>null):await rt(GH(e,t,"master")).catch(()=>null);return i?Qwe(i,e,t):null}function Qwe(e,t,n){let i=a=>{let c=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e);return c?VH(c[1]):null},r=a=>{let l=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e)?.[1]?.trim();return l||null},o=(()=>{let a=/(?:^|\n)\s*description\s*:\s*"""([\s\S]*?)"""/.exec(e);return a?a[1].trim()||null:r("description")})(),s=(()=>{let a=/(?:^|\n)\s*url\s*\{([\s\S]*?)\n[ \t]*\}/.exec(e),c=a?a[1]:e,l=/(?:^|\n)\s*src\s*:\s*"([^"\n]+)"/.exec(c)??/(?:^|\n)\s*archive\s*:\s*"([^"\n]+)"/.exec(c);return l?VH(l[1]):null})();return{name:t,version:n,devRepo:i("dev-repo"),homepage:i("homepage"),bugReports:i("bug-reports"),doc:i("doc"),synopsis:r("synopsis"),description:o,sourceUrl:s}}function VH(e){let t=e.trim();return!t||/%\{[^}]*\}%?/.test(t)?null:t}function WH(e){return aa(e.devRepo)??aa(e.sourceUrl)??aa(e.homepage)??aa(e.bugReports)}function Gk(e){let t={};return e.map(n=>{let i={...t,...n};return t=i,i})}function Vk(e,t){return e.find(n=>n.version===t)}async function Wn(e,t,n){switch(t){case"npm":return bke(e,n);case"pypi":return vke(e,n);case"cargo":return wke(e);case"go":return kke(e);case"maven":return Ske(e);case"rubygems":return xke(e);case"nuget":return eke(e);case"packagist":return tke(e,n);case"hex":return nke(e);case"pub":return rke(e);case"swift":return ike(e);case"cocoapods":return oke(e,n);case"conan":return ske(e);case"vcpkg":return lke(e);case"arduino":return uke(e);case"opam":return Xwe(e,n);default:return null}}async function Xwe(e,t){let[n,i]=await Promise.all([zk(e),t?qH(e,t):Promise.resolve(null)]);return!n&&!i?null:{name:e,ecosystem:"opam",githubRepo:i?WH(i):null,homepage:i?.homepage??i?.devRepo??null,versions:n??[],deprecated:null,description:i?.description??i?.synopsis??null}}async function eke(e){let t=e.toLowerCase(),[n,i]=await Promise.all([$e(`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(t)}/index.json`),$e(`https://api.nuget.org/v3/registration5-gz-semver2/${encodeURIComponent(t)}/index.json`)]);if(!n&&!i)return null;let r=(i?.items??[]).flatMap(s=>s.items??[]),o=r[r.length-1]?.catalogEntry;return{name:e,ecosystem:"nuget",githubRepo:Lt(o?.repository?.url??null)??Lt(o?.projectUrl??null),homepage:o?.projectUrl??`https://www.nuget.org/packages/${e}`,versions:n?.versions??[],deprecated:o?.deprecation?.message??null,description:o?.description??null}}async function tke(e,t){let i=(await $e(`https://repo.packagist.org/p2/${e}.json`))?.packages?.[e];if(!i||i.length===0)return null;let r=Gk(i),o=t?Vk(r,t):r[0];if(!o)return null;let s=o.abandoned,a=s===void 0||s===!1?null:typeof s=="string"?`This package is abandoned; the author suggests using ${s} instead.`:"This package is abandoned and is no longer maintained.";return{name:e,ecosystem:"packagist",githubRepo:Lt(o.source?.url??null)??Lt(o.homepage??null),homepage:o.homepage??`https://packagist.org/packages/${e}`,versions:r.map(c=>c.version).filter(c=>!!c),deprecated:a,description:o.description??null}}async function nke(e){let t=await $e(`https://hex.pm/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.meta?.links??{},i=Object.entries(n).map(([s,a])=>({key:s.toLowerCase(),value:a})),r=i.find(s=>s.key==="github")?.value??i.find(s=>s.key==="source")?.value,o=Object.values(t.retirements??{})[0];return{name:e,ecosystem:"hex",githubRepo:Lt(r??null)??i.map(s=>Lt(s.value)).find(Boolean)??null,homepage:t.html_url??`https://hex.pm/packages/${e}`,versions:(t.releases??[]).map(s=>s.version).filter(s=>!!s),deprecated:o?o.message??o.reason??"This release is retired.":null,description:t.meta?.description??null}}async function rke(e){let t=await $e(`https://pub.dev/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.latest?.pubspec,i=n?.repository??n?.homepage??n?.issue_tracker;return{name:e,ecosystem:"pub",githubRepo:Lt(i??null),homepage:n?.homepage??`https://pub.dev/packages/${e}`,versions:(t.versions??[]).map(r=>r.version).filter(r=>!!r),deprecated:t.latest?.retracted?"The latest version of this package has been retracted.":null,description:n?.description??null}}function ike(e){return/^[\w.-]+\/[\w.-]+$/.test(e)?{name:e,ecosystem:"swift",githubRepo:e,homepage:`https://github.com/${e}`,versions:[],deprecated:null,description:null}:null}async function oke(e,t){let[n,i]=await Promise.all([$e(`https://trunk.cocoapods.org/api/v1/pods/${encodeURIComponent(e)}`),t?jk(e,t):Promise.resolve(null)]);return n?{name:e,ecosystem:"cocoapods",githubRepo:i?zH(i):null,homepage:i?.homepage??`https://cocoapods.org/pods/${e}`,versions:(n.versions??[]).map(r=>r.name).filter(r=>!!r),deprecated:null,description:i?.description??i?.summary??null}:null}async function ske(e){let t=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,n=await rt(`${t}/config.yml`);if(!n)return null;let{versions:i,folders:r}=ake(n);if(i.length===0)return null;let o=r[i[i.length-1]]??r[i[0]]??"all",s=await rt(`${t}/${o}/conandata.yml`);return{name:e,ecosystem:"conan",githubRepo:s?cke(s):null,homepage:`https://conan.io/center/recipes/${e}`,versions:i,deprecated:null,description:null}}function ake(e){let t=[],n={},i=!1,r=null;for(let o of e.split(` -`)){let s=o.split("#")[0].replace(/\s+$/,"");if(!s.trim())continue;if(/^versions\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1;continue}if(!i)continue;let a=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim(),r&&!t.includes(r)&&t.push(r);continue}let c=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(s);c&&r&&(n[r]=c[1])}return{versions:t,folders:n}}function cke(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function lke(e){let t=e[0]?.toLowerCase();if(!t||!/[a-z0-9]/.test(t))return null;let[n,i]=await Promise.all([$e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/versions/${t}-/${encodeURIComponent(e)}.json`),$e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`)]);if(!n)return null;let r=[];for(let s of n.versions??[]){let a=s.version??s["version-semver"]??s["version-string"]??s["version-date"];a&&!r.includes(a)&&r.push(a)}if(r.length===0)return null;let o=Array.isArray(i?.description)?i.description.join(" "):i?.description??null;return{name:e,ecosystem:"vcpkg",githubRepo:Lt(i?.homepage??null),homepage:i?.homepage??`https://vcpkg.io/en/package/${e}`,versions:r,deprecated:null,description:o}}async function uke(e){let t=await Uk(e);if(t)return{name:t.name,ecosystem:"arduino",githubRepo:t.githubRepo,homepage:t.website??`https://www.arduino.cc/reference/en/libraries/${pke(e)}/`,versions:t.versions,deprecated:null,description:t.description};let n=await dke(e);return n?{name:n.name??e,ecosystem:"arduino",githubRepo:Lt(n.repository_url??null),homepage:n.homepage??null,versions:n.version?.name?[n.version.name]:[],deprecated:null,description:n.description??null}:null}async function dke(e){let n=((await $e(`https://api.registry.platformio.org/v3/search?query=${encodeURIComponent(e)}`))?.items??[]).find(i=>i.name?.toLowerCase()===e.toLowerCase()&&i.owner?.username);return n?$e(`https://api.registry.platformio.org/v3/packages/${encodeURIComponent(n.owner.username)}/library/${encodeURIComponent(n.name)}`):null}function pke(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}async function ca(e,t,n){switch(t){case"npm":return fke(e,n);case"pypi":return mke(e,n);case"go":return gke(e,n);case"cargo":return yke(e,n);default:return null}}function Bk(e){return{version:e,license:null,releasedAt:null,runtime:null,dependencies:[],withdrawn:null}}async function fke(e,t){let n=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`),i=n?.versions?.[t];if(!i)return null;let r=i.engines?.node;return{...Bk(t),license:typeof i.license=="string"?i.license:i.license?.type??null,releasedAt:n?.time?.[t]??null,runtime:r?{name:"Node.js",requirement:r}:null,dependencies:Object.keys(i.dependencies??{}),withdrawn:i.deprecated??null}}async function mke(e,t){let n=await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{immutable:!0});if(!n?.info)return null;let i=n.info.requires_python;return{...Bk(t),license:n.info.license||null,releasedAt:n.urls?.[0]?.upload_time_iso_8601??null,runtime:i?{name:"Python",requirement:i}:null,dependencies:(n.info.requires_dist??[]).map(r=>/^\s*([A-Za-z0-9._-]+)/.exec(r)?.[1]).filter(r=>!!r),withdrawn:n.info.yanked?`Release yanked: ${n.info.yanked_reason??"no reason given"}`:null}}async function gke(e,t){let n=t.startsWith("v")?t:`v${t}`,i=`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/${encodeURIComponent(n)}`,[r,o]=await Promise.all([rt(`${i}.mod`,{immutable:!0}),$e(`${i}.info`,{immutable:!0})]);if(!r&&!o)return null;let s=r?/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(r)?.[1]:null;return{...Bk(n),releasedAt:o?.Time??null,runtime:s?{name:"Go",requirement:`>=${s}`}:null,withdrawn:r?hke(r,n):null}}function hke(e,t){let n=t.replace(/^v/,"");for(let r of e.matchAll(/^\s*retract\s+(.+)$/gm)){let o=r[1].trim(),s=/\/\/\s*(.+)$/.exec(o)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.",c=/^v?([\w.+-]+)/.exec(o.replace(/\/\/.*$/,"").trim())?.[1];if(c&&c===n)return a;let l=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(l&&HH(n,l[1],l[2]))return a}let i=/^\s*retract\s*\(([\s\S]*?)^\s*\)/m.exec(e)?.[1];if(i)for(let r of i.split(` -`)){let o=r.replace(/\/\/.*$/,"").trim();if(!o)continue;let s=/\/\/\s*(.+)$/.exec(r)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.";if(/^v?([\w.+-]+)$/.exec(o)?.[1]===n)return a;let c=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(c&&HH(n,c[1],c[2]))return a}return null}function HH(e,t,n){return KH(e,t)>=0&&KH(e,n)<=0}function KH(e,t){let n=e.split(/[.+-]/).map(r=>Number.parseInt(r,10)),i=t.split(/[.+-]/).map(r=>Number.parseInt(r,10));for(let r=0;r=${i}`}:null,withdrawn:n.version.yanked?"This release was yanked from crates.io.":null}}async function YH(e,t,n){let i={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};t&&(i.Authorization=`Bearer ${t}`);let r=await $e(`https://api.github.com/repos/${e}`,{headers:i,...n?{onRetry:n}:{}});if(!r)return null;let o=r.license?.spdx_id;return{archived:r.archived===!0,pushedAt:r.pushed_at??null,license:o&&o!=="NOASSERTION"?o:null,url:r.html_url??`https://github.com/${e}`}}async function bke(e,t){let n=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`);if(!n)return null;let i=Object.keys(n.versions??{}),r=t?n.versions?.[t]:void 0;return{name:e,ecosystem:"npm",githubRepo:Lt(JH(n.repository))??Lt(JH(r?.repository))??Lt(n.homepage),homepage:n.homepage??null,versions:i,deprecated:r?.deprecated??null,description:n.description??null}}async function vke(e,t){let n=await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/json`);if(!n)return null;let o=[...Object.values(n.info?.project_urls??{}),n.info?.home_page??""].map(Lt).find(c=>c!==null)??null,a=(t?n.releases?.[t]??[]:[]).find(c=>c.yanked);return{name:e,ecosystem:"pypi",githubRepo:o,homepage:n.info?.home_page??null,versions:Object.keys(n.releases??{}),deprecated:a?`Release yanked: ${a.yanked_reason??"no reason given"}`:null,description:n.info?.summary??null}}async function wke(e){let t=await $e(`https://crates.io/api/v1/crates/${encodeURIComponent(e)}`);return t?{name:e,ecosystem:"cargo",githubRepo:Lt(t.crate?.repository)??Lt(t.crate?.homepage),homepage:t.crate?.homepage??null,versions:(t.versions??[]).map(n=>n.num),deprecated:null,description:t.crate?.description??null}:null}async function kke(e){let t=await rt(`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/list`);return{name:e,ecosystem:"go",githubRepo:_ke(e),homepage:`https://pkg.go.dev/${e}`,versions:t?t.split(` -`).map(n=>n.trim()).filter(Boolean):[],deprecated:null,description:null}}var $ke={grpc:"grpc/grpc-go",protobuf:"protocolbuffers/protobuf-go",api:"googleapis/google-api-go-client",genproto:"googleapis/go-genproto",appengine:"golang/appengine"};function _ke(e){let t=e.replace(/\/v[2-9]\d*$/,""),n=[[/^golang\.org\/x\/([\w.-]+)/,i=>`golang/${i[1]}`],[/^google\.golang\.org\/(\w+)/,i=>$ke[i[1]]??`googleapis/go-${i[1]}`],[/^go\.uber\.org\/([\w.-]+)/,i=>`uber-go/${i[1]}`],[/^sigs\.k8s\.io\/([\w.-]+)/,i=>`kubernetes-sigs/${i[1]}`],[/^k8s\.io\/([\w.-]+)/,i=>`kubernetes/${i[1]}`],[/^gopkg\.in\/([\w.-]+)\/([\w.-]+?)\.v\d+$/,i=>`${i[1]}/${i[2]}`],[/^gopkg\.in\/([\w.-]+?)\.v\d+$/,i=>`go-${i[1]}/${i[1]}`]];for(let[i,r]of n){let o=i.exec(t);if(o)return r(o)}return Lt(`https://${t}`)}async function Ske(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await $e(`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(n)}%22&core=gav&rows=100&wt=json`);return{name:e,ecosystem:"maven",githubRepo:null,homepage:`https://central.sonatype.com/artifact/${t}/${n}`,versions:(i?.response?.docs??[]).map(r=>r.v),deprecated:null,description:null}}async function xke(e){let t=await $e(`https://rubygems.org/api/v1/gems/${encodeURIComponent(e)}.json`);if(!t)return null;let n=await $e(`https://rubygems.org/api/v1/versions/${encodeURIComponent(e)}.json`);return{name:e,ecosystem:"rubygems",githubRepo:Lt(t.source_code_uri)??Lt(t.homepage_uri)??Lt(t.changelog_uri),homepage:t.homepage_uri??null,versions:(n??[]).map(i=>i.number),deprecated:null,description:t.info??null,changelogUrl:t.changelog_uri??null,documentationUrl:t.documentation_uri??null}}function JH(e){if(e)return typeof e=="string"?e:e.url}function Lt(e){if(!e)return null;let t=/^github:([\w.-]+)\/([\w.-]+)$/.exec(e.trim());if(t)return`${t[1]}/${ZH(t[2])}`;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)/.exec(e);if(!n)return null;let i=n[1],r=ZH(n[2]);return!i||!r||i==="sponsors"?null:`${i}/${r}`}function ZH(e){return e.replace(/\.git$/,"")}async function XH(e,t={}){let n=t.lookup??((i,r)=>Wn(i,r,null));return Promise.all(e.map(async i=>{let r=i.rawFrom!=null&&i.from===null,o=i.rawTo!=null&&i.to===null;if(!r&&!o||i.source==="lockfile"||!Eke.has(i.ecosystem))return i;let a=(await n(i.name,i.ecosystem).catch(p=>(t.logger?.debug?.(`range resolution: registry lookup for ${i.name} failed: ${String(p)}`),null)))?.versions??[];if(a.length===0)return i;let c=r?QH(a,i.rawFrom):i.from,l=o?QH(a,i.rawTo):i.to;if(r&&!c||o&&!l)return i;let u=c??i.from,d=l??i.to;return t.logger?.debug?.(`range resolution: ${i.name} ${i.rawFrom} \u2192 ${i.rawTo} resolves to ${u} \u2192 ${d}`),{...i,from:u,to:d,bump:u&&d?ta(u,d,i.ecosystem):i.bump}}))}var Eke=new Set(["npm"]);function QH(e,t){let n=t.trim().replace(/^v(?=\d)/,"");return Mg.default.valid(n)?e.includes(n)?n:Mg.default.valid(n):Mg.default.validRange(n)?Mg.default.maxSatisfying([...e],n,{includePrerelease:!1}):null}var xd=require("node:fs"),tK=gt(gc(),1);function Hn(){return{async readFile(e){try{return(0,xd.readFileSync)(e,"utf8")}catch{return null}},async readDirectory(e){try{return(0,xd.readdirSync)(e)}catch{return[]}},async isDirectory(e){try{return(0,xd.statSync)(e).isDirectory()}catch{return!1}}}}async function Ed(e,t){let i=(await Promise.all([Tke(e,t),Ike(e,t),Ake(e,t),Rke(e,t),Nke(e,t),Cke(e,t)])).filter(o=>o!==null);return i.find(o=>o.kind==="pnpm-workspace")?i.filter(o=>o.kind!=="npm-workspaces"):i}function Td(e){let t=new Set;for(let n of e)for(let i of n.members)t.add(i.dir);return t.size===0?[""]:[...t].sort()}function Fc(e,t){let n=null;for(let i of t){if(i===""){n===null&&(n="");continue}(e===i||e.startsWith(`${i}/`))&&(n===null||i.length>n.length)&&(n=i)}return n}function xP(e,t){return t===""||e===t||e.startsWith(`${t}/`)}function nK(e,t){if(t.length===0)return[...e];let n=Td(t),i=new Map;for(let r of t)for(let o of r.members)o.name&&i.set(o.dir,o.name);return e.map(r=>{let o=Fc(r.manifestPath,n);if(o===null)return r;let s=i.get(o);return{...r,workspace:o,...s?{workspaceName:s}:{}}})}function qk(e){return e.workspace===void 0?null:e.workspaceName??(e.workspace===""?"the repository root":e.workspace)}async function Tke(e,t){let n=await t.readFile(Hr(e,"package.json"));if(!n)return null;let i=Gt(n),r=Array.isArray(i?.workspaces)?i.workspaces:i?.workspaces?.packages;return!r||r.length===0?null:{kind:"npm-workspaces",ecosystem:"npm",declaredIn:"package.json",members:await Id(e,t,r,"npm","package.json",i?.name??null)}}async function Ike(e,t){let n=await t.readFile(Hr(e,"pnpm-workspace.yaml"));if(!n)return null;let i=[];try{let o=(0,tK.parse)(n);Array.isArray(o?.packages)&&(i=o.packages.filter(s=>typeof s=="string"))}catch{return null}if(i.length===0)return null;let r=Gt(await t.readFile(Hr(e,"package.json"))??"")?.name??null;return{kind:"pnpm-workspace",ecosystem:"npm",declaredIn:"pnpm-workspace.yaml",members:await Id(e,t,i,"npm","package.json",r)}}async function Ake(e,t){let n=await t.readFile(Hr(e,"Cargo.toml"));if(!n)return null;let i=pi(n),r=i.find(c=>c.header==="workspace");if(!r)return null;let o=Ag(r.entries.get("members")??""),s=i.some(c=>c.header==="package"),a=s?rK(i.find(c=>c.header==="package")?.entries.get("name")??""):null;return{kind:"cargo-workspace",ecosystem:"cargo",declaredIn:"Cargo.toml",members:await Id(e,t,o,"cargo","Cargo.toml",a,!s)}}async function Rke(e,t){let n=await t.readFile(Hr(e,"go.work"));if(!n)return null;let i=[],r=!1;for(let o of n.split(` -`)){let s=o.split("//")[0].trim();if(!s)continue;if(/^use\s*\($/.test(s)){r=!0;continue}if(r&&s===")"){r=!1;continue}let a=/^use\s+(\S+)$/.exec(s);a?i.push(a[1]):r&&i.push(s)}return{kind:"go-work",ecosystem:"go",declaredIn:"go.work",members:await Id(e,t,i,"go","go.mod",null,!0)}}async function Nke(e,t){let n=await t.readFile(Hr(e,"pom.xml"));if(!n)return null;let i=/([\s\S]*?)<\/modules>/.exec(n);if(!i)return null;let r=[...i[1].matchAll(/\s*([^<]+?)\s*<\/module>/g)].map(s=>s[1]);if(r.length===0)return null;let o=/\s*([^<]+?)\s*<\/artifactId>/.exec(n)?.[1]??null;return{kind:"maven-modules",ecosystem:"maven",declaredIn:"pom.xml",members:await Id(e,t,r,"maven","pom.xml",o)}}async function Cke(e,t){let n=await t.readFile(Hr(e,"settings.gradle.kts"))?"settings.gradle.kts":await t.readFile(Hr(e,"settings.gradle"))?"settings.gradle":null;if(!n)return null;let r=[...(await t.readFile(Hr(e,n))??"").matchAll(/include\s*\(?\s*((?:['"][^'"]+['"]\s*,?\s*)+)/g)].flatMap(o=>[...o[1].matchAll(/['"]([^'"]+)['"]/g)].map(s=>s[1])).map(o=>o.replace(/^:/,"").replace(/:/g,"/"));return r.length===0?null:{kind:"gradle-settings",ecosystem:"maven",declaredIn:n,members:await Id(e,t,r,"maven","build.gradle",null,!0)}}async function Id(e,t,n,i,r,o,s=!1){let a=new Set,c=new Set;for(let u of n){let d=u.trim();if(d.startsWith("!"))for(let p of await eK(e,t,d.slice(1),r))c.add(p);else for(let p of await eK(e,t,d,r))a.add(p)}for(let u of c)a.delete(u);let l=[];s||l.push({dir:"",name:o,ecosystem:i});for(let u of[...a].sort())u!==""&&l.push({dir:u,name:await Lg(e,t,u,r,i),ecosystem:i});return l}async function eK(e,t,n,i){let r=n.replace(/^\.\//,"").replace(/\/+$/,"");if(r.startsWith("!"))return[];if(!r.includes("*"))return[r];let o=r.split("/"),s=o.findIndex(p=>p.includes("*")),a=o.slice(0,s).join("/"),c=o[s]==="**",l=o.slice(s+1).join("/"),u=[],d=async(p,f)=>{if(!(f>4))for(let m of await t.readDirectory(Hr(e,p))){if(m.startsWith(".")||m==="node_modules"||m==="target")continue;let g=p?`${p}/${m}`:m;if(!await t.isDirectory(Hr(e,g)))continue;let h=l?`${g}/${l}`:g;(!i||await t.readFile(Hr(e,h,i))!==null)&&u.push(h),c&&await d(g,f+1)}};return await d(a,0),u}async function Lg(e,t,n,i,r){let o=await t.readFile(Hr(e,n,i));if(!o)return null;switch(r){case"npm":return Gt(o)?.name??null;case"cargo":{let s=pi(o).find(a=>a.header==="package");return rK(s?.entries.get("name")??"")||null}case"go":return/^\s*module\s+(\S+)/m.exec(o)?.[1]??null;case"maven":return/\s*([^<]+?)\s*<\/artifactId>/.exec(o)?.[1]??null;default:return null}}function rK(e){return e.trim().replace(/^["']|["']$/g,"")}function Hr(...e){return e.filter(Boolean).join("/")}var Wk=(e,t,n,i)=>e==="dev"?[t]:e==="optional"?[n]:e==="peer"&&i?[i]:[],Pke=e=>e?[...e.section==="dev-dependencies"?["--dev"]:[],...e.section==="build-dependencies"?["--build"]:[],...e.target?["--target",e.target]:[]]:[],EP=[{id:"npm",batchable:!0,ecosystem:"npm",label:"npm",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json"],outdated:{command:"npm",args:["outdated","--json"]},install:{command:"npm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"npm",args:["install",`${e}@${t}`,...Wk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"pnpm",batchable:!0,ecosystem:"npm",label:"pnpm",manifests:["package.json"],lockfiles:["pnpm-lock.yaml"],outdated:{command:"pnpm",args:["outdated"]},install:{command:"pnpm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"pnpm",args:["add",`${e}@${t}`,...Wk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"yarn-berry",batchable:!0,ecosystem:"npm",label:"Yarn (berry)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:null,install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"yarn",args:["add",`${e}@${t}`,...Wk(n,"--dev","--optional","--peer")]})},{id:"yarn",batchable:!0,ecosystem:"npm",label:"Yarn (classic)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:{command:"yarn",args:["outdated","--json"]},install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t})=>({command:"yarn",args:["upgrade",`${e}@${t}`]})},{id:"bun",batchable:!0,ecosystem:"npm",label:"Bun",manifests:["package.json"],lockfiles:["bun.lock","bun.lockb"],outdated:{command:"bun",args:["outdated"]},install:{command:"bun",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"bun",args:["add",`${e}@${t}`,...Wk(n,"--dev","--optional","--peer")]})},{id:"uv",batchable:!0,ecosystem:"pypi",label:"uv",manifests:["pyproject.toml"],lockfiles:["uv.lock"],outdated:{command:"uv",args:["pip","list","--outdated","--format","json"]},install:{command:"uv",args:["sync"]},upgrade:({name:e,version:t,kind:n})=>({command:"uv",args:["add",`${e}==${t}`,...n==="dev"?["--dev"]:[]]})},{id:"poetry",batchable:!0,ecosystem:"pypi",label:"Poetry",manifests:["pyproject.toml"],lockfiles:["poetry.lock"],outdated:{command:"poetry",args:["show","--outdated"]},install:{command:"poetry",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"poetry",args:["add",`${e}==${t}`,...n==="dev"?["--group","dev"]:[]]})},{id:"pip",batchable:!0,ecosystem:"pypi",label:"pip",manifests:["requirements.in","requirements.txt","pyproject.toml","setup.py"],manifestPattern:/^(?:requirements|constraints)[\w.-]*\.(?:in|txt)$/i,lockfiles:[],outdated:{command:"pip",args:["list","--outdated","--format=json"]},upgrade:({name:e,version:t})=>({command:"pip",args:["install","--upgrade",`${e}==${t}`]}),rewriteManifest:(e,{name:t,version:n},i)=>Oc(i)?Dke(e,t,n):Oke(e,t,n)},{id:"go",batchable:!0,ecosystem:"go",label:"Go modules",manifests:["go.mod"],lockfiles:["go.sum"],outdated:{command:"go",args:["list","-u","-m","all"]},upgrade:({name:e,version:t})=>({command:"go",args:["get",`${e}@${t.startsWith("v")?t:`v${t}`}`]})},{id:"cargo",batchable:!0,ecosystem:"cargo",label:"Cargo",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],outdated:{command:"cargo",args:["update","--dry-run"]},upgrade:({name:e,version:t,cargo:n})=>({command:"cargo",args:["add",`${e}@=${t}`,...Pke(n)]})},{id:"bundler",batchable:!0,ecosystem:"rubygems",label:"Bundler",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],outdated:{command:"bundle",args:["outdated"]},install:{command:"bundle",args:["install"]},upgrade:({name:e})=>({command:"bundle",args:["update",e,"--conservative"]}),rewriteManifest:(e,{name:t,version:n})=>Mke(e,t,n)},{id:"maven",ecosystem:"maven",label:"Maven",manifests:["pom.xml"],lockfiles:[],outdated:{command:"mvn",args:["versions:display-dependency-updates"]},upgrade:({name:e,version:t})=>({command:"mvn",args:["versions:use-dep-version",`-Dincludes=${e}`,`-DdepVersion=${t}`,"-DforceVersion=true"]})},{id:"gradle",ecosystem:"maven",label:"Gradle",manifests:["gradle/libs.versions.toml","build.gradle","build.gradle.kts"],lockfiles:["gradle.lockfile"],outdated:{command:"gradle",args:["dependencyUpdates"]},upgrade:()=>null},{id:"sbt",ecosystem:"maven",label:"sbt",manifests:["build.sbt"],lockfiles:[],outdated:{command:"sbt",args:["dependencyUpdates"]},upgrade:()=>null},{id:"dotnet",ecosystem:"nuget",label:"NuGet",manifests:["Directory.Packages.props"],manifestPattern:/\.(cs|fs|vb)proj$/i,lockfiles:["packages.lock.json"],outdated:{command:"dotnet",args:["list","package","--outdated"]},install:{command:"dotnet",args:["restore"]},upgrade:({name:e,version:t})=>({command:"dotnet",args:["add","package",e,"--version",t]})},{id:"composer",batchable:!0,ecosystem:"packagist",label:"Composer",manifests:["composer.json"],lockfiles:["composer.lock"],outdated:{command:"composer",args:["outdated","--format=json"]},install:{command:"composer",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"composer",args:["require",`${e}:${t}`,...n==="dev"?["--dev"]:[]]})},{id:"mix",batchable:!0,ecosystem:"hex",label:"Mix",manifests:["mix.exs"],lockfiles:["mix.lock"],outdated:{command:"mix",args:["hex.outdated"]},install:{command:"mix",args:["deps.get"]},upgrade:({name:e})=>({command:"mix",args:["deps.update",e]}),rewriteManifest:(e,{name:t,version:n})=>Lke(e,t,n)},{id:"rebar",ecosystem:"hex",label:"Rebar3",manifests:["rebar.config"],lockfiles:["rebar.lock"],outdated:null,install:{command:"rebar3",args:["get-deps"]},upgrade:({name:e})=>({command:"rebar3",args:["upgrade",e]}),rewriteManifest:(e,{name:t,version:n})=>Fke(e,t,n)},{id:"flutter",ecosystem:"pub",label:"Flutter",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"flutter",args:["pub","outdated"]},install:{command:"flutter",args:["pub","get"]},upgrade:({name:e,version:t})=>({command:"flutter",args:["pub","add",`${e}:${t}`]})},{id:"dart",ecosystem:"pub",label:"Dart pub",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"dart",args:["pub","outdated"]},install:{command:"dart",args:["pub","get"]},upgrade:({name:e,version:t,kind:n})=>({command:"dart",args:["pub","add",...n==="dev"?["dev:"]:[],`${e}:${t}`]})},{id:"swiftpm",ecosystem:"swift",label:"Swift Package Manager",manifests:["Package.swift"],lockfiles:["Package.resolved"],outdated:null,upgrade:()=>null},{id:"cocoapods",batchable:!0,ecosystem:"cocoapods",label:"CocoaPods",manifests:["Podfile"],lockfiles:["Podfile.lock"],outdated:{command:"pod",args:["outdated"]},install:{command:"pod",args:["install"]},upgrade:({name:e})=>({command:"pod",args:["update",e]}),rewriteManifest:(e,{name:t,version:n})=>Uke(e,t,n)},{id:"opam",batchable:!0,ecosystem:"opam",label:"opam",manifests:["dune-project"],manifestPattern:/\.opam$/,lockfiles:[],outdated:null,upgrade:({name:e,version:t})=>({command:"opam",args:["install",`${e}.${t}`,"--yes"]})},{id:"conan",batchable:!0,ecosystem:"conan",label:"Conan",manifests:["conanfile.txt","conanfile.py"],lockfiles:["conan.lock"],outdated:null,upgrade:()=>({command:"conan",args:["install",".","--build=missing"]}),rewriteManifest:(e,{name:t,version:n})=>jke(e,t,n)},{id:"vcpkg",batchable:!0,ecosystem:"vcpkg",label:"vcpkg",manifests:["vcpkg.json"],lockfiles:[],outdated:null,upgrade:()=>({command:"vcpkg",args:["install"]}),rewriteManifest:(e,{name:t,version:n})=>zke(e,t,n)},{id:"arduino-cli",batchable:!0,ecosystem:"arduino",label:"Arduino CLI",manifests:["library.properties"],lockfiles:[],outdated:{command:"arduino-cli",args:["lib","upgrade","--dry-run"]},upgrade:({name:e,version:t})=>({command:"arduino-cli",args:["lib","install",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Gke(e,t,n)},{id:"platformio",ecosystem:"arduino",label:"PlatformIO",manifests:["platformio.ini"],lockfiles:[],outdated:{command:"pio",args:["pkg","outdated"]},upgrade:({name:e,version:t})=>({command:"pio",args:["pkg","install","--library",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Vke(e,t,n)}];function la(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`^([ \\t]*${i})(\\[[^\\]]*\\])?[ \\t]*(?:[=<>!~]=?\\s*[^\\s;#,]+(?:\\s*,\\s*[=<>!~]=?\\s*[^\\s;#,]+)*)?`,"im");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${a??""}==${n}`):e}function Oke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`(["'])${i}(\\[[^\\]]*\\])?(?:\\s*[=<>!~]=?\\s*[^"',;]+(?:\\s*,\\s*[=<>!~]=?\\s*[^"',;]+)*)?\\1`,"i");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${t}${a??""}==${n}${s}`):e}function Mke(e,t,n){let i=la(t),r=new RegExp(`(gem\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(gem\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function Lke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*:${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"== ${n}"`):e}function Fke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"${n}"`):e}function Uke(e,t,n){let i=la(t),r=new RegExp(`(pod\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(pod\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function jke(e,t,n){let i=la(t),r=new RegExp(`\\b${i}/[^\\s"'#@]+`,"g");return e.replace(r,`${t}/${n}`)}function zke(e,t,n){let i;try{i=JSON.parse(e)}catch{return e}let r=Array.isArray(i.overrides)?i.overrides:[],o=r.find(s=>s.name===t);return o?o.version=n:r.push({name:t,version:n}),i.overrides=r,`${JSON.stringify(i,null,2)} -`}function Gke(e,t,n){return e.split(` +`)}}bo&&process.on("exit",()=>Nwe());var Pwe=1e4,Dwe=1440*60*1e3,Owe=6e4,Mwe=360*60*1e3,Lwe="drift-bot/0.1 (+https://github.com/trydrift/drift)",SP=new Map,ia=new Map;function EP(e,t){let n=ia.get(e);if(n)return Ar("http","coalesced_hit"),n;let i=t().finally(()=>ia.delete(e));return ia.set(e,i),i}var Xo=null;function PK(e){let t=SP.get(e);return t?Date.now()>=t.expiresAt?(SP.delete(e),{hit:!1}):{hit:!0,value:t.value}:{hit:!1}}function vo(e,t){let n=t===null?Date.now()+Owe:1/0;SP.set(e,{value:t,expiresAt:n})}function TP(e){if(!e)return"default";let t=Object.entries(e).filter(([i])=>/auth|token/i.test(i)||i.toLowerCase()==="accept").sort(([i],[r])=>i.localeCompare(r));if(t.length===0)return"default";let n=t.map(([i,r])=>`${i.toLowerCase()}=${r}`).join("&");return(0,Sd.createHash)("sha256").update(n).digest("hex").slice(0,16)}function qk(e,t){return(0,Sd.createHash)("sha256").update(`${TP(t)}:${e}`).digest("hex").slice(0,10)}function DK(e,t){return(0,Sd.createHash)("sha256").update(`${e}|${t.maxBytes??""}|${t.timeoutMs??""}|${t.retries??""}`).digest("hex").slice(0,10)}function oa(e){let t=e.indexOf("://");if(t<0)return"unknown";let n=e.slice(t+3),i=n.search(/[/?#]/);return(i<0?n:n.slice(0,i)).toLowerCase()}function sa(e){let t=e.indexOf("://");if(t<0)return e.split("?")[0];let n=e.slice(t+3),i=n.indexOf("/");return(i<0?"":n.slice(i)).split("?")[0]}function IP(e){return Math.max(0,Vt()-e)}function Br(e){let t={requestKey:e.requestKey,path:e.path,timeoutMs:Math.max(0,Math.round(e.timeoutMs))};return e.abortFiredAtMs!==null?(t.abortTimerFired=!0,t.abortDelayMs=Math.max(0,Math.round(e.abortFiredAtMs-e.attemptStartOffsetMs-e.timeoutMs))):t.abortTimerFired=!1,e.headersAtMs!==void 0&&e.headersAtMs!==null&&(t.headersMs=Math.max(0,Math.round(e.headersAtMs-e.attemptStartOffsetMs))),e.headersAtMs!==void 0&&e.headersAtMs!==null&&e.bodyDoneAtMs!==void 0&&e.bodyDoneAtMs!==null&&(t.bodyMs=Math.max(0,Math.round(e.bodyDoneAtMs-e.headersAtMs))),t}function Zt(e){TK({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status,cache:e.cache,bytes:e.bytes,retries:e.retries,backoffMs:e.backoffMs,failure:e.failure})}function qr(e){IK({host:oa(e.url),method:e.method,path:sa(e.url),startOffsetMs:e.startOffsetMs,durationMs:Vt()-e.startOffsetMs,status:e.status})}function OK(e){Xo=e}function Uc(){return Xo}function _e(e,t={}){let n=`json:${TP(t.headers)}:${e}`,i=PK(n);if(i.hit)return nt("http.cache.memory"),Ar("http","memory_hit"),Zt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);jg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s={Accept:"application/json",...t.headers},a=qk(e,s),c=o?It("http-coalesced-json",oa(e),{requestKey:a,path:sa(e)}):null,l=EP(n,()=>Fwe(e,n,t));return o?l.then(u=>(c?.end({waitMs:Math.round(IP(r))}),Zt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"}),u)):l}async function Fwe(e,t,n){let i={Accept:"application/json",...n.headers},r=await rt(e,{...n,headers:i});if(r===null)return vo(t,null),null;let o=It("json-parse",oa(e),{requestKey:qk(e,i),path:sa(e),bytes:r.length});try{let s=JSON.parse(r);return vo(t,s),s}catch{return vo(t,null),null}finally{o.end()}}function rt(e,t={}){let n=`text:${TP(t.headers)}:${e}`,i=PK(n);if(i.hit)return nt("http.cache.memory"),Ar("http","memory_hit"),Zt({url:e,method:"GET",startOffsetMs:Vt(),status:null,cache:"memory_hit"}),Promise.resolve(i.value);jg()&&ia.has(n)&&nt("http.cache.coalesced");let r=Vt(),o=ia.has(n),s=qk(e,t.headers),a=o?It("http-coalesced-text",oa(e),{requestKey:s,path:sa(e)}):null;return EP(n,()=>Uwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(IP(r))}),Zt({url:e,method:"GET",startOffsetMs:r,status:null,cache:"coalesced_hit"})),c))}async function Uwe(e,t,n){let{timeoutMs:i=Pwe,headers:r={},retries:o=2}=n,s=oa(e),a=qk(e,r),c=sa(e),l=It("disk-cache",s,{requestKey:a,path:c}),u=await Vwe(t);l.end({hit:u!==null});let d=n.cacheTtlMs??Dwe,p=Date.now();if(u&&u.body!==null&&(u.immutable||n.immutable||p-u.fetchedAt{w=Vt(),y.abort()},i),$=It("http",s,{requestKey:a,path:c,timeoutMs:i,...h>0?{attempt:h}:{}});try{let S=await fetch(e,{signal:y.signal,headers:{"User-Agent":Lwe,...f,...r},redirect:"follow"}),x=Vt();if(S.status===304&&u)return $.end({status:304,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),qr({url:e,method:"GET",startOffsetMs:b,status:304}),Zt({url:e,method:"GET",startOffsetMs:m,status:304,cache:"revalidated_304",retries:h,backoffMs:g}),nt("http.notModified"),Ar("http","revalidated_304"),Ar("http","write"),await $P(t,{...u,fetchedAt:p,immutable:u.immutable||n.immutable}),vo(t,u.body),u.body;if(S.ok){let A=await S.text(),L=Vt();return $.end({status:S.status,bytes:A.length,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x,bodyDoneAtMs:L})}),qr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Zt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",bytes:A.length,retries:h,backoffMs:g}),vo(t,A),Ar("http","write"),await $P(t,{key:t,body:A,etag:S.headers.get("etag")??void 0,fetchedAt:p,immutable:n.immutable}),A}if(S.status===404)return $.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),qr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Zt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g}),vo(t,null),Ar("http","write"),await $P(t,{key:t,body:null,absent:!0,fetchedAt:p,immutable:n.immutable}),null;if(S.status===403){if(!(S.headers.get("x-ratelimit-remaining")==="0"||S.headers.has("retry-after"))||h===o){$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),qr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Zt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),qr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,"rate-limited");let L=zg(h,S.headers.get("retry-after"));g+=L,await Gg(L);continue}if(!(S.status===429||S.status>=500)||h===o){$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),qr({url:e,method:"GET",startOffsetMs:b,status:S.status}),Zt({url:e,method:"GET",startOffsetMs:m,status:S.status,cache:"miss",retries:h,backoffMs:g});break}$.end({status:S.status,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w,headersAtMs:x})}),qr({url:e,method:"GET",startOffsetMs:b,status:S.status}),n.onRetry?.(h+1,S.status===429?"rate-limited":"server-error");let T=zg(h,S.headers.get("retry-after"));g+=T,await Gg(T)}catch(S){if($.end({status:0,...Br({requestKey:a,path:c,timeoutMs:i,attemptStartOffsetMs:b,abortFiredAtMs:w})}),qr({url:e,method:"GET",startOffsetMs:b,status:null}),h===o){Zt({url:e,method:"GET",startOffsetMs:m,status:null,cache:"miss",retries:h,backoffMs:g,failure:S instanceof Error?S.name:"network-error"}),nt("http.error");break}nt("http.error"),n.onRetry?.(h+1,"network-error");let x=zg(h,null);g+=x,await Gg(x)}finally{clearTimeout(k)}}return vo(t,null),u?.body!==void 0?(vo(t,u.body),u.body):null}function Bt(e,t={}){let n=`archive:${e}`,i=`${n}|maxBytes=${t.maxBytes??""}|timeoutMs=${t.timeoutMs??""}|retries=${t.retries??""}`,r=Vt(),o=ia.has(i),s=DK(e,t),a=o?It("http-coalesced-archive",oa(e),{requestKey:s,path:sa(e)}):null;return EP(i,()=>jwe(e,n,t)).then(c=>(o&&(a?.end({waitMs:Math.round(IP(r))}),Zt({url:e,method:"GET",startOffsetMs:r,status:c.ok?200:c.status,cache:"coalesced_hit"})),c))}async function jwe(e,t,n){let i=oa(e),r=sa(e),o=DK(e,n),s=Gwe(t),{retries:a=2,maxBytes:c}=n;if(s)try{let m=await(0,Vi.readFile)(s);if(c===void 0||m.length<=c)return nt("http.cache.archive"),Ar("http","disk_hit"),Zt({url:e,method:"GET",startOffsetMs:Vt(),status:200,cache:"disk_hit"}),{ok:!0,bytes:m}}catch{}Ar("http","miss");let l=n.timeoutMs??6e4,u=Date.now()+l,d=()=>u-Date.now();nt("http.archive");let p=Vt(),f=0;for(let m=0;m<=a;m++){let g=d();if(g<=0)return Zt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:"timeout"}),{ok:!1,status:0,error:"Timed out before this attempt could start."};let h=Vt(),b=It("archive",i,{requestKey:o,path:r,timeoutMs:Math.max(0,Math.round(g)),...m>0?{attempt:m}:{}}),y=new AbortController,w=null,k=setTimeout(()=>{w=Vt(),y.abort()},g);try{let $=await fetch(e,{signal:y.signal}),S=Vt();if(!$.ok){b.end({status:$.status,...Br({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),qr({url:e,method:"GET",startOffsetMs:h,status:$.status});let A=$.status===429||$.status>=500,L=Math.min(zg(m,$.headers.get("retry-after")),d());if(!A||m===a||L<=0)return Zt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",retries:m,backoffMs:f}),{ok:!1,status:$.status};f+=L,await Gg(L);continue}let x=Number($.headers.get("content-length"));if(c!==void 0&&Number.isFinite(x)&&x>c)return b.end({status:$.status,bytes:x,oversized:!0,...Br({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S})}),qr({url:e,method:"GET",startOffsetMs:h,status:$.status}),Zt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:$.status,error:`Response of ${x} bytes exceeds the ${c}-byte limit for this archive.`};let E=await zwe($,c,y),T=Vt();if(E==="oversized")return b.end({status:$.status,oversized:!0,...Br({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),qr({url:e,method:"GET",startOffsetMs:h,status:$.status}),Zt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",retries:m,backoffMs:f,failure:"oversized"}),{ok:!1,status:$.status,error:`Response exceeds the ${c}-byte limit for this archive.`};if(b.end({status:$.status,bytes:E.length,...Br({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w,headersAtMs:S,bodyDoneAtMs:T})}),qr({url:e,method:"GET",startOffsetMs:h,status:$.status}),Zt({url:e,method:"GET",startOffsetMs:p,status:$.status,cache:"miss",bytes:E.length,retries:m,backoffMs:f}),s)try{await(0,Vi.mkdir)(Xo,{recursive:!0});let A=`${s}.${process.pid}.partial`;await(0,Vi.writeFile)(A,E),await(0,Vi.rename)(A,s),Ar("http","write")}catch{}return{ok:!0,bytes:E}}catch($){if(b.end({status:0,...Br({requestKey:o,path:r,timeoutMs:g,attemptStartOffsetMs:h,abortFiredAtMs:w})}),qr({url:e,method:"GET",startOffsetMs:h,status:null}),m===a)return Zt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:$ instanceof Error?$.name:"network-error"}),{ok:!1,status:0,error:$.message};let S=Math.min(zg(m,null),d());if(S<=0)return Zt({url:e,method:"GET",startOffsetMs:p,status:null,cache:"miss",retries:m,backoffMs:f,failure:$ instanceof Error?$.name:"network-error"}),{ok:!1,status:0,error:$.message};f+=S,await Gg(S)}finally{clearTimeout(k)}}return{ok:!1,status:0}}async function zwe(e,t,n){if(t===void 0||!e.body)return Buffer.from(await e.arrayBuffer());let i=e.body.getReader(),r=[],o=0;for(;;){let{done:s,value:a}=await i.read();if(s)break;if(o+=a.byteLength,o>t)return n.abort(),"oversized";r.push(a)}return Buffer.concat(r)}function Gwe(e){return Xo?(0,xP.join)(Xo,`${(0,Sd.createHash)("sha256").update(e).digest("hex")}.bin`):null}async function Vwe(e){if(!Xo)return null;try{let t=await(0,Vi.readFile)(MK(e),"utf8"),n=JSON.parse(t);return n.key===e?n:null}catch{return null}}async function $P(e,t){if(Xo)try{await(0,Vi.mkdir)(Xo,{recursive:!0}),await(0,Vi.writeFile)(MK(e),JSON.stringify(t),"utf8")}catch{}}function MK(e){let t=(0,Sd.createHash)("sha256").update(e).digest("hex");return(0,xP.join)(Xo,`${t}.json`)}function zg(e,t){if(t){let i=Number(t);if(Number.isFinite(i)&&i>0)return Math.min(i*1e3,3e4)}return 400*2**e+Math.random()*200}function Gg(e){return new Promise(t=>setTimeout(t,e))}async function Bn(e,t,n){let i=new Array(e.length),r=0,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let s=r++;if(s>=e.length)return;i[s]=await n(e[s],s)}});return await Promise.all(o),i}var UK=require("node:crypto"),jK=require("node:zlib"),xd=require("node:fs/promises"),RP=require("node:path");var zK="https://downloads.arduino.cc/libraries/library_index.json.gz",Bwe=1440*60*1e3,qwe=12e4,LK=null;async function Wwe(){return LK??=Kwe(),LK}async function Wk(e){return(await Wwe())?.get(e.toLowerCase())??null}async function Kwe(){let e=await FK();if(e)return AP(e);let t=await Hwe();if(!t){let i=await FK({ignoreAge:!0});return i?AP(i):null}let n=Jwe(t);return await Ywe(n),AP(n)}async function Hwe(){try{let e=await fetch(zK,{signal:AbortSignal.timeout(qwe),headers:{"User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"}});if(!e.ok)return null;let t=Buffer.from(await e.arrayBuffer()),n=t[0]===31&&t[1]===139?(0,jK.gunzipSync)(t):t;return JSON.parse(n.toString("utf8"))}catch{return null}}function Jwe(e){let t=new Map;for(let n of e.libraries??[]){if(!n.name||!n.version)continue;let i=n.name.toLowerCase(),r=t.get(i);r||(r={name:n.name,versions:[],githubRepo:null,website:null,description:null,archives:{}},t.set(i,r)),r.versions.includes(n.version)||r.versions.push(n.version),n.url&&(r.archives[n.version]=n.url),r.githubRepo=Zwe(n.repository)??r.githubRepo,r.website=n.website??r.website,r.description=n.sentence??r.description}return[...t.values()]}function Zwe(e){if(!e)return null;let t=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/.exec(e);return t?`${t[1]}/${t[2]}`:null}function AP(e){return new Map(e.map(t=>[t.name.toLowerCase(),t]))}function GK(){let e=Uc();if(!e)return null;let t=(0,UK.createHash)("sha256").update(zK).digest("hex");return(0,RP.join)(e,`arduino-index-${t.slice(0,16)}.json`)}async function FK(e={}){let t=GK();if(!t)return null;try{let n=JSON.parse(await(0,xd.readFile)(t,"utf8"));return!Array.isArray(n.libraries)||!e.ignoreAge&&Date.now()-n.fetchedAt>=Bwe?null:n.libraries}catch{return null}}async function Ywe(e){let t=GK();if(t)try{await(0,xd.mkdir)((0,RP.join)(t,".."),{recursive:!0});let n={fetchedAt:Date.now(),libraries:[...e]};await(0,xd.writeFile)(t,JSON.stringify(n),"utf8")}catch{}}var WK=require("node:crypto");var Qwe=new Set(["sponsors","apps","marketplace","settings","about","pricing","features"]),VK=/^[A-Za-z0-9._-]+$/;function BK(e,t){let n=t.replace(/\.git$/i,"");return!e||!n||!VK.test(e)||!VK.test(n)||e==="."||e===".."||n==="."||n===".."||Qwe.has(e.toLowerCase())?null:`${e}/${n}`}function qK(e){let t=e.toLowerCase();return t==="github.com"||t==="www.github.com"}function aa(e){if(!e)return null;let t=e.trim();if(!t)return null;t=t.replace(/^git\+/i,"");let n=/^(?:ssh:\/\/)?(?:[^@/\s]+@)?github\.com:(?[^/\s:]+)\/(?[^\s?#]+?)\/?$/i.exec(t);if(n?.groups)return qK("github.com")?BK(n.groups.owner,n.groups.repo):null;let i;try{i=new URL(t)}catch{return null}if(!["http:","https:","ssh:","git:"].includes(i.protocol)||!qK(i.hostname))return null;let r=i.pathname.split("/").filter(Boolean);return r.length<2?null:BK(r[0],r[1])}var CP=new Map;function Xwe(e,t){let n=(0,WK.createHash)("md5").update(e).digest("hex"),i=`${n[0]}/${n[1]}/${n[2]}`,r=encodeURIComponent(e);return`https://cdn.cocoapods.org/Specs/${i}/${r}/${encodeURIComponent(t)}/${r}.podspec.json`}function Kk(e,t,n={}){let i=`${e}@${t}`,r=CP.get(i);if(r)return r;let o=eke(e,t,n).catch(()=>null);return CP.set(i,o),o.then(s=>{s||CP.delete(i)}),o}async function eke(e,t,n){let i=await _e(Xwe(e,t),{immutable:!0,...n.timeoutMs?{timeoutMs:n.timeoutMs}:{}});if(!i)return null;let r=i.source&&typeof i.source=="object"?tke(i.source):null;return{name:i.name??e,version:i.version??t,moduleName:typeof i.module_name=="string"&&i.module_name?i.module_name:null,source:r,homepage:NP(i.homepage),summary:NP(i.summary),description:NP(i.description)}}function tke(e){let t=n=>{let i=e[n];return typeof i=="string"&&i?i:void 0};return{git:t("git"),tag:t("tag"),http:t("http"),svn:t("svn")}}function NP(e){return typeof e=="string"&&e.trim()?e.trim():null}function KK(e){return aa(e.source?.git)??aa(e.homepage)}var nke=e=>`https://api.github.com/repos/ocaml/opam-repository/contents/packages/${encodeURIComponent(e)}`,rke="https://api.github.com/repos/ocaml/opam-repository/branches/master",HK=(e,t,n)=>`https://raw.githubusercontent.com/ocaml/opam-repository/${n}/packages/${encodeURIComponent(e)}/${encodeURIComponent(`${e}.${t}`)}/opam`;async function ike(e){let n=(await _e(rke,{...e?{headers:e}:{}}).catch(()=>null))?.commit?.sha;return typeof n=="string"&&/^[0-9a-f]{40}$/.test(n)?n:null}function ZK(e){return/^[\w.+-]+$/.test(e)}async function Hk(e,t={}){if(!ZK(e))return null;let n=await _e(nke(e),{...t.headers?{headers:t.headers}:{}}).catch(()=>null);if(!Array.isArray(n))return null;let i=`${e}.`;return n.filter(r=>r.type==="dir"&&r.name?.startsWith(i)).map(r=>r.name.slice(i.length))}async function YK(e,t){if(!ZK(e))return null;let n=await ike(),i=n?await rt(HK(e,t,n),{immutable:!0}).catch(()=>null):await rt(HK(e,t,"master")).catch(()=>null);return i?oke(i,e,t):null}function oke(e,t,n){let i=a=>{let c=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e);return c?JK(c[1]):null},r=a=>{let l=new RegExp(`(?:^|\\n)\\s*${a}\\s*:\\s*"([^"\\n]*)"`).exec(e)?.[1]?.trim();return l||null},o=(()=>{let a=/(?:^|\n)\s*description\s*:\s*"""([\s\S]*?)"""/.exec(e);return a?a[1].trim()||null:r("description")})(),s=(()=>{let a=/(?:^|\n)\s*url\s*\{([\s\S]*?)\n[ \t]*\}/.exec(e),c=a?a[1]:e,l=/(?:^|\n)\s*src\s*:\s*"([^"\n]+)"/.exec(c)??/(?:^|\n)\s*archive\s*:\s*"([^"\n]+)"/.exec(c);return l?JK(l[1]):null})();return{name:t,version:n,devRepo:i("dev-repo"),homepage:i("homepage"),bugReports:i("bug-reports"),doc:i("doc"),synopsis:r("synopsis"),description:o,sourceUrl:s}}function JK(e){let t=e.trim();return!t||/%\{[^}]*\}%?/.test(t)?null:t}function QK(e){return aa(e.devRepo)??aa(e.sourceUrl)??aa(e.homepage)??aa(e.bugReports)}function Jk(e){let t={};return e.map(n=>{let i={...t,...n};return t=i,i})}function Zk(e,t){return e.find(n=>n.version===t)}async function qn(e,t,n){switch(t){case"npm":return xke(e,n);case"pypi":return Eke(e,n);case"cargo":return Tke(e);case"go":return Ike(e);case"maven":return Cke(e);case"rubygems":return Nke(e);case"nuget":return ake(e);case"packagist":return cke(e,n);case"hex":return lke(e);case"pub":return uke(e);case"swift":return dke(e);case"cocoapods":return pke(e,n);case"conan":return fke(e);case"vcpkg":return hke(e);case"arduino":return yke(e);case"opam":return ske(e,n);default:return null}}async function ske(e,t){let[n,i]=await Promise.all([Hk(e),t?YK(e,t):Promise.resolve(null)]);return!n&&!i?null:{name:e,ecosystem:"opam",githubRepo:i?QK(i):null,homepage:i?.homepage??i?.devRepo??null,versions:n??[],deprecated:null,description:i?.description??i?.synopsis??null}}async function ake(e){let t=e.toLowerCase(),[n,i]=await Promise.all([_e(`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(t)}/index.json`),_e(`https://api.nuget.org/v3/registration5-gz-semver2/${encodeURIComponent(t)}/index.json`)]);if(!n&&!i)return null;let r=(i?.items??[]).flatMap(s=>s.items??[]),o=r[r.length-1]?.catalogEntry;return{name:e,ecosystem:"nuget",githubRepo:Lt(o?.repository?.url??null)??Lt(o?.projectUrl??null),homepage:o?.projectUrl??`https://www.nuget.org/packages/${e}`,versions:n?.versions??[],deprecated:o?.deprecation?.message??null,description:o?.description??null}}async function cke(e,t){let i=(await _e(`https://repo.packagist.org/p2/${e}.json`))?.packages?.[e];if(!i||i.length===0)return null;let r=Jk(i),o=t?Zk(r,t):r[0];if(!o)return null;let s=o.abandoned,a=s===void 0||s===!1?null:typeof s=="string"?`This package is abandoned; the author suggests using ${s} instead.`:"This package is abandoned and is no longer maintained.";return{name:e,ecosystem:"packagist",githubRepo:Lt(o.source?.url??null)??Lt(o.homepage??null),homepage:o.homepage??`https://packagist.org/packages/${e}`,versions:r.map(c=>c.version).filter(c=>!!c),deprecated:a,description:o.description??null}}async function lke(e){let t=await _e(`https://hex.pm/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.meta?.links??{},i=Object.entries(n).map(([s,a])=>({key:s.toLowerCase(),value:a})),r=i.find(s=>s.key==="github")?.value??i.find(s=>s.key==="source")?.value,o=Object.values(t.retirements??{})[0];return{name:e,ecosystem:"hex",githubRepo:Lt(r??null)??i.map(s=>Lt(s.value)).find(Boolean)??null,homepage:t.html_url??`https://hex.pm/packages/${e}`,versions:(t.releases??[]).map(s=>s.version).filter(s=>!!s),deprecated:o?o.message??o.reason??"This release is retired.":null,description:t.meta?.description??null}}async function uke(e){let t=await _e(`https://pub.dev/api/packages/${encodeURIComponent(e)}`);if(!t)return null;let n=t.latest?.pubspec,i=n?.repository??n?.homepage??n?.issue_tracker;return{name:e,ecosystem:"pub",githubRepo:Lt(i??null),homepage:n?.homepage??`https://pub.dev/packages/${e}`,versions:(t.versions??[]).map(r=>r.version).filter(r=>!!r),deprecated:t.latest?.retracted?"The latest version of this package has been retracted.":null,description:n?.description??null}}function dke(e){return/^[\w.-]+\/[\w.-]+$/.test(e)?{name:e,ecosystem:"swift",githubRepo:e,homepage:`https://github.com/${e}`,versions:[],deprecated:null,description:null}:null}async function pke(e,t){let[n,i]=await Promise.all([_e(`https://trunk.cocoapods.org/api/v1/pods/${encodeURIComponent(e)}`),t?Kk(e,t):Promise.resolve(null)]);return n?{name:e,ecosystem:"cocoapods",githubRepo:i?KK(i):null,homepage:i?.homepage??`https://cocoapods.org/pods/${e}`,versions:(n.versions??[]).map(r=>r.name).filter(r=>!!r),deprecated:null,description:i?.description??i?.summary??null}:null}async function fke(e){let t=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,n=await rt(`${t}/config.yml`);if(!n)return null;let{versions:i,folders:r}=mke(n);if(i.length===0)return null;let o=r[i[i.length-1]]??r[i[0]]??"all",s=await rt(`${t}/${o}/conandata.yml`);return{name:e,ecosystem:"conan",githubRepo:s?gke(s):null,homepage:`https://conan.io/center/recipes/${e}`,versions:i,deprecated:null,description:null}}function mke(e){let t=[],n={},i=!1,r=null;for(let o of e.split(` +`)){let s=o.split("#")[0].replace(/\s+$/,"");if(!s.trim())continue;if(/^versions\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1;continue}if(!i)continue;let a=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim(),r&&!t.includes(r)&&t.push(r);continue}let c=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(s);c&&r&&(n[r]=c[1])}return{versions:t,folders:n}}function gke(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function hke(e){let t=e[0]?.toLowerCase();if(!t||!/[a-z0-9]/.test(t))return null;let[n,i]=await Promise.all([_e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/versions/${t}-/${encodeURIComponent(e)}.json`),_e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`)]);if(!n)return null;let r=[];for(let s of n.versions??[]){let a=s.version??s["version-semver"]??s["version-string"]??s["version-date"];a&&!r.includes(a)&&r.push(a)}if(r.length===0)return null;let o=Array.isArray(i?.description)?i.description.join(" "):i?.description??null;return{name:e,ecosystem:"vcpkg",githubRepo:Lt(i?.homepage??null),homepage:i?.homepage??`https://vcpkg.io/en/package/${e}`,versions:r,deprecated:null,description:o}}async function yke(e){let t=await Wk(e);if(t)return{name:t.name,ecosystem:"arduino",githubRepo:t.githubRepo,homepage:t.website??`https://www.arduino.cc/reference/en/libraries/${vke(e)}/`,versions:t.versions,deprecated:null,description:t.description};let n=await bke(e);return n?{name:n.name??e,ecosystem:"arduino",githubRepo:Lt(n.repository_url??null),homepage:n.homepage??null,versions:n.version?.name?[n.version.name]:[],deprecated:null,description:n.description??null}:null}async function bke(e){let n=((await _e(`https://api.registry.platformio.org/v3/search?query=${encodeURIComponent(e)}`))?.items??[]).find(i=>i.name?.toLowerCase()===e.toLowerCase()&&i.owner?.username);return n?_e(`https://api.registry.platformio.org/v3/packages/${encodeURIComponent(n.owner.username)}/library/${encodeURIComponent(n.name)}`):null}function vke(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}async function ca(e,t,n){switch(t){case"npm":return wke(e,n);case"pypi":return kke(e,n);case"go":return _ke(e,n);case"cargo":return Ske(e,n);default:return null}}function Yk(e){return{version:e,license:null,releasedAt:null,runtime:null,dependencies:[],withdrawn:null}}async function wke(e,t){let n=await _e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`),i=n?.versions?.[t];if(!i)return null;let r=i.engines?.node;return{...Yk(t),license:typeof i.license=="string"?i.license:i.license?.type??null,releasedAt:n?.time?.[t]??null,runtime:r?{name:"Node.js",requirement:r}:null,dependencies:Object.keys(i.dependencies??{}),withdrawn:i.deprecated??null}}async function kke(e,t){let n=await _e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{immutable:!0});if(!n?.info)return null;let i=n.info.requires_python;return{...Yk(t),license:n.info.license||null,releasedAt:n.urls?.[0]?.upload_time_iso_8601??null,runtime:i?{name:"Python",requirement:i}:null,dependencies:(n.info.requires_dist??[]).map(r=>/^\s*([A-Za-z0-9._-]+)/.exec(r)?.[1]).filter(r=>!!r),withdrawn:n.info.yanked?`Release yanked: ${n.info.yanked_reason??"no reason given"}`:null}}async function _ke(e,t){let n=t.startsWith("v")?t:`v${t}`,i=`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/${encodeURIComponent(n)}`,[r,o]=await Promise.all([rt(`${i}.mod`,{immutable:!0}),_e(`${i}.info`,{immutable:!0})]);if(!r&&!o)return null;let s=r?/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(r)?.[1]:null;return{...Yk(n),releasedAt:o?.Time??null,runtime:s?{name:"Go",requirement:`>=${s}`}:null,withdrawn:r?$ke(r,n):null}}function $ke(e,t){let n=t.replace(/^v/,"");for(let r of e.matchAll(/^\s*retract\s+(.+)$/gm)){let o=r[1].trim(),s=/\/\/\s*(.+)$/.exec(o)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.",c=/^v?([\w.+-]+)/.exec(o.replace(/\/\/.*$/,"").trim())?.[1];if(c&&c===n)return a;let l=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(l&&XK(n,l[1],l[2]))return a}let i=/^\s*retract\s*\(([\s\S]*?)^\s*\)/m.exec(e)?.[1];if(i)for(let r of i.split(` +`)){let o=r.replace(/\/\/.*$/,"").trim();if(!o)continue;let s=/\/\/\s*(.+)$/.exec(r)?.[1]?.trim(),a=s?`Retracted by the maintainer: ${s}`:"Retracted by the maintainer.";if(/^v?([\w.+-]+)$/.exec(o)?.[1]===n)return a;let c=/\[\s*v?([\w.+-]+)\s*,\s*v?([\w.+-]+)\s*\]/.exec(o);if(c&&XK(n,c[1],c[2]))return a}return null}function XK(e,t,n){return eH(e,t)>=0&&eH(e,n)<=0}function eH(e,t){let n=e.split(/[.+-]/).map(r=>Number.parseInt(r,10)),i=t.split(/[.+-]/).map(r=>Number.parseInt(r,10));for(let r=0;r=${i}`}:null,withdrawn:n.version.yanked?"This release was yanked from crates.io.":null}}async function rH(e,t,n){let i={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};t&&(i.Authorization=`Bearer ${t}`);let r=await _e(`https://api.github.com/repos/${e}`,{headers:i,...n?{onRetry:n}:{}});if(!r)return null;let o=r.license?.spdx_id;return{archived:r.archived===!0,pushedAt:r.pushed_at??null,license:o&&o!=="NOASSERTION"?o:null,url:r.html_url??`https://github.com/${e}`}}async function xke(e,t){let n=await _e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`);if(!n)return null;let i=Object.keys(n.versions??{}),r=t?n.versions?.[t]:void 0;return{name:e,ecosystem:"npm",githubRepo:Lt(tH(n.repository))??Lt(tH(r?.repository))??Lt(n.homepage),homepage:n.homepage??null,versions:i,deprecated:r?.deprecated??null,description:n.description??null}}async function Eke(e,t){let n=await _e(`https://pypi.org/pypi/${encodeURIComponent(e)}/json`);if(!n)return null;let o=[...Object.values(n.info?.project_urls??{}),n.info?.home_page??""].map(Lt).find(c=>c!==null)??null,a=(t?n.releases?.[t]??[]:[]).find(c=>c.yanked);return{name:e,ecosystem:"pypi",githubRepo:o,homepage:n.info?.home_page??null,versions:Object.keys(n.releases??{}),deprecated:a?`Release yanked: ${a.yanked_reason??"no reason given"}`:null,description:n.info?.summary??null}}async function Tke(e){let t=await _e(`https://crates.io/api/v1/crates/${encodeURIComponent(e)}`);return t?{name:e,ecosystem:"cargo",githubRepo:Lt(t.crate?.repository)??Lt(t.crate?.homepage),homepage:t.crate?.homepage??null,versions:(t.versions??[]).map(n=>n.num),deprecated:null,description:t.crate?.description??null}:null}async function Ike(e){let t=await rt(`https://proxy.golang.org/${encodeURI(e.toLowerCase())}/@v/list`);return{name:e,ecosystem:"go",githubRepo:Rke(e),homepage:`https://pkg.go.dev/${e}`,versions:t?t.split(` +`).map(n=>n.trim()).filter(Boolean):[],deprecated:null,description:null}}var Ake={grpc:"grpc/grpc-go",protobuf:"protocolbuffers/protobuf-go",api:"googleapis/google-api-go-client",genproto:"googleapis/go-genproto",appengine:"golang/appengine"};function Rke(e){let t=e.replace(/\/v[2-9]\d*$/,""),n=[[/^golang\.org\/x\/([\w.-]+)/,i=>`golang/${i[1]}`],[/^google\.golang\.org\/(\w+)/,i=>Ake[i[1]]??`googleapis/go-${i[1]}`],[/^go\.uber\.org\/([\w.-]+)/,i=>`uber-go/${i[1]}`],[/^sigs\.k8s\.io\/([\w.-]+)/,i=>`kubernetes-sigs/${i[1]}`],[/^k8s\.io\/([\w.-]+)/,i=>`kubernetes/${i[1]}`],[/^gopkg\.in\/([\w.-]+)\/([\w.-]+?)\.v\d+$/,i=>`${i[1]}/${i[2]}`],[/^gopkg\.in\/([\w.-]+?)\.v\d+$/,i=>`go-${i[1]}/${i[1]}`]];for(let[i,r]of n){let o=i.exec(t);if(o)return r(o)}return Lt(`https://${t}`)}async function Cke(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await _e(`https://search.maven.org/solrsearch/select?q=g:%22${encodeURIComponent(t)}%22+AND+a:%22${encodeURIComponent(n)}%22&core=gav&rows=100&wt=json`);return{name:e,ecosystem:"maven",githubRepo:null,homepage:`https://central.sonatype.com/artifact/${t}/${n}`,versions:(i?.response?.docs??[]).map(r=>r.v),deprecated:null,description:null}}async function Nke(e){let t=await _e(`https://rubygems.org/api/v1/gems/${encodeURIComponent(e)}.json`);if(!t)return null;let n=await _e(`https://rubygems.org/api/v1/versions/${encodeURIComponent(e)}.json`);return{name:e,ecosystem:"rubygems",githubRepo:Lt(t.source_code_uri)??Lt(t.homepage_uri)??Lt(t.changelog_uri),homepage:t.homepage_uri??null,versions:(n??[]).map(i=>i.number),deprecated:null,description:t.info??null,changelogUrl:t.changelog_uri??null,documentationUrl:t.documentation_uri??null}}function tH(e){if(e)return typeof e=="string"?e:e.url}function Lt(e){if(!e)return null;let t=/^github:([\w.-]+)\/([\w.-]+)$/.exec(e.trim());if(t)return`${t[1]}/${nH(t[2])}`;let n=/github\.com[/:]([\w.-]+)\/([\w.-]+)/.exec(e);if(!n)return null;let i=n[1],r=nH(n[2]);return!i||!r||i==="sponsors"?null:`${i}/${r}`}function nH(e){return e.replace(/\.git$/,"")}async function oH(e,t={}){let n=t.lookup??((i,r)=>qn(i,r,null));return Promise.all(e.map(async i=>{let r=i.rawFrom!=null&&i.from===null,o=i.rawTo!=null&&i.to===null;if(!r&&!o||i.source==="lockfile"||!Pke.has(i.ecosystem))return i;let a=(await n(i.name,i.ecosystem).catch(p=>(t.logger?.debug?.(`range resolution: registry lookup for ${i.name} failed: ${String(p)}`),null)))?.versions??[];if(a.length===0)return i;let c=r?iH(a,i.rawFrom):i.from,l=o?iH(a,i.rawTo):i.to;if(r&&!c||o&&!l)return i;let u=c??i.from,d=l??i.to;return t.logger?.debug?.(`range resolution: ${i.name} ${i.rawFrom} \u2192 ${i.rawTo} resolves to ${u} \u2192 ${d}`),{...i,from:u,to:d,bump:u&&d?ta(u,d,i.ecosystem):i.bump}}))}var Pke=new Set(["npm"]);function iH(e,t){let n=t.trim().replace(/^v(?=\d)/,"");return Vg.default.valid(n)?e.includes(n)?n:Vg.default.valid(n):Vg.default.validRange(n)?Vg.default.maxSatisfying([...e],n,{includePrerelease:!1}):null}var Ed=require("node:fs"),aH=gt(gc(),1);function Wn(){return{async readFile(e){try{return(0,Ed.readFileSync)(e,"utf8")}catch{return null}},async readDirectory(e){try{return(0,Ed.readdirSync)(e)}catch{return[]}},async isDirectory(e){try{return(0,Ed.statSync)(e).isDirectory()}catch{return!1}}}}async function Td(e,t){let i=(await Promise.all([Dke(e,t),Oke(e,t),Mke(e,t),Lke(e,t),Fke(e,t),Uke(e,t)])).filter(o=>o!==null);return i.find(o=>o.kind==="pnpm-workspace")?i.filter(o=>o.kind!=="npm-workspaces"):i}function Id(e){let t=new Set;for(let n of e)for(let i of n.members)t.add(i.dir);return t.size===0?[""]:[...t].sort()}function jc(e,t){let n=null;for(let i of t){if(i===""){n===null&&(n="");continue}(e===i||e.startsWith(`${i}/`))&&(n===null||i.length>n.length)&&(n=i)}return n}function PP(e,t){return t===""||e===t||e.startsWith(`${t}/`)}function cH(e,t){if(t.length===0)return[...e];let n=Id(t),i=new Map;for(let r of t)for(let o of r.members)o.name&&i.set(o.dir,o.name);return e.map(r=>{let o=jc(r.manifestPath,n);if(o===null)return r;let s=i.get(o);return{...r,workspace:o,...s?{workspaceName:s}:{}}})}function Qk(e){return e.workspace===void 0?null:e.workspaceName??(e.workspace===""?"the repository root":e.workspace)}async function Dke(e,t){let n=await t.readFile(Wr(e,"package.json"));if(!n)return null;let i=Gt(n),r=Array.isArray(i?.workspaces)?i.workspaces:i?.workspaces?.packages;return!r||r.length===0?null:{kind:"npm-workspaces",ecosystem:"npm",declaredIn:"package.json",members:await Ad(e,t,r,"npm","package.json",i?.name??null)}}async function Oke(e,t){let n=await t.readFile(Wr(e,"pnpm-workspace.yaml"));if(!n)return null;let i=[];try{let o=(0,aH.parse)(n);Array.isArray(o?.packages)&&(i=o.packages.filter(s=>typeof s=="string"))}catch{return null}if(i.length===0)return null;let r=Gt(await t.readFile(Wr(e,"package.json"))??"")?.name??null;return{kind:"pnpm-workspace",ecosystem:"npm",declaredIn:"pnpm-workspace.yaml",members:await Ad(e,t,i,"npm","package.json",r)}}async function Mke(e,t){let n=await t.readFile(Wr(e,"Cargo.toml"));if(!n)return null;let i=pi(n),r=i.find(c=>c.header==="workspace");if(!r)return null;let o=Mg(r.entries.get("members")??""),s=i.some(c=>c.header==="package"),a=s?lH(i.find(c=>c.header==="package")?.entries.get("name")??""):null;return{kind:"cargo-workspace",ecosystem:"cargo",declaredIn:"Cargo.toml",members:await Ad(e,t,o,"cargo","Cargo.toml",a,!s)}}async function Lke(e,t){let n=await t.readFile(Wr(e,"go.work"));if(!n)return null;let i=[],r=!1;for(let o of n.split(` +`)){let s=o.split("//")[0].trim();if(!s)continue;if(/^use\s*\($/.test(s)){r=!0;continue}if(r&&s===")"){r=!1;continue}let a=/^use\s+(\S+)$/.exec(s);a?i.push(a[1]):r&&i.push(s)}return{kind:"go-work",ecosystem:"go",declaredIn:"go.work",members:await Ad(e,t,i,"go","go.mod",null,!0)}}async function Fke(e,t){let n=await t.readFile(Wr(e,"pom.xml"));if(!n)return null;let i=/([\s\S]*?)<\/modules>/.exec(n);if(!i)return null;let r=[...i[1].matchAll(/\s*([^<]+?)\s*<\/module>/g)].map(s=>s[1]);if(r.length===0)return null;let o=/\s*([^<]+?)\s*<\/artifactId>/.exec(n)?.[1]??null;return{kind:"maven-modules",ecosystem:"maven",declaredIn:"pom.xml",members:await Ad(e,t,r,"maven","pom.xml",o)}}async function Uke(e,t){let n=await t.readFile(Wr(e,"settings.gradle.kts"))?"settings.gradle.kts":await t.readFile(Wr(e,"settings.gradle"))?"settings.gradle":null;if(!n)return null;let r=[...(await t.readFile(Wr(e,n))??"").matchAll(/include\s*\(?\s*((?:['"][^'"]+['"]\s*,?\s*)+)/g)].flatMap(o=>[...o[1].matchAll(/['"]([^'"]+)['"]/g)].map(s=>s[1])).map(o=>o.replace(/^:/,"").replace(/:/g,"/"));return r.length===0?null:{kind:"gradle-settings",ecosystem:"maven",declaredIn:n,members:await Ad(e,t,r,"maven","build.gradle",null,!0)}}async function Ad(e,t,n,i,r,o,s=!1){let a=new Set,c=new Set;for(let u of n){let d=u.trim();if(d.startsWith("!"))for(let p of await sH(e,t,d.slice(1),r))c.add(p);else for(let p of await sH(e,t,d,r))a.add(p)}for(let u of c)a.delete(u);let l=[];s||l.push({dir:"",name:o,ecosystem:i});for(let u of[...a].sort())u!==""&&l.push({dir:u,name:await Bg(e,t,u,r,i),ecosystem:i});return l}async function sH(e,t,n,i){let r=n.replace(/^\.\//,"").replace(/\/+$/,"");if(r.startsWith("!"))return[];if(!r.includes("*"))return[r];let o=r.split("/"),s=o.findIndex(p=>p.includes("*")),a=o.slice(0,s).join("/"),c=o[s]==="**",l=o.slice(s+1).join("/"),u=[],d=async(p,f)=>{if(!(f>4))for(let m of await t.readDirectory(Wr(e,p))){if(m.startsWith(".")||m==="node_modules"||m==="target")continue;let g=p?`${p}/${m}`:m;if(!await t.isDirectory(Wr(e,g)))continue;let h=l?`${g}/${l}`:g;(!i||await t.readFile(Wr(e,h,i))!==null)&&u.push(h),c&&await d(g,f+1)}};return await d(a,0),u}async function Bg(e,t,n,i,r){let o=await t.readFile(Wr(e,n,i));if(!o)return null;switch(r){case"npm":return Gt(o)?.name??null;case"cargo":{let s=pi(o).find(a=>a.header==="package");return lH(s?.entries.get("name")??"")||null}case"go":return/^\s*module\s+(\S+)/m.exec(o)?.[1]??null;case"maven":return/\s*([^<]+?)\s*<\/artifactId>/.exec(o)?.[1]??null;default:return null}}function lH(e){return e.trim().replace(/^["']|["']$/g,"")}function Wr(...e){return e.filter(Boolean).join("/")}var Xk=(e,t,n,i)=>e==="dev"?[t]:e==="optional"?[n]:e==="peer"&&i?[i]:[],jke=e=>e?[...e.section==="dev-dependencies"?["--dev"]:[],...e.section==="build-dependencies"?["--build"]:[],...e.target?["--target",e.target]:[]]:[],DP=[{id:"npm",batchable:!0,ecosystem:"npm",label:"npm",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json"],outdated:{command:"npm",args:["outdated","--json"]},install:{command:"npm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"npm",args:["install",`${e}@${t}`,...Xk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"pnpm",batchable:!0,ecosystem:"npm",label:"pnpm",manifests:["package.json"],lockfiles:["pnpm-lock.yaml"],outdated:{command:"pnpm",args:["outdated"]},install:{command:"pnpm",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"pnpm",args:["add",`${e}@${t}`,...Xk(n,"--save-dev","--save-optional","--save-peer")]})},{id:"yarn-berry",batchable:!0,ecosystem:"npm",label:"Yarn (berry)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:null,install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"yarn",args:["add",`${e}@${t}`,...Xk(n,"--dev","--optional","--peer")]})},{id:"yarn",batchable:!0,ecosystem:"npm",label:"Yarn (classic)",manifests:["package.json"],lockfiles:["yarn.lock"],outdated:{command:"yarn",args:["outdated","--json"]},install:{command:"yarn",args:["install"]},upgrade:({name:e,version:t})=>({command:"yarn",args:["upgrade",`${e}@${t}`]})},{id:"bun",batchable:!0,ecosystem:"npm",label:"Bun",manifests:["package.json"],lockfiles:["bun.lock","bun.lockb"],outdated:{command:"bun",args:["outdated"]},install:{command:"bun",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"bun",args:["add",`${e}@${t}`,...Xk(n,"--dev","--optional","--peer")]})},{id:"uv",batchable:!0,ecosystem:"pypi",label:"uv",manifests:["pyproject.toml"],lockfiles:["uv.lock"],outdated:{command:"uv",args:["pip","list","--outdated","--format","json"]},install:{command:"uv",args:["sync"]},upgrade:({name:e,version:t,kind:n})=>({command:"uv",args:["add",`${e}==${t}`,...n==="dev"?["--dev"]:[]]})},{id:"poetry",batchable:!0,ecosystem:"pypi",label:"Poetry",manifests:["pyproject.toml"],lockfiles:["poetry.lock"],outdated:{command:"poetry",args:["show","--outdated"]},install:{command:"poetry",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"poetry",args:["add",`${e}==${t}`,...n==="dev"?["--group","dev"]:[]]})},{id:"pip",batchable:!0,ecosystem:"pypi",label:"pip",manifests:["requirements.in","requirements.txt","pyproject.toml","setup.py"],manifestPattern:/^(?:requirements|constraints)[\w.-]*\.(?:in|txt)$/i,lockfiles:[],outdated:{command:"pip",args:["list","--outdated","--format=json"]},upgrade:({name:e,version:t})=>({command:"pip",args:["install","--upgrade",`${e}==${t}`]}),rewriteManifest:(e,{name:t,version:n},i)=>Lc(i)?zke(e,t,n):Gke(e,t,n)},{id:"go",batchable:!0,ecosystem:"go",label:"Go modules",manifests:["go.mod"],lockfiles:["go.sum"],outdated:{command:"go",args:["list","-u","-m","all"]},upgrade:({name:e,version:t})=>({command:"go",args:["get",`${e}@${t.startsWith("v")?t:`v${t}`}`]})},{id:"cargo",batchable:!0,ecosystem:"cargo",label:"Cargo",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],outdated:{command:"cargo",args:["update","--dry-run"]},upgrade:({name:e,version:t,cargo:n})=>({command:"cargo",args:["add",`${e}@=${t}`,...jke(n)]})},{id:"bundler",batchable:!0,ecosystem:"rubygems",label:"Bundler",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],outdated:{command:"bundle",args:["outdated"]},install:{command:"bundle",args:["install"]},upgrade:({name:e})=>({command:"bundle",args:["update",e,"--conservative"]}),rewriteManifest:(e,{name:t,version:n})=>Vke(e,t,n)},{id:"maven",ecosystem:"maven",label:"Maven",manifests:["pom.xml"],lockfiles:[],outdated:{command:"mvn",args:["versions:display-dependency-updates"]},upgrade:({name:e,version:t})=>({command:"mvn",args:["versions:use-dep-version",`-Dincludes=${e}`,`-DdepVersion=${t}`,"-DforceVersion=true"]})},{id:"gradle",ecosystem:"maven",label:"Gradle",manifests:["gradle/libs.versions.toml","build.gradle","build.gradle.kts"],lockfiles:["gradle.lockfile"],outdated:{command:"gradle",args:["dependencyUpdates"]},upgrade:()=>null},{id:"sbt",ecosystem:"maven",label:"sbt",manifests:["build.sbt"],lockfiles:[],outdated:{command:"sbt",args:["dependencyUpdates"]},upgrade:()=>null},{id:"dotnet",ecosystem:"nuget",label:"NuGet",manifests:["Directory.Packages.props"],manifestPattern:/\.(cs|fs|vb)proj$/i,lockfiles:["packages.lock.json"],outdated:{command:"dotnet",args:["list","package","--outdated"]},install:{command:"dotnet",args:["restore"]},upgrade:({name:e,version:t})=>({command:"dotnet",args:["add","package",e,"--version",t]})},{id:"composer",batchable:!0,ecosystem:"packagist",label:"Composer",manifests:["composer.json"],lockfiles:["composer.lock"],outdated:{command:"composer",args:["outdated","--format=json"]},install:{command:"composer",args:["install"]},upgrade:({name:e,version:t,kind:n})=>({command:"composer",args:["require",`${e}:${t}`,...n==="dev"?["--dev"]:[]]})},{id:"mix",batchable:!0,ecosystem:"hex",label:"Mix",manifests:["mix.exs"],lockfiles:["mix.lock"],outdated:{command:"mix",args:["hex.outdated"]},install:{command:"mix",args:["deps.get"]},upgrade:({name:e})=>({command:"mix",args:["deps.update",e]}),rewriteManifest:(e,{name:t,version:n})=>Bke(e,t,n)},{id:"rebar",ecosystem:"hex",label:"Rebar3",manifests:["rebar.config"],lockfiles:["rebar.lock"],outdated:null,install:{command:"rebar3",args:["get-deps"]},upgrade:({name:e})=>({command:"rebar3",args:["upgrade",e]}),rewriteManifest:(e,{name:t,version:n})=>qke(e,t,n)},{id:"flutter",ecosystem:"pub",label:"Flutter",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"flutter",args:["pub","outdated"]},install:{command:"flutter",args:["pub","get"]},upgrade:({name:e,version:t})=>({command:"flutter",args:["pub","add",`${e}:${t}`]})},{id:"dart",ecosystem:"pub",label:"Dart pub",manifests:["pubspec.yaml"],lockfiles:["pubspec.lock"],outdated:{command:"dart",args:["pub","outdated"]},install:{command:"dart",args:["pub","get"]},upgrade:({name:e,version:t,kind:n})=>({command:"dart",args:["pub","add",...n==="dev"?["dev:"]:[],`${e}:${t}`]})},{id:"swiftpm",ecosystem:"swift",label:"Swift Package Manager",manifests:["Package.swift"],lockfiles:["Package.resolved"],outdated:null,upgrade:()=>null},{id:"cocoapods",batchable:!0,ecosystem:"cocoapods",label:"CocoaPods",manifests:["Podfile"],lockfiles:["Podfile.lock"],outdated:{command:"pod",args:["outdated"]},install:{command:"pod",args:["install"]},upgrade:({name:e})=>({command:"pod",args:["update",e]}),rewriteManifest:(e,{name:t,version:n})=>Wke(e,t,n)},{id:"opam",batchable:!0,ecosystem:"opam",label:"opam",manifests:["dune-project"],manifestPattern:/\.opam$/,lockfiles:[],outdated:null,upgrade:({name:e,version:t})=>({command:"opam",args:["install",`${e}.${t}`,"--yes"]})},{id:"conan",batchable:!0,ecosystem:"conan",label:"Conan",manifests:["conanfile.txt","conanfile.py"],lockfiles:["conan.lock"],outdated:null,upgrade:()=>({command:"conan",args:["install",".","--build=missing"]}),rewriteManifest:(e,{name:t,version:n})=>Kke(e,t,n)},{id:"vcpkg",batchable:!0,ecosystem:"vcpkg",label:"vcpkg",manifests:["vcpkg.json"],lockfiles:[],outdated:null,upgrade:()=>({command:"vcpkg",args:["install"]}),rewriteManifest:(e,{name:t,version:n})=>Hke(e,t,n)},{id:"arduino-cli",batchable:!0,ecosystem:"arduino",label:"Arduino CLI",manifests:["library.properties"],lockfiles:[],outdated:{command:"arduino-cli",args:["lib","upgrade","--dry-run"]},upgrade:({name:e,version:t})=>({command:"arduino-cli",args:["lib","install",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Jke(e,t,n)},{id:"platformio",ecosystem:"arduino",label:"PlatformIO",manifests:["platformio.ini"],lockfiles:[],outdated:{command:"pio",args:["pkg","outdated"]},upgrade:({name:e,version:t})=>({command:"pio",args:["pkg","install","--library",`${e}@${t}`]}),rewriteManifest:(e,{name:t,version:n})=>Zke(e,t,n)}];function la(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`^([ \\t]*${i})(\\[[^\\]]*\\])?[ \\t]*(?:[=<>!~]=?\\s*[^\\s;#,]+(?:\\s*,\\s*[=<>!~]=?\\s*[^\\s;#,]+)*)?`,"im");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${a??""}==${n}`):e}function Gke(e,t,n){let i=la(t).replace(/[-_.]/g,"[-_.]"),r=new RegExp(`(["'])${i}(\\[[^\\]]*\\])?(?:\\s*[=<>!~]=?\\s*[^"',;]+(?:\\s*,\\s*[=<>!~]=?\\s*[^"',;]+)*)?\\1`,"i");return r.test(e)?e.replace(r,(o,s,a)=>`${s}${t}${a??""}==${n}${s}`):e}function Vke(e,t,n){let i=la(t),r=new RegExp(`(gem\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(gem\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function Bke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*:${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"== ${n}"`):e}function qke(e,t,n){let i=la(t),r=new RegExp(`(\\{\\s*${i}\\s*,\\s*)"[^"]*"`);return r.test(e)?e.replace(r,`$1"${n}"`):e}function Wke(e,t,n){let i=la(t),r=new RegExp(`(pod\\s+["']${i}["'])\\s*,\\s*["'][^"']*["']`);if(r.test(e))return e.replace(r,`$1, '${n}'`);let o=new RegExp(`(pod\\s+["']${i}["'])(?!\\s*,\\s*["'])`);return e.replace(o,`$1, '${n}'`)}function Kke(e,t,n){let i=la(t),r=new RegExp(`\\b${i}/[^\\s"'#@]+`,"g");return e.replace(r,`${t}/${n}`)}function Hke(e,t,n){let i;try{i=JSON.parse(e)}catch{return e}let r=Array.isArray(i.overrides)?i.overrides:[],o=r.find(s=>s.name===t);return o?o.version=n:r.push({name:t,version:n}),i.overrides=r,`${JSON.stringify(i,null,2)} +`}function Jke(e,t,n){return e.split(` `).map(i=>{let r=/^(\s*depends\s*=\s*)(.*)$/i.exec(i);if(!r)return i;let o=r[2].split(",").map(s=>s.replace(/\s*\([^)]*\)\s*$/,"").trim()!==t?s:` ${t} (${n})`);return`${r[1]}${o.join(",").replace(/^\s+/,"")}`}).join(` -`)}function Vke(e,t,n){let i=la(t),r=new RegExp(`^(\\s*)((?:[\\w.-]+/)?${i})(@[^\\s;#]*)?\\s*$`,"gm");return e.replace(r,(o,s,a)=>/^\s+/.test(s)?`${s}${a}@${n}`:o)}function Uc(e){return EP.find(t=>t.id===e)}var ua=EP;function iK(e,t){if(!e.batchable||t.length===0)return null;let n=new Map;for(let i of t){let r=e.upgrade(i);if(!r)return null;let o=Bke(e,i,r);if(o===void 0)return null;let s=o===null?r.args:r.args.filter((l,u)=>u!==o),a=`${r.command}\0${o}\0${s.join("\0")}`,c=n.get(a);if(c){o!==null&&c.specs.push(r.args[o]);continue}n.set(a,{command:r,at:o,specs:o===null?[]:[r.args[o]]})}return[...n.values()].map(({command:i,at:r,specs:o})=>r===null?i:{command:i.command,args:[...i.args.slice(0,r),...o,...i.args.slice(r+1)]})}function Bke(e,t,n){let i=e.upgrade({...t,name:qke,version:Wke});if(!i||i.command!==n.command||i.args.length!==n.args.length)return;let r=n.args.reduce((o,s,a)=>s===i.args[a]?o:[...o,a],[]);return r.length===0?null:r.length===1?r[0]:void 0}var qke="\0drift-probe",Wke="\0drift-probe-version";function da(e){let t=new Set(e.entries),n=[];for(let r of EP){let o=r.lockfiles.filter(a=>t.has(a)),s=[...r.manifests.filter(a=>t.has(a)),...r.manifestPattern?e.entries.filter(a=>r.manifestPattern.test(a)):[]];o.length===0&&s.length===0||Hke(r,e,t)&&n.push({manager:r,evidence:[...o,...s],fromLockfile:o.length>0})}let i=new Set(n.filter(r=>r.fromLockfile).map(r=>r.manager.ecosystem));return n.filter(r=>r.fromLockfile||!i.has(r.manager.ecosystem))}function Hke(e,t,n){if(e.id==="yarn"||e.id==="yarn-berry"){let i=n.has(".yarnrc.yml")||(t.read?.("yarn.lock")??"").includes("__metadata");return e.id==="yarn-berry"?i:!i}if(e.id==="dart"||e.id==="flutter"){let i=t.read?.("pubspec.yaml")??"",r=/^\s*(flutter|flutter_test)\s*:/m.test(i)||/sdk:\s*flutter/.test(i);return e.id==="flutter"?r:!r}return!0}function oK(e){let t=new Map;for(let n of e){let i=t.get(n.manager.ecosystem)??[];i.push(n),t.set(n.manager.ecosystem,i)}return[...t.entries()].filter(([,n])=>n.length>1).map(([n,i])=>({ecosystem:n,candidates:i}))}function sK(e){return[e.command,...e.args].join(" ")}var pa=require("node:fs/promises"),jc=require("node:path");var IP=new Set([".git",".hg",".svn","node_modules","vendor","bower_components",".venv","venv","env","__pycache__",".tox","site-packages","target","build","dist","out",".next",".nuxt",".svelte-kit","coverage",".pytest_cache",".mypy_cache",".gradle",".idea",".vscode",".terraform","Pods","DerivedData",".pio","third_party","thirdparty","cmake-build-debug","cmake-build-release"]),Kke=new Set(["package.json",".nvmrc",".node-version",".ruby-version",".python-version",".tool-versions","dockerfile","containerfile","go.mod","gemfile","pom.xml","build.gradle","build.gradle.kts","cargo.toml","rust-toolchain","rust-toolchain.toml","pyproject.toml","setup.py","setup.cfg","runtime.txt",".ruby-gemset"]);function AP(e){let t=(e.split("/").pop()??"").toLowerCase();return Kke.has(t)||t.startsWith("dockerfile")||t.startsWith("containerfile")||t.endsWith(".gemspec")?!0:/^\.github\/workflows\/.+\.ya?ml$/.test(e)||/^\.(gitlab-ci|circleci)/.test(e)}var Jke={".ts":"typescript",".tsx":"typescript",".mts":"typescript",".cts":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".go":"go",".rs":"rust",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".c++":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".h++":"cpp",".inl":"cpp",".tpp":"cpp",".ino":"cpp",".pde":"cpp",".java":"java",".kt":"java",".kts":"java",".scala":"java",".rb":"ruby",".rake":"ruby",".cs":"dotnet",".fs":"dotnet",".vb":"dotnet",".php":"php",".ex":"elixir",".exs":"elixir",".erl":"erlang",".dart":"dart",".swift":"swift",".ml":"ocaml",".mli":"ocaml"},aK=64*1024,Zke=2e3,Yke=["@generated","do not edit","do not modify","auto-generated","autogenerated","generated by","webpackbootstrap","sourcemappingurl"];async function Qke(e){let t;try{let r=await(0,pa.open)(e,"r");try{let o=Buffer.alloc(aK),{bytesRead:s}=await r.read(o,0,aK,0);t=o.subarray(0,s).toString("utf8")}finally{await r.close()}}catch{return!1}let n=t.slice(0,4e3).toLowerCase();if(Yke.some(r=>n.includes(r)))return!0;let i=t.split(` -`);return i.length===1?!0:i.slice(0,-1).some(r=>r.length>Zke)}function cK(e){let t=e.lastIndexOf(".");return t===-1?"other":Jke[e.slice(t).toLowerCase()]??"other"}async function Ad(e,t={}){let{maxFileBytes:n=512*1024,maxFiles:i=5e3,extraIgnores:r=[],members:o}=t,s=new Set([...IP,...r]),a=async _=>{let S;try{S=await Xke.run(()=>(0,pa.readdir)(_,{withFileTypes:!0}))}catch{return[]}let x=[];for(let E of S){let T=(0,jc.join)(_,E.name);if(E.isDirectory()){if(s.has(E.name)||E.name.startsWith(".")&&E.name!==".github"&&E.name!==".circleci")continue;x.push(a(T));continue}if(!E.isFile())continue;let A=t$e((0,jc.relative)(e,T)),L=AP(A)?"config":cK(E.name);L!=="other"&&(/\.min\.(js|ts)$/.test(E.name)||/\.d\.ts\.map$/.test(E.name)||x.push([{full:T,repoPath:A,language:L}]))}return(await Promise.all(x)).flat()},c=await a(e),l=c.filter(_=>_.language==="config"),u=c.filter(_=>_.language!=="config"),d=[],p=0,f=0,m=0,g=async _=>{let S=await qn(_,e$e,async x=>{try{return(await(0,pa.stat)(x.full)).size>n?(await Qke(x.full)?f+=1:m+=1,null):await(0,pa.readFile)(x.full,"utf8")}catch{return null}});for(let[x,E]of S.entries()){if(E===null)continue;let T=_[x];d.push({path:T.repoPath,language:T.language,content:E,lineCount:n$e(E),...o?{member:Fc(T.repoPath,o)}:{}})}};await g(l);let h=0;for(;h_.path.localeCompare(S.path)),y=h+f===u.length,w=d.filter(_=>_.language==="config").length,k={localizationRan:!0,localizationComplete:y,sourceFilesDiscovered:u.length,sourceFilesIndexed:h,sourceTruncated:!y,generatedFilesSkipped:f,oversizedSourceSkipped:m,runtimeConfigsDiscovered:l.length,runtimeConfigsIndexed:w,runtimeConfigComplete:l.length===w};return Object.defineProperty(b,"coverage",{value:k,enumerable:!1}),b}var TP=class{constructor(t){this.limit=t}limit;active=0;waiting=[];async run(t){this.active>=this.limit&&await new Promise(n=>this.waiting.push(n)),this.active+=1;try{return await t()}finally{this.active-=1,this.waiting.shift()?.()}}},Xke=new TP(64),e$e=16;function t$e(e){return jc.sep==="/"?e:e.split(jc.sep).join("/")}function n$e(e){let t=1;for(let n=0;ne.manifests)),RP=new Map;for(let e of ua)for(let t of e.manifests)RP.has(t)||RP.set(t,e.ecosystem);function lK(e){let t=RP.get(e);if(t)return t;for(let n of ua){let i=n.manifestPattern;if(i&&(i.lastIndex=0,i.test(e)))return n.ecosystem}return null}async function Kk(e,t,n=[],i=8){let r=new Set(n),o=[],s=async(a,c)=>{if(c>i)return;let l=await t.readDirectory(Hk(e,a));if(l.length===0)return;let u=!1;if(a!==""&&!r.has(a)){u=l.includes(".git");let d=l.find(f=>r$e.has(f))??l.find(f=>lK(f)),p=d?lK(d):null;d&&p&&(u||!o$e(a))&&o.push({dir:a,ecosystem:p,manifestPath:Hk(a,d),hasOwnGit:u})}if(!u)for(let d of l){if(IP.has(d)||d.startsWith(".")&&d!==".github")continue;let p=Hk(a,d);r.has(p)||await t.isDirectory(Hk(e,p))&&await s(p,c+1)}};return await s("",0),o}var i$e=new Set(["fixtures","__fixtures__","testdata","registry"]);function o$e(e){let t=e.split("/").filter(Boolean).map(i=>i.toLowerCase()),n=t.findIndex(i=>i==="test"||i==="tests");return n===-1?!1:t.slice(n+1).some(i=>i$e.has(i))}function Hk(...e){return e.filter(Boolean).join("/")}var dK=require("node:crypto");function St(e,...t){let n=(0,dK.createHash)("sha256").update(t.map(i=>String(i??"")).join(" ")).digest("hex");return`${e}_${n.slice(0,10)}`}function zc(e){return e.workspace===void 0?e.name:`${e.workspace} ${e.name}`}function cn(e){return`${e.ecosystem} ${zc(e)}`}function NP(e){return JSON.stringify([e.ecosystem,e.name,e.from??null,e.to??null])}function uK(e){let t=0,n=e.length;for(;tt&&e.charCodeAt(n-1)===45;)n--;return e.slice(t,n)}function pK(e,t=40){let n=uK(e.toLowerCase().replace(/[^a-z0-9]+/g,"-"));return uK(n.slice(0,t))||"change"}var s$e=["CHANGELOG.md","CHANGELOG.markdown","CHANGELOG","CHANGES.md","Changes.md","HISTORY.md","NEWS.md","RELEASES.md","RELEASE-NOTES.md","RELEASE_NOTES.md","CHANGELOG.rst","CHANGES.rst","CHANGELOG.txt","docs/CHANGELOG.md","docs/changelog.md","changelog.md"],a$e=["MIGRATING.md","MIGRATION.md","UPGRADING.md","UPGRADE.md","docs/migration.md","docs/migrating.md","docs/upgrading.md","docs/MIGRATION.md","docs/UPGRADE.md"];async function hK(e,t=["main","master"]){return yK(e,s$e,t)}async function c$e(e,t=["main","master"]){return yK(e,a$e,t)}var fK=1,mK=16;function*l$e(e){if(e.length!==0){yield e.slice(0,fK);for(let t=fK;tt.map(o=>({branch:r,filename:o})));for(let r of l$e(i)){let o=await Promise.all(r.map(({branch:l,filename:u})=>rt(`https://raw.githubusercontent.com/${e}/${l}/${u}`,{retries:0}))),s=o.findIndex(l=>l!==null&&l.trim()!=="");if(s<0)continue;let{branch:a,filename:c}=r[s];return{path:c,url:`https://github.com/${e}/blob/${a}/${c}`,content:o[s],branch:a}}return null}function u$e(e,t="npm"){let n=[],i=new Set;for(let r of e.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)){let o=r[1],s=r[2];if(/^[a-z]+:/i.test(s)||s.startsWith("#")||!/\.(md|markdown|rst|txt)$/i.test(s))continue;let a=CP(o,t)??CP(s.replace(/[/\\]/g," "),t);if(!a)continue;let c=s.replace(/^\.?\//,"").split("#")[0];i.has(c)||(i.add(c),n.push({path:c,version:a}))}return n}async function bK(e,t,n,i="npm",r={}){let{branches:o=["main","master"],maxDocuments:s=12}=r,a=await hK(e,o);return a?wK(a,e,t,n,i,s):[]}async function vK(e,t,n,i,r="npm",o=12){let s=/^https?:\/\/github\.com\/([^/]+\/[^/]+)\/blob\/([^/]+)\/(.+)$/i.exec(e),a=s?`https://raw.githubusercontent.com/${s[1]}/${s[2]}/${s[3]}`:e,c=await rt(a,{retries:0});if(!c||!c.trim())return[];let l=decodeURIComponent(new URL(e).pathname.split("/").pop()||"changelog"),u=s?.[2]??"main",d=s?.[1]??t;s?.[3]&&(l=s[3]);let p={path:l,url:e,content:c,branch:u};return d?wK(p,d,n,i,r,o):[p]}async function wK(e,t,n,i,r,o){if(DP(PP(e.content,r),n,i,r).length>0)return[e];let s=u$e(e.content,r).filter(l=>d$e(l.version,n,i,r));if(s.length===0)return[e];let c=(await Promise.all([...s].sort((l,u)=>$K(u.version,l.version,r)).slice(0,o).map(async l=>{let u=await rt(`https://raw.githubusercontent.com/${t}/${e.branch}/${l.path}`,{retries:0});return!u||!u.trim()?null:{path:l.path,url:`https://github.com/${t}/blob/${e.branch}/${l.path}`,content:u,branch:e.branch}}))).filter(l=>l!==null);return c.length>0?c:[e]}async function kK(e,t=["main","master"]){let[n,i]=await Promise.all([c$e(e,t),hK(e,t)]),r=n?[n]:[];if(!i)return r;let o=[...i.content.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)].filter(([,s,a])=>gK.test(s)||gK.test(a)).map(([,,s])=>s.replace(/^\.?\//,"").split("#")[0]).filter(s=>/\.(md|markdown|rst|txt)$/i.test(s)&&!/^[a-z]+:/i.test(s));for(let s of[...new Set(o)].slice(0,4)){if(r.some(c=>c.path===s))continue;let a=await rt(`https://raw.githubusercontent.com/${e}/${i.branch}/${s}`,{retries:0});!a||!a.trim()||r.push({path:s,url:`https://github.com/${e}/blob/${i.branch}/${s}`,content:a,branch:i.branch})}return r}var gK=/migrat|upgrad/i;function d$e(e,t,n,i){let r=Te(t,i),o=Te(n,i),s=Te(e,i);if(!r||!o||!s)return!1;let a=Qe(o,r);if(a===null)return!1;let[c,l]=a>0?[r,o]:[o,r],u=Qe(s,c),d=Qe(s,l);return u!==null&&d!==null&&u>0&&d<=0}function PP(e,t="npm"){let n=[],i=e.split(` -`),r=null;for(let o=0;o/^\s+/.test(s)?`${s}${a}@${n}`:o)}function zc(e){return DP.find(t=>t.id===e)}var ua=DP;function uH(e,t){if(!e.batchable||t.length===0)return null;let n=new Map;for(let i of t){let r=e.upgrade(i);if(!r)return null;let o=Yke(e,i,r);if(o===void 0)return null;let s=o===null?r.args:r.args.filter((l,u)=>u!==o),a=`${r.command}\0${o}\0${s.join("\0")}`,c=n.get(a);if(c){o!==null&&c.specs.push(r.args[o]);continue}n.set(a,{command:r,at:o,specs:o===null?[]:[r.args[o]]})}return[...n.values()].map(({command:i,at:r,specs:o})=>r===null?i:{command:i.command,args:[...i.args.slice(0,r),...o,...i.args.slice(r+1)]})}function Yke(e,t,n){let i=e.upgrade({...t,name:Qke,version:Xke});if(!i||i.command!==n.command||i.args.length!==n.args.length)return;let r=n.args.reduce((o,s,a)=>s===i.args[a]?o:[...o,a],[]);return r.length===0?null:r.length===1?r[0]:void 0}var Qke="\0drift-probe",Xke="\0drift-probe-version";function da(e){let t=new Set(e.entries),n=[];for(let r of DP){let o=r.lockfiles.filter(a=>t.has(a)),s=[...r.manifests.filter(a=>t.has(a)),...r.manifestPattern?e.entries.filter(a=>r.manifestPattern.test(a)):[]];o.length===0&&s.length===0||e_e(r,e,t)&&n.push({manager:r,evidence:[...o,...s],fromLockfile:o.length>0})}let i=new Set(n.filter(r=>r.fromLockfile).map(r=>r.manager.ecosystem));return n.filter(r=>r.fromLockfile||!i.has(r.manager.ecosystem))}function e_e(e,t,n){if(e.id==="yarn"||e.id==="yarn-berry"){let i=n.has(".yarnrc.yml")||(t.read?.("yarn.lock")??"").includes("__metadata");return e.id==="yarn-berry"?i:!i}if(e.id==="dart"||e.id==="flutter"){let i=t.read?.("pubspec.yaml")??"",r=/^\s*(flutter|flutter_test)\s*:/m.test(i)||/sdk:\s*flutter/.test(i);return e.id==="flutter"?r:!r}return!0}function dH(e){let t=new Map;for(let n of e){let i=t.get(n.manager.ecosystem)??[];i.push(n),t.set(n.manager.ecosystem,i)}return[...t.entries()].filter(([,n])=>n.length>1).map(([n,i])=>({ecosystem:n,candidates:i}))}function pH(e){return[e.command,...e.args].join(" ")}var pa=require("node:fs/promises"),Gc=require("node:path");var MP=new Set([".git",".hg",".svn","node_modules","vendor","bower_components",".venv","venv","env","__pycache__",".tox","site-packages","target","build","dist","out",".next",".nuxt",".svelte-kit","coverage",".pytest_cache",".mypy_cache",".gradle",".idea",".vscode",".terraform","Pods","DerivedData",".pio","third_party","thirdparty","cmake-build-debug","cmake-build-release"]),t_e=new Set(["package.json",".nvmrc",".node-version",".ruby-version",".python-version",".tool-versions","dockerfile","containerfile","go.mod","gemfile","pom.xml","build.gradle","build.gradle.kts","cargo.toml","rust-toolchain","rust-toolchain.toml","pyproject.toml","setup.py","setup.cfg","runtime.txt",".ruby-gemset"]);function LP(e){let t=(e.split("/").pop()??"").toLowerCase();return t_e.has(t)||t.startsWith("dockerfile")||t.startsWith("containerfile")||t.endsWith(".gemspec")?!0:/^\.github\/workflows\/.+\.ya?ml$/.test(e)||/^\.(gitlab-ci|circleci)/.test(e)}var n_e={".ts":"typescript",".tsx":"typescript",".mts":"typescript",".cts":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".go":"go",".rs":"rust",".c":"c",".h":"c",".cpp":"cpp",".cc":"cpp",".cxx":"cpp",".c++":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".h++":"cpp",".inl":"cpp",".tpp":"cpp",".ino":"cpp",".pde":"cpp",".java":"java",".kt":"java",".kts":"java",".scala":"java",".rb":"ruby",".rake":"ruby",".cs":"dotnet",".fs":"dotnet",".vb":"dotnet",".php":"php",".ex":"elixir",".exs":"elixir",".erl":"erlang",".dart":"dart",".swift":"swift",".ml":"ocaml",".mli":"ocaml"},fH=64*1024,r_e=2e3,i_e=["@generated","do not edit","do not modify","auto-generated","autogenerated","generated by","webpackbootstrap","sourcemappingurl"];async function o_e(e){let t;try{let r=await(0,pa.open)(e,"r");try{let o=Buffer.alloc(fH),{bytesRead:s}=await r.read(o,0,fH,0);t=o.subarray(0,s).toString("utf8")}finally{await r.close()}}catch{return!1}let n=t.slice(0,4e3).toLowerCase();if(i_e.some(r=>n.includes(r)))return!0;let i=t.split(` +`);return i.length===1?!0:i.slice(0,-1).some(r=>r.length>r_e)}function mH(e){let t=e.lastIndexOf(".");return t===-1?"other":n_e[e.slice(t).toLowerCase()]??"other"}async function Rd(e,t={}){let{maxFileBytes:n=512*1024,maxFiles:i=5e3,extraIgnores:r=[],members:o}=t,s=new Set([...MP,...r]),a=async $=>{let S;try{S=await s_e.run(()=>(0,pa.readdir)($,{withFileTypes:!0}))}catch{return[]}let x=[];for(let E of S){let T=(0,Gc.join)($,E.name);if(E.isDirectory()){if(s.has(E.name)||E.name.startsWith(".")&&E.name!==".github"&&E.name!==".circleci")continue;x.push(a(T));continue}if(!E.isFile())continue;let A=c_e((0,Gc.relative)(e,T)),L=LP(A)?"config":mH(E.name);L!=="other"&&(/\.min\.(js|ts)$/.test(E.name)||/\.d\.ts\.map$/.test(E.name)||x.push([{full:T,repoPath:A,language:L}]))}return(await Promise.all(x)).flat()},c=await a(e),l=c.filter($=>$.language==="config"),u=c.filter($=>$.language!=="config"),d=[],p=0,f=0,m=0,g=async $=>{let S=await Bn($,a_e,async x=>{try{return(await(0,pa.stat)(x.full)).size>n?(await o_e(x.full)?f+=1:m+=1,null):await(0,pa.readFile)(x.full,"utf8")}catch{return null}});for(let[x,E]of S.entries()){if(E===null)continue;let T=$[x];d.push({path:T.repoPath,language:T.language,content:E,lineCount:l_e(E),...o?{member:jc(T.repoPath,o)}:{}})}};await g(l);let h=0;for(;h$.path.localeCompare(S.path)),y=h+f===u.length,w=d.filter($=>$.language==="config").length,k={localizationRan:!0,localizationComplete:y,sourceFilesDiscovered:u.length,sourceFilesIndexed:h,sourceTruncated:!y,generatedFilesSkipped:f,oversizedSourceSkipped:m,runtimeConfigsDiscovered:l.length,runtimeConfigsIndexed:w,runtimeConfigComplete:l.length===w};return Object.defineProperty(b,"coverage",{value:k,enumerable:!1}),b}var OP=class{constructor(t){this.limit=t}limit;active=0;waiting=[];async run(t){this.active>=this.limit&&await new Promise(n=>this.waiting.push(n)),this.active+=1;try{return await t()}finally{this.active-=1,this.waiting.shift()?.()}}},s_e=new OP(64),a_e=16;function c_e(e){return Gc.sep==="/"?e:e.split(Gc.sep).join("/")}function l_e(e){let t=1;for(let n=0;ne.manifests)),FP=new Map;for(let e of ua)for(let t of e.manifests)FP.has(t)||FP.set(t,e.ecosystem);function gH(e){let t=FP.get(e);if(t)return t;for(let n of ua){let i=n.manifestPattern;if(i&&(i.lastIndex=0,i.test(e)))return n.ecosystem}return null}async function t_(e,t,n=[],i=8){let r=new Set(n),o=[],s=async(a,c)=>{if(c>i)return;let l=await t.readDirectory(e_(e,a));if(l.length===0)return;let u=!1;if(a!==""&&!r.has(a)){u=l.includes(".git");let d=l.find(f=>u_e.has(f))??l.find(f=>gH(f)),p=d?gH(d):null;d&&p&&(u||!p_e(a))&&o.push({dir:a,ecosystem:p,manifestPath:e_(a,d),hasOwnGit:u})}if(!u)for(let d of l){if(MP.has(d)||d.startsWith(".")&&d!==".github")continue;let p=e_(a,d);r.has(p)||await t.isDirectory(e_(e,p))&&await s(p,c+1)}};return await s("",0),o}var d_e=new Set(["fixtures","__fixtures__","testdata","registry"]);function p_e(e){let t=e.split("/").filter(Boolean).map(i=>i.toLowerCase()),n=t.findIndex(i=>i==="test"||i==="tests");return n===-1?!1:t.slice(n+1).some(i=>d_e.has(i))}function e_(...e){return e.filter(Boolean).join("/")}var yH=require("node:crypto");function St(e,...t){let n=(0,yH.createHash)("sha256").update(t.map(i=>String(i??"")).join(" ")).digest("hex");return`${e}_${n.slice(0,10)}`}function Vc(e){return e.workspace===void 0?e.name:`${e.workspace} ${e.name}`}function an(e){return`${e.ecosystem} ${Vc(e)}`}function UP(e){return JSON.stringify([e.ecosystem,e.name,e.from??null,e.to??null])}function hH(e){let t=0,n=e.length;for(;tt&&e.charCodeAt(n-1)===45;)n--;return e.slice(t,n)}function bH(e,t=40){let n=hH(e.toLowerCase().replace(/[^a-z0-9]+/g,"-"));return hH(n.slice(0,t))||"change"}var f_e=["CHANGELOG.md","CHANGELOG.markdown","CHANGELOG","CHANGES.md","Changes.md","HISTORY.md","NEWS.md","RELEASES.md","RELEASE-NOTES.md","RELEASE_NOTES.md","CHANGELOG.rst","CHANGES.rst","CHANGELOG.txt","docs/CHANGELOG.md","docs/changelog.md","changelog.md"],m_e=["MIGRATING.md","MIGRATION.md","UPGRADING.md","UPGRADE.md","docs/migration.md","docs/migrating.md","docs/upgrading.md","docs/MIGRATION.md","docs/UPGRADE.md"];async function _H(e,t=["main","master"]){return $H(e,f_e,t)}async function g_e(e,t=["main","master"]){return $H(e,m_e,t)}var vH=1,wH=16;function*h_e(e){if(e.length!==0){yield e.slice(0,vH);for(let t=vH;tt.map(o=>({branch:r,filename:o})));for(let r of h_e(i)){let o=await Promise.all(r.map(({branch:l,filename:u})=>rt(`https://raw.githubusercontent.com/${e}/${l}/${u}`,{retries:0}))),s=o.findIndex(l=>l!==null&&l.trim()!=="");if(s<0)continue;let{branch:a,filename:c}=r[s];return{path:c,url:`https://github.com/${e}/blob/${a}/${c}`,content:o[s],branch:a}}return null}function y_e(e,t="npm"){let n=[],i=new Set;for(let r of e.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)){let o=r[1],s=r[2];if(/^[a-z]+:/i.test(s)||s.startsWith("#")||!/\.(md|markdown|rst|txt)$/i.test(s))continue;let a=jP(o,t)??jP(s.replace(/[/\\]/g," "),t);if(!a)continue;let c=s.replace(/^\.?\//,"").split("#")[0];i.has(c)||(i.add(c),n.push({path:c,version:a}))}return n}async function SH(e,t,n,i="npm",r={}){let{branches:o=["main","master"],maxDocuments:s=12}=r,a=await _H(e,o);return a?EH(a,e,t,n,i,s):[]}async function xH(e,t,n,i,r="npm",o=12){let s=/^https?:\/\/github\.com\/([^/]+\/[^/]+)\/blob\/([^/]+)\/(.+)$/i.exec(e),a=s?`https://raw.githubusercontent.com/${s[1]}/${s[2]}/${s[3]}`:e,c=await rt(a,{retries:0});if(!c||!c.trim())return[];let l=decodeURIComponent(new URL(e).pathname.split("/").pop()||"changelog"),u=s?.[2]??"main",d=s?.[1]??t;s?.[3]&&(l=s[3]);let p={path:l,url:e,content:c,branch:u};return d?EH(p,d,n,i,r,o):[p]}async function EH(e,t,n,i,r,o){if(GP(zP(e.content,r),n,i,r).length>0)return[e];let s=y_e(e.content,r).filter(l=>b_e(l.version,n,i,r));if(s.length===0)return[e];let c=(await Promise.all([...s].sort((l,u)=>IH(u.version,l.version,r)).slice(0,o).map(async l=>{let u=await rt(`https://raw.githubusercontent.com/${t}/${e.branch}/${l.path}`,{retries:0});return!u||!u.trim()?null:{path:l.path,url:`https://github.com/${t}/blob/${e.branch}/${l.path}`,content:u,branch:e.branch}}))).filter(l=>l!==null);return c.length>0?c:[e]}async function TH(e,t=["main","master"]){let[n,i]=await Promise.all([g_e(e,t),_H(e,t)]),r=n?[n]:[];if(!i)return r;let o=[...i.content.matchAll(/\[([^\]]+)\]\(([^)\s]+)\)/g)].filter(([,s,a])=>kH.test(s)||kH.test(a)).map(([,,s])=>s.replace(/^\.?\//,"").split("#")[0]).filter(s=>/\.(md|markdown|rst|txt)$/i.test(s)&&!/^[a-z]+:/i.test(s));for(let s of[...new Set(o)].slice(0,4)){if(r.some(c=>c.path===s))continue;let a=await rt(`https://raw.githubusercontent.com/${e}/${i.branch}/${s}`,{retries:0});!a||!a.trim()||r.push({path:s,url:`https://github.com/${e}/blob/${i.branch}/${s}`,content:a,branch:i.branch})}return r}var kH=/migrat|upgrad/i;function b_e(e,t,n,i){let r=Te(t,i),o=Te(n,i),s=Te(e,i);if(!r||!o||!s)return!1;let a=Qe(o,r);if(a===null)return!1;let[c,l]=a>0?[r,o]:[o,r],u=Qe(s,c),d=Qe(s,l);return u!==null&&d!==null&&u>0&&d<=0}function zP(e,t="npm"){let n=[],i=e.split(` +`),r=null;for(let o=0;o0?[r,o]:[o,r];return e.filter(l=>{let u=Te(l.version,i);if(!u)return!1;let d=Qe(u,a),p=Qe(u,c);return d!==null&&p!==null&&d>0&&p<=0}).sort((l,u)=>$K(u.version,l.version,i))}function $K(e,t,n){let i=Te(e,n),r=Te(t,n);return i&&r?Qe(i,r)??0:0}function Fg(e){let t=[],n=e.split(` -`),i=!1,r=0;for(let o of n){let s=/^(#{1,6})\s(.*)$/.exec(o);if(s){let c=s[1].length,l=s[2].trimStart();if(f$e.test(l)){i=!0,r=c,t.push(o.trim());continue}i&&c<=r&&(i=!1)}let a=o.trim();if(a){if(i){t.push(a);continue}g$e(a)&&t.push(a)}}return h$e(t)}var p$e=/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b|\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,f$e=/breaking|incompatib|removed|migration|upgrade\s+guide|deprecat|commonjs/i,m$e=/\b(BREAKING(\s+CHANGE)?|breaking change|no longer|has been removed|have been removed|was removed|were removed|is removed|renamed to|renamed from|replaced by|replaced with|now requires?|required\s+node|must now|dropped support|drop support|removed support|is now required|are now required|moved to|deprecated in favou?r of|minimum\s+(?:supported\s+)?(?:node|python|go|ruby|java|rust))\b/i;function g$e(e){return m$e.test(e)||p$e.test(e)}function h$e(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}async function _K(e,t,n,i,r={}){let{token:o,maxReleases:s=25}=r,a={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};o&&(a.Authorization=`Bearer ${o}`);let c=Te(t,i),l=Te(n,i);if(!c||!l)return[];let u=Qe(l,c);if(u===null)return[];let[d,p]=u>0?[c,l]:[l,c],f=[],m=100,g=5;for(let h=1;h<=g;h++){let b=await $e(`https://api.github.com/repos/${e}/releases?per_page=${m}&page=${h}`,{headers:a});if(!b||b.length===0)break;let y=!1;for(let w of b){if(w.draft)continue;let k=b$e(w.tag_name,i);if(!k)continue;let _=Qe(k,d),S=Qe(k,p);if(!(_===null||S===null)){if(_<=0){y=!0;continue}S>0||f.push({tag:w.tag_name,version:k.raw,name:w.name,body:w.body??"",url:w.html_url,publishedAt:w.published_at})}}if(y||b.lengthTe(a.version,n),r=[...e].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0});if(r.length<=t)return r;let o=r.filter(a=>{let c=i(a);return!!(c?.release&&(c.release[2]??0)===0&&!c.prerelease)}).sort((a,c)=>{let l=i(a),u=i(c);return l&&u?Qe(l,u)??0:0}),s=new Map;for(let a of o){if(s.size>=t)break;s.set(a.version,a)}for(let a of r){if(s.size>=t)break;s.set(a.version,a)}return[...s.values()].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0})}function b$e(e,t){let n=Te(e,t);if(n)return n;let i=e.match(/v?\d[0-9A-Za-z.!+_-]*(?:\.[0-9A-Za-z!+_-]+)*/g)??[];for(let r of i){let o=Te(r,t)??(r.startsWith("v")?Te(r.slice(1),t):null);if(o)return o}return null}var z$=require("node:fs/promises"),c8=require("node:os"),l8=require("node:path");var SK=require("node:child_process");var v$e=18e4,w$e=32*1024*1024;function k$e(e,t){let n=e.slice(e.lastIndexOf("/")+1),i=t[0];return i&&!i.startsWith("-")?`${n} ${i}`:n}var Xe=(e,t,n={})=>new Promise(i=>{let r=k$e(e,t),o=Pg()?It("exec",r):null;o&&nt("exec.spawned");let s=Date.now(),a=(0,SK.execFile)(e,[...t],{cwd:n.cwd,timeout:n.timeoutMs??v$e,maxBuffer:n.maxBuffer??w$e,env:n.env??process.env,windowsHide:!0,encoding:"utf8",...n.signal?{signal:n.signal}:{}},(c,l,u)=>{if(o?.end({code:c?1:0}),!c){uP({label:r,durationMs:Date.now()-s,exitCode:0,stdoutBytes:l.length,stderrBytes:u.length}),i({code:0,stdout:l,stderr:u});return}let d=c,p=d.code==="ENOENT"?"not-found":d.killed||d.name==="AbortError"||d.code==="ABORT_ERR"?"timeout":"error";uP({label:r,durationMs:Date.now()-s,exitCode:typeof d.code=="number"?d.code:null,failure:p,stdoutBytes:(l??"").length,stderrBytes:(u??"").length}),i({code:typeof d.code=="number"?d.code:1,stdout:l??"",stderr:u??String(c.message??""),failure:p})});if(n.onOutput){let c=l=>{try{n.onOutput(String(l))}catch{}};a.stdout?.on("data",c),a.stderr?.on("data",c)}a.stdin?.end()});async function Jk(e,t,n=["--version"]){let i=await e(t,n,{timeoutMs:2e4});return i.failure!=="not-found"&&i.code===0}var AK=gt(gc(),1),OP="openapi-diff",LP={id:"openapi",source:"openapi-diff",tool:OP,weight:1,originClass:"computed-artifact",config:{enabled:"openapi",paths:"openapiSpecs"},handles(e,t){return Rd(t)!==null},async compute(e){return!Rd(e.before)||!Rd(e.after)?{available:!1,reason:"parse-failed",detail:`${e.path} is not a document Drift could read as an OpenAPI or Swagger spec on both sides of this change.`,tool:OP}:{available:!0,changes:RK(e.before,e.after).map(t=>({code:t.kind,location:t.location,pointer:t.pointer,detail:t.detail})),tool:OP,weight:1,locator:e.path}},codes:{"path-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"operation-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"response-status-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this success status. Update response handling so the removed status is no longer treated as a success path.`},"parameter-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`A required parameter was removed from \`${e}\`. Remove it from client calls; sending it may now be rejected as an unexpected parameter.`},"parameter-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"parameter-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-now-required":{kind:"required-field-added",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"request-enum-narrowed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer accepts some previously-valid values. Find code that sends the removed values and map them onto still-supported ones.`},"response-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this field. Update every reader of that field. If the value is genuinely no longer available, propagate the absence properly rather than substituting a placeholder that could be mistaken for real data.`},"response-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The response type for \`${e}\` changed. Update parsing and any downstream type declarations.`},"response-enum-widened":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` can now return values this code has never seen. Add explicit handling; make sure exhaustive switches and mapping tables have a safe default rather than falling through silently.`},"security-added":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires authentication. Ensure the client attaches credentials for this call, reusing the repo's existing auth mechanism \u2014 never introduce a new credential source or hard-code a token.`}}},$$e=["get","put","post","delete","options","head","patch","trace"];function Rd(e){let t;try{t=e.trim().startsWith("{")?JSON.parse(e):(0,AK.parse)(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t;return!n.openapi&&!n.swagger?null:n}function RK(e,t){let n=Rd(e),i=Rd(t);if(!n||!i)return[];let r=[],o=n.paths??{},s=i.paths??{};for(let[a,c]of Object.entries(o)){let l=s[a];if(!l){r.push({kind:"path-removed",location:a,pointer:`#/paths/${IK(a)}`,detail:`Path \`${a}\` no longer exists. Every request to it will 404.`});continue}for(let u of $$e){let d=c[u];if(!d)continue;let p=l[u],f=`${u.toUpperCase()} ${a}`,m=`#/paths/${IK(a)}/${u}`;if(!p){r.push({kind:"operation-removed",location:f,pointer:m,detail:`Operation \`${f}\` was removed.`});continue}_$e(d,p,n,i,f,m,r),S$e(d,p,n,i,f,m,r),x$e(d,p,n,i,f,m,r),E$e(d,p,f,m,r)}}return r}function _$e(e,t,n,i,r,o,s){let a=xK(e.parameters,n),c=xK(t.parameters,i);for(let[l,u]of a){let d=c.get(l);if(!d){u.required&&s.push({kind:"parameter-removed",location:r,pointer:`${o}/parameters/${l}`,detail:`Required parameter \`${u.name}\` (in: ${u.in}) was removed.`});continue}!u.required&&d.required&&s.push({kind:"parameter-now-required",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` (in: ${d.in}) is now required. Calls omitting it will be rejected.`});let p=Yk(u.schema??{type:u.type}),f=Yk(d.schema??{type:d.type});p&&f&&p!==f&&s.push({kind:"parameter-type-changed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` changed type from \`${p}\` to \`${f}\`.`});let m=Qk(u.schema),g=Qk(d.schema),h=m.filter(b=>!g.includes(b));m.length&&g.length&&h.length&&s.push({kind:"request-enum-narrowed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` no longer accepts: ${h.map(b=>`\`${b}\``).join(", ")}.`})}}function S$e(e,t,n,i,r,o,s){let a=fa(EK(e),n),c=fa(EK(t),i);if(!a||!c)return;let l=new Set(TK(a)),u=TK(c);for(let d of u)l.has(d)||s.push({kind:"request-field-now-required",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` is now required.`});for(let[d,p,f]of NK(a,c,n,i))s.push({kind:"request-field-type-changed",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` changed type from \`${p}\` to \`${f}\`.`})}function x$e(e,t,n,i,r,o,s){let a=e.responses??{},c=t.responses??{};for(let[l,u]of Object.entries(a)){if(!/^2\d\d$/.test(l))continue;let d=c[l];if(!d){s.push({kind:"response-status-removed",location:r,pointer:`${o}/responses/${l}`,detail:`Success response \`${l}\` was removed from \`${r}\`.`});continue}let p=fa(MP(u),n),f=fa(MP(d),i);if(!p||!f)continue;let m=Zk(p),g=Zk(f);for(let h of Object.keys(m))h in g||s.push({kind:"response-field-removed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` is no longer returned by \`${r}\`.`});for(let[h,b,y]of NK(p,f,n,i))s.push({kind:"response-field-type-changed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` changed type from \`${b}\` to \`${y}\`.`});for(let[h,b]of Object.entries(m)){let y=g[h];if(!y)continue;let w=Qk(b),_=Qk(y).filter(S=>!w.includes(S));w.length&&_.length&&s.push({kind:"response-enum-widened",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` can now return new values: ${_.map(S=>`\`${S}\``).join(", ")}. Exhaustive handling of this field must be updated.`})}}}function E$e(e,t,n,i,r){let o=e.security??[],s=t.security??[],a=o.length===0||o.some(l=>Object.keys(l).length===0),c=s.length===0||s.some(l=>Object.keys(l).length===0);if(a&&!c&&s.length>0){let l=[...new Set(s.flatMap(u=>Object.keys(u)))];r.push({kind:"security-added",location:n,pointer:`${i}/security`,detail:`\`${n}\` now requires authentication (${l.join(", ")}).`})}}function xK(e,t){let n=new Map;if(!Array.isArray(e))return n;for(let i of e){let r=fa(i,t);r?.name&&n.set(`${r.in??"query"}:${r.name}`,r)}return n}function EK(e){let t=e.requestBody;return t?MP(t):null}function MP(e){let t=e.content;if(!t)return e.schema??null;let n=Object.keys(t).find(i=>i.includes("json"))??Object.keys(t)[0];return n?t[n]?.schema??null:null}function fa(e,t,n=0){if(!e)return null;if(n>10)return e;let i=e.$ref;if(typeof i!="string")return e;if(!i.startsWith("#/"))return null;let r=i.slice(2).split("/").map(T$e),o=t;for(let s of r){if(!o||typeof o!="object")return null;o=o[s]}return!o||typeof o!="object"?null:fa(o,t,n+1)}function Zk(e){let t=e.properties??{},n=e.allOf;if(!Array.isArray(n))return t;let i={...t};for(let r of n)r&&typeof r=="object"&&Object.assign(i,r.properties??{});return i}function TK(e){let t=Array.isArray(e.required)?e.required:[],i=(Array.isArray(e.allOf)?e.allOf:[]).flatMap(r=>{let o=r?.required;return Array.isArray(o)?o:[]});return[...new Set([...t,...i])]}function NK(e,t,n,i){let r=[],o=Zk(e),s=Zk(t);for(let[a,c]of Object.entries(o)){let l=s[a];if(!l)continue;let u=Yk(fa(c,n)),d=Yk(fa(l,i));u&&d&&u!==d&&r.push([a,u,d])}return r}function Yk(e){if(!e)return null;let t=e.type;if(typeof t=="string"){if(t==="array"){let n=e.items;return`array<${typeof n?.type=="string"?n.type:"unknown"}>`}return t}return Array.isArray(t)?t.join("|"):null}function Qk(e){let t=e?.enum;return Array.isArray(t)?t.map(n=>String(n)):[]}function IK(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function T$e(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var e$=require("node:fs/promises"),es=require("node:path");function ma(e,t,n,i){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},tool:e}}var Nd="buf breaking",I$e="Install the Buf CLI (https://buf.build/docs/installation) so Drift can compare `.proto` revisions against the protobuf compatibility rules.",CK="Add the imported `.proto` files to `evidence.protobufSpecs` \u2014 Drift compiles every configured `.proto` together, so an import it was told about resolves. A pattern such as `proto/**/*.proto` covers a whole directory of them.",A$e=100,FP={id:"protobuf",source:"protobuf-diff",tool:Nd,weight:1,originClass:"computed-artifact",config:{enabled:"protobuf",paths:"protobufSpecs"},handles(e,t){return e.endsWith(".proto")?/^\s*(syntax\s*=|package\s+|message\s+|service\s+|enum\s+)/m.test(t):!1},async compute(e){let t=await e.exec("buf",["--version"],{timeoutMs:2e4,...e.env?{env:e.env}:{}});if(t.failure==="not-found"||t.code!==0)return ma(Nd,"tool-missing",`The Buf CLI is not installed or is not on PATH, so ${e.path} could not be checked against the protobuf compatibility rules.`,I$e);let n=(0,es.join)(e.workdir,"after"),i=(0,es.join)(e.workdir,"before");await Xk((0,es.join)(n,e.path),e.after),await Xk((0,es.join)(i,e.path),e.before);for(let a of e.siblings)a.path!==e.path&&(await Xk((0,es.join)(n,a.path),a.after),await Xk((0,es.join)(i,a.path),a.before));let r=await e.exec("buf",["breaking",n,"--against",i,"--error-format=json"],{cwd:e.workdir,timeoutMs:e.timeoutMs,...e.env?{env:e.env}:{}});if(r.code!==0&&r.code!==A$e){let a=(r.stderr||r.stdout||"no output").trim().split(` -`)[0]??"";return ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${a}`,CK)}let o;try{o=PK(r.stdout)}catch(a){return ma(Nd,"unexpected-output",`Drift could not read \`buf breaking\` output for ${e.path}: ${a.message}`)}let s=o.find(R$e);return s?ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${s.message}`,C$e(s)):{available:!0,changes:o.filter(a=>P$e(a,e.path)).map(a=>D$e(a,e.path)),tool:Nd,weight:1,locator:`${e.path} (buf breaking)`}},codes:{"proto-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` was deleted. Regenerate this repository's stubs and update every reader and writer of that field. Do not reuse its field number for anything else \u2014 reserve it \u2014 and if the value is genuinely gone, propagate the absence rather than substituting a placeholder that could be mistaken for real data.`},"proto-field-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` changed name. The wire encoding is unaffected \u2014 field numbers carry it \u2014 but generated accessors and any JSON representation are not. Regenerate the stubs and rename every use; check JSON payloads persisted or exchanged under the old name.`},"proto-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The type or cardinality of the protobuf field \`${e}\` changed. Regenerate the stubs and update every construction and read of that field. A value already persisted or in flight was encoded under the old type \u2014 check that decoding it still means what the code assumes.`},"proto-field-encoding-changed":{kind:"behaviour-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`An encoding option on the protobuf field \`${e}\` changed. Nothing about the schema's shape moved, so this compiles either way \u2014 what changes is the generated representation or the validation applied to the value. Review code that depends on that field's concrete representation.`},"proto-oneof-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf oneof \`${e}\` was deleted. Regenerate the stubs and rewrite every switch over its cases; a oneof's generated API has no drop-in replacement, so restructure the calling code rather than stubbing the accessor.`},"proto-message-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf message \`${e}\` no longer exists. Regenerate the stubs and migrate every use to the replacement message. If there is no replacement, leave the call site intact with a clearly-marked TODO and explain it in the PR description rather than inventing a local copy of the type.`},"proto-enum-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum \`${e}\` no longer exists. Regenerate the stubs and migrate every use to whatever now carries those values.`},"proto-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` was deleted. Regenerate the stubs and map every use onto a still-supported value. A peer that still sends the removed number will decode as the unknown/unrecognised case \u2014 make sure that path is handled rather than falling through silently.`},"proto-enum-value-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` changed name. The number is unchanged, so the wire encoding is safe; generated constants and JSON names are not. Regenerate the stubs and rename every use.`},"proto-rpc-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The RPC \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement RPC. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"proto-rpc-signature-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The signature of the RPC \`${e}\` changed \u2014 its request type, response type, or streaming shape. Regenerate the stubs and update every call site; a streaming change in particular rewrites the call's control flow, not just its types.`},"proto-service-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The service \`${e}\` no longer exists. Every client of it must be migrated to the replacement service; if there is none, leave the client intact with a clearly-marked TODO rather than deleting the feature.`},"proto-package-changed":{kind:"moved-export",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"package",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf package or a generated-code package option changed for \`${e}\`. The definitions still exist \u2014 their generated home moved. Regenerate the stubs and update the import paths; do not re-implement or stub the individual messages.`},"proto-file-removed":{kind:"removed-endpoint",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The \`.proto\` file \`${e}\` was deleted, taking everything it declared with it. Find where those definitions moved to and update the imports and generated-code references; if they were removed outright, say so in the PR description rather than recreating the file locally.`},"proto-contract-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e,detail:t})=>`\`buf\` reports a compatibility break at \`${e}\`: ${t} Regenerate this repository's stubs and update the code around that definition to match the new contract.`}}};async function Xk(e,t){await(0,e$.mkdir)((0,es.dirname)(e),{recursive:!0}),await(0,e$.writeFile)(e,t,"utf8")}function PK(e){let t=[];for(let n of e.split(` -`)){let i=n.trim();if(!i.startsWith("{"))continue;let r;try{r=JSON.parse(i)}catch{continue}if(!r||typeof r!="object")continue;let o=r;typeof o.type!="string"||typeof o.message!="string"||t.push({path:typeof o.path=="string"?o.path:"",type:o.type,message:o.message,...typeof o.start_line=="number"?{start_line:o.start_line}:{},...typeof o.start_column=="number"?{start_column:o.start_column}:{}})}return t}function R$e(e){return N$e.has(e.type)}var N$e=new Set(["COMPILE","PLUGIN_FAILURE","CONFIGURATION"]);function C$e(e){return e.type==="COMPILE"?CK:"Check the `buf` configuration and plugins in this repository, then re-run."}function P$e(e,t){return e.path===t||e.path.endsWith(`/${t}`)}function D$e(e,t){let n=e.start_line??0;return{code:DK(e.type),location:OK(e.message)??`${t}:${n}`,pointer:n>0?`${t}:${n}`:t,detail:e.message}}function DK(e){switch(e){case"FIELD_SAME_NAME":case"FIELD_SAME_JSON_NAME":return"proto-field-renamed";case"ENUM_VALUE_SAME_NAME":return"proto-enum-value-renamed";case"FIELD_SAME_TYPE":case"FIELD_SAME_LABEL":case"FIELD_SAME_CARDINALITY":case"FIELD_SAME_ONEOF":case"FIELD_WIRE_COMPATIBLE_TYPE":case"FIELD_WIRE_COMPATIBLE_CARDINALITY":case"FIELD_WIRE_JSON_COMPATIBLE_TYPE":case"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY":return"proto-field-type-changed";case"FIELD_SAME_CTYPE":case"FIELD_SAME_JSTYPE":case"FIELD_SAME_CPP_STRING_TYPE":case"FIELD_SAME_UTF8_VALIDATION":case"FIELD_SAME_JAVA_UTF8_VALIDATION":case"FIELD_SAME_DEFAULT":return"proto-field-encoding-changed";case"RPC_SAME_REQUEST_TYPE":case"RPC_SAME_RESPONSE_TYPE":case"RPC_SAME_CLIENT_STREAMING":case"RPC_SAME_SERVER_STREAMING":case"RPC_SAME_IDEMPOTENCY_LEVEL":return"proto-rpc-signature-changed";default:break}if(/^FILE_SAME_(GO|JAVA|PHP|RUBY|CSHARP|OBJC|SWIFT)_/.test(e)||e==="FILE_SAME_PACKAGE"||e==="PACKAGE_NO_DELETE")return"proto-package-changed";if(e==="FILE_NO_DELETE")return"proto-file-removed";if(e.endsWith("_NO_DELETE")||e.includes("_NO_DELETE_UNLESS_")){if(e.startsWith("FIELD_"))return"proto-field-removed";if(e.startsWith("ENUM_VALUE_"))return"proto-enum-value-removed";if(e.startsWith("ENUM_")||e.startsWith("PACKAGE_ENUM_"))return"proto-enum-removed";if(e.startsWith("ONEOF_"))return"proto-oneof-removed";if(e.startsWith("RPC_"))return"proto-rpc-removed";if(e.startsWith("SERVICE_")||e.startsWith("PACKAGE_SERVICE_"))return"proto-service-removed";if(e.startsWith("MESSAGE_")||e.startsWith("PACKAGE_MESSAGE_"))return"proto-message-removed"}return"proto-contract-changed"}function OK(e){let t=/\bon (?:message|service|enum|oneof|extension) "([^"]+)"/.exec(e)?.[1]??/\b(?:message|service|enum) "([^"]+)"/.exec(e)?.[1]??null,n=/\bwith name "([^"]+)"/.exec(e)?.[1]??/\bchanged name from "[^"]+" to "([^"]+)"/.exec(e)?.[1]??/\b(?:RPC|field|value|oneof) "([^"]+)"/i.exec(e)?.[1]??null,i=n&&!/^\d+$/.test(n)?n:null;return t&&i?`${t}.${i}`:t??i}function ce(e){return t$(e,[])}function t$(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return O$e(e,t);default:return String(e)}}function O$e(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(M$e(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:t$(i,n)}else if(Array.isArray(e))return F$e(e,n);return L$e(e,n)}function M$e(e){return typeof e.toJSON=="function"}function L$e(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+U$e(e)+"]":"{ "+n.map(([r,o])=>r+": "+t$(o,t)).join(", ")+" }"}function F$e(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function U$e(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function j$e(e,t){return e?.__kind===t}var Nr=j$e;function MK(e){return e instanceof Error?e:new UP(e)}var UP=class extends Error{constructor(t){super("Unexpected error value: "+ce(t)),this.name="NonErrorThrown",this.thrownValue=t}};function Kn(e){return typeof e=="object"&&e!==null}function it(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var z$e=/\r\n|[\n\r]/g;function Cd(e,t){let n=0,i=1;for(let r of e.body.matchAll(z$e)){if(typeof r.index!="number"&&it(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function jP(e){return n$(e.source,Cd(e.source,e.start))}function n$(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,c=t.column+a,l=`${e.name}:${s}:${c} -`,u=i.split(/\r\n|[\n\r]/g),d=u[r];if(d.length>120){let p=Math.floor(c/80),f=c%80,m=[];for(let g=0;g["|",g]),["|","^".padStart(f)],["|",m[p+1]]])}return l+LK([[`${s-1} |`,u[r-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,u[r+1]]])}function LK(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` -`)}var O=class e extends Error{constructor(t,n={}){let{nodes:i,source:r,positions:o,path:s,originalError:a,cause:c,extensions:l}=n,u="cause"in n,d=u?c:a,p=u||a!=null?{cause:d}:void 0;super(t,p),this.name="GraphQLError",this.path=s??void 0;let f=a??(c instanceof Error?c:void 0);this.originalError=f,this.nodes=FK(Array.isArray(i)?i:i?[i]:void 0);let m=FK(this.nodes?.map(h=>h.loc).filter(h=>h!=null));this.source=r??m?.[0]?.source,this.positions=o??m?.map(h=>h.start),this.locations=o&&r?o.map(h=>Cd(r,h)):m?.map(h=>Cd(h.source,h.start));let g=Kn(f?.extensions)?f.extensions:void 0;this.extensions=l??g??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),a?.stack!=null?Object.defineProperty(this,"stack",{value:a.stack,writable:!0,configurable:!0}):Error.captureStackTrace!=null?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` +`).trim(),line:r.line}),n}function jP(e,t){let i=e.replace(/\[([^\]]{0,300})\]\([^)]{0,2000}\)/g,"$1").match(/(?:\d+!)?v?\d+(?:\.\d+)+(?:[A-Za-z][0-9A-Za-z.-]*|[-+][\w.-]+)?/g)??[];for(let r of i){let o=Te(r,t);if(o)return o.raw;if(r.startsWith("v")){let s=Te(r.slice(1),t);if(s)return s.raw}}return null}function GP(e,t,n,i="npm"){let r=Te(t,i),o=Te(n,i);if(!r||!o)return[];let s=Qe(o,r);if(s===null)return[];let[a,c]=s>0?[r,o]:[o,r];return e.filter(l=>{let u=Te(l.version,i);if(!u)return!1;let d=Qe(u,a),p=Qe(u,c);return d!==null&&p!==null&&d>0&&p<=0}).sort((l,u)=>IH(u.version,l.version,i))}function IH(e,t,n){let i=Te(e,n),r=Te(t,n);return i&&r?Qe(i,r)??0:0}function qg(e){let t=[],n=e.split(` +`),i=!1,r=0;for(let o of n){let s=/^(#{1,6})\s(.*)$/.exec(o);if(s){let c=s[1].length,l=s[2].trimStart();if(w_e.test(l)){i=!0,r=c,t.push(o.trim());continue}i&&c<=r&&(i=!1)}let a=o.trim();if(a){if(i){t.push(a);continue}__e(a)&&t.push(a)}}return $_e(t)}var v_e=/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b|\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,w_e=/breaking|incompatib|removed|migration|upgrade\s+guide|deprecat|commonjs/i,k_e=/\b(BREAKING(\s+CHANGE)?|breaking change|no longer|has been removed|have been removed|was removed|were removed|is removed|renamed to|renamed from|replaced by|replaced with|now requires?|required\s+node|must now|dropped support|drop support|removed support|is now required|are now required|moved to|deprecated in favou?r of|minimum\s+(?:supported\s+)?(?:node|python|go|ruby|java|rust))\b/i;function __e(e){return k_e.test(e)||v_e.test(e)}function $_e(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}async function AH(e,t,n,i,r={}){let{token:o,maxReleases:s=25}=r,a={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};o&&(a.Authorization=`Bearer ${o}`);let c=Te(t,i),l=Te(n,i);if(!c||!l)return[];let u=Qe(l,c);if(u===null)return[];let[d,p]=u>0?[c,l]:[l,c],f=[],m=100,g=5;for(let h=1;h<=g;h++){let b=await _e(`https://api.github.com/repos/${e}/releases?per_page=${m}&page=${h}`,{headers:a});if(!b||b.length===0)break;let y=!1;for(let w of b){if(w.draft)continue;let k=x_e(w.tag_name,i);if(!k)continue;let $=Qe(k,d),S=Qe(k,p);if(!($===null||S===null)){if($<=0){y=!0;continue}S>0||f.push({tag:w.tag_name,version:k.raw,name:w.name,body:w.body??"",url:w.html_url,publishedAt:w.published_at})}}if(y||b.lengthTe(a.version,n),r=[...e].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0});if(r.length<=t)return r;let o=r.filter(a=>{let c=i(a);return!!(c?.release&&(c.release[2]??0)===0&&!c.prerelease)}).sort((a,c)=>{let l=i(a),u=i(c);return l&&u?Qe(l,u)??0:0}),s=new Map;for(let a of o){if(s.size>=t)break;s.set(a.version,a)}for(let a of r){if(s.size>=t)break;s.set(a.version,a)}return[...s.values()].sort((a,c)=>{let l=i(a),u=i(c);return l&&u?-(Qe(l,u)??0):0})}function x_e(e,t){let n=Te(e,t);if(n)return n;let i=e.match(/v?\d[0-9A-Za-z.!+_-]*(?:\.[0-9A-Za-z!+_-]+)*/g)??[];for(let r of i){let o=Te(r,t)??(r.startsWith("v")?Te(r.slice(1),t):null);if(o)return o}return null}var H_=require("node:fs/promises"),mY=require("node:os"),gY=require("node:path");var RH=require("node:child_process");var E_e=18e4,T_e=32*1024*1024;function I_e(e,t){let n=e.slice(e.lastIndexOf("/")+1),i=t[0];return i&&!i.startsWith("-")?`${n} ${i}`:n}var Xe=(e,t,n={})=>new Promise(i=>{let r=I_e(e,t),o=jg()?It("exec",r):null;o&&nt("exec.spawned");let s=Date.now(),a=(0,RH.execFile)(e,[...t],{cwd:n.cwd,timeout:n.timeoutMs??E_e,maxBuffer:n.maxBuffer??T_e,env:n.env??process.env,windowsHide:!0,encoding:"utf8",...n.signal?{signal:n.signal}:{}},(c,l,u)=>{if(o?.end({code:c?1:0}),!c){bP({label:r,durationMs:Date.now()-s,exitCode:0,stdoutBytes:l.length,stderrBytes:u.length}),i({code:0,stdout:l,stderr:u});return}let d=c,p=d.code==="ENOENT"?"not-found":d.killed||d.name==="AbortError"||d.code==="ABORT_ERR"?"timeout":"error";bP({label:r,durationMs:Date.now()-s,exitCode:typeof d.code=="number"?d.code:null,failure:p,stdoutBytes:(l??"").length,stderrBytes:(u??"").length}),i({code:typeof d.code=="number"?d.code:1,stdout:l??"",stderr:u??String(c.message??""),failure:p})});if(n.onOutput){let c=l=>{try{n.onOutput(String(l))}catch{}};a.stdout?.on("data",c),a.stderr?.on("data",c)}a.stdin?.end()});async function n_(e,t,n=["--version"]){let i=await e(t,n,{timeoutMs:2e4});return i.failure!=="not-found"&&i.code===0}var OH=gt(gc(),1),VP="openapi-diff",qP={id:"openapi",source:"openapi-diff",tool:VP,weight:1,originClass:"computed-artifact",config:{enabled:"openapi",paths:"openapiSpecs"},handles(e,t){return Cd(t)!==null},async compute(e){return!Cd(e.before)||!Cd(e.after)?{available:!1,reason:"parse-failed",detail:`${e.path} is not a document Drift could read as an OpenAPI or Swagger spec on both sides of this change.`,tool:VP}:{available:!0,changes:MH(e.before,e.after).map(t=>({code:t.kind,location:t.location,pointer:t.pointer,detail:t.detail})),tool:VP,weight:1,locator:e.path}},codes:{"path-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"operation-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The endpoint \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement endpoint. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"response-status-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this success status. Update response handling so the removed status is no longer treated as a success path.`},"parameter-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`A required parameter was removed from \`${e}\`. Remove it from client calls; sending it may now be rejected as an unexpected parameter.`},"parameter-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"parameter-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-now-required":{kind:"required-field-added",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires this field. Add it to every request built in this repo, using a value consistent with the surrounding code's intent.`},"request-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The request type for \`${e}\` changed. Update serialisation at each call site so the value sent matches the new type.`},"request-enum-narrowed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer accepts some previously-valid values. Find code that sends the removed values and map them onto still-supported ones.`},"response-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` no longer returns this field. Update every reader of that field. If the value is genuinely no longer available, propagate the absence properly rather than substituting a placeholder that could be mistaken for real data.`},"response-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The response type for \`${e}\` changed. Update parsing and any downstream type declarations.`},"response-enum-widened":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` can now return values this code has never seen. Add explicit handling; make sure exhaustive switches and mapping tables have a safe default rather than falling through silently.`},"security-added":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` now requires authentication. Ensure the client attaches credentials for this call, reusing the repo's existing auth mechanism \u2014 never introduce a new credential source or hard-code a token.`}}},A_e=["get","put","post","delete","options","head","patch","trace"];function Cd(e){let t;try{t=e.trim().startsWith("{")?JSON.parse(e):(0,OH.parse)(e)}catch{return null}if(!t||typeof t!="object")return null;let n=t;return!n.openapi&&!n.swagger?null:n}function MH(e,t){let n=Cd(e),i=Cd(t);if(!n||!i)return[];let r=[],o=n.paths??{},s=i.paths??{};for(let[a,c]of Object.entries(o)){let l=s[a];if(!l){r.push({kind:"path-removed",location:a,pointer:`#/paths/${DH(a)}`,detail:`Path \`${a}\` no longer exists. Every request to it will 404.`});continue}for(let u of A_e){let d=c[u];if(!d)continue;let p=l[u],f=`${u.toUpperCase()} ${a}`,m=`#/paths/${DH(a)}/${u}`;if(!p){r.push({kind:"operation-removed",location:f,pointer:m,detail:`Operation \`${f}\` was removed.`});continue}R_e(d,p,n,i,f,m,r),C_e(d,p,n,i,f,m,r),N_e(d,p,n,i,f,m,r),P_e(d,p,f,m,r)}}return r}function R_e(e,t,n,i,r,o,s){let a=CH(e.parameters,n),c=CH(t.parameters,i);for(let[l,u]of a){let d=c.get(l);if(!d){u.required&&s.push({kind:"parameter-removed",location:r,pointer:`${o}/parameters/${l}`,detail:`Required parameter \`${u.name}\` (in: ${u.in}) was removed.`});continue}!u.required&&d.required&&s.push({kind:"parameter-now-required",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` (in: ${d.in}) is now required. Calls omitting it will be rejected.`});let p=i_(u.schema??{type:u.type}),f=i_(d.schema??{type:d.type});p&&f&&p!==f&&s.push({kind:"parameter-type-changed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` changed type from \`${p}\` to \`${f}\`.`});let m=o_(u.schema),g=o_(d.schema),h=m.filter(b=>!g.includes(b));m.length&&g.length&&h.length&&s.push({kind:"request-enum-narrowed",location:r,pointer:`${o}/parameters/${l}`,detail:`Parameter \`${d.name}\` no longer accepts: ${h.map(b=>`\`${b}\``).join(", ")}.`})}}function C_e(e,t,n,i,r,o,s){let a=fa(NH(e),n),c=fa(NH(t),i);if(!a||!c)return;let l=new Set(PH(a)),u=PH(c);for(let d of u)l.has(d)||s.push({kind:"request-field-now-required",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` is now required.`});for(let[d,p,f]of LH(a,c,n,i))s.push({kind:"request-field-type-changed",location:r,pointer:`${o}/requestBody/${d}`,detail:`Request body field \`${d}\` changed type from \`${p}\` to \`${f}\`.`})}function N_e(e,t,n,i,r,o,s){let a=e.responses??{},c=t.responses??{};for(let[l,u]of Object.entries(a)){if(!/^2\d\d$/.test(l))continue;let d=c[l];if(!d){s.push({kind:"response-status-removed",location:r,pointer:`${o}/responses/${l}`,detail:`Success response \`${l}\` was removed from \`${r}\`.`});continue}let p=fa(BP(u),n),f=fa(BP(d),i);if(!p||!f)continue;let m=r_(p),g=r_(f);for(let h of Object.keys(m))h in g||s.push({kind:"response-field-removed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` is no longer returned by \`${r}\`.`});for(let[h,b,y]of LH(p,f,n,i))s.push({kind:"response-field-type-changed",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` changed type from \`${b}\` to \`${y}\`.`});for(let[h,b]of Object.entries(m)){let y=g[h];if(!y)continue;let w=o_(b),$=o_(y).filter(S=>!w.includes(S));w.length&&$.length&&s.push({kind:"response-enum-widened",location:r,pointer:`${o}/responses/${l}/${h}`,detail:`Response field \`${h}\` can now return new values: ${$.map(S=>`\`${S}\``).join(", ")}. Exhaustive handling of this field must be updated.`})}}}function P_e(e,t,n,i,r){let o=e.security??[],s=t.security??[],a=o.length===0||o.some(l=>Object.keys(l).length===0),c=s.length===0||s.some(l=>Object.keys(l).length===0);if(a&&!c&&s.length>0){let l=[...new Set(s.flatMap(u=>Object.keys(u)))];r.push({kind:"security-added",location:n,pointer:`${i}/security`,detail:`\`${n}\` now requires authentication (${l.join(", ")}).`})}}function CH(e,t){let n=new Map;if(!Array.isArray(e))return n;for(let i of e){let r=fa(i,t);r?.name&&n.set(`${r.in??"query"}:${r.name}`,r)}return n}function NH(e){let t=e.requestBody;return t?BP(t):null}function BP(e){let t=e.content;if(!t)return e.schema??null;let n=Object.keys(t).find(i=>i.includes("json"))??Object.keys(t)[0];return n?t[n]?.schema??null:null}function fa(e,t,n=0){if(!e)return null;if(n>10)return e;let i=e.$ref;if(typeof i!="string")return e;if(!i.startsWith("#/"))return null;let r=i.slice(2).split("/").map(D_e),o=t;for(let s of r){if(!o||typeof o!="object")return null;o=o[s]}return!o||typeof o!="object"?null:fa(o,t,n+1)}function r_(e){let t=e.properties??{},n=e.allOf;if(!Array.isArray(n))return t;let i={...t};for(let r of n)r&&typeof r=="object"&&Object.assign(i,r.properties??{});return i}function PH(e){let t=Array.isArray(e.required)?e.required:[],i=(Array.isArray(e.allOf)?e.allOf:[]).flatMap(r=>{let o=r?.required;return Array.isArray(o)?o:[]});return[...new Set([...t,...i])]}function LH(e,t,n,i){let r=[],o=r_(e),s=r_(t);for(let[a,c]of Object.entries(o)){let l=s[a];if(!l)continue;let u=i_(fa(c,n)),d=i_(fa(l,i));u&&d&&u!==d&&r.push([a,u,d])}return r}function i_(e){if(!e)return null;let t=e.type;if(typeof t=="string"){if(t==="array"){let n=e.items;return`array<${typeof n?.type=="string"?n.type:"unknown"}>`}return t}return Array.isArray(t)?t.join("|"):null}function o_(e){let t=e?.enum;return Array.isArray(t)?t.map(n=>String(n)):[]}function DH(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function D_e(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}var a_=require("node:fs/promises"),es=require("node:path");function ma(e,t,n,i){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},tool:e}}var Nd="buf breaking",O_e="Install the Buf CLI (https://buf.build/docs/installation) so Drift can compare `.proto` revisions against the protobuf compatibility rules.",FH="Add the imported `.proto` files to `evidence.protobufSpecs` \u2014 Drift compiles every configured `.proto` together, so an import it was told about resolves. A pattern such as `proto/**/*.proto` covers a whole directory of them.",M_e=100,WP={id:"protobuf",source:"protobuf-diff",tool:Nd,weight:1,originClass:"computed-artifact",config:{enabled:"protobuf",paths:"protobufSpecs"},handles(e,t){return e.endsWith(".proto")?/^\s*(syntax\s*=|package\s+|message\s+|service\s+|enum\s+)/m.test(t):!1},async compute(e){let t=await e.exec("buf",["--version"],{timeoutMs:2e4,...e.env?{env:e.env}:{}});if(t.failure==="not-found"||t.code!==0)return ma(Nd,"tool-missing",`The Buf CLI is not installed or is not on PATH, so ${e.path} could not be checked against the protobuf compatibility rules.`,O_e);let n=(0,es.join)(e.workdir,"after"),i=(0,es.join)(e.workdir,"before");await s_((0,es.join)(n,e.path),e.after),await s_((0,es.join)(i,e.path),e.before);for(let a of e.siblings)a.path!==e.path&&(await s_((0,es.join)(n,a.path),a.after),await s_((0,es.join)(i,a.path),a.before));let r=await e.exec("buf",["breaking",n,"--against",i,"--error-format=json"],{cwd:e.workdir,timeoutMs:e.timeoutMs,...e.env?{env:e.env}:{}});if(r.code!==0&&r.code!==M_e){let a=(r.stderr||r.stdout||"no output").trim().split(` +`)[0]??"";return ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${a}`,FH)}let o;try{o=UH(r.stdout)}catch(a){return ma(Nd,"unexpected-output",`Drift could not read \`buf breaking\` output for ${e.path}: ${a.message}`)}let s=o.find(L_e);return s?ma(Nd,"toolchain-failed",`\`buf breaking\` could not compare ${e.path}: ${s.message}`,U_e(s)):{available:!0,changes:o.filter(a=>j_e(a,e.path)).map(a=>z_e(a,e.path)),tool:Nd,weight:1,locator:`${e.path} (buf breaking)`}},codes:{"proto-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` was deleted. Regenerate this repository's stubs and update every reader and writer of that field. Do not reuse its field number for anything else \u2014 reserve it \u2014 and if the value is genuinely gone, propagate the absence rather than substituting a placeholder that could be mistaken for real data.`},"proto-field-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf field \`${e}\` changed name. The wire encoding is unaffected \u2014 field numbers carry it \u2014 but generated accessors and any JSON representation are not. Regenerate the stubs and rename every use; check JSON payloads persisted or exchanged under the old name.`},"proto-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The type or cardinality of the protobuf field \`${e}\` changed. Regenerate the stubs and update every construction and read of that field. A value already persisted or in flight was encoded under the old type \u2014 check that decoding it still means what the code assumes.`},"proto-field-encoding-changed":{kind:"behaviour-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`An encoding option on the protobuf field \`${e}\` changed. Nothing about the schema's shape moved, so this compiles either way \u2014 what changes is the generated representation or the validation applied to the value. Review code that depends on that field's concrete representation.`},"proto-oneof-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf oneof \`${e}\` was deleted. Regenerate the stubs and rewrite every switch over its cases; a oneof's generated API has no drop-in replacement, so restructure the calling code rather than stubbing the accessor.`},"proto-message-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf message \`${e}\` no longer exists. Regenerate the stubs and migrate every use to the replacement message. If there is no replacement, leave the call site intact with a clearly-marked TODO and explain it in the PR description rather than inventing a local copy of the type.`},"proto-enum-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"type",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum \`${e}\` no longer exists. Regenerate the stubs and migrate every use to whatever now carries those values.`},"proto-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` was deleted. Regenerate the stubs and map every use onto a still-supported value. A peer that still sends the removed number will decode as the unknown/unrecognised case \u2014 make sure that path is handled rather than falling through silently.`},"proto-enum-value-renamed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf enum value \`${e}\` changed name. The number is unchanged, so the wire encoding is safe; generated constants and JSON names are not. Regenerate the stubs and rename every use.`},"proto-rpc-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The RPC \`${e}\` no longer exists. Locate the client code that calls it and migrate to the replacement RPC. If there is no replacement, do not delete the feature \u2014 leave the call site intact with a clearly-marked TODO and explain it in the PR description.`},"proto-rpc-signature-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e})=>`The signature of the RPC \`${e}\` changed \u2014 its request type, response type, or streaming shape. Regenerate the stubs and update every call site; a streaming change in particular rewrites the call's control flow, not just its types.`},"proto-service-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The service \`${e}\` no longer exists. Every client of it must be migrated to the replacement service; if there is none, leave the client intact with a clearly-marked TODO rather than deleting the feature.`},"proto-package-changed":{kind:"moved-export",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"package",visibility:["generated"]},remediation:({symbol:e})=>`The protobuf package or a generated-code package option changed for \`${e}\`. The definitions still exist \u2014 their generated home moved. Regenerate the stubs and update the import paths; do not re-implement or stub the individual messages.`},"proto-file-removed":{kind:"removed-endpoint",taxonomy:{nature:"packaging",detectability:["compile-time"],scope:"module",visibility:["generated"]},remediation:({symbol:e})=>`The \`.proto\` file \`${e}\` was deleted, taking everything it declared with it. Find where those definitions moved to and update the imports and generated-code references; if they were removed outright, say so in the PR description rather than recreating the file locally.`},"proto-contract-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["compile-time","runtime-only"],scope:"symbol",visibility:["generated"]},remediation:({symbol:e,detail:t})=>`\`buf\` reports a compatibility break at \`${e}\`: ${t} Regenerate this repository's stubs and update the code around that definition to match the new contract.`}}};async function s_(e,t){await(0,a_.mkdir)((0,es.dirname)(e),{recursive:!0}),await(0,a_.writeFile)(e,t,"utf8")}function UH(e){let t=[];for(let n of e.split(` +`)){let i=n.trim();if(!i.startsWith("{"))continue;let r;try{r=JSON.parse(i)}catch{continue}if(!r||typeof r!="object")continue;let o=r;typeof o.type!="string"||typeof o.message!="string"||t.push({path:typeof o.path=="string"?o.path:"",type:o.type,message:o.message,...typeof o.start_line=="number"?{start_line:o.start_line}:{},...typeof o.start_column=="number"?{start_column:o.start_column}:{}})}return t}function L_e(e){return F_e.has(e.type)}var F_e=new Set(["COMPILE","PLUGIN_FAILURE","CONFIGURATION"]);function U_e(e){return e.type==="COMPILE"?FH:"Check the `buf` configuration and plugins in this repository, then re-run."}function j_e(e,t){return e.path===t||e.path.endsWith(`/${t}`)}function z_e(e,t){let n=e.start_line??0;return{code:jH(e.type),location:zH(e.message)??`${t}:${n}`,pointer:n>0?`${t}:${n}`:t,detail:e.message}}function jH(e){switch(e){case"FIELD_SAME_NAME":case"FIELD_SAME_JSON_NAME":return"proto-field-renamed";case"ENUM_VALUE_SAME_NAME":return"proto-enum-value-renamed";case"FIELD_SAME_TYPE":case"FIELD_SAME_LABEL":case"FIELD_SAME_CARDINALITY":case"FIELD_SAME_ONEOF":case"FIELD_WIRE_COMPATIBLE_TYPE":case"FIELD_WIRE_COMPATIBLE_CARDINALITY":case"FIELD_WIRE_JSON_COMPATIBLE_TYPE":case"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY":return"proto-field-type-changed";case"FIELD_SAME_CTYPE":case"FIELD_SAME_JSTYPE":case"FIELD_SAME_CPP_STRING_TYPE":case"FIELD_SAME_UTF8_VALIDATION":case"FIELD_SAME_JAVA_UTF8_VALIDATION":case"FIELD_SAME_DEFAULT":return"proto-field-encoding-changed";case"RPC_SAME_REQUEST_TYPE":case"RPC_SAME_RESPONSE_TYPE":case"RPC_SAME_CLIENT_STREAMING":case"RPC_SAME_SERVER_STREAMING":case"RPC_SAME_IDEMPOTENCY_LEVEL":return"proto-rpc-signature-changed";default:break}if(/^FILE_SAME_(GO|JAVA|PHP|RUBY|CSHARP|OBJC|SWIFT)_/.test(e)||e==="FILE_SAME_PACKAGE"||e==="PACKAGE_NO_DELETE")return"proto-package-changed";if(e==="FILE_NO_DELETE")return"proto-file-removed";if(e.endsWith("_NO_DELETE")||e.includes("_NO_DELETE_UNLESS_")){if(e.startsWith("FIELD_"))return"proto-field-removed";if(e.startsWith("ENUM_VALUE_"))return"proto-enum-value-removed";if(e.startsWith("ENUM_")||e.startsWith("PACKAGE_ENUM_"))return"proto-enum-removed";if(e.startsWith("ONEOF_"))return"proto-oneof-removed";if(e.startsWith("RPC_"))return"proto-rpc-removed";if(e.startsWith("SERVICE_")||e.startsWith("PACKAGE_SERVICE_"))return"proto-service-removed";if(e.startsWith("MESSAGE_")||e.startsWith("PACKAGE_MESSAGE_"))return"proto-message-removed"}return"proto-contract-changed"}function zH(e){let t=/\bon (?:message|service|enum|oneof|extension) "([^"]+)"/.exec(e)?.[1]??/\b(?:message|service|enum) "([^"]+)"/.exec(e)?.[1]??null,n=/\bwith name "([^"]+)"/.exec(e)?.[1]??/\bchanged name from "[^"]+" to "([^"]+)"/.exec(e)?.[1]??/\b(?:RPC|field|value|oneof) "([^"]+)"/i.exec(e)?.[1]??null,i=n&&!/^\d+$/.test(n)?n:null;return t&&i?`${t}.${i}`:t??i}function ce(e){return c_(e,[])}function c_(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return G_e(e,t);default:return String(e)}}function G_e(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(V_e(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:c_(i,n)}else if(Array.isArray(e))return q_e(e,n);return B_e(e,n)}function V_e(e){return typeof e.toJSON=="function"}function B_e(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+W_e(e)+"]":"{ "+n.map(([r,o])=>r+": "+c_(o,t)).join(", ")+" }"}function q_e(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function W_e(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function K_e(e,t){return e?.__kind===t}var Rr=K_e;function GH(e){return e instanceof Error?e:new KP(e)}var KP=class extends Error{constructor(t){super("Unexpected error value: "+ce(t)),this.name="NonErrorThrown",this.thrownValue=t}};function Kn(e){return typeof e=="object"&&e!==null}function it(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var H_e=/\r\n|[\n\r]/g;function Pd(e,t){let n=0,i=1;for(let r of e.body.matchAll(H_e)){if(typeof r.index!="number"&&it(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function HP(e){return l_(e.source,Pd(e.source,e.start))}function l_(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?n:0,c=t.column+a,l=`${e.name}:${s}:${c} +`,u=i.split(/\r\n|[\n\r]/g),d=u[r];if(d.length>120){let p=Math.floor(c/80),f=c%80,m=[];for(let g=0;g["|",g]),["|","^".padStart(f)],["|",m[p+1]]])}return l+VH([[`${s-1} |`,u[r-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,u[r+1]]])}function VH(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(` +`)}var O=class e extends Error{constructor(t,n={}){let{nodes:i,source:r,positions:o,path:s,originalError:a,cause:c,extensions:l}=n,u="cause"in n,d=u?c:a,p=u||a!=null?{cause:d}:void 0;super(t,p),this.name="GraphQLError",this.path=s??void 0;let f=a??(c instanceof Error?c:void 0);this.originalError=f,this.nodes=BH(Array.isArray(i)?i:i?[i]:void 0);let m=BH(this.nodes?.map(h=>h.loc).filter(h=>h!=null));this.source=r??m?.[0]?.source,this.positions=o??m?.map(h=>h.start),this.locations=o&&r?o.map(h=>Pd(r,h)):m?.map(h=>Pd(h.source,h.start));let g=Kn(f?.extensions)?f.extensions:void 0;this.extensions=l??g??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),a?.stack!=null?Object.defineProperty(this,"stack",{value:a.stack,writable:!0,configurable:!0}):Error.captureStackTrace!=null?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=` -`+jP(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` +`+HP(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=` -`+n$(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function FK(e){return e===void 0||e.length===0?void 0:e}function Ug(e){if(e instanceof O)return e;let t=MK(e);return new O(t.message,{originalError:t})}var Cr=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let i=this.get(t);i===void 0?this.set(t,[n]):i.push(n)}};function UK(e){return G$e("or",e)}function G$e(e,t){switch(t.length===0&&it(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),i=t.at(-1);return n.join(", ")+", "+e+" "+i}function ts(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function r$(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}function ga(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}function zP(e){return e.length===0?"":` at ${e.map(t=>typeof t=="number"?`[${t}]`:`.${t}`).join("")}`}var jg=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Pd=class{constructor(t,n,i,r,o,s){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},zg={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},V$e=new Set(Object.keys(zg));function GP(e){let t=e?.kind;return typeof t=="string"&&V$e.has(t)}var Jn={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var $={};_r($,{ARGUMENT:()=>Z$e,ARGUMENT_COORDINATE:()=>L_e,BOOLEAN:()=>o_e,DIRECTIVE:()=>d_e,DIRECTIVE_ARGUMENT_COORDINATE:()=>U_e,DIRECTIVE_COORDINATE:()=>F_e,DIRECTIVE_DEFINITION:()=>E_e,DIRECTIVE_EXTENSION:()=>I_e,DOCUMENT:()=>q$e,ENUM:()=>a_e,ENUM_TYPE_DEFINITION:()=>__e,ENUM_TYPE_EXTENSION:()=>P_e,ENUM_VALUE_DEFINITION:()=>S_e,FIELD:()=>J$e,FIELD_DEFINITION:()=>v_e,FLOAT:()=>r_e,FRAGMENT_ARGUMENT:()=>Y$e,FRAGMENT_DEFINITION:()=>e_e,FRAGMENT_SPREAD:()=>Q$e,INLINE_FRAGMENT:()=>X$e,INPUT_OBJECT_TYPE_DEFINITION:()=>x_e,INPUT_OBJECT_TYPE_EXTENSION:()=>D_e,INPUT_VALUE_DEFINITION:()=>w_e,INT:()=>n_e,INTERFACE_TYPE_DEFINITION:()=>k_e,INTERFACE_TYPE_EXTENSION:()=>N_e,LIST:()=>c_e,LIST_TYPE:()=>f_e,MEMBER_COORDINATE:()=>M_e,NAME:()=>B$e,NAMED_TYPE:()=>p_e,NON_NULL_TYPE:()=>m_e,NULL:()=>s_e,OBJECT:()=>l_e,OBJECT_FIELD:()=>u_e,OBJECT_TYPE_DEFINITION:()=>b_e,OBJECT_TYPE_EXTENSION:()=>R_e,OPERATION_DEFINITION:()=>W$e,OPERATION_TYPE_DEFINITION:()=>h_e,SCALAR_TYPE_DEFINITION:()=>y_e,SCALAR_TYPE_EXTENSION:()=>A_e,SCHEMA_DEFINITION:()=>g_e,SCHEMA_EXTENSION:()=>T_e,SELECTION_SET:()=>K$e,STRING:()=>i_e,TYPE_COORDINATE:()=>O_e,UNION_TYPE_DEFINITION:()=>$_e,UNION_TYPE_EXTENSION:()=>C_e,VARIABLE:()=>t_e,VARIABLE_DEFINITION:()=>H$e});var B$e="Name",q$e="Document",W$e="OperationDefinition",H$e="VariableDefinition",K$e="SelectionSet",J$e="Field",Z$e="Argument",Y$e="FragmentArgument",Q$e="FragmentSpread",X$e="InlineFragment",e_e="FragmentDefinition",t_e="Variable",n_e="IntValue",r_e="FloatValue",i_e="StringValue",o_e="BooleanValue",s_e="NullValue",a_e="EnumValue",c_e="ListValue",l_e="ObjectValue",u_e="ObjectField",d_e="Directive",p_e="NamedType",f_e="ListType",m_e="NonNullType",g_e="SchemaDefinition",h_e="OperationTypeDefinition",y_e="ScalarTypeDefinition",b_e="ObjectTypeDefinition",v_e="FieldDefinition",w_e="InputValueDefinition",k_e="InterfaceTypeDefinition",$_e="UnionTypeDefinition",__e="EnumTypeDefinition",S_e="EnumValueDefinition",x_e="InputObjectTypeDefinition",E_e="DirectiveDefinition",T_e="SchemaExtension",I_e="DirectiveExtension",A_e="ScalarTypeExtension",R_e="ObjectTypeExtension",N_e="InterfaceTypeExtension",C_e="UnionTypeExtension",P_e="EnumTypeExtension",D_e="InputObjectTypeExtension",O_e="TypeCoordinate",M_e="MemberCoordinate",L_e="ArgumentCoordinate",F_e="DirectiveCoordinate",U_e="DirectiveArgumentCoordinate";function fi(e,t){if(!e)throw new Error(t)}var j_e=5;function Zn(e,t){let[n,i]=t?[e,t]:[void 0,e];if(i.length===0)return"";let r=" Did you mean ";n!=null&&(r+=n+" ");let o=UK(i.slice(0,j_e).map(s=>`"${s}"`));return r+o+"?"}function VP(e){return e}function Gc(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}function Dd(e,t){let n=0,i=0;for(;n0);let a=0;do++i,a=a*10+o-BP,o=t.charCodeAt(i);while(i$(o)&&a>0);if(sa)return 1}else{if(ro)return 1;++n,++i}}return e.length-t.length}var BP=48,z_e=57;function i$(e){return!isNaN(e)&&BP<=e&&e<=z_e}function lr(e,t){let n=Object.create(null),i=new qP(e),r=Math.floor(e.length*.4)+1;for(let o of t){let s=i.measure(o,r);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:Dd(o,s)})}var qP=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=jK(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=jK(i),o=this._inputArray;if(r.lengthn)return;let c=this._rows;for(let u=0;u<=a;u++)c[0][u]=u;for(let u=1;u<=s;u++){let d=c[(u-1)%3],p=c[u%3],f=p[0]=u;for(let m=1;m<=a;m++){let g=r[u-1]===o[m-1]?0:1,h=Math.min(d[m]+1,p[m-1]+1,d[m-1]+g);if(u>1&&m>1&&r[u-1]===o[m-2]&&r[u-2]===o[m-1]){let b=c[(u-2)%3][m-2];h=Math.min(h,b+1)}hn)return}let l=c[s%3][a];return l<=n?l:void 0}};function jK(e){let t=e.length,n=new Array(t);for(let i=0;i=48&&e<=57}function zK(e){return e>=97&&e<=122||e>=65&&e<=90}function Gg(e){return zK(e)||e===95}function s$(e){return zK(e)||Vc(e)||e===95}function GK(e){let t=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let r=0;ro===0?r:r.slice(t)).slice(n??0,i+1)}function G_e(e){let t=0;for(;t1&&i.slice(1).every(f=>f.length===0||o$(f.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),l=a||c,u=!t?.minimize&&(!r||e.length>70||l||o||s),d="",p=r&&o$(e.charCodeAt(0));return(u&&!p||o)&&(d+=` +`+l_(this.source,n);return t}toJSON(){let t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}};function BH(e){return e===void 0||e.length===0?void 0:e}function Wg(e){if(e instanceof O)return e;let t=GH(e);return new O(t.message,{originalError:t})}var Cr=class extends Map{get[Symbol.toStringTag](){return"AccumulatorMap"}add(t,n){let i=this.get(t);i===void 0?this.set(t,[n]):i.push(n)}};function qH(e){return J_e("or",e)}function J_e(e,t){switch(t.length===0&&it(!1),t.length){case 1:return t[0];case 2:return t[0]+" "+e+" "+t[1]}let n=t.slice(0,-1),i=t.at(-1);return n.join(", ")+", "+e+" "+i}function ts(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}function u_(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}function ga(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}function JP(e){return e.length===0?"":` at ${e.map(t=>typeof t=="number"?`[${t}]`:`.${t}`).join("")}`}var Kg=class{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Dd=class{constructor(t,n,i,r,o,s){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},Hg={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Z_e=new Set(Object.keys(Hg));function ZP(e){let t=e?.kind;return typeof t=="string"&&Z_e.has(t)}var Hn={QUERY:"query",MUTATION:"mutation",SUBSCRIPTION:"subscription"};var _={};kr(_,{ARGUMENT:()=>r$e,ARGUMENT_COORDINATE:()=>B$e,BOOLEAN:()=>p$e,DIRECTIVE:()=>b$e,DIRECTIVE_ARGUMENT_COORDINATE:()=>W$e,DIRECTIVE_COORDINATE:()=>q$e,DIRECTIVE_DEFINITION:()=>P$e,DIRECTIVE_EXTENSION:()=>O$e,DOCUMENT:()=>Q_e,ENUM:()=>m$e,ENUM_TYPE_DEFINITION:()=>R$e,ENUM_TYPE_EXTENSION:()=>j$e,ENUM_VALUE_DEFINITION:()=>C$e,FIELD:()=>n$e,FIELD_DEFINITION:()=>E$e,FLOAT:()=>u$e,FRAGMENT_ARGUMENT:()=>i$e,FRAGMENT_DEFINITION:()=>a$e,FRAGMENT_SPREAD:()=>o$e,INLINE_FRAGMENT:()=>s$e,INPUT_OBJECT_TYPE_DEFINITION:()=>N$e,INPUT_OBJECT_TYPE_EXTENSION:()=>z$e,INPUT_VALUE_DEFINITION:()=>T$e,INT:()=>l$e,INTERFACE_TYPE_DEFINITION:()=>I$e,INTERFACE_TYPE_EXTENSION:()=>F$e,LIST:()=>g$e,LIST_TYPE:()=>w$e,MEMBER_COORDINATE:()=>V$e,NAME:()=>Y_e,NAMED_TYPE:()=>v$e,NON_NULL_TYPE:()=>k$e,NULL:()=>f$e,OBJECT:()=>h$e,OBJECT_FIELD:()=>y$e,OBJECT_TYPE_DEFINITION:()=>x$e,OBJECT_TYPE_EXTENSION:()=>L$e,OPERATION_DEFINITION:()=>X_e,OPERATION_TYPE_DEFINITION:()=>$$e,SCALAR_TYPE_DEFINITION:()=>S$e,SCALAR_TYPE_EXTENSION:()=>M$e,SCHEMA_DEFINITION:()=>_$e,SCHEMA_EXTENSION:()=>D$e,SELECTION_SET:()=>t$e,STRING:()=>d$e,TYPE_COORDINATE:()=>G$e,UNION_TYPE_DEFINITION:()=>A$e,UNION_TYPE_EXTENSION:()=>U$e,VARIABLE:()=>c$e,VARIABLE_DEFINITION:()=>e$e});var Y_e="Name",Q_e="Document",X_e="OperationDefinition",e$e="VariableDefinition",t$e="SelectionSet",n$e="Field",r$e="Argument",i$e="FragmentArgument",o$e="FragmentSpread",s$e="InlineFragment",a$e="FragmentDefinition",c$e="Variable",l$e="IntValue",u$e="FloatValue",d$e="StringValue",p$e="BooleanValue",f$e="NullValue",m$e="EnumValue",g$e="ListValue",h$e="ObjectValue",y$e="ObjectField",b$e="Directive",v$e="NamedType",w$e="ListType",k$e="NonNullType",_$e="SchemaDefinition",$$e="OperationTypeDefinition",S$e="ScalarTypeDefinition",x$e="ObjectTypeDefinition",E$e="FieldDefinition",T$e="InputValueDefinition",I$e="InterfaceTypeDefinition",A$e="UnionTypeDefinition",R$e="EnumTypeDefinition",C$e="EnumValueDefinition",N$e="InputObjectTypeDefinition",P$e="DirectiveDefinition",D$e="SchemaExtension",O$e="DirectiveExtension",M$e="ScalarTypeExtension",L$e="ObjectTypeExtension",F$e="InterfaceTypeExtension",U$e="UnionTypeExtension",j$e="EnumTypeExtension",z$e="InputObjectTypeExtension",G$e="TypeCoordinate",V$e="MemberCoordinate",B$e="ArgumentCoordinate",q$e="DirectiveCoordinate",W$e="DirectiveArgumentCoordinate";function fi(e,t){if(!e)throw new Error(t)}var K$e=5;function Jn(e,t){let[n,i]=t?[e,t]:[void 0,e];if(i.length===0)return"";let r=" Did you mean ";n!=null&&(r+=n+" ");let o=qH(i.slice(0,K$e).map(s=>`"${s}"`));return r+o+"?"}function YP(e){return e}function Bc(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}function Od(e,t){let n=0,i=0;for(;n0);let a=0;do++i,a=a*10+o-QP,o=t.charCodeAt(i);while(d_(o)&&a>0);if(sa)return 1}else{if(ro)return 1;++n,++i}}return e.length-t.length}var QP=48,H$e=57;function d_(e){return!isNaN(e)&&QP<=e&&e<=H$e}function ar(e,t){let n=Object.create(null),i=new XP(e),r=Math.floor(e.length*.4)+1;for(let o of t){let s=i.measure(o,r);s!==void 0&&(n[o]=s)}return Object.keys(n).sort((o,s)=>{let a=n[o]-n[s];return a!==0?a:Od(o,s)})}var XP=class{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=WH(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=WH(i),o=this._inputArray;if(r.lengthn)return;let c=this._rows;for(let u=0;u<=a;u++)c[0][u]=u;for(let u=1;u<=s;u++){let d=c[(u-1)%3],p=c[u%3],f=p[0]=u;for(let m=1;m<=a;m++){let g=r[u-1]===o[m-1]?0:1,h=Math.min(d[m]+1,p[m-1]+1,d[m-1]+g);if(u>1&&m>1&&r[u-1]===o[m-2]&&r[u-2]===o[m-1]){let b=c[(u-2)%3][m-2];h=Math.min(h,b+1)}hn)return}let l=c[s%3][a];return l<=n?l:void 0}};function WH(e){let t=e.length,n=new Array(t);for(let i=0;i=48&&e<=57}function KH(e){return e>=97&&e<=122||e>=65&&e<=90}function Jg(e){return KH(e)||e===95}function f_(e){return KH(e)||qc(e)||e===95}function HH(e){let t=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let r=0;ro===0?r:r.slice(t)).slice(n??0,i+1)}function J$e(e){let t=0;for(;t1&&i.slice(1).every(f=>f.length===0||p_(f.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,c=e.endsWith("\\"),l=a||c,u=!t?.minimize&&(!r||e.length>70||l||o||s),d="",p=r&&p_(e.charCodeAt(0));return(u&&!p||o)&&(d+=` `),d+=n,(u||l)&&(d+=` -`),'"""'+d+'"""'}function BK(e){return`"${e.replace(V_e,B_e)}"`}var V_e=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function B_e(e){return q_e[e.charCodeAt(0)]}var q_e=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var Od=Object.freeze({});function Md(e,t,n=zg){let i=new Map;for(let m of Object.values($))i.set(m,HP(t,m));let r,o=Array.isArray(e),s=[e],a=-1,c=[],l=e,u,d,p=[],f=[];do{a++;let m=a===s.length,g=m&&c.length!==0;if(m){if(u=f.length===0?void 0:p[p.length-1],l=d,d=f.pop(),g)if(o){l=l.slice();let b=0;for(let[y,w]of c){let k=y-b;w===null?(l.splice(k,1),b++):l[k]=w}}else{l={...l};for(let[b,y]of c)l[b]=y}a=r.index,s=r.keys,c=r.edits,o=r.inArray,r=r.prev}else if(d!=null){if(u=o?a:s[a],l=d[u],l==null)continue;p.push(u)}let h;if(!Array.isArray(l)){if(GP(l)||fi(!1,`Invalid AST Node: ${ce(l)}.`),h=(m?i.get(l.kind)?.leave:i.get(l.kind)?.enter)?.call(t,l,u,d,p,f),h===Od)break;if(h===!1){if(!m){p.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!m))if(GP(h))l=h;else{p.pop();continue}}h===void 0&&g&&c.push([u,l]),m?p.pop():(r={inArray:o,index:a,keys:s,edits:c,prev:r},o=Array.isArray(l),s=o?l:n[l.kind]??[],a=-1,c=[],d!=null&&f.push(d),d=l)}while(r!==void 0);return c.length!==0?c.at(-1)[1]:e}function WP(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let i of Object.values($)){let r=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;ce.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>se(e.definitions,` +`),'"""'+d+'"""'}function ZH(e){return`"${e.replace(Z$e,Y$e)}"`}var Z$e=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Y$e(e){return Q$e[e.charCodeAt(0)]}var Q$e=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var Md=Object.freeze({});function Ld(e,t,n=Hg){let i=new Map;for(let m of Object.values(_))i.set(m,tD(t,m));let r,o=Array.isArray(e),s=[e],a=-1,c=[],l=e,u,d,p=[],f=[];do{a++;let m=a===s.length,g=m&&c.length!==0;if(m){if(u=f.length===0?void 0:p[p.length-1],l=d,d=f.pop(),g)if(o){l=l.slice();let b=0;for(let[y,w]of c){let k=y-b;w===null?(l.splice(k,1),b++):l[k]=w}}else{l={...l};for(let[b,y]of c)l[b]=y}a=r.index,s=r.keys,c=r.edits,o=r.inArray,r=r.prev}else if(d!=null){if(u=o?a:s[a],l=d[u],l==null)continue;p.push(u)}let h;if(!Array.isArray(l)){if(ZP(l)||fi(!1,`Invalid AST Node: ${ce(l)}.`),h=(m?i.get(l.kind)?.leave:i.get(l.kind)?.enter)?.call(t,l,u,d,p,f),h===Md)break;if(h===!1){if(!m){p.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!m))if(ZP(h))l=h;else{p.pop();continue}}h===void 0&&g&&c.push([u,l]),m?p.pop():(r={inArray:o,index:a,keys:s,edits:c,prev:r},o=Array.isArray(l),s=o?l:n[l.kind]??[],a=-1,c=[],d!=null&&f.push(d),d=l)}while(r!==void 0);return c.length!==0?c.at(-1)[1]:e}function eD(e){let t=new Array(e.length).fill(null),n=Object.create(null);for(let i of Object.values(_)){let r=!1,o=new Array(e.length).fill(void 0),s=new Array(e.length).fill(void 0);for(let c=0;ce.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>se(e.definitions,` -`)},OperationDefinition:{leave(e){let t=KP(e.variableDefinitions)?Pe(`( +`)},OperationDefinition:{leave(e){let t=nD(e.variableDefinitions)?Ne(`( `,se(e.variableDefinitions,` `),` -)`):Pe("(",se(e.variableDefinitions,", "),")"),n=Pe("",e.description,` -`)+se([e.operation,se([e.name,t]),se(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i,description:r})=>Pe("",r,` -`)+e+": "+t+Pe(" = ",n)+Pe(" ",se(i," "))},SelectionSet:{leave:({selections:e})=>mi(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=se([Pe("",e,": "),t],"");return se([qK(o,n),Pe(" ",se(i," ")),Pe(" ",r)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let i="..."+e;return qK(i,t)+Pe(" ",se(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>se(["...",Pe("on ",e),se(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r,description:o})=>Pe("",o,` -`)+`fragment ${e}${Pe("(",se(n,", "),")")} on ${t} ${Pe("",se(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?VK(e):BK(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+se(e,", ")+"]";return t.length>JP?`[ -`+Vg(se(e,` +)`):Ne("(",se(e.variableDefinitions,", "),")"),n=Ne("",e.description,` +`)+se([e.operation,se([e.name,t]),se(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i,description:r})=>Ne("",r,` +`)+e+": "+t+Ne(" = ",n)+Ne(" ",se(i," "))},SelectionSet:{leave:({selections:e})=>mi(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=se([Ne("",e,": "),t],"");return se([YH(o,n),Ne(" ",se(i," ")),Ne(" ",r)])}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>{let i="..."+e;return YH(i,t)+Ne(" ",se(n," "))}},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>se(["...",Ne("on ",e),se(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r,description:o})=>Ne("",o,` +`)+`fragment ${e}${Ne("(",se(n,", "),")")} on ${t} ${Ne("",se(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t===!0?JH(e):ZH(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{let t="["+se(e,", ")+"]";return t.length>rD?`[ +`+Zg(se(e,` `))+` -]`:t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+se(e,", ")+" }";return t.length>JP?mi(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Pe("(",se(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Pe("",e,` -`)+se(["schema",se(t," "),mi(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Pe("",e,` -`)+se(["scalar",t,se(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Pe("",e,` -`)+se(["type",t,Pe("implements ",se(n," & ")),se(i," "),mi(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>Pe("",e,` -`)+t+(KP(n)?Pe(`( -`,Vg(se(n,` +]`:t}},ObjectValue:{leave:({fields:e})=>{let t="{ "+se(e,", ")+" }";return t.length>rD?mi(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Ne("(",se(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Ne("",e,` +`)+se(["schema",se(t," "),mi(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Ne("",e,` +`)+se(["scalar",t,se(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Ne("",e,` +`)+se(["type",t,Ne("implements ",se(n," & ")),se(i," "),mi(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>Ne("",e,` +`)+t+(nD(n)?Ne(`( +`,Zg(se(n,` `)),` -)`):Pe("(",se(n,", "),")"))+": "+i+Pe(" ",se(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>Pe("",e,` -`)+se([t+": "+n,Pe("= ",i),se(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Pe("",e,` -`)+se(["interface",t,Pe("implements ",se(n," & ")),se(i," "),mi(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>Pe("",e,` -`)+se(["union",t,se(n," "),Pe("= ",se(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>Pe("",e,` -`)+se(["enum",t,se(n," "),mi(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Pe("",e,` -`)+se([t,se(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>Pe("",e,` -`)+se(["input",t,se(n," "),mi(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:i,repeatable:r,locations:o})=>Pe("",e,` -`)+"directive @"+t+(KP(n)?Pe(`( -`,Vg(se(n,` +)`):Ne("(",se(n,", "),")"))+": "+i+Ne(" ",se(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>Ne("",e,` +`)+se([t+": "+n,Ne("= ",i),se(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>Ne("",e,` +`)+se(["interface",t,Ne("implements ",se(n," & ")),se(i," "),mi(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>Ne("",e,` +`)+se(["union",t,se(n," "),Ne("= ",se(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>Ne("",e,` +`)+se(["enum",t,se(n," "),mi(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Ne("",e,` +`)+se([t,se(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>Ne("",e,` +`)+se(["input",t,se(n," "),mi(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:i,repeatable:r,locations:o})=>Ne("",e,` +`)+"directive @"+t+(nD(n)?Ne(`( +`,Zg(se(n,` `)),` -)`):Pe("(",se(n,", "),")"))+Pe(" ",se(i," "))+(r?" repeatable":"")+" on "+se(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>se(["extend schema",se(e," "),mi(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>se(["extend scalar",e,se(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend type",e,Pe("implements ",se(t," & ")),se(n," "),mi(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend interface",e,Pe("implements ",se(t," & ")),se(n," "),mi(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>se(["extend union",e,se(t," "),Pe("= ",se(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>se(["extend enum",e,se(t," "),mi(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>se(["extend input",e,se(t," "),mi(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>se(["extend directive @"+e,se(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>se([e,Pe(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>se([e,Pe(".",t),Pe("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>se(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>se(["@",e,Pe("(",t,":)")])}};function se(e,t=""){return e?.filter(n=>n!==void 0&&n!=="").join(t)??""}function mi(e){return Pe(`{ -`,Vg(se(e,` +)`):Ne("(",se(n,", "),")"))+Ne(" ",se(i," "))+(r?" repeatable":"")+" on "+se(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>se(["extend schema",se(e," "),mi(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>se(["extend scalar",e,se(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend type",e,Ne("implements ",se(t," & ")),se(n," "),mi(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>se(["extend interface",e,Ne("implements ",se(t," & ")),se(n," "),mi(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>se(["extend union",e,se(t," "),Ne("= ",se(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>se(["extend enum",e,se(t," "),mi(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>se(["extend input",e,se(t," "),mi(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>se(["extend directive @"+e,se(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>se([e,Ne(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>se([e,Ne(".",t),Ne("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>se(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>se(["@",e,Ne("(",t,":)")])}};function se(e,t=""){return e?.filter(n=>n!==void 0&&n!=="").join(t)??""}function mi(e){return Ne(`{ +`,Zg(se(e,` `)),` -}`)}function Pe(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Vg(e){return Pe(" ",e.replaceAll(` +}`)}function Ne(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Zg(e){return Ne(" ",e.replaceAll(` `,` - `))}function KP(e){return e?.some(t=>t.includes(` -`))??!1}function qK(e,t){let n=e+Pe("(",se(t,", "),")");return n.length>JP&&(n=e+Pe(`( -`,Vg(se(t,` + `))}function nD(e){return e?.some(t=>t.includes(` +`))??!1}function YH(e,t){let n=e+Ne("(",se(t,", "),")");return n.length>rD&&(n=e+Ne(`( +`,Zg(se(t,` `)),` -)`)),n}function Bg(e,t){switch(e.kind){case $.NULL:return null;case $.INT:return parseInt(e.value,10);case $.FLOAT:return parseFloat(e.value);case $.STRING:case $.ENUM:case $.BOOLEAN:return e.value;case $.LIST:return e.values.map(n=>Bg(n,t));case $.OBJECT:return Gc(e.fields,n=>n.name.value,n=>Bg(n.value,t));case $.VARIABLE:return t?.[e.name.value]}}function Pr(e){if(e.length===0)throw new O("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Bg(n,i))),this.coerceOutputValue=t.coerceOutputValue??this.serialize,this.coerceInputValue=t.coerceInputValue??this.parseValue,this.coerceInputLiteral=t.coerceInputLiteral,this.valueToLiteral=t.valueToLiteral,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||fi(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),t.coerceInputLiteral&&(typeof t.coerceInputValue=="function"&&typeof t.coerceInputLiteral=="function"||fi(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Yn=class{constructor(t){this.__kind=YP,this.__kind=YP,this.name=Pr(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=tJ.bind(void 0,this,t.fields),this._interfaces=eJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function eJ(e){return u$(e??[])}function tJ(e,t){let n=Hg(t);return ga(n,(i,r)=>new Bc(e,r,i))}var Bc=class{constructor(t,n,i){this.__kind=H_e,this.parentType=t,this.name=Pr(n),this.description=i.description,this.type=i.type;let r=i.args;this.args=r?Object.entries(r).map(([o,s])=>new Ld(this,o,s)):[],this.resolve=i.resolve,this.subscribe=i.subscribe,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Gc(this.args,t=>t.name,t=>t.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}},Ld=class{constructor(t,n,i){this.__kind=HK,this.parent=t,this.name=Pr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}};function ha(e){return _e(e.type)&&e.default===void 0&&e.defaultValue===void 0}var ns=class{constructor(t){this.__kind=KK,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=tJ.bind(void 0,this,t.fields),this._interfaces=eJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},rs=class{constructor(t){this.__kind=JK,this.name=Pr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._types=Z_e.bind(void 0,t.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Z_e(e){return u$(e)}var gi=class{constructor(t){this.__kind=ZK,this.name=Pr(t.name),this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._values=Y_e.bind(void 0,this,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=this._values()),this._values}getValue(t){return this._nameLookup??=r$(this.getValues(),n=>n.name),this._nameLookup[t]}serialize(t){return this.coerceOutputValue(t)}coerceOutputValue(t){this._valueLookup??=new Map(this.getValues().map(i=>[i.value,i]));let n=this._valueLookup.get(t);if(n===void 0)throw new O(`Enum "${this.name}" cannot represent value: ${ce(t)}`);return n.name}parseValue(t,n){return this.coerceInputValue(t,n)}coerceInputValue(t,n){if(typeof t!="string"){let r=ce(t);throw new O(`Enum "${this.name}" cannot represent non-string value: ${r}.`+(n?"":a$(this,r)))}let i=this.getValue(t);if(i==null)throw new O(`Value "${t}" does not exist in "${this.name}" enum.`+(n?"":a$(this,t)));return i.value}parseLiteral(t,n,i){return this.coerceInputLiteral(t,i)}coerceInputLiteral(t,n){if(t.kind!==$.ENUM){let r=Ye(t);throw new O(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+(n?"":a$(this,r)),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=Ye(t);throw new O(`Value "${r}" does not exist in "${this.name}" enum.`+(n?"":a$(this,r)),{nodes:t})}return i.value}valueToLiteral(t){if(typeof t=="string"&&this.getValue(t))return{kind:$.ENUM,value:t}}toConfig(){return{name:this.name,description:this.description,values:Gc(this.getValues(),t=>t.name,t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Y_e(e,t){let n=Hg(t);return Object.entries(n).map(([i,r])=>new QP(e,i,r))}function a$(e,t){let n=e.getValues().map(r=>r.name),i=lr(t,n);return Zn("the enum value",i)}var QP=class{constructor(t,n,i){this.__kind=K_e,this.parentEnum=t,this.name=ZP(n),this.description=i.description,this.value=i.value!==void 0?i.value:n,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},is=class{constructor(t){this.__kind=YK,this.name=Pr(t.name),this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this.isOneOf=t.isOneOf??!1,this._fields=Q_e.bind(void 0,this,t.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:ga(this.getFields(),t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function Q_e(e,t){let n=Hg(t);return ga(n,(i,r)=>new XP(e,r,i))}var XP=class{constructor(t,n,i){"resolve"in i&&fi(!1,`${t}.${n} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=J_e,this.parentType=t,this.name=Pr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=ur(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function qi(e){return _e(e.type)&&e.defaultValue===void 0&&e.default===void 0}function qc(e,t,n){return t===n?!0:_e(n)?_e(t)?qc(e,t.ofType,n.ofType):!1:_e(t)?qc(e,t.ofType,n):Ke(n)?Ke(t)?qc(e,t.ofType,n.ofType):!1:Ke(t)?!1:Kr(n)&&(Be(t)||at(t))&&e.isSubType(n,t)}function d$(e,t,n){return t===n?!0:Kr(t)?Kr(n)?e.getPossibleTypes(t).some(i=>e.isSubType(n,i)):e.isSubType(t,n):Kr(n)?e.isSubType(n,t):!1}function Wc(e,t,n){return{prev:e,key:t,typename:n}}function Kg(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function ss(e,t){if(_e(t))return e==null?void 0:ss(e,t.ofType);if(e==null)return{kind:$.NULL};if(Ke(t)){if(!ts(e))return ss(e,t.ofType);let i=[];for(let r of e){let o=ss(r,t.ofType);if(!o)return;i.push(o)}return{kind:$.LIST,values:i}}if(He(t)){if(!Kn(e))return;let i=[],r=t.getFields();if(Object.keys(e).some(s=>e[s]!==void 0&&!Object.hasOwn(r,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(qi(s))return}else{let c=ss(e[s.name],s.type);if(!c)return;i.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:s.name},value:c})}return{kind:$.OBJECT,fields:i}}let n=wo(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return Hc(e)}function Hc(e){if(e==null)return{kind:$.NULL};switch(typeof e){case"boolean":return{kind:$.BOOLEAN,value:e};case"string":return{kind:$.STRING,value:e,block:!1};case"bigint":return{kind:$.INT,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:$.NULL};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:$.INT,value:t}:{kind:$.FLOAT,value:t}}case"object":{if(ts(e))return{kind:$.LIST,values:Array.from(e,Hc)};let t=e,n=[];for(let i of Object.keys(t)){let r=t[i];r!==void 0&&n.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:i},value:Hc(r)})}return{kind:$.OBJECT,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${ce(e)}.`)}function ya(e,t,n){switch(e.kind){case $.VARIABLE:{let i=e.name.value,r=n?.sources[i];if(r){let s=r.value;if(s===void 0){let a=r.signature.default;return a!==void 0?a.literal:{kind:$.NULL}}return ya(s,t,r.fragmentVariableValues)}let o=t?.sources[i];if(o==null)return{kind:$.NULL};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return ss(o.value,o.signature.type)}case $.OBJECT:{let i=[];for(let r of e.fields){if(r.value.kind===$.VARIABLE){let s=n?.sources[r.value.name.value]??t?.sources[r.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=ya(r.value,t,n);i.push({...r,value:o})}return{...e,fields:i}}case $.LIST:{let i=[];for(let r of e.values){let o=ya(r,t,n);i.push(o)}return{...e,values:i}}default:return e}}function f$(e,t,n,i){return Jg(e,t,n,i,void 0)}function Jg(e,t,n,i,r){if(_e(t)){if(e===void 0){ba(n,`Expected a value of non-null type "${t}" to be provided.`,r);return}if(e===null){ba(n,`Expected value of non-null type "${t}" not to be null.`,r);return}return Jg(e,t.ofType,n,i,r)}if(e!=null)if(Ke(t))if(!ts(e))Jg(e,t.ofType,n,i,r);else{let o=0;for(let s of e)Jg(s,t.ofType,n,i,Wc(r,o++,void 0))}else if(He(t)){if(!Kn(e)||Array.isArray(e)){ba(n,`Expected value of type "${t}" to be an object, found: ${ce(e)}.`,r);return}let o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];c===void 0?qi(a)&&ba(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${ce(e)}.`,r):Jg(c,a.type,n,i,Wc(r,a.name,t.name))}let s=[];for(let a of Object.keys(e))if(e[a]!==void 0){if(!Object.hasOwn(o,a)){let c=i?"":Zn(lr(a,Object.keys(o)));ba(n,`Expected value of type "${t}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ce(e)}.`,r);continue}s.push(a)}if(t.isOneOf){s.length!==1&&ba(n,p$(t),r);let a=s[0];e[a]===null&&ba(n,p$(t),Wc(r,a,t.name))}}else{wo(t);let o,s;try{o=t.coerceInputValue(e,i)}catch(a){if(a instanceof O){n(a,Kg(r));return}s=a}o===void 0&&ba(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${rJ(s)}"; found`:", found"}: ${ce(e)}.`,r,Ug(s))}}function ba(e,t,n,i){e(new O(t,{originalError:i}),Kg(n))}function Kc(e,t,n,i,r,o){return Zg({static:!i&&!r,onError:n,variables:i,fragmentVariableValues:r},e,t,o,void 0)}function Zg(e,t,n,i,r){if(t.kind===$.VARIABLE){if(e.static)return;let s=nJ(e,t)?.coerced[t.name.value];_e(n)&&(s===void 0?Wi(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,r):s===null&&Wi(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,r));return}if(_e(n)){if(t.kind===$.NULL){Wi(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,r);return}return Zg(e,t,n.ofType,i,r)}if(t.kind!==$.NULL)if(Ke(n))if(t.kind!==$.LIST)Zg(e,t,n.ofType,i,r);else{let o=0;for(let s of t.values)Zg(e,s,n.ofType,i,Wc(r,o++,void 0))}else if(He(n)){if(t.kind!==$.OBJECT){Wi(e.onError,`Expected value of type "${n}" to be an object, found: ${Ye(t)}.`,t,r);return}let o=n.getFields(),s=r$(t.fields,l=>l.name.value);for(let l of Object.values(o)){let u=s[l.name];if(u===void 0)qi(l)&&Wi(e.onError,`Expected value of type "${n}" to include required field "${l.name}", found: ${Ye(t)}.`,t,r);else{let d=u.value;if(d.kind===$.VARIABLE&&!e.static){let p=nJ(e,d),f=d.name.value,m=p?.coerced[f];if(n.isOneOf)m===void 0?Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,r):m===null&&Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" not to be null.`,t,r);else if(m===void 0&&!qi(l))continue}Zg(e,d,l.type,i,Wc(r,l.name,n.name))}}let a=t.fields,c=[];for(let l of a){let u=l.name.value;if(Object.hasOwn(o,u))c.push(l);else{let d=i?"":Zn(lr(u,Object.keys(o)));Wi(e.onError,`Expected value of type "${n}" not to include unknown field "${u}"${d?`.${d} Found`:", found"}: ${Ye(t)}.`,l,r)}}if(n.isOneOf){if(c.length!==1){Wi(e.onError,p$(n),t,r);return}if(c[0].value.kind===$.NULL){let d=c[0].name.value;Wi(e.onError,p$(n),t,Wc(r,d,void 0))}}}else{wo(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(ya(t,e.variables,e.fragmentVariableValues),i):n.parseLiteral(t,void 0,i)}catch(a){if(a instanceof O){e.onError(a,Kg(r));return}s=a}o===void 0&&Wi(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${rJ(s)}"; found`:", found"}: ${Ye(t)}.`,t,r,Ug(s))}}function nJ(e,t){let n=t.name.value,{fragmentVariableValues:i,variables:r}=e;return i?.sources[n]?i:r}function Wi(e,t,n,i,r){e(new O(t,{nodes:n,originalError:r}),Kg(i))}function rJ(e){if(Kn(e)){let t=e.message;if(typeof t=="string"&&t!=="")return t}return String(e)}function p$(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var pe={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var Fd=2147483647,Ud=-2147483648,m$=new dr({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="number")return iJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return X_e(t);if(typeof t=="bigint")return oJ(t);throw new O(`Int cannot represent non-integer value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return iJ(e);if(typeof e=="bigint")return oJ(e);throw new O(`Int cannot represent non-integer value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.INT)throw new O(`Int cannot represent non-integer value: ${Ye(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>Fd||t=Ud)return{kind:$.INT,value:String(e)}}}),cJ=new dr({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=Yg(e);if(typeof t=="number")return sJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return eSe(t);if(typeof t=="bigint")return aJ(t);throw new O(`Float cannot represent non numeric value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return sJ(e);if(typeof e=="bigint")return aJ(e);throw new O(`Float cannot represent non numeric value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.FLOAT&&e.kind!==$.INT)throw new O(`Float cannot represent non numeric value: ${Ye(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=Hc(e);if(t.kind===$.FLOAT||t.kind===$.INT)return t}}),wt=new dr({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number")return tSe(t);if(typeof t=="bigint")return String(t);throw new O(`String cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e!="string")throw new O(`String cannot represent a non string value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==$.STRING)throw new O(`String cannot represent a non string value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Hc(e);if(t.kind===$.STRING)return t}}),ln=new dr({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=Yg(e);if(typeof t=="boolean")return t;if(typeof t=="number")return nSe(t);if(typeof t=="bigint")return t!==0n;throw new O(`Boolean cannot represent a non boolean value: ${ce(t)}`)},coerceInputValue(e){if(typeof e!="boolean")throw new O(`Boolean cannot represent a non boolean value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==$.BOOLEAN)throw new O(`Boolean cannot represent a non boolean value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Hc(e);if(t.kind===$.BOOLEAN)return t}}),g$=new dr({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=Yg(e);if(typeof t=="string")return t;if(typeof t=="number")return eD(t);if(typeof t=="bigint")return String(t);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e=="string")return e;if(typeof e=="number")return eD(e);if(typeof e=="bigint")return String(e);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==$.STRING&&e.kind!==$.INT)throw new O("ID cannot represent a non-string and non-integer value: "+Ye(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e=="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:$.INT,value:e}:{kind:$.STRING,value:e,block:!1};if(typeof e=="number")return{kind:$.INT,value:eD(e)};if(typeof e=="bigint")return{kind:$.INT,value:String(e)}}}),va=Object.freeze([wt,m$,cJ,ln,g$]);function tD(e){return va.some(({name:t})=>e.name===t)}function Yg(e){if(Kn(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!Kn(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function iJ(e){if(!Number.isInteger(e))throw new O(`Int cannot represent non-integer value: ${ce(e)}`);if(e>Fd||eFd||tFd||enew Ld(this,i,r))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Gc(this.args,t=>t.name,t=>t.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}},wa=new Tn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Included when true."}}}),ka=new Tn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Skipped when true."}}}),$o=new Tn({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(ln),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),_o=new Tn({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[pe.FIELD],args:{initialCount:{default:{value:0},type:new ve(m$),description:"Number of items to return immediately"},if:{type:new ve(ln),description:"Stream when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),nD="No longer supported",Jr=new Tn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[pe.FIELD_DEFINITION,pe.ARGUMENT_DEFINITION,pe.INPUT_FIELD_DEFINITION,pe.ENUM_VALUE,pe.DIRECTIVE_DEFINITION],args:{reason:{type:new ve(wt),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:nD}}}}),Qg=new Tn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[pe.SCALAR],args:{url:{type:new ve(wt),description:"The URL that specifies the behavior of this scalar."}}}),Xg=new Tn({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[pe.INPUT_OBJECT],args:{}}),AYe=new Tn({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[pe.QUERY,pe.MUTATION,pe.SUBSCRIPTION]}),fr=Object.freeze([wa,ka,Jr,Qg,Xg]);function Jc(e){return fr.some(({name:t})=>t===e.name)}function Zc(e,t){if(_e(t)){let n=Zc(e,t.ofType);return n?.kind===$.NULL?null:n}if(e===null)return{kind:$.NULL};if(e===void 0)return null;if(Ke(t)){let n=t.ofType;if(ts(e)){let i=[];for(let r of e){let o=Zc(r,n);o!=null&&i.push(o)}return{kind:$.LIST,values:i}}return Zc(e,n)}if(He(t)){if(!Kn(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=Zc(e[i.name],i.type);r&&n.push({kind:$.OBJECT_FIELD,name:{kind:$.NAME,value:i.name},value:r})}return{kind:$.OBJECT,fields:n}}if(hi(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n=="boolean")return{kind:$.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return uJ.test(i)?{kind:$.INT,value:i}:{kind:$.FLOAT,value:i}}if(typeof n=="bigint")return{kind:$.INT,value:String(n)};if(typeof n=="string")return Xt(t)?{kind:$.ENUM,value:n}:t===g$&&uJ.test(n)?{kind:$.INT,value:n}:{kind:$.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${ce(n)}.`)}it(!1,"Unexpected input type: "+ce(t))}var uJ=/^-?(?:0|[1-9][0-9]*)$/;function dJ(e){let t=e.type,n=e.default;if(n){let r=n.literal??ss(n.value,t);return r==null&&it(!1,"Invalid default value"),r}let i=e.defaultValue;if(i!==void 0){let r=Zc(i,t);return r==null&&it(!1,"Invalid default value"),r}}var eh=new Yn({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:wt,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ve(new qt(new ve(yi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new ve(yi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:yi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:yi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ve(new qt(new ve(rD))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),rD=new Yn({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. +)`)),n}function Yg(e,t){switch(e.kind){case _.NULL:return null;case _.INT:return parseInt(e.value,10);case _.FLOAT:return parseFloat(e.value);case _.STRING:case _.ENUM:case _.BOOLEAN:return e.value;case _.LIST:return e.values.map(n=>Yg(n,t));case _.OBJECT:return Bc(e.fields,n=>n.name.value,n=>Yg(n.value,t));case _.VARIABLE:return t?.[e.name.value]}}function Nr(e){if(e.length===0)throw new O("Expected name to be a non-empty string.");for(let t=1;tthis.coerceInputValue(Yg(n,i))),this.coerceOutputValue=t.coerceOutputValue??this.serialize,this.coerceInputValue=t.coerceInputValue??this.parseValue,this.coerceInputLiteral=t.coerceInputLiteral,this.valueToLiteral=t.valueToLiteral,this.extensions=cr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||fi(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`)),t.coerceInputLiteral&&(typeof t.coerceInputValue=="function"&&typeof t.coerceInputLiteral=="function"||fi(!1,`${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,coerceOutputValue:this.coerceOutputValue,coerceInputValue:this.coerceInputValue,coerceInputLiteral:this.coerceInputLiteral,valueToLiteral:this.valueToLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},Zn=class{constructor(t){this.__kind=oD,this.__kind=oD,this.name=Nr(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=cr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=aJ.bind(void 0,this,t.fields),this._interfaces=sJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function sJ(e){return y_(e??[])}function aJ(e,t){let n=eh(t);return ga(n,(i,r)=>new Wc(e,r,i))}var Wc=class{constructor(t,n,i){this.__kind=eSe,this.parentType=t,this.name=Nr(n),this.description=i.description,this.type=i.type;let r=i.args;this.args=r?Object.entries(r).map(([o,s])=>new Fd(this,o,s)):[],this.resolve=i.resolve,this.subscribe=i.subscribe,this.deprecationReason=i.deprecationReason,this.extensions=cr(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLField"}toConfig(){return{description:this.description,type:this.type,args:Bc(this.args,t=>t.name,t=>t.toConfig()),resolve:this.resolve,subscribe:this.subscribe,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType??""}.${this.name}`}toJSON(){return this.toString()}},Fd=class{constructor(t,n,i){this.__kind=XH,this.parent=t,this.name=Nr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=cr(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLArgument"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parent}(${this.name}:)`}toJSON(){return this.toString()}};function ha(e){return $e(e.type)&&e.default===void 0&&e.defaultValue===void 0}var ns=class{constructor(t){this.__kind=eJ,this.name=Nr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=cr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._fields=aJ.bind(void 0,this,t.fields),this._interfaces=sJ.bind(void 0,t.interfaces)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:ga(this.getFields(),t=>t.toConfig()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},rs=class{constructor(t){this.__kind=tJ,this.name=Nr(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=cr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._types=rSe.bind(void 0,t.types)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function rSe(e){return y_(e)}var gi=class{constructor(t){this.__kind=nJ,this.name=Nr(t.name),this.description=t.description,this.extensions=cr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._values=iSe.bind(void 0,this,t.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return typeof this._values=="function"&&(this._values=this._values()),this._values}getValue(t){return this._nameLookup??=u_(this.getValues(),n=>n.name),this._nameLookup[t]}serialize(t){return this.coerceOutputValue(t)}coerceOutputValue(t){this._valueLookup??=new Map(this.getValues().map(i=>[i.value,i]));let n=this._valueLookup.get(t);if(n===void 0)throw new O(`Enum "${this.name}" cannot represent value: ${ce(t)}`);return n.name}parseValue(t,n){return this.coerceInputValue(t,n)}coerceInputValue(t,n){if(typeof t!="string"){let r=ce(t);throw new O(`Enum "${this.name}" cannot represent non-string value: ${r}.`+(n?"":m_(this,r)))}let i=this.getValue(t);if(i==null)throw new O(`Value "${t}" does not exist in "${this.name}" enum.`+(n?"":m_(this,t)));return i.value}parseLiteral(t,n,i){return this.coerceInputLiteral(t,i)}coerceInputLiteral(t,n){if(t.kind!==_.ENUM){let r=Ye(t);throw new O(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+(n?"":m_(this,r)),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=Ye(t);throw new O(`Value "${r}" does not exist in "${this.name}" enum.`+(n?"":m_(this,r)),{nodes:t})}return i.value}valueToLiteral(t){if(typeof t=="string"&&this.getValue(t))return{kind:_.ENUM,value:t}}toConfig(){return{name:this.name,description:this.description,values:Bc(this.getValues(),t=>t.name,t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function iSe(e,t){let n=eh(t);return Object.entries(n).map(([i,r])=>new sD(e,i,r))}function m_(e,t){let n=e.getValues().map(r=>r.name),i=ar(t,n);return Jn("the enum value",i)}var sD=class{constructor(t,n,i){this.__kind=tSe,this.parentEnum=t,this.name=iD(n),this.description=i.description,this.value=i.value!==void 0?i.value:n,this.deprecationReason=i.deprecationReason,this.extensions=cr(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLEnumValue"}toConfig(){return{description:this.description,value:this.value,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentEnum.name}.${this.name}`}toJSON(){return this.toString()}},is=class{constructor(t){this.__kind=rJ,this.name=Nr(t.name),this.description=t.description,this.extensions=cr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this.isOneOf=t.isOneOf??!1,this._fields=oSe.bind(void 0,this,t.fields)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){return{name:this.name,description:this.description,fields:ga(this.getFields(),t=>t.toConfig()),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}};function oSe(e,t){let n=eh(t);return ga(n,(i,r)=>new aD(e,r,i))}var aD=class{constructor(t,n,i){"resolve"in i&&fi(!1,`${t}.${n} field has a resolve property, but Input Types cannot define resolvers.`),this.__kind=nSe,this.parentType=t,this.name=Nr(n),this.description=i.description,this.type=i.type,this.defaultValue=i.defaultValue,this.default=i.default,this._memoizedCoercedDefaultValue=void 0,this.deprecationReason=i.deprecationReason,this.extensions=cr(i.extensions),this.astNode=i.astNode}get[Symbol.toStringTag](){return"GraphQLInputField"}toConfig(){return{description:this.description,type:this.type,defaultValue:this.defaultValue,default:this.default,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode}}toString(){return`${this.parentType}.${this.name}`}toJSON(){return this.toString()}};function qi(e){return $e(e.type)&&e.defaultValue===void 0&&e.default===void 0}function Kc(e,t,n){return t===n?!0:$e(n)?$e(t)?Kc(e,t.ofType,n.ofType):!1:$e(t)?Kc(e,t.ofType,n):He(n)?He(t)?Kc(e,t.ofType,n.ofType):!1:He(t)?!1:Kr(n)&&(Be(t)||ot(t))&&e.isSubType(n,t)}function b_(e,t,n){return t===n?!0:Kr(t)?Kr(n)?e.getPossibleTypes(t).some(i=>e.isSubType(n,i)):e.isSubType(t,n):Kr(n)?e.isSubType(n,t):!1}function Hc(e,t,n){return{prev:e,key:t,typename:n}}function th(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function ss(e,t){if($e(t))return e==null?void 0:ss(e,t.ofType);if(e==null)return{kind:_.NULL};if(He(t)){if(!ts(e))return ss(e,t.ofType);let i=[];for(let r of e){let o=ss(r,t.ofType);if(!o)return;i.push(o)}return{kind:_.LIST,values:i}}if(Ke(t)){if(!Kn(e))return;let i=[],r=t.getFields();if(Object.keys(e).some(s=>e[s]!==void 0&&!Object.hasOwn(r,s)))return;for(let s of Object.values(t.getFields()))if(e[s.name]===void 0){if(qi(s))return}else{let c=ss(e[s.name],s.type);if(!c)return;i.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:s.name},value:c})}return{kind:_.OBJECT,fields:i}}let n=wo(t);if(n.valueToLiteral)try{return n.valueToLiteral(e)}catch{return}return Jc(e)}function Jc(e){if(e==null)return{kind:_.NULL};switch(typeof e){case"boolean":return{kind:_.BOOLEAN,value:e};case"string":return{kind:_.STRING,value:e,block:!1};case"bigint":return{kind:_.INT,value:e.toString()};case"number":{if(!Number.isFinite(e))return{kind:_.NULL};let t=String(e);return/^-?(?:0|[1-9][0-9]*)$/.test(t)?{kind:_.INT,value:t}:{kind:_.FLOAT,value:t}}case"object":{if(ts(e))return{kind:_.LIST,values:Array.from(e,Jc)};let t=e,n=[];for(let i of Object.keys(t)){let r=t[i];r!==void 0&&n.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:i},value:Jc(r)})}return{kind:_.OBJECT,fields:n}}}throw new TypeError(`Cannot convert value to AST: ${ce(e)}.`)}function ya(e,t,n){switch(e.kind){case _.VARIABLE:{let i=e.name.value,r=n?.sources[i];if(r){let s=r.value;if(s===void 0){let a=r.signature.default;return a!==void 0?a.literal:{kind:_.NULL}}return ya(s,t,r.fragmentVariableValues)}let o=t?.sources[i];if(o==null)return{kind:_.NULL};if(o.value===void 0){let s=o.signature.default;if(s!==void 0)return s.literal}return ss(o.value,o.signature.type)}case _.OBJECT:{let i=[];for(let r of e.fields){if(r.value.kind===_.VARIABLE){let s=n?.sources[r.value.name.value]??t?.sources[r.value.name.value];if(s?.value===void 0&&s?.signature.default===void 0)continue}let o=ya(r.value,t,n);i.push({...r,value:o})}return{...e,fields:i}}case _.LIST:{let i=[];for(let r of e.values){let o=ya(r,t,n);i.push(o)}return{...e,values:i}}default:return e}}function w_(e,t,n,i){return nh(e,t,n,i,void 0)}function nh(e,t,n,i,r){if($e(t)){if(e===void 0){ba(n,`Expected a value of non-null type "${t}" to be provided.`,r);return}if(e===null){ba(n,`Expected value of non-null type "${t}" not to be null.`,r);return}return nh(e,t.ofType,n,i,r)}if(e!=null)if(He(t))if(!ts(e))nh(e,t.ofType,n,i,r);else{let o=0;for(let s of e)nh(s,t.ofType,n,i,Hc(r,o++,void 0))}else if(Ke(t)){if(!Kn(e)||Array.isArray(e)){ba(n,`Expected value of type "${t}" to be an object, found: ${ce(e)}.`,r);return}let o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];c===void 0?qi(a)&&ba(n,`Expected value of type "${t}" to include required field "${a.name}", found: ${ce(e)}.`,r):nh(c,a.type,n,i,Hc(r,a.name,t.name))}let s=[];for(let a of Object.keys(e))if(e[a]!==void 0){if(!Object.hasOwn(o,a)){let c=i?"":Jn(ar(a,Object.keys(o)));ba(n,`Expected value of type "${t}" not to include unknown field "${a}"${c?`.${c} Found`:", found"}: ${ce(e)}.`,r);continue}s.push(a)}if(t.isOneOf){s.length!==1&&ba(n,v_(t),r);let a=s[0];e[a]===null&&ba(n,v_(t),Hc(r,a,t.name))}}else{wo(t);let o,s;try{o=t.coerceInputValue(e,i)}catch(a){if(a instanceof O){n(a,th(r));return}s=a}o===void 0&&ba(n,`Expected value of type "${t}"${s!=null?`, but encountered error "${lJ(s)}"; found`:", found"}: ${ce(e)}.`,r,Wg(s))}}function ba(e,t,n,i){e(new O(t,{originalError:i}),th(n))}function Zc(e,t,n,i,r,o){return rh({static:!i&&!r,onError:n,variables:i,fragmentVariableValues:r},e,t,o,void 0)}function rh(e,t,n,i,r){if(t.kind===_.VARIABLE){if(e.static)return;let s=cJ(e,t)?.coerced[t.name.value];$e(n)&&(s===void 0?Wi(e.onError,`Expected variable "$${t.name.value}" provided to type "${n}" to provide a runtime value.`,t,r):s===null&&Wi(e.onError,`Expected variable "$${t.name.value}" provided to non-null type "${n}" not to be null.`,t,r));return}if($e(n)){if(t.kind===_.NULL){Wi(e.onError,`Expected value of non-null type "${n}" not to be null.`,t,r);return}return rh(e,t,n.ofType,i,r)}if(t.kind!==_.NULL)if(He(n))if(t.kind!==_.LIST)rh(e,t,n.ofType,i,r);else{let o=0;for(let s of t.values)rh(e,s,n.ofType,i,Hc(r,o++,void 0))}else if(Ke(n)){if(t.kind!==_.OBJECT){Wi(e.onError,`Expected value of type "${n}" to be an object, found: ${Ye(t)}.`,t,r);return}let o=n.getFields(),s=u_(t.fields,l=>l.name.value);for(let l of Object.values(o)){let u=s[l.name];if(u===void 0)qi(l)&&Wi(e.onError,`Expected value of type "${n}" to include required field "${l.name}", found: ${Ye(t)}.`,t,r);else{let d=u.value;if(d.kind===_.VARIABLE&&!e.static){let p=cJ(e,d),f=d.name.value,m=p?.coerced[f];if(n.isOneOf)m===void 0?Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" to provide a runtime value.`,t,r):m===null&&Wi(e.onError,`Expected variable "$${f}" provided to field "${l.name}" for OneOf Input Object type "${n}" not to be null.`,t,r);else if(m===void 0&&!qi(l))continue}rh(e,d,l.type,i,Hc(r,l.name,n.name))}}let a=t.fields,c=[];for(let l of a){let u=l.name.value;if(Object.hasOwn(o,u))c.push(l);else{let d=i?"":Jn(ar(u,Object.keys(o)));Wi(e.onError,`Expected value of type "${n}" not to include unknown field "${u}"${d?`.${d} Found`:", found"}: ${Ye(t)}.`,l,r)}}if(n.isOneOf){if(c.length!==1){Wi(e.onError,v_(n),t,r);return}if(c[0].value.kind===_.NULL){let d=c[0].name.value;Wi(e.onError,v_(n),t,Hc(r,d,void 0))}}}else{wo(n);let o,s;try{o=n.coerceInputLiteral?n.coerceInputLiteral(ya(t,e.variables,e.fragmentVariableValues),i):n.parseLiteral(t,void 0,i)}catch(a){if(a instanceof O){e.onError(a,th(r));return}s=a}o===void 0&&Wi(e.onError,`Expected value of type "${n}"${s!=null?`, but encountered error "${lJ(s)}"; found`:", found"}: ${Ye(t)}.`,t,r,Wg(s))}}function cJ(e,t){let n=t.name.value,{fragmentVariableValues:i,variables:r}=e;return i?.sources[n]?i:r}function Wi(e,t,n,i,r){e(new O(t,{nodes:n,originalError:r}),th(i))}function lJ(e){if(Kn(e)){let t=e.message;if(typeof t=="string"&&t!=="")return t}return String(e)}function v_(e){return`Within OneOf Input Object type "${e}", exactly one field must be specified, and the value for that field must be non-null.`}var pe={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};var Ud=2147483647,jd=-2147483648,k_=new lr({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",coerceOutputValue(e){let t=ih(e);if(typeof t=="number")return uJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return sSe(t);if(typeof t=="bigint")return dJ(t);throw new O(`Int cannot represent non-integer value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return uJ(e);if(typeof e=="bigint")return dJ(e);throw new O(`Int cannot represent non-integer value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==_.INT)throw new O(`Int cannot represent non-integer value: ${Ye(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>Ud||t=jd)return{kind:_.INT,value:String(e)}}}),mJ=new lr({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",coerceOutputValue(e){let t=ih(e);if(typeof t=="number")return pJ(t);if(typeof t=="boolean")return t?1:0;if(typeof t=="string")return aSe(t);if(typeof t=="bigint")return fJ(t);throw new O(`Float cannot represent non numeric value: ${ce(t)}`)},coerceInputValue(e){if(typeof e=="number")return pJ(e);if(typeof e=="bigint")return fJ(e);throw new O(`Float cannot represent non numeric value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==_.FLOAT&&e.kind!==_.INT)throw new O(`Float cannot represent non numeric value: ${Ye(e)}`,{nodes:e});return parseFloat(e.value)},valueToLiteral(e){let t=Jc(e);if(t.kind===_.FLOAT||t.kind===_.INT)return t}}),wt=new lr({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",coerceOutputValue(e){let t=ih(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number")return cSe(t);if(typeof t=="bigint")return String(t);throw new O(`String cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e!="string")throw new O(`String cannot represent a non string value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_.STRING)throw new O(`String cannot represent a non string value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Jc(e);if(t.kind===_.STRING)return t}}),cn=new lr({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",coerceOutputValue(e){let t=ih(e);if(typeof t=="boolean")return t;if(typeof t=="number")return lSe(t);if(typeof t=="bigint")return t!==0n;throw new O(`Boolean cannot represent a non boolean value: ${ce(t)}`)},coerceInputValue(e){if(typeof e!="boolean")throw new O(`Boolean cannot represent a non boolean value: ${ce(e)}`);return e},coerceInputLiteral(e){if(e.kind!==_.BOOLEAN)throw new O(`Boolean cannot represent a non boolean value: ${Ye(e)}`,{nodes:e});return e.value},valueToLiteral(e){let t=Jc(e);if(t.kind===_.BOOLEAN)return t}}),__=new lr({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',coerceOutputValue(e){let t=ih(e);if(typeof t=="string")return t;if(typeof t=="number")return cD(t);if(typeof t=="bigint")return String(t);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputValue(e){if(typeof e=="string")return e;if(typeof e=="number")return cD(e);if(typeof e=="bigint")return String(e);throw new O(`ID cannot represent value: ${ce(e)}`)},coerceInputLiteral(e){if(e.kind!==_.STRING&&e.kind!==_.INT)throw new O("ID cannot represent a non-string and non-integer value: "+Ye(e),{nodes:e});return e.value},valueToLiteral(e){if(typeof e=="string")return/^-?(?:0|[1-9][0-9]*)$/.test(e)?{kind:_.INT,value:e}:{kind:_.STRING,value:e,block:!1};if(typeof e=="number")return{kind:_.INT,value:cD(e)};if(typeof e=="bigint")return{kind:_.INT,value:String(e)}}}),va=Object.freeze([wt,k_,mJ,cn,__]);function lD(e){return va.some(({name:t})=>e.name===t)}function ih(e){if(Kn(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!Kn(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function uJ(e){if(!Number.isInteger(e))throw new O(`Int cannot represent non-integer value: ${ce(e)}`);if(e>Ud||eUd||tUd||enew Fd(this,i,r))}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Bc(this.args,t=>t.name,t=>t.toConfig()),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}},wa=new xn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(cn),description:"Included when true."}}}),ka=new xn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[pe.FIELD,pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(cn),description:"Skipped when true."}}}),_o=new xn({name:"defer",description:"Directs the executor to defer this fragment when the `if` argument is true or undefined.",locations:[pe.FRAGMENT_SPREAD,pe.INLINE_FRAGMENT],args:{if:{type:new ve(cn),description:"Deferred when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),$o=new xn({name:"stream",description:"Directs the executor to stream plural fields when the `if` argument is true or undefined.",locations:[pe.FIELD],args:{initialCount:{default:{value:0},type:new ve(k_),description:"Number of items to return immediately"},if:{type:new ve(cn),description:"Stream when true or undefined.",default:{value:!0}},label:{type:wt,description:"Unique name"}}}),uD="No longer supported",Hr=new xn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[pe.FIELD_DEFINITION,pe.ARGUMENT_DEFINITION,pe.INPUT_FIELD_DEFINITION,pe.ENUM_VALUE,pe.DIRECTIVE_DEFINITION],args:{reason:{type:new ve(wt),description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",default:{value:uD}}}}),oh=new xn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[pe.SCALAR],args:{url:{type:new ve(wt),description:"The URL that specifies the behavior of this scalar."}}}),sh=new xn({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[pe.INPUT_OBJECT],args:{}}),M8e=new xn({name:"experimental_disableErrorPropagation",description:"Disables error propagation.",locations:[pe.QUERY,pe.MUTATION,pe.SUBSCRIPTION]}),dr=Object.freeze([wa,ka,Hr,oh,sh]);function Yc(e){return dr.some(({name:t})=>t===e.name)}function Qc(e,t){if($e(t)){let n=Qc(e,t.ofType);return n?.kind===_.NULL?null:n}if(e===null)return{kind:_.NULL};if(e===void 0)return null;if(He(t)){let n=t.ofType;if(ts(e)){let i=[];for(let r of e){let o=Qc(r,n);o!=null&&i.push(o)}return{kind:_.LIST,values:i}}return Qc(e,n)}if(Ke(t)){if(!Kn(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=Qc(e[i.name],i.type);r&&n.push({kind:_.OBJECT_FIELD,name:{kind:_.NAME,value:i.name},value:r})}return{kind:_.OBJECT,fields:n}}if(hi(t)){let n=t.coerceOutputValue(e);if(n==null)return null;if(typeof n=="boolean")return{kind:_.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return hJ.test(i)?{kind:_.INT,value:i}:{kind:_.FLOAT,value:i}}if(typeof n=="bigint")return{kind:_.INT,value:String(n)};if(typeof n=="string")return Qt(t)?{kind:_.ENUM,value:n}:t===__&&hJ.test(n)?{kind:_.INT,value:n}:{kind:_.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${ce(n)}.`)}it(!1,"Unexpected input type: "+ce(t))}var hJ=/^-?(?:0|[1-9][0-9]*)$/;function yJ(e){let t=e.type,n=e.default;if(n){let r=n.literal??ss(n.value,t);return r==null&&it(!1,"Invalid default value"),r}let i=e.defaultValue;if(i!==void 0){let r=Qc(i,t);return r==null&&it(!1,"Invalid default value"),r}}var ah=new Zn({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:wt,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new ve(new qt(new ve(yi))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new ve(yi),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:yi,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:yi,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new ve(new qt(new ve(dD))),args:{includeDeprecated:{type:new ve(cn),default:{value:!1}}},resolve:(e,{includeDeprecated:t})=>t===!0?e.getDirectives():e.getDirectives().filter(n=>n.deprecationReason==null)}})}),dD=new Zn({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. -In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isRepeatable:{type:new ve(ln),resolve:e=>e.isRepeatable},locations:{type:new ve(new qt(new ve(iD))),resolve:e=>e.locations},args:{type:new ve(new qt(new ve(th))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),iD=new gi({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:pe.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:pe.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:pe.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:pe.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:pe.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:pe.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:pe.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:pe.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:pe.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:pe.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:pe.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:pe.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:pe.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:pe.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:pe.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:pe.UNION,description:"Location adjacent to a union definition."},ENUM:{value:pe.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:pe.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:pe.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:pe.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:pe.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),yi=new Yn({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new ve(aD),resolve(e){if(pr(e))return Ln.SCALAR;if(at(e))return Ln.OBJECT;if(Be(e))return Ln.INTERFACE;if(Qt(e))return Ln.UNION;if(Xt(e))return Ln.ENUM;if(He(e))return Ln.INPUT_OBJECT;if(Ke(e))return Ln.LIST;if(_e(e))return Ln.NON_NULL;it(!1,`Unexpected type: "${ce(e)}".`)}},name:{type:wt,resolve:e=>"name"in e?e.name:void 0},description:{type:wt,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:wt,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new qt(new ve(oD)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(at(e)||Be(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new qt(new ve(yi)),resolve(e){if(at(e)||Be(e))return e.getInterfaces()}},possibleTypes:{type:new qt(new ve(yi)),resolve(e,t,n,{schema:i}){if(Kr(e))return i.getPossibleTypes(e)}},enumValues:{type:new qt(new ve(sD)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Xt(e)){let n=e.getValues();return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new qt(new ve(th)),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(He(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:yi,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:ln,resolve:e=>{if(He(e))return e.isOneOf}}})}),oD=new Yn({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},args:{type:new ve(new qt(new ve(th))),args:{includeDeprecated:{type:new ve(ln),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new ve(yi),resolve:e=>e.type},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),th=new Yn({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},type:{type:new ve(yi),resolve:e=>e.type},defaultValue:{type:wt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=dJ(e);return t?Ye(t):null}},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),sD=new Yn({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isDeprecated:{type:new ve(ln),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),Ln={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},aD=new gi({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Ln.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Ln.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Ln.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Ln.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Ln.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Ln.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Ln.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Ln.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),y$=new Bc(void 0,"__schema",{type:new ve(eh),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:i})=>i}),b$=new Bc(void 0,"__type",{type:yi,description:"Request the type information of a single type.",args:{name:{type:new ve(wt)}},resolve:(e,{name:t},n,{schema:i})=>i.getType(t)}),v$=new Bc(void 0,"__typename",{type:new ve(wt),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:i})=>i.name}),$a=Object.freeze([eh,rD,iD,yi,oD,th,sD,aD]);function cD(e){return $a.some(({name:t})=>e.name===t)}var rSe=Symbol("Schema"),nh=class{constructor(t){this.__kind=rSe,this.assumeValid=t.assumeValid??!1,this.__validationErrors=t.assumeValid===!0?[]:void 0,this.description=t.description,this.extensions=ur(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=t.directives??fr;let n=new Set(t.types);if(t.types!=null)for(let i of t.types)n.delete(i),Hi(i,n);this._queryType!=null&&Hi(this._queryType,n),this._mutationType!=null&&Hi(this._mutationType,n),this._subscriptionType!=null&&Hi(this._subscriptionType,n);for(let i of this._directives)if(h$(i))for(let r of i.args)Hi(r.type,n);Hi(eh,n),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let i of n){if(i==null)continue;let r=i.name;if(this._typeMap[r]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${r}".`);if(this._typeMap[r]=i,Be(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.interfaces.push(i)}}else if(at(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.objects.push(i)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Jn.QUERY:return this.getQueryType();case Jn.MUTATION:return this.getMutationType();case Jn.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Qt(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){return this._implementationsMap[t.name]??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap.get(t);if(i===void 0){if(Qt(t))i=new Set(t.getTypes());else{let r=this.getImplementations(t);i=new Set([...r.objects,...r.interfaces])}this._subTypeMap.set(t,i)}return i.has(n)}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}getField(t,n){switch(n){case y$.name:return this.getQueryType()===t?y$:void 0;case b$.name:return this.getQueryType()===t?b$:void 0;case v$.name:return v$}if("getFields"in t)return t.getFields()[n]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function Hi(e,t){let n=ko(e);if(!t.has(n)){if(t.add(n),Qt(n))for(let i of n.getTypes())Hi(i,t);else if(at(n)||Be(n)){for(let i of n.getInterfaces())Hi(i,t);for(let i of Object.values(n.getFields())){Hi(i.type,t);for(let r of i.args)Hi(r.type,t)}}else if(He(n))for(let i of Object.values(n.getFields()))Hi(i.type,t)}return t}function pJ(e,t,n,i){if(e.literal){Kc(e.literal,t,n,void 0,void 0,i);return}f$(e.value,t,n,i)}function Ft(e,t,n){return new O(`Syntax Error: ${n}`,{source:e,positions:[t]})}function iSe(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule=="function"&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}var Yc=iSe(),lD=Yc?.tracingChannel("graphql:parse"),a9e=Yc?.tracingChannel("graphql:validate"),c9e=Yc?.tracingChannel("graphql:execute"),l9e=Yc?.tracingChannel("graphql:execute:variableCoercion"),u9e=Yc?.tracingChannel("graphql:execute:rootSelectionSet"),d9e=Yc?.tracingChannel("graphql:subscribe"),p9e=Yc?.tracingChannel("graphql:resolve"),oSe=["start","end","asyncStart","asyncEnd","error"];function fJ(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of oSe)if(e[n].hasSubscribers)return!0;return!1}var B={SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};var ih=class{constructor(t){let n=new Pd(B.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==B.EOF)do if(t.next)t=t.next;else{let n=sSe(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===B.COMMENT);return t}};function gJ(e){return e===B.BANG||e===B.DOLLAR||e===B.AMP||e===B.PAREN_L||e===B.PAREN_R||e===B.DOT||e===B.SPREAD||e===B.COLON||e===B.EQUALS||e===B.AT||e===B.BRACKET_L||e===B.BRACKET_R||e===B.BRACE_L||e===B.PIPE||e===B.BRACE_R}function jd(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function k$(e,t){return hJ(e.charCodeAt(t))&&yJ(e.charCodeAt(t+1))}function hJ(e){return e>=55296&&e<=56319}function yJ(e){return e>=56320&&e<=57343}function Qc(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return B.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function un(e,t,n,i,r){let o=e.line,s=1+n-e.lineStart;return new Pd(t,n,i,o,s,r)}function sSe(e,t){let n=e.source.body,i=n.length,r=t;for(;r=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function pSe(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` -`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ft(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function fSe(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,s=o,a="",c=[];for(;o0||fi(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||fi(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function vJ(e){return Nr(e,bJ,zd)}function dD(e,t){return fJ(lD)?lD.traceSync(()=>wJ(e,t),{source:e}):wJ(e,t)}function wJ(e,t){let n=new uD(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var uD=class{constructor(t,n={}){let{lexer:i,...r}=n;if(i)this._lexer=i;else{let o=vJ(t)?t:new zd(t);this._lexer=new ih(o)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(B.NAME);return this.node(t,{kind:$.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:$.DOCUMENT,definitions:this.many(B.SOF,this.parseDefinition,B.EOF)})}parseDefinition(){if(this.peek(B.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===B.BRACE_L)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===B.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(B.BRACE_L))return this.node(t,{kind:$.OPERATION_DEFINITION,operation:Jn.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),i=this.parseOperationType(),r;return this.peek(B.NAME)&&(r=this.parseName()),this.node(t,{kind:$.OPERATION_DEFINITION,operation:i,description:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(B.NAME);switch(t.value){case"query":return Jn.QUERY;case"mutation":return Jn.MUTATION;case"subscription":return Jn.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(B.PAREN_L,this.parseVariableDefinition,B.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:$.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(B.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(B.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(B.DOLLAR),this.node(t,{kind:$.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:$.SELECTION_SET,selections:this.many(B.BRACE_L,this.parseSelection,B.BRACE_R)})}parseSelection(){return this.peek(B.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(B.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:$.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(B.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(B.PAREN_L,n,B.PAREN_R)}parseFragmentArguments(){let t=this.parseFragmentArgument;return this.optionalMany(B.PAREN_L,t,B.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:$.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let t=this._lexer.token,n=this.parseName();return this.expectToken(B.COLON),this.node(t,{kind:$.FRAGMENT_ARGUMENT,name:n,value:this.parseValueLiteral(!1)})}parseFragment(){let t=this._lexer.token;this.expectToken(B.SPREAD);let n=this.expectOptionalKeyword("on");if(!n&&this.peek(B.NAME)){let i=this.parseFragmentName();return this.peek(B.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(t,{kind:$.FRAGMENT_SPREAD,name:i,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(t,{kind:$.FRAGMENT_SPREAD,name:i,directives:this.parseDirectives(!1)})}return this.node(t,{kind:$.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0?this.node(t,{kind:$.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:$.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case B.BRACKET_L:return this.parseList(t);case B.BRACE_L:return this.parseObject(t);case B.INT:return this.advanceLexer(),this.node(n,{kind:$.INT,value:n.value});case B.FLOAT:return this.advanceLexer(),this.node(n,{kind:$.FLOAT,value:n.value});case B.STRING:case B.BLOCK_STRING:return this.parseStringLiteral();case B.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:$.BOOLEAN,value:!0});case"false":return this.node(n,{kind:$.BOOLEAN,value:!1});case"null":return this.node(n,{kind:$.NULL});default:return this.node(n,{kind:$.ENUM,value:n.value})}case B.DOLLAR:if(t)if(this.expectToken(B.DOLLAR),this._lexer.token.kind===B.NAME){let i=this._lexer.token.value;throw Ft(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:$.STRING,value:t.value,block:t.kind===B.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:$.LIST,values:this.any(B.BRACKET_L,n,B.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:$.OBJECT,fields:this.any(B.BRACE_L,n,B.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:$.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(B.AT);)n.push(this.parseDirective(t));if(n.length)return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(B.AT),this.node(n,{kind:$.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(B.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(B.BRACKET_R),n=this.node(t,{kind:$.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(B.BANG)?this.node(t,{kind:$.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:$.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(B.STRING)||this.peek(B.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);return this.node(t,{kind:$.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(B.COLON);let i=this.parseNamedType();return this.node(t,{kind:$.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:$.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:$.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(B.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseFieldDefinition,B.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(B.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:$.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(B.PAREN_L,this.parseInputValueDef,B.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(B.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(B.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:$.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:$.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:$.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(B.EQUALS)?this.delimitedMany(B.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:$.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(B.BRACE_L,this.parseEnumValueDefinition,B.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:$.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ft(this._lexer.source,this._lexer.token.start,`${$$(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:$.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseInputValueDef,B.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===B.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);if(n===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:$.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:$.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:$.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:$.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:$.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(B.AT);let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:$.DIRECTIVE_EXTENSION,name:n,directives:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(B.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.parseConstDirectives(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:$.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,directives:o,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(B.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.hasOwn(pe,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(B.AT),i=this.parseName(),r;!n&&this.expectOptionalToken(B.DOT)&&(r=this.parseName());let o;return(n||r)&&this.expectOptionalToken(B.PAREN_L)&&(o=this.parseName(),this.expectToken(B.COLON),this.expectToken(B.PAREN_R)),n?o?this.node(t,{kind:$.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:o}):this.node(t,{kind:$.DIRECTIVE_COORDINATE,name:i}):r?o?this.node(t,{kind:$.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:o}):this.node(t,{kind:$.MEMBER_COORDINATE,name:i,memberName:r}):this.node(t,{kind:$.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new jg(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Ft(this._lexer.source,n.start,`Expected ${kJ(t)}, found ${$$(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===B.NAME&&n.value===t)this.advanceLexer();else throw Ft(this._lexer.source,n.start,`Expected "${t}", found ${$$(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===B.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return Ft(this._lexer.source,n.start,`Unexpected ${$$(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==B.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw Ft(this._lexer.source,n.start,`Document contains more than ${t} tokens. Parsing aborted.`)}};function $$(e){let t=e.value;return kJ(e.kind)+(t!=null?` "${t}"`:"")}function kJ(e){return gJ(e)?`"${e}"`:e}function vn(e,t){switch(t.kind){case $.LIST_TYPE:{let n=vn(e,t.type);return n&&new qt(n)}case $.NON_NULL_TYPE:{let n=vn(e,t.type);return n&&new ve(n)}case $.NAMED_TYPE:return e.getType(t.name.value)}}function $J(e){let t=new Map;return{Directive(n){if(n.name.value===$o.name||n.name.value===_o.name){let r=n.arguments?.find(s=>s.name.value==="label")?.value;if(!r||r.kind===$.NULL)return;if(r.kind!==$.STRING){e.reportError(new O(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(r.value);o!=null?e.reportError(new O('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(r.value,n)}}}}function SJ(e){return{OperationDefinition(t){let n=e.getDocument(),i=new Map;for(let s of n.definitions)s.kind===$.FRAGMENT_DEFINITION&&i.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);o&&pD({context:e,operationType:t.operation,rootType:o,fragments:i,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:r,visitedFragments:o}){for(let s of r.selections)if(s.kind==="Field"){let a=s.directives?.find(c=>c.name.value===_o.name);a&&e.reportError(new O(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let c=i.get(a);if(c){let l=_J(s);l!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:l})),pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:c.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=_J(s);a!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a})),pD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:s.selectionSet,visitedFragments:o})}}function _J(e){return e.directives?.find(t=>t.name.value===$o.name)}function xJ(e){let t=e.arguments?.find(n=>n.name.value==="if");if(!t)return!1;if(t.value.kind===$.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==$.VARIABLE)return!1;return!0}function gSe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t&&t.value.kind===$.BOOLEAN?!!t.value.value:!0}function hSe(e){let t=e.arguments?.find(n=>n.name.value==="if");return t?t?.value.kind===$.BOOLEAN?!t.value.value:!0:!1}function EJ(e){return{OperationDefinition(t){if(t.operation!==Jn.SUBSCRIPTION)return;let n=e.getDocument(),i=new Map;for(let o of n.definitions)o.kind===$.FRAGMENT_DEFINITION&&i.set(o.name.value,o);let r=new Set;fD({context:e,fragments:i,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:r})}}}function fD({context:e,fragments:t,selectionSet:n,parentNodes:i,visitedFragments:r}){for(let o of n.selections){let s=o.directives?.find(c=>c.name.value===ka.name);if(s&&gSe(s))continue;let a=o.directives?.find(c=>c.name.value===wa.name);if(!(a&&hSe(a))){for(let c of o.directives??[])c.name.value===$o.name?xJ(c)||e.reportError(new O("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[c,...i]})):c.name.value===_o.name&&(xJ(c)||e.reportError(new O("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[c,...i]})));if(o.kind==="FragmentSpread"){let c=o.name.value;if(r.has(c))continue;r.add(c);let l=t.get(c);l&&fD({context:e,fragments:t,parentNodes:[o,...i],selectionSet:l?.selectionSet,visitedFragments:r})}else o.selectionSet&&fD({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:i,visitedFragments:r})}}}function mD(e){return e.kind===$.OPERATION_DEFINITION||e.kind===$.FRAGMENT_DEFINITION}function gD(e){return e.kind===$.SCHEMA_DEFINITION||_a(e)||e.kind===$.DIRECTIVE_DEFINITION}function _a(e){return e.kind===$.SCALAR_TYPE_DEFINITION||e.kind===$.OBJECT_TYPE_DEFINITION||e.kind===$.INTERFACE_TYPE_DEFINITION||e.kind===$.UNION_TYPE_DEFINITION||e.kind===$.ENUM_TYPE_DEFINITION||e.kind===$.INPUT_OBJECT_TYPE_DEFINITION}function hD(e){return e.kind===$.SCHEMA_EXTENSION||e.kind===$.DIRECTIVE_EXTENSION||_$(e)}function _$(e){return e.kind===$.SCALAR_TYPE_EXTENSION||e.kind===$.OBJECT_TYPE_EXTENSION||e.kind===$.INTERFACE_TYPE_EXTENSION||e.kind===$.UNION_TYPE_EXTENSION||e.kind===$.ENUM_TYPE_EXTENSION||e.kind===$.INPUT_OBJECT_TYPE_EXTENSION}function TJ(e){return{Document(t){for(let n of t.definitions)if(!mD(n)){let i=n.kind===$.SCHEMA_DEFINITION||n.kind===$.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new O(`The ${i} definition is not executable.`,{nodes:n}))}return!1}}}function IJ(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),o=t.name.value,s=Zn("to use an inline fragment on",e.hideSuggestions?[]:ySe(r,n,o));s===""&&(s=Zn(e.hideSuggestions?[]:bSe(n,o))),e.reportError(new O(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}function ySe(e,t,n){if(!Kr(t))return[];let i=new Set,r=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]!=null){i.add(o),r[o.name]=1;for(let s of o.getInterfaces())s.getFields()[n]!=null&&(i.add(s),r[s.name]=(r[s.name]??0)+1)}return[...i].sort((o,s)=>{let a=r[s.name]-r[o.name];return a!==0?a:Be(o)&&e.isSubType(o,s)?-1:Be(s)&&e.isSubType(s,o)?1:Dd(o.name,s.name)}).map(o=>o.name)}function bSe(e,t){if(at(e)||Be(e)){let n=Object.keys(e.getFields());return lr(t,n)}return[]}function AJ(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let i=vn(e.getSchema(),n);if(i&&!os(i)){let r=Ye(n);e.reportError(new O(`Fragment cannot condition on non composite type "${r}".`,{nodes:n}))}}},FragmentDefinition(t){let n=vn(e.getSchema(),t.typeCondition);if(n&&!os(n)){let i=Ye(t.typeCondition);e.reportError(new O(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}}function RJ(e){return{...yD(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n&&!n.variableDefinitions.get(t.name.value)){let r=t.name.value,o=e.hideSuggestions?[]:lr(r,Array.from(n.variableDefinitions.values()).map(s=>s.variable.name.value));e.reportError(new O(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+Zn(o),{nodes:t}))}},Argument(t){let n=e.getArgument(),i=e.getFieldDef();if(!n&&i){let r=t.name.value,o=e.hideSuggestions?[]:lr(r,i.args.map(s=>s.name));e.reportError(new O(`Unknown argument "${r}" on field "${i}".`+Zn(o),{nodes:t}))}}}}function yD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let o of i)t.set(o.name,o.args.map(s=>s.name));let r=e.getDocument().definitions;for(let o of r)if(o.kind===$.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,s.map(a=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let c of o.arguments){let l=c.name.value;if(!a.includes(l)){let u=lr(l,a);e.reportError(new O(`Unknown argument "${l}" on directive "@${s}".`+(e.hideSuggestions?"":Zn(u)),{nodes:c}))}}return!1}}}function bD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let o of i)t.set(o.name,o.locations);let r=e.getDocument().definitions;for(let o of r)o.kind===$.DIRECTIVE_DEFINITION&&t.set(o.name.value,o.locations.map(s=>s.value));return{Directive(o,s,a,c,l){let u=o.name.value,d=t.get(u);if(d==null){e.reportError(new O(`Unknown directive "@${u}".`,{nodes:o}));return}let p=vSe(l);p!=null&&!d.includes(p)&&e.reportError(new O(`Directive "@${u}" may not be used on ${p}.`,{nodes:o}))}}}function vSe(e){let t=e.at(-1);switch(t!=null&&"kind"in t||it(!1),t.kind){case $.OPERATION_DEFINITION:return wSe(t.operation);case $.FIELD:return pe.FIELD;case $.FRAGMENT_SPREAD:return pe.FRAGMENT_SPREAD;case $.INLINE_FRAGMENT:return pe.INLINE_FRAGMENT;case $.FRAGMENT_DEFINITION:return pe.FRAGMENT_DEFINITION;case $.VARIABLE_DEFINITION:{let n=e[e.length-3];return"kind"in n||it(!1),n.kind===$.OPERATION_DEFINITION?pe.VARIABLE_DEFINITION:pe.FRAGMENT_VARIABLE_DEFINITION}case $.SCHEMA_DEFINITION:case $.SCHEMA_EXTENSION:return pe.SCHEMA;case $.SCALAR_TYPE_DEFINITION:case $.SCALAR_TYPE_EXTENSION:return pe.SCALAR;case $.OBJECT_TYPE_DEFINITION:case $.OBJECT_TYPE_EXTENSION:return pe.OBJECT;case $.FIELD_DEFINITION:return pe.FIELD_DEFINITION;case $.INTERFACE_TYPE_DEFINITION:case $.INTERFACE_TYPE_EXTENSION:return pe.INTERFACE;case $.UNION_TYPE_DEFINITION:case $.UNION_TYPE_EXTENSION:return pe.UNION;case $.ENUM_TYPE_DEFINITION:case $.ENUM_TYPE_EXTENSION:return pe.ENUM;case $.ENUM_VALUE_DEFINITION:return pe.ENUM_VALUE;case $.INPUT_OBJECT_TYPE_DEFINITION:case $.INPUT_OBJECT_TYPE_EXTENSION:return pe.INPUT_OBJECT;case $.INPUT_VALUE_DEFINITION:{let n=e.at(-3);return n!=null&&"kind"in n||it(!1),n.kind===$.INPUT_OBJECT_TYPE_DEFINITION||n.kind===$.INPUT_OBJECT_TYPE_EXTENSION?pe.INPUT_FIELD_DEFINITION:pe.ARGUMENT_DEFINITION}case $.DIRECTIVE_DEFINITION:case $.DIRECTIVE_EXTENSION:return pe.DIRECTIVE_DEFINITION;default:it(!1,"Unexpected kind: "+ce(t.kind))}}function wSe(e){switch(e){case Jn.QUERY:return pe.QUERY;case Jn.MUTATION:return pe.MUTATION;case Jn.SUBSCRIPTION:return pe.SUBSCRIPTION}}function NJ(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new O(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function CJ(e){let t=e.getSchema();return{OperationDefinition(n){let i=n.operation;t.getRootType(i)||e.reportError(new O(`The ${i} operation is not supported by the schema.`,{nodes:n}))}}}function vD(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},i=new Set([...Object.keys(n),...t.filter(_a).map(r=>r.name.value)]);return{NamedType(r,o,s,a,c){let l=r.name.value;if(!i.has(l)){let u=c[2]??s,d=u!=null&&kSe(u);if(d&&PJ.has(l))return;let p=e.hideSuggestions?[]:lr(l,d?[...PJ,...i]:[...i]);e.reportError(new O(`Unknown type "${l}".`+Zn(p),{nodes:r}))}}}}var PJ=new Set([...va,...$a].map(e=>e.name));function kSe(e){return"kind"in e&&(gD(e)||hD(e))}function DJ(e){let t=0;return{Document(n){t=n.definitions.filter(i=>i.kind===$.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new O("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function OJ(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),i=0;return{SchemaDefinition(r){if(n){e.reportError(new O("Cannot define a new schema within a schema extension.",{nodes:r}));return}i>0&&e.reportError(new O("Must provide only one schema definition.",{nodes:r})),++i}}}var $Se=3;function MJ(e){function t(n,i=Object.create(null),r=0){if(n.kind===$.FRAGMENT_SPREAD){let o=n.name.value;if(i[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return i[o]=!0,t(s,i,r)}finally{i[o]=void 0}}if(n.kind===$.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(r++,r>=$Se))return!0;if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,i,r))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new O("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function LJ(e){let t=new Set,n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return r(o),!1}};function r(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){i[s]=n.length;for(let c of a){let l=c.name.value,u=i[l];if(n.push(c),u===void 0){let d=e.getFragment(l);d&&r(d)}else{let d=n.slice(u),p=d.slice(0,-1).map(f=>'"'+f.name.value+'"').join(", ");e.reportError(new O(`Cannot spread fragment "${l}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:d}))}n.pop()}i[s]=void 0}}}function FJ(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map(r=>r.variable.name.value)),i=e.getRecursiveVariableUsages(t);for(let{node:r,fragmentVariableDefinition:o}of i){if(o)continue;let s=r.name.value;n.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[r,t]}))}}}}function UJ(e){let t=new Set,n=[];return{OperationDefinition(i){for(let r of e.getRecursivelyReferencedFragments(i))t.add(r.name.value);return!1},FragmentDefinition(i){return n.push(i),!1},Document:{leave(){for(let i of n){let r=i.name.value;t.has(r)||e.reportError(new O(`Fragment "${r}" is never used.`,{nodes:i}))}}}}}function jJ(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),i=new Set(n.map(({node:o})=>o.name.value)),r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),i=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;s||i.add(a)}let r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function oh(e){switch(e.kind){case $.OBJECT:return{...e,fields:_Se(e.fields)};case $.LIST:return{...e,values:e.values.map(oh)};case $.INT:case $.FLOAT:case $.STRING:case $.BOOLEAN:case $.NULL:case $.ENUM:case $.VARIABLE:return e}}function _Se(e){return e.map(t=>({...t,value:oh(t.value)})).sort((t,n)=>Dd(t.name.value,n.name.value))}function VJ(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+VJ(n)).join(" and "):e}function BJ(e){let t=new T$,n=new $D,i=new Map;return{SelectionSet(r){let o=SSe(e,i,t,n,e.getParentType(),r);for(let[[s,a],c,l]of o){let u=VJ(a);e.reportError(new O(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function SSe(e,t,n,i,r,o){let s=[],[a,c]=E$(e,t,r,o,void 0);if(ESe(e,s,t,n,i,a),c.length!==0)for(let l=0;l1)for(let c=0;c[o.value,i===void 0?s:sh(s,i)]));return e.every(o=>{let s=o.value;t&&(s=sh(s,t));let a=r.get(o.name.value);return a===void 0?!1:zJ(s)===zJ(a)})}function sh(e,t){switch(e.kind){case $.VARIABLE:return t.get(e.name.value)??e;case $.LIST:return{...e,values:e.values.map(n=>sh(n,t))};case $.OBJECT:return{...e,fields:e.fields.map(n=>({...n,value:sh(n.value,t)}))};default:return e}}function zJ(e){return Ye(oh(e))}function GJ(e){return e?.find(t=>t.name.value==="stream")}function TSe(e,t,n,i){let r=GJ(e),o=GJ(n);if(!(!r&&!o))return r&&o&&SD(r.arguments,t,o.arguments,i)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives"}function wD(e,t){return Ke(e)?Ke(t)?wD(e.ofType,t.ofType):!0:Ke(t)?!0:_e(e)?_e(t)?wD(e.ofType,t.ofType):!0:_e(t)?!0:hi(e)||hi(t)?e!==t:!1}function E$(e,t,n,i,r){let o=t.get(i);if(o)return o;let s=new Map,a=new Map;WJ(e,n,i,s,a,r);let c=[s,Array.from(a.values())];return t.set(i,c),c}function kD(e,t,n,i){let r=t.get(n.selectionSet);if(r)return r;let o=vn(e.getSchema(),n.typeCondition);return E$(e,t,o,n.selectionSet,i)}function WJ(e,t,n,i,r,o){for(let s of n.selections)switch(s.kind){case $.FIELD:{let a=s.name.value,c;(at(t)||Be(t))&&(c=t.getFields()[a]);let l=s.alias?s.alias.value:a,u=i.get(l);u==null&&(u=[],i.set(l,u)),u.push([t,s,c]);break}case $.FRAGMENT_SPREAD:{let a=ISe(e,s,o);r.set(a.key,a);break}case $.INLINE_FRAGMENT:{let a=s.typeCondition,c=a?vn(e.getSchema(),a):t;WJ(e,c,s.selectionSet,i,r,o);break}}}function ISe(e,t,n){let i="",r=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){i+=t.name.value+"(";for(let[a,c]of o.variableDefinitions){let l=s.get(a);l&&(i+=a+": "+Ye(oh(l)));let u=s.get(a);u!==void 0?r.set(a,n!==void 0?sh(u,n):u):c.defaultValue&&r.set(a,c.defaultValue)}i+=")"}return{key:i,node:t,varMap:r.size>0?r:void 0}}function ASe(e,t,n,i){if(e.length>0)return[[t,e.map(([r])=>r)],[n,...e.map(([,r])=>r).flat()],[i,...e.map(([,,r])=>r).flat()]]}var T$=class{constructor(){this._data=new Map}has(t,n,i){let r=this._data.get(t)?.get(n);return r===void 0?!1:i?!0:i===r}add(t,n,i){let r=this._data.get(t);r===void 0?this._data.set(t,new Map([[n,i]])):r.set(n,i)}},$D=class{constructor(){this._orderedPairSet=new T$}has(t,n,i){return tr.name.value));for(let r of n.args)!i.has(r.name)&&ha(r)&&e.reportError(new O(`Argument "${r}" of type "${r.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let i=new Set(t.arguments?.map(r=>r.name.value));for(let[r,o]of n.variableDefinitions)if(!i.has(r)&&ZJ(o)){let s=vn(e.getSchema(),o.type),a=ce(s);e.reportError(new O(`Fragment "${t.name.value}" argument "${r}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function xD(e){let t=new Map,i=e.getSchema()?.getDirectives()??fr;for(let o of i)t.set(o.name,new Map(o.args.filter(ha).map(s=>[s.name,s])));let r=e.getDocument().definitions;for(let o of r)if(o.kind===$.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(ZJ).map(a=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let c=o.arguments??[],l=new Set(c.map(u=>u.name.value));for(let[u,d]of a.entries())if(!l.has(u)){let p=qg(d.type)?ce(d.type):Ye(d.type);e.reportError(new O(`Argument "@${s}(${u}:)" of type "${p}" is required, but it was not provided.`,{nodes:o}))}}}}}}function ZJ(e){return e.type.kind===$.NON_NULL_TYPE&&e.defaultValue==null}function YJ(e){return{Field(t){let n=e.getType(),i=t.selectionSet;if(n)if(hi(ko(n))){if(i){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" must not have a selection since type "${o}" has no subfields.`,{nodes:i}))}}else if(i){if(i.selections.length===0){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}else{let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function So(e,t){if(_e(t))return e==null?void 0:So(e,t.ofType);if(e==null)return null;if(Ke(t)){if(!ts(e)){let r=So(e,t.ofType);return r===void 0?void 0:[r]}let i=[];for(let r of e){let o=So(r,t.ofType);if(o===void 0)return;i.push(o)}return i}if(He(t)){if(!Kn(e)||Array.isArray(e))return;let i=Object.create(null),r=t.getFields(),o=0;for(let s of Object.keys(e))if(e[s]!==void 0&&(o++,!Object.hasOwn(r,s)))return;for(let s of Object.values(r)){let a=e[s.name];if(a===void 0){if(qi(s))return;let c=I$(s);c!==void 0&&(i[s.name]=c)}else{let c=So(a,s.type);if(c===void 0)return;i[s.name]=c}}if(t.isOneOf){let s=Object.keys(i);if(o!==1||s.length!==1)return;let a=s[0];if(i[a]===null)return}return i}let n=wo(t);try{return n.coerceInputValue(e)}catch{}}function as(e,t,n,i){if(e.kind===$.VARIABLE){let o=QJ(e,n,i);return o==null&&_e(t)?void 0:o}if(_e(t))return e.kind===$.NULL?void 0:as(e,t.ofType,n,i);if(e.kind===$.NULL)return null;if(Ke(t)){if(e.kind!==$.LIST){let s=as(e,t.ofType,n,i);return s===void 0?void 0:[s]}let o=[];for(let s of e.values){let a=as(s,t.ofType,n,i);if(a===void 0)if(s.kind===$.VARIABLE&&QJ(s,n,i)==null&&!_e(t.ofType))a=null;else return;o.push(a)}return o}if(He(t)){if(e.kind!==$.OBJECT)return;let o=Object.create(null),s=t.getFields();if(e.fields.some(l=>!Object.hasOwn(s,l.name.value)))return;let c=new Map(e.fields.map(l=>[l.name.value,l]));for(let l of Object.values(s)){let u=c.get(l.name);if(!u||u.value.kind===$.VARIABLE&&DSe(u.value,n,i)){if(qi(l))return;let d=I$(l);d!==void 0&&(o[l.name]=d)}else{let d=as(u.value,l.type,n,i);if(d===void 0)return;o[l.name]=d}}if(t.isOneOf){let l=Object.keys(o);if(c.size!==1||l.length!==1)return;for(let[u,d]of c)if(d.value.kind===$.NULL||o[u]===null)return}return o}let r=wo(t);try{return r.coerceInputLiteral?r.coerceInputLiteral(ya(e,n,i)):r.parseLiteral(e,n?.coerced)}catch{}}function QJ(e,t,n){let i=e.name.value;return n?.sources[i]!==void 0?n.coerced[i]:t?.coerced[i]}function DSe(e,t,n){let i=e.name.value;return(n?.sources[i]!==void 0?n.coerced:t?.coerced)?.[i]===void 0}function I$(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0)return t=n.literal?as(n.literal,e.type):So(n.value,e.type),t===void 0&&it(!1,`Expected value of type "${e.type}" to be valid, found: ${ce(n.literal??n.value)}.`),e._memoizedCoercedDefaultValue=t,t;let i=e.defaultValue;return i!==void 0&&(e._memoizedCoercedDefaultValue=i),i}function XJ(e,t,n,i,r){try{let o=I$(n);o!==void 0&&(e[t]=o)}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;pJ(s,n.type,(c,l)=>{a=!0,i(c,l)},r),a||i(Ug(o),[])}}function eZ(e,t,n,i,r){let o=e.arguments??[],s=new Map(o.map(l=>[l.name.value,l])),a=Object.create(null),c=Object.create(null);for(let[l,u]of Object.entries(t)){let d=s.get(l);d!==void 0?a[l]=i==null?{signature:u,value:d.value}:{signature:u,value:d.value,fragmentVariableValues:i}:a[l]={signature:u},tZ(c,e,l,u,d,n,i,r)}return{sources:a,coerced:c}}function A$(e,t,n,i,r){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map(c=>[c.name.value,c]));for(let c of e.args){let l=c.name;tZ(o,t,l,c,a.get(c.name),n,i,r)}return o}function tZ(e,t,n,i,r,o,s,a){let c=i.type,l=(p,f)=>{throw new O(`${ED(i,t)} has invalid default value${zP(f)}: ${p.message}`,{nodes:t})};if(!r){if(ha(i))throw new O(`${ED(i,t)} of required type "${c}" was not provided.`,{nodes:t});XJ(e,n,i,l,a);return}let u=r.value;if(u.kind===$.VARIABLE){let p=u.name.value,f=s?.sources[p]?s:o;if((f==null||!Object.hasOwn(f.coerced,p))&&!ha(i)){XJ(e,n,i,l,a);return}}let d=as(u,c,o,s);d===void 0&&(Kc(u,c,(p,f)=>{throw p.message=`${ED(i,t)} has invalid value${zP(f)}: ${p.message}`,p},o,s,a),it(!1,"Invalid argument")),e[n]=d}function ED(e,t){return c$(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function Gd(e,t,n,i,r){let o=t.directives?.find(s=>s.name.value===e.name);if(o)return A$(e,o,n,i,r)}function iZ(e,t,n,i,r,o,s=!1){let a=new Cr,c=[],l={schema:e,fragments:t,variableValues:n,runtimeType:i,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return R$(l,r,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:l.forbiddenDirectiveInstances}}function R$(e,t,n,i,r,o){let{schema:s,fragments:a,variableValues:c,runtimeType:l,visitedFragmentNames:u,hideSuggestions:d}=e;for(let p of t.selections)switch(p.kind){case $.FIELD:{if(!TD(e,p,c,o))continue;n.add(OSe(p),{node:p,deferUsage:r,fragmentVariableValues:o});break}case $.INLINE_FRAGMENT:{if(!TD(e,p,c,o)||!rZ(s,p,l))continue;let f=nZ(c,o,p,r);f?(i.push(f),R$(e,p.selectionSet,n,i,f,o)):R$(e,p.selectionSet,n,i,r,o);break}case $.FRAGMENT_SPREAD:{let f=p.name.value;if(!TD(e,p,c,o))continue;let m=a[f];if(m==null||!rZ(s,m.definition,l))continue;let g=nZ(c,o,p,r),h=u.get(f),b;if(g){if(h!==void 0)continue;u.set(f,!0),i.push(g),b=g}else{if(h===!1)continue;u.set(f,!1),b=r}let y=m.variableSignatures,w;y&&(w=eZ(p,y,c,o,d)),R$(e,m.definition.selectionSet,n,i,b,w);break}}}function nZ(e,t,n,i){let r=Gd($o,n,e,t);if(r&&r.if!==!1)return{label:typeof r.label=="string"?r.label:void 0,parentDeferUsage:i}}function TD(e,t,n,i){let r=t.directives?.find(c=>c.name.value===ka.name);if(r&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(r),!1;if((r?A$(ka,r,n,i,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find(c=>c.name.value===wa.name);return s&&e.forbidSkipAndInclude?(e.forbiddenDirectiveInstances.push(s),!1):(s?A$(wa,s,n,i,e.hideSuggestions):void 0)?.if!==!1}function rZ(e,t,n){let i=t.typeCondition;if(!i)return!0;let r=vn(e,i);return r===n?!0:Kr(r)?e.isSubType(r,n):!1}function OSe(e){return e.alias?e.alias.value:e.name.value}function ID(e){return e.map(t=>t.node)}function oZ(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),i=n.getSubscriptionType();if(i){let r=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let u of s.definitions)u.kind===$.FRAGMENT_DEFINITION&&(a[u.name.value]={definition:u});let{groupedFieldSet:c,forbiddenDirectiveInstances:l}=iZ(n,a,o,i,t.selectionSet,e.hideSuggestions,!0);if(l.length>0){e.reportError(new O(r!=null?`Subscription "${r}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:l}));return}if(c.size>1){let p=[...c.values()].slice(1).flatMap(f=>ID(f));e.reportError(new O(r!=null?`Subscription "${r}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())ID(u)[0].name.value.startsWith("__")&&e.reportError(new O(r!=null?`Subscription "${r}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:ID(u)}))}}}}}function sZ(e){return{Directive(t){let n=e.getFieldDef(),i=e.getParentType();n&&i&&t.name.value===_o.name&&!(Ke(n.type)||Bi(n.type)&&Ke(n.type.ofType))&&e.reportError(new O(`Directive "@stream" cannot be used on non-list field "${i}.${n.name}".`,{nodes:t}))}}}function Vd(e,t){let n=new Cr;for(let i of e)n.add(t(i),i);return n}function aZ(e){return{DirectiveDefinition(i){let r=i.arguments??[];return n(`@${i.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(i){let r=i.name.value,o=i.fields??[];for(let s of o){let a=s.name.value,c=s.arguments??[];n(`${r}.${a}`,c)}return!1}function n(i,r){let o=Vd(r,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new O(`Argument "${i}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function AD(e){return{Field:t,Directive:t};function t(n){let i=n.arguments??[],r=Vd(i,o=>o.name.value);for(let[o,s]of r)s.length>1&&e.reportError(new O(`There can be only one argument named "${o}".`,{nodes:s.map(a=>a.name)}))}}function cZ(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(i){let r=i.name.value;if(n?.getDirective(r)){e.reportError(new O(`Directive "@${r}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}));return}let o=t.get(r);return o?e.reportError(new O(`There can be only one directive named "@${r}".`,{nodes:[o,i.name]})):t.set(r,i.name),!1}}}function RD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():fr;for(let c of i)t.set(c.name,!c.isRepeatable);let r=e.getDocument().definitions;for(let c of r)c.kind===$.DIRECTIVE_DEFINITION&&t.set(c.name.value,!c.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(c){if(!("directives"in c)||!c.directives)return;let l;if(c.kind===$.SCHEMA_DEFINITION||c.kind===$.SCHEMA_EXTENSION)l=o;else if(_a(c)||_$(c)){let u=c.name.value;l=s.get(u),l===void 0&&(l=new Map,s.set(u,l))}else if(c.kind===$.DIRECTIVE_DEFINITION||c.kind===$.DIRECTIVE_EXTENSION){let u=c.name.value;l=a.get(u),l===void 0&&(l=new Map,a.set(u,l))}else l=new Map;for(let u of c.directives){let d=u.name.value;if(t.get(d)===!0){let p=l.get(d);p!=null?e.reportError(new O(`The directive "@${d}" can only be used once at this location.`,{nodes:[p,u]})):l.set(d,u)}}}}}function lZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{EnumTypeDefinition:r,EnumTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.values??[];for(let l of c){let u=l.name.value,d=n[s];if(Xt(d)&&d.getValue(u)){e.reportError(new O(`Enum value "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let p=a.get(u);p!=null?e.reportError(new O(`Enum value "${s}.${u}" can only be defined once.`,{nodes:[p,l.name]})):a.set(u,l.name)}return!1}}function uZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{InputObjectTypeDefinition:r,InputObjectTypeExtension:r,InterfaceTypeDefinition:r,InterfaceTypeExtension:r,ObjectTypeDefinition:r,ObjectTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.fields??[];for(let l of c){let u=l.name.value;if(MSe(n[s],u)){e.reportError(new O(`Field "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let d=a.get(u);d!=null?e.reportError(new O(`Field "${s}.${u}" can only be defined once.`,{nodes:[d,l.name]})):a.set(u,l.name)}return!1}}function MSe(e,t){return at(e)||Be(e)||He(e)?e.getFields()[t]!=null:!1}function dZ(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let i=n.name.value,r=t.get(i);return r!=null?e.reportError(new O(`There can be only one fragment named "${i}".`,{nodes:[r,n.name]})):t.set(i,n.name),!1}}}function ND(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let i=t.pop();i==null&&it(!1),n=i}},ObjectField(i){let r=i.name.value,o=n.get(r);o!=null?e.reportError(new O(`There can be only one input field named "${r}".`,{nodes:[o,i.name]})):n.set(r,i.name)}}}function pZ(e){let t=new Map;return{OperationDefinition(n){let i=n.name;if(i!=null){let r=t.get(i.value);r!=null?e.reportError(new O(`There can be only one operation named "${i.value}".`,{nodes:[r,i]})):t.set(i.value,i)}return!1},FragmentDefinition:()=>!1}}function fZ(e){let t=e.getSchema(),n=new Map,i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:r,SchemaExtension:r};function r(o){let s=o.operationTypes??[];for(let a of s){let c=a.operation,l=n.get(c);i[c]?e.reportError(new O(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:a})):l?e.reportError(new O(`There can be only one ${c} type in schema.`,{nodes:[l,a]})):n.set(c,a)}return!1}}function mZ(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(r){let o=r.name.value;if(n?.getType(o)){e.reportError(new O(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}let s=t.get(o);return s!=null?e.reportError(new O(`There can be only one type named "${o}".`,{nodes:[s,r.name]})):t.set(o,r.name),!1}}function gZ(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],i=Vd(n,r=>r.variable.name.value);for(let[r,o]of i)o.length>1&&e.reportError(new O(`There can be only one variable named "$${r}".`,{nodes:o.map(s=>s.variable.name)}))}}}function hZ(e){return{NullValue:t=>Sa(e,t,e.getInputType()),ListValue:t=>Sa(e,t,e.getParentInputType()),ObjectValue:t=>Sa(e,t,e.getInputType()),EnumValue:t=>Sa(e,t,e.getInputType()),IntValue:t=>Sa(e,t,e.getInputType()),FloatValue:t=>Sa(e,t,e.getInputType()),StringValue:t=>Sa(e,t,e.getInputType()),BooleanValue:t=>Sa(e,t,e.getInputType())}}function Sa(e,t,n){return n&&Kc(t,n,i=>{e.reportError(i)},void 0,void 0,e.hideSuggestions),!1}function yZ(e){return{VariableDefinition(t){let n=vn(e.getSchema(),t.type);if(n!==void 0&&!Wg(n)){let i=t.variable.name.value,r=Ye(t.type);e.reportError(new O(`Variable "$${i}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function bZ(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let i=e.getRecursiveVariableUsages(n);for(let{node:r,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:c}of i){let l=r.name.value,u=c;if(u??=t.get(l),u&&o){let d=e.getSchema(),p=vn(d,u.type);p&&!LSe(d,p,u.defaultValue,o,a)&&e.reportError(new O(`Variable "$${l}" of type "${p}" used in position expecting type "${o}".`,{nodes:[u,r]})),He(s)&&s.isOneOf&&l$(p)&&e.reportError(new O(`Variable "$${l}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[u,r]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function LSe(e,t,n,i,r){if(_e(i)&&!_e(t)){if(!(n!=null&&n.kind!==$.NULL)&&!(r!==void 0))return!1;let a=i.ofType;return qc(e,t,a)}return qc(e,t,i)}var FSe=Object.freeze([MJ]),USe=Object.freeze([TJ,CJ,pZ,DJ,oZ,vD,AJ,yZ,YJ,IJ,dZ,NJ,UJ,HJ,LJ,gZ,FJ,jJ,bD,RD,SJ,EJ,$J,sZ,RJ,AD,hZ,JJ,bZ,BJ,ND,...FSe]),vZ=Object.freeze([OJ,fZ,mZ,lZ,uZ,aZ,cZ,vD,bD,RD,KJ,yD,AD,ND,xD]);var CD=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let i of this.getDocument().definitions)i.kind===$.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===$.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=new Set,r=[t.selectionSet],o;for(;o=r.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(!i.has(a)){i.add(a);let c=this.getFragment(a);c&&(n.push(c),r.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},N$=class extends CD{constructor(t,n,i){super(t,i),this._schema=n}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};var set=ga(zg,e=>e.filter(t=>t!=="description")),aet=new O("Too many validation errors, error limit reached. Validation aborted.");function jSe(e,t,n=vZ){let i=[],r=new N$(e,t,s=>{i.push(s)}),o=n.map(s=>s(r));return Md(e,WP(o)),i}function wZ(e){let t=jSe(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` +In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isRepeatable:{type:new ve(cn),resolve:e=>e.isRepeatable},locations:{type:new ve(new qt(new ve(pD))),resolve:e=>e.locations},args:{type:new ve(new qt(new ve(ch))),args:{includeDeprecated:{type:new ve(cn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},isDeprecated:{type:new ve(cn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),pD=new gi({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:pe.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:pe.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:pe.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:pe.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:pe.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:pe.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:pe.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:pe.VARIABLE_DEFINITION,description:"Location adjacent to an operation variable definition."},FRAGMENT_VARIABLE_DEFINITION:{value:pe.FRAGMENT_VARIABLE_DEFINITION,description:"Location adjacent to a fragment variable definition."},SCHEMA:{value:pe.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:pe.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:pe.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:pe.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:pe.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:pe.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:pe.UNION,description:"Location adjacent to a union definition."},ENUM:{value:pe.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:pe.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:pe.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:pe.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:pe.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}}),yi=new Zn({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new ve(gD),resolve(e){if(ur(e))return Mn.SCALAR;if(ot(e))return Mn.OBJECT;if(Be(e))return Mn.INTERFACE;if(Yt(e))return Mn.UNION;if(Qt(e))return Mn.ENUM;if(Ke(e))return Mn.INPUT_OBJECT;if(He(e))return Mn.LIST;if($e(e))return Mn.NON_NULL;it(!1,`Unexpected type: "${ce(e)}".`)}},name:{type:wt,resolve:e=>"name"in e?e.name:void 0},description:{type:wt,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:wt,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new qt(new ve(fD)),args:{includeDeprecated:{type:new ve(cn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(ot(e)||Be(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new qt(new ve(yi)),resolve(e){if(ot(e)||Be(e))return e.getInterfaces()}},possibleTypes:{type:new qt(new ve(yi)),resolve(e,t,n,{schema:i}){if(Kr(e))return i.getPossibleTypes(e)}},enumValues:{type:new qt(new ve(mD)),args:{includeDeprecated:{type:new ve(cn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Qt(e)){let n=e.getValues();return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new qt(new ve(ch)),args:{includeDeprecated:{type:new ve(cn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){if(Ke(e)){let n=Object.values(e.getFields());return t===!0?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:yi,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:cn,resolve:e=>{if(Ke(e))return e.isOneOf}}})}),fD=new Zn({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},args:{type:new ve(new qt(new ve(ch))),args:{includeDeprecated:{type:new ve(cn),default:{value:!1}}},resolve(e,{includeDeprecated:t}){return t===!0?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new ve(yi),resolve:e=>e.type},isDeprecated:{type:new ve(cn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),ch=new Zn({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},type:{type:new ve(yi),resolve:e=>e.type},defaultValue:{type:wt,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let t=yJ(e);return t?Ye(t):null}},isDeprecated:{type:new ve(cn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),mD=new Zn({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new ve(wt),resolve:e=>e.name},description:{type:wt,resolve:e=>e.description},isDeprecated:{type:new ve(cn),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:wt,resolve:e=>e.deprecationReason}})}),Mn={SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"},gD=new gi({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:Mn.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:Mn.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:Mn.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:Mn.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:Mn.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:Mn.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:Mn.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:Mn.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),S_=new Wc(void 0,"__schema",{type:new ve(ah),description:"Access the current type schema of this server.",resolve:(e,t,n,{schema:i})=>i}),x_=new Wc(void 0,"__type",{type:yi,description:"Request the type information of a single type.",args:{name:{type:new ve(wt)}},resolve:(e,{name:t},n,{schema:i})=>i.getType(t)}),E_=new Wc(void 0,"__typename",{type:new ve(wt),description:"The name of the current Object type at runtime.",resolve:(e,t,n,{parentType:i})=>i.name}),_a=Object.freeze([ah,dD,pD,yi,fD,ch,mD,gD]);function hD(e){return _a.some(({name:t})=>e.name===t)}var uSe=Symbol("Schema"),lh=class{constructor(t){this.__kind=uSe,this.assumeValid=t.assumeValid??!1,this.__validationErrors=t.assumeValid===!0?[]:void 0,this.description=t.description,this.extensions=cr(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes??[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=t.directives??dr;let n=new Set(t.types);if(t.types!=null)for(let i of t.types)n.delete(i),Ki(i,n);this._queryType!=null&&Ki(this._queryType,n),this._mutationType!=null&&Ki(this._mutationType,n),this._subscriptionType!=null&&Ki(this._subscriptionType,n);for(let i of this._directives)if($_(i))for(let r of i.args)Ki(r.type,n);Ki(ah,n),this._typeMap=Object.create(null),this._subTypeMap=new Map,this._implementationsMap=Object.create(null);for(let i of n){if(i==null)continue;let r=i.name;if(this._typeMap[r]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${r}".`);if(this._typeMap[r]=i,Be(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.interfaces.push(i)}}else if(ot(i)){for(let o of i.getInterfaces())if(Be(o)){let s=this._implementationsMap[o.name];s??=this._implementationsMap[o.name]={objects:[],interfaces:[]},s.objects.push(i)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case Hn.QUERY:return this.getQueryType();case Hn.MUTATION:return this.getMutationType();case Hn.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Yt(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){return this._implementationsMap[t.name]??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap.get(t);if(i===void 0){if(Yt(t))i=new Set(t.getTypes());else{let r=this.getImplementations(t);i=new Set([...r.objects,...r.interfaces])}this._subTypeMap.set(t,i)}return i.has(n)}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}getField(t,n){switch(n){case S_.name:return this.getQueryType()===t?S_:void 0;case x_.name:return this.getQueryType()===t?x_:void 0;case E_.name:return E_}if("getFields"in t)return t.getFields()[n]}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.assumeValid}}};function Ki(e,t){let n=ko(e);if(!t.has(n)){if(t.add(n),Yt(n))for(let i of n.getTypes())Ki(i,t);else if(ot(n)||Be(n)){for(let i of n.getInterfaces())Ki(i,t);for(let i of Object.values(n.getFields())){Ki(i.type,t);for(let r of i.args)Ki(r.type,t)}}else if(Ke(n))for(let i of Object.values(n.getFields()))Ki(i.type,t)}return t}function bJ(e,t,n,i){if(e.literal){Zc(e.literal,t,n,void 0,void 0,i);return}w_(e.value,t,n,i)}function Ft(e,t,n){return new O(`Syntax Error: ${n}`,{source:e,positions:[t]})}function dSe(){let e;try{let t=globalThis.process;typeof t?.getBuiltinModule=="function"&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}var Xc=dSe(),yD=Xc?.tracingChannel("graphql:parse"),m9e=Xc?.tracingChannel("graphql:validate"),g9e=Xc?.tracingChannel("graphql:execute"),h9e=Xc?.tracingChannel("graphql:execute:variableCoercion"),y9e=Xc?.tracingChannel("graphql:execute:rootSelectionSet"),b9e=Xc?.tracingChannel("graphql:subscribe"),v9e=Xc?.tracingChannel("graphql:resolve"),pSe=["start","end","asyncStart","asyncEnd","error"];function vJ(e){if(e==null)return!1;let t=e.hasSubscribers;if(t!==void 0)return t;for(let n of pSe)if(e[n].hasSubscribers)return!0;return!1}var B={SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",DOT:".",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"};var dh=class{constructor(t){let n=new Dd(B.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==B.EOF)do if(t.next)t=t.next;else{let n=fSe(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===B.COMMENT);return t}};function kJ(e){return e===B.BANG||e===B.DOLLAR||e===B.AMP||e===B.PAREN_L||e===B.PAREN_R||e===B.DOT||e===B.SPREAD||e===B.COLON||e===B.EQUALS||e===B.AT||e===B.BRACKET_L||e===B.BRACKET_R||e===B.BRACE_L||e===B.PIPE||e===B.BRACE_R}function zd(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function I_(e,t){return _J(e.charCodeAt(t))&&$J(e.charCodeAt(t+1))}function _J(e){return e>=55296&&e<=56319}function $J(e){return e>=56320&&e<=57343}function el(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return B.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ln(e,t,n,i,r){let o=e.line,s=1+n-e.lineStart;return new Dd(t,n,i,o,s,r)}function fSe(e,t){let n=e.source.body,i=n.length,r=t;for(;r=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function vSe(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` +`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ft(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function wSe(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,s=o,a="",c=[];for(;o0||fi(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||fi(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function xJ(e){return Rr(e,SJ,Gd)}function vD(e,t){return vJ(yD)?yD.traceSync(()=>EJ(e,t),{source:e}):EJ(e,t)}function EJ(e,t){let n=new bD(e,t),i=n.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:n.tokenCount}),i}var bD=class{constructor(t,n={}){let{lexer:i,...r}=n;if(i)this._lexer=i;else{let o=xJ(t)?t:new Gd(t);this._lexer=new dh(o)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let t=this.expectToken(B.NAME);return this.node(t,{kind:_.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:_.DOCUMENT,definitions:this.many(B.SOF,this.parseDefinition,B.EOF)})}parseDefinition(){if(this.peek(B.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===B.BRACE_L)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===B.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw Ft(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if(n.value==="extend")return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(B.BRACE_L))return this.node(t,{kind:_.OPERATION_DEFINITION,operation:Hn.QUERY,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});let n=this.parseDescription(),i=this.parseOperationType(),r;return this.peek(B.NAME)&&(r=this.parseName()),this.node(t,{kind:_.OPERATION_DEFINITION,operation:i,description:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(B.NAME);switch(t.value){case"query":return Hn.QUERY;case"mutation":return Hn.MUTATION;case"subscription":return Hn.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(B.PAREN_L,this.parseVariableDefinition,B.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:_.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(B.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(B.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(B.DOLLAR),this.node(t,{kind:_.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_.SELECTION_SET,selections:this.many(B.BRACE_L,this.parseSelection,B.BRACE_R)})}parseSelection(){return this.peek(B.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(B.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:_.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(B.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(B.PAREN_L,n,B.PAREN_R)}parseFragmentArguments(){let t=this.parseFragmentArgument;return this.optionalMany(B.PAREN_L,t,B.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:_.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){let t=this._lexer.token,n=this.parseName();return this.expectToken(B.COLON),this.node(t,{kind:_.FRAGMENT_ARGUMENT,name:n,value:this.parseValueLiteral(!1)})}parseFragment(){let t=this._lexer.token;this.expectToken(B.SPREAD);let n=this.expectOptionalKeyword("on");if(!n&&this.peek(B.NAME)){let i=this.parseFragmentName();return this.peek(B.PAREN_L)&&this._options.experimentalFragmentArguments?this.node(t,{kind:_.FRAGMENT_SPREAD,name:i,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(t,{kind:_.FRAGMENT_SPREAD,name:i,directives:this.parseDirectives(!1)})}return this.node(t,{kind:_.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this._options.experimentalFragmentArguments===!0?this.node(t,{kind:_.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:_.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case B.BRACKET_L:return this.parseList(t);case B.BRACE_L:return this.parseObject(t);case B.INT:return this.advanceLexer(),this.node(n,{kind:_.INT,value:n.value});case B.FLOAT:return this.advanceLexer(),this.node(n,{kind:_.FLOAT,value:n.value});case B.STRING:case B.BLOCK_STRING:return this.parseStringLiteral();case B.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:_.BOOLEAN,value:!0});case"false":return this.node(n,{kind:_.BOOLEAN,value:!1});case"null":return this.node(n,{kind:_.NULL});default:return this.node(n,{kind:_.ENUM,value:n.value})}case B.DOLLAR:if(t)if(this.expectToken(B.DOLLAR),this._lexer.token.kind===B.NAME){let i=this._lexer.token.value;throw Ft(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:_.STRING,value:t.value,block:t.kind===B.BLOCK_STRING})}parseList(t){let n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:_.LIST,values:this.any(B.BRACKET_L,n,B.BRACKET_R)})}parseObject(t){let n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:_.OBJECT,fields:this.any(B.BRACE_L,n,B.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(B.COLON),this.node(n,{kind:_.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(B.AT);)n.push(this.parseDirective(t));if(n.length)return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(B.AT),this.node(n,{kind:_.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(B.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(B.BRACKET_R),n=this.node(t,{kind:_.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(B.BANG)?this.node(t,{kind:_.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:_.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(B.STRING)||this.peek(B.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);return this.node(t,{kind:_.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(B.COLON);let i=this.parseNamedType();return this.node(t,{kind:_.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:_.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:_.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(B.AMP,this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseFieldDefinition,B.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(B.COLON);let o=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:_.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:s})}parseArgumentDefs(){return this.optionalMany(B.PAREN_L,this.parseInputValueDef,B.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(B.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(B.EQUALS)&&(o=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:_.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:s})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:_.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:s})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:_.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(B.EQUALS)?this.delimitedMany(B.PIPE,this.parseNamedType):void 0}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:_.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(B.BRACE_L,this.parseEnumValueDefinition,B.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:_.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ft(this._lexer.source,this._lexer.token.start,`${A_(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:_.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(B.BRACE_L,this.parseInputValueDef,B.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===B.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(B.BRACE_L,this.parseOperationTypeDefinition,B.BRACE_R);if(n===void 0&&i===void 0)throw this.unexpected();return this.node(t,{kind:_.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:_.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:_.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i===void 0&&r===void 0&&o===void 0)throw this.unexpected();return this.node(t,{kind:_.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:_.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:_.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i===void 0&&r===void 0)throw this.unexpected();return this.node(t,{kind:_.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(B.AT);let n=this.parseName(),i=this.parseConstDirectives();if(i===void 0)throw this.unexpected();return this.node(t,{kind:_.DIRECTIVE_EXTENSION,name:n,directives:i})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(B.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.parseConstDirectives(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:_.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,directives:o,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(B.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.hasOwn(pe,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){let t=this._lexer.token,n=this.expectOptionalToken(B.AT),i=this.parseName(),r;!n&&this.expectOptionalToken(B.DOT)&&(r=this.parseName());let o;return(n||r)&&this.expectOptionalToken(B.PAREN_L)&&(o=this.parseName(),this.expectToken(B.COLON),this.expectToken(B.PAREN_R)),n?o?this.node(t,{kind:_.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:o}):this.node(t,{kind:_.DIRECTIVE_COORDINATE,name:i}):r?o?this.node(t,{kind:_.ARGUMENT_COORDINATE,name:i,fieldName:r,argumentName:o}):this.node(t,{kind:_.MEMBER_COORDINATE,name:i,memberName:r}):this.node(t,{kind:_.TYPE_COORDINATE,name:i})}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Kg(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Ft(this._lexer.source,n.start,`Expected ${TJ(t)}, found ${A_(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===B.NAME&&n.value===t)this.advanceLexer();else throw Ft(this._lexer.source,n.start,`Expected "${t}", found ${A_(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===B.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return Ft(this._lexer.source,n.start,`Unexpected ${A_(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==B.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw Ft(this._lexer.source,n.start,`Document contains more than ${t} tokens. Parsing aborted.`)}};function A_(e){let t=e.value;return TJ(e.kind)+(t!=null?` "${t}"`:"")}function TJ(e){return kJ(e)?`"${e}"`:e}function bn(e,t){switch(t.kind){case _.LIST_TYPE:{let n=bn(e,t.type);return n&&new qt(n)}case _.NON_NULL_TYPE:{let n=bn(e,t.type);return n&&new ve(n)}case _.NAMED_TYPE:return e.getType(t.name.value)}}function IJ(e){let t=new Map;return{Directive(n){if(n.name.value===_o.name||n.name.value===$o.name){let r=n.arguments?.find(s=>s.name.value==="label")?.value;if(!r||r.kind===_.NULL)return;if(r.kind!==_.STRING){e.reportError(new O(`Argument "@${n.name.value}(label:)" must be a static string.`,{nodes:n}));return}let o=t.get(r.value);o!=null?e.reportError(new O('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.',{nodes:[o,n]})):t.set(r.value,n)}}}}function RJ(e){return{OperationDefinition(t){let n=e.getDocument(),i=new Map;for(let s of n.definitions)s.kind===_.FRAGMENT_DEFINITION&&i.set(s.name.value,s);if(t.operation!=="subscription"&&t.operation!=="mutation")return;let o=e.getSchema().getRootType(t.operation);o&&wD({context:e,operationType:t.operation,rootType:o,fragments:i,selectionSet:t.selectionSet,visitedFragments:new Set})}}}function wD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:r,visitedFragments:o}){for(let s of r.selections)if(s.kind==="Field"){let a=s.directives?.find(c=>c.name.value===$o.name);a&&e.reportError(new O(`Stream directive cannot be used on root ${t} type "${n}".`,{nodes:a}))}else if(s.kind==="FragmentSpread"){let a=s.name.value;if(o.has(a))continue;let c=i.get(a);if(c){let l=AJ(s);l!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:l})),wD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:c.selectionSet,visitedFragments:o})}o.add(a)}else if(s.kind==="InlineFragment"){let a=AJ(s);a!==void 0&&e.reportError(new O(`Defer directive cannot be used on root ${t} type "${n}".`,{nodes:a})),wD({context:e,operationType:t,rootType:n,fragments:i,selectionSet:s.selectionSet,visitedFragments:o})}}function AJ(e){return e.directives?.find(t=>t.name.value===_o.name)}function CJ(e){let t=e.arguments?.find(n=>n.name.value==="if");if(!t)return!1;if(t.value.kind===_.BOOLEAN){if(t.value.value)return!1}else if(t.value.kind!==_.VARIABLE)return!1;return!0}function _Se(e){let t=e.arguments?.find(n=>n.name.value==="if");return t&&t.value.kind===_.BOOLEAN?!!t.value.value:!0}function $Se(e){let t=e.arguments?.find(n=>n.name.value==="if");return t?t?.value.kind===_.BOOLEAN?!t.value.value:!0:!1}function NJ(e){return{OperationDefinition(t){if(t.operation!==Hn.SUBSCRIPTION)return;let n=e.getDocument(),i=new Map;for(let o of n.definitions)o.kind===_.FRAGMENT_DEFINITION&&i.set(o.name.value,o);let r=new Set;kD({context:e,fragments:i,selectionSet:t.selectionSet,parentNodes:[],visitedFragments:r})}}}function kD({context:e,fragments:t,selectionSet:n,parentNodes:i,visitedFragments:r}){for(let o of n.selections){let s=o.directives?.find(c=>c.name.value===ka.name);if(s&&_Se(s))continue;let a=o.directives?.find(c=>c.name.value===wa.name);if(!(a&&$Se(a))){for(let c of o.directives??[])c.name.value===_o.name?CJ(c)||e.reportError(new O("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.",{nodes:[c,...i]})):c.name.value===$o.name&&(CJ(c)||e.reportError(new O("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.",{nodes:[c,...i]})));if(o.kind==="FragmentSpread"){let c=o.name.value;if(r.has(c))continue;r.add(c);let l=t.get(c);l&&kD({context:e,fragments:t,parentNodes:[o,...i],selectionSet:l?.selectionSet,visitedFragments:r})}else o.selectionSet&&kD({context:e,fragments:t,selectionSet:o.selectionSet,parentNodes:i,visitedFragments:r})}}}function _D(e){return e.kind===_.OPERATION_DEFINITION||e.kind===_.FRAGMENT_DEFINITION}function $D(e){return e.kind===_.SCHEMA_DEFINITION||$a(e)||e.kind===_.DIRECTIVE_DEFINITION}function $a(e){return e.kind===_.SCALAR_TYPE_DEFINITION||e.kind===_.OBJECT_TYPE_DEFINITION||e.kind===_.INTERFACE_TYPE_DEFINITION||e.kind===_.UNION_TYPE_DEFINITION||e.kind===_.ENUM_TYPE_DEFINITION||e.kind===_.INPUT_OBJECT_TYPE_DEFINITION}function SD(e){return e.kind===_.SCHEMA_EXTENSION||e.kind===_.DIRECTIVE_EXTENSION||R_(e)}function R_(e){return e.kind===_.SCALAR_TYPE_EXTENSION||e.kind===_.OBJECT_TYPE_EXTENSION||e.kind===_.INTERFACE_TYPE_EXTENSION||e.kind===_.UNION_TYPE_EXTENSION||e.kind===_.ENUM_TYPE_EXTENSION||e.kind===_.INPUT_OBJECT_TYPE_EXTENSION}function PJ(e){return{Document(t){for(let n of t.definitions)if(!_D(n)){let i=n.kind===_.SCHEMA_DEFINITION||n.kind===_.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new O(`The ${i} definition is not executable.`,{nodes:n}))}return!1}}}function DJ(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),o=t.name.value,s=Jn("to use an inline fragment on",e.hideSuggestions?[]:SSe(r,n,o));s===""&&(s=Jn(e.hideSuggestions?[]:xSe(n,o))),e.reportError(new O(`Cannot query field "${o}" on type "${n}".`+s,{nodes:t}))}}}}function SSe(e,t,n){if(!Kr(t))return[];let i=new Set,r=Object.create(null);for(let o of e.getPossibleTypes(t))if(o.getFields()[n]!=null){i.add(o),r[o.name]=1;for(let s of o.getInterfaces())s.getFields()[n]!=null&&(i.add(s),r[s.name]=(r[s.name]??0)+1)}return[...i].sort((o,s)=>{let a=r[s.name]-r[o.name];return a!==0?a:Be(o)&&e.isSubType(o,s)?-1:Be(s)&&e.isSubType(s,o)?1:Od(o.name,s.name)}).map(o=>o.name)}function xSe(e,t){if(ot(e)||Be(e)){let n=Object.keys(e.getFields());return ar(t,n)}return[]}function OJ(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let i=bn(e.getSchema(),n);if(i&&!os(i)){let r=Ye(n);e.reportError(new O(`Fragment cannot condition on non composite type "${r}".`,{nodes:n}))}}},FragmentDefinition(t){let n=bn(e.getSchema(),t.typeCondition);if(n&&!os(n)){let i=Ye(t.typeCondition);e.reportError(new O(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}}function MJ(e){return{...xD(e),FragmentArgument(t){let n=e.getFragmentSignature();if(n&&!n.variableDefinitions.get(t.name.value)){let r=t.name.value,o=e.hideSuggestions?[]:ar(r,Array.from(n.variableDefinitions.values()).map(s=>s.variable.name.value));e.reportError(new O(`Unknown argument "${r}" on fragment "${n.definition.name.value}".`+Jn(o),{nodes:t}))}},Argument(t){let n=e.getArgument(),i=e.getFieldDef();if(!n&&i){let r=t.name.value,o=e.hideSuggestions?[]:ar(r,i.args.map(s=>s.name));e.reportError(new O(`Unknown argument "${r}" on field "${i}".`+Jn(o),{nodes:t}))}}}}function xD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():dr;for(let o of i)t.set(o.name,o.args.map(s=>s.name));let r=e.getDocument().definitions;for(let o of r)if(o.kind===_.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,s.map(a=>a.name.value))}return{Directive(o){let s=o.name.value,a=t.get(s);if(o.arguments!=null&&a!=null)for(let c of o.arguments){let l=c.name.value;if(!a.includes(l)){let u=ar(l,a);e.reportError(new O(`Unknown argument "${l}" on directive "@${s}".`+(e.hideSuggestions?"":Jn(u)),{nodes:c}))}}return!1}}}function ED(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():dr;for(let o of i)t.set(o.name,o.locations);let r=e.getDocument().definitions;for(let o of r)o.kind===_.DIRECTIVE_DEFINITION&&t.set(o.name.value,o.locations.map(s=>s.value));return{Directive(o,s,a,c,l){let u=o.name.value,d=t.get(u);if(d==null){e.reportError(new O(`Unknown directive "@${u}".`,{nodes:o}));return}let p=ESe(l);p!=null&&!d.includes(p)&&e.reportError(new O(`Directive "@${u}" may not be used on ${p}.`,{nodes:o}))}}}function ESe(e){let t=e.at(-1);switch(t!=null&&"kind"in t||it(!1),t.kind){case _.OPERATION_DEFINITION:return TSe(t.operation);case _.FIELD:return pe.FIELD;case _.FRAGMENT_SPREAD:return pe.FRAGMENT_SPREAD;case _.INLINE_FRAGMENT:return pe.INLINE_FRAGMENT;case _.FRAGMENT_DEFINITION:return pe.FRAGMENT_DEFINITION;case _.VARIABLE_DEFINITION:{let n=e[e.length-3];return"kind"in n||it(!1),n.kind===_.OPERATION_DEFINITION?pe.VARIABLE_DEFINITION:pe.FRAGMENT_VARIABLE_DEFINITION}case _.SCHEMA_DEFINITION:case _.SCHEMA_EXTENSION:return pe.SCHEMA;case _.SCALAR_TYPE_DEFINITION:case _.SCALAR_TYPE_EXTENSION:return pe.SCALAR;case _.OBJECT_TYPE_DEFINITION:case _.OBJECT_TYPE_EXTENSION:return pe.OBJECT;case _.FIELD_DEFINITION:return pe.FIELD_DEFINITION;case _.INTERFACE_TYPE_DEFINITION:case _.INTERFACE_TYPE_EXTENSION:return pe.INTERFACE;case _.UNION_TYPE_DEFINITION:case _.UNION_TYPE_EXTENSION:return pe.UNION;case _.ENUM_TYPE_DEFINITION:case _.ENUM_TYPE_EXTENSION:return pe.ENUM;case _.ENUM_VALUE_DEFINITION:return pe.ENUM_VALUE;case _.INPUT_OBJECT_TYPE_DEFINITION:case _.INPUT_OBJECT_TYPE_EXTENSION:return pe.INPUT_OBJECT;case _.INPUT_VALUE_DEFINITION:{let n=e.at(-3);return n!=null&&"kind"in n||it(!1),n.kind===_.INPUT_OBJECT_TYPE_DEFINITION||n.kind===_.INPUT_OBJECT_TYPE_EXTENSION?pe.INPUT_FIELD_DEFINITION:pe.ARGUMENT_DEFINITION}case _.DIRECTIVE_DEFINITION:case _.DIRECTIVE_EXTENSION:return pe.DIRECTIVE_DEFINITION;default:it(!1,"Unexpected kind: "+ce(t.kind))}}function TSe(e){switch(e){case Hn.QUERY:return pe.QUERY;case Hn.MUTATION:return pe.MUTATION;case Hn.SUBSCRIPTION:return pe.SUBSCRIPTION}}function LJ(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new O(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function FJ(e){let t=e.getSchema();return{OperationDefinition(n){let i=n.operation;t.getRootType(i)||e.reportError(new O(`The ${i} operation is not supported by the schema.`,{nodes:n}))}}}function TD(e){let{definitions:t}=e.getDocument(),n=e.getSchema()?.getTypeMap()??{},i=new Set([...Object.keys(n),...t.filter($a).map(r=>r.name.value)]);return{NamedType(r,o,s,a,c){let l=r.name.value;if(!i.has(l)){let u=c[2]??s,d=u!=null&&ISe(u);if(d&&UJ.has(l))return;let p=e.hideSuggestions?[]:ar(l,d?[...UJ,...i]:[...i]);e.reportError(new O(`Unknown type "${l}".`+Jn(p),{nodes:r}))}}}}var UJ=new Set([...va,..._a].map(e=>e.name));function ISe(e){return"kind"in e&&($D(e)||SD(e))}function jJ(e){let t=0;return{Document(n){t=n.definitions.filter(i=>i.kind===_.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new O("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function zJ(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),i=0;return{SchemaDefinition(r){if(n){e.reportError(new O("Cannot define a new schema within a schema extension.",{nodes:r}));return}i>0&&e.reportError(new O("Must provide only one schema definition.",{nodes:r})),++i}}}var ASe=3;function GJ(e){function t(n,i=Object.create(null),r=0){if(n.kind===_.FRAGMENT_SPREAD){let o=n.name.value;if(i[o]===!0)return!1;let s=e.getFragment(o);if(!s)return!1;try{return i[o]=!0,t(s,i,r)}finally{i[o]=void 0}}if(n.kind===_.FIELD&&(n.name.value==="fields"||n.name.value==="interfaces"||n.name.value==="possibleTypes"||n.name.value==="inputFields")&&(r++,r>=ASe))return!0;if("selectionSet"in n&&n.selectionSet){for(let o of n.selectionSet.selections)if(t(o,i,r))return!0}return!1}return{Field(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new O("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function VJ(e){let t=new Set,n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(o){return r(o),!1}};function r(o){if(t.has(o.name.value))return;let s=o.name.value;t.add(s);let a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){i[s]=n.length;for(let c of a){let l=c.name.value,u=i[l];if(n.push(c),u===void 0){let d=e.getFragment(l);d&&r(d)}else{let d=n.slice(u),p=d.slice(0,-1).map(f=>'"'+f.name.value+'"').join(", ");e.reportError(new O(`Cannot spread fragment "${l}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:d}))}n.pop()}i[s]=void 0}}}function BJ(e){return{OperationDefinition(t){let n=new Set(t.variableDefinitions?.map(r=>r.variable.name.value)),i=e.getRecursiveVariableUsages(t);for(let{node:r,fragmentVariableDefinition:o}of i){if(o)continue;let s=r.name.value;n.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is not defined by operation "${t.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[r,t]}))}}}}function qJ(e){let t=new Set,n=[];return{OperationDefinition(i){for(let r of e.getRecursivelyReferencedFragments(i))t.add(r.name.value);return!1},FragmentDefinition(i){return n.push(i),!1},Document:{leave(){for(let i of n){let r=i.name.value;t.has(r)||e.reportError(new O(`Fragment "${r}" is never used.`,{nodes:i}))}}}}}function WJ(e){return{FragmentDefinition(t){let n=e.getVariableUsages(t),i=new Set(n.map(({node:o})=>o.name.value)),r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(`Variable "$${s}" is never used in fragment "${t.name.value}".`,{nodes:o}))}},OperationDefinition(t){let n=e.getRecursiveVariableUsages(t),i=new Set;for(let{node:o,fragmentVariableDefinition:s}of n){let a=o.name.value;s||i.add(a)}let r=t.variableDefinitions??[];for(let o of r){let s=o.variable.name.value;i.has(s)||e.reportError(new O(t.name?`Variable "$${s}" is never used in operation "${t.name.value}".`:`Variable "$${s}" is never used.`,{nodes:o}))}}}}function ph(e){switch(e.kind){case _.OBJECT:return{...e,fields:RSe(e.fields)};case _.LIST:return{...e,values:e.values.map(ph)};case _.INT:case _.FLOAT:case _.STRING:case _.BOOLEAN:case _.NULL:case _.ENUM:case _.VARIABLE:return e}}function RSe(e){return e.map(t=>({...t,value:ph(t.value)})).sort((t,n)=>Od(t.name.value,n.name.value))}function JJ(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+JJ(n)).join(" and "):e}function ZJ(e){let t=new D_,n=new RD,i=new Map;return{SelectionSet(r){let o=CSe(e,i,t,n,e.getParentType(),r);for(let[[s,a],c,l]of o){let u=JJ(a);e.reportError(new O(`Fields "${s}" conflict because ${u}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:c.concat(l)}))}}}}function CSe(e,t,n,i,r,o){let s=[],[a,c]=P_(e,t,r,o,void 0);if(PSe(e,s,t,n,i,a),c.length!==0)for(let l=0;l1)for(let c=0;c[o.value,i===void 0?s:fh(s,i)]));return e.every(o=>{let s=o.value;t&&(s=fh(s,t));let a=r.get(o.name.value);return a===void 0?!1:KJ(s)===KJ(a)})}function fh(e,t){switch(e.kind){case _.VARIABLE:return t.get(e.name.value)??e;case _.LIST:return{...e,values:e.values.map(n=>fh(n,t))};case _.OBJECT:return{...e,fields:e.fields.map(n=>({...n,value:fh(n.value,t)}))};default:return e}}function KJ(e){return Ye(ph(e))}function HJ(e){return e?.find(t=>t.name.value==="stream")}function DSe(e,t,n,i){let r=HJ(e),o=HJ(n);if(!(!r&&!o))return r&&o&&ND(r.arguments,t,o.arguments,i)?"they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100":"they have overlapping stream directives"}function ID(e,t){return He(e)?He(t)?ID(e.ofType,t.ofType):!0:He(t)?!0:$e(e)?$e(t)?ID(e.ofType,t.ofType):!0:$e(t)?!0:hi(e)||hi(t)?e!==t:!1}function P_(e,t,n,i,r){let o=t.get(i);if(o)return o;let s=new Map,a=new Map;QJ(e,n,i,s,a,r);let c=[s,Array.from(a.values())];return t.set(i,c),c}function AD(e,t,n,i){let r=t.get(n.selectionSet);if(r)return r;let o=bn(e.getSchema(),n.typeCondition);return P_(e,t,o,n.selectionSet,i)}function QJ(e,t,n,i,r,o){for(let s of n.selections)switch(s.kind){case _.FIELD:{let a=s.name.value,c;(ot(t)||Be(t))&&(c=t.getFields()[a]);let l=s.alias?s.alias.value:a,u=i.get(l);u==null&&(u=[],i.set(l,u)),u.push([t,s,c]);break}case _.FRAGMENT_SPREAD:{let a=OSe(e,s,o);r.set(a.key,a);break}case _.INLINE_FRAGMENT:{let a=s.typeCondition,c=a?bn(e.getSchema(),a):t;QJ(e,c,s.selectionSet,i,r,o);break}}}function OSe(e,t,n){let i="",r=new Map,o=e.getFragmentSignatureByName()(t.name.value),s=new Map;if(t.arguments)for(let a of t.arguments)s.set(a.name.value,a.value);if(o?.variableDefinitions){i+=t.name.value+"(";for(let[a,c]of o.variableDefinitions){let l=s.get(a);l&&(i+=a+": "+Ye(ph(l)));let u=s.get(a);u!==void 0?r.set(a,n!==void 0?fh(u,n):u):c.defaultValue&&r.set(a,c.defaultValue)}i+=")"}return{key:i,node:t,varMap:r.size>0?r:void 0}}function MSe(e,t,n,i){if(e.length>0)return[[t,e.map(([r])=>r)],[n,...e.map(([,r])=>r).flat()],[i,...e.map(([,,r])=>r).flat()]]}var D_=class{constructor(){this._data=new Map}has(t,n,i){let r=this._data.get(t)?.get(n);return r===void 0?!1:i?!0:i===r}add(t,n,i){let r=this._data.get(t);r===void 0?this._data.set(t,new Map([[n,i]])):r.set(n,i)}},RD=class{constructor(){this._orderedPairSet=new D_}has(t,n,i){return tr.name.value));for(let r of n.args)!i.has(r.name)&&ha(r)&&e.reportError(new O(`Argument "${r}" of type "${r.type}" is required, but it was not provided.`,{nodes:t}))}},FragmentSpread:{leave(t){let n=e.getFragmentSignature();if(!n)return!1;let i=new Set(t.arguments?.map(r=>r.name.value));for(let[r,o]of n.variableDefinitions)if(!i.has(r)&&nZ(o)){let s=bn(e.getSchema(),o.type),a=ce(s);e.reportError(new O(`Fragment "${t.name.value}" argument "${r}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}function PD(e){let t=new Map,i=e.getSchema()?.getDirectives()??dr;for(let o of i)t.set(o.name,new Map(o.args.filter(ha).map(s=>[s.name,s])));let r=e.getDocument().definitions;for(let o of r)if(o.kind===_.DIRECTIVE_DEFINITION){let s=o.arguments??[];t.set(o.name.value,new Map(s.filter(nZ).map(a=>[a.name.value,a])))}return{Directive:{leave(o){let s=o.name.value,a=t.get(s);if(a!=null){let c=o.arguments??[],l=new Set(c.map(u=>u.name.value));for(let[u,d]of a.entries())if(!l.has(u)){let p=Qg(d.type)?ce(d.type):Ye(d.type);e.reportError(new O(`Argument "@${s}(${u}:)" of type "${p}" is required, but it was not provided.`,{nodes:o}))}}}}}}function nZ(e){return e.type.kind===_.NON_NULL_TYPE&&e.defaultValue==null}function rZ(e){return{Field(t){let n=e.getType(),i=t.selectionSet;if(n)if(hi(ko(n))){if(i){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" must not have a selection since type "${o}" has no subfields.`,{nodes:i}))}}else if(i){if(i.selections.length===0){let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have at least one field selected.`,{nodes:t}))}}else{let r=t.name.value,o=ce(n);e.reportError(new O(`Field "${r}" of type "${o}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function So(e,t){if($e(t))return e==null?void 0:So(e,t.ofType);if(e==null)return null;if(He(t)){if(!ts(e)){let r=So(e,t.ofType);return r===void 0?void 0:[r]}let i=[];for(let r of e){let o=So(r,t.ofType);if(o===void 0)return;i.push(o)}return i}if(Ke(t)){if(!Kn(e)||Array.isArray(e))return;let i=Object.create(null),r=t.getFields(),o=0;for(let s of Object.keys(e))if(e[s]!==void 0&&(o++,!Object.hasOwn(r,s)))return;for(let s of Object.values(r)){let a=e[s.name];if(a===void 0){if(qi(s))return;let c=O_(s);c!==void 0&&(i[s.name]=c)}else{let c=So(a,s.type);if(c===void 0)return;i[s.name]=c}}if(t.isOneOf){let s=Object.keys(i);if(o!==1||s.length!==1)return;let a=s[0];if(i[a]===null)return}return i}let n=wo(t);try{return n.coerceInputValue(e)}catch{}}function as(e,t,n,i){if(e.kind===_.VARIABLE){let o=iZ(e,n,i);return o==null&&$e(t)?void 0:o}if($e(t))return e.kind===_.NULL?void 0:as(e,t.ofType,n,i);if(e.kind===_.NULL)return null;if(He(t)){if(e.kind!==_.LIST){let s=as(e,t.ofType,n,i);return s===void 0?void 0:[s]}let o=[];for(let s of e.values){let a=as(s,t.ofType,n,i);if(a===void 0)if(s.kind===_.VARIABLE&&iZ(s,n,i)==null&&!$e(t.ofType))a=null;else return;o.push(a)}return o}if(Ke(t)){if(e.kind!==_.OBJECT)return;let o=Object.create(null),s=t.getFields();if(e.fields.some(l=>!Object.hasOwn(s,l.name.value)))return;let c=new Map(e.fields.map(l=>[l.name.value,l]));for(let l of Object.values(s)){let u=c.get(l.name);if(!u||u.value.kind===_.VARIABLE&&zSe(u.value,n,i)){if(qi(l))return;let d=O_(l);d!==void 0&&(o[l.name]=d)}else{let d=as(u.value,l.type,n,i);if(d===void 0)return;o[l.name]=d}}if(t.isOneOf){let l=Object.keys(o);if(c.size!==1||l.length!==1)return;for(let[u,d]of c)if(d.value.kind===_.NULL||o[u]===null)return}return o}let r=wo(t);try{return r.coerceInputLiteral?r.coerceInputLiteral(ya(e,n,i)):r.parseLiteral(e,n?.coerced)}catch{}}function iZ(e,t,n){let i=e.name.value;return n?.sources[i]!==void 0?n.coerced[i]:t?.coerced[i]}function zSe(e,t,n){let i=e.name.value;return(n?.sources[i]!==void 0?n.coerced:t?.coerced)?.[i]===void 0}function O_(e){let t=e._memoizedCoercedDefaultValue;if(t!==void 0)return t;let n=e.default;if(n!==void 0)return t=n.literal?as(n.literal,e.type):So(n.value,e.type),t===void 0&&it(!1,`Expected value of type "${e.type}" to be valid, found: ${ce(n.literal??n.value)}.`),e._memoizedCoercedDefaultValue=t,t;let i=e.defaultValue;return i!==void 0&&(e._memoizedCoercedDefaultValue=i),i}function oZ(e,t,n,i,r){try{let o=O_(n);o!==void 0&&(e[t]=o)}catch(o){let s=n.default;if(s===void 0)throw o;let a=!1;bJ(s,n.type,(c,l)=>{a=!0,i(c,l)},r),a||i(Wg(o),[])}}function sZ(e,t,n,i,r){let o=e.arguments??[],s=new Map(o.map(l=>[l.name.value,l])),a=Object.create(null),c=Object.create(null);for(let[l,u]of Object.entries(t)){let d=s.get(l);d!==void 0?a[l]=i==null?{signature:u,value:d.value}:{signature:u,value:d.value,fragmentVariableValues:i}:a[l]={signature:u},aZ(c,e,l,u,d,n,i,r)}return{sources:a,coerced:c}}function M_(e,t,n,i,r){let o=Object.create(null),s=t.arguments??[],a=new Map(s.map(c=>[c.name.value,c]));for(let c of e.args){let l=c.name;aZ(o,t,l,c,a.get(c.name),n,i,r)}return o}function aZ(e,t,n,i,r,o,s,a){let c=i.type,l=(p,f)=>{throw new O(`${DD(i,t)} has invalid default value${JP(f)}: ${p.message}`,{nodes:t})};if(!r){if(ha(i))throw new O(`${DD(i,t)} of required type "${c}" was not provided.`,{nodes:t});oZ(e,n,i,l,a);return}let u=r.value;if(u.kind===_.VARIABLE){let p=u.name.value,f=s?.sources[p]?s:o;if((f==null||!Object.hasOwn(f.coerced,p))&&!ha(i)){oZ(e,n,i,l,a);return}}let d=as(u,c,o,s);d===void 0&&(Zc(u,c,(p,f)=>{throw p.message=`${DD(i,t)} has invalid value${JP(f)}: ${p.message}`,p},o,s,a),it(!1,"Invalid argument")),e[n]=d}function DD(e,t){return g_(e)?`Argument "${e}"`:`Variable "$${e.name}" defined by fragment "${t.name.value}"`}function Vd(e,t,n,i,r){let o=t.directives?.find(s=>s.name.value===e.name);if(o)return M_(e,o,n,i,r)}function uZ(e,t,n,i,r,o,s=!1){let a=new Cr,c=[],l={schema:e,fragments:t,variableValues:n,runtimeType:i,visitedFragmentNames:new Map,hideSuggestions:o,forbiddenDirectiveInstances:[],forbidSkipAndInclude:s};return L_(l,r,a,c),{groupedFieldSet:a,newDeferUsages:c,forbiddenDirectiveInstances:l.forbiddenDirectiveInstances}}function L_(e,t,n,i,r,o){let{schema:s,fragments:a,variableValues:c,runtimeType:l,visitedFragmentNames:u,hideSuggestions:d}=e;for(let p of t.selections)switch(p.kind){case _.FIELD:{if(!OD(e,p,c,o))continue;n.add(GSe(p),{node:p,deferUsage:r,fragmentVariableValues:o});break}case _.INLINE_FRAGMENT:{if(!OD(e,p,c,o)||!lZ(s,p,l))continue;let f=cZ(c,o,p,r);f?(i.push(f),L_(e,p.selectionSet,n,i,f,o)):L_(e,p.selectionSet,n,i,r,o);break}case _.FRAGMENT_SPREAD:{let f=p.name.value;if(!OD(e,p,c,o))continue;let m=a[f];if(m==null||!lZ(s,m.definition,l))continue;let g=cZ(c,o,p,r),h=u.get(f),b;if(g){if(h!==void 0)continue;u.set(f,!0),i.push(g),b=g}else{if(h===!1)continue;u.set(f,!1),b=r}let y=m.variableSignatures,w;y&&(w=sZ(p,y,c,o,d)),L_(e,m.definition.selectionSet,n,i,b,w);break}}}function cZ(e,t,n,i){let r=Vd(_o,n,e,t);if(r&&r.if!==!1)return{label:typeof r.label=="string"?r.label:void 0,parentDeferUsage:i}}function OD(e,t,n,i){let r=t.directives?.find(c=>c.name.value===ka.name);if(r&&e.forbidSkipAndInclude)return e.forbiddenDirectiveInstances.push(r),!1;if((r?M_(ka,r,n,i,e.hideSuggestions):void 0)?.if===!0)return!1;let s=t.directives?.find(c=>c.name.value===wa.name);return s&&e.forbidSkipAndInclude?(e.forbiddenDirectiveInstances.push(s),!1):(s?M_(wa,s,n,i,e.hideSuggestions):void 0)?.if!==!1}function lZ(e,t,n){let i=t.typeCondition;if(!i)return!0;let r=bn(e,i);return r===n?!0:Kr(r)?e.isSubType(r,n):!1}function GSe(e){return e.alias?e.alias.value:e.name.value}function MD(e){return e.map(t=>t.node)}function dZ(e){return{OperationDefinition(t){if(t.operation==="subscription"){let n=e.getSchema(),i=n.getSubscriptionType();if(i){let r=t.name?t.name.value:null,o=Object.create(null),s=e.getDocument(),a=Object.create(null);for(let u of s.definitions)u.kind===_.FRAGMENT_DEFINITION&&(a[u.name.value]={definition:u});let{groupedFieldSet:c,forbiddenDirectiveInstances:l}=uZ(n,a,o,i,t.selectionSet,e.hideSuggestions,!0);if(l.length>0){e.reportError(new O(r!=null?`Subscription "${r}" must not use \`@skip\` or \`@include\` directives in the top level selection.`:"Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.",{nodes:l}));return}if(c.size>1){let p=[...c.values()].slice(1).flatMap(f=>MD(f));e.reportError(new O(r!=null?`Subscription "${r}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:p}))}for(let u of c.values())MD(u)[0].name.value.startsWith("__")&&e.reportError(new O(r!=null?`Subscription "${r}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:MD(u)}))}}}}}function pZ(e){return{Directive(t){let n=e.getFieldDef(),i=e.getParentType();n&&i&&t.name.value===$o.name&&!(He(n.type)||Bi(n.type)&&He(n.type.ofType))&&e.reportError(new O(`Directive "@stream" cannot be used on non-list field "${i}.${n.name}".`,{nodes:t}))}}}function Bd(e,t){let n=new Cr;for(let i of e)n.add(t(i),i);return n}function fZ(e){return{DirectiveDefinition(i){let r=i.arguments??[];return n(`@${i.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(i){let r=i.name.value,o=i.fields??[];for(let s of o){let a=s.name.value,c=s.arguments??[];n(`${r}.${a}`,c)}return!1}function n(i,r){let o=Bd(r,s=>s.name.value);for(let[s,a]of o)a.length>1&&e.reportError(new O(`Argument "${i}(${s}:)" can only be defined once.`,{nodes:a.map(c=>c.name)}));return!1}}function LD(e){return{Field:t,Directive:t};function t(n){let i=n.arguments??[],r=Bd(i,o=>o.name.value);for(let[o,s]of r)s.length>1&&e.reportError(new O(`There can be only one argument named "${o}".`,{nodes:s.map(a=>a.name)}))}}function mZ(e){let t=new Map,n=e.getSchema();return{DirectiveDefinition(i){let r=i.name.value;if(n?.getDirective(r)){e.reportError(new O(`Directive "@${r}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}));return}let o=t.get(r);return o?e.reportError(new O(`There can be only one directive named "@${r}".`,{nodes:[o,i.name]})):t.set(r,i.name),!1}}}function FD(e){let t=new Map,n=e.getSchema(),i=n?n.getDirectives():dr;for(let c of i)t.set(c.name,!c.isRepeatable);let r=e.getDocument().definitions;for(let c of r)c.kind===_.DIRECTIVE_DEFINITION&&t.set(c.name.value,!c.repeatable);let o=new Map,s=new Map,a=new Map;return{enter(c){if(!("directives"in c)||!c.directives)return;let l;if(c.kind===_.SCHEMA_DEFINITION||c.kind===_.SCHEMA_EXTENSION)l=o;else if($a(c)||R_(c)){let u=c.name.value;l=s.get(u),l===void 0&&(l=new Map,s.set(u,l))}else if(c.kind===_.DIRECTIVE_DEFINITION||c.kind===_.DIRECTIVE_EXTENSION){let u=c.name.value;l=a.get(u),l===void 0&&(l=new Map,a.set(u,l))}else l=new Map;for(let u of c.directives){let d=u.name.value;if(t.get(d)===!0){let p=l.get(d);p!=null?e.reportError(new O(`The directive "@${d}" can only be used once at this location.`,{nodes:[p,u]})):l.set(d,u)}}}}}function gZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{EnumTypeDefinition:r,EnumTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.values??[];for(let l of c){let u=l.name.value,d=n[s];if(Qt(d)&&d.getValue(u)){e.reportError(new O(`Enum value "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let p=a.get(u);p!=null?e.reportError(new O(`Enum value "${s}.${u}" can only be defined once.`,{nodes:[p,l.name]})):a.set(u,l.name)}return!1}}function hZ(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=new Map;return{InputObjectTypeDefinition:r,InputObjectTypeExtension:r,InterfaceTypeDefinition:r,InterfaceTypeExtension:r,ObjectTypeDefinition:r,ObjectTypeExtension:r};function r(o){let s=o.name.value,a=i.get(s);a==null&&(a=new Map,i.set(s,a));let c=o.fields??[];for(let l of c){let u=l.name.value;if(VSe(n[s],u)){e.reportError(new O(`Field "${s}.${u}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:l.name}));continue}let d=a.get(u);d!=null?e.reportError(new O(`Field "${s}.${u}" can only be defined once.`,{nodes:[d,l.name]})):a.set(u,l.name)}return!1}}function VSe(e,t){return ot(e)||Be(e)||Ke(e)?e.getFields()[t]!=null:!1}function yZ(e){let t=new Map;return{OperationDefinition:()=>!1,FragmentDefinition(n){let i=n.name.value,r=t.get(i);return r!=null?e.reportError(new O(`There can be only one fragment named "${i}".`,{nodes:[r,n.name]})):t.set(i,n.name),!1}}}function UD(e){let t=[],n=new Map;return{ObjectValue:{enter(){t.push(n),n=new Map},leave(){let i=t.pop();i==null&&it(!1),n=i}},ObjectField(i){let r=i.name.value,o=n.get(r);o!=null?e.reportError(new O(`There can be only one input field named "${r}".`,{nodes:[o,i.name]})):n.set(r,i.name)}}}function bZ(e){let t=new Map;return{OperationDefinition(n){let i=n.name;if(i!=null){let r=t.get(i.value);r!=null?e.reportError(new O(`There can be only one operation named "${i.value}".`,{nodes:[r,i]})):t.set(i.value,i)}return!1},FragmentDefinition:()=>!1}}function vZ(e){let t=e.getSchema(),n=new Map,i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:r,SchemaExtension:r};function r(o){let s=o.operationTypes??[];for(let a of s){let c=a.operation,l=n.get(c);i[c]?e.reportError(new O(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:a})):l?e.reportError(new O(`There can be only one ${c} type in schema.`,{nodes:[l,a]})):n.set(c,a)}return!1}}function wZ(e){let t=new Map,n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(r){let o=r.name.value;if(n?.getType(o)){e.reportError(new O(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}let s=t.get(o);return s!=null?e.reportError(new O(`There can be only one type named "${o}".`,{nodes:[s,r.name]})):t.set(o,r.name),!1}}function kZ(e){return{OperationDefinition(t){let n=t.variableDefinitions??[],i=Bd(n,r=>r.variable.name.value);for(let[r,o]of i)o.length>1&&e.reportError(new O(`There can be only one variable named "$${r}".`,{nodes:o.map(s=>s.variable.name)}))}}}function _Z(e){return{NullValue:t=>Sa(e,t,e.getInputType()),ListValue:t=>Sa(e,t,e.getParentInputType()),ObjectValue:t=>Sa(e,t,e.getInputType()),EnumValue:t=>Sa(e,t,e.getInputType()),IntValue:t=>Sa(e,t,e.getInputType()),FloatValue:t=>Sa(e,t,e.getInputType()),StringValue:t=>Sa(e,t,e.getInputType()),BooleanValue:t=>Sa(e,t,e.getInputType())}}function Sa(e,t,n){return n&&Zc(t,n,i=>{e.reportError(i)},void 0,void 0,e.hideSuggestions),!1}function $Z(e){return{VariableDefinition(t){let n=bn(e.getSchema(),t.type);if(n!==void 0&&!Xg(n)){let i=t.variable.name.value,r=Ye(t.type);e.reportError(new O(`Variable "$${i}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function SZ(e){let t;return{OperationDefinition:{enter(){t=new Map},leave(n){let i=e.getRecursiveVariableUsages(n);for(let{node:r,type:o,parentType:s,defaultValue:a,fragmentVariableDefinition:c}of i){let l=r.name.value,u=c;if(u??=t.get(l),u&&o){let d=e.getSchema(),p=bn(d,u.type);p&&!BSe(d,p,u.defaultValue,o,a)&&e.reportError(new O(`Variable "$${l}" of type "${p}" used in position expecting type "${o}".`,{nodes:[u,r]})),Ke(s)&&s.isOneOf&&h_(p)&&e.reportError(new O(`Variable "$${l}" is of type "${p}" but must be non-nullable to be used for OneOf Input Object "${s}".`,{nodes:[u,r]}))}}}},VariableDefinition(n){t.set(n.variable.name.value,n)}}}function BSe(e,t,n,i,r){if($e(i)&&!$e(t)){if(!(n!=null&&n.kind!==_.NULL)&&!(r!==void 0))return!1;let a=i.ofType;return Kc(e,t,a)}return Kc(e,t,i)}var qSe=Object.freeze([GJ]),WSe=Object.freeze([PJ,FJ,bZ,jJ,dZ,TD,OJ,$Z,rZ,DJ,yZ,LJ,qJ,XJ,VJ,kZ,BJ,WJ,ED,FD,RJ,NJ,IJ,pZ,MJ,LD,_Z,tZ,SZ,ZJ,UD,...qSe]),xZ=Object.freeze([zJ,vZ,wZ,gZ,hZ,fZ,mZ,TD,ED,FD,eZ,xD,LD,UD,PD]);var jD=class{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let i of this.getDocument().definitions)i.kind===_.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===_.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=new Set,r=[t.selectionSet],o;for(;o=r.pop();)for(let s of this.getFragmentSpreads(o)){let a=s.name.value;if(!i.has(a)){i.add(a);let c=this.getFragment(a);c&&(n.push(c),r.push(c.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}},F_=class extends jD{constructor(t,n,i){super(t,i),this._schema=n}get hideSuggestions(){return!1}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}};var met=ga(Hg,e=>e.filter(t=>t!=="description")),get=new O("Too many validation errors, error limit reached. Validation aborted.");function KSe(e,t,n=xZ){let i=[],r=new F_(e,t,s=>{i.push(s)}),o=n.map(s=>s(r));return Ld(e,eD(o)),i}function EZ(e){let t=KSe(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(` -`))}var dn={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function kZ(e,t){let n=t({getNamedType:c,setNamedType:l,getNamedTypes:u}),i=new Map;for(let x of e.types){let E=x.name,T=d(x);T&&i.set(E,T)}let r=[];for(let x of e.directives){if(Jc(x)){r.push(x);continue}let E=S(x.toConfig());E&&r.push(new Tn(E))}let o={...e,query:e.query&&c(e.query.name),mutation:e.mutation&&c(e.mutation.name),subscription:e.subscription&&c(e.subscription.name),types:Array.from(i.values()),directives:r},s=n[dn.SCHEMA];return s==null?o:s(o);function a(x){return Ke(x)?new qt(a(x.ofType)):_e(x)?new ve(a(x.ofType)):c(x.name)}function c(x){let E=mxe.get(x)??i.get(x);return E===void 0&&it(!1,`Unknown type: "${x}".`),E}function l(x){i.set(x.name,x)}function u(){return Array.from(i.values())}function d(x){if(cD(x)||tD(x))return x;if(pr(x))return p(x);if(at(x))return f(x);if(Be(x))return h(x);if(Qt(x))return b(x);if(Xt(x))return y(x);if(He(x))return k(x);it(!1,"Unexpected type: "+ce(x))}function p(x){let E=x.toConfig(),T=n[dn.SCALAR];return E=T==null?E:T(E),new dr(E)}function f(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[dn.OBJECT];return T=A==null?T:A(T),new Yn(T)}function m(x,E){let T=Object.create(null);for(let[A,L]of Object.entries(x)){let F={...L,type:a(L.type),args:g(L.args,A,E)},K=n[dn.FIELD];K&&(F=K(F,E)),T[A]=F}return T}function g(x,E,T){let A=Object.create(null);for(let[L,F]of Object.entries(x)){let K={...F,type:a(F.type)},te=n[dn.ARGUMENT];te&&(K=te(K,E,T)),A[L]=K}return A}function h(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[dn.INTERFACE];return T=A==null?T:A(T),new ns(T)}function b(x){let E=x.toConfig(),T={...E,types:()=>E.types.map(L=>c(L.name))},A=n[dn.UNION];return T=A==null?T:A(T),new rs(T)}function y(x){let E=x.toConfig(),T={...E,values:()=>{let L=Object.create(null);for(let[F,K]of Object.entries(E.values)){let te=w(K,F,x.name);L[F]=te}return L}},A=n[dn.ENUM];return T=A==null?T:A(T),new gi(T)}function w(x,E,T){let A={...x},L=n[dn.ENUM_VALUE];return L==null?A:L(A,E,T)}function k(x){let E=x.toConfig(),T={...E,fields:()=>{let L=Object.create(null);for(let[F,K]of Object.entries(E.fields)){let te=_(K,F,x.name);L[F]=te}return L}},A=n[dn.INPUT_OBJECT];return T=A==null?T:A(T),new is(T)}function _(x,E,T){let A={...x,type:a(x.type)},L=n[dn.INPUT_FIELD];return L==null?A:L(A,E,T)}function S(x){let E={...x,args:g(x.args,x.name,void 0)},T=n[dn.DIRECTIVE];return T==null?E:T(E)}}var mxe=new Map([...va,...$a].map(e=>[e.name,e]));function $Z(e,t,n){let i=[],r=new Cr,o=new Cr,s=new Cr,a=new Cr,c=new Cr,l=new Cr,u=new Cr,d=[],p,f=[],m=!1;for(let g of t.definitions){switch(g.kind){case $.SCHEMA_DEFINITION:p=g;break;case $.SCHEMA_EXTENSION:f.push(g);break;case $.DIRECTIVE_DEFINITION:d.push(g);break;case $.DIRECTIVE_EXTENSION:u.add(g.name.value,g);break;case $.SCALAR_TYPE_DEFINITION:case $.OBJECT_TYPE_DEFINITION:case $.INTERFACE_TYPE_DEFINITION:case $.UNION_TYPE_DEFINITION:case $.ENUM_TYPE_DEFINITION:case $.INPUT_OBJECT_TYPE_DEFINITION:i.push(g);break;case $.SCALAR_TYPE_EXTENSION:r.add(g.name.value,g);break;case $.OBJECT_TYPE_EXTENSION:o.add(g.name.value,g);break;case $.INTERFACE_TYPE_EXTENSION:s.add(g.name.value,g);break;case $.UNION_TYPE_EXTENSION:a.add(g.name.value,g);break;case $.ENUM_TYPE_EXTENSION:c.add(g.name.value,g);break;case $.INPUT_OBJECT_TYPE_EXTENSION:l.add(g.name.value,g);break;default:continue}m=!0}return m?kZ(e,g=>{let{getNamedType:h,setNamedType:b,getNamedTypes:y}=g;return{[dn.SCHEMA]:D=>{for(let re of i){let ie=gxe.get(re.name.value)??te(re);b(ie)}let X={query:D.query&&h(D.query.name),mutation:D.mutation&&h(D.mutation.name),subscription:D.subscription&&h(D.subscription.name),...p&&w([p]),...w(f)};return{description:p?.description?.value??D.description,...X,types:y(),directives:[...D.directives.map(x),...d.map(S)],extensions:D.extensions,astNode:p??D.astNode,extensionASTNodes:D.extensionASTNodes.concat(f),assumeValid:n?.assumeValid??!1}},[dn.INPUT_OBJECT]:D=>{let X=l.get(D.name)??[];return{...D,fields:()=>({...D.fields(),...A(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.ENUM]:D=>{let X=c.get(D.name)??[];return{...D,values:()=>({...D.values(),...L(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.SCALAR]:D=>{let X=r.get(D.name)??[],re=D.specifiedByURL;for(let ie of X)re=PD(ie)??re;return{...D,specifiedByURL:re,extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.OBJECT]:D=>{let X=o.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.INTERFACE]:D=>{let X=s.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[dn.UNION]:D=>{let X=a.get(D.name)??[];return{...D,types:()=>[...D.types(),...K(X)],extensionASTNodes:D.extensionASTNodes.concat(X)}}};function w(D){let X={};for(let re of D){let ie=re.operationTypes??[];for(let ke of ie)X[ke.operation]=k(ke.type)}return X}function k(D){let X=D.name.value,re=h(X);return re===void 0&&it(!1,`Unknown type: "${X}".`),re}function _(D){return D.kind===$.LIST_TYPE?new qt(_(D.type)):D.kind===$.NON_NULL_TYPE?new ve(_(D.type)):k(D)}function S(D){let X=u.get(D.name.value)??[],re=Xc(D)??X.map(ie=>Xc(ie)).find(ie=>ie!=null);return new Tn({name:D.name.value,description:D.description?.value,locations:D.locations.map(({value:ie})=>ie),isRepeatable:D.repeatable,args:T(D.arguments),deprecationReason:re,astNode:D,extensionASTNodes:X})}function x(D){let X=u.get(D.name)??[];if(X.length===0)return D;let re=D.deprecationReason??X.map(ie=>Xc(ie)).find(ie=>ie!=null);return new Tn({...D.toConfig(),deprecationReason:re,extensionASTNodes:D.extensionASTNodes.concat(X)})}function E(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie)X[ke.name.value]={type:_(ke.type),description:ke.description?.value,args:T(ke.arguments),deprecationReason:Xc(ke),astNode:ke}}return X}function T(D){let X=D??[],re=Object.create(null);for(let ie of X){let ke=_(ie.type);re[ie.name.value]={type:ke,description:ie.description?.value,default:ie.defaultValue&&{literal:ie.defaultValue},deprecationReason:Xc(ie),astNode:ie}}return re}function A(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie){let We=_(ke.type);X[ke.name.value]={type:We,description:ke.description?.value,default:ke.defaultValue&&{literal:ke.defaultValue},deprecationReason:Xc(ke),astNode:ke}}}return X}function L(D){let X=Object.create(null);for(let re of D){let ie=re.values??[];for(let ke of ie)X[ke.name.value]={description:ke.description?.value,deprecationReason:Xc(ke),astNode:ke}}return X}function F(D){return D.flatMap(X=>X.interfaces?.map(k)??[])}function K(D){return D.flatMap(X=>X.types?.map(k)??[])}function te(D){let X=D.name.value;switch(D.kind){case $.OBJECT_TYPE_DEFINITION:{let re=o.get(X)??[],ie=[D,...re];return new Yn({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case $.INTERFACE_TYPE_DEFINITION:{let re=s.get(X)??[],ie=[D,...re];return new ns({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case $.ENUM_TYPE_DEFINITION:{let re=c.get(X)??[],ie=[D,...re];return new gi({name:X,description:D.description?.value,values:()=>L(ie),astNode:D,extensionASTNodes:re})}case $.UNION_TYPE_DEFINITION:{let re=a.get(X)??[],ie=[D,...re];return new rs({name:X,description:D.description?.value,types:()=>K(ie),astNode:D,extensionASTNodes:re})}case $.SCALAR_TYPE_DEFINITION:{let re=r.get(X)??[],ie=PD(D);for(let ke of re)ie=PD(ke)??ie;return new dr({name:X,description:D.description?.value,specifiedByURL:ie,astNode:D,extensionASTNodes:re})}case $.INPUT_OBJECT_TYPE_DEFINITION:{let re=l.get(X)??[],ie=[D,...re];return new is({name:X,description:D.description?.value,fields:()=>A(ie),astNode:D,extensionASTNodes:re,isOneOf:hxe(D)})}}}}):e}var gxe=new Map([...va,...$a].map(e=>[e.name,e]));function Xc(e){return Gd(Jr,e)?.reason}function PD(e){return Gd(Qg,e)?.url}function hxe(e){return!!Gd(Xg,e)}function DD(e,t){t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&wZ(e);let i=$Z({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(i.astNode==null)for(let o of i.types)switch(o.name){case"Query":i.query=o;break;case"Mutation":i.mutation=o;break;case"Subscription":i.subscription=o;break}let r=[...i.directives,...fr.filter(o=>i.directives.every(s=>s.name!==o.name))];return new nh({...i,directives:r})}function ah(e,t){let n=dD(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return DD(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function xa(e,t,n){if(e){if(e.kind===$.VARIABLE){let i=e.name.value;if(n==null||!Object.hasOwn(n,i))return;let r=n[i];return r===void 0||r===null&&_e(t)?void 0:r}if(_e(t))return e.kind===$.NULL?void 0:xa(e,t.ofType,n);if(e.kind===$.NULL)return null;if(Ke(t)){let i=t.ofType;if(e.kind===$.LIST){let o=[];for(let s of e.values)if(_Z(s,n)){if(_e(i))return;o.push(null)}else{let a=xa(s,i,n);if(a===void 0)return;o.push(a)}return o}let r=xa(e,i,n);return r===void 0?void 0:[r]}if(He(t)){if(e.kind!==$.OBJECT)return;let i=Object.create(null),r=t.getFields();if(e.fields.some(a=>!Object.hasOwn(r,a.name.value)))return;let s=new Map(e.fields.map(a=>[a.name.value,a]));for(let a of Object.values(r)){let c=s.get(a.name);if(c==null||_Z(c.value,n)){if(a.defaultValue!==void 0)i[a.name]=a.defaultValue;else if(_e(a.type))return;continue}let l=xa(c.value,a.type,n);if(l===void 0)return;i[a.name]=l}if(t.isOneOf){let a=Object.keys(i);if(s.size!==1||a.length!==1)return;for(let[c,l]of s)if(l.value.kind===$.NULL||i[c]===null)return}return i}if(hi(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}it(!1,"Unexpected input type: "+ce(t))}}function _Z(e,t){return e.kind===$.VARIABLE&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function cs(e){return"isDeprecated"in e?!!e.isDeprecated:!!(e.deprecationReason!=null||e.astNode?.directives?.some(t=>t.name.value==="deprecated"))}function Zr(e){return e.default!==void 0?e.default.literal!==void 0?xa(e.default.literal,e.type):So(e.default.value,e.type):e.defaultValue}function Bd(e){return e.default!==void 0||e.defaultValue!==void 0}function qd(e,t){return OD(e==null?void 0:Zr(e),Zr(t))}function OD(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,i)=>OD(n,t[i]));if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){let n=e,i=t,r=Object.keys(n),o=Object.keys(i);return r.length===o.length&&r.every(s=>Object.prototype.hasOwnProperty.call(i,s)&&OD(n[s],i[s]))}return!1}function ch(e,t){if(!Bi(e)&&!Bi(t))return e.toString()===t.toString();if(_e(t)){let n=_e(e)?e.ofType:e;return ch(n,t.ofType)}return Ke(e)?Ke(t)&&ch(e.ofType,t.ofType)||_e(t)&&ch(e,t.ofType):!1}function Ea(e,t){if(!Bi(e)&&!Bi(t))return e?.toString()===t.toString();if(Ke(e)&&Ke(t))return Ea(e.ofType,t.ofType);if(_e(e)){let n=_e(t)?t.ofType:t;return Ea(e.ofType,n)}return!1}function lh(e){return e.astNode?.kind||""}function MD(e){return["String","Int","Float","Boolean","ID"].includes(typeof e=="string"?e:e.name)}function LD(e){return["__Schema","__Type","__TypeKind","__Field","__InputValue","__EnumValue","__Directive","__DirectiveLocation"].includes(typeof e=="string"?e:e.name)}var W;(function(e){e.Breaking="BREAKING",e.NonBreaking="NON_BREAKING",e.Dangerous="DANGEROUS"})(W||(W={}));var P={FieldArgumentDescriptionChanged:"FIELD_ARGUMENT_DESCRIPTION_CHANGED",FieldArgumentDefaultChanged:"FIELD_ARGUMENT_DEFAULT_CHANGED",FieldArgumentTypeChanged:"FIELD_ARGUMENT_TYPE_CHANGED",DirectiveRemoved:"DIRECTIVE_REMOVED",DirectiveAdded:"DIRECTIVE_ADDED",DirectiveDescriptionChanged:"DIRECTIVE_DESCRIPTION_CHANGED",DirectiveLocationAdded:"DIRECTIVE_LOCATION_ADDED",DirectiveLocationRemoved:"DIRECTIVE_LOCATION_REMOVED",DirectiveArgumentAdded:"DIRECTIVE_ARGUMENT_ADDED",DirectiveArgumentRemoved:"DIRECTIVE_ARGUMENT_REMOVED",DirectiveArgumentDescriptionChanged:"DIRECTIVE_ARGUMENT_DESCRIPTION_CHANGED",DirectiveArgumentDefaultValueChanged:"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED",DirectiveArgumentTypeChanged:"DIRECTIVE_ARGUMENT_TYPE_CHANGED",DirectiveRepeatableAdded:"DIRECTIVE_REPEATABLE_ADDED",DirectiveRepeatableRemoved:"DIRECTIVE_REPEATABLE_REMOVED",EnumValueRemoved:"ENUM_VALUE_REMOVED",EnumValueAdded:"ENUM_VALUE_ADDED",EnumValueDescriptionChanged:"ENUM_VALUE_DESCRIPTION_CHANGED",EnumValueDeprecationReasonChanged:"ENUM_VALUE_DEPRECATION_REASON_CHANGED",EnumValueDeprecationReasonAdded:"ENUM_VALUE_DEPRECATION_REASON_ADDED",EnumValueDeprecationReasonRemoved:"ENUM_VALUE_DEPRECATION_REASON_REMOVED",FieldRemoved:"FIELD_REMOVED",FieldAdded:"FIELD_ADDED",FieldDescriptionChanged:"FIELD_DESCRIPTION_CHANGED",FieldDescriptionAdded:"FIELD_DESCRIPTION_ADDED",FieldDescriptionRemoved:"FIELD_DESCRIPTION_REMOVED",FieldDeprecationAdded:"FIELD_DEPRECATION_ADDED",FieldDeprecationRemoved:"FIELD_DEPRECATION_REMOVED",FieldDeprecationReasonChanged:"FIELD_DEPRECATION_REASON_CHANGED",FieldDeprecationReasonAdded:"FIELD_DEPRECATION_REASON_ADDED",FieldDeprecationReasonRemoved:"FIELD_DEPRECATION_REASON_REMOVED",FieldTypeChanged:"FIELD_TYPE_CHANGED",FieldArgumentAdded:"FIELD_ARGUMENT_ADDED",FieldArgumentRemoved:"FIELD_ARGUMENT_REMOVED",InputFieldRemoved:"INPUT_FIELD_REMOVED",InputFieldAdded:"INPUT_FIELD_ADDED",InputFieldDescriptionAdded:"INPUT_FIELD_DESCRIPTION_ADDED",InputFieldDescriptionRemoved:"INPUT_FIELD_DESCRIPTION_REMOVED",InputFieldDescriptionChanged:"INPUT_FIELD_DESCRIPTION_CHANGED",InputFieldDefaultValueChanged:"INPUT_FIELD_DEFAULT_VALUE_CHANGED",InputFieldTypeChanged:"INPUT_FIELD_TYPE_CHANGED",ObjectTypeInterfaceAdded:"OBJECT_TYPE_INTERFACE_ADDED",ObjectTypeInterfaceRemoved:"OBJECT_TYPE_INTERFACE_REMOVED",SchemaQueryTypeChanged:"SCHEMA_QUERY_TYPE_CHANGED",SchemaMutationTypeChanged:"SCHEMA_MUTATION_TYPE_CHANGED",SchemaSubscriptionTypeChanged:"SCHEMA_SUBSCRIPTION_TYPE_CHANGED",TypeRemoved:"TYPE_REMOVED",TypeAdded:"TYPE_ADDED",TypeKindChanged:"TYPE_KIND_CHANGED",TypeDescriptionChanged:"TYPE_DESCRIPTION_CHANGED",TypeDescriptionRemoved:"TYPE_DESCRIPTION_REMOVED",TypeDescriptionAdded:"TYPE_DESCRIPTION_ADDED",UnionMemberRemoved:"UNION_MEMBER_REMOVED",UnionMemberAdded:"UNION_MEMBER_ADDED",DirectiveUsageUnionMemberAdded:"DIRECTIVE_USAGE_UNION_MEMBER_ADDED",DirectiveUsageUnionMemberRemoved:"DIRECTIVE_USAGE_UNION_MEMBER_REMOVED",DirectiveUsageEnumAdded:"DIRECTIVE_USAGE_ENUM_ADDED",DirectiveUsageEnumRemoved:"DIRECTIVE_USAGE_ENUM_REMOVED",DirectiveUsageEnumValueAdded:"DIRECTIVE_USAGE_ENUM_VALUE_ADDED",DirectiveUsageEnumValueRemoved:"DIRECTIVE_USAGE_ENUM_VALUE_REMOVED",DirectiveUsageInputObjectAdded:"DIRECTIVE_USAGE_INPUT_OBJECT_ADDED",DirectiveUsageInputObjectRemoved:"DIRECTIVE_USAGE_INPUT_OBJECT_REMOVED",DirectiveUsageFieldAdded:"DIRECTIVE_USAGE_FIELD_ADDED",DirectiveUsageFieldRemoved:"DIRECTIVE_USAGE_FIELD_REMOVED",DirectiveUsageScalarAdded:"DIRECTIVE_USAGE_SCALAR_ADDED",DirectiveUsageScalarRemoved:"DIRECTIVE_USAGE_SCALAR_REMOVED",DirectiveUsageObjectAdded:"DIRECTIVE_USAGE_OBJECT_ADDED",DirectiveUsageObjectRemoved:"DIRECTIVE_USAGE_OBJECT_REMOVED",DirectiveUsageInterfaceAdded:"DIRECTIVE_USAGE_INTERFACE_ADDED",DirectiveUsageInterfaceRemoved:"DIRECTIVE_USAGE_INTERFACE_REMOVED",DirectiveUsageArgumentDefinitionAdded:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_ADDED",DirectiveUsageArgumentDefinitionRemoved:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_REMOVED",DirectiveUsageSchemaAdded:"DIRECTIVE_USAGE_SCHEMA_ADDED",DirectiveUsageSchemaRemoved:"DIRECTIVE_USAGE_SCHEMA_REMOVED",DirectiveUsageFieldDefinitionAdded:"DIRECTIVE_USAGE_FIELD_DEFINITION_ADDED",DirectiveUsageFieldDefinitionRemoved:"DIRECTIVE_USAGE_FIELD_DEFINITION_REMOVED",DirectiveUsageInputFieldDefinitionAdded:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_ADDED",DirectiveUsageInputFieldDefinitionRemoved:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_REMOVED",DirectiveUsageArgumentAdded:"DIRECTIVE_USAGE_ARGUMENT_ADDED",DirectiveUsageArgumentRemoved:"DIRECTIVE_USAGE_ARGUMENT_REMOVED"};function SZ(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),Object.create(null))}function C$(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n"u"||e===null}function FD(e,t){return e.filter(n=>!t.some(i=>C$(i,n)))}function bi(e){return typeof e=="string"?e:e.value}function en(e,t,n){let i=SZ(e,({name:c})=>bi(c)),r=SZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;l===null?s.push(c):a.push({newVersion:l,oldVersion:c??null})}for(let c of t)i[bi(c.name)]===void 0&&o.push(c);if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function tn(e,t,n){let i=xZ(e,({name:c})=>bi(c)),r=xZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;if(l===null)s.push(c);else{let[u,...d]=l;d.length>0?r[bi(c.name)]=d:delete r[bi(c.name)],a.push({newVersion:u,oldVersion:c??null})}}for(let c of t){let l=i[bi(c.name)]??null;if(l===null)o.push(c);else{let[u,...d]=l;d.length>0?i[bi(c.name)]=d:delete i[bi(c.name)]}}if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function xZ(e,t){return e.reduce((n,i)=>{let r=t(i);return n[r]=[...n[r]??[],i],n},Object.create(null))}function vi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.Breaking:t}function wi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.NonBreaking:t}function vxe(e){return`Directive '${e.addedDirectiveName}' was added to argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function wxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionAdded,message:vxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function kxe(e){return`Directive '${e.removedDirectiveName}' was removed from argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function $xe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionRemoved,message:kxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function _xe(e){return`Directive '${e.addedDirectiveName}' was added to input object '${e.inputObjectName}'`}function Sxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectAdded,message:_xe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function xxe(e){return`Directive '${e.removedDirectiveName}' was removed from input object '${e.inputObjectName}'`}function Exe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectRemoved,message:xxe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Txe(e){return`Directive '${e.addedDirectiveName}' was added to interface '${e.interfaceName}'`}function Ixe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceAdded,message:Txe(e.meta),path:[e.meta.interfaceName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Axe(e){return`Directive '${e.removedDirectiveName}' was removed from interface '${e.interfaceName}'`}function Rxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceRemoved,message:Axe(e.meta),path:[e.meta.interfaceName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Nxe(e){return`Directive '${e.addedDirectiveName}' was added to input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function Cxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionAdded,message:Nxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Pxe(e){return`Directive '${e.removedDirectiveName}' was removed from input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function Dxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionRemoved,message:Pxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Oxe(e){return`Directive '${e.addedDirectiveName}' was added to object '${e.objectName}'`}function Mxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectAdded,message:Oxe(e.meta),path:[e.meta.objectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Lxe(e){return`Directive '${e.removedDirectiveName}' was removed from object '${e.objectName}'`}function Fxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectRemoved,message:Lxe(e.meta),path:[e.meta.objectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Uxe(e){return`Directive '${e.addedDirectiveName}' was added to enum '${e.enumName}'`}function jxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumAdded,message:Uxe(e.meta),path:[e.meta.enumName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function zxe(e){return`Directive '${e.removedDirectiveName}' was removed from enum '${e.enumName}'`}function Gxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumRemoved,message:zxe(e.meta),path:[e.meta.enumName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Vxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Bxe(e){return{criticality:{level:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldAdded,message:Vxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.addedDirectiveName].join("."),meta:e.meta}}function qxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Wxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionAdded,message:qxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Hxe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function Kxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldRemoved,message:Hxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.removedDirectiveName].join("."),meta:e.meta}}function Jxe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function Zxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionRemoved,message:Jxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Yxe(e){return`Directive '${e.addedDirectiveName}' was added to enum value '${e.enumName}.${e.enumValueName}'`}function Qxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueAdded,message:Yxe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Xxe(e){return`Directive '${e.removedDirectiveName}' was removed from enum value '${e.enumName}.${e.enumValueName}'`}function eEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueRemoved,message:Xxe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function tEe(e){return`Directive '${e.addedDirectiveName}' was added to schema`}function nEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to schema`},type:P.DirectiveUsageSchemaAdded,message:tEe(e.meta),path:`.@${e.meta.addedDirectiveName}`,meta:e.meta}}function rEe(e){return`Directive '${e.removedDirectiveName}' was removed from schema`}function iEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from schema`},type:P.DirectiveUsageSchemaRemoved,message:rEe(e.meta),path:`.@${e.meta.removedDirectiveName}`,meta:e.meta}}function oEe(e){return`Directive '${e.addedDirectiveName}' was added to scalar '${e.scalarName}'`}function sEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarAdded,message:oEe(e.meta),path:[e.meta.scalarName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function aEe(e){return`Directive '${e.removedDirectiveName}' was removed from scalar '${e.scalarName}'`}function cEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarRemoved,message:aEe(e.meta),path:[e.meta.scalarName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function lEe(e){return`Directive '${e.addedDirectiveName}' was added to union member '${e.unionName}'`}function uEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to union member '${e.meta.unionName}.${e.meta.addedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberAdded,message:lEe(e.meta),path:[e.meta.unionName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function dEe(e){return`Directive '${e.removedDirectiveName}' was removed from union member '${e.unionName}'`}function pEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from union member '${e.meta.unionName}.${e.meta.removedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberRemoved,message:dEe(e.meta),path:[e.meta.unionName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function nn(e,t,n,i){return Nt(e,$.ARGUMENT,n)?wxe({type:P.DirectiveUsageArgumentDefinitionAdded,meta:{addedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,$.INPUT_VALUE_DEFINITION,n)?Cxe({type:P.DirectiveUsageInputFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,inputFieldName:n.field.name,inputFieldType:n.field.type.toString(),inputObjectName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.INPUT_OBJECT_TYPE_DEFINITION,n)?Sxe({type:P.DirectiveUsageInputObjectAdded,meta:{addedDirectiveName:t.name.value,addedInputFieldName:t.name.value,addedInputFieldType:n.name,inputObjectName:n.name,isAddedInputFieldTypeNullable:e===$.INPUT_VALUE_DEFINITION,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.INTERFACE_TYPE_DEFINITION,n)?Ixe({type:P.DirectiveUsageInterfaceAdded,meta:{addedDirectiveName:t.name.value,interfaceName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.OBJECT,n)?Mxe({type:P.DirectiveUsageObjectAdded,meta:{objectName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_TYPE_DEFINITION,n)?jxe({type:P.DirectiveUsageEnumAdded,meta:{enumName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.FIELD,n)?Bxe({type:P.DirectiveUsageFieldAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.FIELD_DEFINITION,n)?Wxe({type:P.DirectiveUsageFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.UNION_TYPE_DEFINITION,n)?uEe({type:P.DirectiveUsageUnionMemberAdded,meta:{addedDirectiveName:t.name.value,addedUnionMemberTypeName:n.name,unionName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_VALUE_DEFINITION,n)?Qxe({type:P.DirectiveUsageEnumValueAdded,meta:{enumName:n.type.name,enumValueName:n.value.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,$.SCHEMA_DEFINITION,n)?nEe({type:P.DirectiveUsageSchemaAdded,meta:{addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,$.SCALAR_TYPE_DEFINITION,n)?sEe({type:P.DirectiveUsageScalarAdded,meta:{scalarName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function yt(e,t){let n=t.name.value,i=0;for(let r of e)if(r.name.value===n&&(i+=1),r===t)return i;return 0}function rn(e,t,n){return Nt(e,$.ARGUMENT,n)?$xe({type:P.DirectiveUsageArgumentDefinitionRemoved,meta:{removedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Nt(e,$.INPUT_VALUE_DEFINITION,n)?Dxe({type:P.DirectiveUsageInputFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,inputFieldName:n.field.name,inputObjectName:n.type.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.INPUT_OBJECT_TYPE_DEFINITION,n)?Exe({type:P.DirectiveUsageInputObjectRemoved,meta:{removedDirectiveName:t.name.value,removedInputFieldName:t.name.value,removedInputFieldType:n.name,inputObjectName:n.name,isRemovedInputFieldTypeNullable:e===$.INPUT_VALUE_DEFINITION,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.INTERFACE_TYPE_DEFINITION,n)?Rxe({type:P.DirectiveUsageInterfaceRemoved,meta:{removedDirectiveName:t.name.value,interfaceName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.OBJECT,n)?Fxe({type:P.DirectiveUsageObjectRemoved,meta:{objectName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_TYPE_DEFINITION,n)?Gxe({type:P.DirectiveUsageEnumRemoved,meta:{enumName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.FIELD,n)?Kxe({type:P.DirectiveUsageFieldRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.FIELD_DEFINITION,n)?Zxe({type:P.DirectiveUsageFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Nt(e,$.UNION_TYPE_DEFINITION,n)?pEe({type:P.DirectiveUsageUnionMemberRemoved,meta:{removedDirectiveName:t.name.value,removedUnionMemberTypeName:n.name,unionName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Nt(e,$.ENUM_VALUE_DEFINITION,n)?eEe({type:P.DirectiveUsageEnumValueRemoved,meta:{enumName:n.type.name,enumValueName:n.value.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Nt(e,$.SCHEMA_DEFINITION,n)?iEe({type:P.DirectiveUsageSchemaRemoved,meta:{removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Nt(e,$.SCALAR_TYPE_DEFINITION,n)?cEe({type:P.DirectiveUsageScalarRemoved,meta:{scalarName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function Nt(e,t,n){return e===t}function EZ(e){return{type:P.DirectiveUsageArgumentAdded,criticality:{level:W.NonBreaking},message:`Argument '${e.meta.addedArgumentName}' was added to '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.addedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function TZ(e){return{type:P.DirectiveUsageArgumentRemoved,criticality:{level:W.Dangerous,reason:"Changing an argument on a directive can change runtime behavior."},message:`Argument '${e.meta.removedArgumentName}' was removed from '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.removedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function et(e,t,n,i,r,o,s){en(e?.arguments||[],t.arguments||[],{onAdded(a){n(EZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.name.value,addedArgumentValue:Ye(a.value),oldArgumentValue:null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))},onMutual(a){a.oldVersion&&Ye(a.oldVersion.value)===Ye(a.newVersion.value)||(a.oldVersion&&n(TZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.oldVersion.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})),n(EZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.newVersion.name.value,addedArgumentValue:Ye(a.newVersion.value),oldArgumentValue:(a.oldVersion?.value&&Ye(a.oldVersion.value))??null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})))},onRemoved(a){n(TZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))}})}var ZZ=gt(JZ(),1);function Ki(e){return typeof e=="string"?JSON.stringify(e):(0,ZZ.default)(e).replace(/\[Object: null prototype\] /g,"").replace(/(^')|('$)/g,"")}function je(e){return e.replace(/'/g,"\\'")}function jEe(e){return`Directive '${e.removedDirectiveName}' was removed`}var zEe="A directive could be in use of a client application. Removing it could break the client application.";function GEe(e){return{criticality:{level:W.Breaking,reason:zEe},type:P.DirectiveRemoved,message:jEe(e.meta),path:`@${e.meta.removedDirectiveName}`,meta:e.meta}}function YZ(e){return GEe({type:P.DirectiveRemoved,meta:{removedDirectiveName:e.name}})}function VEe(e){return`Directive '${e.addedDirectiveName}' was added`}function BEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveAdded,message:VEe(e.meta),path:`@${e.meta.addedDirectiveName}`,meta:e.meta}}function QZ(e){return BEe({type:P.DirectiveAdded,meta:{addedDirectiveName:e.name,addedDirectiveDescription:e.description??null,addedDirectiveLocations:e.locations.map(t=>String(t)),addedDirectiveRepeatable:e.isRepeatable}})}function qEe(e){return e.oldDirectiveDescription===null&&e.newDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.newDirectiveDescription)}' was added`:e.newDirectiveDescription===null&&e.oldDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.oldDirectiveDescription)}' was removed`:`Directive '${e.directiveName}' description changed from '${je(e.oldDirectiveDescription??"")}' to '${je(e.newDirectiveDescription??"")}'`}function WEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveDescriptionChanged,message:qEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function XZ(e,t){return WEe({type:P.DirectiveDescriptionChanged,meta:{directiveName:t.name,oldDirectiveDescription:e?.description??null,newDirectiveDescription:t.description??null}})}function HEe(e){return`Directive '${e.directiveName}' added repeatable.`}function KEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveRepeatableAdded,message:HEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function e3(e){return KEe({type:P.DirectiveRepeatableAdded,meta:{directiveName:e.name}})}function JEe(e){return`Directive '${e.directiveName}' removed repeatable.`}function ZEe(e){return{criticality:{level:W.Dangerous},type:P.DirectiveRepeatableRemoved,message:JEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function t3(e){return ZEe({type:P.DirectiveRepeatableRemoved,meta:{directiveName:e.name}})}function YEe(e){return`Location '${e.addedDirectiveLocation}' was added to directive '${e.directiveName}'`}function QEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveLocationAdded,message:YEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function n3(e,t){return QEe({type:P.DirectiveLocationAdded,meta:{directiveName:e.name,addedDirectiveLocation:String(t)}})}function XEe(e){return`Location '${e.removedDirectiveLocation}' was removed from directive '${e.directiveName}'`}var eTe="A directive could be in use of a client application. Removing it could break the client application.";function tTe(e){return{criticality:{level:W.Breaking,reason:eTe},type:P.DirectiveLocationRemoved,message:XEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function r3(e,t){return tTe({type:P.DirectiveLocationRemoved,meta:{directiveName:e.name,removedDirectiveLocation:t.toString()}})}var nTe="A directive could be in use of a client application. Adding a non-nullable argument will break those clients.",rTe="A directive could be in use of a client application. Adding a nullable argument will not break those clients.",iTe="Refer to the directive usage for the breaking status. If the directive is new and therefore unused, then adding an argument does not risk breaking clients.";function oTe(e){return{criticality:e.meta.addedToNewDirective?{level:W.NonBreaking,reason:iTe}:e.meta.addedDirectiveArgumentTypeIsNonNull?{level:W.Breaking,reason:nTe}:{level:W.NonBreaking,reason:rTe},type:P.DirectiveArgumentAdded,message:`Argument '${e.meta.addedDirectiveArgumentName}' was added to directive '${e.meta.directiveName}'`,path:`@${e.meta.directiveName}`,meta:e.meta}}function i3(e,t,n){return oTe({type:P.DirectiveArgumentAdded,meta:{directiveName:e.name,addedDirectiveArgumentName:t.name,addedDirectiveArgumentType:t.type.toString(),addedDirectiveDefaultValue:Bd(t)?Ki(Zr(t)):void 0,addedDirectiveArgumentTypeIsNonNull:_e(t.type),addedDirectiveArgumentDescription:t.description??void 0,addedToNewDirective:n}})}function sTe(e){return`Argument '${e.removedDirectiveArgumentName}' was removed from directive '${e.directiveName}'`}var aTe="A directive argument could be in use of a client application. Removing the argument can break client applications.";function cTe(e){return{criticality:{level:W.Breaking,reason:aTe},type:P.DirectiveArgumentRemoved,message:sTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.removedDirectiveArgumentName}`,meta:e.meta}}function o3(e,t){return cTe({type:P.DirectiveArgumentRemoved,meta:{directiveName:e.name,removedDirectiveArgumentName:t.name}})}function lTe(e){return e.oldDirectiveArgumentDescription===null&&e.newDirectiveArgumentDescription!==null?`Description '${je(e.newDirectiveArgumentDescription)}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:e.newDirectiveArgumentDescription===null&&e.oldDirectiveArgumentDescription!==null?`Description '${je(e.oldDirectiveArgumentDescription)}' was removed from argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Description for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${je(e.oldDirectiveArgumentDescription??"")}' to '${je(e.newDirectiveArgumentDescription??"")}'`}function uTe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveArgumentDescriptionChanged,message:lTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function s3(e,t,n){return uTe({type:P.DirectiveArgumentDescriptionChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentDescription:t?.description??null,newDirectiveArgumentDescription:n.description??null}})}function dTe(e){return e.oldDirectiveArgumentDefaultValue===void 0?`Default value '${e.newDirectiveArgumentDefaultValue}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Default value for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${e.oldDirectiveArgumentDefaultValue}' to '${e.newDirectiveArgumentDefaultValue}'`}var pTe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function fTe(e){return{criticality:{level:W.Dangerous,reason:pTe},type:P.DirectiveArgumentDefaultValueChanged,message:dTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function a3(e,t,n){let i={directiveName:e.name,directiveArgumentName:n.name},r=t===null?void 0:Zr(t),o=Zr(n);return r!==void 0&&(i.oldDirectiveArgumentDefaultValue=Ki(r)),o!==void 0&&(i.newDirectiveArgumentDefaultValue=Ki(o)),fTe({type:P.DirectiveArgumentDefaultValueChanged,meta:i})}function mTe(e){return`Type for argument '${e.meta.directiveArgumentName}' on directive '${e.meta.directiveName}' changed from '${e.meta.oldDirectiveArgumentType}' to '${e.meta.newDirectiveArgumentType}'`}var gTe="Changing an input field from non-null to null is considered non-breaking.";function hTe(e){return{criticality:e.meta.isSafeDirectiveArgumentTypeChange?{level:W.NonBreaking,reason:gTe}:{level:W.Breaking},type:P.DirectiveArgumentTypeChanged,message:mTe(e),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function c3(e,t,n){return hTe({type:P.DirectiveArgumentTypeChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentType:t?.type.toString()??"",newDirectiveArgumentType:n.type.toString(),isSafeDirectiveArgumentTypeChange:Ea(t.type,n.type)}})}function yTe(e){return e.oldQueryTypeName===null?`Schema query root type was set to '${e.newQueryTypeName}'.`:e.newQueryTypeName===null?`Schema query root type '${e.oldQueryTypeName}' was removed.`:`Schema query root type was changed from '${e.oldQueryTypeName}' to '${e.newQueryTypeName}'`}function bTe(e){return{type:P.SchemaQueryTypeChanged,criticality:{level:e.meta.oldQueryTypeName===null?W.NonBreaking:W.Breaking},message:yTe(e.meta),meta:e.meta}}function l3(e,t){let n=e?.getQueryType()?.name||null,i=t?.getQueryType()?.name||null;return bTe({type:P.SchemaQueryTypeChanged,meta:{oldQueryTypeName:n,newQueryTypeName:i}})}function vTe(e){return e.oldMutationTypeName===null?`Schema mutation type was set to '${e.newMutationTypeName}'.`:e.newMutationTypeName===null?`Schema mutation type '${e.oldMutationTypeName}' was removed.`:`Schema mutation type was changed from '${e.oldMutationTypeName}' to '${e.newMutationTypeName}'`}function wTe(e){return{type:P.SchemaMutationTypeChanged,criticality:{level:e.meta.oldMutationTypeName===null?W.NonBreaking:W.Breaking},message:vTe(e.meta),meta:e.meta}}function u3(e,t){let n=e?.getMutationType()?.name||null,i=t?.getMutationType()?.name||null;return wTe({type:P.SchemaMutationTypeChanged,meta:{newMutationTypeName:i,oldMutationTypeName:n}})}function kTe(e){return e.oldSubscriptionTypeName===null?`Schema subscription type was set to '${e.newSubscriptionTypeName}'.`:e.newSubscriptionTypeName===null?`Schema subscription type '${e.oldSubscriptionTypeName}' was removed.`:`Schema subscription type was changed from '${e.oldSubscriptionTypeName}' to '${e.newSubscriptionTypeName}'`}function $Te(e){return{type:P.SchemaSubscriptionTypeChanged,criticality:{level:e.meta.oldSubscriptionTypeName===null?W.NonBreaking:W.Breaking},message:kTe(e.meta),meta:e.meta}}function d3(e,t){let n=e?.getSubscriptionType()?.name||null,i=t?.getSubscriptionType()?.name||null;return $Te({type:P.SchemaSubscriptionTypeChanged,meta:{newSubscriptionTypeName:i,oldSubscriptionTypeName:n}})}function _Te(e){return`Type '${e.removedTypeName}' was removed`}function STe(e){return{criticality:{level:W.Breaking},type:P.TypeRemoved,message:_Te(e.meta),meta:e.meta,path:e.meta.removedTypeName}}function p3(e){return STe({type:P.TypeRemoved,meta:{removedTypeName:e.name}})}function xTe(e){return`Type '${e.addedTypeName}' was added`}function ETe(e){return{criticality:{level:W.NonBreaking},type:P.TypeAdded,message:xTe(e.meta),meta:e.meta,path:e.meta.addedTypeName}}function TTe(e){return Xt(e)?{addedTypeKind:$.ENUM_TYPE_DEFINITION,addedTypeName:e.name}:at(e)||Be(e)?{addedTypeKind:lh(e),addedTypeName:e.name}:Qt(e)?{addedTypeKind:$.UNION_TYPE_DEFINITION,addedTypeName:e.name}:He(e)?{addedTypeKind:$.INPUT_OBJECT_TYPE_DEFINITION,addedTypeIsOneOf:e.isOneOf,addedTypeName:e.name}:{addedTypeKind:lh(e),addedTypeName:e.name}}function f3(e){return ETe({type:P.TypeAdded,meta:TTe(e)})}function ITe(e){return`'${e.meta.typeName}' kind changed from '${e.meta.oldTypeKind}' to '${e.meta.newTypeKind}'`}function ATe(e){return{criticality:{level:W.Breaking,reason:"Changing the kind of a type is a breaking change because it can cause existing queries to error. For example, turning an object type to a scalar type would break queries that define a selection set for this type."},type:P.TypeKindChanged,message:ITe(e),path:e.meta.typeName,meta:e.meta}}function m3(e,t){return ATe({type:P.TypeKindChanged,meta:{typeName:t.name,newTypeKind:String(lh(t)),oldTypeKind:String(lh(e))}})}function RTe(e){let t=je(e.oldTypeDescription),n=je(e.newTypeDescription);return`Description '${t}' on type '${e.typeName}' has changed to '${n}'`}function NTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionChanged,message:RTe(e.meta),path:e.meta.typeName,meta:e.meta}}function g3(e,t){return NTe({type:P.TypeDescriptionChanged,meta:{typeName:e.name,newTypeDescription:t.description??"",oldTypeDescription:e.description??""}})}function CTe(e){return`Description '${je(e.removedTypeDescription)}' was removed from object type '${e.typeName}'`}function PTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionRemoved,message:CTe(e.meta),path:e.meta.typeName,meta:e.meta}}function h3(e){return PTe({type:P.TypeDescriptionRemoved,meta:{typeName:e.name,removedTypeDescription:e.description??""}})}function DTe(e){let t=je(e.addedTypeDescription);return`Object type '${e.typeName}' has description '${t}'`}function OTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionAdded,message:DTe(e.meta),path:e.meta.typeName,meta:e.meta}}function y3(e){return OTe({type:P.TypeDescriptionAdded,meta:{typeName:e.name,addedTypeDescription:e.description??""}})}function YD(e,t,n){Wt(e?.description,t.description)&&n(XZ(e,t)),!t.isRepeatable&&e?.isRepeatable&&n(t3(t)),t.isRepeatable&&!e?.isRepeatable&&n(e3(t));let i={added:FD(t.locations,e?.locations??[]),removed:FD(e?.locations??[],t.locations)};for(let r of i.added)n(n3(t,r));for(let r of i.removed)n(r3(t,r));en(e?.args??[],t.args,{onAdded(r){n(i3(t,r,e===null))},onRemoved(r){n(o3(t,r))},onMutual(r){MTe(t,r.oldVersion,r.newVersion,n)}})}function MTe(e,t,n,i){Wt(t?.description,n.description)&&i(s3(e,t,n)),qd(t,n)||i(a3(e,t,n)),Wt(t.type.toString(),n.type.toString())&&i(c3(e,t,n))}function LTe(e){return`Enum value '${e.removedEnumValueName}' ${e.isEnumValueDeprecated?"(deprecated) ":""}was removed from enum '${e.enumName}'`}var FTe="Removing an enum value will cause existing queries that use this enum value to error.";function UTe(e){return{type:P.EnumValueRemoved,criticality:{level:W.Breaking,reason:FTe},message:LTe(e.meta),meta:e.meta,path:[e.meta.enumName,e.meta.removedEnumValueName].join(".")}}function b3(e,t){return UTe({type:P.EnumValueRemoved,meta:{enumName:e.name,removedEnumValueName:t.name,isEnumValueDeprecated:cs(t)}})}function jTe(e){return`Enum value '${e.meta.addedEnumValueName}' was added to enum '${e.meta.enumName}'`}var zTe="Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.";function GTe(e){let t=e.meta.addedToNewType;return{type:P.EnumValueAdded,criticality:{level:t?W.NonBreaking:W.Dangerous,reason:t?void 0:zTe},message:jTe(e),meta:e.meta,path:[e.meta.enumName,e.meta.addedEnumValueName].join(".")}}function v3(e,t,n){return GTe({type:P.EnumValueAdded,meta:{enumName:e.name,addedEnumValueName:t.name,addedToNewType:n,addedDirectiveDescription:t.description??null}})}function VTe(e){return e.oldEnumValueDescription===null&&e.newEnumValueDescription!==null?`Description '${je(e.newEnumValueDescription)}' was added to enum value '${e.enumName}.${e.enumValueName}'`:e.newEnumValueDescription===null&&e.oldEnumValueDescription!==null?`Description '${je(e.oldEnumValueDescription)}' was removed from enum value '${e.enumName}.${e.enumValueName}'`:`Description for enum value '${e.enumName}.${e.enumValueName}' changed from '${je(e.oldEnumValueDescription??"")}' to '${je(e.newEnumValueDescription??"")}'`}function BTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDescriptionChanged,message:VTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function w3(e,t,n){return BTe({type:P.EnumValueDescriptionChanged,meta:{enumName:e.name,enumValueName:n.name,oldEnumValueDescription:t?.description??null,newEnumValueDescription:n.description??null}})}function qTe(e){let t=je(e.oldEnumValueDeprecationReason),n=je(e.newEnumValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' deprecation reason changed from '${t}' to '${n}'`}function WTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonChanged,message:qTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Jr.name}`].join("."),meta:e.meta}}function k3(e,t,n){return WTe({type:P.EnumValueDeprecationReasonChanged,meta:{enumName:e.name,enumValueName:t.name,oldEnumValueDeprecationReason:t.deprecationReason??"",newEnumValueDeprecationReason:n.deprecationReason??""}})}function HTe(e){let t=je(e.addedValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' was deprecated with reason '${t}'`}function KTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonAdded,message:HTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Jr.name}`].join("."),meta:e.meta}}function $3(e,t,n){return KTe({type:P.EnumValueDeprecationReasonAdded,meta:{enumName:e.name,enumValueName:n.name,addedValueDeprecationReason:n.deprecationReason??""}})}function JTe(e){return`Deprecation reason was removed from enum value '${e.enumName}.${e.enumValueName}'`}function ZTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonRemoved,message:JTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function _3(e,t,n){return ZTe({type:P.EnumValueDeprecationReasonRemoved,meta:{enumName:e.name,enumValueName:t.name,removedEnumValueDeprecationReason:t.deprecationReason??""}})}var S3="No longer supported";function E3(e,t,n){en(e?.getValues()??[],t.getValues(),{onAdded(i){n(v3(t,i,e===null)),x3({newVersion:i,oldVersion:null},t,n)},onRemoved(i){n(b3(e,i))},onMutual(i){x3(i,t,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(nn($.ENUM_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(rn($.ENUM_TYPE_DEFINITION,i,t))}})}function x3(e,t,n){let i=e.oldVersion,r=e.newVersion;Wt(i?.description,r.description)&&n(w3(t,i,r)),Wt(i?.deprecationReason,r.deprecationReason)&&(At(i?.deprecationReason)||i?.deprecationReason===S3?n($3(t,i,r)):At(r.deprecationReason)||r?.deprecationReason===S3?n(_3(t,i,r)):n(k3(t,i,r))),tn(i?.astNode?.directives||[],r.astNode?.directives||[],{onAdded(o){n(nn($.ENUM_VALUE_DEFINITION,o,{type:t,value:r},i===null)),et(null,o,n,t,void 0,void 0,r)},onMutual(o){et(o.oldVersion,o.newVersion,n,t,void 0,void 0,r)},onRemoved(o){n(rn($.ENUM_VALUE_DEFINITION,o,{type:t,value:i}))}})}function YTe(e){return`Input field '${e.removedFieldName}' ${e.isInputFieldDeprecated?"(deprecated) ":""}was removed from input object type '${e.inputName}'`}function QTe(e){return{type:P.InputFieldRemoved,criticality:{level:W.Breaking,reason:"Removing an input field will cause existing queries that use this input field to error."},message:YTe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.removedFieldName].join(".")}}function T3(e,t){return QTe({type:P.InputFieldRemoved,meta:{inputName:e.name,removedFieldName:t.name,isInputFieldDeprecated:cs(t)}})}function XTe(e){return`Input field '${e.addedInputFieldName}' of type '${e.addedInputFieldType}'${e.addedFieldDefault?` with default value '${e.addedFieldDefault}'`:""} was added to input object type '${e.inputName}'`}function eIe(e){let t,n=e.meta.isAddedInputFieldTypeNullable&&e.meta.addedFieldDefault===void 0;return e.meta.addedToNewType?t={level:W.NonBreaking,reason:"The field is being added to a new type."}:n?t={level:W.NonBreaking,reason:"The field is nullable and no default is set."}:e.meta.addedFieldDefault===void 0?t={level:W.Breaking,reason:"Adding a required input field to an existing input object type is a breaking change because it will cause existing uses of this input object type to error."}:t={level:W.Dangerous,reason:"Adding a field with a default value can change runtime behavior for clients that previously omitted it, and during rolling deploys consumers may receive the new default before producers are ready to handle it."},{type:P.InputFieldAdded,criticality:t,message:XTe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.addedInputFieldName].join(".")}}function I3(e,t,n){let i=Zr(t);return eIe({type:P.InputFieldAdded,meta:{inputName:e.name,addedInputFieldName:t.name,isAddedInputFieldTypeNullable:!_e(t.type),addedInputFieldType:t.type.toString(),...Bd(t)?{addedFieldDefault:Ki(i)}:{},addedToNewType:n}})}function tIe(e){let t=je(e.addedInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' has description '${t}'`}function nIe(e){return{type:P.InputFieldDescriptionAdded,criticality:{level:W.NonBreaking},message:tIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function A3(e,t){return nIe({type:P.InputFieldDescriptionAdded,meta:{inputName:e.name,inputFieldName:t.name,addedInputFieldDescription:t.description??""}})}function rIe(e){return`Description '${je(e.removedDescription)}' was removed from input field '${e.inputName}.${e.inputFieldName}'`}function iIe(e){return{type:P.InputFieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:rIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function R3(e,t){return iIe({type:P.InputFieldDescriptionRemoved,meta:{inputName:e.name,inputFieldName:t.name,removedDescription:t.description??""}})}function oIe(e){let t=je(e.oldInputFieldDescription),n=je(e.newInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' description changed from '${t}' to '${n}'`}function sIe(e){return{type:P.InputFieldDescriptionChanged,criticality:{level:W.NonBreaking},message:oIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function N3(e,t,n){return sIe({type:P.InputFieldDescriptionChanged,meta:{inputName:e.name,inputFieldName:t.name,oldInputFieldDescription:t.description??"",newInputFieldDescription:n.description??""}})}function aIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' default value changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}function cIe(e){let t={level:W.Dangerous,reason:"Changing the default value for an argument may change the runtime behavior of a field if it was never provided."};return{type:P.InputFieldDefaultValueChanged,criticality:t,message:aIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function C3(e,t,n){let i={inputName:e.name,inputFieldName:n.name},r=Zr(t),o=Zr(n);return r!==void 0&&(i.oldDefaultValue=Ki(r)),o!==void 0&&(i.newDefaultValue=Ki(o)),cIe({type:P.InputFieldDefaultValueChanged,meta:i})}function lIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' changed type from '${e.oldInputFieldType}' to '${e.newInputFieldType}'`}function uIe(e){return{type:P.InputFieldTypeChanged,criticality:e.meta.isInputFieldTypeChangeSafe?{level:W.NonBreaking,reason:"Changing an input field from non-null to null is considered non-breaking."}:{level:W.Breaking,reason:"Changing the type of an input field can cause existing queries that use this field to error."},message:lIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function P3(e,t,n){return uIe({type:P.InputFieldTypeChanged,meta:{inputName:e.name,inputFieldName:n.name,oldInputFieldType:t.type.toString(),newInputFieldType:n.type.toString(),isInputFieldTypeChangeSafe:Ea(t.type,n.type)}})}function O3(e,t,n){let i=e?.getFields()??{},r=t.getFields();en(Object.values(i),Object.values(r),{onAdded(o){n(I3(t,o,e==null)),D3(t,null,o,n)},onRemoved(o){n(T3(e,o))},onMutual(o){D3(t,o.oldVersion,o.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn($.INPUT_OBJECT_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn($.INPUT_OBJECT_TYPE_DEFINITION,o,e))}})}function D3(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(A3(e,n)):At(n.description)?i(R3(e,t)):i(N3(e,t,n))),At(t)||(qd(t,n)||i(C3(e,t,n)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(P3(e,t,n))),(t?.astNode?.directives||n.astNode?.directives)&&tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(nn($.INPUT_VALUE_DEFINITION,r,{type:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(rn($.INPUT_VALUE_DEFINITION,r,{type:e,field:n}))}})}function dIe(e){return`Field '${e.removedFieldName}' ${e.isRemovedFieldDeprecated?"(deprecated) ":""}was removed from ${e.typeType} '${e.typeName}'`}function pIe(e){return{type:P.FieldRemoved,criticality:{level:W.Breaking,reason:e.meta.isRemovedFieldDeprecated?"Removing a deprecated field is a breaking change. Before removing it, you may want to look at the field's usage to see the impact of removing the field.":"Removing a field is a breaking change. It is preferable to deprecate the field before removing it. This applies to removed union fields as well, since removal breaks client operations that contain fragments that reference the removed type through direct (... on RemovedType) or indirect means such as __typename in the consumers."},message:dIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.removedFieldName].join(".")}}function M$(e,t){let n=Be(e)?"interface":"object type";return pIe({type:P.FieldRemoved,meta:{typeName:e.name,removedFieldName:t.name,isRemovedFieldDeprecated:t.deprecationReason!=null,typeType:n}})}function fIe(e){return`Field '${e.addedFieldName}' was added to ${e.typeType} '${e.typeName}'`}function mIe(e){return{type:P.FieldAdded,criticality:{level:W.NonBreaking},message:fIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.addedFieldName].join(".")}}function L$(e,t){let n=Be(e)?"interface":"object type";return mIe({type:P.FieldAdded,meta:{typeName:e.name,addedFieldName:t.name,typeType:n,addedFieldReturnType:t.type.toString()}})}function gIe(e){return!e.oldDescription&&e.newDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.newDescription)}' was added`:!e.newDescription&&e.oldDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.oldDescription)}' was removed`:`Field '${e.typeName}.${e.fieldName}' description changed from '${je(e.oldDescription)}' to '${je(e.newDescription)}'`}function hIe(e){return{type:P.FieldDescriptionChanged,criticality:{level:W.NonBreaking},message:gIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function M3(e,t,n){return hIe({type:P.FieldDescriptionChanged,meta:{fieldName:t.name,typeName:e.name,oldDescription:t.description??"",newDescription:n.description??""}})}function yIe(e){let t=je(e.addedDescription);return`Field '${e.typeName}.${e.fieldName}' has description '${t}'`}function bIe(e){return{type:P.FieldDescriptionAdded,criticality:{level:W.NonBreaking},message:yIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function L3(e,t){return bIe({type:P.FieldDescriptionAdded,meta:{typeName:e.name,fieldName:t.name,addedDescription:t.description??""}})}function vIe(e){return`Description was removed from field '${e.typeName}.${e.fieldName}'`}function wIe(e){return{type:P.FieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:vIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function F3(e,t){return wIe({type:P.FieldDescriptionRemoved,meta:{typeName:e.name,fieldName:t.name}})}function kIe(e){return`Field '${e.typeName}.${e.fieldName}' is deprecated`}function $Ie(e){return{type:P.FieldDeprecationAdded,criticality:{level:W.NonBreaking},message:kIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function U3(e,t){return $Ie({type:P.FieldDeprecationAdded,meta:{typeName:e.name,fieldName:t.name,deprecationReason:t.deprecationReason??""}})}function _Ie(e){return{type:P.FieldDeprecationRemoved,criticality:{level:W.NonBreaking},message:`Field '${e.meta.typeName}.${e.meta.fieldName}' is no longer deprecated`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function j3(e,t){return _Ie({type:P.FieldDeprecationRemoved,meta:{fieldName:t.name,typeName:e.name}})}function SIe(e){let t=je(e.oldDeprecationReason),n=je(e.newDeprecationReason);return`Deprecation reason on field '${e.typeName}.${e.fieldName}' has changed from '${t}' to '${n}'`}function xIe(e){return{type:P.FieldDeprecationReasonChanged,criticality:{level:W.NonBreaking},message:SIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function z3(e,t,n){return xIe({type:P.FieldDeprecationReasonChanged,meta:{fieldName:n.name,typeName:e.name,newDeprecationReason:n.deprecationReason??"",oldDeprecationReason:t.deprecationReason??""}})}function EIe(e){let t=je(e.addedDeprecationReason);return`Field '${e.typeName}.${e.fieldName}' has deprecation reason '${t}'`}function TIe(e){return{type:P.FieldDeprecationReasonAdded,criticality:{level:W.NonBreaking},message:EIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Jr.name}`].join(".")}}function G3(e,t){return TIe({type:P.FieldDeprecationReasonAdded,meta:{typeName:e.name,fieldName:t.name,addedDeprecationReason:t.deprecationReason??""}})}function IIe(e){return{type:P.FieldDeprecationReasonRemoved,criticality:{level:W.NonBreaking},message:`Deprecation reason was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function V3(e,t){return IIe({type:P.FieldDeprecationReasonRemoved,meta:{typeName:e.name,fieldName:t.name}})}function AIe(e){return`Field '${e.meta.typeName}.${e.meta.fieldName}' changed type from '${e.meta.oldFieldType}' to '${e.meta.newFieldType}'`}function RIe(e){return{type:P.FieldTypeChanged,criticality:{level:e.meta.isSafeFieldTypeChange?W.NonBreaking:W.Breaking},message:AIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function B3(e,t,n){return RIe({type:P.FieldTypeChanged,meta:{typeName:e.name,fieldName:t.name,oldFieldType:t.type.toString(),newFieldType:n.type.toString(),isSafeFieldTypeChange:ch(t.type,n.type)}})}function NIe(e){return`Argument '${e.addedArgumentName}: ${e.addedArgumentType}'${e.hasDefaultValue?" (with default value) ":" "}added to field '${e.typeName}.${e.fieldName}'`}function CIe(e){return{type:P.FieldArgumentAdded,criticality:{level:e.meta.addedToNewField?W.NonBreaking:e.meta.isAddedFieldArgumentBreaking?W.Breaking:W.Dangerous},message:NIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.addedArgumentName].join(".")}}function q3(e,t,n,i){let r=Bd(n),o=_e(n.type)&&!r;return CIe({type:P.FieldArgumentAdded,meta:{typeName:e.name,fieldName:t.name,addedArgumentName:n.name,addedArgumentType:n.type.toString(),hasDefaultValue:r,addedToNewField:i,isAddedFieldArgumentBreaking:o}})}function PIe(e){return`Argument '${e.meta.removedFieldArgumentName}: ${e.meta.removedFieldType}' was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`}function DIe(e){return{type:P.FieldArgumentRemoved,criticality:{level:W.Breaking},message:PIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.removedFieldArgumentName].join(".")}}function W3(e,t,n){return DIe({type:P.FieldArgumentRemoved,meta:{typeName:e.name,fieldName:t.name,removedFieldArgumentName:n.name,removedFieldType:n.type.toString()}})}function OIe(e){return`'${e.objectTypeName}' object implements '${e.addedInterfaceName}' interface`}function MIe(e){return{type:P.ObjectTypeInterfaceAdded,criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding an interface to an object type may break existing clients that are consuming a field returning the interface type that are not programming defensively against this new possible type."},message:OIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function F$(e,t,n){return MIe({type:P.ObjectTypeInterfaceAdded,meta:{objectTypeName:t.name,addedInterfaceName:e.name,addedToNewType:n}})}function LIe(e){return`'${e.objectTypeName}' object type no longer implements '${e.removedInterfaceName}' interface`}function FIe(e){return{type:P.ObjectTypeInterfaceRemoved,criticality:{level:W.Breaking,reason:"Removing an interface from an object type can cause existing queries that use this in a fragment spread to error."},message:LIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function U$(e,t){return FIe({type:P.ObjectTypeInterfaceRemoved,meta:{objectTypeName:t.name,removedInterfaceName:e.name}})}function UIe(e){return e.oldDescription===null&&e.newDescription!==null?`Description '${je(e.newDescription)}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:e.newDescription===null&&e.oldDescription!==null?`Description '${je(e.oldDescription)}' was removed from argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Description for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${je(e.oldDescription??"")}' to '${je(e.newDescription??"")}'`}function jIe(e){return{type:P.FieldArgumentDescriptionChanged,criticality:{level:W.NonBreaking},message:UIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function H3(e,t,n,i){return jIe({type:P.FieldArgumentDescriptionChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldDescription:n?.description??null,newDescription:i.description??null}})}function zIe(e){return e.oldDefaultValue===void 0?`Default value '${e.newDefaultValue}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Default value for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}var GIe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function VIe(e){return{type:P.FieldArgumentDefaultChanged,criticality:{level:W.Dangerous,reason:GIe},message:zIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function K3(e,t,n,i){let r={typeName:e.name,fieldName:t.name,argumentName:i.name},o=n===null?void 0:Zr(n),s=Zr(i);return o!==void 0&&(r.oldDefaultValue=Ki(o)),s!==void 0&&(r.newDefaultValue=Ki(s)),VIe({type:P.FieldArgumentDefaultChanged,meta:r})}function BIe(e){return`Type for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldArgumentType}' to '${e.newArgumentType}'`}var qIe="Changing an input field from non-null to null is considered non-breaking.",WIe="Changing the type of a field's argument can cause existing queries that use this argument to error.";function HIe(e){return{type:P.FieldArgumentTypeChanged,criticality:e.meta.isSafeArgumentTypeChange?{level:W.NonBreaking,reason:qIe}:{level:W.Breaking,reason:WIe},message:BIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function J3(e,t,n,i){return HIe({type:P.FieldArgumentTypeChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldArgumentType:n?.type.toString()??"",newArgumentType:i.type.toString(),isSafeArgumentTypeChange:!n||Ea(n.type,i.type)}})}function Z3(e,t,n,i,r){Wt(n?.description,i.description)&&r(H3(e,t,n,i)),qd(n,i)||r(K3(e,t,n,i)),Wt(n?.type.toString(),i.type.toString())&&r(J3(e,t,n,i)),(n?.astNode?.directives||i.astNode?.directives)&&tn(n?.astNode?.directives||[],i.astNode?.directives||[],{onAdded(o){r(nn($.ARGUMENT,o,{argument:i,field:t,type:e},n===null)),et(null,o,r,e,t,i)},onMutual(o){et(o.oldVersion,o.newVersion,r,e,t,i)},onRemoved(o){r(rn($.ARGUMENT,o,{argument:n,field:t,type:e}))}})}var Y3="No longer supported";function Hd(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(L3(e,n)):At(n.description)?i(F3(e,t)):i(M3(e,t,n))),At(t)||!cs(t)?cs(n)&&i(U3(e,n)):cs(n)?Wt(t.deprecationReason,n.deprecationReason)&&(At(t.deprecationReason)||t.deprecationReason===Y3?i(G3(e,n)):At(n.deprecationReason)||n.deprecationReason===Y3?i(V3(e,t)):i(z3(e,t,n))):cs(t)&&i(j3(e,t)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(B3(e,t,n)),en(t?.args??[],n.args,{onAdded(r){i(q3(e,n,r,t===null))},onRemoved(r){i(W3(e,n,r))},onMutual(r){Z3(e,n,r.oldVersion,r.newVersion,i)}}),tn(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(nn($.FIELD_DEFINITION,r,{parentType:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(rn($.FIELD_DEFINITION,r,{parentType:e,field:t}))}})}function Q3(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces();en(i,r,{onAdded(a){n(F$(a,t,e===null))},onRemoved(a){n(U$(a,e))}});let o=e?.getFields()??{},s=t.getFields();en(Object.values(o),Object.values(s),{onAdded(a){n(L$(t,a)),Hd(t,null,a,n)},onRemoved(a){n(M$(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn($.INTERFACE_TYPE_DEFINITION,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn($.INTERFACE_TYPE_DEFINITION,a,e))}})}function X3(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces(),o=e?.getFields()??{},s=t.getFields();en(i,r,{onAdded(a){n(F$(a,t,e===null))},onRemoved(a){n(U$(a,e))}}),en(Object.values(o),Object.values(s),{onAdded(a){n(L$(t,a)),Hd(t,null,a,n)},onRemoved(a){n(M$(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(nn($.OBJECT,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(rn($.OBJECT,a,e))}})}function e8(e,t,n){tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(nn($.SCALAR_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(rn($.SCALAR_TYPE_DEFINITION,i,e))}})}function KIe(e){return`Member '${e.removedUnionMemberTypeName}' was removed from Union type '${e.unionName}'`}function JIe(e){return{criticality:{level:W.Breaking,reason:"Removing a union member from a union can cause existing queries that use this union member in a fragment spread to error."},type:P.UnionMemberRemoved,message:KIe(e.meta),meta:e.meta,path:e.meta.unionName}}function t8(e,t){return JIe({type:P.UnionMemberRemoved,meta:{unionName:e.name,removedUnionMemberTypeName:t.name}})}function ZIe(e){return`Member '${e.addedUnionMemberTypeName}' was added to Union type '${e.unionName}'`}function YIe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding a possible type to Unions may break existing clients that were not programming defensively against a new possible type."},type:P.UnionMemberAdded,message:ZIe(e.meta),meta:e.meta,path:e.meta.unionName}}function n8(e,t,n){return YIe({type:P.UnionMemberAdded,meta:{unionName:e.name,addedUnionMemberTypeName:t.name,addedToNewType:n}})}function r8(e,t,n){let i=e?.getTypes()??[],r=t.getTypes();en(i,r,{onAdded(o){n(n8(t,o,e===null))},onRemoved(o){n(t8(e,o))}}),tn(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(nn($.UNION_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(rn($.UNION_TYPE_DEFINITION,o,e))}})}function o8(e,t){let n=[];function i(r){n.push(r)}en((e?.getDirectives()??[]).filter(r=>!Jc(r)),(t?.getDirectives()??[]).filter(r=>!Jc(r)),{onAdded(r){i(QZ(r)),YD(null,r,i)},onRemoved(r){i(YZ(r))},onMutual(r){YD(r.oldVersion,r.newVersion,i)}}),QIe(e,t,i),en(Object.values(e?.getTypeMap()??{}).filter(r=>!MD(r)&&!LD(r)),Object.values(t?.getTypeMap()??{}).filter(r=>!MD(r)&&!LD(r)),{onAdded(r){i(f3(r)),i8(null,r,i)},onRemoved(r){i(p3(r))},onMutual(r){i8(r.oldVersion,r.newVersion,i)}}),tn(e?.astNode?.directives||[],t?.astNode?.directives||[],{onAdded(r){i(nn($.SCHEMA_DEFINITION,r,t,!1)),et(null,r,i)},onMutual(r){et(r.oldVersion,r.newVersion,i)},onRemoved(r){i(rn($.SCHEMA_DEFINITION,r,e))}});for(let r=0;r{let a=await o;return s({changes:a,oldSchema:e,newSchema:t,config:i})},Promise.resolve(r))}var j$="graphql-inspector",XD={id:"graphql",source:"graphql-diff",tool:j$,weight:1,originClass:"computed-artifact",config:{enabled:"graphql",paths:"graphqlSchemas"},handles(e,t){return/\.(graphql|graphqls|gql|sdl)$/i.test(e)?/\b(type|interface|enum|union|input|scalar|schema|directive)\b/.test(t):!1},async compute(e){let t,n;try{t=ah(e.before,{assumeValidSDL:!0}),n=ah(e.after,{assumeValidSDL:!0})}catch(o){return ma(j$,"parse-failed",`${e.path} could not be parsed as GraphQL SDL on both sides of this change: ${o.message}`)}let i;try{i=await QD(t,n)}catch(o){return ma(j$,"toolchain-failed",`graphql-inspector could not compare ${e.path}: ${o.message}`)}let r=[];for(let o of i){let s=o.criticality?.level;if(s!=="BREAKING"&&s!=="DANGEROUS")continue;let a=o.path??o.type;r.push({code:s8(o.type,s),location:a,pointer:`${e.path}#${a}`,detail:o.message})}return{available:!0,changes:r,tool:j$,weight:1,locator:`${e.path} (GraphQL SDL)`}},codes:{"graphql-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL field \`${e}\` was removed. Every query, mutation, or fragment in this repository that selects it will now be rejected outright \u2014 the whole document fails validation, not just that selection. Find those documents and migrate each to the replacement field; if there is none, propagate the absence rather than substituting a placeholder.`},"graphql-input-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL input field \`${e}\` no longer exists. Stop sending it: an unknown field on an input object fails validation, so every variable payload and inline argument that still carries it will be rejected.`},"graphql-type-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"type",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL type \`${e}\` no longer exists. Every fragment on it, every \`... on ${e}\` inline fragment, and every variable declared with it must be migrated. If there is no replacement type, leave the operation intact with a clearly-marked TODO and explain it in the PR description.`},"graphql-type-kind-changed":{kind:"type-change",taxonomy:{nature:"type-contract",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`\`${e}\` changed kind: ${t} Selections written against the old kind are no longer valid \u2014 an object's field selection does not survive becoming a union or a scalar. Rewrite each selection set for the new kind rather than adjusting it in place.`},"graphql-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL field \`${e}\` changed: ${t} Update the sub-selection and any client-side parsing of the value. A field that became nullable can now return null where the code assumed a value \u2014 handle that explicitly rather than asserting it away.`},"graphql-input-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL input field \`${e}\` changed: ${t} Update every variable payload that sets it so the value sent matches the new type.`},"graphql-argument-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL argument \`${e}\` was removed. Stop passing it \u2014 an unknown argument fails validation, so the whole operation is rejected, not just that argument.`},"graphql-argument-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL argument \`${e}\` changed: ${t} Update the variable declarations and the values passed at every call site.`},"graphql-argument-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is now required and has no default. Supply it in every operation that reaches this field, using a value that preserves the previous behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`},"graphql-argument-default-changed":{kind:"default-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The default value of \`${e}\` changed: ${t} Operations that omit it will silently behave differently. Pass the old value explicitly wherever the previous behaviour was intended.`},"graphql-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL enum value \`${e}\` was removed. Find code that sends it and map it onto a still-supported value; code that only *reads* the enum should keep its fallback branch, since a stored value may still carry the old name.`},"graphql-enum-value-added":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is a new value this code has never seen returned. Add explicit handling; make sure exhaustive switches and mapping tables over that enum have a safe default rather than falling through silently.`},"graphql-union-member-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A union or interface membership changed: ${t} An \`... on ${e}\` fragment against a type that is no longer a member fails validation. Rewrite those fragments for the members the schema still declares.`},"graphql-directive-removed":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A GraphQL directive changed or was removed: ${t} Every operation that applies \`${e}\` \u2014 or applies it where it is no longer allowed \u2014 fails validation. Remove or relocate those usages.`},"graphql-root-type-changed":{kind:"moved-export",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The root operation type \`${e}\` changed: ${t} Every operation of that kind is now rooted somewhere else \u2014 check that the top-level selections in this repository's documents still exist on the new root.`},"graphql-schema-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`graphql-inspector reports a breaking schema change at \`${e}\`: ${t} Update the operations in this repository that touch it.`}}};function s8(e,t){switch(e){case"FIELD_REMOVED":return"graphql-field-removed";case"INPUT_FIELD_REMOVED":return"graphql-input-field-removed";case"TYPE_REMOVED":return"graphql-type-removed";case"TYPE_KIND_CHANGED":return"graphql-type-kind-changed";case"FIELD_TYPE_CHANGED":return"graphql-field-type-changed";case"INPUT_FIELD_TYPE_CHANGED":return"graphql-input-field-type-changed";case"FIELD_ARGUMENT_REMOVED":case"DIRECTIVE_ARGUMENT_REMOVED":return"graphql-argument-removed";case"FIELD_ARGUMENT_TYPE_CHANGED":case"DIRECTIVE_ARGUMENT_TYPE_CHANGED":return"graphql-argument-type-changed";case"FIELD_ARGUMENT_ADDED":case"INPUT_FIELD_ADDED":case"DIRECTIVE_ARGUMENT_ADDED":return t==="BREAKING"?"graphql-argument-now-required":"graphql-schema-changed";case"FIELD_ARGUMENT_DEFAULT_CHANGED":case"INPUT_FIELD_DEFAULT_VALUE_CHANGED":case"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED":return"graphql-argument-default-changed";case"ENUM_VALUE_REMOVED":return"graphql-enum-value-removed";case"ENUM_VALUE_ADDED":return"graphql-enum-value-added";case"UNION_MEMBER_REMOVED":case"UNION_MEMBER_ADDED":case"OBJECT_TYPE_INTERFACE_REMOVED":return"graphql-union-member-removed";case"DIRECTIVE_REMOVED":case"DIRECTIVE_LOCATION_REMOVED":case"DIRECTIVE_REPEATABLE_REMOVED":return"graphql-directive-removed";case"SCHEMA_QUERY_TYPE_CHANGED":case"SCHEMA_MUTATION_TYPE_CHANGED":case"SCHEMA_SUBSCRIPTION_TYPE_CHANGED":return"graphql-root-type-changed";default:return"graphql-schema-changed"}}var XIe=["openapi-diff","protobuf-diff","graphql-diff"];function a8(e){return XIe.includes(e)}var el=[LP,FP,XD];var u8=Object.fromEntries(el.map(e=>[e.source,e.weight])),d8=Object.fromEntries(el.map(e=>[e.source,e.originClass])),e0e=Object.fromEntries(el.flatMap(e=>Object.entries(e.codes)));function eO(e){return e0e[e]}function p8(e,t){return t.evidence[e.config.enabled]===!0}function f8(e,t){let n=t.evidence[e.config.paths];return Array.isArray(n)?n:[]}var t0e=12e4;async function m8(e,t,n){let i=await(0,z$.mkdtemp)((0,l8.join)((0,c8.tmpdir)(),"drift-spec-"));try{return await e.compute({path:t.path,before:t.before,after:t.after,siblings:n.siblings??[],workdir:i,exec:n.exec??Xe,logger:n.logger,...n.env?{env:n.env}:{},timeoutMs:n.timeoutMs??t0e})}catch(r){return n.logger.debug(`Spec diff crashed for ${t.path}: ${r.message}`),{available:!1,reason:"toolchain-failed",detail:`Drift could not compare ${t.path}: ${r.message}`,tool:e.tool}}finally{await(0,z$.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var g8=require("node:crypto"),Ra=require("node:fs/promises"),h8=require("node:path");function y8(e){let t=Lc();return t?(0,h8.join)(t,`artifact-${(0,g8.createHash)("sha256").update(e).digest("hex")}.json`):null}async function Na(e){let t=y8(e);if(!t)return null;try{let n=JSON.parse(await(0,Ra.readFile)(t,"utf8"));return n.format!==1||n.key!==e?null:(nt("artifact.cache.hit"),n.value)}catch{return nt("artifact.cache.miss"),null}}async function Ca(e,t){let n=y8(e);if(n)try{await(0,Ra.mkdir)(Lc(),{recursive:!0});let i=`${n}.${process.pid}.partial`;await(0,Ra.writeFile)(i,JSON.stringify({format:1,key:e,value:t}),"utf8"),await(0,Ra.rename)(i,n)}catch{}}var V$=require("node:zlib");function n0e(e){return e.length>2&&e[0]===31&&e[1]===139}function r0e(e){return e.length>4&&e[0]===80&&e[1]===75}var b8=200*1024*1024;function Fn(e,t={}){let n=t.maxDecompressedBytes??b8;return r0e(e)?tO(e,{maxDecompressedBytes:n}):c0e(n0e(e)?(0,V$.gunzipSync)(e,{maxOutputLength:n}):e)}var i0e=101010256,o0e=33639248;function tO(e,t={}){let n=t.maxDecompressedBytes??b8,i=a0e(e);if(i===-1)return[];let r=e.readUInt16LE(i+10),o=e.readUInt32LE(i+16),s=[];for(let a=0;ae.length||e.readUInt32LE(o)!==o0e);a++){let c=e.readUInt16LE(o+10),l=e.readUInt32LE(o+20),u=e.readUInt32LE(o+24),d=e.readUInt16LE(o+28),p=e.readUInt16LE(o+30),f=e.readUInt16LE(o+32),m=e.readUInt32LE(o+42),g=e.toString("utf8",o+46,o+46+d);o+=46+d+p+f,!g.endsWith("/")&&s.push({path:g,size:u,read:()=>s0e(e,m,c,l,n)})}return s}function s0e(e,t,n,i,r){let o=e.readUInt16LE(t+26),s=e.readUInt16LE(t+28),a=t+30+o+s,c=e.subarray(a,a+i);if(n===0){if(c.length>r)throw new Error(`Stored zip entry exceeds the ${r}-byte decompressed-size limit.`);return Buffer.from(c)}if(n===8)return(0,V$.inflateRawSync)(c,{maxOutputLength:r});throw new Error(`Unsupported zip compression method ${n}`)}function a0e(e){let t=Math.max(0,e.length-65535-22);for(let n=e.length-22;n>=t;n--)if(e.readUInt32LE(n)===i0e)return n;return-1}var fh=512;function c0e(e){let t=[],n=0,i=null;for(;n+fh<=e.length;){let r=e.subarray(n,n+fh);if(r[0]===0)break;let o=G$(r.subarray(0,100)),s=l0e(r.subarray(124,136)),a=String.fromCharCode(r[156]??0),c=G$(r.subarray(345,500)),l=n+fh,u=l+s;if(n=l+Math.ceil(s/fh)*fh,a==="L"){i=G$(e.subarray(l,u));continue}if(a==="x"||a==="X"){i=u0e(e.subarray(l,u))??i;continue}if(a!=="0"&&a!=="\0"&&a!=="7"){i=null;continue}let d=i??(c?`${c}/${o}`:o);if(i=null,!d)continue;let p=e.subarray(l,u);t.push({path:d,size:s,read:()=>Buffer.from(p)})}return t}function G$(e){let t=e.indexOf(0);return e.toString("utf8",0,t===-1?e.length:t).trim()}function l0e(e){let t=G$(e).replace(/[^0-7]/g,"");return t?Number.parseInt(t,8):0}function u0e(e){for(let t of e.toString("utf8").split(` -`)){let n=/^\d+\s+path=(.*)$/.exec(t);if(n)return n[1]}return null}function d0e(e){return/^[aeiou]/i.test(e.trim())?"an":"a"}function Eo(e){return`${d0e(e)} ${e}`}var j8="https://data.jsdelivr.com/v1/packages/npm",dO="https://cdn.jsdelivr.net/npm",p0e="https://registry.npmjs.org",f0e=50*1024*1024,v8=200*1024*1024,w8=20*1024*1024,B$=new Map;function tl(e,t,n={}){if(n.traversal)return m0e+=1,En("surface",e,()=>$8(e,t,n));let i=`${e}@${t}#${n.followDependencies===!1?"own":"deps"}`+(n.subpath?`#${n.subpath}`:""),r=B$.get(i);if(r)return nt("surface.cache.hit"),r;nt("surface.cache.miss");let o=En("surface",e,()=>$8(e,t,n));return B$.set(i,o),o.then(s=>{s||B$.delete(i)},()=>B$.delete(i)),o}var m0e=0;var g0e=6;function h0e(e,t,n,i){return`npm-surface:v${g0e}:${e}@${t}#${n?"deps":"own"}`+(i?`#${i}`:"")}async function y0e(e,t,n,i){let r=fO(z8(n?.exports,i)),o=[...r?gh(nl(r)):[],...gh(nl(i))],s=[...new Set(o)],a=await pO(e,t,s);if(a!==void 0)return a;for(let c of s)if(await Q$(e,t,c))return c;return null}function k8(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function z8(e,t){if(!e||typeof e!="object")return;let n=e;for(let i of[`./${t}`,t])if(i in n)return n[i]}async function $8(e,t,n){let i=n.followDependencies!==!1,r=h0e(e,t,i,n.subpath),o=await Na(r);if(o)return nt("surface.diskCache.hit"),{...o,incomplete:o.incomplete??!1,api:new Map(o.api)};nt("surface.diskCache.miss");let s=await oO(e,t),a=n.subpath?await y0e(e,t,s,n.subpath):await P0e(e,t,s),c=a?await En("surface-sources",e,()=>nO(e,t,a)):{sources:[],truncated:!1};if(!a||c.sources.length===0){let h=await $0e(e,t);if(!h)throw new Kd(e,t);if(s=h.manifest,a=n.subpath?await O0e(s,n.subpath,h.files):D0e(e,s,h.files),a&&(c=await En("surface-sources",e,()=>nO(e,t,a,h)),c.sources.length===0))throw new Kd(e,t)}if(!a){if(a=await M0e(e,t,n.subpath),!a)return null;c=await En("surface-sources",e,()=>nO(e,t,a))}let l=c.sources,u=c.truncated;if(nt("surface.declarationFiles",l.length),l.length===0)return null;let d=new Map,p=[];for(let h of l)B0e(h.content,h.path,d,p,e);K0e(d,p),q8(d);let f=d.size,m=!s||!i?{followed:[],attempted:!1,incomplete:!1}:await En("surface-deps",e,()=>I0e(s,l,d,`${e}@${t}`,n.traversal)),g=d.size>0?{api:d,entryPath:a,viaDependencies:m.followed,ownSymbols:f,subpaths:C0e(s?.exports),incomplete:m.incomplete||u}:null;return g&&!m.attempted&&!g.incomplete&&await Ca(r,{...g,api:[...g.api]}),g}var Y$=class extends Error{constructor(n,i){super(`${n}@${i} could not be fetched`);this.packageName=n;this.version=i;this.name="VersionUnavailableError"}packageName;version},Kd=class extends Error{constructor(n,i){super(`${n}@${i} artifact could not be inspected`);this.packageName=n;this.version=i;this.name="ArtifactUnavailableError"}packageName;version};function oO(e,t){return $e(`${dO}/${e}@${t}/package.json`)}async function G8(e,t,n){let[i,r]=await Promise.all([oO(e,t),oO(e,n)]);if(!i||!r)return[];let o=_8(e,i),s=_8(e,r),a=[],c=[...o.requireConditions].filter(u=>!s.requireConditions.has(u)&&!s.commonJsExports.has(u));for(let u of c){let d=aO(e,u),p=w0e(u)?"affectedSpecifierPatterns":"affectedSpecifiers";a.push({kind:"exports-require-condition-removed",symbol:e,detail:u==="."?"The root CommonJS export condition was removed":`The CommonJS export condition for ${u} was removed`,before:[...o.requireConditions].sort().join(` +`))}var un={SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD:"FIELD",ARGUMENT:"ARGUMENT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD:"INPUT_FIELD",DIRECTIVE:"DIRECTIVE"};function TZ(e,t){let n=t({getNamedType:c,setNamedType:l,getNamedTypes:u}),i=new Map;for(let x of e.types){let E=x.name,T=d(x);T&&i.set(E,T)}let r=[];for(let x of e.directives){if(Yc(x)){r.push(x);continue}let E=S(x.toConfig());E&&r.push(new xn(E))}let o={...e,query:e.query&&c(e.query.name),mutation:e.mutation&&c(e.mutation.name),subscription:e.subscription&&c(e.subscription.name),types:Array.from(i.values()),directives:r},s=n[un.SCHEMA];return s==null?o:s(o);function a(x){return He(x)?new qt(a(x.ofType)):$e(x)?new ve(a(x.ofType)):c(x.name)}function c(x){let E=kxe.get(x)??i.get(x);return E===void 0&&it(!1,`Unknown type: "${x}".`),E}function l(x){i.set(x.name,x)}function u(){return Array.from(i.values())}function d(x){if(hD(x)||lD(x))return x;if(ur(x))return p(x);if(ot(x))return f(x);if(Be(x))return h(x);if(Yt(x))return b(x);if(Qt(x))return y(x);if(Ke(x))return k(x);it(!1,"Unexpected type: "+ce(x))}function p(x){let E=x.toConfig(),T=n[un.SCALAR];return E=T==null?E:T(E),new lr(E)}function f(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[un.OBJECT];return T=A==null?T:A(T),new Zn(T)}function m(x,E){let T=Object.create(null);for(let[A,L]of Object.entries(x)){let F={...L,type:a(L.type),args:g(L.args,A,E)},H=n[un.FIELD];H&&(F=H(F,E)),T[A]=F}return T}function g(x,E,T){let A=Object.create(null);for(let[L,F]of Object.entries(x)){let H={...F,type:a(F.type)},te=n[un.ARGUMENT];te&&(H=te(H,E,T)),A[L]=H}return A}function h(x){let E=x.toConfig(),T={...E,interfaces:()=>E.interfaces.map(L=>c(L.name)),fields:()=>m(E.fields,x.name)},A=n[un.INTERFACE];return T=A==null?T:A(T),new ns(T)}function b(x){let E=x.toConfig(),T={...E,types:()=>E.types.map(L=>c(L.name))},A=n[un.UNION];return T=A==null?T:A(T),new rs(T)}function y(x){let E=x.toConfig(),T={...E,values:()=>{let L=Object.create(null);for(let[F,H]of Object.entries(E.values)){let te=w(H,F,x.name);L[F]=te}return L}},A=n[un.ENUM];return T=A==null?T:A(T),new gi(T)}function w(x,E,T){let A={...x},L=n[un.ENUM_VALUE];return L==null?A:L(A,E,T)}function k(x){let E=x.toConfig(),T={...E,fields:()=>{let L=Object.create(null);for(let[F,H]of Object.entries(E.fields)){let te=$(H,F,x.name);L[F]=te}return L}},A=n[un.INPUT_OBJECT];return T=A==null?T:A(T),new is(T)}function $(x,E,T){let A={...x,type:a(x.type)},L=n[un.INPUT_FIELD];return L==null?A:L(A,E,T)}function S(x){let E={...x,args:g(x.args,x.name,void 0)},T=n[un.DIRECTIVE];return T==null?E:T(E)}}var kxe=new Map([...va,..._a].map(e=>[e.name,e]));function IZ(e,t,n){let i=[],r=new Cr,o=new Cr,s=new Cr,a=new Cr,c=new Cr,l=new Cr,u=new Cr,d=[],p,f=[],m=!1;for(let g of t.definitions){switch(g.kind){case _.SCHEMA_DEFINITION:p=g;break;case _.SCHEMA_EXTENSION:f.push(g);break;case _.DIRECTIVE_DEFINITION:d.push(g);break;case _.DIRECTIVE_EXTENSION:u.add(g.name.value,g);break;case _.SCALAR_TYPE_DEFINITION:case _.OBJECT_TYPE_DEFINITION:case _.INTERFACE_TYPE_DEFINITION:case _.UNION_TYPE_DEFINITION:case _.ENUM_TYPE_DEFINITION:case _.INPUT_OBJECT_TYPE_DEFINITION:i.push(g);break;case _.SCALAR_TYPE_EXTENSION:r.add(g.name.value,g);break;case _.OBJECT_TYPE_EXTENSION:o.add(g.name.value,g);break;case _.INTERFACE_TYPE_EXTENSION:s.add(g.name.value,g);break;case _.UNION_TYPE_EXTENSION:a.add(g.name.value,g);break;case _.ENUM_TYPE_EXTENSION:c.add(g.name.value,g);break;case _.INPUT_OBJECT_TYPE_EXTENSION:l.add(g.name.value,g);break;default:continue}m=!0}return m?TZ(e,g=>{let{getNamedType:h,setNamedType:b,getNamedTypes:y}=g;return{[un.SCHEMA]:D=>{for(let re of i){let ie=_xe.get(re.name.value)??te(re);b(ie)}let X={query:D.query&&h(D.query.name),mutation:D.mutation&&h(D.mutation.name),subscription:D.subscription&&h(D.subscription.name),...p&&w([p]),...w(f)};return{description:p?.description?.value??D.description,...X,types:y(),directives:[...D.directives.map(x),...d.map(S)],extensions:D.extensions,astNode:p??D.astNode,extensionASTNodes:D.extensionASTNodes.concat(f),assumeValid:n?.assumeValid??!1}},[un.INPUT_OBJECT]:D=>{let X=l.get(D.name)??[];return{...D,fields:()=>({...D.fields(),...A(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[un.ENUM]:D=>{let X=c.get(D.name)??[];return{...D,values:()=>({...D.values(),...L(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[un.SCALAR]:D=>{let X=r.get(D.name)??[],re=D.specifiedByURL;for(let ie of X)re=zD(ie)??re;return{...D,specifiedByURL:re,extensionASTNodes:D.extensionASTNodes.concat(X)}},[un.OBJECT]:D=>{let X=o.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[un.INTERFACE]:D=>{let X=s.get(D.name)??[];return{...D,interfaces:()=>[...D.interfaces(),...F(X)],fields:()=>({...D.fields(),...E(X)}),extensionASTNodes:D.extensionASTNodes.concat(X)}},[un.UNION]:D=>{let X=a.get(D.name)??[];return{...D,types:()=>[...D.types(),...H(X)],extensionASTNodes:D.extensionASTNodes.concat(X)}}};function w(D){let X={};for(let re of D){let ie=re.operationTypes??[];for(let ke of ie)X[ke.operation]=k(ke.type)}return X}function k(D){let X=D.name.value,re=h(X);return re===void 0&&it(!1,`Unknown type: "${X}".`),re}function $(D){return D.kind===_.LIST_TYPE?new qt($(D.type)):D.kind===_.NON_NULL_TYPE?new ve($(D.type)):k(D)}function S(D){let X=u.get(D.name.value)??[],re=tl(D)??X.map(ie=>tl(ie)).find(ie=>ie!=null);return new xn({name:D.name.value,description:D.description?.value,locations:D.locations.map(({value:ie})=>ie),isRepeatable:D.repeatable,args:T(D.arguments),deprecationReason:re,astNode:D,extensionASTNodes:X})}function x(D){let X=u.get(D.name)??[];if(X.length===0)return D;let re=D.deprecationReason??X.map(ie=>tl(ie)).find(ie=>ie!=null);return new xn({...D.toConfig(),deprecationReason:re,extensionASTNodes:D.extensionASTNodes.concat(X)})}function E(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie)X[ke.name.value]={type:$(ke.type),description:ke.description?.value,args:T(ke.arguments),deprecationReason:tl(ke),astNode:ke}}return X}function T(D){let X=D??[],re=Object.create(null);for(let ie of X){let ke=$(ie.type);re[ie.name.value]={type:ke,description:ie.description?.value,default:ie.defaultValue&&{literal:ie.defaultValue},deprecationReason:tl(ie),astNode:ie}}return re}function A(D){let X=Object.create(null);for(let re of D){let ie=re.fields??[];for(let ke of ie){let We=$(ke.type);X[ke.name.value]={type:We,description:ke.description?.value,default:ke.defaultValue&&{literal:ke.defaultValue},deprecationReason:tl(ke),astNode:ke}}}return X}function L(D){let X=Object.create(null);for(let re of D){let ie=re.values??[];for(let ke of ie)X[ke.name.value]={description:ke.description?.value,deprecationReason:tl(ke),astNode:ke}}return X}function F(D){return D.flatMap(X=>X.interfaces?.map(k)??[])}function H(D){return D.flatMap(X=>X.types?.map(k)??[])}function te(D){let X=D.name.value;switch(D.kind){case _.OBJECT_TYPE_DEFINITION:{let re=o.get(X)??[],ie=[D,...re];return new Zn({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case _.INTERFACE_TYPE_DEFINITION:{let re=s.get(X)??[],ie=[D,...re];return new ns({name:X,description:D.description?.value,interfaces:()=>F(ie),fields:()=>E(ie),astNode:D,extensionASTNodes:re})}case _.ENUM_TYPE_DEFINITION:{let re=c.get(X)??[],ie=[D,...re];return new gi({name:X,description:D.description?.value,values:()=>L(ie),astNode:D,extensionASTNodes:re})}case _.UNION_TYPE_DEFINITION:{let re=a.get(X)??[],ie=[D,...re];return new rs({name:X,description:D.description?.value,types:()=>H(ie),astNode:D,extensionASTNodes:re})}case _.SCALAR_TYPE_DEFINITION:{let re=r.get(X)??[],ie=zD(D);for(let ke of re)ie=zD(ke)??ie;return new lr({name:X,description:D.description?.value,specifiedByURL:ie,astNode:D,extensionASTNodes:re})}case _.INPUT_OBJECT_TYPE_DEFINITION:{let re=l.get(X)??[],ie=[D,...re];return new is({name:X,description:D.description?.value,fields:()=>A(ie),astNode:D,extensionASTNodes:re,isOneOf:$xe(D)})}}}}):e}var _xe=new Map([...va,..._a].map(e=>[e.name,e]));function tl(e){return Vd(Hr,e)?.reason}function zD(e){return Vd(oh,e)?.url}function $xe(e){return!!Vd(sh,e)}function GD(e,t){t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&EZ(e);let i=IZ({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(i.astNode==null)for(let o of i.types)switch(o.name){case"Query":i.query=o;break;case"Mutation":i.mutation=o;break;case"Subscription":i.subscription=o;break}let r=[...i.directives,...dr.filter(o=>i.directives.every(s=>s.name!==o.name))];return new lh({...i,directives:r})}function mh(e,t){let n=vD(e,{noLocation:t?.noLocation,experimentalFragmentArguments:t?.experimentalFragmentArguments});return GD(n,{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}function xa(e,t,n){if(e){if(e.kind===_.VARIABLE){let i=e.name.value;if(n==null||!Object.hasOwn(n,i))return;let r=n[i];return r===void 0||r===null&&$e(t)?void 0:r}if($e(t))return e.kind===_.NULL?void 0:xa(e,t.ofType,n);if(e.kind===_.NULL)return null;if(He(t)){let i=t.ofType;if(e.kind===_.LIST){let o=[];for(let s of e.values)if(AZ(s,n)){if($e(i))return;o.push(null)}else{let a=xa(s,i,n);if(a===void 0)return;o.push(a)}return o}let r=xa(e,i,n);return r===void 0?void 0:[r]}if(Ke(t)){if(e.kind!==_.OBJECT)return;let i=Object.create(null),r=t.getFields();if(e.fields.some(a=>!Object.hasOwn(r,a.name.value)))return;let s=new Map(e.fields.map(a=>[a.name.value,a]));for(let a of Object.values(r)){let c=s.get(a.name);if(c==null||AZ(c.value,n)){if(a.defaultValue!==void 0)i[a.name]=a.defaultValue;else if($e(a.type))return;continue}let l=xa(c.value,a.type,n);if(l===void 0)return;i[a.name]=l}if(t.isOneOf){let a=Object.keys(i);if(s.size!==1||a.length!==1)return;for(let[c,l]of s)if(l.value.kind===_.NULL||i[c]===null)return}return i}if(hi(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}it(!1,"Unexpected input type: "+ce(t))}}function AZ(e,t){return e.kind===_.VARIABLE&&(t?.[e.name.value]===void 0||!Object.hasOwn(t,e.name.value))}function cs(e){return"isDeprecated"in e?!!e.isDeprecated:!!(e.deprecationReason!=null||e.astNode?.directives?.some(t=>t.name.value==="deprecated"))}function Jr(e){return e.default!==void 0?e.default.literal!==void 0?xa(e.default.literal,e.type):So(e.default.value,e.type):e.defaultValue}function qd(e){return e.default!==void 0||e.defaultValue!==void 0}function Wd(e,t){return VD(e==null?void 0:Jr(e),Jr(t))}function VD(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,i)=>VD(n,t[i]));if(e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"){let n=e,i=t,r=Object.keys(n),o=Object.keys(i);return r.length===o.length&&r.every(s=>Object.prototype.hasOwnProperty.call(i,s)&&VD(n[s],i[s]))}return!1}function gh(e,t){if(!Bi(e)&&!Bi(t))return e.toString()===t.toString();if($e(t)){let n=$e(e)?e.ofType:e;return gh(n,t.ofType)}return He(e)?He(t)&&gh(e.ofType,t.ofType)||$e(t)&&gh(e,t.ofType):!1}function Ea(e,t){if(!Bi(e)&&!Bi(t))return e?.toString()===t.toString();if(He(e)&&He(t))return Ea(e.ofType,t.ofType);if($e(e)){let n=$e(t)?t.ofType:t;return Ea(e.ofType,n)}return!1}function hh(e){return e.astNode?.kind||""}function BD(e){return["String","Int","Float","Boolean","ID"].includes(typeof e=="string"?e:e.name)}function qD(e){return["__Schema","__Type","__TypeKind","__Field","__InputValue","__EnumValue","__Directive","__DirectiveLocation"].includes(typeof e=="string"?e:e.name)}var W;(function(e){e.Breaking="BREAKING",e.NonBreaking="NON_BREAKING",e.Dangerous="DANGEROUS"})(W||(W={}));var P={FieldArgumentDescriptionChanged:"FIELD_ARGUMENT_DESCRIPTION_CHANGED",FieldArgumentDefaultChanged:"FIELD_ARGUMENT_DEFAULT_CHANGED",FieldArgumentTypeChanged:"FIELD_ARGUMENT_TYPE_CHANGED",DirectiveRemoved:"DIRECTIVE_REMOVED",DirectiveAdded:"DIRECTIVE_ADDED",DirectiveDescriptionChanged:"DIRECTIVE_DESCRIPTION_CHANGED",DirectiveLocationAdded:"DIRECTIVE_LOCATION_ADDED",DirectiveLocationRemoved:"DIRECTIVE_LOCATION_REMOVED",DirectiveArgumentAdded:"DIRECTIVE_ARGUMENT_ADDED",DirectiveArgumentRemoved:"DIRECTIVE_ARGUMENT_REMOVED",DirectiveArgumentDescriptionChanged:"DIRECTIVE_ARGUMENT_DESCRIPTION_CHANGED",DirectiveArgumentDefaultValueChanged:"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED",DirectiveArgumentTypeChanged:"DIRECTIVE_ARGUMENT_TYPE_CHANGED",DirectiveRepeatableAdded:"DIRECTIVE_REPEATABLE_ADDED",DirectiveRepeatableRemoved:"DIRECTIVE_REPEATABLE_REMOVED",EnumValueRemoved:"ENUM_VALUE_REMOVED",EnumValueAdded:"ENUM_VALUE_ADDED",EnumValueDescriptionChanged:"ENUM_VALUE_DESCRIPTION_CHANGED",EnumValueDeprecationReasonChanged:"ENUM_VALUE_DEPRECATION_REASON_CHANGED",EnumValueDeprecationReasonAdded:"ENUM_VALUE_DEPRECATION_REASON_ADDED",EnumValueDeprecationReasonRemoved:"ENUM_VALUE_DEPRECATION_REASON_REMOVED",FieldRemoved:"FIELD_REMOVED",FieldAdded:"FIELD_ADDED",FieldDescriptionChanged:"FIELD_DESCRIPTION_CHANGED",FieldDescriptionAdded:"FIELD_DESCRIPTION_ADDED",FieldDescriptionRemoved:"FIELD_DESCRIPTION_REMOVED",FieldDeprecationAdded:"FIELD_DEPRECATION_ADDED",FieldDeprecationRemoved:"FIELD_DEPRECATION_REMOVED",FieldDeprecationReasonChanged:"FIELD_DEPRECATION_REASON_CHANGED",FieldDeprecationReasonAdded:"FIELD_DEPRECATION_REASON_ADDED",FieldDeprecationReasonRemoved:"FIELD_DEPRECATION_REASON_REMOVED",FieldTypeChanged:"FIELD_TYPE_CHANGED",FieldArgumentAdded:"FIELD_ARGUMENT_ADDED",FieldArgumentRemoved:"FIELD_ARGUMENT_REMOVED",InputFieldRemoved:"INPUT_FIELD_REMOVED",InputFieldAdded:"INPUT_FIELD_ADDED",InputFieldDescriptionAdded:"INPUT_FIELD_DESCRIPTION_ADDED",InputFieldDescriptionRemoved:"INPUT_FIELD_DESCRIPTION_REMOVED",InputFieldDescriptionChanged:"INPUT_FIELD_DESCRIPTION_CHANGED",InputFieldDefaultValueChanged:"INPUT_FIELD_DEFAULT_VALUE_CHANGED",InputFieldTypeChanged:"INPUT_FIELD_TYPE_CHANGED",ObjectTypeInterfaceAdded:"OBJECT_TYPE_INTERFACE_ADDED",ObjectTypeInterfaceRemoved:"OBJECT_TYPE_INTERFACE_REMOVED",SchemaQueryTypeChanged:"SCHEMA_QUERY_TYPE_CHANGED",SchemaMutationTypeChanged:"SCHEMA_MUTATION_TYPE_CHANGED",SchemaSubscriptionTypeChanged:"SCHEMA_SUBSCRIPTION_TYPE_CHANGED",TypeRemoved:"TYPE_REMOVED",TypeAdded:"TYPE_ADDED",TypeKindChanged:"TYPE_KIND_CHANGED",TypeDescriptionChanged:"TYPE_DESCRIPTION_CHANGED",TypeDescriptionRemoved:"TYPE_DESCRIPTION_REMOVED",TypeDescriptionAdded:"TYPE_DESCRIPTION_ADDED",UnionMemberRemoved:"UNION_MEMBER_REMOVED",UnionMemberAdded:"UNION_MEMBER_ADDED",DirectiveUsageUnionMemberAdded:"DIRECTIVE_USAGE_UNION_MEMBER_ADDED",DirectiveUsageUnionMemberRemoved:"DIRECTIVE_USAGE_UNION_MEMBER_REMOVED",DirectiveUsageEnumAdded:"DIRECTIVE_USAGE_ENUM_ADDED",DirectiveUsageEnumRemoved:"DIRECTIVE_USAGE_ENUM_REMOVED",DirectiveUsageEnumValueAdded:"DIRECTIVE_USAGE_ENUM_VALUE_ADDED",DirectiveUsageEnumValueRemoved:"DIRECTIVE_USAGE_ENUM_VALUE_REMOVED",DirectiveUsageInputObjectAdded:"DIRECTIVE_USAGE_INPUT_OBJECT_ADDED",DirectiveUsageInputObjectRemoved:"DIRECTIVE_USAGE_INPUT_OBJECT_REMOVED",DirectiveUsageFieldAdded:"DIRECTIVE_USAGE_FIELD_ADDED",DirectiveUsageFieldRemoved:"DIRECTIVE_USAGE_FIELD_REMOVED",DirectiveUsageScalarAdded:"DIRECTIVE_USAGE_SCALAR_ADDED",DirectiveUsageScalarRemoved:"DIRECTIVE_USAGE_SCALAR_REMOVED",DirectiveUsageObjectAdded:"DIRECTIVE_USAGE_OBJECT_ADDED",DirectiveUsageObjectRemoved:"DIRECTIVE_USAGE_OBJECT_REMOVED",DirectiveUsageInterfaceAdded:"DIRECTIVE_USAGE_INTERFACE_ADDED",DirectiveUsageInterfaceRemoved:"DIRECTIVE_USAGE_INTERFACE_REMOVED",DirectiveUsageArgumentDefinitionAdded:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_ADDED",DirectiveUsageArgumentDefinitionRemoved:"DIRECTIVE_USAGE_ARGUMENT_DEFINITION_REMOVED",DirectiveUsageSchemaAdded:"DIRECTIVE_USAGE_SCHEMA_ADDED",DirectiveUsageSchemaRemoved:"DIRECTIVE_USAGE_SCHEMA_REMOVED",DirectiveUsageFieldDefinitionAdded:"DIRECTIVE_USAGE_FIELD_DEFINITION_ADDED",DirectiveUsageFieldDefinitionRemoved:"DIRECTIVE_USAGE_FIELD_DEFINITION_REMOVED",DirectiveUsageInputFieldDefinitionAdded:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_ADDED",DirectiveUsageInputFieldDefinitionRemoved:"DIRECTIVE_USAGE_INPUT_FIELD_DEFINITION_REMOVED",DirectiveUsageArgumentAdded:"DIRECTIVE_USAGE_ARGUMENT_ADDED",DirectiveUsageArgumentRemoved:"DIRECTIVE_USAGE_ARGUMENT_REMOVED"};function RZ(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),Object.create(null))}function U_(e,t){if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n"u"||e===null}function WD(e,t){return e.filter(n=>!t.some(i=>U_(i,n)))}function bi(e){return typeof e=="string"?e:e.value}function Xt(e,t,n){let i=RZ(e,({name:c})=>bi(c)),r=RZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;l===null?s.push(c):a.push({newVersion:l,oldVersion:c??null})}for(let c of t)i[bi(c.name)]===void 0&&o.push(c);if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function en(e,t,n){let i=CZ(e,({name:c})=>bi(c)),r=CZ(t,({name:c})=>bi(c)),o=[],s=[],a=[];for(let c of e){let l=r[bi(c.name)]??null;if(l===null)s.push(c);else{let[u,...d]=l;d.length>0?r[bi(c.name)]=d:delete r[bi(c.name)],a.push({newVersion:u,oldVersion:c??null})}}for(let c of t){let l=i[bi(c.name)]??null;if(l===null)o.push(c);else{let[u,...d]=l;d.length>0?i[bi(c.name)]=d:delete i[bi(c.name)]}}if(n){if(n.onRemoved)for(let c of s)n.onRemoved(c);if(n.onAdded)for(let c of o)n.onAdded(c);if(n.onMutual)for(let c of a)n.onMutual(c)}return{added:o,removed:s,mutual:a}}function CZ(e,t){return e.reduce((n,i)=>{let r=t(i);return n[r]=[...n[r]??[],i],n},Object.create(null))}function vi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.Breaking:t}function wi(e,t){return e==="deprecated"?W.NonBreaking:e==="oneOf"?W.NonBreaking:t}function Exe(e){return`Directive '${e.addedDirectiveName}' was added to argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function Txe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionAdded,message:Exe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Ixe(e){return`Directive '${e.removedDirectiveName}' was removed from argument '${e.argumentName}' of field '${e.fieldName}' in type '${e.typeName}'`}function Axe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from argument '${e.meta.argumentName}'`},type:P.DirectiveUsageArgumentDefinitionRemoved,message:Ixe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Rxe(e){return`Directive '${e.addedDirectiveName}' was added to input object '${e.inputObjectName}'`}function Cxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectAdded,message:Rxe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Nxe(e){return`Directive '${e.removedDirectiveName}' was removed from input object '${e.inputObjectName}'`}function Pxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input object '${e.meta.inputObjectName}'`},type:P.DirectiveUsageInputObjectRemoved,message:Nxe(e.meta),path:[e.meta.inputObjectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Dxe(e){return`Directive '${e.addedDirectiveName}' was added to interface '${e.interfaceName}'`}function Oxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceAdded,message:Dxe(e.meta),path:[e.meta.interfaceName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Mxe(e){return`Directive '${e.removedDirectiveName}' was removed from interface '${e.interfaceName}'`}function Lxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from interface '${e.meta.interfaceName}'`},type:P.DirectiveUsageInterfaceRemoved,message:Mxe(e.meta),path:[e.meta.interfaceName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Fxe(e){return`Directive '${e.addedDirectiveName}' was added to input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function Uxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionAdded,message:Fxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function jxe(e){return`Directive '${e.removedDirectiveName}' was removed from input field '${e.inputFieldName}' in input object '${e.inputObjectName}'`}function zxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from input field '${e.meta.inputFieldName}'`},type:P.DirectiveUsageInputFieldDefinitionRemoved,message:jxe(e.meta),path:[e.meta.inputObjectName,e.meta.inputFieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Gxe(e){return`Directive '${e.addedDirectiveName}' was added to object '${e.objectName}'`}function Vxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectAdded,message:Gxe(e.meta),path:[e.meta.objectName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Bxe(e){return`Directive '${e.removedDirectiveName}' was removed from object '${e.objectName}'`}function qxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from object '${e.meta.objectName}'`},type:P.DirectiveUsageObjectRemoved,message:Bxe(e.meta),path:[e.meta.objectName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Wxe(e){return`Directive '${e.addedDirectiveName}' was added to enum '${e.enumName}'`}function Kxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumAdded,message:Wxe(e.meta),path:[e.meta.enumName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function Hxe(e){return`Directive '${e.removedDirectiveName}' was removed from enum '${e.enumName}'`}function Jxe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum '${e.meta.enumName}'`},type:P.DirectiveUsageEnumRemoved,message:Hxe(e.meta),path:[e.meta.enumName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function Zxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Yxe(e){return{criticality:{level:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldAdded,message:Zxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.addedDirectiveName].join("."),meta:e.meta}}function Qxe(e){return`Directive '${e.addedDirectiveName}' was added to field '${e.typeName}.${e.fieldName}'`}function Xxe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionAdded,message:Qxe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function eEe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function tEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldRemoved,message:eEe(e.meta),path:[e.meta.typeName,e.meta.fieldName,e.meta.removedDirectiveName].join("."),meta:e.meta}}function nEe(e){return`Directive '${e.removedDirectiveName}' was removed from field '${e.typeName}.${e.fieldName}'`}function rEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from field '${e.meta.fieldName}'`},type:P.DirectiveUsageFieldDefinitionRemoved,message:nEe(e.meta),path:[e.meta.typeName,e.meta.fieldName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function iEe(e){return`Directive '${e.addedDirectiveName}' was added to enum value '${e.enumName}.${e.enumValueName}'`}function oEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueAdded,message:iEe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function sEe(e){return`Directive '${e.removedDirectiveName}' was removed from enum value '${e.enumName}.${e.enumValueName}'`}function aEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from enum value '${e.meta.enumName}.${e.meta.enumValueName}'`},type:P.DirectiveUsageEnumValueRemoved,message:sEe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function cEe(e){return`Directive '${e.addedDirectiveName}' was added to schema`}function lEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to schema`},type:P.DirectiveUsageSchemaAdded,message:cEe(e.meta),path:`.@${e.meta.addedDirectiveName}`,meta:e.meta}}function uEe(e){return`Directive '${e.removedDirectiveName}' was removed from schema`}function dEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from schema`},type:P.DirectiveUsageSchemaRemoved,message:uEe(e.meta),path:`.@${e.meta.removedDirectiveName}`,meta:e.meta}}function pEe(e){return`Directive '${e.addedDirectiveName}' was added to scalar '${e.scalarName}'`}function fEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarAdded,message:pEe(e.meta),path:[e.meta.scalarName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function mEe(e){return`Directive '${e.removedDirectiveName}' was removed from scalar '${e.scalarName}'`}function gEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from scalar '${e.meta.scalarName}'`},type:P.DirectiveUsageScalarRemoved,message:mEe(e.meta),path:[e.meta.scalarName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function hEe(e){return`Directive '${e.addedDirectiveName}' was added to union member '${e.unionName}'`}function yEe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:vi(e.meta.addedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.addedDirectiveName}' was added to union member '${e.meta.unionName}.${e.meta.addedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberAdded,message:hEe(e.meta),path:[e.meta.unionName,`@${e.meta.addedDirectiveName}`].join("."),meta:e.meta}}function bEe(e){return`Directive '${e.removedDirectiveName}' was removed from union member '${e.unionName}'`}function vEe(e){return{criticality:{level:wi(e.meta.removedDirectiveName,W.Dangerous),reason:`Directive '${e.meta.removedDirectiveName}' was removed from union member '${e.meta.unionName}.${e.meta.removedUnionMemberTypeName}'`},type:P.DirectiveUsageUnionMemberRemoved,message:bEe(e.meta),path:[e.meta.unionName,`@${e.meta.removedDirectiveName}`].join("."),meta:e.meta}}function tn(e,t,n,i){return Ct(e,_.ARGUMENT,n)?Txe({type:P.DirectiveUsageArgumentDefinitionAdded,meta:{addedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Ct(e,_.INPUT_VALUE_DEFINITION,n)?Uxe({type:P.DirectiveUsageInputFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,inputFieldName:n.field.name,inputFieldType:n.field.type.toString(),inputObjectName:n.type.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Ct(e,_.INPUT_OBJECT_TYPE_DEFINITION,n)?Cxe({type:P.DirectiveUsageInputObjectAdded,meta:{addedDirectiveName:t.name.value,addedInputFieldName:t.name.value,addedInputFieldType:n.name,inputObjectName:n.name,isAddedInputFieldTypeNullable:e===_.INPUT_VALUE_DEFINITION,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.INTERFACE_TYPE_DEFINITION,n)?Oxe({type:P.DirectiveUsageInterfaceAdded,meta:{addedDirectiveName:t.name.value,interfaceName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.OBJECT,n)?Vxe({type:P.DirectiveUsageObjectAdded,meta:{objectName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.ENUM_TYPE_DEFINITION,n)?Kxe({type:P.DirectiveUsageEnumAdded,meta:{enumName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.FIELD,n)?Yxe({type:P.DirectiveUsageFieldAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Ct(e,_.FIELD_DEFINITION,n)?Xxe({type:P.DirectiveUsageFieldDefinitionAdded,meta:{addedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,addedToNewType:i,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Ct(e,_.UNION_TYPE_DEFINITION,n)?yEe({type:P.DirectiveUsageUnionMemberAdded,meta:{addedDirectiveName:t.name.value,addedUnionMemberTypeName:n.name,unionName:n.name,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.ENUM_VALUE_DEFINITION,n)?oEe({type:P.DirectiveUsageEnumValueAdded,meta:{enumName:n.type.name,enumValueName:n.value.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Ct(e,_.SCHEMA_DEFINITION,n)?lEe({type:P.DirectiveUsageSchemaAdded,meta:{addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Ct(e,_.SCALAR_TYPE_DEFINITION,n)?fEe({type:P.DirectiveUsageScalarAdded,meta:{scalarName:n.name,addedDirectiveName:t.name.value,addedToNewType:i,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function yt(e,t){let n=t.name.value,i=0;for(let r of e)if(r.name.value===n&&(i+=1),r===t)return i;return 0}function nn(e,t,n){return Ct(e,_.ARGUMENT,n)?Axe({type:P.DirectiveUsageArgumentDefinitionRemoved,meta:{removedDirectiveName:t.name.value,argumentName:n.argument.name,fieldName:n.field.name,typeName:n.type.name,directiveRepeatedTimes:yt(n.argument.astNode?.directives??[],t)}}):Ct(e,_.INPUT_VALUE_DEFINITION,n)?zxe({type:P.DirectiveUsageInputFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,inputFieldName:n.field.name,inputObjectName:n.type.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Ct(e,_.INPUT_OBJECT_TYPE_DEFINITION,n)?Pxe({type:P.DirectiveUsageInputObjectRemoved,meta:{removedDirectiveName:t.name.value,removedInputFieldName:t.name.value,removedInputFieldType:n.name,inputObjectName:n.name,isRemovedInputFieldTypeNullable:e===_.INPUT_VALUE_DEFINITION,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.INTERFACE_TYPE_DEFINITION,n)?Lxe({type:P.DirectiveUsageInterfaceRemoved,meta:{removedDirectiveName:t.name.value,interfaceName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.OBJECT,n)?qxe({type:P.DirectiveUsageObjectRemoved,meta:{objectName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.ENUM_TYPE_DEFINITION,n)?Jxe({type:P.DirectiveUsageEnumRemoved,meta:{enumName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.FIELD,n)?tEe({type:P.DirectiveUsageFieldRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Ct(e,_.FIELD_DEFINITION,n)?rEe({type:P.DirectiveUsageFieldDefinitionRemoved,meta:{removedDirectiveName:t.name.value,fieldName:n.field.name,typeName:n.parentType.name,directiveRepeatedTimes:yt(n.field.astNode?.directives??[],t)}}):Ct(e,_.UNION_TYPE_DEFINITION,n)?vEe({type:P.DirectiveUsageUnionMemberRemoved,meta:{removedDirectiveName:t.name.value,removedUnionMemberTypeName:n.name,unionName:n.name,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):Ct(e,_.ENUM_VALUE_DEFINITION,n)?aEe({type:P.DirectiveUsageEnumValueRemoved,meta:{enumName:n.type.name,enumValueName:n.value.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.value.astNode?.directives??[],t)}}):Ct(e,_.SCHEMA_DEFINITION,n)?dEe({type:P.DirectiveUsageSchemaRemoved,meta:{removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n?.astNode?.directives??[],t)}}):Ct(e,_.SCALAR_TYPE_DEFINITION,n)?gEe({type:P.DirectiveUsageScalarRemoved,meta:{scalarName:n.name,removedDirectiveName:t.name.value,directiveRepeatedTimes:yt(n.astNode?.directives??[],t)}}):{}}function Ct(e,t,n){return e===t}function NZ(e){return{type:P.DirectiveUsageArgumentAdded,criticality:{level:W.NonBreaking},message:`Argument '${e.meta.addedArgumentName}' was added to '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.addedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function PZ(e){return{type:P.DirectiveUsageArgumentRemoved,criticality:{level:W.Dangerous,reason:"Changing an argument on a directive can change runtime behavior."},message:`Argument '${e.meta.removedArgumentName}' was removed from '@${e.meta.directiveName}'`,path:[e.meta.parentTypeName??"",e.meta.parentFieldName??e.meta.parentEnumValueName,e.meta.parentArgumentName,`@${e.meta.directiveName}`,e.meta.removedArgumentName].filter(t=>t!==null).join("."),meta:e.meta}}function et(e,t,n,i,r,o,s){Xt(e?.arguments||[],t.arguments||[],{onAdded(a){n(NZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.name.value,addedArgumentValue:Ye(a.value),oldArgumentValue:null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))},onMutual(a){a.oldVersion&&Ye(a.oldVersion.value)===Ye(a.newVersion.value)||(a.oldVersion&&n(PZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.oldVersion.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})),n(NZ({type:P.DirectiveUsageArgumentAdded,meta:{addedArgumentName:a.newVersion.name.value,addedArgumentValue:Ye(a.newVersion.value),oldArgumentValue:(a.oldVersion?.value&&Ye(a.oldVersion.value))??null,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}})))},onRemoved(a){n(PZ({type:P.DirectiveUsageArgumentRemoved,meta:{removedArgumentName:a.name.value,directiveName:t.name.value,parentTypeName:i?.name??null,parentFieldName:r?.name??null,parentArgumentName:o?.name??null,parentEnumValueName:s?.name??null,directiveRepeatedTimes:yt((s||o||r||i)?.astNode?.directives??[],t)}}))}})}var n3=gt(t3(),1);function Hi(e){return typeof e=="string"?JSON.stringify(e):(0,n3.default)(e).replace(/\[Object: null prototype\] /g,"").replace(/(^')|('$)/g,"")}function je(e){return e.replace(/'/g,"\\'")}function KEe(e){return`Directive '${e.removedDirectiveName}' was removed`}var HEe="A directive could be in use of a client application. Removing it could break the client application.";function JEe(e){return{criticality:{level:W.Breaking,reason:HEe},type:P.DirectiveRemoved,message:KEe(e.meta),path:`@${e.meta.removedDirectiveName}`,meta:e.meta}}function r3(e){return JEe({type:P.DirectiveRemoved,meta:{removedDirectiveName:e.name}})}function ZEe(e){return`Directive '${e.addedDirectiveName}' was added`}function YEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveAdded,message:ZEe(e.meta),path:`@${e.meta.addedDirectiveName}`,meta:e.meta}}function i3(e){return YEe({type:P.DirectiveAdded,meta:{addedDirectiveName:e.name,addedDirectiveDescription:e.description??null,addedDirectiveLocations:e.locations.map(t=>String(t)),addedDirectiveRepeatable:e.isRepeatable}})}function QEe(e){return e.oldDirectiveDescription===null&&e.newDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.newDirectiveDescription)}' was added`:e.newDirectiveDescription===null&&e.oldDirectiveDescription!==null?`Directive '${e.directiveName}' description '${je(e.oldDirectiveDescription)}' was removed`:`Directive '${e.directiveName}' description changed from '${je(e.oldDirectiveDescription??"")}' to '${je(e.newDirectiveDescription??"")}'`}function XEe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveDescriptionChanged,message:QEe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function o3(e,t){return XEe({type:P.DirectiveDescriptionChanged,meta:{directiveName:t.name,oldDirectiveDescription:e?.description??null,newDirectiveDescription:t.description??null}})}function eTe(e){return`Directive '${e.directiveName}' added repeatable.`}function tTe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveRepeatableAdded,message:eTe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function s3(e){return tTe({type:P.DirectiveRepeatableAdded,meta:{directiveName:e.name}})}function nTe(e){return`Directive '${e.directiveName}' removed repeatable.`}function rTe(e){return{criticality:{level:W.Dangerous},type:P.DirectiveRepeatableRemoved,message:nTe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function a3(e){return rTe({type:P.DirectiveRepeatableRemoved,meta:{directiveName:e.name}})}function iTe(e){return`Location '${e.addedDirectiveLocation}' was added to directive '${e.directiveName}'`}function oTe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveLocationAdded,message:iTe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function c3(e,t){return oTe({type:P.DirectiveLocationAdded,meta:{directiveName:e.name,addedDirectiveLocation:String(t)}})}function sTe(e){return`Location '${e.removedDirectiveLocation}' was removed from directive '${e.directiveName}'`}var aTe="A directive could be in use of a client application. Removing it could break the client application.";function cTe(e){return{criticality:{level:W.Breaking,reason:aTe},type:P.DirectiveLocationRemoved,message:sTe(e.meta),path:`@${e.meta.directiveName}`,meta:e.meta}}function l3(e,t){return cTe({type:P.DirectiveLocationRemoved,meta:{directiveName:e.name,removedDirectiveLocation:t.toString()}})}var lTe="A directive could be in use of a client application. Adding a non-nullable argument will break those clients.",uTe="A directive could be in use of a client application. Adding a nullable argument will not break those clients.",dTe="Refer to the directive usage for the breaking status. If the directive is new and therefore unused, then adding an argument does not risk breaking clients.";function pTe(e){return{criticality:e.meta.addedToNewDirective?{level:W.NonBreaking,reason:dTe}:e.meta.addedDirectiveArgumentTypeIsNonNull?{level:W.Breaking,reason:lTe}:{level:W.NonBreaking,reason:uTe},type:P.DirectiveArgumentAdded,message:`Argument '${e.meta.addedDirectiveArgumentName}' was added to directive '${e.meta.directiveName}'`,path:`@${e.meta.directiveName}`,meta:e.meta}}function u3(e,t,n){return pTe({type:P.DirectiveArgumentAdded,meta:{directiveName:e.name,addedDirectiveArgumentName:t.name,addedDirectiveArgumentType:t.type.toString(),addedDirectiveDefaultValue:qd(t)?Hi(Jr(t)):void 0,addedDirectiveArgumentTypeIsNonNull:$e(t.type),addedDirectiveArgumentDescription:t.description??void 0,addedToNewDirective:n}})}function fTe(e){return`Argument '${e.removedDirectiveArgumentName}' was removed from directive '${e.directiveName}'`}var mTe="A directive argument could be in use of a client application. Removing the argument can break client applications.";function gTe(e){return{criticality:{level:W.Breaking,reason:mTe},type:P.DirectiveArgumentRemoved,message:fTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.removedDirectiveArgumentName}`,meta:e.meta}}function d3(e,t){return gTe({type:P.DirectiveArgumentRemoved,meta:{directiveName:e.name,removedDirectiveArgumentName:t.name}})}function hTe(e){return e.oldDirectiveArgumentDescription===null&&e.newDirectiveArgumentDescription!==null?`Description '${je(e.newDirectiveArgumentDescription)}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:e.newDirectiveArgumentDescription===null&&e.oldDirectiveArgumentDescription!==null?`Description '${je(e.oldDirectiveArgumentDescription)}' was removed from argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Description for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${je(e.oldDirectiveArgumentDescription??"")}' to '${je(e.newDirectiveArgumentDescription??"")}'`}function yTe(e){return{criticality:{level:W.NonBreaking},type:P.DirectiveArgumentDescriptionChanged,message:hTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function p3(e,t,n){return yTe({type:P.DirectiveArgumentDescriptionChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentDescription:t?.description??null,newDirectiveArgumentDescription:n.description??null}})}function bTe(e){return e.oldDirectiveArgumentDefaultValue===void 0?`Default value '${e.newDirectiveArgumentDefaultValue}' was added to argument '${e.directiveArgumentName}' on directive '${e.directiveName}'`:`Default value for argument '${e.directiveArgumentName}' on directive '${e.directiveName}' changed from '${e.oldDirectiveArgumentDefaultValue}' to '${e.newDirectiveArgumentDefaultValue}'`}var vTe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function wTe(e){return{criticality:{level:W.Dangerous,reason:vTe},type:P.DirectiveArgumentDefaultValueChanged,message:bTe(e.meta),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function f3(e,t,n){let i={directiveName:e.name,directiveArgumentName:n.name},r=t===null?void 0:Jr(t),o=Jr(n);return r!==void 0&&(i.oldDirectiveArgumentDefaultValue=Hi(r)),o!==void 0&&(i.newDirectiveArgumentDefaultValue=Hi(o)),wTe({type:P.DirectiveArgumentDefaultValueChanged,meta:i})}function kTe(e){return`Type for argument '${e.meta.directiveArgumentName}' on directive '${e.meta.directiveName}' changed from '${e.meta.oldDirectiveArgumentType}' to '${e.meta.newDirectiveArgumentType}'`}var _Te="Changing an input field from non-null to null is considered non-breaking.";function $Te(e){return{criticality:e.meta.isSafeDirectiveArgumentTypeChange?{level:W.NonBreaking,reason:_Te}:{level:W.Breaking},type:P.DirectiveArgumentTypeChanged,message:kTe(e),path:`@${e.meta.directiveName}.${e.meta.directiveArgumentName}`,meta:e.meta}}function m3(e,t,n){return $Te({type:P.DirectiveArgumentTypeChanged,meta:{directiveName:e.name,directiveArgumentName:n.name,oldDirectiveArgumentType:t?.type.toString()??"",newDirectiveArgumentType:n.type.toString(),isSafeDirectiveArgumentTypeChange:Ea(t.type,n.type)}})}function STe(e){return e.oldQueryTypeName===null?`Schema query root type was set to '${e.newQueryTypeName}'.`:e.newQueryTypeName===null?`Schema query root type '${e.oldQueryTypeName}' was removed.`:`Schema query root type was changed from '${e.oldQueryTypeName}' to '${e.newQueryTypeName}'`}function xTe(e){return{type:P.SchemaQueryTypeChanged,criticality:{level:e.meta.oldQueryTypeName===null?W.NonBreaking:W.Breaking},message:STe(e.meta),meta:e.meta}}function g3(e,t){let n=e?.getQueryType()?.name||null,i=t?.getQueryType()?.name||null;return xTe({type:P.SchemaQueryTypeChanged,meta:{oldQueryTypeName:n,newQueryTypeName:i}})}function ETe(e){return e.oldMutationTypeName===null?`Schema mutation type was set to '${e.newMutationTypeName}'.`:e.newMutationTypeName===null?`Schema mutation type '${e.oldMutationTypeName}' was removed.`:`Schema mutation type was changed from '${e.oldMutationTypeName}' to '${e.newMutationTypeName}'`}function TTe(e){return{type:P.SchemaMutationTypeChanged,criticality:{level:e.meta.oldMutationTypeName===null?W.NonBreaking:W.Breaking},message:ETe(e.meta),meta:e.meta}}function h3(e,t){let n=e?.getMutationType()?.name||null,i=t?.getMutationType()?.name||null;return TTe({type:P.SchemaMutationTypeChanged,meta:{newMutationTypeName:i,oldMutationTypeName:n}})}function ITe(e){return e.oldSubscriptionTypeName===null?`Schema subscription type was set to '${e.newSubscriptionTypeName}'.`:e.newSubscriptionTypeName===null?`Schema subscription type '${e.oldSubscriptionTypeName}' was removed.`:`Schema subscription type was changed from '${e.oldSubscriptionTypeName}' to '${e.newSubscriptionTypeName}'`}function ATe(e){return{type:P.SchemaSubscriptionTypeChanged,criticality:{level:e.meta.oldSubscriptionTypeName===null?W.NonBreaking:W.Breaking},message:ITe(e.meta),meta:e.meta}}function y3(e,t){let n=e?.getSubscriptionType()?.name||null,i=t?.getSubscriptionType()?.name||null;return ATe({type:P.SchemaSubscriptionTypeChanged,meta:{newSubscriptionTypeName:i,oldSubscriptionTypeName:n}})}function RTe(e){return`Type '${e.removedTypeName}' was removed`}function CTe(e){return{criticality:{level:W.Breaking},type:P.TypeRemoved,message:RTe(e.meta),meta:e.meta,path:e.meta.removedTypeName}}function b3(e){return CTe({type:P.TypeRemoved,meta:{removedTypeName:e.name}})}function NTe(e){return`Type '${e.addedTypeName}' was added`}function PTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeAdded,message:NTe(e.meta),meta:e.meta,path:e.meta.addedTypeName}}function DTe(e){return Qt(e)?{addedTypeKind:_.ENUM_TYPE_DEFINITION,addedTypeName:e.name}:ot(e)||Be(e)?{addedTypeKind:hh(e),addedTypeName:e.name}:Yt(e)?{addedTypeKind:_.UNION_TYPE_DEFINITION,addedTypeName:e.name}:Ke(e)?{addedTypeKind:_.INPUT_OBJECT_TYPE_DEFINITION,addedTypeIsOneOf:e.isOneOf,addedTypeName:e.name}:{addedTypeKind:hh(e),addedTypeName:e.name}}function v3(e){return PTe({type:P.TypeAdded,meta:DTe(e)})}function OTe(e){return`'${e.meta.typeName}' kind changed from '${e.meta.oldTypeKind}' to '${e.meta.newTypeKind}'`}function MTe(e){return{criticality:{level:W.Breaking,reason:"Changing the kind of a type is a breaking change because it can cause existing queries to error. For example, turning an object type to a scalar type would break queries that define a selection set for this type."},type:P.TypeKindChanged,message:OTe(e),path:e.meta.typeName,meta:e.meta}}function w3(e,t){return MTe({type:P.TypeKindChanged,meta:{typeName:t.name,newTypeKind:String(hh(t)),oldTypeKind:String(hh(e))}})}function LTe(e){let t=je(e.oldTypeDescription),n=je(e.newTypeDescription);return`Description '${t}' on type '${e.typeName}' has changed to '${n}'`}function FTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionChanged,message:LTe(e.meta),path:e.meta.typeName,meta:e.meta}}function k3(e,t){return FTe({type:P.TypeDescriptionChanged,meta:{typeName:e.name,newTypeDescription:t.description??"",oldTypeDescription:e.description??""}})}function UTe(e){return`Description '${je(e.removedTypeDescription)}' was removed from object type '${e.typeName}'`}function jTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionRemoved,message:UTe(e.meta),path:e.meta.typeName,meta:e.meta}}function _3(e){return jTe({type:P.TypeDescriptionRemoved,meta:{typeName:e.name,removedTypeDescription:e.description??""}})}function zTe(e){let t=je(e.addedTypeDescription);return`Object type '${e.typeName}' has description '${t}'`}function GTe(e){return{criticality:{level:W.NonBreaking},type:P.TypeDescriptionAdded,message:zTe(e.meta),path:e.meta.typeName,meta:e.meta}}function $3(e){return GTe({type:P.TypeDescriptionAdded,meta:{typeName:e.name,addedTypeDescription:e.description??""}})}function oO(e,t,n){Wt(e?.description,t.description)&&n(o3(e,t)),!t.isRepeatable&&e?.isRepeatable&&n(a3(t)),t.isRepeatable&&!e?.isRepeatable&&n(s3(t));let i={added:WD(t.locations,e?.locations??[]),removed:WD(e?.locations??[],t.locations)};for(let r of i.added)n(c3(t,r));for(let r of i.removed)n(l3(t,r));Xt(e?.args??[],t.args,{onAdded(r){n(u3(t,r,e===null))},onRemoved(r){n(d3(t,r))},onMutual(r){VTe(t,r.oldVersion,r.newVersion,n)}})}function VTe(e,t,n,i){Wt(t?.description,n.description)&&i(p3(e,t,n)),Wd(t,n)||i(f3(e,t,n)),Wt(t.type.toString(),n.type.toString())&&i(m3(e,t,n))}function BTe(e){return`Enum value '${e.removedEnumValueName}' ${e.isEnumValueDeprecated?"(deprecated) ":""}was removed from enum '${e.enumName}'`}var qTe="Removing an enum value will cause existing queries that use this enum value to error.";function WTe(e){return{type:P.EnumValueRemoved,criticality:{level:W.Breaking,reason:qTe},message:BTe(e.meta),meta:e.meta,path:[e.meta.enumName,e.meta.removedEnumValueName].join(".")}}function S3(e,t){return WTe({type:P.EnumValueRemoved,meta:{enumName:e.name,removedEnumValueName:t.name,isEnumValueDeprecated:cs(t)}})}function KTe(e){return`Enum value '${e.meta.addedEnumValueName}' was added to enum '${e.meta.enumName}'`}var HTe="Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.";function JTe(e){let t=e.meta.addedToNewType;return{type:P.EnumValueAdded,criticality:{level:t?W.NonBreaking:W.Dangerous,reason:t?void 0:HTe},message:KTe(e),meta:e.meta,path:[e.meta.enumName,e.meta.addedEnumValueName].join(".")}}function x3(e,t,n){return JTe({type:P.EnumValueAdded,meta:{enumName:e.name,addedEnumValueName:t.name,addedToNewType:n,addedDirectiveDescription:t.description??null}})}function ZTe(e){return e.oldEnumValueDescription===null&&e.newEnumValueDescription!==null?`Description '${je(e.newEnumValueDescription)}' was added to enum value '${e.enumName}.${e.enumValueName}'`:e.newEnumValueDescription===null&&e.oldEnumValueDescription!==null?`Description '${je(e.oldEnumValueDescription)}' was removed from enum value '${e.enumName}.${e.enumValueName}'`:`Description for enum value '${e.enumName}.${e.enumValueName}' changed from '${je(e.oldEnumValueDescription??"")}' to '${je(e.newEnumValueDescription??"")}'`}function YTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDescriptionChanged,message:ZTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function E3(e,t,n){return YTe({type:P.EnumValueDescriptionChanged,meta:{enumName:e.name,enumValueName:n.name,oldEnumValueDescription:t?.description??null,newEnumValueDescription:n.description??null}})}function QTe(e){let t=je(e.oldEnumValueDeprecationReason),n=je(e.newEnumValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' deprecation reason changed from '${t}' to '${n}'`}function XTe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonChanged,message:QTe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Hr.name}`].join("."),meta:e.meta}}function T3(e,t,n){return XTe({type:P.EnumValueDeprecationReasonChanged,meta:{enumName:e.name,enumValueName:t.name,oldEnumValueDeprecationReason:t.deprecationReason??"",newEnumValueDeprecationReason:n.deprecationReason??""}})}function eIe(e){let t=je(e.addedValueDeprecationReason);return`Enum value '${e.enumName}.${e.enumValueName}' was deprecated with reason '${t}'`}function tIe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonAdded,message:eIe(e.meta),path:[e.meta.enumName,e.meta.enumValueName,`@${Hr.name}`].join("."),meta:e.meta}}function I3(e,t,n){return tIe({type:P.EnumValueDeprecationReasonAdded,meta:{enumName:e.name,enumValueName:n.name,addedValueDeprecationReason:n.deprecationReason??""}})}function nIe(e){return`Deprecation reason was removed from enum value '${e.enumName}.${e.enumValueName}'`}function rIe(e){return{criticality:{level:W.NonBreaking},type:P.EnumValueDeprecationReasonRemoved,message:nIe(e.meta),path:[e.meta.enumName,e.meta.enumValueName].join("."),meta:e.meta}}function A3(e,t,n){return rIe({type:P.EnumValueDeprecationReasonRemoved,meta:{enumName:e.name,enumValueName:t.name,removedEnumValueDeprecationReason:t.deprecationReason??""}})}var R3="No longer supported";function N3(e,t,n){Xt(e?.getValues()??[],t.getValues(),{onAdded(i){n(x3(t,i,e===null)),C3({newVersion:i,oldVersion:null},t,n)},onRemoved(i){n(S3(e,i))},onMutual(i){C3(i,t,n)}}),en(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(tn(_.ENUM_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(nn(_.ENUM_TYPE_DEFINITION,i,t))}})}function C3(e,t,n){let i=e.oldVersion,r=e.newVersion;Wt(i?.description,r.description)&&n(E3(t,i,r)),Wt(i?.deprecationReason,r.deprecationReason)&&(At(i?.deprecationReason)||i?.deprecationReason===R3?n(I3(t,i,r)):At(r.deprecationReason)||r?.deprecationReason===R3?n(A3(t,i,r)):n(T3(t,i,r))),en(i?.astNode?.directives||[],r.astNode?.directives||[],{onAdded(o){n(tn(_.ENUM_VALUE_DEFINITION,o,{type:t,value:r},i===null)),et(null,o,n,t,void 0,void 0,r)},onMutual(o){et(o.oldVersion,o.newVersion,n,t,void 0,void 0,r)},onRemoved(o){n(nn(_.ENUM_VALUE_DEFINITION,o,{type:t,value:i}))}})}function iIe(e){return`Input field '${e.removedFieldName}' ${e.isInputFieldDeprecated?"(deprecated) ":""}was removed from input object type '${e.inputName}'`}function oIe(e){return{type:P.InputFieldRemoved,criticality:{level:W.Breaking,reason:"Removing an input field will cause existing queries that use this input field to error."},message:iIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.removedFieldName].join(".")}}function P3(e,t){return oIe({type:P.InputFieldRemoved,meta:{inputName:e.name,removedFieldName:t.name,isInputFieldDeprecated:cs(t)}})}function sIe(e){return`Input field '${e.addedInputFieldName}' of type '${e.addedInputFieldType}'${e.addedFieldDefault?` with default value '${e.addedFieldDefault}'`:""} was added to input object type '${e.inputName}'`}function aIe(e){let t,n=e.meta.isAddedInputFieldTypeNullable&&e.meta.addedFieldDefault===void 0;return e.meta.addedToNewType?t={level:W.NonBreaking,reason:"The field is being added to a new type."}:n?t={level:W.NonBreaking,reason:"The field is nullable and no default is set."}:e.meta.addedFieldDefault===void 0?t={level:W.Breaking,reason:"Adding a required input field to an existing input object type is a breaking change because it will cause existing uses of this input object type to error."}:t={level:W.Dangerous,reason:"Adding a field with a default value can change runtime behavior for clients that previously omitted it, and during rolling deploys consumers may receive the new default before producers are ready to handle it."},{type:P.InputFieldAdded,criticality:t,message:sIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.addedInputFieldName].join(".")}}function D3(e,t,n){let i=Jr(t);return aIe({type:P.InputFieldAdded,meta:{inputName:e.name,addedInputFieldName:t.name,isAddedInputFieldTypeNullable:!$e(t.type),addedInputFieldType:t.type.toString(),...qd(t)?{addedFieldDefault:Hi(i)}:{},addedToNewType:n}})}function cIe(e){let t=je(e.addedInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' has description '${t}'`}function lIe(e){return{type:P.InputFieldDescriptionAdded,criticality:{level:W.NonBreaking},message:cIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function O3(e,t){return lIe({type:P.InputFieldDescriptionAdded,meta:{inputName:e.name,inputFieldName:t.name,addedInputFieldDescription:t.description??""}})}function uIe(e){return`Description '${je(e.removedDescription)}' was removed from input field '${e.inputName}.${e.inputFieldName}'`}function dIe(e){return{type:P.InputFieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:uIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function M3(e,t){return dIe({type:P.InputFieldDescriptionRemoved,meta:{inputName:e.name,inputFieldName:t.name,removedDescription:t.description??""}})}function pIe(e){let t=je(e.oldInputFieldDescription),n=je(e.newInputFieldDescription);return`Input field '${e.inputName}.${e.inputFieldName}' description changed from '${t}' to '${n}'`}function fIe(e){return{type:P.InputFieldDescriptionChanged,criticality:{level:W.NonBreaking},message:pIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function L3(e,t,n){return fIe({type:P.InputFieldDescriptionChanged,meta:{inputName:e.name,inputFieldName:t.name,oldInputFieldDescription:t.description??"",newInputFieldDescription:n.description??""}})}function mIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' default value changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}function gIe(e){let t={level:W.Dangerous,reason:"Changing the default value for an argument may change the runtime behavior of a field if it was never provided."};return{type:P.InputFieldDefaultValueChanged,criticality:t,message:mIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function F3(e,t,n){let i={inputName:e.name,inputFieldName:n.name},r=Jr(t),o=Jr(n);return r!==void 0&&(i.oldDefaultValue=Hi(r)),o!==void 0&&(i.newDefaultValue=Hi(o)),gIe({type:P.InputFieldDefaultValueChanged,meta:i})}function hIe(e){return`Input field '${e.inputName}.${e.inputFieldName}' changed type from '${e.oldInputFieldType}' to '${e.newInputFieldType}'`}function yIe(e){return{type:P.InputFieldTypeChanged,criticality:e.meta.isInputFieldTypeChangeSafe?{level:W.NonBreaking,reason:"Changing an input field from non-null to null is considered non-breaking."}:{level:W.Breaking,reason:"Changing the type of an input field can cause existing queries that use this field to error."},message:hIe(e.meta),meta:e.meta,path:[e.meta.inputName,e.meta.inputFieldName].join(".")}}function U3(e,t,n){return yIe({type:P.InputFieldTypeChanged,meta:{inputName:e.name,inputFieldName:n.name,oldInputFieldType:t.type.toString(),newInputFieldType:n.type.toString(),isInputFieldTypeChangeSafe:Ea(t.type,n.type)}})}function z3(e,t,n){let i=e?.getFields()??{},r=t.getFields();Xt(Object.values(i),Object.values(r),{onAdded(o){n(D3(t,o,e==null)),j3(t,null,o,n)},onRemoved(o){n(P3(e,o))},onMutual(o){j3(t,o.oldVersion,o.newVersion,n)}}),en(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(tn(_.INPUT_OBJECT_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(nn(_.INPUT_OBJECT_TYPE_DEFINITION,o,e))}})}function j3(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(O3(e,n)):At(n.description)?i(M3(e,t)):i(L3(e,t,n))),At(t)||(Wd(t,n)||i(F3(e,t,n)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(U3(e,t,n))),(t?.astNode?.directives||n.astNode?.directives)&&en(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(tn(_.INPUT_VALUE_DEFINITION,r,{type:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(nn(_.INPUT_VALUE_DEFINITION,r,{type:e,field:n}))}})}function bIe(e){return`Field '${e.removedFieldName}' ${e.isRemovedFieldDeprecated?"(deprecated) ":""}was removed from ${e.typeType} '${e.typeName}'`}function vIe(e){return{type:P.FieldRemoved,criticality:{level:W.Breaking,reason:e.meta.isRemovedFieldDeprecated?"Removing a deprecated field is a breaking change. Before removing it, you may want to look at the field's usage to see the impact of removing the field.":"Removing a field is a breaking change. It is preferable to deprecate the field before removing it. This applies to removed union fields as well, since removal breaks client operations that contain fragments that reference the removed type through direct (... on RemovedType) or indirect means such as __typename in the consumers."},message:bIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.removedFieldName].join(".")}}function V_(e,t){let n=Be(e)?"interface":"object type";return vIe({type:P.FieldRemoved,meta:{typeName:e.name,removedFieldName:t.name,isRemovedFieldDeprecated:t.deprecationReason!=null,typeType:n}})}function wIe(e){return`Field '${e.addedFieldName}' was added to ${e.typeType} '${e.typeName}'`}function kIe(e){return{type:P.FieldAdded,criticality:{level:W.NonBreaking},message:wIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.addedFieldName].join(".")}}function B_(e,t){let n=Be(e)?"interface":"object type";return kIe({type:P.FieldAdded,meta:{typeName:e.name,addedFieldName:t.name,typeType:n,addedFieldReturnType:t.type.toString()}})}function _Ie(e){return!e.oldDescription&&e.newDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.newDescription)}' was added`:!e.newDescription&&e.oldDescription?`Field '${e.typeName}.${e.fieldName}' description '${je(e.oldDescription)}' was removed`:`Field '${e.typeName}.${e.fieldName}' description changed from '${je(e.oldDescription)}' to '${je(e.newDescription)}'`}function $Ie(e){return{type:P.FieldDescriptionChanged,criticality:{level:W.NonBreaking},message:_Ie(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function G3(e,t,n){return $Ie({type:P.FieldDescriptionChanged,meta:{fieldName:t.name,typeName:e.name,oldDescription:t.description??"",newDescription:n.description??""}})}function SIe(e){let t=je(e.addedDescription);return`Field '${e.typeName}.${e.fieldName}' has description '${t}'`}function xIe(e){return{type:P.FieldDescriptionAdded,criticality:{level:W.NonBreaking},message:SIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function V3(e,t){return xIe({type:P.FieldDescriptionAdded,meta:{typeName:e.name,fieldName:t.name,addedDescription:t.description??""}})}function EIe(e){return`Description was removed from field '${e.typeName}.${e.fieldName}'`}function TIe(e){return{type:P.FieldDescriptionRemoved,criticality:{level:W.NonBreaking},message:EIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function B3(e,t){return TIe({type:P.FieldDescriptionRemoved,meta:{typeName:e.name,fieldName:t.name}})}function IIe(e){return`Field '${e.typeName}.${e.fieldName}' is deprecated`}function AIe(e){return{type:P.FieldDeprecationAdded,criticality:{level:W.NonBreaking},message:IIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function q3(e,t){return AIe({type:P.FieldDeprecationAdded,meta:{typeName:e.name,fieldName:t.name,deprecationReason:t.deprecationReason??""}})}function RIe(e){return{type:P.FieldDeprecationRemoved,criticality:{level:W.NonBreaking},message:`Field '${e.meta.typeName}.${e.meta.fieldName}' is no longer deprecated`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function W3(e,t){return RIe({type:P.FieldDeprecationRemoved,meta:{fieldName:t.name,typeName:e.name}})}function CIe(e){let t=je(e.oldDeprecationReason),n=je(e.newDeprecationReason);return`Deprecation reason on field '${e.typeName}.${e.fieldName}' has changed from '${t}' to '${n}'`}function NIe(e){return{type:P.FieldDeprecationReasonChanged,criticality:{level:W.NonBreaking},message:CIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function K3(e,t,n){return NIe({type:P.FieldDeprecationReasonChanged,meta:{fieldName:n.name,typeName:e.name,newDeprecationReason:n.deprecationReason??"",oldDeprecationReason:t.deprecationReason??""}})}function PIe(e){let t=je(e.addedDeprecationReason);return`Field '${e.typeName}.${e.fieldName}' has deprecation reason '${t}'`}function DIe(e){return{type:P.FieldDeprecationReasonAdded,criticality:{level:W.NonBreaking},message:PIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,`@${Hr.name}`].join(".")}}function H3(e,t){return DIe({type:P.FieldDeprecationReasonAdded,meta:{typeName:e.name,fieldName:t.name,addedDeprecationReason:t.deprecationReason??""}})}function OIe(e){return{type:P.FieldDeprecationReasonRemoved,criticality:{level:W.NonBreaking},message:`Deprecation reason was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`,meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function J3(e,t){return OIe({type:P.FieldDeprecationReasonRemoved,meta:{typeName:e.name,fieldName:t.name}})}function MIe(e){return`Field '${e.meta.typeName}.${e.meta.fieldName}' changed type from '${e.meta.oldFieldType}' to '${e.meta.newFieldType}'`}function LIe(e){return{type:P.FieldTypeChanged,criticality:{level:e.meta.isSafeFieldTypeChange?W.NonBreaking:W.Breaking},message:MIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName].join(".")}}function Z3(e,t,n){return LIe({type:P.FieldTypeChanged,meta:{typeName:e.name,fieldName:t.name,oldFieldType:t.type.toString(),newFieldType:n.type.toString(),isSafeFieldTypeChange:gh(t.type,n.type)}})}function FIe(e){return`Argument '${e.addedArgumentName}: ${e.addedArgumentType}'${e.hasDefaultValue?" (with default value) ":" "}added to field '${e.typeName}.${e.fieldName}'`}function UIe(e){return{type:P.FieldArgumentAdded,criticality:{level:e.meta.addedToNewField?W.NonBreaking:e.meta.isAddedFieldArgumentBreaking?W.Breaking:W.Dangerous},message:FIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.addedArgumentName].join(".")}}function Y3(e,t,n,i){let r=qd(n),o=$e(n.type)&&!r;return UIe({type:P.FieldArgumentAdded,meta:{typeName:e.name,fieldName:t.name,addedArgumentName:n.name,addedArgumentType:n.type.toString(),hasDefaultValue:r,addedToNewField:i,isAddedFieldArgumentBreaking:o}})}function jIe(e){return`Argument '${e.meta.removedFieldArgumentName}: ${e.meta.removedFieldType}' was removed from field '${e.meta.typeName}.${e.meta.fieldName}'`}function zIe(e){return{type:P.FieldArgumentRemoved,criticality:{level:W.Breaking},message:jIe(e),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.removedFieldArgumentName].join(".")}}function Q3(e,t,n){return zIe({type:P.FieldArgumentRemoved,meta:{typeName:e.name,fieldName:t.name,removedFieldArgumentName:n.name,removedFieldType:n.type.toString()}})}function GIe(e){return`'${e.objectTypeName}' object implements '${e.addedInterfaceName}' interface`}function VIe(e){return{type:P.ObjectTypeInterfaceAdded,criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding an interface to an object type may break existing clients that are consuming a field returning the interface type that are not programming defensively against this new possible type."},message:GIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function q_(e,t,n){return VIe({type:P.ObjectTypeInterfaceAdded,meta:{objectTypeName:t.name,addedInterfaceName:e.name,addedToNewType:n}})}function BIe(e){return`'${e.objectTypeName}' object type no longer implements '${e.removedInterfaceName}' interface`}function qIe(e){return{type:P.ObjectTypeInterfaceRemoved,criticality:{level:W.Breaking,reason:"Removing an interface from an object type can cause existing queries that use this in a fragment spread to error."},message:BIe(e.meta),meta:e.meta,path:e.meta.objectTypeName}}function W_(e,t){return qIe({type:P.ObjectTypeInterfaceRemoved,meta:{objectTypeName:t.name,removedInterfaceName:e.name}})}function WIe(e){return e.oldDescription===null&&e.newDescription!==null?`Description '${je(e.newDescription)}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:e.newDescription===null&&e.oldDescription!==null?`Description '${je(e.oldDescription)}' was removed from argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Description for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${je(e.oldDescription??"")}' to '${je(e.newDescription??"")}'`}function KIe(e){return{type:P.FieldArgumentDescriptionChanged,criticality:{level:W.NonBreaking},message:WIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function X3(e,t,n,i){return KIe({type:P.FieldArgumentDescriptionChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldDescription:n?.description??null,newDescription:i.description??null}})}function HIe(e){return e.oldDefaultValue===void 0?`Default value '${e.newDefaultValue}' was added to argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}'`:`Default value for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldDefaultValue}' to '${e.newDefaultValue}'`}var JIe="Changing the default value for an argument may change the runtime behaviour of a field if it was never provided.";function ZIe(e){return{type:P.FieldArgumentDefaultChanged,criticality:{level:W.Dangerous,reason:JIe},message:HIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function eY(e,t,n,i){let r={typeName:e.name,fieldName:t.name,argumentName:i.name},o=n===null?void 0:Jr(n),s=Jr(i);return o!==void 0&&(r.oldDefaultValue=Hi(o)),s!==void 0&&(r.newDefaultValue=Hi(s)),ZIe({type:P.FieldArgumentDefaultChanged,meta:r})}function YIe(e){return`Type for argument '${e.argumentName}' on field '${e.typeName}.${e.fieldName}' changed from '${e.oldArgumentType}' to '${e.newArgumentType}'`}var QIe="Changing an input field from non-null to null is considered non-breaking.",XIe="Changing the type of a field's argument can cause existing queries that use this argument to error.";function eAe(e){return{type:P.FieldArgumentTypeChanged,criticality:e.meta.isSafeArgumentTypeChange?{level:W.NonBreaking,reason:QIe}:{level:W.Breaking,reason:XIe},message:YIe(e.meta),meta:e.meta,path:[e.meta.typeName,e.meta.fieldName,e.meta.argumentName].join(".")}}function tY(e,t,n,i){return eAe({type:P.FieldArgumentTypeChanged,meta:{typeName:e.name,fieldName:t.name,argumentName:i.name,oldArgumentType:n?.type.toString()??"",newArgumentType:i.type.toString(),isSafeArgumentTypeChange:!n||Ea(n.type,i.type)}})}function nY(e,t,n,i,r){Wt(n?.description,i.description)&&r(X3(e,t,n,i)),Wd(n,i)||r(eY(e,t,n,i)),Wt(n?.type.toString(),i.type.toString())&&r(tY(e,t,n,i)),(n?.astNode?.directives||i.astNode?.directives)&&en(n?.astNode?.directives||[],i.astNode?.directives||[],{onAdded(o){r(tn(_.ARGUMENT,o,{argument:i,field:t,type:e},n===null)),et(null,o,r,e,t,i)},onMutual(o){et(o.oldVersion,o.newVersion,r,e,t,i)},onRemoved(o){r(nn(_.ARGUMENT,o,{argument:n,field:t,type:e}))}})}var rY="No longer supported";function Hd(e,t,n,i){Wt(t?.description,n.description)&&(At(t?.description)?i(V3(e,n)):At(n.description)?i(B3(e,t)):i(G3(e,t,n))),At(t)||!cs(t)?cs(n)&&i(q3(e,n)):cs(n)?Wt(t.deprecationReason,n.deprecationReason)&&(At(t.deprecationReason)||t.deprecationReason===rY?i(H3(e,n)):At(n.deprecationReason)||n.deprecationReason===rY?i(J3(e,t)):i(K3(e,t,n))):cs(t)&&i(W3(e,t)),!At(t)&&Wt(t.type.toString(),n.type.toString())&&i(Z3(e,t,n)),Xt(t?.args??[],n.args,{onAdded(r){i(Y3(e,n,r,t===null))},onRemoved(r){i(Q3(e,n,r))},onMutual(r){nY(e,n,r.oldVersion,r.newVersion,i)}}),en(t?.astNode?.directives||[],n.astNode?.directives||[],{onAdded(r){i(tn(_.FIELD_DEFINITION,r,{parentType:e,field:n},t===null)),et(null,r,i,e,n)},onMutual(r){et(r.oldVersion,r.newVersion,i,e,n)},onRemoved(r){i(nn(_.FIELD_DEFINITION,r,{parentType:e,field:t}))}})}function iY(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces();Xt(i,r,{onAdded(a){n(q_(a,t,e===null))},onRemoved(a){n(W_(a,e))}});let o=e?.getFields()??{},s=t.getFields();Xt(Object.values(o),Object.values(s),{onAdded(a){n(B_(t,a)),Hd(t,null,a,n)},onRemoved(a){n(V_(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),en(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(tn(_.INTERFACE_TYPE_DEFINITION,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(nn(_.INTERFACE_TYPE_DEFINITION,a,e))}})}function oY(e,t,n){let i=e?.getInterfaces()??[],r=t.getInterfaces(),o=e?.getFields()??{},s=t.getFields();Xt(i,r,{onAdded(a){n(q_(a,t,e===null))},onRemoved(a){n(W_(a,e))}}),Xt(Object.values(o),Object.values(s),{onAdded(a){n(B_(t,a)),Hd(t,null,a,n)},onRemoved(a){n(V_(e,a))},onMutual(a){Hd(t,a.oldVersion,a.newVersion,n)}}),en(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(a){n(tn(_.OBJECT,a,t,e===null)),et(null,a,n,t)},onMutual(a){et(a.oldVersion,a.newVersion,n,t)},onRemoved(a){n(nn(_.OBJECT,a,e))}})}function sY(e,t,n){en(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(i){n(tn(_.SCALAR_TYPE_DEFINITION,i,t,e===null)),et(null,i,n,t)},onMutual(i){et(i.oldVersion,i.newVersion,n,t)},onRemoved(i){n(nn(_.SCALAR_TYPE_DEFINITION,i,e))}})}function tAe(e){return`Member '${e.removedUnionMemberTypeName}' was removed from Union type '${e.unionName}'`}function nAe(e){return{criticality:{level:W.Breaking,reason:"Removing a union member from a union can cause existing queries that use this union member in a fragment spread to error."},type:P.UnionMemberRemoved,message:tAe(e.meta),meta:e.meta,path:e.meta.unionName}}function aY(e,t){return nAe({type:P.UnionMemberRemoved,meta:{unionName:e.name,removedUnionMemberTypeName:t.name}})}function rAe(e){return`Member '${e.addedUnionMemberTypeName}' was added to Union type '${e.unionName}'`}function iAe(e){return{criticality:{level:e.meta.addedToNewType?W.NonBreaking:W.Dangerous,reason:"Adding a possible type to Unions may break existing clients that were not programming defensively against a new possible type."},type:P.UnionMemberAdded,message:rAe(e.meta),meta:e.meta,path:e.meta.unionName}}function cY(e,t,n){return iAe({type:P.UnionMemberAdded,meta:{unionName:e.name,addedUnionMemberTypeName:t.name,addedToNewType:n}})}function lY(e,t,n){let i=e?.getTypes()??[],r=t.getTypes();Xt(i,r,{onAdded(o){n(cY(t,o,e===null))},onRemoved(o){n(aY(e,o))}}),en(e?.astNode?.directives||[],t.astNode?.directives||[],{onAdded(o){n(tn(_.UNION_TYPE_DEFINITION,o,t,e===null)),et(null,o,n,t)},onMutual(o){et(o.oldVersion,o.newVersion,n,t)},onRemoved(o){n(nn(_.UNION_TYPE_DEFINITION,o,e))}})}function dY(e,t){let n=[];function i(r){n.push(r)}Xt((e?.getDirectives()??[]).filter(r=>!Yc(r)),(t?.getDirectives()??[]).filter(r=>!Yc(r)),{onAdded(r){i(i3(r)),oO(null,r,i)},onRemoved(r){i(r3(r))},onMutual(r){oO(r.oldVersion,r.newVersion,i)}}),oAe(e,t,i),Xt(Object.values(e?.getTypeMap()??{}).filter(r=>!BD(r)&&!qD(r)),Object.values(t?.getTypeMap()??{}).filter(r=>!BD(r)&&!qD(r)),{onAdded(r){i(v3(r)),uY(null,r,i)},onRemoved(r){i(b3(r))},onMutual(r){uY(r.oldVersion,r.newVersion,i)}}),en(e?.astNode?.directives||[],t?.astNode?.directives||[],{onAdded(r){i(tn(_.SCHEMA_DEFINITION,r,t,!1)),et(null,r,i)},onMutual(r){et(r.oldVersion,r.newVersion,i)},onRemoved(r){i(nn(_.SCHEMA_DEFINITION,r,e))}});for(let r=0;r{let a=await o;return s({changes:a,oldSchema:e,newSchema:t,config:i})},Promise.resolve(r))}var K_="graphql-inspector",aO={id:"graphql",source:"graphql-diff",tool:K_,weight:1,originClass:"computed-artifact",config:{enabled:"graphql",paths:"graphqlSchemas"},handles(e,t){return/\.(graphql|graphqls|gql|sdl)$/i.test(e)?/\b(type|interface|enum|union|input|scalar|schema|directive)\b/.test(t):!1},async compute(e){let t,n;try{t=mh(e.before,{assumeValidSDL:!0}),n=mh(e.after,{assumeValidSDL:!0})}catch(o){return ma(K_,"parse-failed",`${e.path} could not be parsed as GraphQL SDL on both sides of this change: ${o.message}`)}let i;try{i=await sO(t,n)}catch(o){return ma(K_,"toolchain-failed",`graphql-inspector could not compare ${e.path}: ${o.message}`)}let r=[];for(let o of i){let s=o.criticality?.level;if(s!=="BREAKING"&&s!=="DANGEROUS")continue;let a=o.path??o.type;r.push({code:pY(o.type,s),location:a,pointer:`${e.path}#${a}`,detail:o.message})}return{available:!0,changes:r,tool:K_,weight:1,locator:`${e.path} (GraphQL SDL)`}},codes:{"graphql-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL field \`${e}\` was removed. Every query, mutation, or fragment in this repository that selects it will now be rejected outright \u2014 the whole document fails validation, not just that selection. Find those documents and migrate each to the replacement field; if there is none, propagate the absence rather than substituting a placeholder.`},"graphql-input-field-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL input field \`${e}\` no longer exists. Stop sending it: an unknown field on an input object fails validation, so every variable payload and inline argument that still carries it will be rejected.`},"graphql-type-removed":{kind:"removed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"type",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL type \`${e}\` no longer exists. Every fragment on it, every \`... on ${e}\` inline fragment, and every variable declared with it must be migrated. If there is no replacement type, leave the operation intact with a clearly-marked TODO and explain it in the PR description.`},"graphql-type-kind-changed":{kind:"type-change",taxonomy:{nature:"type-contract",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`\`${e}\` changed kind: ${t} Selections written against the old kind are no longer valid \u2014 an object's field selection does not survive becoming a union or a scalar. Rewrite each selection set for the new kind rather than adjusting it in place.`},"graphql-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL field \`${e}\` changed: ${t} Update the sub-selection and any client-side parsing of the value. A field that became nullable can now return null where the code assumed a value \u2014 handle that explicitly rather than asserting it away.`},"graphql-input-field-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL input field \`${e}\` changed: ${t} Update every variable payload that sets it so the value sent matches the new type.`},"graphql-argument-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL argument \`${e}\` was removed. Stop passing it \u2014 an unknown argument fails validation, so the whole operation is rejected, not just that argument.`},"graphql-argument-type-changed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The type of the GraphQL argument \`${e}\` changed: ${t} Update the variable declarations and the values passed at every call site.`},"graphql-argument-now-required":{kind:"required-field-added",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is now required and has no default. Supply it in every operation that reaches this field, using a value that preserves the previous behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`},"graphql-argument-default-changed":{kind:"default-change",taxonomy:{nature:"behaviour",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The default value of \`${e}\` changed: ${t} Operations that omit it will silently behave differently. Pass the old value explicitly wherever the previous behaviour was intended.`},"graphql-enum-value-removed":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`The GraphQL enum value \`${e}\` was removed. Find code that sends it and map it onto a still-supported value; code that only *reads* the enum should keep its fallback branch, since a stored value may still carry the old name.`},"graphql-enum-value-added":{kind:"changed-endpoint",taxonomy:{nature:"data-schema",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e})=>`\`${e}\` is a new value this code has never seen returned. Add explicit handling; make sure exhaustive switches and mapping tables over that enum have a safe default rather than falling through silently.`},"graphql-union-member-removed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"type",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A union or interface membership changed: ${t} An \`... on ${e}\` fragment against a type that is no longer a member fails validation. Rewrite those fragments for the members the schema still declares.`},"graphql-directive-removed":{kind:"config-change",taxonomy:{nature:"configuration",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`A GraphQL directive changed or was removed: ${t} Every operation that applies \`${e}\` \u2014 or applies it where it is no longer allowed \u2014 fails validation. Remove or relocate those usages.`},"graphql-root-type-changed":{kind:"moved-export",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"module",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`The root operation type \`${e}\` changed: ${t} Every operation of that kind is now rooted somewhere else \u2014 check that the top-level selections in this repository's documents still exist on the new root.`},"graphql-schema-changed":{kind:"changed-endpoint",taxonomy:{nature:"protocol",detectability:["runtime-only"],scope:"symbol",visibility:["unknown"]},remediation:({symbol:e,detail:t})=>`graphql-inspector reports a breaking schema change at \`${e}\`: ${t} Update the operations in this repository that touch it.`}}};function pY(e,t){switch(e){case"FIELD_REMOVED":return"graphql-field-removed";case"INPUT_FIELD_REMOVED":return"graphql-input-field-removed";case"TYPE_REMOVED":return"graphql-type-removed";case"TYPE_KIND_CHANGED":return"graphql-type-kind-changed";case"FIELD_TYPE_CHANGED":return"graphql-field-type-changed";case"INPUT_FIELD_TYPE_CHANGED":return"graphql-input-field-type-changed";case"FIELD_ARGUMENT_REMOVED":case"DIRECTIVE_ARGUMENT_REMOVED":return"graphql-argument-removed";case"FIELD_ARGUMENT_TYPE_CHANGED":case"DIRECTIVE_ARGUMENT_TYPE_CHANGED":return"graphql-argument-type-changed";case"FIELD_ARGUMENT_ADDED":case"INPUT_FIELD_ADDED":case"DIRECTIVE_ARGUMENT_ADDED":return t==="BREAKING"?"graphql-argument-now-required":"graphql-schema-changed";case"FIELD_ARGUMENT_DEFAULT_CHANGED":case"INPUT_FIELD_DEFAULT_VALUE_CHANGED":case"DIRECTIVE_ARGUMENT_DEFAULT_VALUE_CHANGED":return"graphql-argument-default-changed";case"ENUM_VALUE_REMOVED":return"graphql-enum-value-removed";case"ENUM_VALUE_ADDED":return"graphql-enum-value-added";case"UNION_MEMBER_REMOVED":case"UNION_MEMBER_ADDED":case"OBJECT_TYPE_INTERFACE_REMOVED":return"graphql-union-member-removed";case"DIRECTIVE_REMOVED":case"DIRECTIVE_LOCATION_REMOVED":case"DIRECTIVE_REPEATABLE_REMOVED":return"graphql-directive-removed";case"SCHEMA_QUERY_TYPE_CHANGED":case"SCHEMA_MUTATION_TYPE_CHANGED":case"SCHEMA_SUBSCRIPTION_TYPE_CHANGED":return"graphql-root-type-changed";default:return"graphql-schema-changed"}}var sAe=["openapi-diff","protobuf-diff","graphql-diff"];function fY(e){return sAe.includes(e)}var nl=[qP,WP,aO];var hY=Object.fromEntries(nl.map(e=>[e.source,e.weight])),yY=Object.fromEntries(nl.map(e=>[e.source,e.originClass])),aAe=Object.fromEntries(nl.flatMap(e=>Object.entries(e.codes)));function cO(e){return aAe[e]}function bY(e,t){return t.evidence[e.config.enabled]===!0}function vY(e,t){let n=t.evidence[e.config.paths];return Array.isArray(n)?n:[]}var cAe=12e4;async function wY(e,t,n){let i=await(0,H_.mkdtemp)((0,gY.join)((0,mY.tmpdir)(),"drift-spec-"));try{return await e.compute({path:t.path,before:t.before,after:t.after,siblings:n.siblings??[],workdir:i,exec:n.exec??Xe,logger:n.logger,...n.env?{env:n.env}:{},timeoutMs:n.timeoutMs??cAe})}catch(r){return n.logger.debug(`Spec diff crashed for ${t.path}: ${r.message}`),{available:!1,reason:"toolchain-failed",detail:`Drift could not compare ${t.path}: ${r.message}`,tool:e.tool}}finally{await(0,H_.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var kY=require("node:crypto"),Ra=require("node:fs/promises"),_Y=require("node:path");function $Y(e){let t=Uc();return t?(0,_Y.join)(t,`artifact-${(0,kY.createHash)("sha256").update(e).digest("hex")}.json`):null}async function Ca(e){let t=$Y(e);if(!t)return null;try{let n=JSON.parse(await(0,Ra.readFile)(t,"utf8"));return n.format!==1||n.key!==e?null:(nt("artifact.cache.hit"),n.value)}catch{return nt("artifact.cache.miss"),null}}async function Na(e,t){let n=$Y(e);if(n)try{await(0,Ra.mkdir)(Uc(),{recursive:!0});let i=`${n}.${process.pid}.partial`;await(0,Ra.writeFile)(i,JSON.stringify({format:1,key:e,value:t}),"utf8"),await(0,Ra.rename)(i,n)}catch{}}var Z_=require("node:zlib");function lAe(e){return e.length>2&&e[0]===31&&e[1]===139}function uAe(e){return e.length>4&&e[0]===80&&e[1]===75}var SY=200*1024*1024;function Ln(e,t={}){let n=t.maxDecompressedBytes??SY;return uAe(e)?lO(e,{maxDecompressedBytes:n}):gAe(lAe(e)?(0,Z_.gunzipSync)(e,{maxOutputLength:n}):e)}var dAe=101010256,pAe=33639248;function lO(e,t={}){let n=t.maxDecompressedBytes??SY,i=mAe(e);if(i===-1)return[];let r=e.readUInt16LE(i+10),o=e.readUInt32LE(i+16),s=[];for(let a=0;ae.length||e.readUInt32LE(o)!==pAe);a++){let c=e.readUInt16LE(o+10),l=e.readUInt32LE(o+20),u=e.readUInt32LE(o+24),d=e.readUInt16LE(o+28),p=e.readUInt16LE(o+30),f=e.readUInt16LE(o+32),m=e.readUInt32LE(o+42),g=e.toString("utf8",o+46,o+46+d);o+=46+d+p+f,!g.endsWith("/")&&s.push({path:g,size:u,read:()=>fAe(e,m,c,l,n)})}return s}function fAe(e,t,n,i,r){let o=e.readUInt16LE(t+26),s=e.readUInt16LE(t+28),a=t+30+o+s,c=e.subarray(a,a+i);if(n===0){if(c.length>r)throw new Error(`Stored zip entry exceeds the ${r}-byte decompressed-size limit.`);return Buffer.from(c)}if(n===8)return(0,Z_.inflateRawSync)(c,{maxOutputLength:r});throw new Error(`Unsupported zip compression method ${n}`)}function mAe(e){let t=Math.max(0,e.length-65535-22);for(let n=e.length-22;n>=t;n--)if(e.readUInt32LE(n)===dAe)return n;return-1}var wh=512;function gAe(e){let t=[],n=0,i=null;for(;n+wh<=e.length;){let r=e.subarray(n,n+wh);if(r[0]===0)break;let o=J_(r.subarray(0,100)),s=hAe(r.subarray(124,136)),a=String.fromCharCode(r[156]??0),c=J_(r.subarray(345,500)),l=n+wh,u=l+s;if(n=l+Math.ceil(s/wh)*wh,a==="L"){i=J_(e.subarray(l,u));continue}if(a==="x"||a==="X"){i=yAe(e.subarray(l,u))??i;continue}if(a!=="0"&&a!=="\0"&&a!=="7"){i=null;continue}let d=i??(c?`${c}/${o}`:o);if(i=null,!d)continue;let p=e.subarray(l,u);t.push({path:d,size:s,read:()=>Buffer.from(p)})}return t}function J_(e){let t=e.indexOf(0);return e.toString("utf8",0,t===-1?e.length:t).trim()}function hAe(e){let t=J_(e).replace(/[^0-7]/g,"");return t?Number.parseInt(t,8):0}function yAe(e){for(let t of e.toString("utf8").split(` +`)){let n=/^\d+\s+path=(.*)$/.exec(t);if(n)return n[1]}return null}function bAe(e){return/^[aeiou]/i.test(e.trim())?"an":"a"}function Eo(e){return`${bAe(e)} ${e}`}var WY="https://data.jsdelivr.com/v1/packages/npm",vO="https://cdn.jsdelivr.net/npm",vAe="https://registry.npmjs.org",wAe=50*1024*1024,xY=200*1024*1024,EY=20*1024*1024,Y_=new Map;function rl(e,t,n={}){if(n.traversal)return kAe+=1,Sn("surface",e,()=>IY(e,t,n));let i=`${e}@${t}#${n.followDependencies===!1?"own":"deps"}`+(n.subpath?`#${n.subpath}`:""),r=Y_.get(i);if(r)return nt("surface.cache.hit"),r;nt("surface.cache.miss");let o=Sn("surface",e,()=>IY(e,t,n));return Y_.set(i,o),o.then(s=>{s||Y_.delete(i)},()=>Y_.delete(i)),o}var kAe=0;var _Ae=6;function $Ae(e,t,n,i){return`npm-surface:v${_Ae}:${e}@${t}#${n?"deps":"own"}`+(i?`#${i}`:"")}async function SAe(e,t,n,i){let r=kO(KY(n?.exports,i)),o=[...r?_h(il(r)):[],..._h(il(i))],s=[...new Set(o)],a=await wO(e,t,s);if(a!==void 0)return a;for(let c of s)if(await o$(e,t,c))return c;return null}function TY(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function KY(e,t){if(!e||typeof e!="object")return;let n=e;for(let i of[`./${t}`,t])if(i in n)return n[i]}async function IY(e,t,n){let i=n.followDependencies!==!1,r=$Ae(e,t,i,n.subpath),o=await Ca(r);if(o)return nt("surface.diskCache.hit"),{...o,incomplete:o.incomplete??!1,api:new Map(o.api)};nt("surface.diskCache.miss");let s=await fO(e,t),a=n.subpath?await SAe(e,t,s,n.subpath):await jAe(e,t,s),c=a?await Sn("surface-sources",e,()=>uO(e,t,a)):{sources:[],truncated:!1};if(!a||c.sources.length===0){let h=await AAe(e,t);if(!h)throw new Jd(e,t);if(s=h.manifest,a=n.subpath?await GAe(s,n.subpath,h.files):zAe(e,s,h.files),a&&(c=await Sn("surface-sources",e,()=>uO(e,t,a,h)),c.sources.length===0))throw new Jd(e,t)}if(!a){if(a=await VAe(e,t,n.subpath),!a)return null;c=await Sn("surface-sources",e,()=>uO(e,t,a))}let l=c.sources,u=c.truncated;if(nt("surface.declarationFiles",l.length),l.length===0)return null;let d=new Map,p=[];for(let h of l)YAe(h.content,h.path,d,p,e);t0e(d,p),YY(d);let f=d.size,m=!s||!i?{followed:[],attempted:!1,incomplete:!1}:await Sn("surface-deps",e,()=>OAe(s,l,d,`${e}@${t}`,n.traversal)),g=d.size>0?{api:d,entryPath:a,viaDependencies:m.followed,ownSymbols:f,subpaths:UAe(s?.exports),incomplete:m.incomplete||u}:null;return g&&!m.attempted&&!g.incomplete&&await Na(r,{...g,api:[...g.api]}),g}var i$=class extends Error{constructor(n,i){super(`${n}@${i} could not be fetched`);this.packageName=n;this.version=i;this.name="VersionUnavailableError"}packageName;version},Jd=class extends Error{constructor(n,i){super(`${n}@${i} artifact could not be inspected`);this.packageName=n;this.version=i;this.name="ArtifactUnavailableError"}packageName;version};function fO(e,t){return _e(`${vO}/${e}@${t}/package.json`)}async function HY(e,t,n){let[i,r]=await Promise.all([fO(e,t),fO(e,n)]);if(!i||!r)return[];let o=AY(e,i),s=AY(e,r),a=[],c=[...o.requireConditions].filter(u=>!s.requireConditions.has(u)&&!s.commonJsExports.has(u));for(let u of c){let d=gO(e,u),p=TAe(u)?"affectedSpecifierPatterns":"affectedSpecifiers";a.push({kind:"exports-require-condition-removed",symbol:e,detail:u==="."?"The root CommonJS export condition was removed":`The CommonJS export condition for ${u} was removed`,before:[...o.requireConditions].sort().join(` `),after:[...s.requireConditions].sort().join(` -`)||"(none)",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],[p]:[d]}})}let l=c.includes(".");return o.hasRootCommonJsEntry&&!s.hasRootCommonJsEntry&&!l?a.push({kind:"commonjs-entry-removed",symbol:e,detail:"The package no longer exposes a CommonJS-compatible entry point",before:o.entrySummary,after:s.entrySummary,moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],affectedSpecifiers:[e]}}):i.type!==r.type&&r.type==="module"&&!s.hasRootCommonJsEntry&&!l&&a.push({kind:"package-type-changed",symbol:e,detail:"The package type changed to ESM without a CommonJS-compatible entry point",before:S8(i),after:S8(r),moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"],affectedSpecifiers:[e]}}),k0e(a)}function _8(e,t){let n=b0e(t.exports),i=v0e(t.exports,t),r=t.exports!==void 0?i.has("."):cO(t.main,t)||cO("./index.js",t),o=[`type: ${t.type??"(absent)"}`,t.exports===void 0&&t.main?`main: ${t.main}`:"",t.module?`module: ${t.module}`:"",n.size>0?`exports.require: ${[...n].sort().map(s=>aO(e,s)).join(", ")}`:"",i.size>0?`exports.commonjs: ${[...i].sort().map(s=>aO(e,s)).join(", ")}`:""].filter(Boolean).join(` -`)||"(no CommonJS-compatible entry point detected)";return{hasRootCommonJsEntry:r,requireConditions:n,commonJsExports:i,entrySummary:o}}function b0e(e){let t=new Set;return K$(e,".",t),t}function K$(e,t,n){if(Array.isArray(e)){for(let o of e)K$(o,t,n);return}if(!e||typeof e!="object")return;let i=Object.entries(e),r=i.some(([o])=>o==="."||o.startsWith("./"));for(let[o,s]of i)o==="require"&&n.add(t),r&&(o==="."||o.startsWith("./"))?K$(s,o,n):typeof s=="object"&&K$(s,t,n)}function v0e(e,t){let n=new Set;return sO(e,".",t,n),n}function sO(e,t,n,i){if(J$(e,n)&&i.add(t),Array.isArray(e)){for(let s of e)sO(s,t,n,i);return}if(!e||typeof e!="object")return;let r=Object.entries(e);if(r.some(([s])=>s==="."||s.startsWith("./")))for(let[s,a]of r)(s==="."||s.startsWith("./"))&&sO(a,s,n,i)}function aO(e,t){return t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function w0e(e){return e.includes("*")}function J$(e,t){if(typeof e=="string")return cO(e,t);if(Array.isArray(e))return e.some(i=>J$(i,t));if(!e||typeof e!="object")return!1;let n=e;return"require"in n?mh(n.require):"node"in n&&J$(n.node,t)?!0:"default"in n?J$(n.default,t):!1}function mh(e){if(typeof e=="string")return!/\.mjs$/i.test(e);if(Array.isArray(e))return e.some(mh);if(!e||typeof e!="object")return!1;let t=e;return"require"in t?mh(t.require):"node"in t&&mh(t.node)?!0:"default"in t?mh(t.default):!1}function cO(e,t){return e?/\.cjs$/i.test(e)?!0:/\.mjs$/i.test(e)?!1:(/\.[jt]sx?$/i.test(e),t.type!=="module"):!1}function S8(e){return`type: ${e.type??"(absent)"} -${e.main?`main: ${e.main}`:"main: (absent)"}`}function k0e(e){let t=new Set;return e.filter(n=>{let i=n.moduleSystem?.affectedSpecifiers?.join(",")??"",r=n.moduleSystem?.affectedSpecifierPatterns?.join(",")??"",o=`${n.kind}:${i}:${r}:${n.symbol}`;return t.has(o)?!1:(t.add(o),!0)})}var x8=new Map,q$=new Map;function $0e(e,t){let n=`${e}@${t}`,i=q$.get(n);if(i)return i;let r=encodeURIComponent(e).replaceAll("%40","@"),o=(async()=>{let s=await $e(`${p0e}/${r}/${encodeURIComponent(t)}`,{immutable:!0});if(!s?.dist?.tarball||s.version!==t)return null;let a=await Bt(s.dist.tarball,{maxBytes:f0e,timeoutMs:6e4,retries:2});if(!a.ok)return null;let c;try{c=Fn(a.bytes,{maxDecompressedBytes:v8})}catch{return null}if(c.length===0)return null;let l=c.reduce((f,m)=>f+Math.max(0,m.size),0);if(!Number.isSafeInteger(l)||l>v8)return null;let u=new Map;for(let f of c){let m=_0e(f.path);if(m===null)return null;!m||u.has(m)||u.set(m,f)}let d=u.get("package.json");if(!d||d.size>1024*1024)return null;let p;try{p=JSON.parse(d.read().toString("utf8"))}catch{return null}return p.version!==t?null:{manifest:p,files:u}})();return q$.set(n,o),o.then(s=>{s||q$.delete(n)},()=>q$.delete(n)),o}function _0e(e){let t=e.replaceAll("\\","/");if(!t||t.includes("\0")||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return null;let n=t.split("/");if(n.some(i=>i===".."))return null;for(;n[0]==="."||n[0]==="";)n.shift();return n[0]==="package"&&n.shift(),n.join("/")}function V8(e,t){let n=`${e}@${t}`,i=x8.get(n);if(i)return i;let r=$e(`${j8}/${e}@${t}?structure=flat`,{immutable:!0,retries:0}).then(o=>o?.files?new Set(o.files.map(s=>s.name).filter(s=>typeof s=="string").map(s=>s.startsWith("/")?s.slice(1):s)):null).catch(()=>null);return x8.set(n,r),r}async function pO(e,t,n){let i=await V8(e,t);if(i)return n.find(r=>i.has(r))??null}var S0e=8,E8=8,x0e=4,E0e=24;function T0e(e){return e.star||e.reExported.size>0}async function I0e(e,t,n,i,r){let o={...e?.dependencies,...e?.peerDependencies},s=[...T8(t,n)].some(([y,w])=>w.star&&!o[k8(y)]);if(Object.keys(o).length===0)return{followed:[],attempted:!1,incomplete:s};let a=r?.depth??0,c=r?.budget??{remaining:E0e},l=new Set([...r?.visited??[],i]),u=[...T8(t,n)].map(([y,w])=>{let k=k8(y),_=y.length>k.length?y.slice(k.length+1):void 0;return{specifier:y,reference:w,pkg:k,subpath:_}}).filter(y=>o[y.pkg]),d=u.length>0;if(!d)return{followed:[],attempted:!1,incomplete:s};let p=[],f=!1,m=await qn(u,E8,y=>N0e(y.pkg,o[y.pkg])),g=[],h=0;for(let[y,{specifier:w,reference:k,pkg:_,subpath:S}]of u.entries()){let x=m[y],E=T0e(k);if(!x){E&&(f=!0);continue}let T=l.has(`${w}@${x}`);if(!E){if(h>=S0e)continue;h+=1,g.push({specifier:w,pkg:_,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:!1});continue}let A=!T&&a0;A?c.remaining-=1:T||(f=!0),g.push({specifier:w,pkg:_,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:A})}let b=new Array(g.length);await qn(g.map((y,w)=>({entry:y,index:w})),E8,async({entry:y,index:w})=>{y.recurse||(b[w]=await tl(y.pkg,y.resolved,{followDependencies:!1,...y.subpath?{subpath:y.subpath}:{}}).catch(()=>null))});for(let[y,w]of g.entries())w.recurse&&(b[y]=await tl(w.pkg,w.resolved,{followDependencies:!0,...w.subpath?{subpath:w.subpath}:{},traversal:{depth:a+1,visited:new Set([...l,`${w.specifier}@${w.resolved}`]),budget:c}}).catch(()=>null));for(let[y,w]of g.entries()){let k=b[y];if(w.publicEdge&&!k&&(f=!0),k?.incomplete&&(f=!0),!k)continue;let _=0;for(let[S,x]of w.reference.names(k.api)){let E=k.api.get(x);if(!E)continue;let T=w.reference.star||w.reference.reExported.has(S)?S:`${w.specifier}#${S}`;n.has(T)||(n.set(T,{...hh(E,S),via:w.specifier}),_+=1)}_>0&&p.push(`${w.specifier}@${w.resolved}`)}return{followed:p,attempted:d,incomplete:f||s}}function T8(e,t){let n=new Map,i=s=>{let a=n.get(s);if(a)return a;let c={named:new Map,star:!1,reExported:new Set,names(l){if(!this.star)return[...this.named];let u=[...l.keys()].map(d=>[d,d]);return[...this.named,...u.filter(([d])=>!this.named.has(d))]}};return n.set(s,c),c},r=[...t.values()].map(s=>s.signature).join(` -`),o=s=>new RegExp(`\\b${e_(s)}\\b`).test(r);for(let s of e)for(let a of A0e(s.content)){if(R0e(a.specifier))continue;let c=i(a.specifier);if(a.kind==="export"&&a.star){c.star=!0;continue}for(let l of a.bindings)a.kind==="export"?(c.named.set(l.local,l.imported),c.reExported.add(l.local)):o(l.local)&&c.named.set(l.imported,l.imported)}return n}function A0e(e){let t=[],n=/\b(import|export)\s+(?:type\s+)?(?:(\*(?:\s+as\s+\w+)?)|(\{[^}]*\})|(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let i of e.matchAll(n)){let[,r="",o,s,a,c=""]=i,l=r==="export"?"export":"import";if(o){t.push({kind:l,specifier:c,star:!0,bindings:[]});continue}if(a){t.push({kind:l,specifier:c,star:!1,bindings:[{imported:"default",local:a}]});continue}let u=[];for(let d of(s??"").replace(/[{}]/g,"").split(",")){let p=d.replace(/\btype\s+/g,"").trim();if(!p)continue;let[f,m]=p.split(/\s+as\s+/).map(g=>g.trim());f&&u.push({imported:f,local:m||f})}u.length>0&&t.push({kind:l,specifier:c,star:!1,bindings:u})}return t}function R0e(e){return e.startsWith(".")||e.startsWith("/")}async function N0e(e,t){return(await $e(`${j8}/${e}/resolved?specifier=${encodeURIComponent(t)}`))?.version??null}function C0e(e){return!e||typeof e!="object"?[]:Object.keys(e).filter(t=>t.startsWith("./")&&!t.endsWith("package.json")).slice(0,20)}async function P0e(e,t,n){let i=B8(e,n),r=await pO(e,t,i);if(r!==void 0){if(r)return r}else for(let o of i)if(await Q$(e,t,o))return o;return null}function D0e(e,t,n){return B8(e,t).find(i=>n.has(i))??null}function O0e(e,t,n){let i=fO(z8(e?.exports,t)),r=[...i?gh(nl(i)):[],...gh(nl(t))];return[...new Set(r)].find(o=>n.has(o))??null}function B8(e,t){let n=[];if(t){let i=t.types??t.typings??fO(t.exports);i&&n.push(...gh(nl(i))),t.main&&n.push(nl(t.main).replace(/\.(c|m)?js$/,".d.ts"))}return n.push(...F0e(e)),[...new Set(n)]}async function M0e(e,t,n){let i=e.startsWith("@")?`@types/${e.slice(1).replace("/","__")}`:`@types/${e}`,r=n?`${n}.d.ts`:"index.d.ts",o=n?`#${n}`:"",s=/^\D*(\d+)\./.exec(t)?.[1]??/^\D*(\d+)$/.exec(t)?.[1];return s&&await Q$(i,s,r)?`@types:${i}@${s}${o}`:await Q$(i,"latest",r)?`@types:${i}@latest${o}`:null}function L0e(e){let t=e.slice(7),n=t.indexOf("#"),i=n===-1?t:t.slice(0,n),r=n===-1?void 0:t.slice(n+1),o=i.lastIndexOf("@"),s=o>0?{name:i.slice(0,o),range:i.slice(o+1)}:{name:i,range:"latest"};return r?{...s,subpath:r}:s}function F0e(e){return["index.d.ts","dist/index.d.ts","lib/index.d.ts","types/index.d.ts",`types/${e.split("/").pop()?.replace(/^@/,"")||e}.d.ts`]}function gh(e){if(/\.d\.(c|m)?ts$/.test(e))return[e,e.replace(/\.d\.(c|m)?ts$/,".d.ts")];let t=e.replace(/\.(c|m)?[jt]s$/,"").replace(/\/$/,""),n=[`${t}.d.ts`,`${t}.d.cts`,`${t}.d.mts`,`${t}/index.d.ts`];return/\.(c|m)?js$/.test(e)||n.push(e),n}function fO(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=(n,i)=>{if(i>6||!n)return null;if(typeof n=="string")return i>0?n:null;if(typeof n!="object")return null;let r=n,o=r.types??r.typings;if(typeof o=="string")return o;let s=[".","import","require","default","node"];for(let a of[...s,...Object.keys(r)]){if(!(a in r))continue;let c=t(r[a],i+1);if(c)return c}return null};return t(e,0)}async function nO(e,t,n,i){let r=n.startsWith("@types:")?L0e(n):null,o=r?`${r.name}@${r.range}`:`${e}@${t}`,s=r?r.subpath?`${r.subpath}.d.ts`:"index.d.ts":n,a=r?null:i?new Set(i.files.keys()):await V8(e,t),c=0,l=[],u=new Set,d=[[s]],p=async g=>{let h=a?g.find(b=>a.has(b))??null:void 0;for(let b of h===void 0?g:h?[h]:[]){let y;if(i){let w=i.files.get(b);if(!w||w.size>w8-c)return null;let k=w.read();if(c+=k.length,c>w8)return null;y=k.toString("utf8")}else y=await rt(`${dO}/${o}/${b}`,{retries:0});if(y)return{path:b,content:y}}return null},f=!1;for(;d.length>0&&l.length0&&g.length+l.length!u.has(y));for(let y of b)u.add(y);b.length>0&&g.push(b)}if(g.length===0)continue;let h=await qn(g,U0e,b=>p(b));for(let b of h)if(b&&l.length>=W$&&(f=!0),!(!b||l.length>=W$)){l.push(b);for(let y of j0e(b.content))d.push(rO(b.path,y));for(let y of V0e(b.content))d.push(rO(b.path,y));for(let y of z0e(b.content))d.push(rO(b.path,y))}}return d.some(g=>g.some(h=>!u.has(h)))&&(f=!0),{sources:l,truncated:f}}var U0e=8,W$=Number(process.env.DRIFT_MAX_DECLARATION_FILES)||150;function j0e(e){let t=new Set,n=/\bexport\b\s*(?:type\b\s*)?(?:\*(?:\s+as\s+\w+)?|\{[^}]*\})\s*from\s*['"](\.[^'"]+)['"]/g;for(let r of e.matchAll(n))t.add(r[1]);let i=/\bimport\s+[A-Za-z_$][\w$]*\s*=\s*require\((['"])(\.[^'"]+)\1\)/g;for(let r of e.matchAll(i))t.add(r[2]);return[...t]}function z0e(e){if(!/\bexport\b\s*\{[^}]*\}(?!\s*from)/.test(e))return[];let t=new Set,n=/\bimport\b[^'"]*?\bfrom\s*['"](\.[^'"]+)['"]/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function G0e(e,t){if(!t)return[];let n=new Set([t,t.replace(/^@types\//,"")]),i=[],r=/\bdeclare\s+module\s+['"]([^'"]+)['"]\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=o[1];(n.has(c)||[...n].some(l=>c.startsWith(`${l}/`)))&&i.push(e.slice(s+1,a)),r.lastIndex=a+1}return i}function V0e(e){let t=new Set,n=/\/\/\/\s*/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function rO(e,t){let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r=nl(n?`${n}/${t}`:t).replace(/\.(d\.(c|m)?ts|(c|m)?js|(c|m)?ts)$/,"");return[`${r}.d.ts`,`${r}.d.cts`,`${r}.d.mts`,`${r}/index.d.ts`,`${r}/index.d.cts`]}function nl(e){let t=[];for(let n of e.replace(/^\.\//,"").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}async function Q$(e,t,n){let i=await pO(e,t,[n]);return i!==void 0?i!==null:await rt(`${dO}/${e}@${t}/${n}`,{retries:0})!==null}function B0e(e,t,n=new Map,i=[],r){let o=new Map,s=(c,l)=>{let u=c.get(l.name);u&&u.kind===l.kind?(u.signature=`${u.signature} | ${l.signature}`,u.members=[...new Set([...u.members,...l.members])],u.requiredMembers=[...new Set([...u.requiredMembers,...l.requiredMembers])]):u||c.set(l.name,l)},a=gO(e);for(let c of A8(a))s(o,c.entry),c.exported&&s(n,c.entry);for(let c of G0e(a,r)){for(let l of A8(c))s(n,l.entry);I8(c,o,n,{override:!0})}return q0e(a,o),W0e(a,n),H0e(a,o,n,i),I8(a,o,n),Z0e(a,o,n),q8(n,o),n}function q8(e,t){let n=r=>e.get(r)??t?.get(r),i=(r,o)=>{if(!(!r.extends||o.has(r.name))){o.add(r.name);for(let s of r.extends){let a=n(s);!a||a===r||(i(a,o),r.members=[...new Set([...r.members,...a.members])],r.requiredMembers=[...new Set([...r.requiredMembers,...a.requiredMembers])])}}};for(let r of e.values())i(r,new Set)}function q0e(e,t){let n=i=>{t.has(i)||t.set(i,{name:i,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})};for(let i of e.matchAll(/\bimport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"][^'"]+['"]/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?:type\s+)?\{([^}]+)\}\s+from\s+['"][^'"]+['"]/g))for(let{exported:r}of hO(i[1]??""))n(r);for(let i of e.matchAll(/\bimport\s+([A-Za-z_$][\w$]*)\s*=\s*require\(['"][^'"]+['"]\)/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?!type\s)([A-Za-z_$][\w$]*)\s*(?:,\s*\{[^}]*\})?\s+from\s+['"][^'"]+['"]/g))n(i[1])}function W0e(e,t){let n=/\bexport\b\s*(?:type\b\s*)?\*\s+as\s+([A-Za-z_$][\w$]*)\s*from\s*['"][^'"]+['"]/g;for(let i of e.matchAll(n)){let r=i[1];t.has(r)||t.set(r,{name:r,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})}}function H0e(e,t,n,i){let r=/\bexport\b\s*(?:type\b\s*)?\{([^}]+)\}(?:\s*from\s*['"][^'"]+['"])?\s*;/g;for(let o of e.matchAll(r))for(let{exported:s,local:a}of hO(o[1]??"")){if(n.has(s))continue;let c=t.get(a);c?n.set(s,hh(c,s)):i.push({exported:s,local:a})}}function K0e(e,t){for(let n of t){if(e.has(n.exported))continue;let i=e.get(n.local);i&&e.set(n.exported,hh(i,n.exported))}}function I8(e,t,n,i={}){for(let r of e.matchAll(/\bexport\s*=\s*([A-Za-z_$][\w$.]*)\s*(?:;|$)/gm))W8("default",r[1],t,n,i.override),J0e("default",r[1],t,n,i.override)}function J0e(e,t,n,i,r=!1){let o=i.get(e);if(!o||o.members.length>0&&!r)return;let s=n.get(t);if(!s)return;let a=s.signature.replace(/\s*\bexport\s*=[\s\S]*$/,"").replace(/\s*\}\s*$/,"").trim(),c=/:\s*([A-Za-z_$][\w$.]*)\s*;?\s*$/.exec(a)?.[1],l=c?n.get(c):void 0;l&&(o.members=[...l.members],o.requiredMembers=[...l.requiredMembers])}function W8(e,t,n,i,r=!1){let o=n.get(t);o&&(r||!i.has(e))&&i.set(e,hh(o,e));for(let s of n.values()){if(!s.name.startsWith(`${t}.`))continue;let a=`${e}.${s.name.slice(t.length+1)}`;(r||!i.has(a))&&i.set(a,hh(s,a))}}function Z0e(e,t,n){for(let i of e.matchAll(/\bexport\s+default\s+(?:abstract\s+)?(?:class|function|enum|const|let|var)?\s*([A-Za-z_$][\w$]*)/g)){let r=i[1];t.has(r)&&W8("default",r,t,n)}}function hh(e,t){return{...e,name:t,signature:e.signature.replace(new RegExp(`\\b${e_(e.name)}\\b`,"g"),t)}}function e_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yh(e){return e.replace(/\/\*(?:[^*]|\*(?!\/))*\*\//g,"").replace(/\/\/[^\n]*/g,"").replace(/\s+/g," ").trim()}function A8(e){let t=[];for(let n of K8(e))t.push({exported:n.exported,entry:{name:n.name,kind:"function",signature:yh(e.slice(n.start,To(e,n.start))),members:[],requiredMembers:[]}});return R8(e,/\b(export\s+)?(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g,"variable",t),tAe(e,t),R8(e,/\b(export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g,"type",t),iO(e,/\b(export\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"class",t),iO(e,/\b(export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"interface",t),iO(e,/\b(export\s+)?(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"enum",t),H8(e,"",!1,t),t}function H8(e,t,n,i){let r=/\b(export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=n||!!o[1],l=t?`${t}.${o[2]}`:o[2],u=e.slice(s+1,a);i.push({exported:c,entry:{name:l,kind:"namespace",signature:`namespace ${l}`,members:X0e(u),requiredMembers:[]}}),Q0e(u,l,c,i),H8(u,l,c,i),Y0e(u,l,c,i),r.lastIndex=a+1}}function Y0e(e,t,n,i){let r=mO(e);for(let o of r.matchAll(/\bexport\b\s*\{([^}]+)\}\s*;?/g))for(let{exported:s}of hO(o[1]??""))i.push({exported:n,entry:{name:`${t}.${s}`,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0}})}function Q0e(e,t,n,i){let r=mO(e),o=(s,a,c,l=[],u=[])=>{i.push({exported:n,entry:{name:`${t}.${s}`,kind:a,signature:yh(c.replace(new RegExp(`\\b${e_(s)}\\b`),`${t}.${s}`)),members:l,requiredMembers:u}})};for(let s of K8(r))o(s.name,"function",r.slice(s.start,To(r,s.start)));for(let s of r.matchAll(/\b(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"variable",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"type",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=X$(u,!0);o(s[1],"class",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=X$(u,!1);o(s[1],"interface",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"";o(s[1],"enum",r.slice(a,c>=0?c:To(r,a)),Y8(u).map(d=>d.name))}}function mO(e){let t=[],n=/\b(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\s*\{/g;for(let r of e.matchAll(n)){let o=e.indexOf("{",r.index),s=ls(e,o);o>=0&&s>=0&&t.push([r.index??0,s+1])}if(t.length===0)return e;let i=[...e];for(let[r,o]of t)for(let s=r;s"){if(e[i-1]==="=")continue;if(n-=1,n===0)return i}else if(r==="("&&n===0)return-1}return-1}function gO(e){let t="",n=0;for(;n0?`exports.require: ${[...n].sort().map(s=>gO(e,s)).join(", ")}`:"",i.size>0?`exports.commonjs: ${[...i].sort().map(s=>gO(e,s)).join(", ")}`:""].filter(Boolean).join(` +`)||"(no CommonJS-compatible entry point detected)";return{hasRootCommonJsEntry:r,requireConditions:n,commonJsExports:i,entrySummary:o}}function xAe(e){let t=new Set;return t$(e,".",t),t}function t$(e,t,n){if(Array.isArray(e)){for(let o of e)t$(o,t,n);return}if(!e||typeof e!="object")return;let i=Object.entries(e),r=i.some(([o])=>o==="."||o.startsWith("./"));for(let[o,s]of i)o==="require"&&n.add(t),r&&(o==="."||o.startsWith("./"))?t$(s,o,n):typeof s=="object"&&t$(s,t,n)}function EAe(e,t){let n=new Set;return mO(e,".",t,n),n}function mO(e,t,n,i){if(n$(e,n)&&i.add(t),Array.isArray(e)){for(let s of e)mO(s,t,n,i);return}if(!e||typeof e!="object")return;let r=Object.entries(e);if(r.some(([s])=>s==="."||s.startsWith("./")))for(let[s,a]of r)(s==="."||s.startsWith("./"))&&mO(a,s,n,i)}function gO(e,t){return t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function TAe(e){return e.includes("*")}function n$(e,t){if(typeof e=="string")return hO(e,t);if(Array.isArray(e))return e.some(i=>n$(i,t));if(!e||typeof e!="object")return!1;let n=e;return"require"in n?kh(n.require):"node"in n&&n$(n.node,t)?!0:"default"in n?n$(n.default,t):!1}function kh(e){if(typeof e=="string")return!/\.mjs$/i.test(e);if(Array.isArray(e))return e.some(kh);if(!e||typeof e!="object")return!1;let t=e;return"require"in t?kh(t.require):"node"in t&&kh(t.node)?!0:"default"in t?kh(t.default):!1}function hO(e,t){return e?/\.cjs$/i.test(e)?!0:/\.mjs$/i.test(e)?!1:(/\.[jt]sx?$/i.test(e),t.type!=="module"):!1}function RY(e){return`type: ${e.type??"(absent)"} +${e.main?`main: ${e.main}`:"main: (absent)"}`}function IAe(e){let t=new Set;return e.filter(n=>{let i=n.moduleSystem?.affectedSpecifiers?.join(",")??"",r=n.moduleSystem?.affectedSpecifierPatterns?.join(",")??"",o=`${n.kind}:${i}:${r}:${n.symbol}`;return t.has(o)?!1:(t.add(o),!0)})}var CY=new Map,Q_=new Map;function AAe(e,t){let n=`${e}@${t}`,i=Q_.get(n);if(i)return i;let r=encodeURIComponent(e).replaceAll("%40","@"),o=(async()=>{let s=await _e(`${vAe}/${r}/${encodeURIComponent(t)}`,{immutable:!0});if(!s?.dist?.tarball||s.version!==t)return null;let a=await Bt(s.dist.tarball,{maxBytes:wAe,timeoutMs:6e4,retries:2});if(!a.ok)return null;let c;try{c=Ln(a.bytes,{maxDecompressedBytes:xY})}catch{return null}if(c.length===0)return null;let l=c.reduce((f,m)=>f+Math.max(0,m.size),0);if(!Number.isSafeInteger(l)||l>xY)return null;let u=new Map;for(let f of c){let m=RAe(f.path);if(m===null)return null;!m||u.has(m)||u.set(m,f)}let d=u.get("package.json");if(!d||d.size>1024*1024)return null;let p;try{p=JSON.parse(d.read().toString("utf8"))}catch{return null}return p.version!==t?null:{manifest:p,files:u}})();return Q_.set(n,o),o.then(s=>{s||Q_.delete(n)},()=>Q_.delete(n)),o}function RAe(e){let t=e.replaceAll("\\","/");if(!t||t.includes("\0")||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return null;let n=t.split("/");if(n.some(i=>i===".."))return null;for(;n[0]==="."||n[0]==="";)n.shift();return n[0]==="package"&&n.shift(),n.join("/")}function JY(e,t){let n=`${e}@${t}`,i=CY.get(n);if(i)return i;let r=_e(`${WY}/${e}@${t}?structure=flat`,{immutable:!0,retries:0}).then(o=>o?.files?new Set(o.files.map(s=>s.name).filter(s=>typeof s=="string").map(s=>s.startsWith("/")?s.slice(1):s)):null).catch(()=>null);return CY.set(n,r),r}async function wO(e,t,n){let i=await JY(e,t);if(i)return n.find(r=>i.has(r))??null}var CAe=8,NY=8,NAe=4,PAe=24;function DAe(e){return e.star||e.reExported.size>0}async function OAe(e,t,n,i,r){let o={...e?.dependencies,...e?.peerDependencies},s=[...PY(t,n)].some(([y,w])=>w.star&&!o[TY(y)]);if(Object.keys(o).length===0)return{followed:[],attempted:!1,incomplete:s};let a=r?.depth??0,c=r?.budget??{remaining:PAe},l=new Set([...r?.visited??[],i]),u=[...PY(t,n)].map(([y,w])=>{let k=TY(y),$=y.length>k.length?y.slice(k.length+1):void 0;return{specifier:y,reference:w,pkg:k,subpath:$}}).filter(y=>o[y.pkg]),d=u.length>0;if(!d)return{followed:[],attempted:!1,incomplete:s};let p=[],f=!1,m=await Bn(u,NY,y=>FAe(y.pkg,o[y.pkg])),g=[],h=0;for(let[y,{specifier:w,reference:k,pkg:$,subpath:S}]of u.entries()){let x=m[y],E=DAe(k);if(!x){E&&(f=!0);continue}let T=l.has(`${w}@${x}`);if(!E){if(h>=CAe)continue;h+=1,g.push({specifier:w,pkg:$,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:!1});continue}let A=!T&&a0;A?c.remaining-=1:T||(f=!0),g.push({specifier:w,pkg:$,subpath:S,reference:k,resolved:x,publicEdge:E,recurse:A})}let b=new Array(g.length);await Bn(g.map((y,w)=>({entry:y,index:w})),NY,async({entry:y,index:w})=>{y.recurse||(b[w]=await rl(y.pkg,y.resolved,{followDependencies:!1,...y.subpath?{subpath:y.subpath}:{}}).catch(()=>null))});for(let[y,w]of g.entries())w.recurse&&(b[y]=await rl(w.pkg,w.resolved,{followDependencies:!0,...w.subpath?{subpath:w.subpath}:{},traversal:{depth:a+1,visited:new Set([...l,`${w.specifier}@${w.resolved}`]),budget:c}}).catch(()=>null));for(let[y,w]of g.entries()){let k=b[y];if(w.publicEdge&&!k&&(f=!0),k?.incomplete&&(f=!0),!k)continue;let $=0;for(let[S,x]of w.reference.names(k.api)){let E=k.api.get(x);if(!E)continue;let T=w.reference.star||w.reference.reExported.has(S)?S:`${w.specifier}#${S}`;n.has(T)||(n.set(T,{...$h(E,S),via:w.specifier}),$+=1)}$>0&&p.push(`${w.specifier}@${w.resolved}`)}return{followed:p,attempted:d,incomplete:f||s}}function PY(e,t){let n=new Map,i=s=>{let a=n.get(s);if(a)return a;let c={named:new Map,star:!1,reExported:new Set,names(l){if(!this.star)return[...this.named];let u=[...l.keys()].map(d=>[d,d]);return[...this.named,...u.filter(([d])=>!this.named.has(d))]}};return n.set(s,c),c},r=[...t.values()].map(s=>s.signature).join(` +`),o=s=>new RegExp(`\\b${a$(s)}\\b`).test(r);for(let s of e)for(let a of MAe(s.content)){if(LAe(a.specifier))continue;let c=i(a.specifier);if(a.kind==="export"&&a.star){c.star=!0;continue}for(let l of a.bindings)a.kind==="export"?(c.named.set(l.local,l.imported),c.reExported.add(l.local)):o(l.local)&&c.named.set(l.imported,l.imported)}return n}function MAe(e){let t=[],n=/\b(import|export)\s+(?:type\s+)?(?:(\*(?:\s+as\s+\w+)?)|(\{[^}]*\})|(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let i of e.matchAll(n)){let[,r="",o,s,a,c=""]=i,l=r==="export"?"export":"import";if(o){t.push({kind:l,specifier:c,star:!0,bindings:[]});continue}if(a){t.push({kind:l,specifier:c,star:!1,bindings:[{imported:"default",local:a}]});continue}let u=[];for(let d of(s??"").replace(/[{}]/g,"").split(",")){let p=d.replace(/\btype\s+/g,"").trim();if(!p)continue;let[f,m]=p.split(/\s+as\s+/).map(g=>g.trim());f&&u.push({imported:f,local:m||f})}u.length>0&&t.push({kind:l,specifier:c,star:!1,bindings:u})}return t}function LAe(e){return e.startsWith(".")||e.startsWith("/")}async function FAe(e,t){return(await _e(`${WY}/${e}/resolved?specifier=${encodeURIComponent(t)}`))?.version??null}function UAe(e){return!e||typeof e!="object"?[]:Object.keys(e).filter(t=>t.startsWith("./")&&!t.endsWith("package.json")).slice(0,20)}async function jAe(e,t,n){let i=ZY(e,n),r=await wO(e,t,i);if(r!==void 0){if(r)return r}else for(let o of i)if(await o$(e,t,o))return o;return null}function zAe(e,t,n){return ZY(e,t).find(i=>n.has(i))??null}function GAe(e,t,n){let i=kO(KY(e?.exports,t)),r=[...i?_h(il(i)):[],..._h(il(t))];return[...new Set(r)].find(o=>n.has(o))??null}function ZY(e,t){let n=[];if(t){let i=t.types??t.typings??kO(t.exports);i&&n.push(..._h(il(i))),t.main&&n.push(il(t.main).replace(/\.(c|m)?js$/,".d.ts"))}return n.push(...qAe(e)),[...new Set(n)]}async function VAe(e,t,n){let i=e.startsWith("@")?`@types/${e.slice(1).replace("/","__")}`:`@types/${e}`,r=n?`${n}.d.ts`:"index.d.ts",o=n?`#${n}`:"",s=/^\D*(\d+)\./.exec(t)?.[1]??/^\D*(\d+)$/.exec(t)?.[1];return s&&await o$(i,s,r)?`@types:${i}@${s}${o}`:await o$(i,"latest",r)?`@types:${i}@latest${o}`:null}function BAe(e){let t=e.slice(7),n=t.indexOf("#"),i=n===-1?t:t.slice(0,n),r=n===-1?void 0:t.slice(n+1),o=i.lastIndexOf("@"),s=o>0?{name:i.slice(0,o),range:i.slice(o+1)}:{name:i,range:"latest"};return r?{...s,subpath:r}:s}function qAe(e){return["index.d.ts","dist/index.d.ts","lib/index.d.ts","types/index.d.ts",`types/${e.split("/").pop()?.replace(/^@/,"")||e}.d.ts`]}function _h(e){if(/\.d\.(c|m)?ts$/.test(e))return[e,e.replace(/\.d\.(c|m)?ts$/,".d.ts")];let t=e.replace(/\.(c|m)?[jt]s$/,"").replace(/\/$/,""),n=[`${t}.d.ts`,`${t}.d.cts`,`${t}.d.mts`,`${t}/index.d.ts`];return/\.(c|m)?js$/.test(e)||n.push(e),n}function kO(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=(n,i)=>{if(i>6||!n)return null;if(typeof n=="string")return i>0?n:null;if(typeof n!="object")return null;let r=n,o=r.types??r.typings;if(typeof o=="string")return o;let s=[".","import","require","default","node"];for(let a of[...s,...Object.keys(r)]){if(!(a in r))continue;let c=t(r[a],i+1);if(c)return c}return null};return t(e,0)}async function uO(e,t,n,i){let r=n.startsWith("@types:")?BAe(n):null,o=r?`${r.name}@${r.range}`:`${e}@${t}`,s=r?r.subpath?`${r.subpath}.d.ts`:"index.d.ts":n,a=r?null:i?new Set(i.files.keys()):await JY(e,t),c=0,l=[],u=new Set,d=[[s]],p=async g=>{let h=a?g.find(b=>a.has(b))??null:void 0;for(let b of h===void 0?g:h?[h]:[]){let y;if(i){let w=i.files.get(b);if(!w||w.size>EY-c)return null;let k=w.read();if(c+=k.length,c>EY)return null;y=k.toString("utf8")}else y=await rt(`${vO}/${o}/${b}`,{retries:0});if(y)return{path:b,content:y}}return null},f=!1;for(;d.length>0&&l.length0&&g.length+l.length!u.has(y));for(let y of b)u.add(y);b.length>0&&g.push(b)}if(g.length===0)continue;let h=await Bn(g,WAe,b=>p(b));for(let b of h)if(b&&l.length>=X_&&(f=!0),!(!b||l.length>=X_)){l.push(b);for(let y of KAe(b.content))d.push(dO(b.path,y));for(let y of ZAe(b.content))d.push(dO(b.path,y));for(let y of HAe(b.content))d.push(dO(b.path,y))}}return d.some(g=>g.some(h=>!u.has(h)))&&(f=!0),{sources:l,truncated:f}}var WAe=8,X_=Number(process.env.DRIFT_MAX_DECLARATION_FILES)||150;function KAe(e){let t=new Set,n=/\bexport\b\s*(?:type\b\s*)?(?:\*(?:\s+as\s+\w+)?|\{[^}]*\})\s*from\s*['"](\.[^'"]+)['"]/g;for(let r of e.matchAll(n))t.add(r[1]);let i=/\bimport\s+[A-Za-z_$][\w$]*\s*=\s*require\((['"])(\.[^'"]+)\1\)/g;for(let r of e.matchAll(i))t.add(r[2]);return[...t]}function HAe(e){if(!/\bexport\b\s*\{[^}]*\}(?!\s*from)/.test(e))return[];let t=new Set,n=/\bimport\b[^'"]*?\bfrom\s*['"](\.[^'"]+)['"]/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function JAe(e,t){if(!t)return[];let n=new Set([t,t.replace(/^@types\//,"")]),i=[],r=/\bdeclare\s+module\s+['"]([^'"]+)['"]\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=o[1];(n.has(c)||[...n].some(l=>c.startsWith(`${l}/`)))&&i.push(e.slice(s+1,a)),r.lastIndex=a+1}return i}function ZAe(e){let t=new Set,n=/\/\/\/\s*/g;for(let i of e.matchAll(n))t.add(i[1]);return[...t]}function dO(e,t){let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",r=il(n?`${n}/${t}`:t).replace(/\.(d\.(c|m)?ts|(c|m)?js|(c|m)?ts)$/,"");return[`${r}.d.ts`,`${r}.d.cts`,`${r}.d.mts`,`${r}/index.d.ts`,`${r}/index.d.cts`]}function il(e){let t=[];for(let n of e.replace(/^\.\//,"").split("/"))!n||n==="."||(n===".."?t.pop():t.push(n));return t.join("/")}async function o$(e,t,n){let i=await wO(e,t,[n]);return i!==void 0?i!==null:await rt(`${vO}/${e}@${t}/${n}`,{retries:0})!==null}function YAe(e,t,n=new Map,i=[],r){let o=new Map,s=(c,l)=>{let u=c.get(l.name);u&&u.kind===l.kind?(u.signature=`${u.signature} | ${l.signature}`,u.members=[...new Set([...u.members,...l.members])],u.requiredMembers=[...new Set([...u.requiredMembers,...l.requiredMembers])]):u||c.set(l.name,l)},a=$O(e);for(let c of OY(a))s(o,c.entry),c.exported&&s(n,c.entry);for(let c of JAe(a,r)){for(let l of OY(c))s(n,l.entry);DY(c,o,n,{override:!0})}return QAe(a,o),XAe(a,n),e0e(a,o,n,i),DY(a,o,n),r0e(a,o,n),YY(n,o),n}function YY(e,t){let n=r=>e.get(r)??t?.get(r),i=(r,o)=>{if(!(!r.extends||o.has(r.name))){o.add(r.name);for(let s of r.extends){let a=n(s);!a||a===r||(i(a,o),r.members=[...new Set([...r.members,...a.members])],r.requiredMembers=[...new Set([...r.requiredMembers,...a.requiredMembers])])}}};for(let r of e.values())i(r,new Set)}function QAe(e,t){let n=i=>{t.has(i)||t.set(i,{name:i,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})};for(let i of e.matchAll(/\bimport\s+\*\s+as\s+([A-Za-z_$][\w$]*)\s+from\s+['"][^'"]+['"]/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?:type\s+)?\{([^}]+)\}\s+from\s+['"][^'"]+['"]/g))for(let{exported:r}of SO(i[1]??""))n(r);for(let i of e.matchAll(/\bimport\s+([A-Za-z_$][\w$]*)\s*=\s*require\(['"][^'"]+['"]\)/g))n(i[1]);for(let i of e.matchAll(/\bimport\s+(?!type\s)([A-Za-z_$][\w$]*)\s*(?:,\s*\{[^}]*\})?\s+from\s+['"][^'"]+['"]/g))n(i[1])}function XAe(e,t){let n=/\bexport\b\s*(?:type\b\s*)?\*\s+as\s+([A-Za-z_$][\w$]*)\s*from\s*['"][^'"]+['"]/g;for(let i of e.matchAll(n)){let r=i[1];t.has(r)||t.set(r,{name:r,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0})}}function e0e(e,t,n,i){let r=/\bexport\b\s*(?:type\b\s*)?\{([^}]+)\}(?:\s*from\s*['"][^'"]+['"])?\s*;/g;for(let o of e.matchAll(r))for(let{exported:s,local:a}of SO(o[1]??"")){if(n.has(s))continue;let c=t.get(a);c?n.set(s,$h(c,s)):i.push({exported:s,local:a})}}function t0e(e,t){for(let n of t){if(e.has(n.exported))continue;let i=e.get(n.local);i&&e.set(n.exported,$h(i,n.exported))}}function DY(e,t,n,i={}){for(let r of e.matchAll(/\bexport\s*=\s*([A-Za-z_$][\w$.]*)\s*(?:;|$)/gm))QY("default",r[1],t,n,i.override),n0e("default",r[1],t,n,i.override)}function n0e(e,t,n,i,r=!1){let o=i.get(e);if(!o||o.members.length>0&&!r)return;let s=n.get(t);if(!s)return;let a=s.signature.replace(/\s*\bexport\s*=[\s\S]*$/,"").replace(/\s*\}\s*$/,"").trim(),c=/:\s*([A-Za-z_$][\w$.]*)\s*;?\s*$/.exec(a)?.[1],l=c?n.get(c):void 0;l&&(o.members=[...l.members],o.requiredMembers=[...l.requiredMembers])}function QY(e,t,n,i,r=!1){let o=n.get(t);o&&(r||!i.has(e))&&i.set(e,$h(o,e));for(let s of n.values()){if(!s.name.startsWith(`${t}.`))continue;let a=`${e}.${s.name.slice(t.length+1)}`;(r||!i.has(a))&&i.set(a,$h(s,a))}}function r0e(e,t,n){for(let i of e.matchAll(/\bexport\s+default\s+(?:abstract\s+)?(?:class|function|enum|const|let|var)?\s*([A-Za-z_$][\w$]*)/g)){let r=i[1];t.has(r)&&QY("default",r,t,n)}}function $h(e,t){return{...e,name:t,signature:e.signature.replace(new RegExp(`\\b${a$(e.name)}\\b`,"g"),t)}}function a$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Sh(e){return e.replace(/\/\*(?:[^*]|\*(?!\/))*\*\//g,"").replace(/\/\/[^\n]*/g,"").replace(/\s+/g," ").trim()}function OY(e){let t=[];for(let n of e8(e))t.push({exported:n.exported,entry:{name:n.name,kind:"function",signature:Sh(e.slice(n.start,To(e,n.start))),members:[],requiredMembers:[]}});return MY(e,/\b(export\s+)?(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g,"variable",t),c0e(e,t),MY(e,/\b(export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g,"type",t),pO(e,/\b(export\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"class",t),pO(e,/\b(export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"interface",t),pO(e,/\b(export\s+)?(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)(?![\w$])[^{;]*\{/g,"enum",t),XY(e,"",!1,t),t}function XY(e,t,n,i){let r=/\b(export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\{/g;for(let o=r.exec(e);o;o=r.exec(e)){let s=e.indexOf("{",o.index),a=ls(e,s);if(s<0||a<0)continue;let c=n||!!o[1],l=t?`${t}.${o[2]}`:o[2],u=e.slice(s+1,a);i.push({exported:c,entry:{name:l,kind:"namespace",signature:`namespace ${l}`,members:s0e(u),requiredMembers:[]}}),o0e(u,l,c,i),XY(u,l,c,i),i0e(u,l,c,i),r.lastIndex=a+1}}function i0e(e,t,n,i){let r=_O(e);for(let o of r.matchAll(/\bexport\b\s*\{([^}]+)\}\s*;?/g))for(let{exported:s}of SO(o[1]??""))i.push({exported:n,entry:{name:`${t}.${s}`,kind:"namespace",signature:"",members:[],requiredMembers:[],shapeUnknown:!0}})}function o0e(e,t,n,i){let r=_O(e),o=(s,a,c,l=[],u=[])=>{i.push({exported:n,entry:{name:`${t}.${s}`,kind:a,signature:Sh(c.replace(new RegExp(`\\b${a$(s)}\\b`),`${t}.${s}`)),members:l,requiredMembers:u}})};for(let s of e8(r))o(s.name,"function",r.slice(s.start,To(r,s.start)));for(let s of r.matchAll(/\b(?:declare\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"variable",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)\b/g)){let a=s.index??0;o(s[1],"type",r.slice(a,To(r,a)))}for(let s of r.matchAll(/\b(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=s$(u,!0);o(s[1],"class",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"",d=s$(u,!1);o(s[1],"interface",r.slice(a,c>=0?c:To(r,a)),d.map(p=>p.name),d.filter(p=>p.required).map(p=>p.name))}for(let s of r.matchAll(/\b(?:declare\s+)?enum\s+([A-Za-z_$][\w$]*)[^{;]*\{/g)){let a=s.index??0,c=r.indexOf("{",a),l=ls(r,c),u=c>=0&&l>c?r.slice(c+1,l):"";o(s[1],"enum",r.slice(a,c>=0?c:To(r,a)),r8(u).map(d=>d.name))}}function _O(e){let t=[],n=/\b(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\s*\{/g;for(let r of e.matchAll(n)){let o=e.indexOf("{",r.index),s=ls(e,o);o>=0&&s>=0&&t.push([r.index??0,s+1])}if(t.length===0)return e;let i=[...e];for(let[r,o]of t)for(let s=r;s"){if(e[i-1]==="=")continue;if(n-=1,n===0)return i}else if(r==="("&&n===0)return-1}return-1}function $O(e){let t="",n=0;for(;nl.name),requiredMembers:a.filter(l=>l.required).map(l=>l.name)}})}}}function nAe(e){let t=/^\s*(?:export\s+)?(?:declare\s+)?(?:const|let|var)\s+/.exec(e);if(!t)return[];let n=0,i=0,r=0,o=0,s=[],a="";for(let c=t[0].length;c"&&e[c-1]!=="=")o=Math.max(0,o-1);else if(l==="{")r+=1;else if(l==="}")r-=1;else if(n<=0&&i<=0&&r<=0&&o<=0){if(l===","){s.push(a),a="";continue}if(l===";")break}a+=l}return s.push(a),s.slice(1).filter(c=>c.trim()!=="")}function R8(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=To(e,o),a=e.slice(o,s),c=n==="type"?rAe(a):n==="variable"?J8(a):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:yh(a),members:c.map(l=>l.name),requiredMembers:c.filter(l=>l.required).map(l=>l.name)}})}}function rAe(e){return Z8(e,"=")}function J8(e){return Z8(e,":")}function Z8(e,t){let n=e.indexOf(t);if(n<0)return[];let i=e.slice(n+1),r=i.indexOf("{");if(r<0||i.slice(0,r).trim()!=="")return[];let o=ls(i,r);return o<0?[]:i.slice(o+1).replace(/;\s*$/,"").trim()!==""?[]:X$(i.slice(r+1,o),!1)}function iO(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=e.indexOf("{",o),a=ls(e,s),c=a>=0?a+1:To(e,o),l=s>=0&&a>s?e.slice(s+1,a):"",u=n==="enum"?Y8(l):X$(l,n==="class"),d=s>=0?iAe(e.slice(o,s)):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:yh(e.slice(o,s>=0?s:c)),members:u.map(p=>p.name),requiredMembers:u.filter(p=>p.required).map(p=>p.name),...d.length>0?{extends:d}:{}}})}}function iAe(e){let t=/\b(?:extends|implements)\s+([\s\S]+)$/.exec(e);return t?bh(t[1]).map(n=>/^\s*([A-Za-z_$][\w$]*)/.exec(n.replace(/\bimplements\b/g,","))?.[1]).filter(n=>!!n):[]}function To(e,t){let n=0,i=0,r=0,o=0;for(let s=t;s"&&e[s-1]!=="=")o=Math.max(0,o-1);else if(a==="{"){if(n===0&&i===0&&r===0&&o===0){let c=ls(e,s);return c>=0?c+1:e.length}r+=1}else if(a==="}")r-=1;else if(a===";"&&n<=0&&i<=0&&r<=0&&o<=0)return s+1}return e.length}function ls(e,t){if(t<0)return-1;let n=0;for(let i=t;i/^[\s\n]*([A-Za-z_$][\w$]*)/.exec(t)?.[1]).filter(t=>!!t).map(t=>({name:t,required:!1}))}function X$(e,t){let n=[],i=/(?:^|[;\n])\s*((?:public|protected|private|readonly|static|abstract|declare|override)\s+)*(#?[A-Za-z_$][\w$]*)(\?)?\s*(\(|:|<)/g;for(let r of e.matchAll(i)){let o=r[1]??"",s=r[2];s==="constructor"||o.includes("private")||s.startsWith("#")||n.push({name:s,required:t?r[4]===":"&&!r[3]:!r[3]})}return n}function hO(e){let t=[];for(let n of e.split(",")){let i=n.replace(/\btype\s+/g,"").trim();if(!i)continue;let[r,o]=i.split(/\s+as\s+/).map(s=>s.trim());r&&t.push({local:r,exported:o||r})}return t}function oAe(e,t){let n=r=>r==="variable"||r==="function";if(n(e)&&n(t))return!0;let i=r=>r==="interface"||r==="type";return i(e)&&i(t)}function Q8(e,t,n){if(t.api.size<20)return null;let r=0;for(let a of t.api.keys())n.api.has(a)&&(r+=1);if(r>t.api.size*.1||n.api.size>t.api.size*.1)return null;let o=n.subpaths.filter(a=>a!=="."),s=o.length>0?` The new version publishes ${o.length} other entry point${o.length===1?"":"s"}: ${o.join(", ")}. Import from the one that carries the API you use, rather than replacing the symbols individually.`:" Nothing in the new version publishes the old symbols under the old import path.";return{kind:"entry-point-moved",symbol:e,detail:`Importing \`${e}\` no longer gives you its API: the root entry point went from ${t.api.size} exported symbols to ${n.api.size}.${s}`,before:`${t.entryPath} \u2014 ${t.api.size} exports`,after:`${n.entryPath} \u2014 ${n.api.size} exports`}}function sAe(e,t,n){if(e.shapeUnknown||t.length===0)return null;let i=a=>/^[A-Za-z_$][\w$]*$/.test(Z$(a.name))&&!/[#/]/.test(a.name),r=Z$(e.name);if(r.length<3||!/^[A-Za-z_$][\w$]*$/.test(r))return null;let o=t.filter(a=>i(a)&&a.kind===e.kind&&N8(e)&&N8(a)&&C8(e.signature,e.name)===C8(a.signature,a.name)&&aAe(e,a));if(o.length===1)return o[0];let s=(n??"").replace(/^@[^/]+\//,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase();if(s){let a=t.filter(c=>{if(!i(c))return!1;let l=Z$(c.name).toLowerCase();return l===`${s}${r.toLowerCase()}`||l===`${r.toLowerCase()}${s}`});if(a.length===1)return a[0]}return null}function N8(e){let t=e.signature??"";return t.includes("(")&&t.replace(/\s+/g,"").length>=20?!0:e.members.length>=2}function aAe(e,t){if(e.members.length===0&&t.members.length===0)return!0;let n=[...e.members].sort().join(","),i=[...t.members].sort().join(",");return n===i}function Z$(e){return e.split(".").pop()??e}function C8(e,t){let n=Z$(t);return e.replace(new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"g"),"\0").replace(/\s+/g," ").trim()}function Dr(e,t,n={}){let i=[],r=[...t.entries()].filter(([o])=>!e.has(o)).map(([,o])=>o);for(let[o,s]of e){let a=t.get(o),c=s.name,l=s.via?` (declared in ${s.via})`:"";if(!a){if(n.afterComplete===!1&&s.via)continue;let g=sAe(s,r,n.packageName);i.push({kind:"export-removed",symbol:c,detail:s.shapeUnknown?`\`${c}\` is no longer exported${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`:`\`${c}\` is no longer exported (was ${Eo(s.kind)})${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`,before:s.signature,...g?{after:g.signature,replacement:g.name}:{},...s.shapeUnknown?{}:{fromKind:s.kind}});continue}if(s.shapeUnknown||a.shapeUnknown)continue;if(s.kind!==a.kind&&!oAe(s.kind,a.kind)){i.push({kind:"kind-changed",symbol:c,detail:`\`${c}\` changed from ${Eo(s.kind)} to ${Eo(a.kind)}${l}.`,before:s.signature,after:a.signature,fromKind:s.kind,toKind:a.kind});continue}for(let g of s.members)if(!a.members.includes(g))i.push({kind:"member-removed",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` was removed${l}.`});else{let h=s.memberSignatures?.[g],b=a.memberSignatures?.[g];h&&b&&h!==b&&i.push({kind:"signature-changed",symbol:`${c}.${g}`,detail:`The signature of \`${c}.${g}\` changed${l}.`,before:h,after:b})}let u=new Set(s.requiredMembers);for(let g of a.requiredMembers)!u.has(g)&&s.members.includes(g)&&i.push({kind:"member-now-required",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` is now required; it was previously optional${l}.`});let[d,p]=tY(s.signature,a.signature),f=!!(s.callable&&a.callable);(f?!uAe(s.callable,a.callable):d!==p&&s.kind!=="interface"&&s.kind!=="class"&&!vAe(d,p)&&!lAe(d,p))&&i.push({kind:"signature-changed",symbol:c,detail:`The signature of \`${c}\` changed${l}.`,before:s.signature,after:a.signature,...f?{changed:"parameters"}:cAe(d,p)??{}})}return i}function cAe(e,t){let n=rl(e),i=rl(t);if(!n||!i)return null;let r=!il(n.returns,i.returns),o=n.parameters.length!==i.parameters.length||n.parameters.some((s,a)=>{let c=i.parameters[a];return!c||s.optional!==c.optional||s.rest!==c.rest||!il(s.type,c.type)});return r&&o?{changed:"both"}:r?{changed:"return-type"}:o?{changed:"parameters"}:null}function lAe(e,t){if(e.includes(" | declare ")||t.includes(" | declare ")||e.includes(" | export ")||t.includes(" | export "))return!1;let n=rl(e),i=rl(t);if(!n||!i||!il(n.returns,i.returns)||i.parameters.lengthr.optional||r.rest)}function uAe(e,t){let n=p=>p.parameters.filter(f=>f.kind==="positional-only"||f.kind==="positional-or-keyword"),i=(p,f)=>p.parameters.some(m=>m.kind===f),r=p=>p.parameters.filter(f=>f.kind==="positional-or-keyword"||f.kind==="keyword-only"),o=(p,f)=>p.parameters.find(m=>m.name===f),s=n(e),a=n(t),c=s.filter(p=>p.required).length,l=a.filter(p=>p.required).length,u=i(e,"var-positional")?1/0:s.length,d=i(t,"var-positional")?1/0:a.length;if(l>c||dc!==null),s=uO(r).map(rl).filter(c=>c!==null);if(o.length===0||s.length===0)return!1;let a=o.filter(c=>lO(c,n));return a.length===0?!1:a.every(c=>s.some(l=>{if(!lO(l,n)||!il(c.returns,l.returns))return!1;for(let u=0;ui!==null);return n.length===0?!1:!n.some(i=>lO(i,t))}function lO(e,t){let n=e.parameters.filter(i=>!i.optional&&!i.rest).length;return ti.rest)||t<=e.parameters.length}function uO(e){return e.split(/ \| (?=(?:export\s+)?declare\b)/).map(t=>t.trim()).filter(Boolean)}function rl(e){let t=dAe(e);if(t<0)return null;let n=pAe(e,t);if(n<0)return null;let i=e.slice(t+1,n),r=e.slice(n+1).trim(),o=/^(?:=>|:)\s*([\s\S]*?)\s*;?$/.exec(r)?.[1];if(o===void 0)return null;let s=[];for(let a of bh(i)){let c=a.trim();if(!c)continue;let l=/^(\.\.\.)?\s*(?:readonly\s+)?([A-Za-z_$][\w$]*|\{[\s\S]*?\}|\[[\s\S]*?\])\s*(\?)?\s*:\s*([\s\S]+)$/.exec(c);if(!l)return null;s.push({rest:!!l[1],optional:!!l[3]||!!l[1],type:l[4]})}return{parameters:s,returns:o}}function dAe(e){let t=0;for(let n=0;n"&&e[n-1]!=="=")t-=1;else if(i==="("&&t<=0)return n}return-1}function pAe(e,t){let n=0;for(let i=t;i=fAe)return!1;let i=e.trim(),r=t.trim(),o=[O8(i),O8(r)];return o[0]&&o[1]?il(o[0].check,o[1].check)&&Jd(o[0].whenTrue,o[1].whenTrue,n+1)&&Jd(o[0].whenFalse,o[1].whenFalse,n+1):H$(i,"{","}")&&H$(r,"{","}")?mAe(i,r,n):H$(i,"[","]")&&H$(r,"[","]")?gAe(i,r,n):!1}var fAe=6;function mAe(e,t,n){let i=P8(e),r=P8(t);if(!i||!r)return!1;for(let[o,s]of i){let a=r.get(o);if(!a||s.optional&&!a.optional||!Jd(s.type,a.type,n+1))return!1}for(let[o,s]of r)if(!i.has(o)&&!s.optional)return!1;return!0}function gAe(e,t,n){let i=D8(e),r=D8(t);if(!i||!r||r.lengtho.optional||o.rest)}function P8(e){let t=new Map;for(let n of yAe(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(?:readonly\s+)?(?:'([^']+)'|"([^"]+)"|([A-Za-z_$][\w$]*))\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(!r)return null;let o=r[1]??r[2]??r[3];t.set(o,{optional:!!r[4],type:r[5].trim()})}return t}function D8(e){let t=[];for(let n of bh(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(\.\.\.)?\s*([A-Za-z_$][\w$]*)\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(r){t.push({rest:!!r[1],optional:!!r[3]||!!r[1],type:r[4].trim()});continue}let o=/^(\.\.\.)?\s*([\s\S]+?)(\?)?$/.exec(i);if(!o)return null;t.push({rest:!!o[1],optional:!!o[3]||!!o[1],type:o[2].trim()})}return t}function O8(e){let t=0;for(let n=0;n)]}".includes(i))i===">"&&e[n-1]==="="||(t-=1);else if(i==="?"&&t===0){let r=e.slice(0,n);if(!/\bextends\b/.test(r))return null;let o=hAe(e,n+1);return o===-1?null:{check:r.trim(),whenTrue:e.slice(n+1,o).trim(),whenFalse:e.slice(o+1).trim()}}}return null}function hAe(e,t){let n=0,i=0;for(let r=t;r)]}".includes(o))o===">"&&e[r-1]==="="||(n-=1);else if(n===0&&o==="?")i+=1;else if(n===0&&o===":"){if(i===0)return r;i-=1}}return-1}function yAe(e){return bh(e,";,")}function H$(e,t,n){if(!e.startsWith(t)||!e.endsWith(n))return!1;let i=0;for(let r=0;rn.some(o=>il(r,o)))}function M8(e){let t=[],n=0,i="";for(let r of e){if("<([{".includes(r)?n+=1:">)]}".includes(r)&&(n-=1),r==="|"&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t.map(r=>r.trim()).filter(Boolean)}function il(e,t){let n=i=>i.replace(/\s+/g,"").replace(/\|undefined$/,"");return n(e)===n(t)}function vAe(e,t){if(e===t)return!0;let n=U8(e);return n===U8(t)&&n!==null}function tY(e,t){let n=L8(e),i=L8(t);if(n.size===0&&i.size===0)return[e,t];for(let[r,o]of n){let s=i.get(r);if(s!==void 0&&s!==o)return[e,t]}return[F8(e),F8(t)]}function L8(e){let t=new Map,n=/\bimport\((["'])((?:(?!\1).)*)\1\)\.([A-Za-z_$][\w$]*)/g;for(let i of e.matchAll(n))t.set(i[3],i[2]);return t}function F8(e){return e.replace(/\bimport\((["'])(?:(?!\1).)*\1\)\./g,"")}function U8(e){let t=wAe(e);if(t.length===0)return null;let n=e;return t.forEach((i,r)=>{n=n.replace(new RegExp(`\\b${e_(i)}\\b`,"g"),`\0T${r}`)}),n}function wAe(e){let t=[];for(let n=0;n"&&(n-=1,n===0))return i;return-1}function bh(e,t=","){let n=[],i=0,r="";for(let o=0;o)]}".includes(s)&&(s===">"&&e[o-1]==="="||(i-=1)),t.includes(s)&&i===0){n.push(r),r="";continue}r+=s}return r.trim()&&n.push(r),n}var c_=require("node:fs/promises"),W9=require("node:os"),H9=require("node:path");var vh=require("node:fs/promises"),Zd=require("node:path");var yO=new Map;async function bO(e,t){if(!e.autoInstall)return!1;let n=yO.get(t.id);if(n)return n;let i=$Ae(e,t).finally(()=>{yO.delete(t.id)});return yO.set(t.id,i),i}async function $Ae(e,t){e.logger.info(`Installing ${t.label.replace(/^Install\s+/i,"")}...`);let n=await e.exec(t.command,t.args,{...e.env?{env:e.env}:{},timeoutMs:10*6e4});return n.code!==0?(e.logger.warn(`${t.label} failed: ${(n.stderr||n.stdout||"no output").trim()}`),!1):(e.logger.info(`${t.label.replace(/^Install\s+/i,"")} installed.`),!0)}function ne(e,t,n,i,r){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},...r?{install:r}:{},tool:e}}function t_(e,t){return new Promise(n=>{let i=setTimeout(()=>n({timedOut:!0}),Math.max(0,t));e.then(r=>{clearTimeout(i),n({timedOut:!1,value:r})},()=>{clearTimeout(i),n({timedOut:!0})})})}var _Ae=1,SAe=3,nY=750,lY=1,vO=0,rY=[];async function xAe(){vO<_Ae?vO+=1:await new Promise(t=>rY.push(t));let e=!1;return()=>{if(e)return;e=!0;let t=rY.shift();t?t():vO-=1}}function EAe(e){return/waiting for file lock on (?:package cache|build directory|the registry index)/i.test(e)?!/error\[E\d+\]|could not compile|error: could not|linking with|error: linker|failed to run custom build|toolchain '[^']*' is not installed/i.test(e):!1}var iY=/^(?:Updating|Downloading|Downloaded|Compiling|Compiled|Checking|Blocking)\b/i;function oY(e){let t=e.replace(/\u001b\[[0-9;]*m/g,"").split(` -`).map(r=>r.trim()).filter(Boolean),n=r=>/error\[E\d+\]/i.test(r)?100:/requires rustc\b/i.test(r)?95:/failed to select a version|no matching package/i.test(r)?90:/failed to run custom build command|failed custom build/i.test(r)?85:/linking with .* failed|linker .* (?:failed|not found)|cannot find -l/i.test(r)?80:/missing (?:required )?feature|feature .* (?:is not enabled|does not exist|not found)/i.test(r)?75:/could not compile/i.test(r)?70:/^error:/i.test(r)?60:0,i=null;for(let[r,o]of t.entries()){let s=n(o);s>(i?.score??0)&&(i={line:o,score:s,index:r})}if(i){let r=t.slice(i.index+1).find(o=>!iY.test(o)&&n(o)>0&&o!==i.line);return r?`${i.line} -${r}`:i.line}return t.find(r=>!iY.test(r))??t[0]??"unknown Cargo failure"}var TAe=e=>new Promise(t=>setTimeout(t,e)),Io="cargo public-api",IAe="Install Rust and Cargo with rustup, or make sure `cargo` is on PATH.",sY={id:"cargo-public-api",label:"Install cargo-public-api",command:"cargo",args:["install","cargo-public-api","--locked"]},AAe="Drift can install the missing `cargo-public-api` helper for you after approval.",wO={id:"rustup-nightly",label:"Install the Rust nightly toolchain",command:"rustup",args:["toolchain","install","nightly","--profile","minimal"]},uY="Drift can install the Rust nightly toolchain for you after approval, or run `rustup toolchain install nightly` yourself.",dY={ecosystem:"cargo",tool:Io,weight:1,async compute(e){let t=e.workdir,n=(g,h)=>OAe(e.exec,g,h,e.env,t),i=(g,h)=>DAe(e.exec,g,h,e.env,t),r=await n("cargo",["--version"]);if(r===null)return ne(Io,"tool-missing",`The Rust Cargo toolchain is not installed or is not on PATH, so ${e.name}'s public API could not be compared directly.`,IAe);let o=await n("cargo",["public-api","--version"]);if(o===null&&!(await bO(e,sY)&&(o=await n("cargo",["public-api","--version"]))!==null))return ne(Io,"tool-missing",`Rust and Cargo are installed, but Drift's Rust API helper is missing. ${e.name}'s public API could not be compared directly.`,AAe,sY);let s=/^cargo 1\b/.test(r)&&!/nightly/.test(r),a=/nightly/.test(r),c=null,l="nightly";if(a)l="active",c=await n("rustc",["--version"]);else if(s&&await i("rustup",["--version"])&&(c=await n("rustup",["run","nightly","rustc","--version"]),c===null&&!(await bO(e,wO)&&(c=await n("rustup",["run","nightly","rustc","--version"]))!==null)))return ne(Io,"tool-missing",`\`cargo public-api\` needs the Rust nightly toolchain to read rustdoc's JSON output, and it is not installed. ${e.name}'s public API could not be compared directly.`,uY,wO);let u=o===null||c===null?null:[`cpa=${o}`,`${l}=${c}`,`parser=${lY}`].join("|"),d=aY(e,e.from,u),p=aY(e,e.to,u);p.catch(()=>{});let f=await d;if(!f.ok)return f.failure;let m=await p;return m.ok?{available:!0,changes:Dr(f.api,m.api),tool:Io,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (rustdoc JSON)`}:m.failure}};async function aY(e,t,n){let i=(0,Zd.join)(e.workdir,`probe-${t}`),r=n===null?null:`rust-surface:v${lY}:${e.name}@${t}#${n}`;if(r){let d=await Na(r);if(d&&d.length>0)return{ok:!0,api:new Map(d)}}try{await(0,vh.mkdir)((0,Zd.join)(i,"src"),{recursive:!0}),await(0,vh.writeFile)((0,Zd.join)(i,"Cargo.toml"),RAe(e.name,t),"utf8"),await(0,vh.writeFile)((0,Zd.join)(i,"src","lib.rs"),"","utf8")}catch(d){return{ok:!1,failure:ne(Io,"toolchain-failed",`Could not prepare a scratch crate: ${d.message}`)}}let s={...e.env??process.env,CARGO_TARGET_DIR:(0,Zd.join)(i,"target")},a=Date.now()+e.timeoutMs,c=()=>({ok:!1,failure:ne(Io,"toolchain-failed",`\`cargo public-api\` on ${e.name} ${t} ran out of time waiting for the Cargo package-cache lock.`)}),l;for(let d=0;;d+=1){if(a-Date.now()<=0)return c();let p=await xAe(),f=!1;try{let m=a-Date.now();if(m<=0)return p(),f=!0,c();l=await e.exec("cargo",["public-api","--simplified","--package",e.name],{cwd:i,timeoutMs:m,env:s})}finally{f||p()}if(l.code===0)break;if(dl.name),requiredMembers:a.filter(l=>l.required).map(l=>l.name)}})}}}function l0e(e){let t=/^\s*(?:export\s+)?(?:declare\s+)?(?:const|let|var)\s+/.exec(e);if(!t)return[];let n=0,i=0,r=0,o=0,s=[],a="";for(let c=t[0].length;c"&&e[c-1]!=="=")o=Math.max(0,o-1);else if(l==="{")r+=1;else if(l==="}")r-=1;else if(n<=0&&i<=0&&r<=0&&o<=0){if(l===","){s.push(a),a="";continue}if(l===";")break}a+=l}return s.push(a),s.slice(1).filter(c=>c.trim()!=="")}function MY(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=To(e,o),a=e.slice(o,s),c=n==="type"?u0e(a):n==="variable"?t8(a):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:Sh(a),members:c.map(l=>l.name),requiredMembers:c.filter(l=>l.required).map(l=>l.name)}})}}function u0e(e){return n8(e,"=")}function t8(e){return n8(e,":")}function n8(e,t){let n=e.indexOf(t);if(n<0)return[];let i=e.slice(n+1),r=i.indexOf("{");if(r<0||i.slice(0,r).trim()!=="")return[];let o=ls(i,r);return o<0?[]:i.slice(o+1).replace(/;\s*$/,"").trim()!==""?[]:s$(i.slice(r+1,o),!1)}function pO(e,t,n,i){for(let r of e.matchAll(t)){let o=r.index??0,s=e.indexOf("{",o),a=ls(e,s),c=a>=0?a+1:To(e,o),l=s>=0&&a>s?e.slice(s+1,a):"",u=n==="enum"?r8(l):s$(l,n==="class"),d=s>=0?d0e(e.slice(o,s)):[];i.push({exported:!!r[1],entry:{name:r[2],kind:n,signature:Sh(e.slice(o,s>=0?s:c)),members:u.map(p=>p.name),requiredMembers:u.filter(p=>p.required).map(p=>p.name),...d.length>0?{extends:d}:{}}})}}function d0e(e){let t=/\b(?:extends|implements)\s+([\s\S]+)$/.exec(e);return t?xh(t[1]).map(n=>/^\s*([A-Za-z_$][\w$]*)/.exec(n.replace(/\bimplements\b/g,","))?.[1]).filter(n=>!!n):[]}function To(e,t){let n=0,i=0,r=0,o=0;for(let s=t;s"&&e[s-1]!=="=")o=Math.max(0,o-1);else if(a==="{"){if(n===0&&i===0&&r===0&&o===0){let c=ls(e,s);return c>=0?c+1:e.length}r+=1}else if(a==="}")r-=1;else if(a===";"&&n<=0&&i<=0&&r<=0&&o<=0)return s+1}return e.length}function ls(e,t){if(t<0)return-1;let n=0;for(let i=t;i/^[\s\n]*([A-Za-z_$][\w$]*)/.exec(t)?.[1]).filter(t=>!!t).map(t=>({name:t,required:!1}))}function s$(e,t){let n=[],i=/(?:^|[;\n])\s*((?:public|protected|private|readonly|static|abstract|declare|override)\s+)*(#?[A-Za-z_$][\w$]*)(\?)?\s*(\(|:|<)/g;for(let r of e.matchAll(i)){let o=r[1]??"",s=r[2];s==="constructor"||o.includes("private")||s.startsWith("#")||n.push({name:s,required:t?r[4]===":"&&!r[3]:!r[3]})}return n}function SO(e){let t=[];for(let n of e.split(",")){let i=n.replace(/\btype\s+/g,"").trim();if(!i)continue;let[r,o]=i.split(/\s+as\s+/).map(s=>s.trim());r&&t.push({local:r,exported:o||r})}return t}function p0e(e,t){let n=r=>r==="variable"||r==="function";if(n(e)&&n(t))return!0;let i=r=>r==="interface"||r==="type";return i(e)&&i(t)}function i8(e,t,n){if(t.api.size<20)return null;let r=0;for(let a of t.api.keys())n.api.has(a)&&(r+=1);if(r>t.api.size*.1||n.api.size>t.api.size*.1)return null;let o=n.subpaths.filter(a=>a!=="."),s=o.length>0?` The new version publishes ${o.length} other entry point${o.length===1?"":"s"}: ${o.join(", ")}. Import from the one that carries the API you use, rather than replacing the symbols individually.`:" Nothing in the new version publishes the old symbols under the old import path.";return{kind:"entry-point-moved",symbol:e,detail:`Importing \`${e}\` no longer gives you its API: the root entry point went from ${t.api.size} exported symbols to ${n.api.size}.${s}`,before:`${t.entryPath} \u2014 ${t.api.size} exports`,after:`${n.entryPath} \u2014 ${n.api.size} exports`}}function f0e(e,t,n){if(e.shapeUnknown||t.length===0)return null;let i=a=>/^[A-Za-z_$][\w$]*$/.test(r$(a.name))&&!/[#/]/.test(a.name),r=r$(e.name);if(r.length<3||!/^[A-Za-z_$][\w$]*$/.test(r))return null;let o=t.filter(a=>i(a)&&a.kind===e.kind&&LY(e)&&LY(a)&&FY(e.signature,e.name)===FY(a.signature,a.name)&&m0e(e,a));if(o.length===1)return o[0];let s=(n??"").replace(/^@[^/]+\//,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase();if(s){let a=t.filter(c=>{if(!i(c))return!1;let l=r$(c.name).toLowerCase();return l===`${s}${r.toLowerCase()}`||l===`${r.toLowerCase()}${s}`});if(a.length===1)return a[0]}return null}function LY(e){let t=e.signature??"";return t.includes("(")&&t.replace(/\s+/g,"").length>=20?!0:e.members.length>=2}function m0e(e,t){if(e.members.length===0&&t.members.length===0)return!0;let n=[...e.members].sort().join(","),i=[...t.members].sort().join(",");return n===i}function r$(e){return e.split(".").pop()??e}function FY(e,t){let n=r$(t);return e.replace(new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"g"),"\0").replace(/\s+/g," ").trim()}function Pr(e,t,n={}){let i=[],r=[...t.entries()].filter(([o])=>!e.has(o)).map(([,o])=>o);for(let[o,s]of e){let a=t.get(o),c=s.name,l=s.via?` (declared in ${s.via})`:"";if(!a){if(n.afterComplete===!1&&s.via)continue;let g=f0e(s,r,n.packageName);i.push({kind:"export-removed",symbol:c,detail:s.shapeUnknown?`\`${c}\` is no longer exported${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`:`\`${c}\` is no longer exported (was ${Eo(s.kind)})${l}.${g?` The new version exports \`${g.name}\` in its place.`:""}`,before:s.signature,...g?{after:g.signature,replacement:g.name}:{},...s.shapeUnknown?{}:{fromKind:s.kind}});continue}if(s.shapeUnknown||a.shapeUnknown)continue;if(s.kind!==a.kind&&!p0e(s.kind,a.kind)){i.push({kind:"kind-changed",symbol:c,detail:`\`${c}\` changed from ${Eo(s.kind)} to ${Eo(a.kind)}${l}.`,before:s.signature,after:a.signature,fromKind:s.kind,toKind:a.kind});continue}for(let g of s.members)if(!a.members.includes(g))i.push({kind:"member-removed",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` was removed${l}.`});else{let h=s.memberSignatures?.[g],b=a.memberSignatures?.[g];h&&b&&h!==b&&i.push({kind:"signature-changed",symbol:`${c}.${g}`,detail:`The signature of \`${c}.${g}\` changed${l}.`,before:h,after:b})}let u=new Set(s.requiredMembers);for(let g of a.requiredMembers)!u.has(g)&&s.members.includes(g)&&i.push({kind:"member-now-required",symbol:`${c}.${g}`,detail:`\`${c}.${g}\` is now required; it was previously optional${l}.`});let[d,p]=a8(s.signature,a.signature),f=!!(s.callable&&a.callable);(f?!y0e(s.callable,a.callable):d!==p&&s.kind!=="interface"&&s.kind!=="class"&&!E0e(d,p)&&!h0e(d,p))&&i.push({kind:"signature-changed",symbol:c,detail:`The signature of \`${c}\` changed${l}.`,before:s.signature,after:a.signature,...f?{changed:"parameters"}:g0e(d,p)??{}})}return i}function g0e(e,t){let n=ol(e),i=ol(t);if(!n||!i)return null;let r=!sl(n.returns,i.returns),o=n.parameters.length!==i.parameters.length||n.parameters.some((s,a)=>{let c=i.parameters[a];return!c||s.optional!==c.optional||s.rest!==c.rest||!sl(s.type,c.type)});return r&&o?{changed:"both"}:r?{changed:"return-type"}:o?{changed:"parameters"}:null}function h0e(e,t){if(e.includes(" | declare ")||t.includes(" | declare ")||e.includes(" | export ")||t.includes(" | export "))return!1;let n=ol(e),i=ol(t);if(!n||!i||!sl(n.returns,i.returns)||i.parameters.lengthr.optional||r.rest)}function y0e(e,t){let n=p=>p.parameters.filter(f=>f.kind==="positional-only"||f.kind==="positional-or-keyword"),i=(p,f)=>p.parameters.some(m=>m.kind===f),r=p=>p.parameters.filter(f=>f.kind==="positional-or-keyword"||f.kind==="keyword-only"),o=(p,f)=>p.parameters.find(m=>m.name===f),s=n(e),a=n(t),c=s.filter(p=>p.required).length,l=a.filter(p=>p.required).length,u=i(e,"var-positional")?1/0:s.length,d=i(t,"var-positional")?1/0:a.length;if(l>c||dc!==null),s=bO(r).map(ol).filter(c=>c!==null);if(o.length===0||s.length===0)return!1;let a=o.filter(c=>yO(c,n));return a.length===0?!1:a.every(c=>s.some(l=>{if(!yO(l,n)||!sl(c.returns,l.returns))return!1;for(let u=0;ui!==null);return n.length===0?!1:!n.some(i=>yO(i,t))}function yO(e,t){let n=e.parameters.filter(i=>!i.optional&&!i.rest).length;return ti.rest)||t<=e.parameters.length}function bO(e){return e.split(/ \| (?=(?:export\s+)?declare\b)/).map(t=>t.trim()).filter(Boolean)}function ol(e){let t=b0e(e);if(t<0)return null;let n=v0e(e,t);if(n<0)return null;let i=e.slice(t+1,n),r=e.slice(n+1).trim(),o=/^(?:=>|:)\s*([\s\S]*?)\s*;?$/.exec(r)?.[1];if(o===void 0)return null;let s=[];for(let a of xh(i)){let c=a.trim();if(!c)continue;let l=/^(\.\.\.)?\s*(?:readonly\s+)?([A-Za-z_$][\w$]*|\{[\s\S]*?\}|\[[\s\S]*?\])\s*(\?)?\s*:\s*([\s\S]+)$/.exec(c);if(!l)return null;s.push({rest:!!l[1],optional:!!l[3]||!!l[1],type:l[4]})}return{parameters:s,returns:o}}function b0e(e){let t=0;for(let n=0;n"&&e[n-1]!=="=")t-=1;else if(i==="("&&t<=0)return n}return-1}function v0e(e,t){let n=0;for(let i=t;i=w0e)return!1;let i=e.trim(),r=t.trim(),o=[zY(i),zY(r)];return o[0]&&o[1]?sl(o[0].check,o[1].check)&&Zd(o[0].whenTrue,o[1].whenTrue,n+1)&&Zd(o[0].whenFalse,o[1].whenFalse,n+1):e$(i,"{","}")&&e$(r,"{","}")?k0e(i,r,n):e$(i,"[","]")&&e$(r,"[","]")?_0e(i,r,n):!1}var w0e=6;function k0e(e,t,n){let i=UY(e),r=UY(t);if(!i||!r)return!1;for(let[o,s]of i){let a=r.get(o);if(!a||s.optional&&!a.optional||!Zd(s.type,a.type,n+1))return!1}for(let[o,s]of r)if(!i.has(o)&&!s.optional)return!1;return!0}function _0e(e,t,n){let i=jY(e),r=jY(t);if(!i||!r||r.lengtho.optional||o.rest)}function UY(e){let t=new Map;for(let n of S0e(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(?:readonly\s+)?(?:'([^']+)'|"([^"]+)"|([A-Za-z_$][\w$]*))\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(!r)return null;let o=r[1]??r[2]??r[3];t.set(o,{optional:!!r[4],type:r[5].trim()})}return t}function jY(e){let t=[];for(let n of xh(e.trim().slice(1,-1))){let i=n.trim();if(!i)continue;let r=/^(\.\.\.)?\s*([A-Za-z_$][\w$]*)\s*(\?)?\s*:\s*([\s\S]+)$/.exec(i);if(r){t.push({rest:!!r[1],optional:!!r[3]||!!r[1],type:r[4].trim()});continue}let o=/^(\.\.\.)?\s*([\s\S]+?)(\?)?$/.exec(i);if(!o)return null;t.push({rest:!!o[1],optional:!!o[3]||!!o[1],type:o[2].trim()})}return t}function zY(e){let t=0;for(let n=0;n)]}".includes(i))i===">"&&e[n-1]==="="||(t-=1);else if(i==="?"&&t===0){let r=e.slice(0,n);if(!/\bextends\b/.test(r))return null;let o=$0e(e,n+1);return o===-1?null:{check:r.trim(),whenTrue:e.slice(n+1,o).trim(),whenFalse:e.slice(o+1).trim()}}}return null}function $0e(e,t){let n=0,i=0;for(let r=t;r)]}".includes(o))o===">"&&e[r-1]==="="||(n-=1);else if(n===0&&o==="?")i+=1;else if(n===0&&o===":"){if(i===0)return r;i-=1}}return-1}function S0e(e){return xh(e,";,")}function e$(e,t,n){if(!e.startsWith(t)||!e.endsWith(n))return!1;let i=0;for(let r=0;rn.some(o=>sl(r,o)))}function GY(e){let t=[],n=0,i="";for(let r of e){if("<([{".includes(r)?n+=1:">)]}".includes(r)&&(n-=1),r==="|"&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t.map(r=>r.trim()).filter(Boolean)}function sl(e,t){let n=i=>i.replace(/\s+/g,"").replace(/\|undefined$/,"");return n(e)===n(t)}function E0e(e,t){if(e===t)return!0;let n=qY(e);return n===qY(t)&&n!==null}function a8(e,t){let n=VY(e),i=VY(t);if(n.size===0&&i.size===0)return[e,t];for(let[r,o]of n){let s=i.get(r);if(s!==void 0&&s!==o)return[e,t]}return[BY(e),BY(t)]}function VY(e){let t=new Map,n=/\bimport\((["'])((?:(?!\1).)*)\1\)\.([A-Za-z_$][\w$]*)/g;for(let i of e.matchAll(n))t.set(i[3],i[2]);return t}function BY(e){return e.replace(/\bimport\((["'])(?:(?!\1).)*\1\)\./g,"")}function qY(e){let t=T0e(e);if(t.length===0)return null;let n=e;return t.forEach((i,r)=>{n=n.replace(new RegExp(`\\b${a$(i)}\\b`,"g"),`\0T${r}`)}),n}function T0e(e){let t=[];for(let n=0;n"&&(n-=1,n===0))return i;return-1}function xh(e,t=","){let n=[],i=0,r="";for(let o=0;o)]}".includes(s)&&(s===">"&&e[o-1]==="="||(i-=1)),t.includes(s)&&i===0){n.push(r),r="";continue}r+=s}return r.trim()&&n.push(r),n}var g$=require("node:fs/promises"),Q9=require("node:os"),X9=require("node:path");var Eh=require("node:fs/promises"),Yd=require("node:path");var xO=new Map;async function EO(e,t){if(!e.autoInstall)return!1;let n=xO.get(t.id);if(n)return n;let i=A0e(e,t).finally(()=>{xO.delete(t.id)});return xO.set(t.id,i),i}async function A0e(e,t){e.logger.info(`Installing ${t.label.replace(/^Install\s+/i,"")}...`);let n=await e.exec(t.command,t.args,{...e.env?{env:e.env}:{},timeoutMs:10*6e4});return n.code!==0?(e.logger.warn(`${t.label} failed: ${(n.stderr||n.stdout||"no output").trim()}`),!1):(e.logger.info(`${t.label.replace(/^Install\s+/i,"")} installed.`),!0)}function ne(e,t,n,i,r){return{available:!1,reason:t,detail:n,...i?{remedy:i}:{},...r?{install:r}:{},tool:e}}function c$(e,t){return new Promise(n=>{let i=setTimeout(()=>n({timedOut:!0}),Math.max(0,t));e.then(r=>{clearTimeout(i),n({timedOut:!1,value:r})},()=>{clearTimeout(i),n({timedOut:!0})})})}var R0e=1,C0e=3,c8=750,g8=1,TO=0,l8=[];async function N0e(){TOl8.push(t));let e=!1;return()=>{if(e)return;e=!0;let t=l8.shift();t?t():TO-=1}}function P0e(e){return/waiting for file lock on (?:package cache|build directory|the registry index)/i.test(e)?!/error\[E\d+\]|could not compile|error: could not|linking with|error: linker|failed to run custom build|toolchain '[^']*' is not installed/i.test(e):!1}var u8=/^(?:Updating|Downloading|Downloaded|Compiling|Compiled|Checking|Blocking)\b/i;function d8(e){let t=e.replace(/\u001b\[[0-9;]*m/g,"").split(` +`).map(r=>r.trim()).filter(Boolean),n=r=>/error\[E\d+\]/i.test(r)?100:/requires rustc\b/i.test(r)?95:/failed to select a version|no matching package/i.test(r)?90:/failed to run custom build command|failed custom build/i.test(r)?85:/linking with .* failed|linker .* (?:failed|not found)|cannot find -l/i.test(r)?80:/missing (?:required )?feature|feature .* (?:is not enabled|does not exist|not found)/i.test(r)?75:/could not compile/i.test(r)?70:/^error:/i.test(r)?60:0,i=null;for(let[r,o]of t.entries()){let s=n(o);s>(i?.score??0)&&(i={line:o,score:s,index:r})}if(i){let r=t.slice(i.index+1).find(o=>!u8.test(o)&&n(o)>0&&o!==i.line);return r?`${i.line} +${r}`:i.line}return t.find(r=>!u8.test(r))??t[0]??"unknown Cargo failure"}var D0e=e=>new Promise(t=>setTimeout(t,e)),Io="cargo public-api",O0e="Install Rust and Cargo with rustup, or make sure `cargo` is on PATH.",p8={id:"cargo-public-api",label:"Install cargo-public-api",command:"cargo",args:["install","cargo-public-api","--locked"]},M0e="Drift can install the missing `cargo-public-api` helper for you after approval.",IO={id:"rustup-nightly",label:"Install the Rust nightly toolchain",command:"rustup",args:["toolchain","install","nightly","--profile","minimal"]},h8="Drift can install the Rust nightly toolchain for you after approval, or run `rustup toolchain install nightly` yourself.",y8={ecosystem:"cargo",tool:Io,weight:1,async compute(e){let t=e.workdir,n=(g,h)=>G0e(e.exec,g,h,e.env,t),i=(g,h)=>z0e(e.exec,g,h,e.env,t),r=await n("cargo",["--version"]);if(r===null)return ne(Io,"tool-missing",`The Rust Cargo toolchain is not installed or is not on PATH, so ${e.name}'s public API could not be compared directly.`,O0e);let o=await n("cargo",["public-api","--version"]);if(o===null&&!(await EO(e,p8)&&(o=await n("cargo",["public-api","--version"]))!==null))return ne(Io,"tool-missing",`Rust and Cargo are installed, but Drift's Rust API helper is missing. ${e.name}'s public API could not be compared directly.`,M0e,p8);let s=/^cargo 1\b/.test(r)&&!/nightly/.test(r),a=/nightly/.test(r),c=null,l="nightly";if(a)l="active",c=await n("rustc",["--version"]);else if(s&&await i("rustup",["--version"])&&(c=await n("rustup",["run","nightly","rustc","--version"]),c===null&&!(await EO(e,IO)&&(c=await n("rustup",["run","nightly","rustc","--version"]))!==null)))return ne(Io,"tool-missing",`\`cargo public-api\` needs the Rust nightly toolchain to read rustdoc's JSON output, and it is not installed. ${e.name}'s public API could not be compared directly.`,h8,IO);let u=o===null||c===null?null:[`cpa=${o}`,`${l}=${c}`,`parser=${g8}`].join("|"),d=f8(e,e.from,u),p=f8(e,e.to,u);p.catch(()=>{});let f=await d;if(!f.ok)return f.failure;let m=await p;return m.ok?{available:!0,changes:Pr(f.api,m.api),tool:Io,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (rustdoc JSON)`}:m.failure}};async function f8(e,t,n){let i=(0,Yd.join)(e.workdir,`probe-${t}`),r=n===null?null:`rust-surface:v${g8}:${e.name}@${t}#${n}`;if(r){let d=await Ca(r);if(d&&d.length>0)return{ok:!0,api:new Map(d)}}try{await(0,Eh.mkdir)((0,Yd.join)(i,"src"),{recursive:!0}),await(0,Eh.writeFile)((0,Yd.join)(i,"Cargo.toml"),L0e(e.name,t),"utf8"),await(0,Eh.writeFile)((0,Yd.join)(i,"src","lib.rs"),"","utf8")}catch(d){return{ok:!1,failure:ne(Io,"toolchain-failed",`Could not prepare a scratch crate: ${d.message}`)}}let s={...e.env??process.env,CARGO_TARGET_DIR:(0,Yd.join)(i,"target")},a=Date.now()+e.timeoutMs,c=()=>({ok:!1,failure:ne(Io,"toolchain-failed",`\`cargo public-api\` on ${e.name} ${t} ran out of time waiting for the Cargo package-cache lock.`)}),l;for(let d=0;;d+=1){if(a-Date.now()<=0)return c();let p=await N0e(),f=!1;try{let m=a-Date.now();if(m<=0)return p(),f=!0,c();l=await e.exec("cargo",["public-api","--simplified","--package",e.name],{cwd:i,timeoutMs:m,env:s})}finally{f||p()}if(l.code===0)break;if(d({pkg:ol(r.Pkg),error:ol(r.Error)})):[],platforms:Yd(n.Platforms)}}function ol(e){return typeof e=="string"?e:""}function Yd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}var mY=8,gY=200,hY={"package-removed":0,"export-removed":1,"kind-changed":2,"member-removed":3,"member-now-required":4,"signature-changed":5,"constant-value-changed":6};function vY(e,t){let n=[],i=[],r=new Set(e.packages),o=new Set(t.packages),s=e.packages.filter(u=>!o.has(u));for(let u of s)n.push({kind:"package-removed",symbol:u,detail:`The package \`${u}\` no longer exists. Every import of it must move to its replacement \u2014 do not re-implement the symbols it exported.`});for(let u of t.packages)r.has(u)||i.push({kind:"package-added",symbol:u});let a=new Set(s),c=[];for(let[u,d]of e.symbols){if(a.has(d.pkg))continue;let p=t.symbols.get(u),f=yY(d);if(!p){if(MAe(d,e,t))continue;n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer exported (was ${Eo(kO(d.kind))}).`,before:d.signatures[0]});continue}if(d.kind!==p.kind){n.push({kind:"kind-changed",symbol:f,detail:`\`${f}\` changed from ${Eo(kO(d.kind))} to ${Eo(kO(p.kind))}.`,before:d.signatures[0],after:p.signatures[0]});continue}let m=d.platforms.filter(b=>!p.platforms.includes(b));m.length>0&&p.platforms.length>0&&n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer available on ${m.join(", ")}; it remains on ${p.platforms.join(", ")}.`,before:d.signatures[0]});for(let b of d.members)p.members.includes(b)||n.push({kind:"member-removed",symbol:`${f}.${b}`,detail:d.kind==="interface"?`The method \`${b}\` was removed from the interface \`${f}\`.`:`\`${f}.${b}\` was removed.`});if(d.kind==="interface")for(let b of p.requiredMembers)d.requiredMembers.includes(b)||n.push({kind:"member-now-required",symbol:`${f}.${b}`,detail:`The interface \`${f}\` now requires a \`${b}\` method. Any type in this repository that implements \`${f}\` must gain one.`,after:t.symbols.get(`${p.pkg}.${p.name}.${b}`)?.signatures[0]});let g=d.signatures.join(" | "),h=p.signatures.join(" | ");if(g!==h){if(LAe(d.signatures,p.signatures)){c.push(`${f}: ${g} \u2192 ${h}`);continue}n.push({kind:"signature-changed",symbol:f,detail:`The signature of \`${f}\` changed.`,before:g,after:h})}}for(let[u,d]of t.symbols)e.symbols.has(u)||!r.has(d.pkg)||i.push({kind:"export-added",symbol:yY(d)});if(c.length>0&&c.length<=mY)for(let u of c){let[d,p]=wh(u,": ");n.push({kind:"constant-value-changed",symbol:d,detail:`The constant \`${d}\` changed value.`,before:wh(p," \u2192 ")[0],after:wh(p," \u2192 ")[1]})}else c.length>mY&&n.push({kind:"constant-value-changed",symbol:`${e.module} constants`,detail:`${c.length} exported constants changed value. This is usually a regenerated platform header rather than a deliberate API change, but code that compares against a literal copy of one of these values will now disagree.`,after:c.slice(0,10).join("; ")});n.sort((u,d)=>(hY[u.kind]??9)-(hY[d.kind]??9));let l=Math.max(0,n.length-gY);return{changes:n.slice(0,gY),additions:i,omitted:l}}function MAe(e,t,n){let i=e.name.lastIndexOf(".");if(i<=0)return!1;let r=`${e.pkg}.${e.name.slice(0,i)}`;return t.symbols.has(r)&&n.symbols.has(r)}function yY(e){return e.pkgName?`${e.pkgName}.${e.name}`:e.name}function kO(e){switch(e){case"class":return"struct";case"function":return"function";case"interface":return"interface";case"variable":return"constant or variable";default:return"type"}}function LAe(e,t){if(e.length!==1||t.length!==1)return!1;let[n,i]=[e[0],t[0]];return!n.startsWith("const ")||!i.startsWith("const ")?!1:wh(n," = ")[0]===wh(i," = ")[0]}function wh(e,t){let n=e.indexOf(t);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length)]}var FAe="1.24",UAe=["linux/amd64","darwin/arm64","windows/amd64"];function wY(){let e=[...UAe],t=`${jAe()}/${zAe()}`;return e.includes(t)?e:[...e,t]}function jAe(){switch(process.platform){case"win32":return"windows";case"darwin":return"darwin";default:return"linux"}}function zAe(){switch(process.arch){case"x64":return"amd64";case"arm64":return"arm64";case"arm":return"arm";default:return"amd64"}}async function kY(e,t){let n=await e("go",["version"],{timeoutMs:2e4,...t?{env:t}:{}});if(n.failure==="not-found"||n.code!==0)return{available:!1};let i=/go(\d+\.\d+(?:\.\d+)?)/.exec(n.stdout)?.[1],r=await e("go",["env","GOMODCACHE"],{timeoutMs:2e4,...t?{env:t}:{}}),o=r.code===0?r.stdout.trim():"";return{available:!0,...i?{version:i}:{},...o?{moduleCache:o}:{}}}async function $Y(e,t=GAe){if(e)for(let n of t){let i=await e(n).catch(()=>null);if(!i)continue;let r=n.endsWith(".yml")||n.endsWith(".yaml")?BAe(i):VAe(i);if(r)return{version:r,source:n}}return{version:FAe,source:"Drift default"}}var GAe=["go.work","go.mod",".github/workflows/go.yml",".github/workflows/ci.yml",".github/workflows/test.yml",".github/workflows/build.yml"];function VAe(e){let t=/^\s*toolchain\s+go(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1];return t||(/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1]??null)}function BAe(e){let t=/go-version(?:-file)?\s*:\s*['"]?(\d+\.\d+(?:\.\d+|\.x)?)/.exec(e)?.[1];return t?t.replace(/\.x$/,""):null}function _Y(e,t){let n=e.version;return t?`Add \`actions/setup-go\` with \`go-version: '${n}'\` to the Drift workflow, before the Drift step, to install Go ${n} and enable exported-API comparison.`:`Install Go ${n} and make \`go\` available on PATH, or configure \`go-version\` in the Drift workflow, to enable exported-API comparison.`}function SY(){return process.env.GITHUB_ACTIONS==="true"}var us="go (go/build + go/parser)",IY={ecosystem:"go",tool:us,weight:1,async compute(e){let t=await $Y(e.readRepoFile);if(!(await kY(e.exec,e.env)).available)return ne(us,"tool-missing",`The Go toolchain is not installed, so ${e.name}'s exported API could not be compared.`,_Y(t,SY()));let i=await HAe(e.exec,e.logger,e.env);if(!i)return ne(us,"toolchain-failed",`Drift could not prepare a scratch Go module to run its API extractor in, so ${e.name} could not be compared.`);let r=wY(),o=await xY(e,i,e.from,r,t);if("failure"in o)return o.failure;let s=await xY(e,i,e.to,r,t);if("failure"in s)return s.failure;let{changes:a,additions:c,omitted:l}=vY(o.api,s.api),u=new Set([...o.api.failures,...s.api.failures].map(d=>d.pkg));return u.size>0&&e.logger.debug(`${e.name}: ${u.size} package(s) could not be parsed and were skipped`),{available:!0,changes:a,tool:us,weight:1,locator:qAe(e,o.api,s.api,r,u.size,l),additions:c}}};function qAe(e,t,n,i,r,o){let s=[`${e.name} ${e.from} \u2192 ${e.to}`,`${n.packages.length} package(s), ${n.symbols.size} exported symbol(s)`,`platforms: ${i.join(", ")}`];return t.packages.length!==n.packages.length&&s.push(`${t.packages.length} package(s) before`),r>0&&s.push(`${r} package(s) unparseable and skipped`),o>0&&s.push(`${o} further finding(s) not listed`),s.join(" \xB7 ")}var AY=new Map,Qd=new Map;async function xY(e,t,n,i,r){let o=n.startsWith("v")?n:`v${n}`,s=`${e.name}@${o}|${i.join(",")}`;for(;;){let a=AY.get(s);if(a)return{api:a};let c=Qd.get(s);if(c){let d=await t_(c,e.timeoutMs);if(d.timedOut)return{failure:ne(us,"toolchain-failed",`Ran out of time comparing ${e.name} ${o}'s exported API.`)};if("failure"in d.value&&!d.value.failure.available&&d.value.failure.reason==="toolchain-failed"){Qd.get(s)===c&&Qd.delete(s);continue}return d.value}let l=WAe(e,t,n,i,r,s);Qd.set(s,l);let u=()=>{Qd.get(s)===l&&Qd.delete(s)};return l.then(u,u),l}}async function WAe(e,t,n,i,r,o){let s=n.startsWith("v")?n:`v${n}`,a=await e.exec("go",["mod","download","-json",`${e.name}@${s}`],{cwd:t,timeoutMs:e.timeoutMs,env:$O(e.env)}),c=RY(a.stdout);if(!c){let d=`${a.stderr} -${a.stdout}`,p=/unknown revision|invalid version|no matching versions|404 Not Found|does not contain package/i.test(d);return{failure:ne(us,p?"version-unavailable":"toolchain-failed",p?`The Go module proxy has no ${e.name} ${s}, so there was nothing to compare against. It may be retracted, or the module may be private.`:`\`go mod download ${e.name}@${s}\` failed: ${_O(d)}`)}}let l=await e.exec("go",["run","apidump.go","-dir",c,"-module",e.name,"-platforms",i.join(",")],{cwd:t,timeoutMs:e.timeoutMs,env:$O(e.env)});if(l.code!==0)return{failure:ne(us,"toolchain-failed",`Drift's API extractor could not run under the installed Go toolchain (${r.source} asks for Go ${r.version}): ${_O(l.stderr)}`)};let u=bY(l.stdout);return u?u.symbols.size===0?{failure:ne(us,"no-public-surface",`${e.name} ${s} exports nothing from any importable package on ${i.join(", ")}, so there is no API to compare.`)}:(AY.set(o,u),{api:u}):{failure:ne(us,"parse-failed",`Drift could not read its own API extractor's output for ${e.name} ${s}.`)}}function RY(e){let t=e.indexOf("{");if(t<0)return null;try{let n=JSON.parse(e.slice(t,e.lastIndexOf("}")+1));return n.Dir&&!n.Error?n.Dir:null}catch{return/"Dir":\s*"((?:[^"\\]|\\.)*)"/.exec(e)?.[1]?.replace(/\\(.)/g,"$1")??null}}var EY=new Map;function HAe(e,t,n){let i=n?.PATH??process.env.PATH??"",r=EY.get(i);return r??=(async()=>{try{let o=await(0,sl.mkdtemp)((0,kh.join)((0,TY.tmpdir)(),"drift-go-apidump-"));await(0,sl.mkdir)(o,{recursive:!0}),await(0,sl.writeFile)((0,kh.join)(o,"go.mod"),`module driftapidump +`;function S8(e){let t;try{t=JSON.parse(e.trim())}catch{return null}if(!t||typeof t!="object")return null;let n=t;if(!Array.isArray(n.Symbols)||!Array.isArray(n.Packages))return null;let i=new Map;for(let r of n.Symbols){let o=typeof r.Key=="string"?r.Key:null;o&&i.set(o,{key:o,name:al(r.Name),pkg:al(r.Pkg),pkgName:al(r.PkgName),kind:al(r.Kind)||"variable",signatures:Qd(r.Signatures),members:Qd(r.Members),requiredMembers:Qd(r.RequiredMembers),platforms:Qd(r.Platforms)})}return{module:al(n.Module),packages:Qd(n.Packages),symbols:i,failures:Array.isArray(n.Failures)?n.Failures.map(r=>({pkg:al(r.Pkg),error:al(r.Error)})):[],platforms:Qd(n.Platforms)}}function al(e){return typeof e=="string"?e:""}function Qd(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}var w8=8,k8=200,_8={"package-removed":0,"export-removed":1,"kind-changed":2,"member-removed":3,"member-now-required":4,"signature-changed":5,"constant-value-changed":6};function x8(e,t){let n=[],i=[],r=new Set(e.packages),o=new Set(t.packages),s=e.packages.filter(u=>!o.has(u));for(let u of s)n.push({kind:"package-removed",symbol:u,detail:`The package \`${u}\` no longer exists. Every import of it must move to its replacement \u2014 do not re-implement the symbols it exported.`});for(let u of t.packages)r.has(u)||i.push({kind:"package-added",symbol:u});let a=new Set(s),c=[];for(let[u,d]of e.symbols){if(a.has(d.pkg))continue;let p=t.symbols.get(u),f=$8(d);if(!p){if(V0e(d,e,t))continue;n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer exported (was ${Eo(AO(d.kind))}).`,before:d.signatures[0]});continue}if(d.kind!==p.kind){n.push({kind:"kind-changed",symbol:f,detail:`\`${f}\` changed from ${Eo(AO(d.kind))} to ${Eo(AO(p.kind))}.`,before:d.signatures[0],after:p.signatures[0]});continue}let m=d.platforms.filter(b=>!p.platforms.includes(b));m.length>0&&p.platforms.length>0&&n.push({kind:"export-removed",symbol:f,detail:`\`${f}\` is no longer available on ${m.join(", ")}; it remains on ${p.platforms.join(", ")}.`,before:d.signatures[0]});for(let b of d.members)p.members.includes(b)||n.push({kind:"member-removed",symbol:`${f}.${b}`,detail:d.kind==="interface"?`The method \`${b}\` was removed from the interface \`${f}\`.`:`\`${f}.${b}\` was removed.`});if(d.kind==="interface")for(let b of p.requiredMembers)d.requiredMembers.includes(b)||n.push({kind:"member-now-required",symbol:`${f}.${b}`,detail:`The interface \`${f}\` now requires a \`${b}\` method. Any type in this repository that implements \`${f}\` must gain one.`,after:t.symbols.get(`${p.pkg}.${p.name}.${b}`)?.signatures[0]});let g=d.signatures.join(" | "),h=p.signatures.join(" | ");if(g!==h){if(B0e(d.signatures,p.signatures)){c.push(`${f}: ${g} \u2192 ${h}`);continue}n.push({kind:"signature-changed",symbol:f,detail:`The signature of \`${f}\` changed.`,before:g,after:h})}}for(let[u,d]of t.symbols)e.symbols.has(u)||!r.has(d.pkg)||i.push({kind:"export-added",symbol:$8(d)});if(c.length>0&&c.length<=w8)for(let u of c){let[d,p]=Th(u,": ");n.push({kind:"constant-value-changed",symbol:d,detail:`The constant \`${d}\` changed value.`,before:Th(p," \u2192 ")[0],after:Th(p," \u2192 ")[1]})}else c.length>w8&&n.push({kind:"constant-value-changed",symbol:`${e.module} constants`,detail:`${c.length} exported constants changed value. This is usually a regenerated platform header rather than a deliberate API change, but code that compares against a literal copy of one of these values will now disagree.`,after:c.slice(0,10).join("; ")});n.sort((u,d)=>(_8[u.kind]??9)-(_8[d.kind]??9));let l=Math.max(0,n.length-k8);return{changes:n.slice(0,k8),additions:i,omitted:l}}function V0e(e,t,n){let i=e.name.lastIndexOf(".");if(i<=0)return!1;let r=`${e.pkg}.${e.name.slice(0,i)}`;return t.symbols.has(r)&&n.symbols.has(r)}function $8(e){return e.pkgName?`${e.pkgName}.${e.name}`:e.name}function AO(e){switch(e){case"class":return"struct";case"function":return"function";case"interface":return"interface";case"variable":return"constant or variable";default:return"type"}}function B0e(e,t){if(e.length!==1||t.length!==1)return!1;let[n,i]=[e[0],t[0]];return!n.startsWith("const ")||!i.startsWith("const ")?!1:Th(n," = ")[0]===Th(i," = ")[0]}function Th(e,t){let n=e.indexOf(t);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length)]}var q0e="1.24",W0e=["linux/amd64","darwin/arm64","windows/amd64"];function E8(){let e=[...W0e],t=`${K0e()}/${H0e()}`;return e.includes(t)?e:[...e,t]}function K0e(){switch(process.platform){case"win32":return"windows";case"darwin":return"darwin";default:return"linux"}}function H0e(){switch(process.arch){case"x64":return"amd64";case"arm64":return"arm64";case"arm":return"arm";default:return"amd64"}}async function T8(e,t){let n=await e("go",["version"],{timeoutMs:2e4,...t?{env:t}:{}});if(n.failure==="not-found"||n.code!==0)return{available:!1};let i=/go(\d+\.\d+(?:\.\d+)?)/.exec(n.stdout)?.[1],r=await e("go",["env","GOMODCACHE"],{timeoutMs:2e4,...t?{env:t}:{}}),o=r.code===0?r.stdout.trim():"";return{available:!0,...i?{version:i}:{},...o?{moduleCache:o}:{}}}async function I8(e,t=J0e){if(e)for(let n of t){let i=await e(n).catch(()=>null);if(!i)continue;let r=n.endsWith(".yml")||n.endsWith(".yaml")?Y0e(i):Z0e(i);if(r)return{version:r,source:n}}return{version:q0e,source:"Drift default"}}var J0e=["go.work","go.mod",".github/workflows/go.yml",".github/workflows/ci.yml",".github/workflows/test.yml",".github/workflows/build.yml"];function Z0e(e){let t=/^\s*toolchain\s+go(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1];return t||(/^\s*go\s+(\d+\.\d+(?:\.\d+)?)/m.exec(e)?.[1]??null)}function Y0e(e){let t=/go-version(?:-file)?\s*:\s*['"]?(\d+\.\d+(?:\.\d+|\.x)?)/.exec(e)?.[1];return t?t.replace(/\.x$/,""):null}function A8(e,t){let n=e.version;return t?`Add \`actions/setup-go\` with \`go-version: '${n}'\` to the Drift workflow, before the Drift step, to install Go ${n} and enable exported-API comparison.`:`Install Go ${n} and make \`go\` available on PATH, or configure \`go-version\` in the Drift workflow, to enable exported-API comparison.`}function R8(){return process.env.GITHUB_ACTIONS==="true"}var us="go (go/build + go/parser)",D8={ecosystem:"go",tool:us,weight:1,async compute(e){let t=await I8(e.readRepoFile);if(!(await T8(e.exec,e.env)).available)return ne(us,"tool-missing",`The Go toolchain is not installed, so ${e.name}'s exported API could not be compared.`,A8(t,R8()));let i=await eRe(e.exec,e.logger,e.env);if(!i)return ne(us,"toolchain-failed",`Drift could not prepare a scratch Go module to run its API extractor in, so ${e.name} could not be compared.`);let r=E8(),o=await C8(e,i,e.from,r,t);if("failure"in o)return o.failure;let s=await C8(e,i,e.to,r,t);if("failure"in s)return s.failure;let{changes:a,additions:c,omitted:l}=x8(o.api,s.api),u=new Set([...o.api.failures,...s.api.failures].map(d=>d.pkg));return u.size>0&&e.logger.debug(`${e.name}: ${u.size} package(s) could not be parsed and were skipped`),{available:!0,changes:a,tool:us,weight:1,locator:Q0e(e,o.api,s.api,r,u.size,l),additions:c}}};function Q0e(e,t,n,i,r,o){let s=[`${e.name} ${e.from} \u2192 ${e.to}`,`${n.packages.length} package(s), ${n.symbols.size} exported symbol(s)`,`platforms: ${i.join(", ")}`];return t.packages.length!==n.packages.length&&s.push(`${t.packages.length} package(s) before`),r>0&&s.push(`${r} package(s) unparseable and skipped`),o>0&&s.push(`${o} further finding(s) not listed`),s.join(" \xB7 ")}var O8=new Map,Xd=new Map;async function C8(e,t,n,i,r){let o=n.startsWith("v")?n:`v${n}`,s=`${e.name}@${o}|${i.join(",")}`;for(;;){let a=O8.get(s);if(a)return{api:a};let c=Xd.get(s);if(c){let d=await c$(c,e.timeoutMs);if(d.timedOut)return{failure:ne(us,"toolchain-failed",`Ran out of time comparing ${e.name} ${o}'s exported API.`)};if("failure"in d.value&&!d.value.failure.available&&d.value.failure.reason==="toolchain-failed"){Xd.get(s)===c&&Xd.delete(s);continue}return d.value}let l=X0e(e,t,n,i,r,s);Xd.set(s,l);let u=()=>{Xd.get(s)===l&&Xd.delete(s)};return l.then(u,u),l}}async function X0e(e,t,n,i,r,o){let s=n.startsWith("v")?n:`v${n}`,a=await e.exec("go",["mod","download","-json",`${e.name}@${s}`],{cwd:t,timeoutMs:e.timeoutMs,env:RO(e.env)}),c=M8(a.stdout);if(!c){let d=`${a.stderr} +${a.stdout}`,p=/unknown revision|invalid version|no matching versions|404 Not Found|does not contain package/i.test(d);return{failure:ne(us,p?"version-unavailable":"toolchain-failed",p?`The Go module proxy has no ${e.name} ${s}, so there was nothing to compare against. It may be retracted, or the module may be private.`:`\`go mod download ${e.name}@${s}\` failed: ${CO(d)}`)}}let l=await e.exec("go",["run","apidump.go","-dir",c,"-module",e.name,"-platforms",i.join(",")],{cwd:t,timeoutMs:e.timeoutMs,env:RO(e.env)});if(l.code!==0)return{failure:ne(us,"toolchain-failed",`Drift's API extractor could not run under the installed Go toolchain (${r.source} asks for Go ${r.version}): ${CO(l.stderr)}`)};let u=S8(l.stdout);return u?u.symbols.size===0?{failure:ne(us,"no-public-surface",`${e.name} ${s} exports nothing from any importable package on ${i.join(", ")}, so there is no API to compare.`)}:(O8.set(o,u),{api:u}):{failure:ne(us,"parse-failed",`Drift could not read its own API extractor's output for ${e.name} ${s}.`)}}function M8(e){let t=e.indexOf("{");if(t<0)return null;try{let n=JSON.parse(e.slice(t,e.lastIndexOf("}")+1));return n.Dir&&!n.Error?n.Dir:null}catch{return/"Dir":\s*"((?:[^"\\]|\\.)*)"/.exec(e)?.[1]?.replace(/\\(.)/g,"$1")??null}}var N8=new Map;function eRe(e,t,n){let i=n?.PATH??process.env.PATH??"",r=N8.get(i);return r??=(async()=>{try{let o=await(0,cl.mkdtemp)((0,Ih.join)((0,P8.tmpdir)(),"drift-go-apidump-"));await(0,cl.mkdir)(o,{recursive:!0}),await(0,cl.writeFile)((0,Ih.join)(o,"go.mod"),`module driftapidump go 1.21 -`,"utf8"),await(0,sl.writeFile)((0,kh.join)(o,"apidump.go"),fY,"utf8");let s=await e("go",["build","-o",(0,kh.join)(o,"apidump-check"),"."],{cwd:o,timeoutMs:12e4,env:$O(n)});return s.code!==0?(t.debug(`Drift's Go API extractor failed to build: ${_O(s.stderr)}`),null):o}catch(o){return t.debug(`Could not create the Go scratch module: ${o.message}`),null}})(),EY.set(i,r),r}function $O(e=process.env){return{...e,GOFLAGS:"-mod=mod"}}function _O(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var al=require("node:fs/promises"),WY=require("node:path");var CY=require("node:crypto"),Ao=require("node:fs/promises"),PY=require("node:os"),$h=require("node:path");var SO=new Map,KAe=new Map;function JAe(){let e=Lc()??(0,$h.join)((0,PY.tmpdir)(),"drift-cache");return(0,$h.join)(e,"helpers")}function NY(e){return(0,CY.createHash)("sha256").update(e).digest("hex")}function DY(e){let t=KAe.get(e.id);if(t)return Promise.resolve({ok:!0,path:t});let n=`${e.id}@${e.version}#${e.sha256}`,i=SO.get(n);if(i)return i;let r=ZAe(e).finally(()=>SO.delete(n));return SO.set(n,r),r}async function ZAe(e){let t=JAe(),n=(0,$h.join)(t,`${e.id}-${e.version}.${e.extension??"jar"}`);try{let s=await(0,Ao.readFile)(n);if(NY(s)===e.sha256)return{ok:!0,path:n}}catch{}let i;try{i=await Bt(e.url,{timeoutMs:12e4})}catch(s){return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s.message}`}}}if(!i.ok){let s=i.status?`HTTP ${i.status}`:i.error??"the request failed";return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s}`}}}let r=NY(i.bytes);if(r!==e.sha256)return{ok:!1,error:{kind:"checksum-failed",detail:`${e.url}: expected SHA-256 ${e.sha256}, got ${r}`}};let o=(0,$h.join)(t,`.${e.id}-${e.version}.${process.pid}.${Date.now()}.tmp`);try{return await(0,Ao.mkdir)(t,{recursive:!0}),await(0,Ao.writeFile)(o,i.bytes),await(0,Ao.rename)(o,n),{ok:!0,path:n}}catch(s){return await(0,Ao.rm)(o,{force:!0}).catch(()=>{}),{ok:!1,error:{kind:"cache-failed",detail:`${n}: ${s.message}`}}}}function FY(e){let t=0,n="";for(let i of e)i==="<"?t++:i===">"?t=Math.max(0,t-1):t===0&&(n+=i);return n.replace(/\[\]/g,"").trim()}function YAe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"?n++:r===">"&&(n=Math.max(0,n-1)),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t.map(r=>FY(r)).filter(r=>r.length>0)}function UY(e,t,n){let i=e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").trim(),r=i.indexOf("("),o=i.lastIndexOf(")");if(r===-1||o0?e.slice(0,t):null}function MY(e){return e.slice(e.lastIndexOf(".")+1)}function jY(e,t){let n=c=>`${c.owner} ${c.name} ${c.params.length}`,i=new Map;for(let c of t){let l=i.get(n(c));l?l.push(c):i.set(n(c),[c])}let r=new Map;for(let c of e)for(let l of i.get(n(c))??[]){let u=[...c.params,...c.returns===null?[]:[c.returns]],d=[...l.params,...l.returns===null?[]:[l.returns]];if(u.length===d.length)for(let[p,f]of u.entries()){let m=d[p];if(f===m||MY(f)!==MY(m))continue;let g=OY(f),h=OY(m);if(!g||!h||g===h)continue;let b=`${g} ${h}`,y=r.get(b);y||(y={types:new Map,witnesses:new Set,binaryBreaking:!1},r.set(b,y)),y.types.set(f,m),y.witnesses.add(`${c.owner}.${c.name}/${c.params.length}`),c.binaryBreaking&&(y.binaryBreaking=!0)}}let o=[];for(let[c,l]of r){if(!l.binaryBreaking||l.witnesses.size<2)continue;let[u,d]=c.split(" ");o.push({fromPackage:u,toPackage:d,types:[...l.types].map(([p,f])=>({from:p,to:f}))})}o.sort((c,l)=>l.types.length-c.types.length||c.fromPackage.localeCompare(l.fromPackage));let s=64,a=[];for(let c of o){if(s<=0)break;a.push({...c,types:c.types.slice(0,s)}),s-=Math.min(s,c.types.length)}return a}function LY(e){let t=e-44;return t>=5&&t<=99?t:null}function zY(e){let t=0,n=0;for(let o of e.split(` -`)){let s=/CLASS FILE FORMAT VERSION:\s*(\d+)(?:\.\d+)?\s*<-\s*(\d+)(?:\.\d+)?/.exec(o);s&&(n=Math.max(n,Number(s[1])),t=Math.max(t,Number(s[2])))}if(n<=t)return null;let i=LY(t),r=LY(n);return i!==null&&r!==null?{from:i,to:r}:null}var Ro="japicmp",r_="Maven POM contract",ds="https://repo1.maven.org/maven2",GY=5*1024*1024,EO="0.23.1",QAe=`${ds}/com/github/siom79/japicmp/japicmp/${EO}/japicmp-${EO}-jar-with-dependencies.jar`,XAe="f2300a8531b68e25b678247874a1eae13a07d6842a4a1236845481fc90c5c6c7",eRe="Install a JDK (11 or newer) and re-run. Drift downloads and runs japicmp itself, but does not install Java.",HY={ecosystem:"maven",tool:Ro,weight:1,async compute(e){let t=KY(e.name);if(!t)return ne(Ro,"unsupported-ecosystem",`\`${e.name}\` is not a \`groupId:artifactId\` coordinate, so Drift could not locate it on Maven Central.`);let n=[ds,...await nRe(e)],[i,r]=await Promise.all([i_(t,e.from,n),i_(t,e.to,n)]);if(!i.ok)return i.failure;if(!r.ok)return r.failure;let o=BY(i.contract.packaging),s=BY(r.contract.packaging);if(o==="pom"||s==="pom")return{available:!0,changes:rRe(i.contract,r.contract),tool:r_,weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (POM contract; ${o} \u2192 ${s})`,packageRole:s};let a;if(o!=="library"||s!=="library"){await(0,al.mkdir)(e.workdir,{recursive:!0});let[h,b]=await Promise.all([n_(t,e.from,e.workdir,n),n_(t,e.to,e.workdir,n)]);if(!h.ok||!b.ok)return{...ne(r_,"artifact-type-unsupported",`${e.name} is packaged as ${r.contract.packaging}, not as a Java library jar, and publishes no companion jar Drift could compare instead.`),packageRole:s};a={before:h,after:b}}if(!await Jk(e.exec,"java",["-version"]))return ne(Ro,"tool-missing",`Java is not installed, so ${e.name}'s classfile API could not be compared directly.`,eRe);let c=await DY({id:"japicmp",version:EO,url:QAe,sha256:XAe});if(!c.ok){let h=c.error.kind==="checksum-failed"?`Drift's pinned japicmp helper failed its SHA-256 check and was not run (${c.error.detail}).`:c.error.kind==="cache-failed"?`Drift verified its pinned japicmp helper but could not cache it for use (${c.error.detail}).`:`Drift could not download its pinned japicmp helper (${c.error.detail}).`;return ne(Ro,"toolchain-failed",h)}let l=c.path;await(0,al.mkdir)(e.workdir,{recursive:!0});let u,d;if(a)u=a.before,d=a.after;else{let h=n_(t,e.from,e.workdir,n),b=n_(t,e.to,e.workdir,n);if(b.catch(()=>{}),u=await h,!u.ok)return u.failure;if(d=await b,!d.ok)return d.failure}if(!u.ok)return u.failure;if(!d.ok)return d.failure;let[p,f]=await Promise.all([qY(u.path),qY(d.path)]);if(!p||!f)return{...ne(Ro,"artifact-type-unsupported",`${e.name} ${e.from} \u2192 ${e.to} ships no classfiles of its own (an aggregator, starter, or relocated artifact) \u2014 its published API surface is not this jar's contents, so Drift did not claim a classfile comparison for it.`),packageRole:"jar"};let m=await e.exec("java",["-jar",l,"-o",u.path,"-n",d.path,"--only-modified","--ignore-missing-classes"],{cwd:e.workdir,timeoutMs:e.timeoutMs});if(m.stdout.trim().length===0)return ne(Ro,m.code===0?"no-public-surface":"toolchain-failed",m.code===0?`japicmp found no differences it could read between ${e.name} ${e.from} and ${e.to}.`:`japicmp execution failed on ${e.name}: ${uRe(m.stderr)}`);if(!lRe(m.stdout))return ne(Ro,"parse-failed",`japicmp output for ${e.name} was not in a recognised report format.`);let g=aRe(m.stdout);return{available:!0,changes:JY(m.stdout),...g>0?{sourceIncompatibleCount:g}:{},tool:Ro,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (classfiles)`,packageRole:"jar"}}},tRe=4;async function nRe(e){let t=e.readRepoFile;if(!t)return[];let n=[...new Set([e.manifestPath,"pom.xml"].filter(r=>!!r))],i=[];for(let r of n){let o=await t(r).catch(()=>null);if(o){for(let s of o.replace(//g,"").matchAll(/([\s\S]*?)<\/repositories>/g))for(let a of s[1].matchAll(/]*)?>([\s\S]*?)<\/repository>/g)){let c=Xn(a[1],"url");c&&/^https:\/\//i.test(c)&&i.push(c.replace(/\/+$/,""))}if(i.length>0)break}}return[...new Set(i)].slice(0,tRe)}function KY(e){let[t,n]=e.split(":");return!t||!n?null:{groupId:t,artifactId:n}}function TO(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.jar`}function VY(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.pom`}function BY(e){let t=(e??"jar").trim().toLowerCase();return t==="jar"||t==="bundle"?"library":t==="pom"?"pom":t==="maven-plugin"?"maven-plugin":"unsupported"}async function i_(e,t,n=[ds]){let i=VY(e,t,n[0]??ds),r=await Bt(i,{timeoutMs:6e4,maxBytes:GY});for(let o of n.slice(1)){if(r.ok)break;i=VY(e,t,o),r=await Bt(i,{timeoutMs:6e4,maxBytes:GY})}if(!r.ok)return{ok:!1,failure:ne(r_,r.status===404?"version-unavailable":"artifact-unavailable",r.status===404?`No POM for ${e.groupId}:${e.artifactId}:${t} in ${ZY(n)}.`:`The exact Maven POM at ${i} could not be downloaded (HTTP ${r.status||"unavailable"}).`)};try{return{ok:!0,contract:IO(r.bytes.toString("utf8"))}}catch(o){return{ok:!1,failure:ne(r_,"parse-failed",`The exact Maven POM at ${i} could not be parsed: ${o.message}`)}}}function IO(e){if(!/)/i.test(e))throw new Error("missing project element");let t=e.replace(//g,""),n=Xn(t,"packaging")??"jar",i=_h(t,"parent"),r=i?[Xn(i,"groupId"),Xn(i,"artifactId"),Xn(i,"version")].map(o=>o??"").join(":"):null;return{packaging:n,parent:r,properties:iRe(_h(t,"properties")),dependencyManagement:oRe(_h(t,"dependencyManagement")),pluginManagement:sRe(_h(t,"pluginManagement"))}}function rRe(e,t){let n=[];return e.packaging!==t.packaging&&n.push({kind:"signature-changed",symbol:"pom:packaging",detail:`The Maven artifact role changed from ${e.packaging} to ${t.packaging}.`,before:e.packaging,after:t.packaging}),e.parent!==t.parent&&n.push({kind:"signature-changed",symbol:"pom:parent",detail:"The inherited Maven parent coordinates changed.",before:e.parent??"(none)",after:t.parent??"(none)"}),xO("property",e.properties,t.properties,n),xO("dependencyManagement",e.dependencyManagement,t.dependencyManagement,n),xO("pluginManagement",e.pluginManagement,t.pluginManagement,n),n}function xO(e,t,n,i){for(let[r,o]of t){let s=`pom:${e}:${r}`;n.has(r)?n.get(r)!==o&&i.push({kind:"signature-changed",symbol:s,detail:`The ${e} entry ${r} changed in the published POM contract.`,before:o,after:n.get(r)}):i.push({kind:"export-removed",symbol:s,detail:`The ${e} entry ${r} was removed from the published POM contract.`,before:o})}}function Xn(e,t){return new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]?.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()||null}function _h(e,t){return e?new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]??null:null}function iRe(e){let t=new Map;if(!e)return t;let n=/<([A-Za-z_][\w.-]*)(?:\s[^>]*)?>([\s\S]*?)<\/\1>/g;for(let i of e.matchAll(n)){let r=i[2].replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();r&&t.set(i[1],r)}return t}function oRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/dependency>/g)){let i=n[1],r=`${Xn(i,"groupId")??""}:${Xn(i,"artifactId")??""}`;if(r===":")continue;let o=[...i.matchAll(/]*)?>([\s\S]*?)<\/exclusion>/g)].map(s=>`${Xn(s[1],"groupId")??""}:${Xn(s[1],"artifactId")??""}`).sort();t.set(r,[Xn(i,"version"),Xn(i,"type"),Xn(i,"scope"),Xn(i,"classifier"),...o].filter(Boolean).join("|"))}return t}function sRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/plugin>/g)){let i=n[1],r=`${Xn(i,"groupId")??"org.apache.maven.plugins"}:${Xn(i,"artifactId")??""}`;r.endsWith(":")||t.set(r,[Xn(i,"version"),_h(i,"configuration")?.replace(/\s+/g," ").trim()].filter(Boolean).join("|"))}return t}async function qY(e){let t=await(0,al.readFile)(e);return tO(t).some(n=>n.path.endsWith(".class"))}async function n_(e,t,n,i=[ds]){let r=TO(e,t,i[0]??ds),o=(0,WY.join)(n,`${e.artifactId}-${t}.jar`);try{let s=await Bt(r,{timeoutMs:6e4});for(let a of i.slice(1)){if(s.ok)break;r=TO(e,t,a),s=await Bt(r,{timeoutMs:6e4})}if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");return s.ok?(await(0,al.writeFile)(o,s.bytes),{ok:!0,path:o}):{ok:!1,failure:ne(Ro,s.status===404?"version-unavailable":"toolchain-failed",s.status===404?`No jar for ${e.groupId}:${e.artifactId}:${t} in ${ZY(i)}. It may be an internal artefact, or published only as a POM or a BOM.`:`${r} returned ${s.status}.`)}}catch(s){return{ok:!1,failure:ne(Ro,"toolchain-failed",`Could not download ${r}: ${s.message}`)}}}function JY(e){let t=[],n=null,i=[],r=[];for(let s of e.split(` -`)){let a=s.trim(),c=/^([-+*])\1\1([!*])?\s+(\w+)\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)(?:\s*\(<-\s*\w+\))?\s*:\s*(.+)$/.exec(a);if(!c)continue;let[,,l,u,d,p]=c,f=d==="CLASS"||d==="INTERFACE"||d==="ANNOTATION",m=cRe(p);if(!m)continue;if(f&&(n=m),!f&&n&&(d==="METHOD"||d==="CONSTRUCTOR")){let h=UY(p,n,l==="!");h&&(u==="REMOVED"?i.push(h):u==="NEW"&&r.push(h))}if(u==="NEW"||l!=="!")continue;let g=f||!n?m:`${n}.${m}`;u==="REMOVED"?t.push({kind:f?"export-removed":"member-removed",symbol:g,detail:f?`\`${g}\` is no longer published (was ${Eo(d.toLowerCase())}).`:`\`${g}\` was removed.`}):u==="MODIFIED"&&t.push({kind:"signature-changed",symbol:g,detail:f?`The declaration of \`${g}\` changed in a way an existing compiled caller may not be binary-compatible with.`:`The signature of \`${g}\` changed.`,after:p.trim()})}let o=zY(e);o&&t.push({kind:"runtime-requirement-raised",symbol:"Java",detail:`This version is compiled for Java ${o.to}; the previous one was Java ${o.from}. A project building or running on Java ${o.from} cannot use it \u2014 javac rejects it at build time and the JVM raises \`UnsupportedClassVersionError\` at runtime.`,before:String(o.from),after:String(o.to)});for(let s of jY(i,r))for(let a of s.types)t.push({kind:"export-removed",symbol:a.from,detail:`\`${a.from}\` is no longer part of this library's API: \`${s.fromPackage}\` moved to \`${s.toPackage}\`. Code that imports \`${a.from}\` no longer compiles against this version \u2014 import \`${a.to}\` instead.`,before:a.from,after:a.to});return t}function aRe(e){let t=0;for(let n of e.split(` -`))/^([-+*])\1\1\*\s+\w+\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/.test(n.trim())&&(t+=1);return t}function cRe(e){let n=(e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").replace(/\s+\(not serializable\)\s*$/,"").trim().split("(")[0].trim().split(/\s+/).pop()??"").trim();return/^[\w.$]+$/.test(n)?n:null}function lRe(e){return/Comparing (?:binary|source) compatibility/i.test(e)||/^[*+-]{3}/m.test(e)||/^(?:UNCHANGED|MODIFIED|REMOVED|NEW)\s+(?:CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/m.test(e)}function ZY(e){let t=e.filter(n=>n!==ds);return t.length===0?"Maven Central":`Maven Central or ${t.join(", ")} (declared by this project)`}function uRe(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var ll=require("node:fs/promises"),tp=require("node:path"),d9=require("node:crypto");var dRe=/(^|\/)(detail|details|internal|impl|private|priv|test|tests|examples?|demos?|sketch(es)?|dev|sandbox|tools?|scripts?|fuzz|contrib|bench|benchmarks?|docs?|third[_-]?party|extern(al)?|deps?)(\/|$)/i,pRe=/(^|\/)(_|.*[-_](inl|impl|internal|private|guts)\.)|(^|\/)[\w-]*guts\.h$/i,fRe=/\.(h|hpp|hh|hxx|h\+\+|inl|tpp)$/i,mRe=/(^|_)(VERSION|VERNUM|VER)(_?(MAJOR|MINOR|PATCH|REVISION|SUBREVISION|BUILD|STRING|NUM|TEXT|CODE))?$/i,gRe=["include/","inc/","src/",""];function AO(e){let t=hRe(e);return e.map(n=>({path:n.slice(t.length),original:n})).filter(n=>fRe.test(n.path)).filter(n=>!dRe.test(n.path)).filter(n=>!pRe.test(n.path)).filter(n=>gRe.some(i=>n.path.startsWith(i)))}function hRe(e){let t=e[0];if(!t)return"";let n=t.indexOf("/");if(n===-1)return"";let i=t.slice(0,n+1);return e.every(r=>r.startsWith(i))?i:""}function RO(e){let t=new Map;for(let n of e)for(let i of QY(n.content)){let r=t.get(i.name);r&&r.members.length>=i.members.length||t.set(i.name,i)}return t}function QY(e){let t=[],i=ORe(e).split(` -`),r=0,o=[],s=null,a=!1,c=()=>{for(;o.length>0&&r<=o.at(-1).depth;)o.pop()},l=(u,d)=>{for(let p=u;p<=d&&pyRe.test(S))&&s===null?s=r:y&&o.push({path:w?[]:y.split("::").filter(Boolean),depth:r,inline:w});let k=p.indexOf("{"),_=k>=0?p.slice(k+1).replace(/}\s*;?\s*$/,"").trim():"";if(_&&s===null&&!a){let S=YY(_,o.flatMap(x=>x.path));S&&t.push(S)}l(u,u);continue}if(s!==null||a){l(u,u);continue}let m=kRe(p);if(m){t.push(m),l(u,u);continue}let g=$Re(i,u,o.flatMap(y=>y.path));if(g){t.push(g.entry),l(u,g.endLine),u=g.endLine;continue}let h=DRe(i,u);if(!h){l(u,u);continue}let b=YY(h.text,o.flatMap(y=>y.path));b&&t.push(b),l(u,h.endLine),u=h.endLine}return t}var yRe=/^(detail|details|internal|impl|private|_\w+)$/i,bRe=/^\w*BEGIN_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE\b/,vRe=/^\w*(END_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE|BEGIN_PUBLIC_NAMESPACE)\b/;function wRe(e){let t=0;for(let n of e)n==="{"?t++:n==="}"&&t--;return t}function kRe(e){let t=/^#\s*define\s+(\w+)\s*(\([^)]*\))?\s*(.*)$/.exec(e);if(!t)return null;let n=t[1];if(/^_+|_H(_|PP)?$|_INCLUDED$|_GUARD$/i.test(n)||mRe.test(n))return null;let i=t[2]??"",r=t[3]?.trim()??"";return{name:n,kind:i?"function":"variable",signature:ps(`#define ${n}${i}${r?` ${r}`:""}`),members:[],requiredMembers:[]}}function $Re(e,t,n){let i=e[t].trim(),r=/^(?:typedef\s+)?(?:template\s*<[^>]*>\s*)?(struct|class|union|enum)(?:\s+class|\s+struct)?\s+(?:\w+_(?:API|EXPORT)\s+)?(\w+)?\s*(?::[^{]*)?\s*\{/.exec(i);if(!r)return null;let o=r[1],s=0,a=t,c=[];for(let f=t;ft&&c.push(m),s<=0&&f>=t){a=f;break}a=f}let l=e[a],u=/\}\s*(\w+)\s*;/.exec(l),d=r[2]??u?.[1];if(!d)return null;let p=Sh(n,d);return{entry:{name:p,kind:_Re(o),signature:ps(`${o} ${p}`),...SRe(c.join(` -`),o),requiredMembers:[]},endLine:a}}function _Re(e){return e==="enum"?"enum":e==="class"?"class":"interface"}function SRe(e,t){if(t==="enum")return{members:[...new Set(e.replace(/\{|\}[^}]*$/g,"").split(",").map(s=>/^\s*(\w+)/.exec(s)?.[1]).filter(s=>!!s))]};let n=[],i={},r=t!=="class",o=0;for(let s of e.split(` -`)){let a=s.trim(),c=/^(public|private|protected)\s*:/.exec(a);if(c){r=c[1]==="public";continue}let l=o;for(let f of a)f==="{"?o++:f==="}"&&o--;if(l>0||!r)continue;let u=NO(a);if(u){n.push(u.identity),i[u.identity]=u.signature;continue}let d=/(\w+)\s*\([^)]*\)\s*(?:const\s*)?(?:noexcept\s*)?[;{=]/.exec(a);if(d?.[1]&&!xh.has(d[1])){n.push(d[1]);continue}if(d?.[1])continue;let p=/^[\w:<>,\s*&[\]]+?(\w+)\s*(?:\[[^\]]*\]\s*)?(?:=\s*[^;]+)?;/.exec(a);p?.[1]&&!xh.has(p[1])&&!MRe.test(p[1])&&n.push(p[1])}return{members:[...new Set(n)],memberSignatures:i}}function xRe(e){return NO(e)?.identity??null}function NO(e){let t=e.search(/\boperator\b/);if(t<0)return null;let n=e.slice(t+8).trimStart(),i=IRe(n);if(!i)return null;let r=i.end;for(;/\s/.test(n[r]??"");)r++;if(n[r]!=="(")return null;let o=XY(n,r);if(!o)return null;let s=ARe(n.slice(o.end+1)),a=i.conversion?`operator ${i.name}`:/^[A-Za-z]/.test(i.name)?`operator ${i.name}(${o_(o.content)})`:`operator${i.name}(${o_(o.content)})`,c=ERe(e.slice(0,t)),l=`${a}${s}`,u=`${c?`${c} `:""}operator ${i.name}(${o_(o.content)})${s}`;return{identity:l,signature:u}}function ERe(e){return ps(e).replace(/\b(?:extern|static|inline|virtual|friend|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall)\b/g,"").replace(/\s+/g," ").trim()}var TRe=["<=>","->*","<<=",">>=","new[]","delete[]","()","[]","->","<<",">>","==","!=","<=",">=","&&","||","++","--","+=","-=","*=","/=","%=","^=","&=","|=","co_await","new","delete","+","-","*","/","%","^","&","|","~","!","=","<",">",","];function IRe(e){let t=/^""\s*([A-Za-z_]\w*)/.exec(e);if(t)return{name:`""${t[1]}`,end:t[0].length,conversion:!1};for(let i of TRe){let o=(i==="new[]"?/^new\s*\[\]/:i==="delete[]"?/^delete\s*\[\]/:null)?.exec(e)?.[0]??(e.startsWith(i)?i:null);if(o&&!(/^[A-Za-z_]/.test(i)&&/[A-Za-z0-9_]/.test(e[o.length]??"")))return{name:i,end:o.length,conversion:!1}}let n=0;for(let i=0;i"&&n>0)n--;else if(r==="("&&n===0){let o=ps(e.slice(0,i));return o?{name:o,end:i,conversion:!0}:null}}return null}function XY(e,t){let n=0;for(let i=t;i=0){let s=r+8;for(;/\s/.test(t[s]??"");)s++;if(t[s]==="("){let a=XY(t,s);n.push(a?`noexcept(${ps(a.content)})`:"noexcept")}else n.push("noexcept")}let o=/\brequires\s+(.+?)(?=\s*(?:;|\{|$))/.exec(t)?.[1];return o&&n.push(`requires ${ps(o)}`),n.length>0?` ${n.join(" ")}`:""}function YY(e,t=[]){let n=e.trim().replace(/^(?:\[\[[^\]]*\]\]\s*)+/,"").replace(/\s+/g," ");if(!n||n.startsWith("#"))return null;let i=/^typedef\s+(.+?)\s*;$/.exec(n);if(i){let l=/\(\s*\*\s*(\w+)\s*\)/.exec(i[1])?.[1]??/(\w+)\s*(?:\[[^\]]*\])?$/.exec(i[1])?.[1];return!l||xh.has(l)?null:{name:Sh(t,l),kind:"type",signature:ps(n),members:[],requiredMembers:[]}}let r=RRe(n);if(xRe(n)){let c=NO(n);return{name:Sh(t,c.identity),kind:"function",signature:c.signature,members:[],requiredMembers:[]}}let s=/^((?:const\s+|unsigned\s+|signed\s+|struct\s+|enum\s+|class\s+)*[\w:]+(?:\s*<[^>]*>)?[\s*&]+)(\w+)\s*\(([^)]*)\)\s*(const)?\s*(?:noexcept)?\s*[;{]$/.exec(r);if(s){let c=ps(s[1]),l=s[2];return xh.has(l)?null:{name:Sh(t,l),kind:"function",signature:`${c} ${l}(${o_(s[3])})${s[4]?" const":""}`,members:[],requiredMembers:[]}}let a=/^extern\s+((?:const\s+)?[\w:]+[\s*&]+)(\w+)\s*(?:\[[^\]]*\])?\s*;$/.exec(n);if(a){let c=a[2];return xh.has(c)?null:{name:Sh(t,c),kind:"variable",signature:ps(n.replace(/;$/,"")),members:[],requiredMembers:[]}}return null}function RRe(e){let t=e;for(;;){let n=/^(?:extern|static|inline|constexpr|virtual|explicit|friend|EXTERN_C|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall|__forceinline|__inline__|__restrict__|__host__|__device__|[A-Za-z_]\w*_(?:API|EXPORT))\s+/.exec(t);if(n){t=t.slice(n[0].length);continue}let i=/^(?:__declspec|__attribute__)\s*/.exec(t);if(!i)return t;let r=i[0].length;if(t[r]!=="(")return t;let o=0;for(;r{let r=n.split("=")[0].trim().replace(/\s*\[[^\]]*\]\s*$/,"");if(r.split(/(?<=[\s*&])/).length<2)return r;let s=/\b(\w+)\s*$/.exec(r)?.[1];if(s&&NRe.has(s))return r;let a=r.match(/\b\w+\b/g)??[];return a.length===2&&CRe.has(a[0])?r:r.replace(/\b\w+\s*$/,"").trim()||r}).join(", ")}var NRe=new Set(["void","bool","char","wchar_t","char8_t","char16_t","char32_t","short","int","long","float","double","signed","unsigned","const","volatile"]),CRe=new Set(["struct","class","enum","union","const","volatile","signed","unsigned","short","long"]);function PRe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"||r==="("||r==="["?n++:(r===">"||r===")"||r==="]")&&n--,r===","&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t}function DRe(e,t){let n="";for(let i=t;iFRe(e,t)}}var n9=CO("arduino"),r9=CO("conan"),i9=CO("vcpkg");async function FRe(e,t){let n=LRe[e];if(!n)return ne(cl,"unsupported-ecosystem",`No source resolver for ${e}.`);let i=e9(e,n,t,t.from),r=e9(e,n,t,t.to);r.catch(()=>{});let o=await i;if(!o.ok)return o.failure;let s=await r;return s.ok?o.api.size===0&&s.api.size===0?ne(cl,"no-public-surface",`No declarations could be read from ${t.name}'s headers in either version. A library whose API is generated by macros, or shipped as a prebuilt binary, has no header text to compare.`):{available:!0,changes:Dr(o.api,s.api),tool:cl,weight:t9,locator:`${t.name} ${t.from} \u2192 ${t.to} (public headers)`}:s.failure}async function e9(e,t,n,i){let r=await t(n.name,i);if(!r)return{ok:!1,failure:ne(cl,"version-unavailable",`No source archive is published for ${n.name} ${i} in ${URe(e)}, so its headers could not be read.`)};let o;try{let s=await Bt(r,{timeoutMs:n.timeoutMs});if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");if(!s.ok)return{ok:!1,failure:ne(cl,"version-unavailable",`${r} returned ${s.status}.`)};let a=Fn(s.bytes),c=new Map(a.map(l=>[l.path,l]));o=AO([...c.keys()]).map(l=>({path:l.path,content:c.get(l.original).read().toString("utf8")})).filter(l=>l.content.length>0)}catch(s){return{ok:!1,failure:ne(cl,"artifact-unavailable",`Could not read ${n.name} ${i} from ${r}: ${s.message}`)}}return n.logger.debug(`${n.name} ${i}: ${o.length} public header(s)`),{ok:!0,api:RO(o)}}function URe(e){return e==="conan"?"ConanCenter":e==="vcpkg"?"the vcpkg registry":"the Arduino Library Manager"}async function jRe(e,t){let n=await Uk(e),i=n?.archives[t];if(i)return i;let r=n?.githubRepo??await zRe(e);return r?PO(r,t):null}async function zRe(e){return(await Wn(e,"arduino",null))?.githubRepo??null}async function GRe(e,t){let n=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,i=await rt(`${n}/config.yml`);if(!i)return null;let r=o9(i,t)??VRe(i);if(!r)return null;let o=await rt(`${n}/${r}/conandata.yml`);if(!o)return null;let s=s9(o,t);if(s)return s;let a=BRe(o);return a?PO(a,t):null}function VRe(e){return/folder\s*:\s*["']?([^"'\s]+)["']?/.exec(e)?.[1]??null}function BRe(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function PO(e,t){let i=(await $e(`https://api.github.com/repos/${e}/tags?per_page=100`)??[]).map(r=>r.name).find(r=>!!r&&Xd(r,t));return i?`https://codeload.github.com/${e}/tar.gz/refs/tags/${encodeURIComponent(i)}`:null}function o9(e,t){let n=e.split(` -`),i=null;for(let r of n){let o=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(r.replace(/\s+$/,""));if(o){i=o[1].trim();continue}let s=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(r);if(s&&i===t)return s[1]}return null}function s9(e,t){let n=e.split(` -`),i=!1,r=!1;for(let o of n){let s=o.replace(/\s+$/,"");if(!s.trim())continue;if(/^sources\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1,r=!1;continue}if(!i)continue;let a=/^ {2}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim()===t;continue}if(!r)continue;let c=/https?:\/\/\S+/.exec(s);if(c&&!c[0].endsWith(".git"))return c[0].replace(/["',]+$/,"")}return null}async function qRe(e,t){let n=await $e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`),i=Lt(n?.homepage??null);return i?PO(i,t):null}function Xd(e,t){let n=i=>i.replace(/^[^\d]*/,"").replace(/_/g,".");return e===t||n(e)===n(t)}var Un="python ast",WRe="Install Python 3 and make `python3` available on PATH.",a9=.9,HRe=.6,p9={ecosystem:"pypi",tool:Un,weight:a9,async compute(e){if(!await Jk(e.exec,"python3",["--version"]))return ne(Un,"tool-missing",`Python 3 is not installed, so ${e.name}'s public symbols could not be compared.`,WRe);await(0,ll.mkdir)(e.workdir,{recursive:!0});let t=(0,tp.join)(e.workdir,"surface.py");await(0,ll.writeFile)(t,m9,"utf8");let n=`${iNe}/${await oNe(e)}`,i=Date.now()+e.timeoutMs,r=c9(e,e.from,t,n,i),o=c9(e,e.to,t,n,i);o.catch(()=>{});let s=await r;if(!s.ok)return s.failure;let a=await o;if(!a.ok)return a.failure;let c=s.usedGitHubFallback||a.usedGitHubFallback,l=c?"; source: GitHub tag mirror, PyPI archive was unreadable":"";return{available:!0,changes:Dr(s.api,a.api),tool:Un,weight:c?HRe:a9,locator:`${e.name} ${e.from} \u2192 ${e.to} (public symbols, best-effort${l})`}}};function ki(e){return Math.max(0,e-Date.now())}var ep=new Map;async function c9(e,t,n,i,r){let o=`python-surface:${i}:${e.name}@${t}`;for(;;){let s=ki(r);if(s<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let a=ep.get(o);if(a){let l=await t_(a.promise,s);if(l.timedOut)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};if(!l.value.ok&&l.value.budgetExhausted){ep.get(o)===a&&ep.delete(o);continue}return l.value}let c=(async()=>{let l=await Na(o);if(l)return{ok:!0,api:new Map(l),usedGitHubFallback:!1};let u=await KRe(e,t,n,r);return u.ok?(u.usedGitHubFallback||await Ca(o,[...u.api]),u):ki(r)<=0?{...u,budgetExhausted:!0}:u})();return ep.set(o,{promise:c}),c.catch(()=>{}).then(()=>{ep.get(o)?.promise===c&&ep.delete(o)}),c}}async function KRe(e,t,n,i){if(ki(i)<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let r=await nNe(e.name,t,ki(i));if(!r)return{ok:!1,failure:ne(Un,"version-unavailable",`PyPI has no source archive for ${e.name} ${t}. It may be private, yanked, or published only as a built wheel Drift cannot open.`)};let o=(0,tp.join)(e.workdir,`probe-${t.replace(/[^\w.-]/g,"_")}`),s,a=!1;try{await(0,ll.mkdir)(o,{recursive:!0});let d=await Bt(r.url,{timeoutMs:ki(i),retries:2});if(d.ok)s=d.bytes;else{let p=ki(i)>0?await QRe(e.name,t,i):null;if(!p)return d.status===0?{ok:!1,failure:ne(Un,"toolchain-failed",`Could not download ${r.url}: ${d.error??"the request did not complete"}`)}:{ok:!1,failure:ne(Un,"version-unavailable",`PyPI returned ${d.status} for ${r.url}.`)};s=p,a=!0}}catch(d){return{ok:!1,failure:ne(Un,"toolchain-failed",`Could not download ${r.url}: ${d.message}`)}}let c=0;try{let d=Fn(s),p=d,f="";if(a){let m=tNe(d.map(h=>h.path),e.name);if(!m)return{ok:!1,failure:ne(Un,"no-public-surface",`Could not confidently identify ${e.name}'s own source directory inside its GitHub repository, so the fallback was declined rather than comparing the whole repository.`)};let g=`${m}/`;p=d.filter(h=>h.path.startsWith(g)),f=m.slice(0,m.lastIndexOf("/")+1)}for(let m of p){let g=ZRe(f?m.path.slice(f.length):m.path);if(!g)continue;let h=(0,tp.join)(o,g);await(0,ll.mkdir)((0,tp.dirname)(h),{recursive:!0}),await(0,ll.writeFile)(h,m.read()),c+=1}}catch(d){return{ok:!1,failure:ne(Un,"toolchain-failed",`Could not unpack ${r.filename}: ${l9(d.message)}`)}}if(c===0)return{ok:!1,failure:ne(Un,"no-public-surface",`${e.name} ${t} ships no Python sources Drift could read.`)};if(ki(i)<=0)return{ok:!1,failure:ne(Un,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t}'s source could be parsed.`)};let l=await e.exec("python3",[n,o,e.name],{timeoutMs:ki(i)});if(l.code!==0)return{ok:!1,failure:ne(Un,"parse-failed",`Could not read ${e.name} ${t}'s public symbols: ${l9(l.stderr)}`)};let u=f9(l.stdout);return u?u.size===0?{ok:!1,failure:ne(Un,"no-public-surface",`${e.name} ${t} declares no public symbols Drift could read statically.`)}:{ok:!0,api:u,usedGitHubFallback:a}:{ok:!1,failure:ne(Un,"parse-failed",`Unreadable symbol listing for ${e.name} ${t}.`)}}var JRe=new Set(["test","tests",".git","__pycache__"]);function ZRe(e){let t=e.split("/").filter(s=>s!==""&&s!==".");if(t.length===0||t.some(s=>s==="..")||e.startsWith("/")||/^[a-zA-Z]:/.test(e)||t.slice(0,-1).some(s=>JRe.has(s)))return null;let n=t.at(-1),i=n.endsWith(".py")||n.endsWith(".pyi"),r=["pyproject.toml","setup.cfg","setup.py"].includes(n),o=n==="top_level.txt"&&t.some(s=>s.endsWith(".dist-info")||s.endsWith(".egg-info"));return!i&&!r&&!o?null:t.join("/")}var YRe=25*1024*1024;async function QRe(e,t,n){let i=await Wn(e,"pypi",t);if(!i?.githubRepo||ki(n)<=0)return null;let r=await $e(`https://api.github.com/repos/${i.githubRepo}/tags?per_page=100`,{timeoutMs:ki(n)}),o=XRe(r??[],e,t);if(!o||ki(n)<=0)return null;let a=r?.find(l=>l.name===o)?.commit?.sha??`refs/tags/${o}`,c=await Bt(`https://codeload.github.com/${i.githubRepo}/tar.gz/${a}`,{timeoutMs:ki(n),retries:2,maxBytes:YRe});return c.ok?c.bytes:null}function XRe(e,t,n){let i=e.filter(a=>!!a.name&&Xd(a.name,n)),r=t.toLowerCase().replace(/[_.]/g,"-"),o=new RegExp(`(^|[^a-z0-9])${eNe(r)}([^a-z0-9]|$)`),s=i.filter(a=>o.test(a.name.toLowerCase().replace(/[_.]/g,"-")));return s.length===1?s[0].name:s.length>1?null:i.length===1?i[0].name:null}function eNe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tNe(e,t){let n=t.toLowerCase().replace(/[-.]+/g,"_"),i=new Set;for(let r of e){let o=r.split("/").filter(s=>s!=="");for(let s=0;sc.packagetype==="sdist"),s=r.find(c=>c.packagetype==="bdist_wheel"),a=o??s;return a?{url:a.url,filename:a.filename}:null}var rNe={function:"function",class:"class",variable:"variable",unknown:"unknown"};function f9(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t))return null;let n=new Map;for(let i of t)if(i?.name){if(i.shapeUnknown){n.set(i.name,{name:i.name,kind:"unknown",signature:i.name,members:[],requiredMembers:[],shapeUnknown:!0});continue}n.set(i.name,{name:i.name,kind:rNe[i.kind]??"variable",signature:i.signature??i.name,members:i.members??[],requiredMembers:[],...Array.isArray(i.callable)?{callable:{parameters:i.callable}}:{}})}return n}var m9=`import ast, json, os, re, sys +`,"utf8"),await(0,cl.writeFile)((0,Ih.join)(o,"apidump.go"),v8,"utf8");let s=await e("go",["build","-o",(0,Ih.join)(o,"apidump-check"),"."],{cwd:o,timeoutMs:12e4,env:RO(n)});return s.code!==0?(t.debug(`Drift's Go API extractor failed to build: ${CO(s.stderr)}`),null):o}catch(o){return t.debug(`Could not create the Go scratch module: ${o.message}`),null}})(),N8.set(i,r),r}function RO(e=process.env){return{...e,GOFLAGS:"-mod=mod"}}function CO(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var ll=require("node:fs/promises"),Q8=require("node:path");var F8=require("node:crypto"),Ao=require("node:fs/promises"),U8=require("node:os"),Ah=require("node:path");var NO=new Map,tRe=new Map;function nRe(){let e=Uc()??(0,Ah.join)((0,U8.tmpdir)(),"drift-cache");return(0,Ah.join)(e,"helpers")}function L8(e){return(0,F8.createHash)("sha256").update(e).digest("hex")}function j8(e){let t=tRe.get(e.id);if(t)return Promise.resolve({ok:!0,path:t});let n=`${e.id}@${e.version}#${e.sha256}`,i=NO.get(n);if(i)return i;let r=rRe(e).finally(()=>NO.delete(n));return NO.set(n,r),r}async function rRe(e){let t=nRe(),n=(0,Ah.join)(t,`${e.id}-${e.version}.${e.extension??"jar"}`);try{let s=await(0,Ao.readFile)(n);if(L8(s)===e.sha256)return{ok:!0,path:n}}catch{}let i;try{i=await Bt(e.url,{timeoutMs:12e4})}catch(s){return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s.message}`}}}if(!i.ok){let s=i.status?`HTTP ${i.status}`:i.error??"the request failed";return{ok:!1,error:{kind:"download-failed",detail:`${e.url}: ${s}`}}}let r=L8(i.bytes);if(r!==e.sha256)return{ok:!1,error:{kind:"checksum-failed",detail:`${e.url}: expected SHA-256 ${e.sha256}, got ${r}`}};let o=(0,Ah.join)(t,`.${e.id}-${e.version}.${process.pid}.${Date.now()}.tmp`);try{return await(0,Ao.mkdir)(t,{recursive:!0}),await(0,Ao.writeFile)(o,i.bytes),await(0,Ao.rename)(o,n),{ok:!0,path:n}}catch(s){return await(0,Ao.rm)(o,{force:!0}).catch(()=>{}),{ok:!1,error:{kind:"cache-failed",detail:`${n}: ${s.message}`}}}}function B8(e){let t=0,n="";for(let i of e)i==="<"?t++:i===">"?t=Math.max(0,t-1):t===0&&(n+=i);return n.replace(/\[\]/g,"").trim()}function iRe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"?n++:r===">"&&(n=Math.max(0,n-1)),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t.map(r=>B8(r)).filter(r=>r.length>0)}function q8(e,t,n){let i=e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").trim(),r=i.indexOf("("),o=i.lastIndexOf(")");if(r===-1||o0?e.slice(0,t):null}function G8(e){return e.slice(e.lastIndexOf(".")+1)}function W8(e,t){let n=c=>`${c.owner} ${c.name} ${c.params.length}`,i=new Map;for(let c of t){let l=i.get(n(c));l?l.push(c):i.set(n(c),[c])}let r=new Map;for(let c of e)for(let l of i.get(n(c))??[]){let u=[...c.params,...c.returns===null?[]:[c.returns]],d=[...l.params,...l.returns===null?[]:[l.returns]];if(u.length===d.length)for(let[p,f]of u.entries()){let m=d[p];if(f===m||G8(f)!==G8(m))continue;let g=z8(f),h=z8(m);if(!g||!h||g===h)continue;let b=`${g} ${h}`,y=r.get(b);y||(y={types:new Map,witnesses:new Set,binaryBreaking:!1},r.set(b,y)),y.types.set(f,m),y.witnesses.add(`${c.owner}.${c.name}/${c.params.length}`),c.binaryBreaking&&(y.binaryBreaking=!0)}}let o=[];for(let[c,l]of r){if(!l.binaryBreaking||l.witnesses.size<2)continue;let[u,d]=c.split(" ");o.push({fromPackage:u,toPackage:d,types:[...l.types].map(([p,f])=>({from:p,to:f}))})}o.sort((c,l)=>l.types.length-c.types.length||c.fromPackage.localeCompare(l.fromPackage));let s=64,a=[];for(let c of o){if(s<=0)break;a.push({...c,types:c.types.slice(0,s)}),s-=Math.min(s,c.types.length)}return a}function V8(e){let t=e-44;return t>=5&&t<=99?t:null}function K8(e){let t=0,n=0;for(let o of e.split(` +`)){let s=/CLASS FILE FORMAT VERSION:\s*(\d+)(?:\.\d+)?\s*<-\s*(\d+)(?:\.\d+)?/.exec(o);s&&(n=Math.max(n,Number(s[1])),t=Math.max(t,Number(s[2])))}if(n<=t)return null;let i=V8(t),r=V8(n);return i!==null&&r!==null?{from:i,to:r}:null}var Ro="japicmp",u$="Maven POM contract",ds="https://repo1.maven.org/maven2",H8=5*1024*1024,DO="0.23.1",oRe=`${ds}/com/github/siom79/japicmp/japicmp/${DO}/japicmp-${DO}-jar-with-dependencies.jar`,sRe="f2300a8531b68e25b678247874a1eae13a07d6842a4a1236845481fc90c5c6c7",aRe="Install a JDK (11 or newer) and re-run. Drift downloads and runs japicmp itself, but does not install Java.",X8={ecosystem:"maven",tool:Ro,weight:1,async compute(e){let t=e9(e.name);if(!t)return ne(Ro,"unsupported-ecosystem",`\`${e.name}\` is not a \`groupId:artifactId\` coordinate, so Drift could not locate it on Maven Central.`);let n=[ds,...await lRe(e)],[i,r]=await Promise.all([d$(t,e.from,n),d$(t,e.to,n)]);if(!i.ok)return i.failure;if(!r.ok)return r.failure;let o=Z8(i.contract.packaging),s=Z8(r.contract.packaging);if(o==="pom"||s==="pom")return{available:!0,changes:uRe(i.contract,r.contract),tool:u$,weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (POM contract; ${o} \u2192 ${s})`,packageRole:s};let a;if(o!=="library"||s!=="library"){await(0,ll.mkdir)(e.workdir,{recursive:!0});let[h,b]=await Promise.all([l$(t,e.from,e.workdir,n),l$(t,e.to,e.workdir,n)]);if(!h.ok||!b.ok)return{...ne(u$,"artifact-type-unsupported",`${e.name} is packaged as ${r.contract.packaging}, not as a Java library jar, and publishes no companion jar Drift could compare instead.`),packageRole:s};a={before:h,after:b}}if(!await n_(e.exec,"java",["-version"]))return ne(Ro,"tool-missing",`Java is not installed, so ${e.name}'s classfile API could not be compared directly.`,aRe);let c=await j8({id:"japicmp",version:DO,url:oRe,sha256:sRe});if(!c.ok){let h=c.error.kind==="checksum-failed"?`Drift's pinned japicmp helper failed its SHA-256 check and was not run (${c.error.detail}).`:c.error.kind==="cache-failed"?`Drift verified its pinned japicmp helper but could not cache it for use (${c.error.detail}).`:`Drift could not download its pinned japicmp helper (${c.error.detail}).`;return ne(Ro,"toolchain-failed",h)}let l=c.path;await(0,ll.mkdir)(e.workdir,{recursive:!0});let u,d;if(a)u=a.before,d=a.after;else{let h=l$(t,e.from,e.workdir,n),b=l$(t,e.to,e.workdir,n);if(b.catch(()=>{}),u=await h,!u.ok)return u.failure;if(d=await b,!d.ok)return d.failure}if(!u.ok)return u.failure;if(!d.ok)return d.failure;let[p,f]=await Promise.all([Y8(u.path),Y8(d.path)]);if(!p||!f)return{...ne(Ro,"artifact-type-unsupported",`${e.name} ${e.from} \u2192 ${e.to} ships no classfiles of its own (an aggregator, starter, or relocated artifact) \u2014 its published API surface is not this jar's contents, so Drift did not claim a classfile comparison for it.`),packageRole:"jar"};let m=await e.exec("java",["-jar",l,"-o",u.path,"-n",d.path,"--only-modified","--ignore-missing-classes"],{cwd:e.workdir,timeoutMs:e.timeoutMs});if(m.stdout.trim().length===0)return ne(Ro,m.code===0?"no-public-surface":"toolchain-failed",m.code===0?`japicmp found no differences it could read between ${e.name} ${e.from} and ${e.to}.`:`japicmp execution failed on ${e.name}: ${yRe(m.stderr)}`);if(!hRe(m.stdout))return ne(Ro,"parse-failed",`japicmp output for ${e.name} was not in a recognised report format.`);let g=mRe(m.stdout);return{available:!0,changes:t9(m.stdout),...g>0?{sourceIncompatibleCount:g}:{},tool:Ro,weight:1,locator:`${e.name} ${e.from} \u2192 ${e.to} (classfiles)`,packageRole:"jar"}}},cRe=4;async function lRe(e){let t=e.readRepoFile;if(!t)return[];let n=[...new Set([e.manifestPath,"pom.xml"].filter(r=>!!r))],i=[];for(let r of n){let o=await t(r).catch(()=>null);if(o){for(let s of o.replace(//g,"").matchAll(/([\s\S]*?)<\/repositories>/g))for(let a of s[1].matchAll(/]*)?>([\s\S]*?)<\/repository>/g)){let c=Qn(a[1],"url");c&&/^https:\/\//i.test(c)&&i.push(c.replace(/\/+$/,""))}if(i.length>0)break}}return[...new Set(i)].slice(0,cRe)}function e9(e){let[t,n]=e.split(":");return!t||!n?null:{groupId:t,artifactId:n}}function OO(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.jar`}function J8(e,t,n=ds){let i=e.groupId.replace(/\./g,"/");return`${n}/${i}/${e.artifactId}/${t}/${e.artifactId}-${t}.pom`}function Z8(e){let t=(e??"jar").trim().toLowerCase();return t==="jar"||t==="bundle"?"library":t==="pom"?"pom":t==="maven-plugin"?"maven-plugin":"unsupported"}async function d$(e,t,n=[ds]){let i=J8(e,t,n[0]??ds),r=await Bt(i,{timeoutMs:6e4,maxBytes:H8});for(let o of n.slice(1)){if(r.ok)break;i=J8(e,t,o),r=await Bt(i,{timeoutMs:6e4,maxBytes:H8})}if(!r.ok)return{ok:!1,failure:ne(u$,r.status===404?"version-unavailable":"artifact-unavailable",r.status===404?`No POM for ${e.groupId}:${e.artifactId}:${t} in ${n9(n)}.`:`The exact Maven POM at ${i} could not be downloaded (HTTP ${r.status||"unavailable"}).`)};try{return{ok:!0,contract:MO(r.bytes.toString("utf8"))}}catch(o){return{ok:!1,failure:ne(u$,"parse-failed",`The exact Maven POM at ${i} could not be parsed: ${o.message}`)}}}function MO(e){if(!/)/i.test(e))throw new Error("missing project element");let t=e.replace(//g,""),n=Qn(t,"packaging")??"jar",i=Rh(t,"parent"),r=i?[Qn(i,"groupId"),Qn(i,"artifactId"),Qn(i,"version")].map(o=>o??"").join(":"):null;return{packaging:n,parent:r,properties:dRe(Rh(t,"properties")),dependencyManagement:pRe(Rh(t,"dependencyManagement")),pluginManagement:fRe(Rh(t,"pluginManagement"))}}function uRe(e,t){let n=[];return e.packaging!==t.packaging&&n.push({kind:"signature-changed",symbol:"pom:packaging",detail:`The Maven artifact role changed from ${e.packaging} to ${t.packaging}.`,before:e.packaging,after:t.packaging}),e.parent!==t.parent&&n.push({kind:"signature-changed",symbol:"pom:parent",detail:"The inherited Maven parent coordinates changed.",before:e.parent??"(none)",after:t.parent??"(none)"}),PO("property",e.properties,t.properties,n),PO("dependencyManagement",e.dependencyManagement,t.dependencyManagement,n),PO("pluginManagement",e.pluginManagement,t.pluginManagement,n),n}function PO(e,t,n,i){for(let[r,o]of t){let s=`pom:${e}:${r}`;n.has(r)?n.get(r)!==o&&i.push({kind:"signature-changed",symbol:s,detail:`The ${e} entry ${r} changed in the published POM contract.`,before:o,after:n.get(r)}):i.push({kind:"export-removed",symbol:s,detail:`The ${e} entry ${r} was removed from the published POM contract.`,before:o})}}function Qn(e,t){return new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]?.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()||null}function Rh(e,t){return e?new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${t}>`,"i").exec(e)?.[1]??null:null}function dRe(e){let t=new Map;if(!e)return t;let n=/<([A-Za-z_][\w.-]*)(?:\s[^>]*)?>([\s\S]*?)<\/\1>/g;for(let i of e.matchAll(n)){let r=i[2].replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim();r&&t.set(i[1],r)}return t}function pRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/dependency>/g)){let i=n[1],r=`${Qn(i,"groupId")??""}:${Qn(i,"artifactId")??""}`;if(r===":")continue;let o=[...i.matchAll(/]*)?>([\s\S]*?)<\/exclusion>/g)].map(s=>`${Qn(s[1],"groupId")??""}:${Qn(s[1],"artifactId")??""}`).sort();t.set(r,[Qn(i,"version"),Qn(i,"type"),Qn(i,"scope"),Qn(i,"classifier"),...o].filter(Boolean).join("|"))}return t}function fRe(e){let t=new Map;if(!e)return t;for(let n of e.matchAll(/]*)?>([\s\S]*?)<\/plugin>/g)){let i=n[1],r=`${Qn(i,"groupId")??"org.apache.maven.plugins"}:${Qn(i,"artifactId")??""}`;r.endsWith(":")||t.set(r,[Qn(i,"version"),Rh(i,"configuration")?.replace(/\s+/g," ").trim()].filter(Boolean).join("|"))}return t}async function Y8(e){let t=await(0,ll.readFile)(e);return lO(t).some(n=>n.path.endsWith(".class"))}async function l$(e,t,n,i=[ds]){let r=OO(e,t,i[0]??ds),o=(0,Q8.join)(n,`${e.artifactId}-${t}.jar`);try{let s=await Bt(r,{timeoutMs:6e4});for(let a of i.slice(1)){if(s.ok)break;r=OO(e,t,a),s=await Bt(r,{timeoutMs:6e4})}if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");return s.ok?(await(0,ll.writeFile)(o,s.bytes),{ok:!0,path:o}):{ok:!1,failure:ne(Ro,s.status===404?"version-unavailable":"toolchain-failed",s.status===404?`No jar for ${e.groupId}:${e.artifactId}:${t} in ${n9(i)}. It may be an internal artefact, or published only as a POM or a BOM.`:`${r} returned ${s.status}.`)}}catch(s){return{ok:!1,failure:ne(Ro,"toolchain-failed",`Could not download ${r}: ${s.message}`)}}}function t9(e){let t=[],n=null,i=[],r=[];for(let s of e.split(` +`)){let a=s.trim(),c=/^([-+*])\1\1([!*])?\s+(\w+)\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)(?:\s*\(<-\s*\w+\))?\s*:\s*(.+)$/.exec(a);if(!c)continue;let[,,l,u,d,p]=c,f=d==="CLASS"||d==="INTERFACE"||d==="ANNOTATION",m=gRe(p);if(!m)continue;if(f&&(n=m),!f&&n&&(d==="METHOD"||d==="CONSTRUCTOR")){let h=q8(p,n,l==="!");h&&(u==="REMOVED"?i.push(h):u==="NEW"&&r.push(h))}if(u==="NEW"||l!=="!")continue;let g=f||!n?m:`${n}.${m}`;u==="REMOVED"?t.push({kind:f?"export-removed":"member-removed",symbol:g,detail:f?`\`${g}\` is no longer published (was ${Eo(d.toLowerCase())}).`:`\`${g}\` was removed.`}):u==="MODIFIED"&&t.push({kind:"signature-changed",symbol:g,detail:f?`The declaration of \`${g}\` changed in a way an existing compiled caller may not be binary-compatible with.`:`The signature of \`${g}\` changed.`,after:p.trim()})}let o=K8(e);o&&t.push({kind:"runtime-requirement-raised",symbol:"Java",detail:`This version is compiled for Java ${o.to}; the previous one was Java ${o.from}. A project building or running on Java ${o.from} cannot use it \u2014 javac rejects it at build time and the JVM raises \`UnsupportedClassVersionError\` at runtime.`,before:String(o.from),after:String(o.to)});for(let s of W8(i,r))for(let a of s.types)t.push({kind:"export-removed",symbol:a.from,detail:`\`${a.from}\` is no longer part of this library's API: \`${s.fromPackage}\` moved to \`${s.toPackage}\`. Code that imports \`${a.from}\` no longer compiles against this version \u2014 import \`${a.to}\` instead.`,before:a.from,after:a.to});return t}function mRe(e){let t=0;for(let n of e.split(` +`))/^([-+*])\1\1\*\s+\w+\s+(CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/.test(n.trim())&&(t+=1);return t}function gRe(e){let n=(e.replace(/\s*\(<-\s*[^)]+\)/g,"").replace(/\([+-]\)/g,"").replace(/\s+\(not serializable\)\s*$/,"").trim().split("(")[0].trim().split(/\s+/).pop()??"").trim();return/^[\w.$]+$/.test(n)?n:null}function hRe(e){return/Comparing (?:binary|source) compatibility/i.test(e)||/^[*+-]{3}/m.test(e)||/^(?:UNCHANGED|MODIFIED|REMOVED|NEW)\s+(?:CLASS|METHOD|FIELD|CONSTRUCTOR|INTERFACE|ANNOTATION|SUPERCLASS)/m.test(e)}function n9(e){let t=e.filter(n=>n!==ds);return t.length===0?"Maven Central":`Maven Central or ${t.join(", ")} (declared by this project)`}function yRe(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var dl=require("node:fs/promises"),np=require("node:path"),y9=require("node:crypto");var bRe=/(^|\/)(detail|details|internal|impl|private|priv|test|tests|examples?|demos?|sketch(es)?|dev|sandbox|tools?|scripts?|fuzz|contrib|bench|benchmarks?|docs?|third[_-]?party|extern(al)?|deps?)(\/|$)/i,vRe=/(^|\/)(_|.*[-_](inl|impl|internal|private|guts)\.)|(^|\/)[\w-]*guts\.h$/i,wRe=/\.(h|hpp|hh|hxx|h\+\+|inl|tpp)$/i,kRe=/(^|_)(VERSION|VERNUM|VER)(_?(MAJOR|MINOR|PATCH|REVISION|SUBREVISION|BUILD|STRING|NUM|TEXT|CODE))?$/i,_Re=["include/","inc/","src/",""];function LO(e){let t=$Re(e);return e.map(n=>({path:n.slice(t.length),original:n})).filter(n=>wRe.test(n.path)).filter(n=>!bRe.test(n.path)).filter(n=>!vRe.test(n.path)).filter(n=>_Re.some(i=>n.path.startsWith(i)))}function $Re(e){let t=e[0];if(!t)return"";let n=t.indexOf("/");if(n===-1)return"";let i=t.slice(0,n+1);return e.every(r=>r.startsWith(i))?i:""}function FO(e){let t=new Map;for(let n of e)for(let i of i9(n.content)){let r=t.get(i.name);r&&r.members.length>=i.members.length||t.set(i.name,i)}return t}function i9(e){let t=[],i=GRe(e).split(` +`),r=0,o=[],s=null,a=!1,c=()=>{for(;o.length>0&&r<=o.at(-1).depth;)o.pop()},l=(u,d)=>{for(let p=u;p<=d&&pSRe.test(S))&&s===null?s=r:y&&o.push({path:w?[]:y.split("::").filter(Boolean),depth:r,inline:w});let k=p.indexOf("{"),$=k>=0?p.slice(k+1).replace(/}\s*;?\s*$/,"").trim():"";if($&&s===null&&!a){let S=r9($,o.flatMap(x=>x.path));S&&t.push(S)}l(u,u);continue}if(s!==null||a){l(u,u);continue}let m=IRe(p);if(m){t.push(m),l(u,u);continue}let g=ARe(i,u,o.flatMap(y=>y.path));if(g){t.push(g.entry),l(u,g.endLine),u=g.endLine;continue}let h=zRe(i,u);if(!h){l(u,u);continue}let b=r9(h.text,o.flatMap(y=>y.path));b&&t.push(b),l(u,h.endLine),u=h.endLine}return t}var SRe=/^(detail|details|internal|impl|private|_\w+)$/i,xRe=/^\w*BEGIN_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE\b/,ERe=/^\w*(END_(DETAIL|PRIVATE|INTERNAL|IMPL)_NAMESPACE|BEGIN_PUBLIC_NAMESPACE)\b/;function TRe(e){let t=0;for(let n of e)n==="{"?t++:n==="}"&&t--;return t}function IRe(e){let t=/^#\s*define\s+(\w+)\s*(\([^)]*\))?\s*(.*)$/.exec(e);if(!t)return null;let n=t[1];if(/^_+|_H(_|PP)?$|_INCLUDED$|_GUARD$/i.test(n)||kRe.test(n))return null;let i=t[2]??"",r=t[3]?.trim()??"";return{name:n,kind:i?"function":"variable",signature:ps(`#define ${n}${i}${r?` ${r}`:""}`),members:[],requiredMembers:[]}}function ARe(e,t,n){let i=e[t].trim(),r=/^(?:typedef\s+)?(?:template\s*<[^>]*>\s*)?(struct|class|union|enum)(?:\s+class|\s+struct)?\s+(?:\w+_(?:API|EXPORT)\s+)?(\w+)?\s*(?::[^{]*)?\s*\{/.exec(i);if(!r)return null;let o=r[1],s=0,a=t,c=[];for(let f=t;ft&&c.push(m),s<=0&&f>=t){a=f;break}a=f}let l=e[a],u=/\}\s*(\w+)\s*;/.exec(l),d=r[2]??u?.[1];if(!d)return null;let p=Ch(n,d);return{entry:{name:p,kind:RRe(o),signature:ps(`${o} ${p}`),...CRe(c.join(` +`),o),requiredMembers:[]},endLine:a}}function RRe(e){return e==="enum"?"enum":e==="class"?"class":"interface"}function CRe(e,t){if(t==="enum")return{members:[...new Set(e.replace(/\{|\}[^}]*$/g,"").split(",").map(s=>/^\s*(\w+)/.exec(s)?.[1]).filter(s=>!!s))]};let n=[],i={},r=t!=="class",o=0;for(let s of e.split(` +`)){let a=s.trim(),c=/^(public|private|protected)\s*:/.exec(a);if(c){r=c[1]==="public";continue}let l=o;for(let f of a)f==="{"?o++:f==="}"&&o--;if(l>0||!r)continue;let u=UO(a);if(u){n.push(u.identity),i[u.identity]=u.signature;continue}let d=/(\w+)\s*\([^)]*\)\s*(?:const\s*)?(?:noexcept\s*)?[;{=]/.exec(a);if(d?.[1]&&!Nh.has(d[1])){n.push(d[1]);continue}if(d?.[1])continue;let p=/^[\w:<>,\s*&[\]]+?(\w+)\s*(?:\[[^\]]*\]\s*)?(?:=\s*[^;]+)?;/.exec(a);p?.[1]&&!Nh.has(p[1])&&!VRe.test(p[1])&&n.push(p[1])}return{members:[...new Set(n)],memberSignatures:i}}function NRe(e){return UO(e)?.identity??null}function UO(e){let t=e.search(/\boperator\b/);if(t<0)return null;let n=e.slice(t+8).trimStart(),i=ORe(n);if(!i)return null;let r=i.end;for(;/\s/.test(n[r]??"");)r++;if(n[r]!=="(")return null;let o=o9(n,r);if(!o)return null;let s=MRe(n.slice(o.end+1)),a=i.conversion?`operator ${i.name}`:/^[A-Za-z]/.test(i.name)?`operator ${i.name}(${p$(o.content)})`:`operator${i.name}(${p$(o.content)})`,c=PRe(e.slice(0,t)),l=`${a}${s}`,u=`${c?`${c} `:""}operator ${i.name}(${p$(o.content)})${s}`;return{identity:l,signature:u}}function PRe(e){return ps(e).replace(/\b(?:extern|static|inline|virtual|friend|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall)\b/g,"").replace(/\s+/g," ").trim()}var DRe=["<=>","->*","<<=",">>=","new[]","delete[]","()","[]","->","<<",">>","==","!=","<=",">=","&&","||","++","--","+=","-=","*=","/=","%=","^=","&=","|=","co_await","new","delete","+","-","*","/","%","^","&","|","~","!","=","<",">",","];function ORe(e){let t=/^""\s*([A-Za-z_]\w*)/.exec(e);if(t)return{name:`""${t[1]}`,end:t[0].length,conversion:!1};for(let i of DRe){let o=(i==="new[]"?/^new\s*\[\]/:i==="delete[]"?/^delete\s*\[\]/:null)?.exec(e)?.[0]??(e.startsWith(i)?i:null);if(o&&!(/^[A-Za-z_]/.test(i)&&/[A-Za-z0-9_]/.test(e[o.length]??"")))return{name:i,end:o.length,conversion:!1}}let n=0;for(let i=0;i"&&n>0)n--;else if(r==="("&&n===0){let o=ps(e.slice(0,i));return o?{name:o,end:i,conversion:!0}:null}}return null}function o9(e,t){let n=0;for(let i=t;i=0){let s=r+8;for(;/\s/.test(t[s]??"");)s++;if(t[s]==="("){let a=o9(t,s);n.push(a?`noexcept(${ps(a.content)})`:"noexcept")}else n.push("noexcept")}let o=/\brequires\s+(.+?)(?=\s*(?:;|\{|$))/.exec(t)?.[1];return o&&n.push(`requires ${ps(o)}`),n.length>0?` ${n.join(" ")}`:""}function r9(e,t=[]){let n=e.trim().replace(/^(?:\[\[[^\]]*\]\]\s*)+/,"").replace(/\s+/g," ");if(!n||n.startsWith("#"))return null;let i=/^typedef\s+(.+?)\s*;$/.exec(n);if(i){let l=/\(\s*\*\s*(\w+)\s*\)/.exec(i[1])?.[1]??/(\w+)\s*(?:\[[^\]]*\])?$/.exec(i[1])?.[1];return!l||Nh.has(l)?null:{name:Ch(t,l),kind:"type",signature:ps(n),members:[],requiredMembers:[]}}let r=LRe(n);if(NRe(n)){let c=UO(n);return{name:Ch(t,c.identity),kind:"function",signature:c.signature,members:[],requiredMembers:[]}}let s=/^((?:const\s+|unsigned\s+|signed\s+|struct\s+|enum\s+|class\s+)*[\w:]+(?:\s*<[^>]*>)?[\s*&]+)(\w+)\s*\(([^)]*)\)\s*(const)?\s*(?:noexcept)?\s*[;{]$/.exec(r);if(s){let c=ps(s[1]),l=s[2];return Nh.has(l)?null:{name:Ch(t,l),kind:"function",signature:`${c} ${l}(${p$(s[3])})${s[4]?" const":""}`,members:[],requiredMembers:[]}}let a=/^extern\s+((?:const\s+)?[\w:]+[\s*&]+)(\w+)\s*(?:\[[^\]]*\])?\s*;$/.exec(n);if(a){let c=a[2];return Nh.has(c)?null:{name:Ch(t,c),kind:"variable",signature:ps(n.replace(/;$/,"")),members:[],requiredMembers:[]}}return null}function LRe(e){let t=e;for(;;){let n=/^(?:extern|static|inline|constexpr|virtual|explicit|friend|EXTERN_C|__cdecl|__stdcall|__fastcall|__thiscall|__vectorcall|__forceinline|__inline__|__restrict__|__host__|__device__|[A-Za-z_]\w*_(?:API|EXPORT))\s+/.exec(t);if(n){t=t.slice(n[0].length);continue}let i=/^(?:__declspec|__attribute__)\s*/.exec(t);if(!i)return t;let r=i[0].length;if(t[r]!=="(")return t;let o=0;for(;r{let r=n.split("=")[0].trim().replace(/\s*\[[^\]]*\]\s*$/,"");if(r.split(/(?<=[\s*&])/).length<2)return r;let s=/\b(\w+)\s*$/.exec(r)?.[1];if(s&&FRe.has(s))return r;let a=r.match(/\b\w+\b/g)??[];return a.length===2&&URe.has(a[0])?r:r.replace(/\b\w+\s*$/,"").trim()||r}).join(", ")}var FRe=new Set(["void","bool","char","wchar_t","char8_t","char16_t","char32_t","short","int","long","float","double","signed","unsigned","const","volatile"]),URe=new Set(["struct","class","enum","union","const","volatile","signed","unsigned","short","long"]);function jRe(e){let t=[],n=0,i="";for(let r of e){if(r==="<"||r==="("||r==="["?n++:(r===">"||r===")"||r==="]")&&n--,r===","&&n===0){t.push(i),i="";continue}i+=r}return i.trim()&&t.push(i),t}function zRe(e,t){let n="";for(let i=t;iqRe(e,t)}}var c9=jO("arduino"),l9=jO("conan"),u9=jO("vcpkg");async function qRe(e,t){let n=BRe[e];if(!n)return ne(ul,"unsupported-ecosystem",`No source resolver for ${e}.`);let i=s9(e,n,t,t.from),r=s9(e,n,t,t.to);r.catch(()=>{});let o=await i;if(!o.ok)return o.failure;let s=await r;return s.ok?o.api.size===0&&s.api.size===0?ne(ul,"no-public-surface",`No declarations could be read from ${t.name}'s headers in either version. A library whose API is generated by macros, or shipped as a prebuilt binary, has no header text to compare.`):{available:!0,changes:Pr(o.api,s.api),tool:ul,weight:a9,locator:`${t.name} ${t.from} \u2192 ${t.to} (public headers)`}:s.failure}async function s9(e,t,n,i){let r=await t(n.name,i);if(!r)return{ok:!1,failure:ne(ul,"version-unavailable",`No source archive is published for ${n.name} ${i} in ${WRe(e)}, so its headers could not be read.`)};let o;try{let s=await Bt(r,{timeoutMs:n.timeoutMs});if(!s.ok&&s.status===0)throw new Error(s.error??"the request failed");if(!s.ok)return{ok:!1,failure:ne(ul,"version-unavailable",`${r} returned ${s.status}.`)};let a=Ln(s.bytes),c=new Map(a.map(l=>[l.path,l]));o=LO([...c.keys()]).map(l=>({path:l.path,content:c.get(l.original).read().toString("utf8")})).filter(l=>l.content.length>0)}catch(s){return{ok:!1,failure:ne(ul,"artifact-unavailable",`Could not read ${n.name} ${i} from ${r}: ${s.message}`)}}return n.logger.debug(`${n.name} ${i}: ${o.length} public header(s)`),{ok:!0,api:FO(o)}}function WRe(e){return e==="conan"?"ConanCenter":e==="vcpkg"?"the vcpkg registry":"the Arduino Library Manager"}async function KRe(e,t){let n=await Wk(e),i=n?.archives[t];if(i)return i;let r=n?.githubRepo??await HRe(e);return r?zO(r,t):null}async function HRe(e){return(await qn(e,"arduino",null))?.githubRepo??null}async function JRe(e,t){let n=`https://raw.githubusercontent.com/conan-io/conan-center-index/master/recipes/${encodeURIComponent(e)}`,i=await rt(`${n}/config.yml`);if(!i)return null;let r=d9(i,t)??ZRe(i);if(!r)return null;let o=await rt(`${n}/${r}/conandata.yml`);if(!o)return null;let s=p9(o,t);if(s)return s;let a=YRe(o);return a?zO(a,t):null}function ZRe(e){return/folder\s*:\s*["']?([^"'\s]+)["']?/.exec(e)?.[1]??null}function YRe(e){for(let t of e.matchAll(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+/g)){let n=Lt(t[0]);if(n)return n}return null}async function zO(e,t){let i=(await _e(`https://api.github.com/repos/${e}/tags?per_page=100`)??[]).map(r=>r.name).find(r=>!!r&&ep(r,t));return i?`https://codeload.github.com/${e}/tar.gz/refs/tags/${encodeURIComponent(i)}`:null}function d9(e,t){let n=e.split(` +`),i=null;for(let r of n){let o=/^\s{2,}["']?([^"':\s]+)["']?\s*:\s*$/.exec(r.replace(/\s+$/,""));if(o){i=o[1].trim();continue}let s=/^\s{4,}folder\s*:\s*["']?([^"'\s]+)["']?/.exec(r);if(s&&i===t)return s[1]}return null}function p9(e,t){let n=e.split(` +`),i=!1,r=!1;for(let o of n){let s=o.replace(/\s+$/,"");if(!s.trim())continue;if(/^sources\s*:/.test(s)){i=!0;continue}if(!/^\s/.test(s)){i=!1,r=!1;continue}if(!i)continue;let a=/^ {2}["']?([^"':\s]+)["']?\s*:\s*$/.exec(s);if(a){r=a[1].trim()===t;continue}if(!r)continue;let c=/https?:\/\/\S+/.exec(s);if(c&&!c[0].endsWith(".git"))return c[0].replace(/["',]+$/,"")}return null}async function QRe(e,t){let n=await _e(`https://raw.githubusercontent.com/microsoft/vcpkg/master/ports/${encodeURIComponent(e)}/vcpkg.json`),i=Lt(n?.homepage??null);return i?zO(i,t):null}function ep(e,t){let n=i=>i.replace(/^[^\d]*/,"").replace(/_/g,".");return e===t||n(e)===n(t)}var Fn="python ast",XRe="Install Python 3 and make `python3` available on PATH.",f9=.9,eCe=.6,b9={ecosystem:"pypi",tool:Fn,weight:f9,async compute(e){if(!await n_(e.exec,"python3",["--version"]))return ne(Fn,"tool-missing",`Python 3 is not installed, so ${e.name}'s public symbols could not be compared.`,XRe);await(0,dl.mkdir)(e.workdir,{recursive:!0});let t=(0,np.join)(e.workdir,"surface.py");await(0,dl.writeFile)(t,w9,"utf8");let n=`${dCe}/${await pCe(e)}`,i=Date.now()+e.timeoutMs,r=m9(e,e.from,t,n,i),o=m9(e,e.to,t,n,i);o.catch(()=>{});let s=await r;if(!s.ok)return s.failure;let a=await o;if(!a.ok)return a.failure;let c=s.usedGitHubFallback||a.usedGitHubFallback,l=c?"; source: GitHub tag mirror, PyPI archive was unreadable":"";return{available:!0,changes:Pr(s.api,a.api),tool:Fn,weight:c?eCe:f9,locator:`${e.name} ${e.from} \u2192 ${e.to} (public symbols, best-effort${l})`}}};function ki(e){return Math.max(0,e-Date.now())}var tp=new Map;async function m9(e,t,n,i,r){let o=`python-surface:${i}:${e.name}@${t}`;for(;;){let s=ki(r);if(s<=0)return{ok:!1,failure:ne(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let a=tp.get(o);if(a){let l=await c$(a.promise,s);if(l.timedOut)return{ok:!1,failure:ne(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};if(!l.value.ok&&l.value.budgetExhausted){tp.get(o)===a&&tp.delete(o);continue}return l.value}let c=(async()=>{let l=await Ca(o);if(l)return{ok:!0,api:new Map(l),usedGitHubFallback:!1};let u=await tCe(e,t,n,r);return u.ok?(u.usedGitHubFallback||await Na(o,[...u.api]),u):ki(r)<=0?{...u,budgetExhausted:!0}:u})();return tp.set(o,{promise:c}),c.catch(()=>{}).then(()=>{tp.get(o)?.promise===c&&tp.delete(o)}),c}}async function tCe(e,t,n,i){if(ki(i)<=0)return{ok:!1,failure:ne(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t} could be checked.`)};let r=await lCe(e.name,t,ki(i));if(!r)return{ok:!1,failure:ne(Fn,"version-unavailable",`PyPI has no source archive for ${e.name} ${t}. It may be private, yanked, or published only as a built wheel Drift cannot open.`)};let o=(0,np.join)(e.workdir,`probe-${t.replace(/[^\w.-]/g,"_")}`),s,a=!1;try{await(0,dl.mkdir)(o,{recursive:!0});let d=await Bt(r.url,{timeoutMs:ki(i),retries:2});if(d.ok)s=d.bytes;else{let p=ki(i)>0?await oCe(e.name,t,i):null;if(!p)return d.status===0?{ok:!1,failure:ne(Fn,"toolchain-failed",`Could not download ${r.url}: ${d.error??"the request did not complete"}`)}:{ok:!1,failure:ne(Fn,"version-unavailable",`PyPI returned ${d.status} for ${r.url}.`)};s=p,a=!0}}catch(d){return{ok:!1,failure:ne(Fn,"toolchain-failed",`Could not download ${r.url}: ${d.message}`)}}let c=0;try{let d=Ln(s),p=d,f="";if(a){let m=cCe(d.map(h=>h.path),e.name);if(!m)return{ok:!1,failure:ne(Fn,"no-public-surface",`Could not confidently identify ${e.name}'s own source directory inside its GitHub repository, so the fallback was declined rather than comparing the whole repository.`)};let g=`${m}/`;p=d.filter(h=>h.path.startsWith(g)),f=m.slice(0,m.lastIndexOf("/")+1)}for(let m of p){let g=rCe(f?m.path.slice(f.length):m.path);if(!g)continue;let h=(0,np.join)(o,g);await(0,dl.mkdir)((0,np.dirname)(h),{recursive:!0}),await(0,dl.writeFile)(h,m.read()),c+=1}}catch(d){return{ok:!1,failure:ne(Fn,"toolchain-failed",`Could not unpack ${r.filename}: ${g9(d.message)}`)}}if(c===0)return{ok:!1,failure:ne(Fn,"no-public-surface",`${e.name} ${t} ships no Python sources Drift could read.`)};if(ki(i)<=0)return{ok:!1,failure:ne(Fn,"toolchain-failed",`Ran out of time comparing ${e.name}'s public symbols before ${t}'s source could be parsed.`)};let l=await e.exec("python3",[n,o,e.name],{timeoutMs:ki(i)});if(l.code!==0)return{ok:!1,failure:ne(Fn,"parse-failed",`Could not read ${e.name} ${t}'s public symbols: ${g9(l.stderr)}`)};let u=v9(l.stdout);return u?u.size===0?{ok:!1,failure:ne(Fn,"no-public-surface",`${e.name} ${t} declares no public symbols Drift could read statically.`)}:{ok:!0,api:u,usedGitHubFallback:a}:{ok:!1,failure:ne(Fn,"parse-failed",`Unreadable symbol listing for ${e.name} ${t}.`)}}var nCe=new Set(["test","tests",".git","__pycache__"]);function rCe(e){let t=e.split("/").filter(s=>s!==""&&s!==".");if(t.length===0||t.some(s=>s==="..")||e.startsWith("/")||/^[a-zA-Z]:/.test(e)||t.slice(0,-1).some(s=>nCe.has(s)))return null;let n=t.at(-1),i=n.endsWith(".py")||n.endsWith(".pyi"),r=["pyproject.toml","setup.cfg","setup.py"].includes(n),o=n==="top_level.txt"&&t.some(s=>s.endsWith(".dist-info")||s.endsWith(".egg-info"));return!i&&!r&&!o?null:t.join("/")}var iCe=25*1024*1024;async function oCe(e,t,n){let i=await qn(e,"pypi",t);if(!i?.githubRepo||ki(n)<=0)return null;let r=await _e(`https://api.github.com/repos/${i.githubRepo}/tags?per_page=100`,{timeoutMs:ki(n)}),o=sCe(r??[],e,t);if(!o||ki(n)<=0)return null;let a=r?.find(l=>l.name===o)?.commit?.sha??`refs/tags/${o}`,c=await Bt(`https://codeload.github.com/${i.githubRepo}/tar.gz/${a}`,{timeoutMs:ki(n),retries:2,maxBytes:iCe});return c.ok?c.bytes:null}function sCe(e,t,n){let i=e.filter(a=>!!a.name&&ep(a.name,n)),r=t.toLowerCase().replace(/[_.]/g,"-"),o=new RegExp(`(^|[^a-z0-9])${aCe(r)}([^a-z0-9]|$)`),s=i.filter(a=>o.test(a.name.toLowerCase().replace(/[_.]/g,"-")));return s.length===1?s[0].name:s.length>1?null:i.length===1?i[0].name:null}function aCe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function cCe(e,t){let n=t.toLowerCase().replace(/[-.]+/g,"_"),i=new Set;for(let r of e){let o=r.split("/").filter(s=>s!=="");for(let s=0;sc.packagetype==="sdist"),s=r.find(c=>c.packagetype==="bdist_wheel"),a=o??s;return a?{url:a.url,filename:a.filename}:null}var uCe={function:"function",class:"class",variable:"variable",unknown:"unknown"};function v9(e){let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t))return null;let n=new Map;for(let i of t)if(i?.name){if(i.shapeUnknown){n.set(i.name,{name:i.name,kind:"unknown",signature:i.name,members:[],requiredMembers:[],shapeUnknown:!0});continue}n.set(i.name,{name:i.name,kind:uCe[i.kind]??"variable",signature:i.signature??i.name,members:i.members??[],requiredMembers:[],...Array.isArray(i.callable)?{callable:{parameters:i.callable}}:{}})}return n}var w9=`import ast, json, os, re, sys def public(name): return not name.startswith('_') or (name.startswith('__') and name.endswith('__')) @@ -1391,23 +1391,23 @@ for module, entry in index.items(): symbols[key] = emitted json.dump(sorted(symbols.values(), key=lambda s: s['name']), sys.stdout) -`;function l9(e){return e.split(` -`).find(t=>t.trim().length>0)?.trim()??"no output"}var iNe=(0,d9.createHash)("sha256").update(m9).digest("hex").slice(0,12),u9=null;function oNe(e){return u9??=e.exec("python3",["--version"],{timeoutMs:2e4}).then(t=>(t.stdout||t.stderr).trim().replace(/\s+/g,"-")||"unknown").catch(()=>"unknown"),u9}var E9=require("node:crypto");MO();var np="assembly metadata",_9=1,T9={ecosystem:"nuget",tool:np,weight:_9,async compute(e){let t=S9(e,e.from),n=S9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="managed-library"||r.role!=="managed-library"?{available:!0,changes:ENe(i,r),tool:"NuGet package contract",weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (NuGet package roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:{available:!0,changes:Dr(i.api,r.api),tool:np,weight:_9,locator:`${e.name} ${e.from} \u2192 ${e.to} (${i.framework} assembly metadata)`,packageRole:"managed-library"}:r.failure}};async function S9(e,t){let n=e.name.toLowerCase(),i=t.toLowerCase(),r=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(n)}/${encodeURIComponent(i)}/${encodeURIComponent(n)}.${encodeURIComponent(i)}.nupkg`,o;try{let u=await Bt(r,{timeoutMs:e.timeoutMs});if(!u.ok&&u.status===0)throw new Error(u.error??"the request failed");if(!u.ok)return{ok:!1,failure:ne(np,u.status===404?"version-unavailable":"artifact-unavailable",u.status===404?`NuGet has no package for ${e.name} ${t}. It may be unlisted, delisted, or published to a private feed.`:`NuGet returned ${u.status} for ${e.name} ${t}.`)};o=Fn(u.bytes)}catch(u){return{ok:!1,failure:ne(np,"artifact-unavailable",`Could not read ${e.name} ${t} from NuGet: ${u.message}`)}}let s=SNe(o);if(s!=="managed-library")return s==="unsupported"?{ok:!1,failure:{...ne("NuGet package contract","artifact-type-unsupported",`${e.name} ${t} contains no managed library, analyzer, MSBuild, tool, or dependency-only contract Drift can classify.`),packageRole:s}}:{ok:!0,role:s,contract:xNe(o,s),framework:s};let a=I9(o.map(u=>u.path));if(!a)return{ok:!1,failure:ne(np,"parse-failed",`${e.name} ${t} was classified as a managed library, but no readable assembly could be selected under lib/ or ref/.`)};let c=o.find(u=>u.path===a.path),l=s_(c.read());return l?{ok:!0,role:s,contract:new Map,api:TNe(l),framework:a.framework}:{ok:!1,failure:ne(np,"parse-failed",`${a.path} in ${e.name} ${t} is not a managed assembly Drift could read.`)}}function SNe(e){let t=e.map(i=>i.path.replaceAll("\\","/").toLowerCase());if(I9(t))return"managed-library";if(t.some(i=>i.startsWith("analyzers/")))return"analyzer";if(t.some(i=>i.startsWith("build/")||i.startsWith("buildtransitive/")))return"msbuild";if(t.some(i=>i.startsWith("tools/")))return"tool";let n=e.find(i=>i.path.toLowerCase().endsWith(".nuspec"));return n&&/<(?:dependency|group)\b/i.test(n.read().toString("utf8"))?"meta-package":"unsupported"}function xNe(e,t){let n=new Map;if(t==="meta-package"){let r=e.find(s=>s.path.toLowerCase().endsWith(".nuspec"));if(!r)return n;let o=r.read().toString("utf8");for(let s of o.matchAll(/]*)\/?\s*>/gi)){let a=Object.fromEntries([...s[1].matchAll(/([\w.-]+)\s*=\s*["']([^"']*)["']/g)].map(c=>[c[1].toLowerCase(),c[2]]));a.id&&n.set(`dependency:${a.id}`,[a.version,a.include,a.exclude].filter(Boolean).join("|"))}return n}let i=t==="analyzer"?["analyzers/"]:t==="msbuild"?["build/","buildtransitive/"]:["tools/"];for(let r of e){let o=r.path.replaceAll("\\","/").toLowerCase();i.some(s=>o.startsWith(s))&&n.set(o,(0,E9.createHash)("sha256").update(r.read()).digest("hex"))}return n}function ENe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"nuget:package-role",detail:`The NuGet package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`nuget:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the NuGet package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the NuGet package.`,before:r})}return n}function TNe(e){let t=new Map;for(let n of e)t.set(n.fullName,{name:n.fullName,kind:n.kind==="struct"||n.kind==="delegate"?"type":n.kind,signature:`${n.kind} ${n.fullName}`,members:[...n.members,...n.signatures],requiredMembers:[]});return t}function I9(e){let t=e.map(r=>{let o=/^(lib|ref)\/([^/]+)\/([^/]+\.dll)$/i.exec(r);if(!o)return null;let s=o[3];return/\.resources\.dll$/i.test(s)?null:{path:r,area:o[1].toLowerCase(),framework:o[2].toLowerCase(),name:s}}).filter(r=>r!==null);if(t.length===0)return null;let i=[...t].sort((r,o)=>{if(r.area!==o.area)return r.area==="ref"?-1:1;let s=x9(o.framework)-x9(r.framework);return s!==0?s:r.name.length-o.name.length||r.name.localeCompare(o.name)})[0];return{path:i.path,framework:i.framework}}function x9(e){if(e.startsWith("netstandard2.0"))return 1e3;if(e.startsWith("netstandard"))return 900;let t=/^net(\d+)\.(\d+)/.exec(e);if(t)return 500+Number(t[1])*10+Number(t[2]);let n=/^net(\d+)$/.exec(e);return n?100+Number(n[1]):0}var C9=require("node:crypto"),P9=gt(gc(),1);var Eh="pub source",A9=.8,D9={ecosystem:"pub",tool:Eh,weight:A9,async compute(e){let t=R9(e,e.from),n=R9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="code"||r.role!=="code"?{available:!0,changes:RNe(i,r),tool:"pub package contract",weight:.8,locator:`${e.name} ${e.from} \u2192 ${e.to} (published Pub roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:i.api.size===0&&r.api.size===0?ne(Eh,"no-public-surface",`${e.name} publishes no public Dart library Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Dr(i.api,r.api),tool:Eh,weight:A9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published lib/)`,packageRole:"code"}:r.failure}};async function R9(e,t){let n=`https://pub.dev/api/archives/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar.gz`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(Eh,o.status===404?"version-unavailable":"artifact-unavailable",o.status===404?`pub.dev has no archive for ${e.name} ${t}. It may be retracted, or published to a private pub server.`:`pub.dev returned ${o.status} for ${e.name} ${t}.`)};i=Fn(o.bytes)}catch(o){return{ok:!1,failure:ne(Eh,"artifact-unavailable",`Could not read ${e.name} ${t} from pub.dev: ${o.message}`)}}let r=INe(i);return r==="unsupported"?{ok:!1,failure:{...ne("pub package contract","artifact-type-unsupported",`${e.name} ${t} contains no Dart library, declared asset/font contract, or executable tooling Drift can classify.`),packageRole:r}}:r==="code"?{ok:!0,role:r,contract:new Map,api:M9(i)}:{ok:!0,role:r,contract:ANe(i,r)}}function INe(e){let t=FO(e).map(({path:a})=>a);if(t.some(a=>/^lib\/.+\.dart$/i.test(a)))return"code";let n=O9(e);if(Pa(n?.executables)&&Object.keys(n.executables).length>0||t.some(a=>/^bin\/.+\.dart$/i.test(a)))return"tooling";let r=Pa(n?.flutter)?n.flutter:void 0,o=Array.isArray(r?.assets)&&r.assets.length>0,s=Array.isArray(r?.fonts)&&r.fonts.length>0;return o||s?"asset":"unsupported"}function ANe(e,t){let n=FO(e),i=new Map,r=O9(e);if(t==="tooling"){if(Pa(r?.executables))for(let[c,l]of Object.entries(r.executables).sort(([u],[d])=>u.localeCompare(d)))i.set(`executable:${c}`,typeof l=="string"?l:"");return N9(i,n.filter(({path:c})=>/^bin\/.+\.dart$/i.test(c))),i}let o=Pa(r?.flutter)?r.flutter:void 0,s=[...Array.isArray(o?.assets)?o.assets:[],...Array.isArray(o?.fonts)?o.fonts:[]];i.set("pubspec:flutter-assets-and-fonts",LO(s));let a=NNe(s);return N9(i,n.filter(({path:c})=>a.some(l=>c===l||c.startsWith(`${l}/`)))),i}function RNe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"pub:package-role",detail:`The Pub package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`pub:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the Pub package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the Pub package.`,before:r})}return n}function FO(e){let t=e.some(n=>/^(?:lib|bin|assets?)\//i.test(n.path)||/^pubspec\.ya?ml$/i.test(n.path));return e.map(n=>({path:(t?n.path:n.path.replace(/^[^/]+\//,"")).replaceAll("\\","/").replace(/\/$/,""),entry:n}))}function O9(e){let t=FO(e).find(({path:n})=>/^pubspec\.ya?ml$/i.test(n));if(t)try{let n=(0,P9.parse)(t.entry.read().toString("utf8"));return Pa(n)?n:void 0}catch{return}}function NNe(e){let t=new Set;for(let n of e){if(typeof n=="string"&&t.add(n.replace(/^\.\//,"").replace(/\/$/,"")),!Pa(n))continue;let i=Array.isArray(n.fonts)?n.fonts:[];for(let r of i)Pa(r)&&typeof r.asset=="string"&&t.add(r.asset.replace(/^\.\//,""))}return[...t].filter(Boolean)}function N9(e,t){for(let{path:n,entry:i}of[...t].sort((r,o)=>r.path.localeCompare(o.path)))e.set(`file:${n}`,(0,C9.createHash)("sha256").update(i.read()).digest("hex"))}function LO(e){return Array.isArray(e)?`[${e.map(LO).join(",")}]`:Pa(e)?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${LO(e[t])}`).join(",")}}`:JSON.stringify(e)??"null"}function Pa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function M9(e){let t=e.some(s=>s.path.startsWith("lib/")),n=new Map;for(let s of e){let a=t?s.path:s.path.replace(/^[^/]+\//,"");a.startsWith("lib/")&&a.endsWith(".dart")&&n.set(a,s)}let i=new Map,r=new Set,o=[...n.keys()].filter(s=>!s.startsWith("lib/src/"));for(;o.length>0;){let s=o.shift();if(r.has(s))continue;r.add(s);let a=n.get(s);if(!a)continue;let c;try{c=a.read().toString("utf8")}catch{continue}for(let l of L9(c))i.has(l.name)||i.set(l.name,l);for(let l of CNe(c)){let u=PNe(s,l);u&&n.has(u)&&o.push(u)}}return i}function CNe(e){let t=[];for(let n of e.matchAll(/^\s*export\s+['"]([^'"]+)['"]/gm)){let i=n[1];i.startsWith("package:")||i.startsWith("dart:")||t.push(i)}return t}function PNe(e,t){let n=[...e.split("/").slice(0,-1),...t.split("/")],i=[];for(let r of n)if(!(r===""||r===".")){if(r===".."){if(i.length===0)return;i.pop();continue}i.push(r)}return i.join("/")}function L9(e){let t=[],n=ONe(e).split(` -`);for(let i=0;i,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)\s*(?:async\s*\*?|sync\s*\*)?\s*[{=;]/.exec(r);if(a?.[1]&&!a[1].startsWith("_")&&!F9.has(a[1])){t.push({name:a[1],kind:"function",signature:a_(r),members:[],requiredMembers:[]});continue}let c=/^(?:const|final|var|late\s+final|late\s+var)\s+(?:[\w$<>,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*=/.exec(r);c?.[1]&&!c[1].startsWith("_")&&t.push({name:c[1],kind:"variable",signature:a_(r),members:[],requiredMembers:[]})}return t}function DNe(e,t){let n=[],i;for(let r=t+1;r,\s?[\]]+\s+)?(?:get\s+|set\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*[({=;]/.exec(o);a?.[1]&&!a[1].startsWith("_")&&!F9.has(a[1])&&n.push(a[1])}return[...new Set(n)]}var F9=new Set(["if","for","while","switch","catch","return","assert","super","this","new","await","yield","throw","else","do","try","case","with","is","as","in","on","of","when","get","set","factory","operator","part","import","export","library","typedef","class","enum","mixin","extension","const","final","var","void","late","required","covariant","abstract","static","external"]);function ONe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").split(` +`;function g9(e){return e.split(` +`).find(t=>t.trim().length>0)?.trim()??"no output"}var dCe=(0,y9.createHash)("sha256").update(w9).digest("hex").slice(0,12),h9=null;function pCe(e){return h9??=e.exec("python3",["--version"],{timeoutMs:2e4}).then(t=>(t.stdout||t.stderr).trim().replace(/\s+/g,"-")||"unknown").catch(()=>"unknown"),h9}var N9=require("node:crypto");BO();var rp="assembly metadata",A9=1,P9={ecosystem:"nuget",tool:rp,weight:A9,async compute(e){let t=R9(e,e.from),n=R9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="managed-library"||r.role!=="managed-library"?{available:!0,changes:PCe(i,r),tool:"NuGet package contract",weight:.9,locator:`${e.name} ${e.from} \u2192 ${e.to} (NuGet package roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:{available:!0,changes:Pr(i.api,r.api),tool:rp,weight:A9,locator:`${e.name} ${e.from} \u2192 ${e.to} (${i.framework} assembly metadata)`,packageRole:"managed-library"}:r.failure}};async function R9(e,t){let n=e.name.toLowerCase(),i=t.toLowerCase(),r=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(n)}/${encodeURIComponent(i)}/${encodeURIComponent(n)}.${encodeURIComponent(i)}.nupkg`,o;try{let u=await Bt(r,{timeoutMs:e.timeoutMs});if(!u.ok&&u.status===0)throw new Error(u.error??"the request failed");if(!u.ok)return{ok:!1,failure:ne(rp,u.status===404?"version-unavailable":"artifact-unavailable",u.status===404?`NuGet has no package for ${e.name} ${t}. It may be unlisted, delisted, or published to a private feed.`:`NuGet returned ${u.status} for ${e.name} ${t}.`)};o=Ln(u.bytes)}catch(u){return{ok:!1,failure:ne(rp,"artifact-unavailable",`Could not read ${e.name} ${t} from NuGet: ${u.message}`)}}let s=CCe(o);if(s!=="managed-library")return s==="unsupported"?{ok:!1,failure:{...ne("NuGet package contract","artifact-type-unsupported",`${e.name} ${t} contains no managed library, analyzer, MSBuild, tool, or dependency-only contract Drift can classify.`),packageRole:s}}:{ok:!0,role:s,contract:NCe(o,s),framework:s};let a=D9(o.map(u=>u.path));if(!a)return{ok:!1,failure:ne(rp,"parse-failed",`${e.name} ${t} was classified as a managed library, but no readable assembly could be selected under lib/ or ref/.`)};let c=o.find(u=>u.path===a.path),l=f$(c.read());return l?{ok:!0,role:s,contract:new Map,api:DCe(l),framework:a.framework}:{ok:!1,failure:ne(rp,"parse-failed",`${a.path} in ${e.name} ${t} is not a managed assembly Drift could read.`)}}function CCe(e){let t=e.map(i=>i.path.replaceAll("\\","/").toLowerCase());if(D9(t))return"managed-library";if(t.some(i=>i.startsWith("analyzers/")))return"analyzer";if(t.some(i=>i.startsWith("build/")||i.startsWith("buildtransitive/")))return"msbuild";if(t.some(i=>i.startsWith("tools/")))return"tool";let n=e.find(i=>i.path.toLowerCase().endsWith(".nuspec"));return n&&/<(?:dependency|group)\b/i.test(n.read().toString("utf8"))?"meta-package":"unsupported"}function NCe(e,t){let n=new Map;if(t==="meta-package"){let r=e.find(s=>s.path.toLowerCase().endsWith(".nuspec"));if(!r)return n;let o=r.read().toString("utf8");for(let s of o.matchAll(/]*)\/?\s*>/gi)){let a=Object.fromEntries([...s[1].matchAll(/([\w.-]+)\s*=\s*["']([^"']*)["']/g)].map(c=>[c[1].toLowerCase(),c[2]]));a.id&&n.set(`dependency:${a.id}`,[a.version,a.include,a.exclude].filter(Boolean).join("|"))}return n}let i=t==="analyzer"?["analyzers/"]:t==="msbuild"?["build/","buildtransitive/"]:["tools/"];for(let r of e){let o=r.path.replaceAll("\\","/").toLowerCase();i.some(s=>o.startsWith(s))&&n.set(o,(0,N9.createHash)("sha256").update(r.read()).digest("hex"))}return n}function PCe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"nuget:package-role",detail:`The NuGet package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`nuget:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the NuGet package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the NuGet package.`,before:r})}return n}function DCe(e){let t=new Map;for(let n of e)t.set(n.fullName,{name:n.fullName,kind:n.kind==="struct"||n.kind==="delegate"?"type":n.kind,signature:`${n.kind} ${n.fullName}`,members:[...n.members,...n.signatures],requiredMembers:[]});return t}function D9(e){let t=e.map(r=>{let o=/^(lib|ref)\/([^/]+)\/([^/]+\.dll)$/i.exec(r);if(!o)return null;let s=o[3];return/\.resources\.dll$/i.test(s)?null:{path:r,area:o[1].toLowerCase(),framework:o[2].toLowerCase(),name:s}}).filter(r=>r!==null);if(t.length===0)return null;let i=[...t].sort((r,o)=>{if(r.area!==o.area)return r.area==="ref"?-1:1;let s=C9(o.framework)-C9(r.framework);return s!==0?s:r.name.length-o.name.length||r.name.localeCompare(o.name)})[0];return{path:i.path,framework:i.framework}}function C9(e){if(e.startsWith("netstandard2.0"))return 1e3;if(e.startsWith("netstandard"))return 900;let t=/^net(\d+)\.(\d+)/.exec(e);if(t)return 500+Number(t[1])*10+Number(t[2]);let n=/^net(\d+)$/.exec(e);return n?100+Number(n[1]):0}var F9=require("node:crypto"),U9=gt(gc(),1);var Ph="pub source",O9=.8,j9={ecosystem:"pub",tool:Ph,weight:O9,async compute(e){let t=M9(e,e.from),n=M9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.role!=="code"||r.role!=="code"?{available:!0,changes:LCe(i,r),tool:"pub package contract",weight:.8,locator:`${e.name} ${e.from} \u2192 ${e.to} (published Pub roles: ${i.role} \u2192 ${r.role})`,packageRole:r.role}:i.api.size===0&&r.api.size===0?ne(Ph,"no-public-surface",`${e.name} publishes no public Dart library Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Pr(i.api,r.api),tool:Ph,weight:O9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published lib/)`,packageRole:"code"}:r.failure}};async function M9(e,t){let n=`https://pub.dev/api/archives/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar.gz`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(Ph,o.status===404?"version-unavailable":"artifact-unavailable",o.status===404?`pub.dev has no archive for ${e.name} ${t}. It may be retracted, or published to a private pub server.`:`pub.dev returned ${o.status} for ${e.name} ${t}.`)};i=Ln(o.bytes)}catch(o){return{ok:!1,failure:ne(Ph,"artifact-unavailable",`Could not read ${e.name} ${t} from pub.dev: ${o.message}`)}}let r=OCe(i);return r==="unsupported"?{ok:!1,failure:{...ne("pub package contract","artifact-type-unsupported",`${e.name} ${t} contains no Dart library, declared asset/font contract, or executable tooling Drift can classify.`),packageRole:r}}:r==="code"?{ok:!0,role:r,contract:new Map,api:G9(i)}:{ok:!0,role:r,contract:MCe(i,r)}}function OCe(e){let t=WO(e).map(({path:a})=>a);if(t.some(a=>/^lib\/.+\.dart$/i.test(a)))return"code";let n=z9(e);if(Pa(n?.executables)&&Object.keys(n.executables).length>0||t.some(a=>/^bin\/.+\.dart$/i.test(a)))return"tooling";let r=Pa(n?.flutter)?n.flutter:void 0,o=Array.isArray(r?.assets)&&r.assets.length>0,s=Array.isArray(r?.fonts)&&r.fonts.length>0;return o||s?"asset":"unsupported"}function MCe(e,t){let n=WO(e),i=new Map,r=z9(e);if(t==="tooling"){if(Pa(r?.executables))for(let[c,l]of Object.entries(r.executables).sort(([u],[d])=>u.localeCompare(d)))i.set(`executable:${c}`,typeof l=="string"?l:"");return L9(i,n.filter(({path:c})=>/^bin\/.+\.dart$/i.test(c))),i}let o=Pa(r?.flutter)?r.flutter:void 0,s=[...Array.isArray(o?.assets)?o.assets:[],...Array.isArray(o?.fonts)?o.fonts:[]];i.set("pubspec:flutter-assets-and-fonts",qO(s));let a=FCe(s);return L9(i,n.filter(({path:c})=>a.some(l=>c===l||c.startsWith(`${l}/`)))),i}function LCe(e,t){let n=[];e.role!==t.role&&n.push({kind:"signature-changed",symbol:"pub:package-role",detail:`The Pub package role changed from ${e.role} to ${t.role}.`,before:e.role,after:t.role});for(let[i,r]of e.contract){let o=`pub:${e.role}:${i}`;t.contract.has(i)?t.contract.get(i)!==r&&n.push({kind:"signature-changed",symbol:o,detail:`The ${e.role} contract entry ${i} changed in the Pub package.`,before:r,after:t.contract.get(i)}):n.push({kind:"export-removed",symbol:o,detail:`The ${e.role} contract entry ${i} was removed from the Pub package.`,before:r})}return n}function WO(e){let t=e.some(n=>/^(?:lib|bin|assets?)\//i.test(n.path)||/^pubspec\.ya?ml$/i.test(n.path));return e.map(n=>({path:(t?n.path:n.path.replace(/^[^/]+\//,"")).replaceAll("\\","/").replace(/\/$/,""),entry:n}))}function z9(e){let t=WO(e).find(({path:n})=>/^pubspec\.ya?ml$/i.test(n));if(t)try{let n=(0,U9.parse)(t.entry.read().toString("utf8"));return Pa(n)?n:void 0}catch{return}}function FCe(e){let t=new Set;for(let n of e){if(typeof n=="string"&&t.add(n.replace(/^\.\//,"").replace(/\/$/,"")),!Pa(n))continue;let i=Array.isArray(n.fonts)?n.fonts:[];for(let r of i)Pa(r)&&typeof r.asset=="string"&&t.add(r.asset.replace(/^\.\//,""))}return[...t].filter(Boolean)}function L9(e,t){for(let{path:n,entry:i}of[...t].sort((r,o)=>r.path.localeCompare(o.path)))e.set(`file:${n}`,(0,F9.createHash)("sha256").update(i.read()).digest("hex"))}function qO(e){return Array.isArray(e)?`[${e.map(qO).join(",")}]`:Pa(e)?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${qO(e[t])}`).join(",")}}`:JSON.stringify(e)??"null"}function Pa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function G9(e){let t=e.some(s=>s.path.startsWith("lib/")),n=new Map;for(let s of e){let a=t?s.path:s.path.replace(/^[^/]+\//,"");a.startsWith("lib/")&&a.endsWith(".dart")&&n.set(a,s)}let i=new Map,r=new Set,o=[...n.keys()].filter(s=>!s.startsWith("lib/src/"));for(;o.length>0;){let s=o.shift();if(r.has(s))continue;r.add(s);let a=n.get(s);if(!a)continue;let c;try{c=a.read().toString("utf8")}catch{continue}for(let l of V9(c))i.has(l.name)||i.set(l.name,l);for(let l of UCe(c)){let u=jCe(s,l);u&&n.has(u)&&o.push(u)}}return i}function UCe(e){let t=[];for(let n of e.matchAll(/^\s*export\s+['"]([^'"]+)['"]/gm)){let i=n[1];i.startsWith("package:")||i.startsWith("dart:")||t.push(i)}return t}function jCe(e,t){let n=[...e.split("/").slice(0,-1),...t.split("/")],i=[];for(let r of n)if(!(r===""||r===".")){if(r===".."){if(i.length===0)return;i.pop();continue}i.push(r)}return i.join("/")}function V9(e){let t=[],n=GCe(e).split(` +`);for(let i=0;i,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(([^)]*)\)\s*(?:async\s*\*?|sync\s*\*)?\s*[{=;]/.exec(r);if(a?.[1]&&!a[1].startsWith("_")&&!B9.has(a[1])){t.push({name:a[1],kind:"function",signature:m$(r),members:[],requiredMembers:[]});continue}let c=/^(?:const|final|var|late\s+final|late\s+var)\s+(?:[\w$<>,\s?[\]]+\s+)?([A-Za-z_$][\w$]*)\s*=/.exec(r);c?.[1]&&!c[1].startsWith("_")&&t.push({name:c[1],kind:"variable",signature:m$(r),members:[],requiredMembers:[]})}return t}function zCe(e,t){let n=[],i;for(let r=t+1;r,\s?[\]]+\s+)?(?:get\s+|set\s+)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*[({=;]/.exec(o);a?.[1]&&!a[1].startsWith("_")&&!B9.has(a[1])&&n.push(a[1])}return[...new Set(n)]}var B9=new Set(["if","for","while","switch","catch","return","assert","super","this","new","await","yield","throw","else","do","try","case","with","is","as","in","on","of","when","get","set","factory","operator","part","import","export","library","typedef","class","enum","mixin","extension","const","final","var","void","late","required","covariant","abstract","static","external"]);function GCe(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").split(` `).map(t=>/^\s*\/\//.test(t)?"":t).join(` -`)}function a_(e){return e.replace(/\s+/g," ").replace(/\s*[{=;]\s*$/,"").trim()}var ul="hex sources",U9=.8,G9={ecosystem:"hex",tool:ul,weight:U9,async compute(e){let t=j9(e,e.from),n=j9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.api.size===0&&r.api.size===0?ne(ul,"no-public-surface",`${e.name} ships no Elixir or Erlang source Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Dr(i.api,r.api),tool:ul,weight:U9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published sources)`}:r.failure}};async function j9(e,t){let n=`https://repo.hex.pm/tarballs/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(ul,"version-unavailable",o.status===404?`Hex has no release for ${e.name} ${t}. It may have been retired, or published to a private repository.`:`Hex returned ${o.status} for ${e.name} ${t}.`)};i=Fn(o.bytes)}catch(o){return{ok:!1,failure:ne(ul,"toolchain-failed",`Could not read ${e.name} ${t} from Hex: ${o.message}`)}}let r=i.find(o=>o.path==="contents.tar.gz"||o.path.endsWith("/contents.tar.gz"));if(!r)return{ok:!1,failure:ne(ul,"parse-failed",`${e.name} ${t} is not in the layout Hex tarballs use, so Drift could not read its sources.`)};try{return{ok:!0,api:V9(Fn(r.read()))}}catch(o){return{ok:!1,failure:ne(ul,"parse-failed",`Could not unpack ${e.name} ${t}: ${o.message}`)}}}function V9(e){let t=new Map;for(let n of e){if(!/^(lib|src)\//.test(n.path))continue;let i;try{i=n.read().toString("utf8")}catch{continue}if(/\.ex$/.test(n.path)){for(let[r,o]of B9(i))z9(t,r,o,`defmodule ${r}`);continue}if(/\.erl$/.test(n.path)){let r=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(i)?.[1];r&&z9(t,r,q9(i),`-module(${r})`)}}return t}function z9(e,t,n,i){let r=e.get(t);if(r){r.members=[...new Set([...r.members,...n])];return}e.set(t,{name:t,kind:"class",signature:i,members:n,requiredMembers:[]})}function B9(e){let t=new Map,n=[],i=e.split(` -`),r=!1,o=(s,a)=>{for(;n.length>0&&n[n.length-1].indent>=s;)n.pop();n.push({indent:s,name:a})};for(let s=0;s0&&n[n.length-1].indent>=m;)n.pop();let g=n[n.length-1]?.name,h=g?`${g}.${l[2]}`:l[2];o(m,h),t.has(h)||t.set(h,[]);continue}let u=/^(\s*)defimpl\s+/.exec(a);if(u){o(u[1].length,null);continue}let d=/^(\s*)(?:def|defmacro|defguard|defdelegate)\s+([a-z_][\w]*[!?]?)\s*(\(|,|\s+when\b|\s+do\b|\s*$)/.exec(a);if(!d)continue;let p=d[1].length;for(;n.length>0&&n[n.length-1].indent>=p;)n.pop();let f=n[n.length-1]?.name;if(f)for(let m of MNe(i,s,d[3]==="("))t.get(f)?.push(`${d[2]}/${m}`)}for(let[s,a]of t)t.set(s,[...new Set(a)]);return t}function MNe(e,t,n){if(!n)return[0];let i=e[t].indexOf("("),r="",o=0,s=!1;e:for(let u=t;u=1&&(r+=f)}r+=" "}if(!s)return[0];let a=LNe(r);if(a.length===0)return[0];let c=a.filter(u=>!u.includes("\\\\")).length,l=a.length;return Array.from({length:l-c+1},(u,d)=>c+d)}function LNe(e){let t=e.trim();if(t==="")return[];let n=[],i=0,r="";for(let o of t){if(o==="("||o==="["||o==="{"||o==="<"?i+=1:(o===")"||o==="]"||o==="}"||o===">")&&(i-=1),o===","&&i===0){n.push(r),r="";continue}r+=o}return n.push(r),n.map(o=>o.trim()).filter(o=>o!=="")}function q9(e){let t=[];for(let n of e.matchAll(/-export\(\s*\[([\s\S]*?)\]\s*\)/g))for(let i of n[1].split(",")){let r=/([a-z_][\w]*)\s*\/\s*(\d+)/.exec(i);r&&t.push(`${r[1]}/${r[2]}`)}return[...new Set(t)]}var FNe=[dY,IY,HY,p9,r9,i9,n9,T9,D9,G9];function UNe(e){return FNe.find(t=>t.ecosystem===e)}var jNe=18e4;async function K9(e,t){let n=UNe(e.ecosystem);if(!n)return ne("none","unsupported-ecosystem",`Drift has no computed API-surface diff for ${e.ecosystem}; this upgrade rests on prose evidence alone.`);if(!e.from||!e.to)return ne(n.tool,"version-unavailable",`${e.name} has no pair of versions to compare.`);let i=await(0,c_.mkdtemp)((0,H9.join)((0,W9.tmpdir)(),"drift-surface-"));try{return await En("surface",e.name,()=>n.compute({name:e.name,from:e.from,to:e.to,exec:t.exec??Xe,workdir:i,logger:t.logger,...t.env?{env:t.env}:{},timeoutMs:t.timeoutMs??jNe,...t.readRepoFile?{readRepoFile:t.readRepoFile}:{},...e.manifestPath?{manifestPath:e.manifestPath}:{},...t.autoInstall?{autoInstall:!0}:{}}),{ecosystem:e.ecosystem})}catch(r){return t.logger.debug(`Surface diff crashed for ${e.name}: ${r.message}`),ne(n.tool,"toolchain-failed",`Drift could not compare ${e.name}: ${r.message}`)}finally{await(0,c_.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var X9=require("node:fs/promises"),e5=require("node:path"),_i={"type-surface-diff":1,...u8,"migration-guide":.8,"github-release":.7,changelog:.65,"registry-metadata":.4,"semver-heuristic":.25};async function t5(e,t){let n=await qn(e,4,r=>n5(r,t)),i=await KNe(t);return[...n.flat(),...i]}async function n5(e,t){let{config:n,logger:i}=t,r=[],o=y=>e.workspace===void 0?y:y.map(w=>({...w,workspace:e.workspace})),s=QNe(e);if(s&&r.push({id:St("ev",e.name,"semver",e.from,e.to),source:"semver-heuristic",dependency:e.name,url:YNe(e),title:`${e.name} ${e.from} \u2192 ${e.to} (${e.bump})`,content:s,weight:_i["semver-heuristic"]}),!e.from||!e.to)return o(r);let a=ca(e.name,e.ecosystem,e.from).catch(()=>null),c=await Wn(e.name,e.ecosystem,e.to),[l,u]=await Promise.all([a,ca(e.name,e.ecosystem,e.to).catch(()=>null)]);c?.deprecated&&r.push({id:St("ev",e.name,"deprecated",e.to),source:"registry-metadata",dependency:e.name,url:c.homepage??void 0,title:`${e.name}@${e.to} is deprecated`,content:c.deprecated,weight:_i["registry-metadata"]});let d=zNe(l?.runtime??null,u?.runtime??null);d&&r.push({id:St("ev",e.name,"runtime-metadata",e.to,d.runtime,d.requirement),source:"registry-metadata",dependency:e.name,url:c?.homepage??void 0,title:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}`,content:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}.`,weight:_i["registry-metadata"]});let p=c?.githubRepo,f=n.evidence.typeSurface?VNe(e,t):null,m=p&&n.evidence.githubReleases?_K(p,e.from,e.to,e.ecosystem,{token:t.githubToken,maxReleases:n.evidence.maxReleases}):null,g=n.evidence.changelog&&(c?.changelogUrl||p)?(async()=>{if(c?.changelogUrl){let y=await vK(c.changelogUrl,p??null,e.from,e.to,e.ecosystem);if(y.length>0)return y}return p?bK(p,e.from,e.to,e.ecosystem):[]})():null,h=p&&n.evidence.changelog?kK(p):null;for(let y of[f,m,g,h])y?.catch(()=>{});let b=f?await f:null;if(b&&r.push(b),!p&&!g)return i.debug(`No source repository or declared changelog resolved for ${e.name}; prose evidence unavailable`),o(r);if(m){let y=await m;for(let w of y){let k=Fg(w.body);t.onProseConsulted?.(e,{kind:"github-release",label:`${w.name??w.tag} release notes`,url:w.url,breaking:k.length>0}),k.length!==0&&r.push({id:St("ev",e.name,"release",w.tag),source:"github-release",dependency:e.name,url:w.url,title:`${e.name} ${w.name??w.tag} release notes`,content:k.join(` +`)}function m$(e){return e.replace(/\s+/g," ").replace(/\s*[{=;]\s*$/,"").trim()}var pl="hex sources",q9=.8,H9={ecosystem:"hex",tool:pl,weight:q9,async compute(e){let t=W9(e,e.from),n=W9(e,e.to);n.catch(()=>{});let i=await t;if(!i.ok)return i.failure;let r=await n;return r.ok?i.api.size===0&&r.api.size===0?ne(pl,"no-public-surface",`${e.name} ships no Elixir or Erlang source Drift could read, so this upgrade rests on prose evidence.`):{available:!0,changes:Pr(i.api,r.api),tool:pl,weight:q9,locator:`${e.name} ${e.from} \u2192 ${e.to} (published sources)`}:r.failure}};async function W9(e,t){let n=`https://repo.hex.pm/tarballs/${encodeURIComponent(e.name)}-${encodeURIComponent(t)}.tar`,i;try{let o=await Bt(n,{timeoutMs:e.timeoutMs});if(!o.ok&&o.status===0)throw new Error(o.error??"the request failed");if(!o.ok)return{ok:!1,failure:ne(pl,"version-unavailable",o.status===404?`Hex has no release for ${e.name} ${t}. It may have been retired, or published to a private repository.`:`Hex returned ${o.status} for ${e.name} ${t}.`)};i=Ln(o.bytes)}catch(o){return{ok:!1,failure:ne(pl,"toolchain-failed",`Could not read ${e.name} ${t} from Hex: ${o.message}`)}}let r=i.find(o=>o.path==="contents.tar.gz"||o.path.endsWith("/contents.tar.gz"));if(!r)return{ok:!1,failure:ne(pl,"parse-failed",`${e.name} ${t} is not in the layout Hex tarballs use, so Drift could not read its sources.`)};try{return{ok:!0,api:J9(Ln(r.read()))}}catch(o){return{ok:!1,failure:ne(pl,"parse-failed",`Could not unpack ${e.name} ${t}: ${o.message}`)}}}function J9(e){let t=new Map;for(let n of e){if(!/^(lib|src)\//.test(n.path))continue;let i;try{i=n.read().toString("utf8")}catch{continue}if(/\.ex$/.test(n.path)){for(let[r,o]of Z9(i))K9(t,r,o,`defmodule ${r}`);continue}if(/\.erl$/.test(n.path)){let r=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(i)?.[1];r&&K9(t,r,Y9(i),`-module(${r})`)}}return t}function K9(e,t,n,i){let r=e.get(t);if(r){r.members=[...new Set([...r.members,...n])];return}e.set(t,{name:t,kind:"class",signature:i,members:n,requiredMembers:[]})}function Z9(e){let t=new Map,n=[],i=e.split(` +`),r=!1,o=(s,a)=>{for(;n.length>0&&n[n.length-1].indent>=s;)n.pop();n.push({indent:s,name:a})};for(let s=0;s0&&n[n.length-1].indent>=m;)n.pop();let g=n[n.length-1]?.name,h=g?`${g}.${l[2]}`:l[2];o(m,h),t.has(h)||t.set(h,[]);continue}let u=/^(\s*)defimpl\s+/.exec(a);if(u){o(u[1].length,null);continue}let d=/^(\s*)(?:def|defmacro|defguard|defdelegate)\s+([a-z_][\w]*[!?]?)\s*(\(|,|\s+when\b|\s+do\b|\s*$)/.exec(a);if(!d)continue;let p=d[1].length;for(;n.length>0&&n[n.length-1].indent>=p;)n.pop();let f=n[n.length-1]?.name;if(f)for(let m of VCe(i,s,d[3]==="("))t.get(f)?.push(`${d[2]}/${m}`)}for(let[s,a]of t)t.set(s,[...new Set(a)]);return t}function VCe(e,t,n){if(!n)return[0];let i=e[t].indexOf("("),r="",o=0,s=!1;e:for(let u=t;u=1&&(r+=f)}r+=" "}if(!s)return[0];let a=BCe(r);if(a.length===0)return[0];let c=a.filter(u=>!u.includes("\\\\")).length,l=a.length;return Array.from({length:l-c+1},(u,d)=>c+d)}function BCe(e){let t=e.trim();if(t==="")return[];let n=[],i=0,r="";for(let o of t){if(o==="("||o==="["||o==="{"||o==="<"?i+=1:(o===")"||o==="]"||o==="}"||o===">")&&(i-=1),o===","&&i===0){n.push(r),r="";continue}r+=o}return n.push(r),n.map(o=>o.trim()).filter(o=>o!=="")}function Y9(e){let t=[];for(let n of e.matchAll(/-export\(\s*\[([\s\S]*?)\]\s*\)/g))for(let i of n[1].split(",")){let r=/([a-z_][\w]*)\s*\/\s*(\d+)/.exec(i);r&&t.push(`${r[1]}/${r[2]}`)}return[...new Set(t)]}var qCe=[y8,D8,X8,b9,l9,u9,c9,P9,j9,H9];function WCe(e){return qCe.find(t=>t.ecosystem===e)}var KCe=18e4;async function e5(e,t){let n=WCe(e.ecosystem);if(!n)return ne("none","unsupported-ecosystem",`Drift has no computed API-surface diff for ${e.ecosystem}; this upgrade rests on prose evidence alone.`);if(!e.from||!e.to)return ne(n.tool,"version-unavailable",`${e.name} has no pair of versions to compare.`);let i=await(0,g$.mkdtemp)((0,X9.join)((0,Q9.tmpdir)(),"drift-surface-"));try{return await Sn("surface",e.name,()=>n.compute({name:e.name,from:e.from,to:e.to,exec:t.exec??Xe,workdir:i,logger:t.logger,...t.env?{env:t.env}:{},timeoutMs:t.timeoutMs??KCe,...t.readRepoFile?{readRepoFile:t.readRepoFile}:{},...e.manifestPath?{manifestPath:e.manifestPath}:{},...t.autoInstall?{autoInstall:!0}:{}}),{ecosystem:e.ecosystem})}catch(r){return t.logger.debug(`Surface diff crashed for ${e.name}: ${r.message}`),ne(n.tool,"toolchain-failed",`Drift could not compare ${e.name}: ${r.message}`)}finally{await(0,g$.rm)(i,{recursive:!0,force:!0}).catch(()=>{})}}var o5=require("node:fs/promises"),s5=require("node:path"),$i={"type-surface-diff":1,...hY,"migration-guide":.8,"github-release":.7,changelog:.65,"registry-metadata":.4,"semver-heuristic":.25};async function a5(e,t){let n=await Bn(e,4,r=>c5(r,t)),i=await tNe(t);return[...n.flat(),...i]}async function c5(e,t){let{config:n,logger:i}=t,r=[],o=y=>e.workspace===void 0?y:y.map(w=>({...w,workspace:e.workspace})),s=oNe(e);if(s&&r.push({id:St("ev",e.name,"semver",e.from,e.to),source:"semver-heuristic",dependency:e.name,url:iNe(e),title:`${e.name} ${e.from} \u2192 ${e.to} (${e.bump})`,content:s,weight:$i["semver-heuristic"]}),!e.from||!e.to)return o(r);let a=ca(e.name,e.ecosystem,e.from).catch(()=>null),c=await qn(e.name,e.ecosystem,e.to),[l,u]=await Promise.all([a,ca(e.name,e.ecosystem,e.to).catch(()=>null)]);c?.deprecated&&r.push({id:St("ev",e.name,"deprecated",e.to),source:"registry-metadata",dependency:e.name,url:c.homepage??void 0,title:`${e.name}@${e.to} is deprecated`,content:c.deprecated,weight:$i["registry-metadata"]});let d=HCe(l?.runtime??null,u?.runtime??null);d&&r.push({id:St("ev",e.name,"runtime-metadata",e.to,d.runtime,d.requirement),source:"registry-metadata",dependency:e.name,url:c?.homepage??void 0,title:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}`,content:`${e.name}@${e.to} requires ${d.runtime} ${d.requirement}.`,weight:$i["registry-metadata"]});let p=c?.githubRepo,f=n.evidence.typeSurface?ZCe(e,t):null,m=p&&n.evidence.githubReleases?AH(p,e.from,e.to,e.ecosystem,{token:t.githubToken,maxReleases:n.evidence.maxReleases}):null,g=n.evidence.changelog&&(c?.changelogUrl||p)?(async()=>{if(c?.changelogUrl){let y=await xH(c.changelogUrl,p??null,e.from,e.to,e.ecosystem);if(y.length>0)return y}return p?SH(p,e.from,e.to,e.ecosystem):[]})():null,h=p&&n.evidence.changelog?TH(p):null;for(let y of[f,m,g,h])y?.catch(()=>{});let b=f?await f:null;if(b&&r.push(b),!p&&!g)return i.debug(`No source repository or declared changelog resolved for ${e.name}; prose evidence unavailable`),o(r);if(m){let y=await m;for(let w of y){let k=qg(w.body);t.onProseConsulted?.(e,{kind:"github-release",label:`${w.name??w.tag} release notes`,url:w.url,breaking:k.length>0}),k.length!==0&&r.push({id:St("ev",e.name,"release",w.tag),source:"github-release",dependency:e.name,url:w.url,title:`${e.name} ${w.name??w.tag} release notes`,content:k.join(` -`),weight:_i["github-release"]})}}if(g){let y=await g;for(let w of y){let k=DP(PP(w.content,e.ecosystem),e.from,e.to,e.ecosystem),_=k.some(S=>Fg(S.body).length>0);t.onProseConsulted?.(e,{kind:"changelog",label:w.path,url:w.url,breaking:_});for(let S of k){let x=Fg(S.body);x.length!==0&&r.push({id:St("ev",e.name,"changelog",w.path,S.version),source:"changelog",dependency:e.name,url:`${w.url}#L${S.line}`,locator:`${w.path}:${S.line}`,title:`${e.name} CHANGELOG \xA7 ${S.version}`,content:x.join(` +`),weight:$i["github-release"]})}}if(g){let y=await g;for(let w of y){let k=GP(zP(w.content,e.ecosystem),e.from,e.to,e.ecosystem),$=k.some(S=>qg(S.body).length>0);t.onProseConsulted?.(e,{kind:"changelog",label:w.path,url:w.url,breaking:$});for(let S of k){let x=qg(S.body);x.length!==0&&r.push({id:St("ev",e.name,"changelog",w.path,S.version),source:"changelog",dependency:e.name,url:`${w.url}#L${S.line}`,locator:`${w.path}:${S.line}`,title:`${e.name} CHANGELOG \xA7 ${S.version}`,content:x.join(` -`),weight:_i.changelog})}}}if(h)for(let y of await h){let w=Fg(y.content);t.onProseConsulted?.(e,{kind:"migration-guide",label:y.path,url:y.url,breaking:w.length>0}),w.length!==0&&r.push({id:St("ev",e.name,"migration",y.path),source:"migration-guide",dependency:e.name,url:y.url,locator:y.path,title:`${e.name} migration guide (${y.path})`,content:w.slice(0,200).join(` +`),weight:$i.changelog})}}}if(h)for(let y of await h){let w=qg(y.content);t.onProseConsulted?.(e,{kind:"migration-guide",label:y.path,url:y.url,breaking:w.length>0}),w.length!==0&&r.push({id:St("ev",e.name,"migration",y.path),source:"migration-guide",dependency:e.name,url:y.url,locator:y.path,title:`${e.name} migration guide (${y.path})`,content:w.slice(0,200).join(` -`),weight:_i["migration-guide"]})}return o(r)}async function UO(e,t){return n5(e,t)}var J9={node:"Node.js","node.js":"Node.js",nodejs:"Node.js",python:"Python",go:"Go",ruby:"Ruby",java:"Java",rust:"Rust"};function zNe(e,t){if(!t?.requirement)return null;let n=J9[t.name.toLowerCase()];if(!n)return null;let i=t.requirement.trim();if(!i)return null;if(!(e&&J9[e.name.toLowerCase()]===n))return{runtime:n,requirement:i};let o=c=>{let l=/(\d+(?:\.\d+)*)/.exec(c)?.[1];return l?l.split(".").map(u=>Number(u)):null},[s,a]=[o(e.requirement),o(i)];if(!s||!a)return null;for(let c=0;cu)return{runtime:n,requirement:i};if(l(n.debug(`Package module metadata diff failed for ${e.name}: ${l.message}`),[])),WNe(e.name,i,r,n)]);if(!a)return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, though its package.json changed between versions \u2014 that metadata-level change is counted below, but nothing about its public API could be verified.`)),Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, so this upgrade rests on prose evidence.`)),null);if(a.comparisonFailed){let l=`Comparing ${e.name}'s TypeScript declarations failed unexpectedly (${a.comparisonFailed}). This does not mean ${e.name} publishes no declarations.`;return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),null)}if(a.artifactUnavailable){let l=`${a.artifactUnavailable} could not be obtained and inspected from either jsDelivr or the exact npm registry tarball. This is an artifact availability failure, not proof that the package publishes no declarations.`;return t.onUnavailableSurface?.(e,ne("TypeScript declarations","artifact-unavailable",l)),s.length>0?Th(e,{changes:s,weight:_i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:$i(e.name,r,"package.json"),beforeUrl:$i(e.name,i,"package.json"),afterUrl:$i(e.name,r,"package.json")}):null}if(a.unreachable)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","version-unavailable",`${a.unreachable} could not be fetched, so nothing was compared. That version may have been unpublished, or the CDN may not carry it.`)),null;if(a.definitelyTyped)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} ships no declarations of its own; its types live in @types/${e.name.replace(/^@/,"").replace("/","__")}, which versions separately and does not move with this upgrade. Nothing was compared.`)),null;let c=[...s,...a.changes];return c.length===0?(a.comparable?t.onSurfaceComputed?.(e,{available:!0,changes:[],tool:"jsdelivr-dts-diff",weight:_i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} \u2192 ${e.name}@${r}:${a.afterEntryPath}`}):t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name}'s public API is neither in its own declarations nor in any dependency Drift could follow, so comparing its declarations proves nothing about this upgrade.`)),null):Th(e,{changes:c,weight:GNe(a)?_i["type-surface-diff"]*.9:_i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} + package.json \u2192 ${e.name}@${r}:${a.afterEntryPath} + package.json`,url:$i(e.name,r,a.afterEntryPath),beforeUrl:$i(e.name,i,a.beforeEntryPath),afterUrl:$i(e.name,r,a.afterEntryPath)})}let o=await K9(e,{logger:n,exec:t.exec,env:t.env,readRepoFile:BNe(t),autoInstall:t.config.tools.autoInstall});return o.available?(t.onSurfaceComputed?.(e,o),o.changes.length===0?null:Th(e,{changes:o.changes,weight:o.weight,locator:`${o.locator} \xB7 computed by ${o.tool}`,...o.packageRole?{packageRole:o.packageRole}:{}})):(n.debug(`No computed surface for ${e.name}: ${o.detail}`),t.onUnavailableSurface?.(e,o),null)}function BNe(e){let{workspaceRoot:t,readRepoFile:n,afterSha:i}=e;if(t)return async r=>(0,X9.readFile)((0,e5.join)(t,r),"utf8").catch(()=>null);if(n&&i)return r=>n(r,i).catch(()=>null)}function Th(e,t){let n=t.beforeUrl||t.afterUrl?["Declaration sources:",t.beforeUrl?`- before: ${t.beforeUrl}`:"",t.afterUrl?`- after: ${t.afterUrl}`:"",""].filter(Boolean).join(` -`):"";return{id:St("ev",e.name,"surface",e.from??"",e.to??""),source:"type-surface-diff",dependency:e.name,url:t.url,locator:t.locator,title:`${t.changes.length} ${qNe(t.packageRole)} change(s) in ${e.name}`,content:`${n}${HNe(t.changes)}`,findings:t.changes.map(i=>({code:i.kind,symbol:i.symbol,detail:i.detail,before:i.before,after:i.after,...i.changed?{changed:i.changed}:{},...i.replacement?{replacement:i.replacement}:{},...i.fromKind?{fromKind:i.fromKind}:{},...i.toKind?{toKind:i.toKind}:{},...i.moduleSystem?{moduleSystem:{...i.moduleSystem,incompatibleUsage:[...i.moduleSystem.incompatibleUsage],...i.moduleSystem.affectedSpecifiers?{affectedSpecifiers:[...i.moduleSystem.affectedSpecifiers]}:{},...i.moduleSystem.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.moduleSystem.affectedSpecifierPatterns]}:{}}}:{}})),weight:t.weight}}function qNe(e){switch(e){case"pom":return"Maven POM contract";case"analyzer":case"msbuild":case"tool":case"meta-package":return"NuGet package contract";case"asset":case"tooling":return"Pub package contract";default:return"API surface"}}var Z9=3;async function WNe(e,t,n,i){try{let[r,o]=await Promise.all([tl(e,t),tl(e,n)]);if(!r||!o)return null;(r.viaDependencies.length>0||o.viaDependencies.length>0)&&i.debug(`${e} surface includes ${[...new Set([...r.viaDependencies,...o.viaDependencies])].join(", ")}`);let s=Q8(e,r,o),a=Dr(r.api,o.api,{beforeComplete:!r.incomplete,afterComplete:!o.incomplete,packageName:e}),c=r.entryPath.startsWith("@types:")&&o.entryPath.startsWith("@types:")&&r.entryPath===o.entryPath;return{changes:s?[s,...a]:a,comparable:r.api.size>=Z9&&o.api.size>=Z9,beforeEntryPath:r.entryPath,afterEntryPath:o.entryPath,...c?{definitelyTyped:c}:{}}}catch(r){return i.debug(`Type surface diff failed for ${e}: ${r.message}`),r instanceof Y$?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",unreachable:`${r.packageName}@${r.version}`}:r instanceof Kd?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",artifactUnavailable:`${r.packageName}@${r.version}`}:{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",comparisonFailed:r.message}}}function $i(e,t,n){if(!(!n||n.startsWith("@types:")))return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`}function Y9(e){return XNe(e.replace(/\s+/g," ").trim(),4e3)}function HNe(e){let n=e.slice(0,60).map(i=>{let r=[`- ${i.detail}`];return i.before&&i.after&&(r.push(` before: ${Y9(i.before)}`),r.push(` after: ${Y9(i.after)}`)),r.join(` +`),weight:$i["migration-guide"]})}return o(r)}async function KO(e,t){return c5(e,t)}var t5={node:"Node.js","node.js":"Node.js",nodejs:"Node.js",python:"Python",go:"Go",ruby:"Ruby",java:"Java",rust:"Rust"};function HCe(e,t){if(!t?.requirement)return null;let n=t5[t.name.toLowerCase()];if(!n)return null;let i=t.requirement.trim();if(!i)return null;if(!(e&&t5[e.name.toLowerCase()]===n))return{runtime:n,requirement:i};let o=c=>{let l=/(\d+(?:\.\d+)*)/.exec(c)?.[1];return l?l.split(".").map(u=>Number(u)):null},[s,a]=[o(e.requirement),o(i)];if(!s||!a)return null;for(let c=0;cu)return{runtime:n,requirement:i};if(l(n.debug(`Package module metadata diff failed for ${e.name}: ${l.message}`),[])),XCe(e.name,i,r,n)]);if(!a)return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, though its package.json changed between versions \u2014 that metadata-level change is counted below, but nothing about its public API could be verified.`)),Dh(e,{changes:s,weight:$i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:_i(e.name,r,"package.json"),beforeUrl:_i(e.name,i,"package.json"),afterUrl:_i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} publishes no TypeScript declarations Drift could compare, so this upgrade rests on prose evidence.`)),null);if(a.comparisonFailed){let l=`Comparing ${e.name}'s TypeScript declarations failed unexpectedly (${a.comparisonFailed}). This does not mean ${e.name} publishes no declarations.`;return s.length>0?(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),Dh(e,{changes:s,weight:$i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:_i(e.name,r,"package.json"),beforeUrl:_i(e.name,i,"package.json"),afterUrl:_i(e.name,r,"package.json")})):(t.onUnavailableSurface?.(e,ne("TypeScript declarations","toolchain-failed",l)),null)}if(a.artifactUnavailable){let l=`${a.artifactUnavailable} could not be obtained and inspected from either jsDelivr or the exact npm registry tarball. This is an artifact availability failure, not proof that the package publishes no declarations.`;return t.onUnavailableSurface?.(e,ne("TypeScript declarations","artifact-unavailable",l)),s.length>0?Dh(e,{changes:s,weight:$i["type-surface-diff"],locator:`${e.name}@${i}:package.json \u2192 ${e.name}@${r}:package.json`,url:_i(e.name,r,"package.json"),beforeUrl:_i(e.name,i,"package.json"),afterUrl:_i(e.name,r,"package.json")}):null}if(a.unreachable)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","version-unavailable",`${a.unreachable} could not be fetched, so nothing was compared. That version may have been unpublished, or the CDN may not carry it.`)),null;if(a.definitelyTyped)return t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name} ships no declarations of its own; its types live in @types/${e.name.replace(/^@/,"").replace("/","__")}, which versions separately and does not move with this upgrade. Nothing was compared.`)),null;let c=[...s,...a.changes];return c.length===0?(a.comparable?t.onSurfaceComputed?.(e,{available:!0,changes:[],tool:"jsdelivr-dts-diff",weight:$i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} \u2192 ${e.name}@${r}:${a.afterEntryPath}`}):t.onUnavailableSurface?.(e,ne("TypeScript declarations","no-public-surface",`${e.name}'s public API is neither in its own declarations nor in any dependency Drift could follow, so comparing its declarations proves nothing about this upgrade.`)),null):Dh(e,{changes:c,weight:JCe(a)?$i["type-surface-diff"]*.9:$i["type-surface-diff"],locator:`${e.name}@${i}:${a.beforeEntryPath} + package.json \u2192 ${e.name}@${r}:${a.afterEntryPath} + package.json`,url:_i(e.name,r,a.afterEntryPath),beforeUrl:_i(e.name,i,a.beforeEntryPath),afterUrl:_i(e.name,r,a.afterEntryPath)})}let o=await e5(e,{logger:n,exec:t.exec,env:t.env,readRepoFile:YCe(t),autoInstall:t.config.tools.autoInstall});return o.available?(t.onSurfaceComputed?.(e,o),o.changes.length===0?null:Dh(e,{changes:o.changes,weight:o.weight,locator:`${o.locator} \xB7 computed by ${o.tool}`,...o.packageRole?{packageRole:o.packageRole}:{}})):(n.debug(`No computed surface for ${e.name}: ${o.detail}`),t.onUnavailableSurface?.(e,o),null)}function YCe(e){let{workspaceRoot:t,readRepoFile:n,afterSha:i}=e;if(t)return async r=>(0,o5.readFile)((0,s5.join)(t,r),"utf8").catch(()=>null);if(n&&i)return r=>n(r,i).catch(()=>null)}function Dh(e,t){let n=t.beforeUrl||t.afterUrl?["Declaration sources:",t.beforeUrl?`- before: ${t.beforeUrl}`:"",t.afterUrl?`- after: ${t.afterUrl}`:"",""].filter(Boolean).join(` +`):"";return{id:St("ev",e.name,"surface",e.from??"",e.to??""),source:"type-surface-diff",dependency:e.name,url:t.url,locator:t.locator,title:`${t.changes.length} ${QCe(t.packageRole)} change(s) in ${e.name}`,content:`${n}${eNe(t.changes)}`,findings:t.changes.map(i=>({code:i.kind,symbol:i.symbol,detail:i.detail,before:i.before,after:i.after,...i.changed?{changed:i.changed}:{},...i.replacement?{replacement:i.replacement}:{},...i.fromKind?{fromKind:i.fromKind}:{},...i.toKind?{toKind:i.toKind}:{},...i.moduleSystem?{moduleSystem:{...i.moduleSystem,incompatibleUsage:[...i.moduleSystem.incompatibleUsage],...i.moduleSystem.affectedSpecifiers?{affectedSpecifiers:[...i.moduleSystem.affectedSpecifiers]}:{},...i.moduleSystem.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.moduleSystem.affectedSpecifierPatterns]}:{}}}:{}})),weight:t.weight}}function QCe(e){switch(e){case"pom":return"Maven POM contract";case"analyzer":case"msbuild":case"tool":case"meta-package":return"NuGet package contract";case"asset":case"tooling":return"Pub package contract";default:return"API surface"}}var n5=3;async function XCe(e,t,n,i){try{let[r,o]=await Promise.all([rl(e,t),rl(e,n)]);if(!r||!o)return null;(r.viaDependencies.length>0||o.viaDependencies.length>0)&&i.debug(`${e} surface includes ${[...new Set([...r.viaDependencies,...o.viaDependencies])].join(", ")}`);let s=i8(e,r,o),a=Pr(r.api,o.api,{beforeComplete:!r.incomplete,afterComplete:!o.incomplete,packageName:e}),c=r.entryPath.startsWith("@types:")&&o.entryPath.startsWith("@types:")&&r.entryPath===o.entryPath;return{changes:s?[s,...a]:a,comparable:r.api.size>=n5&&o.api.size>=n5,beforeEntryPath:r.entryPath,afterEntryPath:o.entryPath,...c?{definitelyTyped:c}:{}}}catch(r){return i.debug(`Type surface diff failed for ${e}: ${r.message}`),r instanceof i$?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",unreachable:`${r.packageName}@${r.version}`}:r instanceof Jd?{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",artifactUnavailable:`${r.packageName}@${r.version}`}:{changes:[],comparable:!1,beforeEntryPath:"",afterEntryPath:"",comparisonFailed:r.message}}}function _i(e,t,n){if(!(!n||n.startsWith("@types:")))return`https://cdn.jsdelivr.net/npm/${e}@${t}/${n}`}function r5(e){return sNe(e.replace(/\s+/g," ").trim(),4e3)}function eNe(e){let n=e.slice(0,60).map(i=>{let r=[`- ${i.detail}`];return i.before&&i.after&&(r.push(` before: ${r5(i.before)}`),r.push(` after: ${r5(i.after)}`)),r.join(` `)});return e.length>60&&n.push(`- \u2026and ${e.length-60} more`),n.join(` -`)}async function KNe(e){let{config:t,logger:n,readRepoFile:i,beforeSha:r,afterSha:o}=e;if(!i||!r||!o)return[];let s=[];for(let a of el){if(!p8(a,t))continue;let c=await JNe(f8(a,t),e);for(let u of c.unresolvable)e.onUnavailableSpec?.(u,{available:!1,reason:"toolchain-failed",detail:`Drift could not list the files in this repository, so the pattern \`${u}\` could not be expanded and the contracts it covers were not compared.`,remedy:"List the contract documents by literal path instead of by pattern.",tool:a.tool});let l=[];for(let u of c.paths){let[d,p]=await Promise.all([i(u,r),i(u,o)]);!d||!p||a.handles(u,p)&&l.push({path:u,before:d,after:p})}for(let u of l){let d=u.path;if(u.before===u.after)continue;let p=await m8(a,u,{logger:n,exec:e.exec,env:e.env,siblings:l.filter(f=>f.path!==d)});if(!p.available){n.debug(`No ${a.id} diff for ${d}: ${p.detail}`),e.onUnavailableSpec?.(d,p);continue}e.onSpecComputed?.(d,a),p.changes.length!==0&&s.push({id:St("ev",d,a.id,o),source:a.source,dependency:d,locator:d,title:`${p.changes.length} breaking change(s) in ${d}`,content:ZNe(p.changes),findings:p.changes.map(f=>({code:f.code,symbol:f.location,detail:f.detail,...f.before!==void 0?{before:f.before}:{},...f.after!==void 0?{after:f.after}:{}})),weight:p.weight})}}return s}async function JNe(e,t){let n=e.filter(Q9),i=e.filter(s=>!Q9(s));if(n.length===0)return{paths:i,unresolvable:[]};let r=t.listRepoFiles&&t.afterSha?await t.listRepoFiles(t.afterSha):null;if(!r)return{paths:i,unresolvable:n};let o=new Set(i);for(let s of n)for(let a of r)DC(s,a)&&o.add(a);return{paths:[...o].sort(),unresolvable:[]}}function Q9(e){return e.includes("*")||e.includes("?")}function ZNe(e){return e.map(t=>`- \`${t.location}\` \u2014 ${t.detail}`).join(` -`)}function YNe(e){return e.from&&e.to&&Ig(e.from,e.to,e.ecosystem)?"https://semver.org/#spec-item-4":e.bump==="major"?"https://semver.org/#spec-item-8":"https://semver.org/"}function QNe(e){if(!e.from||!e.to)return null;let t=[];return e.bump==="major"?t.push(`Major version bump ${e.from} \u2192 ${e.to}. Semver permits arbitrary breaking changes across a major boundary.`):Ig(e.from,e.to,e.ecosystem)?t.push(`0.x minor bump ${e.from} \u2192 ${e.to}. Under semver \xA74 the minor position carries breaking changes while the major version is 0.`):e.bump==="minor"?t.push(`Minor bump ${e.from} \u2192 ${e.to}. Semver says this should be additive, which is a convention rather than a guarantee \u2014 minor releases do break consumers, so the version number alone is not evidence either way.`):e.bump==="patch"&&t.push(`Patch bump ${e.from} \u2192 ${e.to}. Breakage here is usually accidental.`),Tg(e.from,e.to,e.ecosystem)&&t.push(`This is a DOWNGRADE. Code written against ${e.from} may rely on APIs that do not exist in ${e.to}.`),t.length>0?t.join(" "):null}function XNe(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var rp=["","<","<=",">",">=","=","=="];function ip(e,t){return e==="="||e==="=="?t:e}var jO={node:{runtime:"node",acceptedOperators:[...rp,"^","~"],parserKind:"semver",supportsDisjunction:!0,normalizeOperator:e=>ip(e,"=")},python:{runtime:"python",acceptedOperators:[...rp,"~="],parserKind:"pep440",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"==")},ruby:{runtime:"ruby",acceptedOperators:rp,parserKind:"rubygems",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},go:{runtime:"go",acceptedOperators:rp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},java:{runtime:"java",acceptedOperators:rp,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")},rust:{runtime:"rust",acceptedOperators:[...rp,"^","~"],parserKind:"cargo",supportsDisjunction:!1,normalizeOperator:e=>ip(e,"=")}};function zO(e,t){let n=jO[e];if(!n.acceptedOperators.includes(t))return{status:"unknown",operator:t};let i=n.normalizeOperator(t);return i===null?{status:"unknown",operator:t}:{status:"parsed",operator:i}}function l_(e){let t=eO(e);if(t)return t.kind;switch(e){case"export-removed":return"removed-export";case"member-removed":return"removed-export";case"signature-changed":return"signature-change";case"constant-value-changed":return"signature-change";case"kind-changed":return"type-change";case"member-now-required":return"required-field-added";case"entry-point-moved":case"package-removed":return"moved-export";case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":return"module-system-change";case"runtime-requirement-raised":return"runtime-requirement";default:return"unknown"}}function o5(e,t){let{code:n,symbol:i}=e,r=eO(n);if(r)return r.remediation(e);let o=eCe(i);if(o&&(n==="export-removed"||n==="member-removed"))return`The published ${o} entry \`${i}\` was removed. Review the consuming manifest, build, asset, or tooling configuration and update it if it relies on this entry; assess this package-role contract independently of source call signatures.`;if(o&&n==="signature-changed")return`The published ${o} entry \`${i}\` changed. Review the consuming manifest, build, asset, or tooling configuration against the new contract; this is not an ordinary call-site signature change.`;switch(n){case"runtime-requirement-raised":return`\`${t}\` is now compiled for Java ${e.after??"a newer release"}. Raise this project's Java toolchain to match \u2014 the compiler release and target in the build (\`maven.compiler.release\`, \`sourceCompatibility\`/\`targetCompatibility\`), the JDK used in CI, and any runtime base image \u2014 or stay on the previous version. There is no source change that avoids this.`;case"export-removed":return`Every use of \`${i}\` from \`${t}\` must be replaced. Find the supported replacement in the new version's exports and migrate each call site. Do not stub \`${i}\` out or re-implement it locally unless no replacement exists \u2014 if none exists, say so in the PR description rather than inventing one.`;case"member-removed":return`The member \`${i}\` no longer exists in \`${t}\`. Update each access to use the replacement member, or restructure the calling code if the capability was removed outright.`;case"signature-changed":switch(e.changed){case"parameters":return`The parameters of \`${i}\` changed; its return type did not. Update every call site to pass arguments matching the new list \u2014 check argument order, argument count, and whether an options object replaced positional arguments. A call that only reads the result of \`${i}\` needs no change beyond its arguments.`;case"return-type":return`The return type of \`${i}\` changed; its parameters did not, so no call site needs its arguments touched. What changed is what a caller gets back. In a statically typed language, a call site that assigns or passes the result on will fail to compile and point you straight at the fix; nothing here needs a source change beyond letting the type checker find those. In a dynamically typed one (plain JavaScript, Python, Ruby), nothing will catch this automatically \u2014 search for call sites that store, destructure, or pass along the result of \`${i}\` and check each one against the new type by hand.`;case"both":return`Both the parameters and the return type of \`${i}\` changed. Update every call site's arguments to match the new parameter list, then separately check what each call site does with the result: a statically typed caller will have a mismatched return type caught by its own compiler, a dynamically typed one will not.`;default:return`The signature of \`${i}\` changed. Update every call site to match the new signature exactly. Pay attention to argument order, argument count, and whether an options object replaced positional arguments.`}case"constant-value-changed":return`\`${i}\` changed underlying value. This does not necessarily require a source change \u2014 most code that only refers to \`${i}\` by name keeps working. Review code in this repository that depends on the concrete value: a hard-coded copy of the old number, a value persisted or sent over the wire, or a comparison against zero or another literal.`;case"kind-changed":return tCe(i,e.fromKind,e.toKind);case"entry-point-moved":return`The import path changed, not the API. ${e.detail} Update the import specifier in every file that imports from \`${t}\`, and do not replace, stub, or re-implement the individual symbols \u2014 they still exist under the new entry point. If you cannot determine which entry point carries a symbol this repository uses, leave that import alone with a \`TODO(drift):\` comment naming the symbol.`;case"package-removed":return`The package \`${i}\` no longer exists in \`${t}\`. Update the import path in every file that imports it to whichever package now provides the same API. Do not re-implement or stub the symbols it exported \u2014 if you cannot determine the replacement package, leave the import in place with a \`TODO(drift):\` comment naming it rather than guessing.`;case"member-now-required":return`\`${i}\` is now required. Supply an explicit value at every construction site. Choose the value that preserves the previous default behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`;case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":{let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,c=s?.length&&a?.length?`the affected \`require()\` sites for ${[...s.map(l=>`\`${l}\``),...a.map(l=>`specifier pattern \`${l}\``)].join(", ")}`:s&&s.length===1?`\`require('${s[0]}')\``:s&&s.length>1?`the affected \`require()\` sites for ${s.map(l=>`\`${l}\``).join(", ")}`:a&&a.length===1?`\`require()\` sites whose specifier matches \`${a[0]}\``:a&&a.length>1?`the affected \`require()\` sites matching ${a.map(l=>`\`${l}\``).join(", ")}`:`each localized \`require('${t}')\` site`;return`\`${t}\` no longer exposes the CommonJS loading compatibility it exposed before. Update ${c} to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import()\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`}default:return`Review usages of \`${i}\` from \`${t}\` and update them for the new version.`}}function eCe(e){return e.startsWith("pom:")?"Maven POM contract":e.startsWith("nuget:")?"NuGet package contract":e.startsWith("pub:")?"Pub package contract":null}function tCe(e,t,n){return t==="class"&&n==="function"?`\`${e}\` is no longer a class \u2014 it is a function now. Remove \`new\` from every construction site (\`new ${e}(...)\` becomes \`${e}(...)\`); calling it without \`new\` on the old version would have thrown or behaved differently, so every call site necessarily used \`new\` and necessarily needs it removed. Anything that did \`instanceof ${e}\` on the result has no replacement to fall back on automatically \u2014 check what it was actually testing for.`:t==="function"&&n==="class"?`\`${e}\` is a class now, not a function. Add \`new\` at every call site (\`${e}(...)\` becomes \`new ${e}(...)\`); calling a class without \`new\` throws in JavaScript, so this is a hard requirement, not a style choice.`:(t==="interface"||t==="type")&&n==="class"?`\`${e}\` is a class now, not just a type. Nothing changes for code that only used it as a type annotation \u2014 but if this repository ever constructed a value shaped like it by hand (an object literal, a factory function), that code should now go through \`new ${e}(...)\` if the class provides real behaviour a plain object cannot.`:t==="class"&&(n==="interface"||n==="type")?`\`${e}\` is a plain type now, not a class. Replace every \`new ${e}(...)\` with however the package now wants this value built. Remove any \`instanceof ${e}\` check \u2014 there is no runtime class left to test against; if the value's presence still needs checking, do a structural check on its fields instead.`:t==="namespace"||n==="namespace"?`\`${e}\` moved between a namespace and a ${t==="namespace"?n:t}. Update every access through \`${e}.\` to match how its members are reached in the new form, and update any type position that named \`${e}\` directly.`:`\`${e}\` changed from a ${t??"previous form"} to a ${n??"different form"}. Update declarations, \`new\` expressions, and type positions accordingly.`}function nCe(...e){let t=e.flatMap(n=>{let[i,r]=n.split("|");return[i,r,`${i}s`]});return`(?:${[...new Set(t)].join("|")})`}var rCe=nCe("remove|removed","drop|dropped","delete|deleted"),op=String.raw`(node(?:\.js)?|python|go|ruby|java|rust)\b`,dl=String.raw`([<>=^~]*\s*v?\d+(?:\.\d+){0,3}(?:(?:\s*,\s*|\s*\|\|\s*|\s+)\s*[<>=^~]*\s*v?\d+(?:\.\d+){0,3})*)`,r5=String.raw`(?:versions?\s*)?(?:is\s+|:\s*)?`,i5=[{id:"prose-dropped-runtime-prefix",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:(?:dropped|drops?|removed)\s+support\s+for|no\s+longer\s+supports?)\s+${op}\s*${r5}${dl}`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${op}\s*(?:versions?\s*)?${dl}\s+(?:is|are|was|were)\s+no\s+longer\s+supported`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-support-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bsupport\s+for\s+${op}\s*(?:versions?\s*)?${dl}\s+(?:was|were|is|has\s+been)\s+removed`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-min-runtime-leading",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:requires?|required|now\s+requires?|minimum(?:\s+supported)?)\s+${op}\s*${r5}(?:raised\s+to\s*)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version raised to ${e[2]?.trim()}`},{id:"prose-min-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${op}\s+v?${dl}\s+is\s+now\s+required`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-supported-version",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bminimum\s+supported\s+${op}\s+version\s+is\s+(?:now\s+)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-msrv",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(rust)\b\s+MSRV\s+is\s+(?:now\s+)?${dl}`,"i"),symbolGroup:1,summarize:e=>`Minimum Rust version is ${e[2]?.trim()}`}],iCe=[...i5.filter(e=>e.id.startsWith("prose-dropped-runtime")),{id:"prose-removed",kind:"removed-export",pattern:/`([\w$.]+)`(?:\(\))?\s+(?:has been|have been|was|were|is|are)\s+removed\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-removed-passive",kind:"removed-export",pattern:new RegExp(`\\b${rCe}\\s+(?:the\\s+)?\`([\\w$.]+)\``,"i"),symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-renamed",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?renamed\s+to\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was renamed to \`${e[2]}\``},{id:"prose-replaced",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?replaced\s+(?:by|with)\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was replaced by \`${e[2]}\``},{id:"prose-deprecated-in-favour",kind:"renamed-export",pattern:/`([\w$.]+)`\s+is\s+deprecated\s+in\s+favou?r\s+of\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` is deprecated in favour of \`${e[2]}\``},{id:"prose-no-longer",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer ${e[2]?.trim()}`},{id:"prose-now-requires",kind:"signature-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+(?:requires|takes|accepts|expects)\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now requires ${e[2]?.trim()}`},{id:"prose-now-returns",kind:"type-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+returns\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now returns ${e[2]?.trim()}`},{id:"prose-signature-of-symbol",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+of\s+`([\w$.]+)`[^.\n]{0,40}?\b(?:changed|changes|change\b|different|new\b)/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-symbol-signature-changed",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:call|constructor|method)?\s*signature\s+(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-nth-argument-of-symbol",kind:"signature-change",pattern:/\b(?:first|second|third|fourth|fifth|sixth|last|\d+(?:st|nd|rd|th))\s+(?:positional\s+)?(?:argument|parameter|param|arg)\s+(?:for|of|to|in|passed\s+to)\s+`([\w$.]+)`/i,symbolGroup:1,summarize:e=>`an argument of \`${e[1]}\` changed`},{id:"prose-symbol-no-longer-takes",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(?:takes|accepts|expects|requires)\s+(.{2,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer takes ${e[2]?.trim()}`},{id:"prose-signature-changed-phrase",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+(?:of\b[^.\n]{0,80}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b|\bchanged\s+(?:the\s+)?(?:\w+\s+){0,3}signature\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-call-shape-rewrite",kind:"signature-change",pattern:/\b(?:refactor(?:ed|ing)?\s+)?([\w$.]+)\s*\((?:[^()]|\([^()]*\))*\)\s*(?:->|→|into)\s*\1\s*\(/i,symbolGroup:0,summarize:()=>"a call signature was rewritten"},{id:"prose-verb-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:changed?|changing|updated?|updating|revamp(?:ed)?|rework(?:ed)?|adjust(?:ed)?|modif(?:y|ied)|switch(?:ed)?|new|different|generic\s+single)\s+(?:the\s+)?[\w`.$()/,&\s-]{0,45}?\bsignatures?\b|\bsignatures?\s+(?:of\b[^.\n]{0,60}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+|now\s+|changed|change[ds]|updated?)\b|\b(?:two|multiple|separate|distinct|overloaded)\s+signatures?\b|\binterfaces?\s+(?:has\s+|have\s+)?changed\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-argument-list-changed",kind:"signature-change",refinement:!0,pattern:new RegExp([String.raw`\b(?:arg(?:ument)?|param(?:eter)?)s?\s+order\b`,String.raw`\bargs?\s+now\s+(?:given|passed|taken)\b`,String.raw`\b(?:standardi[sz]e|standardi[sz]ed)\s+(?:the\s+)?arg(?:ument)?s?\b`,String.raw`\barg(?:ument)?s?\s+(?:have\s+been\s+|were\s+|are\s+|been\s+)?(?:swapped|reordered|re-ordered)\b`,"\\b`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\s+(?:(?:to|of|from|in|for)\\s+`?[\\w$.]+`?\\s+)?(?:have\\s+|has\\s+|have\\s+been\\s+|has\\s+been\\s+|is\\s+|are\\s+|was\\s+|were\\s+|been\\s+)?(?:removed|added|dropped|changed)\\b",String.raw`\breturn\s+types?\s+(?:has\s+|have\s+|now\s+)?(?:changed|change[ds])\b`,String.raw`\bupdate\s+[\w$.()]+\s+to\s+return\b`,String.raw`\btype\s+changed\s+from\b`,"\\breplaced?\\s+[\\w$.()`]{0,30}?\\s+args?\\s+w(?:ith|/)\\b","\\b(?:removed?|dropped?|added?)\\s+(?:the\\s+|a\\s+|an\\s+)?(?:deprecated\\s+|new\\s+|optional\\s+|required\\s+)?`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\b",String.raw`\bno\s+longer\s+(?:accepts?|takes?|supports?|allows?|passes?)\b[^.\n]{0,45}?(?:arg(?:ument)?s?|param(?:eter)?s?|[Ss]elector|callbacks?|thisArg)\b`,String.raw`\bcall\s+pattern\s+is\s+no\s+longer\b`,String.raw`\bis\s+no\s+longer\s+(?:a\s+)?valid\s+call\b`,"\\b(?:`?thisArg`?|this\\s+argument)\\b[^.\\n]{0,40}?\\b(?:removed|no\\s+longer|default|undefined|dropped)\\b",String.raw`\b(?:requires?|required|takes?|needs?|accepts?|expects?)\s+(?:a\s+|an\s+|the\s+)?(?:new|additional|extra|second|third|fourth)\s+(?:constructor\s+)?(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\b(?:constructor|function|method)\s+(?:signature\s+)?(?:now\s+)?(?:requires?|takes?|accepts?|expects?|required)\b`,String.raw`\bis\s+no\s+longer\s+(?:the\s+)?(?:first|second|third|fourth|fifth|last|\d+(?:st|nd|rd|th))\s+(?:arg(?:ument)?|param(?:eter)?)\b`,String.raw`\bnow\s+(?:have|has)\s+(?:two|three|multiple|several)\s+(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\bnow\s+(?:two|three)\s+param(?:eter)?s\b`,"\\b(?:use|using|takes?|expects?|switch(?:ed)?\\s+`?[\\w$.]+`?(?:\\s+setting)?\\s+to|switch(?:ed)?\\s+to|pass(?:ing)?|is\\s+now|are\\s+now|it\\s+is\\s+now)\\s+(?:an?\\s+|two\\s+|the\\s+)?(?:object\\s+options?|options?\\s+(?:object|hash)|config(?:uration)?\\s+(?:object|hash)|`?[\\w$.]+`?\\s+option\\b)",String.raw`\b(?:options?|config(?:uration)?)\s+(?:object|hash)\s+(?:as\b|instead\b|for\b)`,String.raw`\bparam(?:eter)?s?\s+(?:are|is)\s+no\s+longer\s+optional\b`,String.raw`\bformerly\s+a\s+config\s+object\b`].join("|"),"i"),symbolGroup:0,summarize:()=>"an argument list changed"},{id:"prose-async-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:make[s]?|made|turn(?:ed)?|change)\s+[\w`#.$()"\s]{1,40}?\s+(?:(?:in)?to\s+)?(?:be\s+)?(?:an?\s+)?a?sync(?:hronous)?(?:\s+function)?\b|\b(?:is|are|be)\s+(?:now\s+|an?\s+)*a?sync(?:hronous)?(?:\s+function|\s+now)?\b|\bnow\s+a?sync(?:hronous)?\b|\ba?sync\s+now\b|\basync\b[^.\n]{0,40}?\b(?:callback|promise|await|sync)\b|\b(?:callback|promise|sync)s?\b[^.\n]{0,40}?\basync\b|\bpromises?\s+instead\s+of\s+(?:using\s+)?callbacks?\b|\bnow\s+returns?\s+(?:a\s+|an\s+)?(?:promise|observable|thenable|query)\b|\bnow\s+return\s+promises\b|\breturns?\s+[\w"']+,?\s+not\s+(?:a\s+)?(?:promise|callback|query)\b|\b(?:needs?|has|have|dosnt\s+wait|doesn'?t\s+wait)\s+to\s+be\s+awaited\b|\bmust\s+(?:now\s+)?be\s+awaited\b|\b(?:update|change|updated)\s+(?:the\s+)?return\s+types?\b|\bdrop(?:ped|s)?\s+(?:support\s+for\s+)?callbacks?\b|\bremove[d]?\s+callback\s+support\b|\bno\s+(?:longer\s+)?(?:takes?|accepts?|using)\s+(?:a\s+|the\s+)?callbacks?\b/i,symbolGroup:0,summarize:()=>"a callback/return signature changed"},{id:"prose-symbol-now-required",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:is|are|becomes?|became)\s+now\s+(?:required|mandatory|non-optional)\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now required`},{id:"prose-is-now",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+(?:is|are|must)\s+now\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now ${e[2]?.trim()}`},{id:"prose-moved",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has\s+)?moved\s+to\s+`([\w$./@-]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` moved to \`${e[2]}\``},...i5.filter(e=>e.id.startsWith("prose-min-runtime")),{id:"prose-esm-only",kind:"module-system-change",pattern:/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b/i,symbolGroup:0,summarize:()=>"The package is now ESM-only and no longer supports `require()`",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-dropped-commonjs",kind:"module-system-change",pattern:/\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,symbolGroup:0,summarize:()=>"CommonJS support was dropped",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-breaking-change-footer",kind:"behaviour-change",pattern:/^BREAKING[ -]CHANGES?:\s*(.{3,160}?)(?:[.;]|$)/i,symbolGroup:0,summarize:e=>`Declared as a breaking change: ${e[1]?.trim()}`},{id:"prose-breaking-change-marker",kind:"unknown",pattern:/^BREAKING[ -]CHANGES?\b\s*:?\s*(?:none|n\/a)?\s*$/i,symbolGroup:0,summarize:()=>"Declared as a breaking change (no detail given)"}];function s5(e){for(let t of e.split(` -`)){let n=t.replace(/\r$/,"").replace(/^\s*[-*>]+\s+/,"").replace(/\*{1,3}([^*\n]+?)\*{1,3}/g,"$1").replace(/\s*[-*=]{2,}\s*$/,"").trim();if(/^BREAKING[ -]CHANGES?\b[ \t]*(?::|[-–—][ \t]|$)/i.test(n)||/^#{1,6}[ \t].*\bbreaking\s+changes?\b/i.test(n))return!0}return!1}function a5(e,t={}){let n=[],i=e.replace(/^[-*+]\s+/,"").trim();if(!i)return n;for(let r of iCe){let o=r.pattern.exec(i);if(!o)continue;let s=r.symbolGroup===0?null:o[r.symbolGroup];if(r.symbolGroup!==0&&!s)continue;let a=r.kind==="runtime-requirement"?oCe(o,r.id):void 0;if(r.kind==="runtime-requirement"&&!a)continue;let c=r.replacementGroup?o[r.replacementGroup]:void 0;n.push({ruleId:r.id,kind:r.kind,summary:a?a.kind==="minimum-runtime"?a.requirement.includes("||")?`Supported ${a.runtime} versions are now ${a.requirement}`:`Minimum ${a.runtime} version is now ${a.requirement}`:`${a.runtime} ${a.requirement} is no longer supported`:r.summarize(o),symbols:s?[s]:[],...a?{runtime:a}:{},replacementSymbols:c?[c]:[],...r.moduleSystem?{moduleSystem:{...r.moduleSystem,incompatibleUsage:[...r.moduleSystem.incompatibleUsage]}}:{},...r.refinement?{refinement:!0}:{},passage:i})}return t.anchored||n.some(r=>!r.refinement)?n:n.filter(r=>!r.refinement)}function oCe(e,t){let n=e[1]?.toLowerCase().replace(/\.js$/,""),i=e[2]?.trim();if(!n||!i||!["node","python","go","ruby","java","rust"].includes(n))return null;if(i.includes("||"))return aCe(n,i,e[0].trim(),t);let r=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(i);if(!r)return null;let o=r[1]??"",s=r[2],a=i.replace(/v?(\d+(?:\.\d+){0,3})/gi,(p,f)=>n==="java"?f.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):f),c=e[0].trim(),l=zO(n,o),u=l.status,d=a.replace(/^\s*[<>=^~]*\s*/,l.operator||">=");if(t.startsWith("prose-dropped-runtime")){if(o===""){let p=s.split(".");return{kind:"unsupported-runtime-range",runtime:n,requirement:i.includes(",")||/\s+[<>=^~]/.test(i)?d:p.length<3?`${s}.x`:s,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"unsupported-runtime-range",runtime:n,requirement:d,...o==="<"?{derivedMinimum:`>=${s}`}:{},...o==="<="?{derivedMinimum:`>${s}`}:{},sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"minimum-runtime",runtime:n,requirement:d,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}function sCe(e){let t=/^v?(\d+(?:\.\d+){0,3})$/i.exec(e.trim());if(!t)return e;let n=t[1];return n.split(".").length<3?`${n}.x`:n}function aCe(e,t,n,i){let r=t.split("||").map(c=>c.trim()).filter(Boolean);if(r.length<2)return null;let o=jO[e].supportsDisjunction?"parsed":"unknown",s=[];for(let c of r){let l=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(c);if(!l)return null;let u=l[1]??"",d=zO(e,u);d.status==="unknown"&&(o="unknown");let p=c.replace(/v?(\d+(?:\.\d+){0,3})/gi,(f,m)=>e==="java"?m.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):m);s.push(u===""?sCe(p):p.replace(/^\s*[<>=^~]*\s*/,d.operator))}let a={runtime:e,requirement:s.join(" || "),sourceText:n,...o==="unknown"?{rangeParseStatus:"unknown"}:{}};return i.startsWith("prose-dropped-runtime")?{kind:"unsupported-runtime-range",...a}:{kind:"minimum-runtime",...a}}function c5(e,t){let n=e.symbols[0]??"the affected API",i=e.replacementSymbols[0];switch(e.kind){case"removed-export":return`\`${n}\` was removed from \`${t}\`. Replace every usage. Verify against the installed version's actual exports before choosing a replacement \u2014 the changelog may be incomplete.`;case"renamed-export":return i?`Replace every usage of \`${n}\` with \`${i}\`, checking that the new API's signature matches before assuming it is a drop-in rename.`:`\`${n}\` was replaced. Migrate every usage to the documented successor.`;case"signature-change":return`The way \`${n}\` is called changed: ${e.summary}. Update every call site and confirm against the installed type declarations.`;case"type-change":return`The type produced by \`${n}\` changed: ${e.summary}. Update consumers of its return value, including any local type declarations.`;case"behaviour-change":return`Behaviour changed: ${e.summary}. Review call sites for assumptions that no longer hold. Prefer making the assumption explicit over silently adapting to the new behaviour.`;case"runtime-requirement":return e.runtime?.kind==="unsupported-runtime-range"?e.runtime.derivedMinimum?`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported. That unambiguously means a floor of ${e.runtime.derivedMinimum}; update the runtime version declared in CI workflows, engine fields, and container images accordingly.`:`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported, but the release note does not establish a replacement minimum. Review the project's declared runtime against authoritative upstream compatibility guidance rather than inventing one.`:`${e.summary}. Update the runtime version declared in CI workflows, engine fields, and container images. Do not change application logic for this.`;case"module-system-change":return`\`${t}\` no longer exposes a CommonJS-compatible entry point. Update each localized \`require('${t}')\` site to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import('${t}')\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`;case"config-change":return`Configuration must change: ${e.summary}.`;default:return`Review usages of \`${n}\` and update them: ${e.summary}`}}var cCe=["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"],lCe=["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"],uCe=["symbol","type","module","package","dependency-cohort","runtime","ecosystem"],dCe=["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"];var pCe={"export-removed":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["direct"]},"member-removed":{nature:"api-shape",detectability:["compile-time"],scope:"symbol",visibility:["direct"]},"signature-changed":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["direct"]},"kind-changed":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"member-now-required":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"entry-point-moved":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"package-removed":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"commonjs-entry-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"exports-require-condition-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"package-type-changed":{nature:"packaging",detectability:["manifest","link-or-import","compile-time"],scope:"package",visibility:["direct"]},"constant-value-changed":{nature:"behaviour",detectability:["static-semantic","runtime-only"],scope:"symbol",visibility:["direct"]},...fCe()};function fCe(){let e={};for(let t of el)for(let[n,i]of Object.entries(t.codes))e[n]=i.taxonomy;return e}var mCe={"removed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"renamed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"moved-export":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"module",visibility:["unknown"]},"signature-change":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["unknown"]},"type-change":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["unknown"]},"behaviour-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"default-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"removed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},"changed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},"required-field-added":{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"type",visibility:["unknown"]},"config-change":{nature:"configuration",detectability:["static-semantic","runtime-only"],scope:"module",visibility:["unknown"]},"module-system-change":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"runtime-requirement":{nature:"runtime-environment",detectability:["manifest","runtime-only"],scope:"runtime",visibility:["direct"]},unknown:{nature:"behaviour",detectability:["runtime-only"],scope:"module",visibility:["unknown"]}};function sp(e,t){let n=t?pCe[t]:void 0;if(n)return{...l5(n),origin:"computed"};let i=mCe[e];return{...l5(i),origin:e==="unknown"?"default":"rule"}}function l5(e){return{nature:e.nature,detectability:[...e.detectability],scope:e.scope,visibility:[...e.visibility]}}function Or(e){return e.taxonomy??sp(e.kind)}function p5(e,t){if(!e||typeof e!="object")return t;let n=e,i=u5(n.nature,cCe),r=u5(n.scope,uCe),o=d5(n.detectability,lCe),s=d5(n.visibility,dCe);return!i||!r?t:{nature:i,scope:r,detectability:o.length>0?o:[...t.detectability],visibility:s.length>0?s:["unknown"],origin:"llm-normalized"}}function u5(e,t){return typeof e=="string"&&t.includes(e)?e:null}function d5(e,t){if(!Array.isArray(e))return[];let n=new Set;for(let i of e)typeof i=="string"&&t.includes(i)&&n.add(i);return t.filter(i=>n.has(i))}function u_(e){let t=["manifest","link-or-import","compile-time","static-semantic"];return!e.detectability.some(n=>t.includes(n))}var OOe={type:"object",properties:{changes:{type:"array",items:{type:"object",properties:{summary:{type:"string",description:"One sentence stating what changed upstream and why it breaks consumers."},remediation:{type:"string",description:"Imperative instructions for fixing affected call sites."},symbols:{type:"array",items:{type:"string"},description:"Exact identifiers to search for in consumer code: export names, method names, option keys, endpoint paths. Empty if the evidence names none."},kind:{type:"string",enum:["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement","unknown"]},evidenceId:{type:"string",description:"The id of the evidence excerpt this was extracted from."},taxonomy:{type:"object",properties:{nature:{type:"string",enum:["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"]},detectability:{type:"array",items:{type:"string",enum:["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"]},description:"What would have to run to notice this. Be honest: a change that only shows up at runtime must not be listed as compile-time."},scope:{type:"string",enum:["symbol","type","module","package","dependency-cohort","runtime","ecosystem"]},visibility:{type:"array",items:{type:"string",enum:["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"]},description:"Use `unknown` when the evidence does not say. Do not guess `direct`."}},required:["nature","detectability","scope","visibility"],additionalProperties:!1}},required:["summary","remediation","symbols","kind","evidenceId"],additionalProperties:!1}}},required:["changes"],additionalProperties:!1},MOe=`You extract breaking changes from dependency release notes for an automated refactoring tool. +`)}async function tNe(e){let{config:t,logger:n,readRepoFile:i,beforeSha:r,afterSha:o}=e;if(!i||!r||!o)return[];let s=[];for(let a of nl){if(!bY(a,t))continue;let c=await nNe(vY(a,t),e);for(let u of c.unresolvable)e.onUnavailableSpec?.(u,{available:!1,reason:"toolchain-failed",detail:`Drift could not list the files in this repository, so the pattern \`${u}\` could not be expanded and the contracts it covers were not compared.`,remedy:"List the contract documents by literal path instead of by pattern.",tool:a.tool});let l=[];for(let u of c.paths){let[d,p]=await Promise.all([i(u,r),i(u,o)]);!d||!p||a.handles(u,p)&&l.push({path:u,before:d,after:p})}for(let u of l){let d=u.path;if(u.before===u.after)continue;let p=await wY(a,u,{logger:n,exec:e.exec,env:e.env,siblings:l.filter(f=>f.path!==d)});if(!p.available){n.debug(`No ${a.id} diff for ${d}: ${p.detail}`),e.onUnavailableSpec?.(d,p);continue}e.onSpecComputed?.(d,a),p.changes.length!==0&&s.push({id:St("ev",d,a.id,o),source:a.source,dependency:d,locator:d,title:`${p.changes.length} breaking change(s) in ${d}`,content:rNe(p.changes),findings:p.changes.map(f=>({code:f.code,symbol:f.location,detail:f.detail,...f.before!==void 0?{before:f.before}:{},...f.after!==void 0?{after:f.after}:{}})),weight:p.weight})}}return s}async function nNe(e,t){let n=e.filter(i5),i=e.filter(s=>!i5(s));if(n.length===0)return{paths:i,unresolvable:[]};let r=t.listRepoFiles&&t.afterSha?await t.listRepoFiles(t.afterSha):null;if(!r)return{paths:i,unresolvable:n};let o=new Set(i);for(let s of n)for(let a of r)GN(s,a)&&o.add(a);return{paths:[...o].sort(),unresolvable:[]}}function i5(e){return e.includes("*")||e.includes("?")}function rNe(e){return e.map(t=>`- \`${t.location}\` \u2014 ${t.detail}`).join(` +`)}function iNe(e){return e.from&&e.to&&Og(e.from,e.to,e.ecosystem)?"https://semver.org/#spec-item-4":e.bump==="major"?"https://semver.org/#spec-item-8":"https://semver.org/"}function oNe(e){if(!e.from||!e.to)return null;let t=[];return e.bump==="major"?t.push(`Major version bump ${e.from} \u2192 ${e.to}. Semver permits arbitrary breaking changes across a major boundary.`):Og(e.from,e.to,e.ecosystem)?t.push(`0.x minor bump ${e.from} \u2192 ${e.to}. Under semver \xA74 the minor position carries breaking changes while the major version is 0.`):e.bump==="minor"?t.push(`Minor bump ${e.from} \u2192 ${e.to}. Semver says this should be additive, which is a convention rather than a guarantee \u2014 minor releases do break consumers, so the version number alone is not evidence either way.`):e.bump==="patch"&&t.push(`Patch bump ${e.from} \u2192 ${e.to}. Breakage here is usually accidental.`),Dg(e.from,e.to,e.ecosystem)&&t.push(`This is a DOWNGRADE. Code written against ${e.from} may rely on APIs that do not exist in ${e.to}.`),t.length>0?t.join(" "):null}function sNe(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var ip=["","<","<=",">",">=","=","=="];function op(e,t){return e==="="||e==="=="?t:e}var HO={node:{runtime:"node",acceptedOperators:[...ip,"^","~"],parserKind:"semver",supportsDisjunction:!0,normalizeOperator:e=>op(e,"=")},python:{runtime:"python",acceptedOperators:[...ip,"~="],parserKind:"pep440",supportsDisjunction:!1,normalizeOperator:e=>op(e,"==")},ruby:{runtime:"ruby",acceptedOperators:ip,parserKind:"rubygems",supportsDisjunction:!1,normalizeOperator:e=>op(e,"=")},go:{runtime:"go",acceptedOperators:ip,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>op(e,"=")},java:{runtime:"java",acceptedOperators:ip,parserKind:"simple",supportsDisjunction:!1,normalizeOperator:e=>op(e,"=")},rust:{runtime:"rust",acceptedOperators:[...ip,"^","~"],parserKind:"cargo",supportsDisjunction:!1,normalizeOperator:e=>op(e,"=")}};function JO(e,t){let n=HO[e];if(!n.acceptedOperators.includes(t))return{status:"unknown",operator:t};let i=n.normalizeOperator(t);return i===null?{status:"unknown",operator:t}:{status:"parsed",operator:i}}function h$(e){let t=cO(e);if(t)return t.kind;switch(e){case"export-removed":return"removed-export";case"member-removed":return"removed-export";case"signature-changed":return"signature-change";case"constant-value-changed":return"signature-change";case"kind-changed":return"type-change";case"member-now-required":return"required-field-added";case"entry-point-moved":case"package-removed":return"moved-export";case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":return"module-system-change";case"runtime-requirement-raised":return"runtime-requirement";default:return"unknown"}}function d5(e,t){let{code:n,symbol:i}=e,r=cO(n);if(r)return r.remediation(e);let o=aNe(i);if(o&&(n==="export-removed"||n==="member-removed"))return`The published ${o} entry \`${i}\` was removed. Review the consuming manifest, build, asset, or tooling configuration and update it if it relies on this entry; assess this package-role contract independently of source call signatures.`;if(o&&n==="signature-changed")return`The published ${o} entry \`${i}\` changed. Review the consuming manifest, build, asset, or tooling configuration against the new contract; this is not an ordinary call-site signature change.`;switch(n){case"runtime-requirement-raised":return`\`${t}\` is now compiled for Java ${e.after??"a newer release"}. Raise this project's Java toolchain to match \u2014 the compiler release and target in the build (\`maven.compiler.release\`, \`sourceCompatibility\`/\`targetCompatibility\`), the JDK used in CI, and any runtime base image \u2014 or stay on the previous version. There is no source change that avoids this.`;case"export-removed":return`Every use of \`${i}\` from \`${t}\` must be replaced. Find the supported replacement in the new version's exports and migrate each call site. Do not stub \`${i}\` out or re-implement it locally unless no replacement exists \u2014 if none exists, say so in the PR description rather than inventing one.`;case"member-removed":return`The member \`${i}\` no longer exists in \`${t}\`. Update each access to use the replacement member, or restructure the calling code if the capability was removed outright.`;case"signature-changed":switch(e.changed){case"parameters":return`The parameters of \`${i}\` changed; its return type did not. Update every call site to pass arguments matching the new list \u2014 check argument order, argument count, and whether an options object replaced positional arguments. A call that only reads the result of \`${i}\` needs no change beyond its arguments.`;case"return-type":return`The return type of \`${i}\` changed; its parameters did not, so no call site needs its arguments touched. What changed is what a caller gets back. In a statically typed language, a call site that assigns or passes the result on will fail to compile and point you straight at the fix; nothing here needs a source change beyond letting the type checker find those. In a dynamically typed one (plain JavaScript, Python, Ruby), nothing will catch this automatically \u2014 search for call sites that store, destructure, or pass along the result of \`${i}\` and check each one against the new type by hand.`;case"both":return`Both the parameters and the return type of \`${i}\` changed. Update every call site's arguments to match the new parameter list, then separately check what each call site does with the result: a statically typed caller will have a mismatched return type caught by its own compiler, a dynamically typed one will not.`;default:return`The signature of \`${i}\` changed. Update every call site to match the new signature exactly. Pay attention to argument order, argument count, and whether an options object replaced positional arguments.`}case"constant-value-changed":return`\`${i}\` changed underlying value. This does not necessarily require a source change \u2014 most code that only refers to \`${i}\` by name keeps working. Review code in this repository that depends on the concrete value: a hard-coded copy of the old number, a value persisted or sent over the wire, or a comparison against zero or another literal.`;case"kind-changed":return cNe(i,e.fromKind,e.toKind);case"entry-point-moved":return`The import path changed, not the API. ${e.detail} Update the import specifier in every file that imports from \`${t}\`, and do not replace, stub, or re-implement the individual symbols \u2014 they still exist under the new entry point. If you cannot determine which entry point carries a symbol this repository uses, leave that import alone with a \`TODO(drift):\` comment naming the symbol.`;case"package-removed":return`The package \`${i}\` no longer exists in \`${t}\`. Update the import path in every file that imports it to whichever package now provides the same API. Do not re-implement or stub the symbols it exported \u2014 if you cannot determine the replacement package, leave the import in place with a \`TODO(drift):\` comment naming it rather than guessing.`;case"member-now-required":return`\`${i}\` is now required. Supply an explicit value at every construction site. Choose the value that preserves the previous default behaviour; if the previous default is not documented, leave a TODO and flag it in the PR description rather than guessing.`;case"commonjs-entry-removed":case"exports-require-condition-removed":case"package-type-changed":{let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,c=s?.length&&a?.length?`the affected \`require()\` sites for ${[...s.map(l=>`\`${l}\``),...a.map(l=>`specifier pattern \`${l}\``)].join(", ")}`:s&&s.length===1?`\`require('${s[0]}')\``:s&&s.length>1?`the affected \`require()\` sites for ${s.map(l=>`\`${l}\``).join(", ")}`:a&&a.length===1?`\`require()\` sites whose specifier matches \`${a[0]}\``:a&&a.length>1?`the affected \`require()\` sites matching ${a.map(l=>`\`${l}\``).join(", ")}`:`each localized \`require('${t}')\` site`;return`\`${t}\` no longer exposes the CommonJS loading compatibility it exposed before. Update ${c} to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import()\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`}default:return`Review usages of \`${i}\` from \`${t}\` and update them for the new version.`}}function aNe(e){return e.startsWith("pom:")?"Maven POM contract":e.startsWith("nuget:")?"NuGet package contract":e.startsWith("pub:")?"Pub package contract":null}function cNe(e,t,n){return t==="class"&&n==="function"?`\`${e}\` is no longer a class \u2014 it is a function now. Remove \`new\` from every construction site (\`new ${e}(...)\` becomes \`${e}(...)\`); calling it without \`new\` on the old version would have thrown or behaved differently, so every call site necessarily used \`new\` and necessarily needs it removed. Anything that did \`instanceof ${e}\` on the result has no replacement to fall back on automatically \u2014 check what it was actually testing for.`:t==="function"&&n==="class"?`\`${e}\` is a class now, not a function. Add \`new\` at every call site (\`${e}(...)\` becomes \`new ${e}(...)\`); calling a class without \`new\` throws in JavaScript, so this is a hard requirement, not a style choice.`:(t==="interface"||t==="type")&&n==="class"?`\`${e}\` is a class now, not just a type. Nothing changes for code that only used it as a type annotation \u2014 but if this repository ever constructed a value shaped like it by hand (an object literal, a factory function), that code should now go through \`new ${e}(...)\` if the class provides real behaviour a plain object cannot.`:t==="class"&&(n==="interface"||n==="type")?`\`${e}\` is a plain type now, not a class. Replace every \`new ${e}(...)\` with however the package now wants this value built. Remove any \`instanceof ${e}\` check \u2014 there is no runtime class left to test against; if the value's presence still needs checking, do a structural check on its fields instead.`:t==="namespace"||n==="namespace"?`\`${e}\` moved between a namespace and a ${t==="namespace"?n:t}. Update every access through \`${e}.\` to match how its members are reached in the new form, and update any type position that named \`${e}\` directly.`:`\`${e}\` changed from a ${t??"previous form"} to a ${n??"different form"}. Update declarations, \`new\` expressions, and type positions accordingly.`}function lNe(...e){let t=e.flatMap(n=>{let[i,r]=n.split("|");return[i,r,`${i}s`]});return`(?:${[...new Set(t)].join("|")})`}var uNe=lNe("remove|removed","drop|dropped","delete|deleted"),sp=String.raw`(node(?:\.js)?|python|go|ruby|java|rust)\b`,fl=String.raw`([<>=^~]*\s*v?\d+(?:\.\d+){0,3}(?:(?:\s*,\s*|\s*\|\|\s*|\s+)\s*[<>=^~]*\s*v?\d+(?:\.\d+){0,3})*)`,l5=String.raw`(?:versions?\s*)?(?:is\s+|:\s*)?`,u5=[{id:"prose-dropped-runtime-prefix",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:(?:dropped|drops?|removed)\s+support\s+for|no\s+longer\s+supports?)\s+${sp}\s*${l5}${fl}`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${sp}\s*(?:versions?\s*)?${fl}\s+(?:is|are|was|were)\s+no\s+longer\s+supported`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-dropped-runtime-support-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bsupport\s+for\s+${sp}\s*(?:versions?\s*)?${fl}\s+(?:was|were|is|has\s+been)\s+removed`,"i"),symbolGroup:1,summarize:e=>`${e[1]} ${e[2]?.trim()} is no longer supported`},{id:"prose-min-runtime-leading",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(?:requires?|required|now\s+requires?|minimum(?:\s+supported)?)\s+${sp}\s*${l5}(?:raised\s+to\s*)?${fl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version raised to ${e[2]?.trim()}`},{id:"prose-min-runtime-passive",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b${sp}\s+v?${fl}\s+is\s+now\s+required`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-supported-version",kind:"runtime-requirement",pattern:new RegExp(String.raw`\bminimum\s+supported\s+${sp}\s+version\s+is\s+(?:now\s+)?${fl}`,"i"),symbolGroup:1,summarize:e=>`Minimum ${e[1]} version is ${e[2]?.trim()}`},{id:"prose-min-runtime-msrv",kind:"runtime-requirement",pattern:new RegExp(String.raw`\b(rust)\b\s+MSRV\s+is\s+(?:now\s+)?${fl}`,"i"),symbolGroup:1,summarize:e=>`Minimum Rust version is ${e[2]?.trim()}`}],dNe=[...u5.filter(e=>e.id.startsWith("prose-dropped-runtime")),{id:"prose-removed",kind:"removed-export",pattern:/`([\w$.]+)`(?:\(\))?\s+(?:has been|have been|was|were|is|are)\s+removed\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-removed-passive",kind:"removed-export",pattern:new RegExp(`\\b${uNe}\\s+(?:the\\s+)?\`([\\w$.]+)\``,"i"),symbolGroup:1,summarize:e=>`\`${e[1]}\` was removed`},{id:"prose-renamed",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?renamed\s+to\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was renamed to \`${e[2]}\``},{id:"prose-replaced",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has been |was |is )?replaced\s+(?:by|with)\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` was replaced by \`${e[2]}\``},{id:"prose-deprecated-in-favour",kind:"renamed-export",pattern:/`([\w$.]+)`\s+is\s+deprecated\s+in\s+favou?r\s+of\s+`([\w$.]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` is deprecated in favour of \`${e[2]}\``},{id:"prose-no-longer",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer ${e[2]?.trim()}`},{id:"prose-now-requires",kind:"signature-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+(?:requires|takes|accepts|expects)\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now requires ${e[2]?.trim()}`},{id:"prose-now-returns",kind:"type-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+now\s+returns\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` now returns ${e[2]?.trim()}`},{id:"prose-signature-of-symbol",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+of\s+`([\w$.]+)`[^.\n]{0,40}?\b(?:changed|changes|change\b|different|new\b)/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-symbol-signature-changed",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:call|constructor|method)?\s*signature\s+(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b/i,symbolGroup:1,summarize:e=>`the signature of \`${e[1]}\` changed`},{id:"prose-nth-argument-of-symbol",kind:"signature-change",pattern:/\b(?:first|second|third|fourth|fifth|sixth|last|\d+(?:st|nd|rd|th))\s+(?:positional\s+)?(?:argument|parameter|param|arg)\s+(?:for|of|to|in|passed\s+to)\s+`([\w$.]+)`/i,symbolGroup:1,summarize:e=>`an argument of \`${e[1]}\` changed`},{id:"prose-symbol-no-longer-takes",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+no\s+longer\s+(?:takes|accepts|expects|requires)\s+(.{2,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` no longer takes ${e[2]?.trim()}`},{id:"prose-signature-changed-phrase",kind:"signature-change",pattern:/\b(?:call|constructor|method|function|callback)?\s*signature\s+(?:of\b[^.\n]{0,80}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+)?(?:been\s+)?\bchanged\b|\bchanged\s+(?:the\s+)?(?:\w+\s+){0,3}signature\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-call-shape-rewrite",kind:"signature-change",pattern:/\b(?:refactor(?:ed|ing)?\s+)?([\w$.]+)\s*\((?:[^()]|\([^()]*\))*\)\s*(?:->|→|into)\s*\1\s*\(/i,symbolGroup:0,summarize:()=>"a call signature was rewritten"},{id:"prose-verb-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:changed?|changing|updated?|updating|revamp(?:ed)?|rework(?:ed)?|adjust(?:ed)?|modif(?:y|ied)|switch(?:ed)?|new|different|generic\s+single)\s+(?:the\s+)?[\w`.$()/,&\s-]{0,45}?\bsignatures?\b|\bsignatures?\s+(?:of\b[^.\n]{0,60}?)?\s*(?:has\s+|have\s+|is\s+|was\s+|were\s+|now\s+|changed|change[ds]|updated?)\b|\b(?:two|multiple|separate|distinct|overloaded)\s+signatures?\b|\binterfaces?\s+(?:has\s+|have\s+)?changed\b/i,symbolGroup:0,summarize:()=>"a function signature changed"},{id:"prose-argument-list-changed",kind:"signature-change",refinement:!0,pattern:new RegExp([String.raw`\b(?:arg(?:ument)?|param(?:eter)?)s?\s+order\b`,String.raw`\bargs?\s+now\s+(?:given|passed|taken)\b`,String.raw`\b(?:standardi[sz]e|standardi[sz]ed)\s+(?:the\s+)?arg(?:ument)?s?\b`,String.raw`\barg(?:ument)?s?\s+(?:have\s+been\s+|were\s+|are\s+|been\s+)?(?:swapped|reordered|re-ordered)\b`,"\\b`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\s+(?:(?:to|of|from|in|for)\\s+`?[\\w$.]+`?\\s+)?(?:have\\s+|has\\s+|have\\s+been\\s+|has\\s+been\\s+|is\\s+|are\\s+|was\\s+|were\\s+|been\\s+)?(?:removed|added|dropped|changed)\\b",String.raw`\breturn\s+types?\s+(?:has\s+|have\s+|now\s+)?(?:changed|change[ds])\b`,String.raw`\bupdate\s+[\w$.()]+\s+to\s+return\b`,String.raw`\btype\s+changed\s+from\b`,"\\breplaced?\\s+[\\w$.()`]{0,30}?\\s+args?\\s+w(?:ith|/)\\b","\\b(?:removed?|dropped?|added?)\\s+(?:the\\s+|a\\s+|an\\s+)?(?:deprecated\\s+|new\\s+|optional\\s+|required\\s+)?`?[\\w$.]+`?\\s+(?:arg(?:ument)?|param(?:eter)?)s?\\b",String.raw`\bno\s+longer\s+(?:accepts?|takes?|supports?|allows?|passes?)\b[^.\n]{0,45}?(?:arg(?:ument)?s?|param(?:eter)?s?|[Ss]elector|callbacks?|thisArg)\b`,String.raw`\bcall\s+pattern\s+is\s+no\s+longer\b`,String.raw`\bis\s+no\s+longer\s+(?:a\s+)?valid\s+call\b`,"\\b(?:`?thisArg`?|this\\s+argument)\\b[^.\\n]{0,40}?\\b(?:removed|no\\s+longer|default|undefined|dropped)\\b",String.raw`\b(?:requires?|required|takes?|needs?|accepts?|expects?)\s+(?:a\s+|an\s+|the\s+)?(?:new|additional|extra|second|third|fourth)\s+(?:constructor\s+)?(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\b(?:constructor|function|method)\s+(?:signature\s+)?(?:now\s+)?(?:requires?|takes?|accepts?|expects?|required)\b`,String.raw`\bis\s+no\s+longer\s+(?:the\s+)?(?:first|second|third|fourth|fifth|last|\d+(?:st|nd|rd|th))\s+(?:arg(?:ument)?|param(?:eter)?)\b`,String.raw`\bnow\s+(?:have|has)\s+(?:two|three|multiple|several)\s+(?:arg(?:ument)?|param(?:eter)?)s?\b`,String.raw`\bnow\s+(?:two|three)\s+param(?:eter)?s\b`,"\\b(?:use|using|takes?|expects?|switch(?:ed)?\\s+`?[\\w$.]+`?(?:\\s+setting)?\\s+to|switch(?:ed)?\\s+to|pass(?:ing)?|is\\s+now|are\\s+now|it\\s+is\\s+now)\\s+(?:an?\\s+|two\\s+|the\\s+)?(?:object\\s+options?|options?\\s+(?:object|hash)|config(?:uration)?\\s+(?:object|hash)|`?[\\w$.]+`?\\s+option\\b)",String.raw`\b(?:options?|config(?:uration)?)\s+(?:object|hash)\s+(?:as\b|instead\b|for\b)`,String.raw`\bparam(?:eter)?s?\s+(?:are|is)\s+no\s+longer\s+optional\b`,String.raw`\bformerly\s+a\s+config\s+object\b`].join("|"),"i"),symbolGroup:0,summarize:()=>"an argument list changed"},{id:"prose-async-signature",kind:"signature-change",refinement:!0,pattern:/\b(?:make[s]?|made|turn(?:ed)?|change)\s+[\w`#.$()"\s]{1,40}?\s+(?:(?:in)?to\s+)?(?:be\s+)?(?:an?\s+)?a?sync(?:hronous)?(?:\s+function)?\b|\b(?:is|are|be)\s+(?:now\s+|an?\s+)*a?sync(?:hronous)?(?:\s+function|\s+now)?\b|\bnow\s+a?sync(?:hronous)?\b|\ba?sync\s+now\b|\basync\b[^.\n]{0,40}?\b(?:callback|promise|await|sync)\b|\b(?:callback|promise|sync)s?\b[^.\n]{0,40}?\basync\b|\bpromises?\s+instead\s+of\s+(?:using\s+)?callbacks?\b|\bnow\s+returns?\s+(?:a\s+|an\s+)?(?:promise|observable|thenable|query)\b|\bnow\s+return\s+promises\b|\breturns?\s+[\w"']+,?\s+not\s+(?:a\s+)?(?:promise|callback|query)\b|\b(?:needs?|has|have|dosnt\s+wait|doesn'?t\s+wait)\s+to\s+be\s+awaited\b|\bmust\s+(?:now\s+)?be\s+awaited\b|\b(?:update|change|updated)\s+(?:the\s+)?return\s+types?\b|\bdrop(?:ped|s)?\s+(?:support\s+for\s+)?callbacks?\b|\bremove[d]?\s+callback\s+support\b|\bno\s+(?:longer\s+)?(?:takes?|accepts?|using)\s+(?:a\s+|the\s+)?callbacks?\b/i,symbolGroup:0,summarize:()=>"a callback/return signature changed"},{id:"prose-symbol-now-required",kind:"signature-change",pattern:/`([\w$.]+)`(?:\([^`]*\))?(?:\(\))?\s+(?:is|are|becomes?|became)\s+now\s+(?:required|mandatory|non-optional)\b/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now required`},{id:"prose-is-now",kind:"behaviour-change",pattern:/`([\w$.]+)(?:\([^`]*\))?`(?:\(\))?(?:[\w\s,`()[\]{}$.]{0,40}?)\s+(?:is|are|must)\s+now\s+(.{3,90}?)(?:[.;]|$)/i,symbolGroup:1,summarize:e=>`\`${e[1]}\` is now ${e[2]?.trim()}`},{id:"prose-moved",kind:"renamed-export",pattern:/`([\w$.]+)`\s+(?:has\s+)?moved\s+to\s+`([\w$./@-]+)`/i,symbolGroup:1,replacementGroup:2,summarize:e=>`\`${e[1]}\` moved to \`${e[2]}\``},...u5.filter(e=>e.id.startsWith("prose-min-runtime")),{id:"prose-esm-only",kind:"module-system-change",pattern:/\b(?:this|the)\s+(?:package|project|library|module)\s+(?:is\s+)?now\s+(?:pure\s+ESM|ESM[\s-]only|an?\s+ESM\s+package)\b|\b(?:migrated|converted|switched)\s+(?:this|the)\s+(?:package|project|library|module)\s+to\s+ESM\b/i,symbolGroup:0,summarize:()=>"The package is now ESM-only and no longer supports `require()`",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-dropped-commonjs",kind:"module-system-change",pattern:/\b(?:dropped|removed)\s+CommonJS\s+support\b|\b(?:dropped|removed|no longer (?:supports|provides))\s+CommonJS\b|\bCommonJS\s+(?:is\s+)?no\s+longer\s+supported\b|\brequire\(\)\s+(?:is\s+)?no\s+longer\s+supported\b/i,symbolGroup:0,summarize:()=>"CommonJS support was dropped",moduleSystem:{from:"dual",to:"esm",incompatibleUsage:["require"]}},{id:"prose-breaking-change-footer",kind:"behaviour-change",pattern:/^BREAKING[ -]CHANGES?:\s*(.{3,160}?)(?:[.;]|$)/i,symbolGroup:0,summarize:e=>`Declared as a breaking change: ${e[1]?.trim()}`},{id:"prose-breaking-change-marker",kind:"unknown",pattern:/^BREAKING[ -]CHANGES?\b\s*:?\s*(?:none|n\/a)?\s*$/i,symbolGroup:0,summarize:()=>"Declared as a breaking change (no detail given)"}];function p5(e){for(let t of e.split(` +`)){let n=t.replace(/\r$/,"").replace(/^\s*[-*>]+\s+/,"").replace(/\*{1,3}([^*\n]+?)\*{1,3}/g,"$1").replace(/\s*[-*=]{2,}\s*$/,"").trim();if(/^BREAKING[ -]CHANGES?\b[ \t]*(?::|[-–—][ \t]|$)/i.test(n)||/^#{1,6}[ \t].*\bbreaking\s+changes?\b/i.test(n))return!0}return!1}function f5(e,t={}){let n=[],i=e.replace(/^[-*+]\s+/,"").trim();if(!i)return n;for(let r of dNe){let o=r.pattern.exec(i);if(!o)continue;let s=r.symbolGroup===0?null:o[r.symbolGroup];if(r.symbolGroup!==0&&!s)continue;let a=r.kind==="runtime-requirement"?pNe(o,r.id):void 0;if(r.kind==="runtime-requirement"&&!a)continue;let c=r.replacementGroup?o[r.replacementGroup]:void 0;n.push({ruleId:r.id,kind:r.kind,summary:a?a.kind==="minimum-runtime"?a.requirement.includes("||")?`Supported ${a.runtime} versions are now ${a.requirement}`:`Minimum ${a.runtime} version is now ${a.requirement}`:`${a.runtime} ${a.requirement} is no longer supported`:r.summarize(o),symbols:s?[s]:[],...a?{runtime:a}:{},replacementSymbols:c?[c]:[],...r.moduleSystem?{moduleSystem:{...r.moduleSystem,incompatibleUsage:[...r.moduleSystem.incompatibleUsage]}}:{},...r.refinement?{refinement:!0}:{},passage:i})}return t.anchored||n.some(r=>!r.refinement)?n:n.filter(r=>!r.refinement)}function pNe(e,t){let n=e[1]?.toLowerCase().replace(/\.js$/,""),i=e[2]?.trim();if(!n||!i||!["node","python","go","ruby","java","rust"].includes(n))return null;if(i.includes("||"))return mNe(n,i,e[0].trim(),t);let r=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(i);if(!r)return null;let o=r[1]??"",s=r[2],a=i.replace(/v?(\d+(?:\.\d+){0,3})/gi,(p,f)=>n==="java"?f.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):f),c=e[0].trim(),l=JO(n,o),u=l.status,d=a.replace(/^\s*[<>=^~]*\s*/,l.operator||">=");if(t.startsWith("prose-dropped-runtime")){if(o===""){let p=s.split(".");return{kind:"unsupported-runtime-range",runtime:n,requirement:i.includes(",")||/\s+[<>=^~]/.test(i)?d:p.length<3?`${s}.x`:s,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"unsupported-runtime-range",runtime:n,requirement:d,...o==="<"?{derivedMinimum:`>=${s}`}:{},...o==="<="?{derivedMinimum:`>${s}`}:{},sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}return{kind:"minimum-runtime",runtime:n,requirement:d,sourceText:c,...u==="unknown"?{rangeParseStatus:u}:{}}}function fNe(e){let t=/^v?(\d+(?:\.\d+){0,3})$/i.exec(e.trim());if(!t)return e;let n=t[1];return n.split(".").length<3?`${n}.x`:n}function mNe(e,t,n,i){let r=t.split("||").map(c=>c.trim()).filter(Boolean);if(r.length<2)return null;let o=HO[e].supportsDisjunction?"parsed":"unknown",s=[];for(let c of r){let l=/^(?:([<>=^~]+)\s*)?v?(\d+(?:\.\d+){0,3})(?:(?:\s*,\s*|\s+)(?:[<>=^~]+\s*)?v?\d+(?:\.\d+){0,3})*$/i.exec(c);if(!l)return null;let u=l[1]??"",d=JO(e,u);d.status==="unknown"&&(o="unknown");let p=c.replace(/v?(\d+(?:\.\d+){0,3})/gi,(f,m)=>e==="java"?m.replace(/^1\.(\d+)(?=$|\.|\s|,)/,"$1"):m);s.push(u===""?fNe(p):p.replace(/^\s*[<>=^~]*\s*/,d.operator))}let a={runtime:e,requirement:s.join(" || "),sourceText:n,...o==="unknown"?{rangeParseStatus:"unknown"}:{}};return i.startsWith("prose-dropped-runtime")?{kind:"unsupported-runtime-range",...a}:{kind:"minimum-runtime",...a}}function m5(e,t){let n=e.symbols[0]??"the affected API",i=e.replacementSymbols[0];switch(e.kind){case"removed-export":return`\`${n}\` was removed from \`${t}\`. Replace every usage. Verify against the installed version's actual exports before choosing a replacement \u2014 the changelog may be incomplete.`;case"renamed-export":return i?`Replace every usage of \`${n}\` with \`${i}\`, checking that the new API's signature matches before assuming it is a drop-in rename.`:`\`${n}\` was replaced. Migrate every usage to the documented successor.`;case"signature-change":return`The way \`${n}\` is called changed: ${e.summary}. Update every call site and confirm against the installed type declarations.`;case"type-change":return`The type produced by \`${n}\` changed: ${e.summary}. Update consumers of its return value, including any local type declarations.`;case"behaviour-change":return`Behaviour changed: ${e.summary}. Review call sites for assumptions that no longer hold. Prefer making the assumption explicit over silently adapting to the new behaviour.`;case"runtime-requirement":return e.runtime?.kind==="unsupported-runtime-range"?e.runtime.derivedMinimum?`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported. That unambiguously means a floor of ${e.runtime.derivedMinimum}; update the runtime version declared in CI workflows, engine fields, and container images accordingly.`:`${e.runtime.runtime} ${e.runtime.requirement} is no longer supported, but the release note does not establish a replacement minimum. Review the project's declared runtime against authoritative upstream compatibility guidance rather than inventing one.`:`${e.summary}. Update the runtime version declared in CI workflows, engine fields, and container images. Do not change application logic for this.`;case"module-system-change":return`\`${t}\` no longer exposes a CommonJS-compatible entry point. Update each localized \`require('${t}')\` site to use an ESM-compatible loading mechanism, usually a static \`import\` in an ESM module or a dynamic \`await import('${t}')\` where the surrounding CommonJS file cannot move. Do not downgrade the dependency, and do not convert the whole repository to ESM unless that is already the intended migration path.`;case"config-change":return`Configuration must change: ${e.summary}.`;default:return`Review usages of \`${n}\` and update them: ${e.summary}`}}var gNe=["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"],hNe=["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"],yNe=["symbol","type","module","package","dependency-cohort","runtime","ecosystem"],bNe=["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"];var vNe={"export-removed":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["direct"]},"member-removed":{nature:"api-shape",detectability:["compile-time"],scope:"symbol",visibility:["direct"]},"signature-changed":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["direct"]},"kind-changed":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"member-now-required":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["direct"]},"entry-point-moved":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"package-removed":{nature:"packaging",detectability:["manifest","link-or-import"],scope:"package",visibility:["direct"]},"commonjs-entry-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"exports-require-condition-removed":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"package-type-changed":{nature:"packaging",detectability:["manifest","link-or-import","compile-time"],scope:"package",visibility:["direct"]},"constant-value-changed":{nature:"behaviour",detectability:["static-semantic","runtime-only"],scope:"symbol",visibility:["direct"]},...wNe()};function wNe(){let e={};for(let t of nl)for(let[n,i]of Object.entries(t.codes))e[n]=i.taxonomy;return e}var kNe={"removed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"renamed-export":{nature:"api-shape",detectability:["link-or-import","compile-time"],scope:"symbol",visibility:["unknown"]},"moved-export":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"module",visibility:["unknown"]},"signature-change":{nature:"type-contract",detectability:["compile-time","static-semantic"],scope:"symbol",visibility:["unknown"]},"type-change":{nature:"type-contract",detectability:["compile-time"],scope:"type",visibility:["unknown"]},"behaviour-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"default-change":{nature:"behaviour",detectability:["test-time","runtime-only"],scope:"symbol",visibility:["unknown"]},"removed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"module",visibility:["unknown"]},"changed-endpoint":{nature:"protocol",detectability:["runtime-only","external-observation"],scope:"symbol",visibility:["unknown"]},"required-field-added":{nature:"data-schema",detectability:["compile-time","runtime-only"],scope:"type",visibility:["unknown"]},"config-change":{nature:"configuration",detectability:["static-semantic","runtime-only"],scope:"module",visibility:["unknown"]},"module-system-change":{nature:"packaging",detectability:["link-or-import","compile-time"],scope:"package",visibility:["direct"]},"runtime-requirement":{nature:"runtime-environment",detectability:["manifest","runtime-only"],scope:"runtime",visibility:["direct"]},unknown:{nature:"behaviour",detectability:["runtime-only"],scope:"module",visibility:["unknown"]}};function ap(e,t){let n=t?vNe[t]:void 0;if(n)return{...g5(n),origin:"computed"};let i=kNe[e];return{...g5(i),origin:e==="unknown"?"default":"rule"}}function g5(e){return{nature:e.nature,detectability:[...e.detectability],scope:e.scope,visibility:[...e.visibility]}}function Dr(e){return e.taxonomy??ap(e.kind)}function b5(e,t){if(!e||typeof e!="object")return t;let n=e,i=h5(n.nature,gNe),r=h5(n.scope,yNe),o=y5(n.detectability,hNe),s=y5(n.visibility,bNe);return!i||!r?t:{nature:i,scope:r,detectability:o.length>0?o:[...t.detectability],visibility:s.length>0?s:["unknown"],origin:"llm-normalized"}}function h5(e,t){return typeof e=="string"&&t.includes(e)?e:null}function y5(e,t){if(!Array.isArray(e))return[];let n=new Set;for(let i of e)typeof i=="string"&&t.includes(i)&&n.add(i);return t.filter(i=>n.has(i))}function y$(e){let t=["manifest","link-or-import","compile-time","static-semantic"];return!e.detectability.some(n=>t.includes(n))}var GOe={type:"object",properties:{changes:{type:"array",items:{type:"object",properties:{summary:{type:"string",description:"One sentence stating what changed upstream and why it breaks consumers."},remediation:{type:"string",description:"Imperative instructions for fixing affected call sites."},symbols:{type:"array",items:{type:"string"},description:"Exact identifiers to search for in consumer code: export names, method names, option keys, endpoint paths. Empty if the evidence names none."},kind:{type:"string",enum:["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement","unknown"]},evidenceId:{type:"string",description:"The id of the evidence excerpt this was extracted from."},taxonomy:{type:"object",properties:{nature:{type:"string",enum:["api-shape","type-contract","behaviour","data-schema","configuration","runtime-environment","protocol","packaging"]},detectability:{type:"array",items:{type:"string",enum:["manifest","link-or-import","compile-time","static-semantic","test-time","runtime-only","external-observation"]},description:"What would have to run to notice this. Be honest: a change that only shows up at runtime must not be listed as compile-time."},scope:{type:"string",enum:["symbol","type","module","package","dependency-cohort","runtime","ecosystem"]},visibility:{type:"array",items:{type:"string",enum:["direct","transitive","wrapper-mediated","re-exported","reflection-or-dynamic","generated","unknown"]},description:"Use `unknown` when the evidence does not say. Do not guess `direct`."}},required:["nature","detectability","scope","visibility"],additionalProperties:!1}},required:["summary","remediation","symbols","kind","evidenceId"],additionalProperties:!1}}},required:["changes"],additionalProperties:!1},VOe=`You extract breaking changes from dependency release notes for an automated refactoring tool. Rules you must follow: @@ -1416,70 +1416,70 @@ Rules you must follow: 3. \`symbols\` must be identifiers that would literally appear in consumer source code. Never put prose, descriptions, or package names there. If the evidence describes a change without naming an identifier, return an empty \`symbols\` array rather than inventing one. 4. \`evidenceId\` must be copied exactly from the evidence block the finding came from. 5. Do not restate a change that is already listed under "Already found" \u2014 those are handled. -6. Write \`remediation\` as instructions to an engineer, describing what to change. Do not speculate about replacements the evidence does not mention; say the replacement is unknown instead.`;async function h7(e,t,n,i){let{config:r,logger:o}=i,s=i.client??await RF(r,o);if(!s)return[];let a=t.filter(l=>!l.findings?.length&&l.source!=="semver-heuristic"&&l.source!=="registry-metadata");if(a.length===0)return[];let c=[];for(let l of e){let u=a.filter(d=>d.dependency===l.name&&d.workspace===l.workspace);if(u.length!==0)try{let d=await FOe(s,r,l,u,n,o);c.push(...UOe(d,l.name,l.workspace,u))}catch(d){o.warn(`LLM extraction failed for ${l.name}: ${d.message}`)}}return c}async function RF(e,t){let n=process.env[e.llm.apiKeyEnv];return n?LOe(n,t):(t.warn(`llm.enabled is true but ${e.llm.apiKeyEnv} is not set; skipping LLM extraction. The rule-based analyser still ran.`),null)}async function LOe(e,t){try{let n=await Promise.resolve().then(()=>(VM(),m7));return new n.default({apiKey:e})}catch{return t.warn("llm.enabled is true but @anthropic-ai/sdk is not installed. Run `npm install @anthropic-ai/sdk` or set llm.enabled: false."),null}}async function FOe(e,t,n,i,r,o){let s=r.filter(p=>p.dependency===n.name&&p.workspace===n.workspace).map(p=>`- ${p.summary}`).join(` -`),a=i.map(p=>` -${GOe(p.content,6e3)} +6. Write \`remediation\` as instructions to an engineer, describing what to change. Do not speculate about replacements the evidence does not mention; say the replacement is unknown instead.`;async function _7(e,t,n,i){let{config:r,logger:o}=i,s=i.client??await FF(r,o);if(!s)return[];let a=t.filter(l=>!l.findings?.length&&l.source!=="semver-heuristic"&&l.source!=="registry-metadata");if(a.length===0)return[];let c=[];for(let l of e){let u=a.filter(d=>d.dependency===l.name&&d.workspace===l.workspace);if(u.length!==0)try{let d=await qOe(s,r,l,u,n,o);c.push(...WOe(d,l.name,l.workspace,u))}catch(d){o.warn(`LLM extraction failed for ${l.name}: ${d.message}`)}}return c}async function FF(e,t){let n=process.env[e.llm.apiKeyEnv];return n?BOe(n,t):(t.warn(`llm.enabled is true but ${e.llm.apiKeyEnv} is not set; skipping LLM extraction. The rule-based analyser still ran.`),null)}async function BOe(e,t){try{let n=await Promise.resolve().then(()=>(YM(),w7));return new n.default({apiKey:e})}catch{return t.warn("llm.enabled is true but @anthropic-ai/sdk is not installed. Run `npm install @anthropic-ai/sdk` or set llm.enabled: false."),null}}async function qOe(e,t,n,i,r,o){let s=r.filter(p=>p.dependency===n.name&&p.workspace===n.workspace).map(p=>`- ${p.summary}`).join(` +`),a=i.map(p=>` +${JOe(p.content,6e3)} `).join(` `),c=[`Dependency: ${n.name} (${n.ecosystem})`,`Version change: ${n.from} \u2192 ${n.to} (${n.bump})`,"",s?`Already found by deterministic rules \u2014 do not repeat these: ${s} `:"","Evidence:",a].filter(Boolean).join(` -`),l=await e.messages.create({model:t.llm.model,max_tokens:16e3,system:MOe,thinking:{type:"adaptive"},output_config:{effort:t.llm.effort,format:{type:"json_schema",schema:OOe}},messages:[{role:"user",content:c}]});if(l.stop_reason==="refusal")return o.warn(`The model declined to analyse the prose for ${n.name}, so nothing was extracted from it. The rule-based analyser still ran.`),[];let u=l.content.find(p=>p.type==="text")?.text;if(!u)return o.warn(`The model returned no text for ${n.name}${l.stop_reason?` (stop reason: ${l.stop_reason})`:""}, so nothing was extracted from its prose.`),[];let d;try{d=JSON.parse(u)}catch(p){return o.warn(`The model's answer for ${n.name} was not readable as JSON (${p.message}), so nothing was extracted from its prose.`),[]}return Array.isArray(d.changes)?d.changes:(o.warn(`The model's answer for ${n.name} carried no \`changes\` array, so nothing was extracted from its prose.`),[])}function UOe(e,t,n,i){let r=new Set(i.map(o=>o.id));return e.filter(o=>r.has(o.evidenceId)).filter(o=>o.summary?.trim()).map(o=>({id:St("bc",t,n,"llm",o.summary),dependency:t,workspace:n,kind:g7(o.kind),summary:o.summary.trim(),remediation:o.remediation?.trim()||`Review usages of ${t} and update them.`,symbols:(o.symbols??[]).filter(jOe),confidence:"medium",taxonomy:p5(o.taxonomy,sp(g7(o.kind))),citations:[o.evidenceId]}))}function jOe(e){let t=e.trim();return!t||t.length>80||/\s/.test(t)&&!t.startsWith("/")?!1:/^[/@]?[\w$][\w$./{}-]*$/.test(t)}var zOe=new Set(["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement"]);function g7(e){return zOe.has(e)?e:"unknown"}function GOe(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function VOe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var k7=require("node:crypto");var BOe=[{band:"high",min:.8},{band:"medium",min:.5},{band:"low",min:.2},{band:"none",min:0}];function NF(e){for(let t of BOe)if(e>=t.min)return t.band;return"none"}var y7={high:"Very confident",medium:"Fairly confident",low:"Not very confident",none:"Not enough evidence to say"};var Ql="drift-confidence-1",qOe={"type-surface-diff":"computed-artifact",...d8,changelog:"maintainer-narrative","github-release":"maintainer-narrative","migration-guide":"maintainer-guide","behavioural-diff":"dynamic-observation","registry-metadata":"registry","semver-heuristic":"heuristic"},WOe={"computed-artifact":.9,"maintainer-guide":.7,"maintainer-narrative":.6,"dynamic-observation":.5,registry:.4,heuristic:.2},b7=new WeakMap;function PF(e){let{change:t,evidence:n}=e,i=n.filter(d=>t.citations.includes(d.id)),r=[],o=[];if(i.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"no-citations",detail:"No evidence record backs this finding.",delta:0}],calibration:Ql};let s=HOe(i),a=0,c="";for(let d of s.keys()){let p=WOe[d]??.3;p>a&&(a=p,c=d)}r.push({code:`origin:${c}`,detail:`Strongest evidence class is ${CF(c)}.`,delta:a});let l=a,u=s.size-1;if(u>0){let d=Math.min(.15,.08*u);l+=d,r.push({code:"corroborated",detail:`Corroborated by ${u} other independent source class(es): ${[...s.keys()].filter(p=>p!==c).map(CF).join(", ")}.`,delta:d})}else i.length>1&&o.push({code:"single-origin",detail:`All ${i.length} citations trace to one source class (${CF(c)}), so they do not corroborate each other.`,delta:0});return s.size===1&&c==="heuristic"&&(l+=-.1,o.push({code:"heuristic-only",detail:"Only a semver heuristic supports this; no changelog, release note, or API diff was retrieved.",delta:-.1})),OF(l,r,o)}function HOe(e){let t=new Map,n=new Set;for(let i of e){let r=b7.get(i);if(r===void 0&&(r=(0,k7.createHash)("sha256").update(i.content.replace(/\s+/g," ").trim().toLowerCase()).digest("hex"),b7.set(i,r)),n.has(r))continue;n.add(r);let o=qOe[i.source]??"unknown",s=t.get(o);s?s.push(i):t.set(o,[i])}return t}function CF(e){switch(e){case"computed-artifact":return"a computed diff of the shipped artifact";case"maintainer-guide":return"a migration guide";case"maintainer-narrative":return"release notes or a changelog";case"registry":return"registry metadata";case"heuristic":return"a semver heuristic";default:return e}}function KOe(e){let{taxonomy:t,sites:n,localizationRan:i}=e,r=[],o=[];if(!i)return{score:0,band:"none",evidence:[],penalties:[{code:"localization-unavailable",detail:"No checkout was available, so Drift could not search this repository. This is not evidence that the change is unused.",delta:0}],calibration:Ql};if(t.scope==="runtime"&&e.runtimeState==="compatible")return{score:.85,band:"high",evidence:[{code:"runtime-compatible",detail:"The repository runtime declaration satisfies the requirement.",delta:.85}],penalties:[],calibration:Ql};if(n.length===0){let d=u_(t),p=e.localizationComplete===!1,f=t.scope==="runtime";return{score:0,band:"none",evidence:[],penalties:[{code:f?"runtime-compatibility-unresolved":p?"localization-incomplete":d?"not-locally-checkable":"no-usage-found",detail:f?"This is a requirement on the runtime this repository builds and deploys on, not on any code it calls. No source search can answer it; the repository's own declared runtime version is what decides.":p?"Drift searched the indexed source subset, but the file limit prevented an exhaustive absence claim.":d?"This change is only observable at runtime, so a source search cannot establish whether this repository is affected.":"Drift searched the files that import this dependency and found no usage of the affected symbols.",delta:0}],calibration:Ql}}let s=n.reduce((d,p)=>w7(p.confidence)>w7(d.confidence)?p:d),a=s.confidence==="high"?.85:s.confidence==="medium"?.6:.3;r.push({code:`site:${s.confidence}`,detail:s.confidence==="high"?`\`${s.matchedSymbol}\` is bound from an import of this dependency in ${s.file}.`:s.confidence==="medium"?`${s.file} imports this dependency and uses \`${s.matchedSymbol}\`, but the symbol was not traced to the import.`:`\`${s.matchedSymbol}\` appears in ${s.file}, but no import of this dependency was established \u2014 the match may be coincidental.`,delta:a});let c=a;if(n.length>1){let d=Math.min(.05,.01*(n.length-1));c+=d,r.push({code:"multiple-sites",detail:`${n.length} affected locations across ${new Set(n.map(p=>p.file)).size} file(s).`,delta:d})}let l=n.filter(d=>JOe(d.file));return l.length===n.length?(c+=-.25,o.push({code:"generated-only",detail:`Every affected location is in generated code (${l[0].file}). Editing it is usually wrong; the generator is the real site.`,delta:-.25})):l.length>0&&(c+=-.05,o.push({code:"some-generated",detail:`${l.length} affected location(s) are in generated code.`,delta:-.05})),t.visibility.includes("reflection-or-dynamic")&&(c+=-.2,o.push({code:"dynamic-access",detail:"Dynamic or reflective access was detected, so the affected set cannot be enumerated by search.",delta:-.2})),t.visibility.includes("wrapper-mediated")&&(c+=-.1,o.push({code:"wrapper-mediated",detail:"Usage is mediated by a local wrapper, so downstream callers of the wrapper are not enumerated here.",delta:-.1})),n.every(d=>d.confidence==="low")&&(c+=-.1,o.push({code:"textual-only",detail:"Every match is textual \u2014 no import edge was established for any of them.",delta:-.1})),OF(c,r,o)}function JOe(e){let t=e.toLowerCase();return/(^|\/)(generated|__generated__|gen|dist|build|out|vendor|node_modules)\//.test(t)||/\.(g|generated)\.[a-z]+$/.test(t)||/\.pb\.(go|ts|js|py)$/.test(t)||/_pb2?\.py$/.test(t)||/\.d\.ts$/.test(t)}function ZOe(e){let{outcomes:t,affectedFiles:n,taxonomy:i}=e;if(t.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"nothing-ran",detail:"No checks were run against this finding, so nothing confirms the change was understood correctly.",delta:0}],calibration:Ql};let r=[],o=[],s=t.filter(p=>p.status==="passed"),a=t.filter(p=>p.status==="failed"),c=t.filter(p=>p.status==="skipped"||p.status==="unavailable"||p.status==="timed-out");if(a.length>0)return{score:0,band:"none",evidence:[],penalties:[{code:"checks-failed",detail:`${a.length} check(s) failed: ${a.map(p=>p.name).join(", ")}.`,delta:0}],calibration:Ql};let l=0,u=i.detectability.some(p=>p==="compile-time"||p==="link-or-import"||p==="manifest");for(let p of s){let f=/type|compile|build|lint/i.test(p.name),g=/test|spec/i.test(p.name)?.45:f?u?.4:.15:.1;l+=g,r.push({code:`passed:${p.name}`,detail:f&&!u?`\`${p.name}\` passed, but this change is not detectable at compile time \u2014 it does not confirm the behaviour is right.`:`\`${p.name}\` passed.`,delta:g})}for(let p of c)o.push({code:`did-not-run:${p.name}`,detail:`\`${p.name}\` was ${p.status} and proves nothing.`,delta:0});let d=new Set(s.flatMap(p=>p.covers??[]));return d.size>0&&n.length>0?n.filter(f=>d.has(f)).length===0&&(l+=-.2,o.push({code:"no-coverage",detail:"The checks that passed do not cover any of the affected files.",delta:-.2})):n.length>0&&o.push({code:"coverage-unknown",detail:"Which code paths the passing checks cover could not be established.",delta:0}),OF(l,r,o)}function $7(e){let t=PF({change:e.change,evidence:e.evidence}),n=KOe({change:e.change,taxonomy:e.taxonomy,sites:e.sites,localizationRan:e.localizationRan,localizationComplete:e.localizationComplete,runtimeState:e.runtimeState}),i=ZOe({outcomes:e.outcomes??[],affectedFiles:[...new Set(e.sites.map(a=>a.file))],taxonomy:e.taxonomy}),r=[...e.gaps??[]],o=[];t.band==="high"&&n.band==="none"&&o.push({code:"upstream-only",detail:"The upstream change is well established, but nothing in this repository was shown to be affected. High upstream confidence is not a reason to edit code.",delta:0});let s=t.band==="high"&&(n.band==="high"||n.band==="medium")&&!r.some(a=>a.automaticExecution==="blocks");return{upstream:t,localImpact:n,verification:i,automaticExecutionEligible:s,reasons:o,checkedSurfaces:[...e.checkedSurfaces??[]],gaps:r}}function DF(e){let{upstream:t,localImpact:n,verification:i}=e,r=n.band==="none"?Math.min(t.score,.55):Math.min(t.score,n.score),o=i.score>0?Math.min(.1,i.score*.15):0,s=Math.round(Math.max(0,Math.min(1,r+o))*100),a=NF(s/100);return{score:s,band:a,label:y7[a]}}function _7(e){let t=e.upstream.band,n=e.localImpact.band;return n==="none"?t==="high"?"medium":v7(t):v7(YOe(t,n))}function v7(e){return e==="high"?"high":e==="medium"?"medium":"low"}function YOe(e,t){let n=["none","low","medium","high"];return n.indexOf(e)<=n.indexOf(t)?e:t}function w7(e){return e==="high"?2:e==="medium"?1:0}function OF(e,t,n){let i=Math.round(Math.max(0,Math.min(1,e))*100)/100;return{score:i,band:NF(i),evidence:t,penalties:n,calibration:Ql}}async function BS(e,t,n){let{config:i,logger:r}=n,o=QOe(t),s=[];for(let a of e){let c=o.get(zc(a))??[];s.push(...XOe(a.name,a.workspace,c))}for(let a of t)a8(a.source)&&s.push(...E7(a));if(i.llm.enabled){let a=await h7(e,t,s,{config:i,logger:r});s.push(...a)}return iMe(sMe(s),t)}function QOe(e){let t=new Map;for(let n of e){let i=zc({name:n.dependency,workspace:n.workspace}),r=t.get(i);r?r.push(n):t.set(i,[n])}return t}function XOe(e,t,n){let i=[];for(let r of n){if(r.findings?.length){i.push(...E7(r));continue}if(r.source!=="semver-heuristic"){if(r.source==="registry-metadata"){i.push(...x7(r,e,t).filter(o=>o.kind==="runtime-requirement"));continue}i.push(...x7(r,e,t))}}return i}function eMe(e,t){return e.replace(/`default\.([\w$]+)`/g,`\`${t}.$1\``).replace(/`default` is no longer exported/g,`\`${t}\` no longer has a default export`).replace(/`default`/g,`the default export of \`${t}\``)}function E7(e){return(e.findings??[]).map(t=>{let n=l_(t.code),i=n==="module-system-change"?t.moduleSystem??{from:"dual",to:"esm",incompatibleUsage:["require"]}:void 0;return{id:St("bc",e.dependency,e.workspace,t.code,t.symbol,i?.affectedSpecifiers?.join(",")??"",i?.affectedSpecifierPatterns?.join(",")??""),dependency:e.dependency,workspace:e.workspace,kind:n==="removed-export"&&t.replacement?"renamed-export":n,summary:eMe(t.detail,e.dependency),...t.replacement?{replacementSymbols:[t.replacement]}:{},...n==="runtime-requirement"&&t.after?{runtime:{kind:"minimum-runtime",runtime:"java",requirement:`>=${t.after}`,sourceText:t.detail}}:{},before:t.before,after:t.after,...t.fromKind?{fromKind:t.fromKind}:{},...t.toKind?{toKind:t.toKind}:{},remediation:o5(t,e.dependency),symbols:tMe(t),...i?{moduleSystem:{...i,incompatibleUsage:[...i.incompatibleUsage],...i.affectedSpecifiers?{affectedSpecifiers:[...i.affectedSpecifiers]}:{},...i.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.affectedSpecifierPatterns]}:{}}}:{},confidence:"high",taxonomy:sp(n,t.code),citations:[e.id]}})}function tMe(e){if(l_(e.code)==="module-system-change")return[];let t=new Set([e.symbol]);if(e.symbol.includes(".")&&!/\s/.test(e.symbol)){let i=e.symbol.split("."),r=i[i.length-1];if(r&&!S7(r)&&t.add(r),i.length>2){let o=i[i.length-2];o&&t.add(`${o}.${r}`)}if(i.length>=2&&l_(e.code)==="required-field-added"){let o=i[i.length-2];o&&!S7(o)&&t.add(o)}}let n=/^[A-Z]+\s+(\/\S*)$/.exec(e.symbol);if(n?.[1]){t.add(n[1]);let i=n[1].split("{")[0]?.replace(/\/$/,"");i&&i.length>1&&t.add(i)}return[...t]}function S7(e){return/^__\w+__$/.test(e)?!0:nMe.has(e.toLowerCase())}var nMe=new Set(["add","all","any","append","apply","build","call","check","clear","clone","close","connect","copy","count","create","define","delete","each","emit","end","execute","exists","extend","fetch","filter","find","first","flush","format","get","handle","has","index","init","insert","is","items","iter","join","keys","last","length","list","load","log","main","map","match","new","next","open","parse","pop","push","put","query","read","remove","render","reset","resolve","run","save","send","set","size","sort","split","start","stop","update","wait","write","args","body","config","content","context","data","error","file","header","headers","host","id","key","name","options","params","path","port","result","root","status","text","type","url","value","values","and","or","not","if","elif","else","for","while","do","in","of","as","with","from","to","try","catch","finally","throw","raise","except","switch","case","break","continue","return","yield","class","def","function","lambda","const","let","var","this","self","super","null","nil","none","true","false","async","await","typeof","instanceof","void","enum","interface","extends","implements","export","import","static","public","private","protected","default","pass","then"]);function x7(e,t,n){let i=[],r=new Set,o=s5(e.content);for(let s of e.content.split(` -`))for(let a of a5(s,{anchored:o})){let c=`${a.kind}:${a.symbols.join(",")}`;if(r.has(c))continue;r.add(c);let l=a.symbols.length>0||a.kind==="module-system-change"?a.symbols:[t];i.push({id:St("bc",t,n,a.ruleId,a.symbols.join(",")),dependency:t,workspace:n,kind:a.kind,summary:a.summary,remediation:c5(a,t),symbols:l,...a.runtime?{runtime:a.runtime}:{},replacementSymbols:a.replacementSymbols.length?a.replacementSymbols:void 0,...a.moduleSystem?{moduleSystem:a.moduleSystem}:{},confidence:rMe(e),taxonomy:sp(a.kind),citations:[e.id]})}return i}function rMe(e){return e.weight>=.95?"high":e.weight>=.6?"medium":"low"}function iMe(e,t){return e.map(n=>{let i=PF({change:n,evidence:t});return{...n,confidence:oMe(i.band)}})}function oMe(e){return e==="high"?"high":e==="medium"?"medium":"low"}function sMe(e){let t=new Map;for(let i of e){let r=aMe(i),o=t.get(r);if(!o){t.set(r,{...i,citations:[...new Set(i.citations)]});continue}t.set(r,{...o,summary:o.summary.length>=i.summary.length?o.summary:i.summary,symbols:[...new Set([...o.symbols,...i.symbols])],replacementSymbols:[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])].filter(Boolean).length?[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])]:void 0,moduleSystem:cMe(o.moduleSystem,i.moduleSystem),confidence:uMe(o.confidence,i.confidence),taxonomy:lMe(Or(o),Or(i)),citations:[...new Set([...o.citations,...i.citations])]})}let n={high:0,medium:1,low:2};return[...t.values()].sort((i,r)=>n[i.confidence]-n[r.confidence]||i.dependency.localeCompare(r.dependency))}function aMe(e){let t=zc({name:e.dependency,workspace:e.workspace});return e.kind==="module-system-change"?[t,e.kind,[...e.moduleSystem?.incompatibleUsage??[]].sort().join(","),e.moduleSystem?.affectedSpecifiers?.length?[...e.moduleSystem.affectedSpecifiers].sort().join(","):"*",e.moduleSystem?.affectedSpecifierPatterns?.length?[...e.moduleSystem.affectedSpecifierPatterns].sort().join(","):"*"].join("|"):`${t}|${e.kind}|${[...e.symbols].sort().join(",")}`}function cMe(e,t){if(!e)return t;if(!t)return e;let n=[...new Set([...e.incompatibleUsage,...t.incompatibleUsage])],i=e.affectedSpecifiers||t.affectedSpecifiers?[...new Set([...e.affectedSpecifiers??[],...t.affectedSpecifiers??[]])]:void 0,r=e.affectedSpecifierPatterns||t.affectedSpecifierPatterns?[...new Set([...e.affectedSpecifierPatterns??[],...t.affectedSpecifierPatterns??[]])]:void 0;return{from:e.from??t.from,to:e.to??t.to,incompatibleUsage:n,...i?{affectedSpecifiers:i}:{},...r?{affectedSpecifierPatterns:r}:{}}}function lMe(e,t){let n={computed:3,rule:2,"llm-normalized":1,default:0};return n[e.origin]>=n[t.origin]?e:t}function uMe(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]?e:t}function MF(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]}function qS(e){return e.keys??[e.packageName]}function _f(e){let t=[],n=new Map,i=new Set(e.map(s=>s.path));for(let s of e){let a=dMe(s),c=VMe(s);t.push({path:s.path,language:s.language,lineCount:s.lineCount,imports:a,localImports:pMe(s),units:c,summary:JMe(s,c,a)});for(let l of new Set(a.flatMap(qS))){let u=n.get(l);u?u.push(s.path):n.set(l,[s.path])}}let r=new Map,o=hMe(i);for(let s of t)for(let a of s.localImports){let c=yMe(s.path,a.specifier,i,o);if(!c||c===s.path)continue;let l=r.get(c),u={from:s.path,bindings:a.bindings,reExport:a.reExport,line:a.line};l?l.push(u):r.set(c,[u])}return{files:t,importers:n,localImporters:r,stats:{fileCount:t.length,unitCount:t.reduce((s,a)=>s+a.units.length,0),totalLines:t.reduce((s,a)=>s+a.lineCount,0)}}}function FF(e,t){let n;for(let i of e.units)ti.endLine||(!n||i.endLine-i.startLine]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&t.push({specifier:o,line:i+1,bindings:[],reExport:!0})}return t}function hMe(e){let t=new Map,n=(i,r)=>{let o=t.get(i);o?o.push(r):t.set(i,[r])};for(let i of e){let r=i.split("/").pop()??i;n(r.toLowerCase(),i)}return t}var T7=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".py"];function yMe(e,t,n,i){if(t.startsWith(".")){let s=e.split("/").slice(0,-1),a=bMe([...s,...t.split("/")]);if(a===void 0)return;let l=/^\.+$/.test(t)||!t.includes("/")&&t.startsWith(".")?[`${I7(e,t)}.py`,`${I7(e,t)}/__init__.py`]:[a,...T7.map(u=>a+u),...T7.map(u=>`${a}/index${u}`),`${a}/__init__.py`];for(let u of l)if(u&&n.has(u))return u;return}let r=(t.split("/").pop()??t).toLowerCase(),o=(i.get(r)??[]).filter(s=>s.toLowerCase().endsWith(t.toLowerCase()));return o.length===1?o[0]:void 0}function bMe(e){let t=[];for(let n of e)if(!(n===""||n===".")){if(n===".."){if(t.length===0)return;t.pop();continue}t.push(n)}return t.join("/")}function I7(e,t){let n=/^\.+/.exec(t)?.[0].length??1,i=t.slice(n).split(".").filter(Boolean);return[...e.split("/").slice(0,-n),...i].join("/")}function vMe(e){let t=[],n=e.split(` -`);for(let i=0;i]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&(o.startsWith(".")||t.push({specifier:o,packageName:wMe(o),bindings:[],line:i+1,reExport:!0}))}return t}function wMe(e){return(e.split("/")[0]??e).replace(/\.(h|hpp|hh|hxx|inl|tpp|h\+\+)$/i,"").toLowerCase()}function kMe(e){let t=gO(e),n=[],i=P7(t),r=d=>D7(i,d),o=/\bimport\s+(?!\()(?:(?:type\s+)?([\w$]+)\s*,\s*)?(?:type\s+)?(?:\{([^}]+)\}|\*\s+as\s+([\w$]+)|([\w$]+))\s+from\s+['"]([^'"]+)['"]|\bimport\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(o)){let p=d[5]??d[6];if(!p||wf(p))continue;let f=LF(d[1],d[2],d[3],d[4]),m=d[1]??d[4];n.push({specifier:p,packageName:kf(p),bindings:f,...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"esm-static"})}let s=/\b(?:const|let|var)\s+(\{[^}]+\}|[\w$]+)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(s)){let p=d[2];if(wf(p))continue;let f=d[1],m=f.startsWith("{")?void 0:f;n.push({specifier:p,packageName:kf(p),bindings:$Me(f),...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"commonjs-require"})}let a=/\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(a)){let p=d[1];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:[],line:r(d.index??0),loadStyle:"esm-dynamic"})}let c=/\bexport\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(c)){let p=d[2];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:LF(void 0,d[1],void 0,void 0),line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let l=/\bexport\s+\*\s+as\s+([\w$]+)\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(l)){let p=d[2];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:["*",d[1]],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let u=/\bexport\s+\*\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(u)){let p=d[1];wf(p)||n.push({specifier:p,packageName:kf(p),bindings:["*"],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}return n.sort((d,p)=>d.line-p.line||d.specifier.localeCompare(p.specifier))}function LF(e,t,n,i){let r=[];if(e&&r.push(e),i&&r.push(i),n&&r.push("*",n),t)for(let o of t.split(",")){let s=o.replace(/\btype\s+/g,"").trim();if(!s)continue;let[a,c]=s.split(/\s+as\s+/).map(l=>l.trim());a&&r.push(c||a,a)}return[...new Set(r)]}function $Me(e){let t=e.trim();return t.startsWith("{")?t.replace(/[{}]/g,"").split(",").flatMap(n=>{let[i,r]=n.split(":").map(o=>o.trim());return[i,r].filter(o=>!!o)}):[t]}function _Me(e,t){let n=[],i=e.split(` -`),r=t.endsWith("/__init__.py")||t==="__init__.py";for(let o=0;o{let n=/^\s*(\w+)(?:\s+as\s+(\w+))?/.exec(t);return n?[n[1],n[2]].filter(Boolean):[]}).flat()}function SMe(e){let t=[],n=e.split(` -`),i=!1;for(let r=0;r{let r=i.trim();if(!r)return;let o=r.indexOf("{");if(o!==-1){let c=r.lastIndexOf("}"),l=r.slice(o+1,c===-1?void 0:c);for(let u of TMe(l))n(u);return}let s=/\bas\s+([\w*]+)\s*$/.exec(r);if(s?.[1]){t.push(s[1]);return}let a=r.split("::").pop()?.trim();if(a&&(t.push(a==="*"?"*":a),a==="self")){let c=r.split("::").slice(-2,-1)[0]?.trim();c&&t.push(c)}};return n(e),[...new Set(t.filter(i=>i!=="self"))]}function TMe(e){let t=[],n=0,i="";for(let r of e){if(r==="{"?n+=1:r==="}"&&(n-=1),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t}function IMe(e){let t=[],n=e.split(` -`);for(let i=0;io.slice(0,a+1).join("\\")).reverse()}}function DMe(e){let t=[],n=new Set,i=e.split(` -`),r=(s,a,c,l=!1)=>{let u=s.split(".")[0];if(!/^[A-Z]/.test(u)||OMe.has(u)||n.has(s))return;n.add(s);let d=s.split(".");t.push({specifier:s,packageName:u,bindings:[...new Set([a,s])],line:c,keys:d.map((p,f)=>d.slice(0,f+1).join(".")).reverse(),...l?{synthetic:!0}:{}})},o=!1;for(let s=0;s{zMe.has(l)||n.has(l)||(n.add(l),t.push({specifier:l,packageName:l,bindings:[l],line:r+1,...u?{synthetic:!0}:{}}))},a=/^\s*open\s+([A-Z][\w']*)/.exec(o);if(a?.[1]){s(a[1]);continue}let c=/^\s*module\s+[A-Z][\w']*\s*=\s*([A-Z][\w']*)/.exec(o);if(c?.[1]){s(c[1]);continue}for(let l of o.matchAll(/\b([A-Z][\w']*)\.[a-z_]/g))s(l[1],!0)}return t}var zMe=new Set(["Stdlib","List","Array","String","Bytes","Char","Int","Int32","Int64","Float","Bool","Option","Result","Hashtbl","Map","Set","Buffer","Printf","Format","Sys","Unix","Filename","Sort","Queue","Stack","Lazy","Seq","Fun","Either","Printexc","Random","Digest","Obj"]);function GMe(e){let t=e.trim();if(!t)return["*"];let n=[],i=/\bshow\s+([\w\s,]+)/.exec(t);i?.[1]&&n.push(...i[1].split(",").map(o=>o.trim()).filter(Boolean));let r=/\bas\s+(\w+)/.exec(t);return r?.[1]&&n.push(r[1]),n.length===0&&n.push("*"),[...new Set(n)]}function wf(e){return e.startsWith(".")||e.startsWith("/")||e.startsWith("#")}function kf(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function VMe(e){return e.language==="typescript"||e.language==="javascript"?BMe(e.content,e.path):HMe(e.content,e.language)}function BMe(e,t){let n=[],i=e.split(` -`),r=WMe(i),o=(s,a,c,l,u,d)=>{n.push({name:s,kind:a,startLine:c,endLine:l,summary:L7(u),exported:d})};for(let s=0;s|^\s*=\s*(?:async\s*)?function\b/.test(h);o(m[1],b?"function":"variable",s+1,R7(i,s)+1,`${b?"const fn":"const"} ${m[1]}`,l);continue}let g=/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([\w$]+)/.exec(c);g&&o(g[1],"module",s+1,$f(i,s)+1,`module ${g[1]}`,l)}return n}function qMe(e,t,n,i,r){let o=0;for(let s=t;s{let a=r.slice(s+1).find(c=>c.indent<=o.indent);return{name:o.name,kind:o.kind,startLine:o.line,endLine:a?a.line-1:i.length,summary:o.summary,exported:!0}})}var KMe={python:[{pattern:/^(?:async\s+)?def\s+(\w+)\s*\(/,kind:"function"},{pattern:/^class\s+(\w+)\s*[(:]/,kind:"class"}],go:[{pattern:/^func\s+(?:\([^)]*\)\s*)?(\w+)\s*[[(]/,kind:"function"},{pattern:/^type\s+(\w+)\s+(?:struct|interface)\s*\{/,kind:"type"}],rust:[{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+(\w+)/,kind:"function"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+(\w+)/,kind:"class"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:enum|trait)\s+(\w+)/,kind:"type"},{pattern:/^impl(?:<[^>]*>)?\s+(?:\w+\s+for\s+)?(\w+)/,kind:"class"}],java:[{pattern:/^(?:public|private|protected|abstract|final|static|\s)*(?:class|interface|enum|record)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|static|final|synchronized|abstract|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],ruby:[{pattern:/^def\s+(?:self\.)?(\w+[?!=]?)/,kind:"method"},{pattern:/^(?:class|module)\s+([\w:]+)/,kind:"class"}],dotnet:[{pattern:/^(?:public|private|protected|internal|sealed|abstract|static|partial|\s)*(?:class|interface|struct|record|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|internal|static|virtual|override|async|sealed|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],php:[{pattern:/^(?:abstract\s+|final\s+|readonly\s+)*(?:class|interface|trait|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|private\s+|protected\s+|static\s+|abstract\s+|final\s+)*function\s+&?(\w+)\s*\(/,kind:"function"}],elixir:[{pattern:/^\s*defmodule\s+([A-Z][\w.]*)/,kind:"module"},{pattern:/^\s*(?:def|defp|defmacro|defmacrop|defguard|defdelegate)\s+([a-z_]\w*[!?]?)/,kind:"function"},{pattern:/^\s*(?:defstruct|defexception|defprotocol|defimpl)\s+([A-Z][\w.]*)?/,kind:"type"}],erlang:[{pattern:/^([a-z]\w*)\s*\(.*\)\s*(?:when\b.*)?->/,kind:"function"},{pattern:/^-record\(\s*(\w+)/,kind:"type"}],swift:[{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|final\s+|@\w+\s+)*(?:class|struct|enum|protocol|actor|extension)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|static\s+|final\s+|override\s+|mutating\s+|@\w+\s+)*func\s+(\w+)/,kind:"function"}],dart:[{pattern:/^(?:abstract\s+|base\s+|final\s+|sealed\s+|interface\s+)*(?:class|mixin|enum|extension)\s+(\w+)/,kind:"class"},{pattern:/^typedef\s+(\w+)/,kind:"type"}],ocaml:[{pattern:/^let\s+(?:rec\s+)?([a-z_]\w*)/,kind:"function"},{pattern:/^(?:module|module\s+type)\s+([A-Z]\w*)/,kind:"module"},{pattern:/^type\s+(?:'\w+\s+)?([a-z_]\w*)/,kind:"type"}],c:N7(),cpp:[{pattern:/^(?:template\s*<[^>]*>\s*)?(?:class|struct)\s+(?:\w+_API\s+|\w+_EXPORT\s+)?(\w+)\s*(?::|\{|$)/,kind:"class"},{pattern:/^namespace\s+(\w+)/,kind:"module"},...N7()]};function N7(){return[{pattern:/^typedef\s+(?:struct|union|enum)?\s*[\w\s*]*?(\w+)\s*;/,kind:"type"},{pattern:/^(?:typedef\s+)?(?:struct|union|enum)\s+(\w+)\s*\{?\s*$/,kind:"class"},{pattern:/^(?!(?:return|if|while|for|switch|case|else|do|sizeof|typeof|delete|throw|catch|assert)\b)(?:(?:static|extern|inline|const|constexpr|virtual|explicit|friend|unsigned|signed|struct|enum|class|\w+_API|\w+_EXPORT)\s+)*[\w:<>,\s]*?[\w>]\s*[*&\s]\s*(\w+)\s*\([^;]*\)\s*(?:const\s*)?(?:noexcept\s*)?[{;]?\s*$/,kind:"function"},{pattern:/^#\s*define\s+(\w+)\s*\(/,kind:"function"}]}function JMe(e,t,n){let i=t.filter(a=>a.exported).map(a=>a.name),r=i.slice(0,8),o=[...new Set(n.map(a=>a.packageName))].slice(0,6),s=[`${e.path} (${e.language}, ${e.lineCount} lines)`];return r.length&&s.push(`defines ${r.join(", ")}${i.length>r.length?`, +${i.length-r.length} more`:""}`),o.length&&s.push(`imports ${o.join(", ")}`),s.join(" \u2014 ")}function L7(e){return e.replace(/\s+/g," ").trim().slice(0,200)}function GF(e,t){return`${e}|${t}`}var ZMe=2e4;async function WS(e,t){let n=new Map;for(let s of e){if(!zF[s.ecosystem])continue;let a=GF(s.ecosystem,s.name);n.has(a)||n.set(a,s)}let i=new Map;if(n.size===0)return i;let r=[...n.entries()],o=await qn(r,t.concurrency??6,async([s,a])=>{let c=a.to??a.from;if(!c)return[s,void 0];try{let l=await aLe(`${s}|${c}`,()=>zF[a.ecosystem](a.name,c,{timeoutMs:t.timeoutMs??ZMe}));return[s,l]}catch(l){return t.logger.debug(`Module map failed for ${s}: ${l.message}`),[s,void 0]}});for(let[s,a]of o)a&&a.names.length>0&&i.set(s,a);return t.logger.debug(`Resolved ${i.size} of ${n.size} module map(s) from published artefacts`),i}var YMe=async(e,t,{timeoutMs:n})=>{let r=(await $e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{timeoutMs:n,immutable:!0}))?.urls?.find(l=>l.packagetype==="bdist_wheel"&&l.url);if(!r?.url)return;let o=await Ty(r.url,n);if(!o)return;let s=o.find(l=>/(^|\/)[^/]+\.dist-info\/top_level\.txt$/.test(l.path));if(s){let l=Ey(s).split(` -`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));if(l.length>0)return{names:[...new Set(l)],source:`${r.filename??"wheel"} top_level.txt`}}let a=o.find(l=>/(^|\/)[^/]+\.dist-info\/RECORD$/.test(l.path));if(!a)return;let c=new Set;for(let l of Ey(a).split(` -`)){let u=l.split(",")[0]?.trim();if(!u)continue;let d=u.split("/")[0];!d||d.startsWith(".")||/\.(dist-info|data)$/.test(d)||c.add(d.endsWith(".py")?d.slice(0,-3):d)}return c.delete(""),c.size>0?{names:[...c],source:`${r.filename??"wheel"} RECORD`}:void 0},QMe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split(":");if(!i||!r)return;let s=`https://repo1.maven.org/maven2/${i.replace(/\./g,"/")}/${r}/${t}/${r}-${t}.jar`,a=await Ty(s,n);if(!a)return;let c=new Set;for(let l of a){if(!l.path.endsWith(".class")||l.path.startsWith("META-INF/"))continue;let u=l.path.split("/").slice(0,-1);u.length!==0&&c.add(u.join("."))}return c.size>0?{names:[...c],source:`${r}-${t}.jar`}:void 0},XMe=async(e,t,{timeoutMs:n})=>{let i=e.toLowerCase(),r=t.toLowerCase(),o=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(i)}/${encodeURIComponent(r)}/${encodeURIComponent(i)}.${encodeURIComponent(r)}.nupkg`,s=await Ty(o,n);if(!s)return;let{readAssembly:a}=await Promise.resolve().then(()=>(MO(),$9)),c=new Set;for(let l of s){if(!/^lib\/.+\.dll$/i.test(l.path)&&!/^ref\/.+\.dll$/i.test(l.path))continue;let u;try{u=a(l.read())}catch{continue}for(let d of u??[]){let p=d.fullName.lastIndexOf(".");p>0&&c.add(d.fullName.slice(0,p))}if(c.size>0)break}return c.size>0?{names:[...c],source:`${e} ${t} assembly metadata`}:void 0},eLe=async(e,t,{timeoutMs:n})=>{let r=(await $e(`https://repo.packagist.org/p2/${e.toLowerCase()}.json`,{timeoutMs:n}))?.packages?.[e.toLowerCase()];if(!r?.length)return;let o=Gk(r),a=(Vk(o,t)??o[0])?.autoload??void 0,c=new Set;for(let l of[a?.["psr-4"],a?.["psr-0"]])for(let u of Object.keys(l??{})){let d=u.replace(/\\+$/,"");d&&c.add(d)}return c.size>0?{names:[...c],source:`${e} composer.json autoload`}:void 0},tLe=async(e,t,{timeoutMs:n})=>{let i=await Ty(`https://repo.hex.pm/tarballs/${encodeURIComponent(e)}-${encodeURIComponent(t)}.tar`,n);if(!i)return;let r=i.find(c=>c.path==="contents.tar.gz"||c.path.endsWith("/contents.tar.gz"));if(!r)return;let o;try{o=Fn(r.read())}catch{return}let s=new Set;for(let c of o)if(/^(lib|src)\//.test(c.path)){if(/\.(ex|exs)$/.test(c.path)){for(let l of nLe(Ey(c)))s.add(l);continue}if(/\.erl$/.test(c.path)){let l=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(Ey(c));l?.[1]&&s.add(l[1])}}if(s.size===0)return;let a=new Set;for(let c of s)a.add(c.split(".")[0]);return{names:[...new Set([...s,...a])],source:`${e} ${t} hex tarball`}};function nLe(e){let t=[],n=[],i=!1;for(let r of e.split(` -`)){let o=(r.match(/"""/g)??[]).length;if(i){o%2===1&&(i=!1);continue}if(o%2===1){i=!0;continue}let s=/^(\s*)defmodule\s+([A-Z][\w.]*)/.exec(r);if(!s)continue;let a=s[1].length;for(;n.length>0&&n[n.length-1].indent>=a;)n.pop();let c=n[n.length-1]?.name,l=c?`${c}.${s[2]}`:s[2];n.push({indent:a,name:l}),t.push(l)}return t}var rLe=async(e,t,{timeoutMs:n})=>{let i=await Ty(`https://rubygems.org/downloads/${encodeURIComponent(e)}-${encodeURIComponent(t)}.gem`,n);if(!i)return;let r=i.find(c=>c.path==="data.tar.gz"||c.path.endsWith("/data.tar.gz"));if(!r)return;let o;try{o=Fn(r.read())}catch{return}let s=new Set,a=new Set;for(let c of o){let l=/^lib\/(.+)\.rb$/.exec(c.path);if(l?.[1]&&(s.add(l[1]),s.add(l[1].split("/")[0]),!(l[1].split("/").length>2)))for(let u of Ey(c).matchAll(/^(?:module|class)\s+([A-Z][\w:]*)/gm))a.add(u[1].split("::")[0])}if(!(s.size===0&&a.size===0))return{names:[...new Set([...s,...a])],source:`${e}-${t}.gem`}},iLe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split("/");if(!(!i||!r))for(let o of[t,`v${t}`]){let s=await rt(`https://raw.githubusercontent.com/${i}/${r}/${encodeURIComponent(o)}/Package.swift`,{timeoutMs:n,immutable:!0});if(!s)continue;let a=new Set;for(let c of s.matchAll(/\.(?:library|target|executableTarget)\s*\(\s*name:\s*"([^"]+)"/g))a.add(c[1]);for(let c of s.matchAll(/targets:\s*\[([^\]]*)\]/g))for(let l of c[1].matchAll(/"([^"]+)"/g))a.add(l[1]);if(a.size>0)return{names:[...a],source:`${e}@${o} Package.swift`}}},oLe=async(e,t,{timeoutMs:n})=>{let i=await jk(e,t,{timeoutMs:n});if(!i)return;let r=i.moduleName??(i.name??e).replace(/[-.]/g,"_");return{names:[...new Set([r,e])],source:`${e} ${t} podspec`}},zF={pypi:YMe,maven:QMe,nuget:XMe,packagist:eLe,hex:tLe,rubygems:rLe,swift:iLe,cocoapods:oLe},oyt=Object.keys(zF),sLe=64*1024*1024;async function Ty(e,t){try{let n=await Bt(e,{timeoutMs:t,retries:0,maxBytes:sLe});return n.ok?Fn(n.bytes):void 0}catch{return}}var UF=new Map,jF=new Map;function aLe(e,t){let n=UF.get(e);if(n!==void 0)return Promise.resolve(n??void 0);let i=jF.get(e);if(i)return i;let r=t().then(o=>(UF.set(e,o??null),o)).catch(()=>{UF.set(e,null)}).finally(()=>jF.delete(e));return jF.set(e,r),r}function Ey(e){try{return e.read().toString("utf8")}catch{return""}}var _s=gt(Dc(),1),_n=gt(gc(),1);function cLe(e){return e.split(".").map(t=>Number.parseInt(t,10))}function Sf(e,t){let n=Math.max(e.length,t.length);for(let i=0;i0}}function U7(e,t){if(!e)return t;if(!t)return e;let n=Sf(e.value,t.value);return n!==0?n>0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function j7(e,t){if(!e)return t;if(!t)return e;let n=Sf(e.value,t.value);return n!==0?n<0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function HS(e,t){return U7(e,t)}function Iy(e,t){return j7(e,t)}function z7(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);if(t.length===0)return{min:null,max:null,imprecise:!1};let n=null,i=null,r=!1;for(let o of t){let s=/^(===|~=|==|!=|<=|>=|<|>)?\s*v?(\d[\w.*]*)$/.exec(o);if(!s){r=!0;continue}let[,a,c]=s,l=!a,u=a??"==",d=lLe(c);if(d.imprecise){r=!0;continue}let{release:p,wildcard:f}=d;if(f&&u!=="=="&&u!=="!="){r=!0;continue}if(u==="~="&&p.length<2){r=!0;continue}let m=l||f;switch(u){case">=":n=HS(n,{value:p,inclusive:!0});break;case">":n=HS(n,{value:p,inclusive:!1});break;case"<=":i=Iy(i,{value:p,inclusive:!0});break;case"<":i=Iy(i,{value:p,inclusive:!1});break;case"==":n=HS(n,{value:p,inclusive:!0}),i=m?Iy(i,{value:F7(p),inclusive:!1}):Iy(i,{value:p,inclusive:!0});break;case"===":r=!0;break;case"~=":n=HS(n,{value:p,inclusive:!0}),i=Iy(i,{value:F7(p.slice(0,-1)),inclusive:!1});break;case"!=":r=!0;break;default:r=!0}}return!r&&uLe(n,i)?{min:n,max:i,imprecise:!0}:{min:n,max:i,imprecise:r}}function uLe(e,t){if(!e||!t)return!1;let n=Sf(e.value,t.value);return n>0?!0:n<0?!1:!(e.inclusive&&t.inclusive)}function dLe(e,t){if(!t)return!0;if(!e)return!1;let n=Sf(e.value,t.value);return n!==0?n>0:!(e.inclusive&&!t.inclusive)}function pLe(e,t){if(!t)return!0;if(!e)return!1;let n=Sf(e.value,t.value);return n!==0?n<0:!(e.inclusive&&!t.inclusive)}function VF(e,t){return e.imprecise||t.imprecise?!1:dLe(e.min,t.min)&&pLe(e.max,t.max)}function BF(e,t){if(e.imprecise||t.imprecise)return!0;let n=U7(e.min,t.min),i=j7(e.max,t.max);if(!n||!i)return!0;let r=Sf(n.value,i.value);return r!==0?r<0:n.inclusive&&i.inclusive}var B7=gt(Dc(),1);var fLe=/^nightly-(\d{4}-\d{2}-\d{2})$/,mLe=/^beta-(\d{4}-\d{2}-\d{2})$/;function JS(e){let t=e.trim().replace(/^rust-/i,"");if(!t)return{kind:"unknown"};let n=fLe.exec(G7(t,"nightly"));if(n)return{kind:"dated-nightly",date:n[1]};if(mLe.test(G7(t,"beta")))return{kind:"moving-beta"};if(/^stable$/i.test(t)||/^stable-/i.test(t))return{kind:"moving-stable"};if(/^beta$/i.test(t)||/^beta-/i.test(t))return{kind:"moving-beta"};if(/^nightly$/i.test(t)||/^nightly-/i.test(t))return{kind:"moving-nightly"};let i=gLe(t);return i?{kind:"exact",version:i}:{kind:"unknown"}}function G7(e,t){let n=new RegExp(`^(${t}(?:-\\d{4}-\\d{2}-\\d{2})?)`).exec(e);return n?n[1]:e}function gLe(e){let t=e.split(/-(?=[a-z])/i)[0].trim();return B7.default.valid(t)?t:/^\d+\.\d+$/.test(t)?`${t}.0`:null}var KS=new Map,hLe=e=>`https://static.rust-lang.org/dist/${e}/channel-rust-nightly.toml`,V7=e=>`rust-nightly-version:v1:${e}`;async function q7(e){let t=KS.get(e);if(t)return t;let n=await Na(V7(e));if(n?.version)return KS.set(e,n.version),n.version;let i=null;try{i=await rt(hLe(e),{immutable:!0,retries:1})}catch{i=null}let r=i?yLe(i):null;return r&&(KS.set(e,r),await Ca(V7(e),{version:r})),r}function W7(e){return KS.get(e)??null}function yLe(e){let t=/\[pkg\.rust\]([\s\S]*?)(?:\n\[|$)/.exec(e);if(!t)return null;let n=/(?:^|\n)\s*version\s*=\s*"([^"]+)"/.exec(t[1]);if(!n)return null;let i=/^\d+\.\d+\.\d+/.exec(n[1].trim());return i?i[0]:null}async function qF(e){let t=new Set;for(let n of e){let i=JS(n);i.kind==="dated-nightly"&&t.add(i.date)}await Promise.all([...t].map(n=>q7(n)))}function KF(e,t,n,i){return Ef(e,t,n,i).resolved}function Ef(e,t,n,i){let r=KLe(e,n,i),o={resolved:[],unresolved:[]};for(let{path:s,content:a}of r){if(!AP(s))continue;let c=(s.split("/").pop()??"").toLowerCase();if(bLe[t].includes(c)){vLe(s,c,a,t,o);continue}if(c===".tool-versions"){$Le(s,a,t,o);continue}if(c.startsWith("dockerfile")||c.startsWith("containerfile")){_Le(s,a,t,o);continue}if(t==="node"&&c==="package.json"){xLe(s,a,o);continue}if(t==="python"&&["pyproject.toml","setup.cfg","setup.py"].includes(c)){ELe(s,c,a,o);continue}if(t==="ruby")c==="gemfile"?TLe(s,a,o,r):c.endsWith(".gemspec")&&ILe(s,a,o);else if(t==="go"&&c==="go.mod")ALe(s,a,o);else if(t==="java")c==="pom.xml"?RLe(s,a,o):(c==="build.gradle"||c==="build.gradle.kts")&&CLe(s,a,o);else if(t==="rust"&&c==="cargo.toml"){let l=PLe(a,"rust-version");l&&tr(o,t,s,l.line,l.requirement,"manifest",l.requirement)}WF(s)&&LLe(s,a,t,o,n,i)}if(n!==void 0&&(i?.length??0)>1){for(let s of o.resolved)!s.scope&&!WF(s.file)&&(s.scope=K7(s.file,n,i));for(let s of o.unresolved)!s.scope&&!WF(s.file)&&(s.scope=K7(s.file,n,i))}if(n!==void 0&&(i?.length??0)>1){let s=c=>c==="member"?2:c==="ambiguous"?0:1,a=Math.max(0,...o.resolved.map(c=>s(c.scope)),...o.unresolved.map(c=>s(c.scope)));o.resolved=o.resolved.filter(c=>s(c.scope)===a),o.unresolved=o.unresolved.filter(c=>s(c.scope)===a)}return o.resolved=BLe(o.resolved),o.unresolved=qLe(o.unresolved),o}var bLe={node:[".nvmrc",".node-version"],python:[".python-version","runtime.txt"],ruby:[".ruby-version"],rust:["rust-toolchain","rust-toolchain.toml"],go:[],java:[]};function tr(e,t,n,i,r,o,s,a){s?e.resolved.push({file:n,line:i,requirement:s,...a?{scope:a}:{}}):e.unresolved.push({runtime:t,file:n,line:i,rawText:r,source:o,...a?{scope:a}:{}})}function ic(e){return/[$`%]|\{\{|\}\}/.test(e)}function vLe(e,t,n,i,r){if(t==="rust-toolchain.toml"){let a=VLe(n,/^\s*channel\s*=\s*['"]([^'"]+)['"]/);if(!a)return;tr(r,i,e,a.line,a.requirement,"version-file",rc(a.requirement));return}if(t===".python-version"){for(let[a,c]of n.split(` -`).entries()){let l=c.trim();if(!(!l||l.startsWith("#")))for(let u of l.split(/\s+/))tr(r,i,e,a+1,u,"version-file",rc(u))}return}let o=n.trim().split(` -`)[0]?.trim();if(!o)return;let s=t==="runtime.txt"?o.replace(/^python-/i,"").trim():o.replace(/^(?:ruby-|go|rust-)?v?/i,"").trim();s&&tr(r,i,e,1,o,"version-file",rc(s))}function rc(e){return ic(e)?null:e}function JF(e,t,n){if(e==="node")return X7(t,n);if(e==="python")return eee(t,n);let i=[],r=XS(YS(e,n).text);for(let o of t){let s=YS(e,o.requirement),a=XS(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!r){i.push({...o,...c,verdict:"unknown"});continue}let l;try{_s.default.subset(a,r,{loose:!0})?l="compatible":_s.default.intersects(a,r,{loose:!0})?l="partial":l="incompatible"}catch{l="unknown"}i.push({...o,...c,verdict:l})}return i}function YS(e,t){if(e==="java")return{text:ex(t)??t};if(e==="rust"){let n=JS(t);if(n.kind==="exact")return{text:n.version,resolved:n.version};if(n.kind==="dated-nightly"){let i=W7(n.date);return i?{text:i,resolved:i}:{text:"\0unresolved-nightly"}}return n.kind!=="unknown"?{text:"\0moving-channel"}:{text:t}}return{text:t}}function J7(e,t,n){if(e==="python")return wLe(t,n);let i=XS(YS(e,n).text),r=[];for(let o of t){let s=YS(e,o.requirement),a=XS(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!i){r.push({...o,...c,verdict:"unknown"});continue}let l;try{_s.default.subset(a,i,{loose:!0})?l="incompatible":_s.default.intersects(a,i,{loose:!0})?l="partial":l="compatible"}catch{l="unknown"}r.push({...o,...c,verdict:l})}return r}function xf(e,t="minimum"){let n=t==="unsupported"?e.replace(/\.x$/i,".*"):e;if(/^\s*(?:\^|~(?![=>]))/.test(n))return{status:"unknown",reason:"unsupported-grammar"};let i=z7(n);return i.imprecise||i.min===null&&i.max===null?{status:"unknown",reason:"unparseable"}:{status:"parsed",value:i}}function wLe(e,t){let n=xf(t,"unsupported"),i=[];for(let r of e){let o=xf(r.requirement),s;n.status==="unknown"||o.status==="unknown"?s="unknown":VF(o.value,n.value)?s="incompatible":BF(o.value,n.value)?s="partial":s="compatible",i.push({...r,verdict:s})}return i}var kLe={node:["node","nodejs"],python:["python","python3"],go:["go","golang"],ruby:["ruby"],java:["java"],rust:["rust"]};function $Le(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*([\w-]+)\s+([^\s#]+)/.exec(o);if(!s||!kLe[n].includes(s[1].toLowerCase()))continue;let a=o.slice(s.index+s[0].length-s[2].length).split("#",1)[0].split(/\s+/).filter(Boolean);for(let c of a){let l=ic(c)||/^(?:system|path:|ref:)/i.test(c)?null:n==="java"?ex(c):c;tr(i,n,e,r+1,c,"tool-versions",l)}}}function _Le(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*FROM\s+(?:--platform=\S+\s+)?(\S+)/i.exec(o)?.[1];s&&Z7(i,n,e,r+1,s,"container")}}function Z7(e,t,n,i,r,o,s){let a=Y7(r);if(!a||a.runtime!==t)return;let c=a.version;tr(e,t,n,i,r,o,c&&!ic(c)?QS(c):null,s)}var SLe={node:"node",python:"python",ruby:"ruby",golang:"go",openjdk:"java","eclipse-temurin":"java",amazoncorretto:"java",rust:"rust"};function Y7(e){let t=e.trim().replace(/^['"]|['"]$/g,"");if(!t||t.startsWith("$"))return null;let n=t.split("@",1)[0],i=n.lastIndexOf("/"),r=n.lastIndexOf(":"),o=r>i,s=(o?n.slice(0,r):n).split("/").at(-1)?.toLowerCase();if(!s)return null;let a=SLe[s];if(!a)return null;let c=o?n.slice(r+1):void 0;return c?{runtime:a,version:c}:{runtime:a}}function xLe(e,t,n){let i=JLe(t);i&&tr(n,"node",e,HF(t,/"node"\s*:/),i.raw,"manifest",i.requirement)}function ELe(e,t,n,i){if(t==="setup.py"){let o=QLe(n);o&&tr(i,"python",e,o.line,o.raw,"manifest",o.requirement);return}let r=t==="pyproject.toml"?ZLe(n):t==="setup.cfg"?nFe(n):null;r&&tr(i,"python",e,r.line,r.requirement,"manifest",rc(r.requirement))}function TLe(e,t,n,i){for(let[r,o]of t.split(` -`).entries()){let s=/^\s*ruby\s+(.+?)\s*(?:#.*)?$/.exec(o)?.[1]?.trim();if(!s)continue;let a=/^(['"])([^'"]+)\1/.exec(s)?.[2],c=/^file\s*:\s*(['"])([^'"]+)\1/.exec(s)?.[2];if(c){let l=i.find(u=>u.path===c||u.path.endsWith(`/${c}`));if(l){let u=l.content.trim().split(/\s+/)[0];if(u&&!ic(u))continue}}tr(n,"ruby",e,r+1,s,"manifest",a?rc(a):null)}}function ILe(e,t,n){for(let[i,r]of t.split(` -`).entries()){let o=/\.required_ruby_version\s*=\s*(.+?)\s*(?:#.*)?$/.exec(r)?.[1]?.trim();if(!o)continue;let s=/^(['"])([^'"]+)\1/.exec(o)?.[2];tr(n,"ruby",e,i+1,o,"manifest",s?rc(s):null)}}function ALe(e,t,n){for(let[i,r]of t.split(` -`).entries()){let o=/^\s*(go|toolchain)\s+(?:go)?(\d+(?:\.\d+){0,3})\s*(?:\/\/.*)?$/.exec(r);o?.[2]&&tr(n,"go",e,i+1,o[2],"manifest",o[2])}}function RLe(e,t,n){let i=[],r=/\s*([^<]+?)\s*<\//g;for(let s of t.matchAll(r))i.push({line:t.slice(0,s.index).split(` -`).length,raw:s[1]});let o=NLe(t);for(let{line:s,raw:a}of i){if(/^\s*\$\{[^}]+\}\s*$/.test(a)&&H7(t,a))continue;let c=H7(t,a),l=c?ex(c):null;tr(n,"java",e,s,a,"manifest",o?l:null)}}function NLe(e){return/\s*maven-toolchains?-plugin\s*<\/artifactId>/i.test(e)?/[\s\S]*?\s*\$\{java\.version\}\s*<\/version>[\s\S]*?<\/jdk>/i.test(e):!1}function H7(e,t){let n=/^\$\{([^}]+)\}$/.exec(t.trim())?.[1];if(!n)return ic(t)?null:t;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<${i}>\\s*([^<]+?)\\s*`).exec(e)?.[1];return r&&!ic(r)?r:null}function CLe(e,t,n){let i=[/JavaLanguageVersion\.of\(\s*([^)]+?)\s*\)/];for(let[r,o]of t.split(` -`).entries())for(let s of i){let a=s.exec(o)?.[1];a&&tr(n,"java",e,r+1,a,"build-config",ic(a)?null:ex(a))}}function ex(e){let t=QS(e.replace(/_/g,"."));return t?.startsWith("1.")?t.slice(2):t}function PLe(e,t){let n=!1;for(let[i,r]of e.split(` -`).entries()){let o=/^\s*\[([^\]]+)\]\s*$/.exec(r);if(o){n=o[1]==="package";continue}if(!n)continue;let s=new RegExp(`^\\s*${t.replace("-","\\-")}\\s*=\\s*['"]([^'"]+)['"]`).exec(r);if(s?.[1])return{line:i+1,requirement:s[1]}}return null}function WF(e){return/^\.github\/workflows\/.+\.ya?ml$/i.test(e)||/^\.(?:gitlab-ci|circleci)(?:\/|\.|$)/i.test(e)}var DLe={node:"node-version",python:"python-version",ruby:"ruby-version",go:"go-version",java:"java-version",rust:"toolchain"};function OLe(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`^\\s*(?:-\\s*)?${n}\\s*:\\s*(.*?)\\s*$`,"i").exec(e);if(!i)return null;let r=i[1].replace(/\\s+#.*$/,"").trim();return{raw:/^(['"])(.*?)\1$/.exec(r)?.[2]??r}}function MLe(e){let t=Array.from({length:e.length},()=>!0),n=null,i=/(?:^\s*-\s*|:\s*)[>|](?:(?:[+-]?\d)|(?:\d[+-]?))?\s*(?:#.*)?$/;for(let[r,o]of e.entries()){let s=o.trim(),a=/^\s*/.exec(o)[0].length;if(n!==null){if(!s||a>n){t[r]=!1;continue}n=null}i.test(o)&&(n=a)}return t}function LLe(e,t,n,i,r,o){let s=t.split(` -`),a=MLe(s),{allowed:c,ambiguous:l,repositoryWide:u}=GLe(s,r,o),d=m=>l[m-1]?"ambiguous":u[m-1]?"repository":"member",p=/^\.github\/workflows\/.+\.ya?ml$/i.test(e)?jLe(t,s):null,f=(m,g,h,b)=>{tr(i,n,e,m,g,h,l[m-1]?null:b,d(m))};for(let[m,g]of s.entries()){if(!a[m]||!c[m]||p?.insideMatrix(m))continue;let h=OLe(g,DLe[n]);if(h){let w=h.raw,k=p&&ULe(w),_=p&&k?p.resolve(m,k):null;if(_?.ok)for(let S of _.values)f(S.line,S.value,"ci",QS(S.value));else f(m+1,w,"ci",ic(w)?null:QS(w))}if(/^\.github\/workflows\//i.test(e)){let w=/^\s*container\s*:\s*['"]?([^'"\s#]+)/i.exec(g)?.[1];if(w&&ZS(i,n,e,m+1,w,"ci",l,d(m+1)),/^\s*container\s*:\s*$/i.test(g)){let k=/^\s*/.exec(g)[0].length;for(let _=m+1;_/^[ \t]*/.exec(l)[0].length,n=l=>!l.trim()||/^\s*#/.test(l),i=e.findIndex(l=>/^[ \t]*jobs:\s*(#.*)?$/.test(l));if(i===-1)return null;let r=t(e[i]),o=null,s=[],a=[],c=e.length;for(let l=i+1;l({name:a[u],start:l,end:u+10||!(0,_n.isMap)(n.contents))return null;let i=Q7(t);if(!i)return null;let r=[];for(let a of i){let c=n.getIn(["jobs",a.name,"strategy","matrix"],!0);c?.range&&r.push([e.slice(0,c.range[0]).split(` +`),l=await e.messages.create({model:t.llm.model,max_tokens:16e3,system:VOe,thinking:{type:"adaptive"},output_config:{effort:t.llm.effort,format:{type:"json_schema",schema:GOe}},messages:[{role:"user",content:c}]});if(l.stop_reason==="refusal")return o.warn(`The model declined to analyse the prose for ${n.name}, so nothing was extracted from it. The rule-based analyser still ran.`),[];let u=l.content.find(p=>p.type==="text")?.text;if(!u)return o.warn(`The model returned no text for ${n.name}${l.stop_reason?` (stop reason: ${l.stop_reason})`:""}, so nothing was extracted from its prose.`),[];let d;try{d=JSON.parse(u)}catch(p){return o.warn(`The model's answer for ${n.name} was not readable as JSON (${p.message}), so nothing was extracted from its prose.`),[]}return Array.isArray(d.changes)?d.changes:(o.warn(`The model's answer for ${n.name} carried no \`changes\` array, so nothing was extracted from its prose.`),[])}function WOe(e,t,n,i){let r=new Set(i.map(o=>o.id));return e.filter(o=>r.has(o.evidenceId)).filter(o=>o.summary?.trim()).map(o=>({id:St("bc",t,n,"llm",o.summary),dependency:t,workspace:n,kind:k7(o.kind),summary:o.summary.trim(),remediation:o.remediation?.trim()||`Review usages of ${t} and update them.`,symbols:(o.symbols??[]).filter(KOe),confidence:"medium",taxonomy:b5(o.taxonomy,ap(k7(o.kind))),citations:[o.evidenceId]}))}function KOe(e){let t=e.trim();return!t||t.length>80||/\s/.test(t)&&!t.startsWith("/")?!1:/^[/@]?[\w$][\w$./{}-]*$/.test(t)}var HOe=new Set(["removed-export","renamed-export","signature-change","type-change","behaviour-change","removed-endpoint","changed-endpoint","required-field-added","default-change","config-change","module-system-change","runtime-requirement"]);function k7(e){return HOe.has(e)?e:"unknown"}function JOe(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function ZOe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var T7=require("node:crypto");var YOe=[{band:"high",min:.8},{band:"medium",min:.5},{band:"low",min:.2},{band:"none",min:0}];function UF(e){for(let t of YOe)if(e>=t.min)return t.band;return"none"}var $7={high:"Very confident",medium:"Fairly confident",low:"Not very confident",none:"Not enough evidence to say"};var eu="drift-confidence-1",QOe={"type-surface-diff":"computed-artifact",...yY,changelog:"maintainer-narrative","github-release":"maintainer-narrative","migration-guide":"maintainer-guide","behavioural-diff":"dynamic-observation","registry-metadata":"registry","semver-heuristic":"heuristic"},XOe={"computed-artifact":.9,"maintainer-guide":.7,"maintainer-narrative":.6,"dynamic-observation":.5,registry:.4,heuristic:.2},S7=new WeakMap;function zF(e){let{change:t,evidence:n}=e,i=n.filter(d=>t.citations.includes(d.id)),r=[],o=[];if(i.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"no-citations",detail:"No evidence record backs this finding.",delta:0}],calibration:eu};let s=eMe(i),a=0,c="";for(let d of s.keys()){let p=XOe[d]??.3;p>a&&(a=p,c=d)}r.push({code:`origin:${c}`,detail:`Strongest evidence class is ${jF(c)}.`,delta:a});let l=a,u=s.size-1;if(u>0){let d=Math.min(.15,.08*u);l+=d,r.push({code:"corroborated",detail:`Corroborated by ${u} other independent source class(es): ${[...s.keys()].filter(p=>p!==c).map(jF).join(", ")}.`,delta:d})}else i.length>1&&o.push({code:"single-origin",detail:`All ${i.length} citations trace to one source class (${jF(c)}), so they do not corroborate each other.`,delta:0});return s.size===1&&c==="heuristic"&&(l+=-.1,o.push({code:"heuristic-only",detail:"Only a semver heuristic supports this; no changelog, release note, or API diff was retrieved.",delta:-.1})),VF(l,r,o)}function eMe(e){let t=new Map,n=new Set;for(let i of e){let r=S7.get(i);if(r===void 0&&(r=(0,T7.createHash)("sha256").update(i.content.replace(/\s+/g," ").trim().toLowerCase()).digest("hex"),S7.set(i,r)),n.has(r))continue;n.add(r);let o=QOe[i.source]??"unknown",s=t.get(o);s?s.push(i):t.set(o,[i])}return t}function jF(e){switch(e){case"computed-artifact":return"a computed diff of the shipped artifact";case"maintainer-guide":return"a migration guide";case"maintainer-narrative":return"release notes or a changelog";case"registry":return"registry metadata";case"heuristic":return"a semver heuristic";default:return e}}function tMe(e){let{taxonomy:t,sites:n,localizationRan:i}=e,r=[],o=[];if(!i)return{score:0,band:"none",evidence:[],penalties:[{code:"localization-unavailable",detail:"No checkout was available, so Drift could not search this repository. This is not evidence that the change is unused.",delta:0}],calibration:eu};if(t.scope==="runtime"&&e.runtimeState==="compatible")return{score:.85,band:"high",evidence:[{code:"runtime-compatible",detail:"The repository runtime declaration satisfies the requirement.",delta:.85}],penalties:[],calibration:eu};if(n.length===0){let d=y$(t),p=e.localizationComplete===!1,f=t.scope==="runtime";return{score:0,band:"none",evidence:[],penalties:[{code:f?"runtime-compatibility-unresolved":p?"localization-incomplete":d?"not-locally-checkable":"no-usage-found",detail:f?"This is a requirement on the runtime this repository builds and deploys on, not on any code it calls. No source search can answer it; the repository's own declared runtime version is what decides.":p?"Drift searched the indexed source subset, but the file limit prevented an exhaustive absence claim.":d?"This change is only observable at runtime, so a source search cannot establish whether this repository is affected.":"Drift searched the files that import this dependency and found no usage of the affected symbols.",delta:0}],calibration:eu}}let s=n.reduce((d,p)=>E7(p.confidence)>E7(d.confidence)?p:d),a=s.confidence==="high"?.85:s.confidence==="medium"?.6:.3;r.push({code:`site:${s.confidence}`,detail:s.confidence==="high"?`\`${s.matchedSymbol}\` is bound from an import of this dependency in ${s.file}.`:s.confidence==="medium"?`${s.file} imports this dependency and uses \`${s.matchedSymbol}\`, but the symbol was not traced to the import.`:`\`${s.matchedSymbol}\` appears in ${s.file}, but no import of this dependency was established \u2014 the match may be coincidental.`,delta:a});let c=a;if(n.length>1){let d=Math.min(.05,.01*(n.length-1));c+=d,r.push({code:"multiple-sites",detail:`${n.length} affected locations across ${new Set(n.map(p=>p.file)).size} file(s).`,delta:d})}let l=n.filter(d=>nMe(d.file));return l.length===n.length?(c+=-.25,o.push({code:"generated-only",detail:`Every affected location is in generated code (${l[0].file}). Editing it is usually wrong; the generator is the real site.`,delta:-.25})):l.length>0&&(c+=-.05,o.push({code:"some-generated",detail:`${l.length} affected location(s) are in generated code.`,delta:-.05})),t.visibility.includes("reflection-or-dynamic")&&(c+=-.2,o.push({code:"dynamic-access",detail:"Dynamic or reflective access was detected, so the affected set cannot be enumerated by search.",delta:-.2})),t.visibility.includes("wrapper-mediated")&&(c+=-.1,o.push({code:"wrapper-mediated",detail:"Usage is mediated by a local wrapper, so downstream callers of the wrapper are not enumerated here.",delta:-.1})),n.every(d=>d.confidence==="low")&&(c+=-.1,o.push({code:"textual-only",detail:"Every match is textual \u2014 no import edge was established for any of them.",delta:-.1})),VF(c,r,o)}function nMe(e){let t=e.toLowerCase();return/(^|\/)(generated|__generated__|gen|dist|build|out|vendor|node_modules)\//.test(t)||/\.(g|generated)\.[a-z]+$/.test(t)||/\.pb\.(go|ts|js|py)$/.test(t)||/_pb2?\.py$/.test(t)||/\.d\.ts$/.test(t)}function rMe(e){let{outcomes:t,affectedFiles:n,taxonomy:i}=e;if(t.length===0)return{score:0,band:"none",evidence:[],penalties:[{code:"nothing-ran",detail:"No checks were run against this finding, so nothing confirms the change was understood correctly.",delta:0}],calibration:eu};let r=[],o=[],s=t.filter(p=>p.status==="passed"),a=t.filter(p=>p.status==="failed"),c=t.filter(p=>p.status==="skipped"||p.status==="unavailable"||p.status==="timed-out");if(a.length>0)return{score:0,band:"none",evidence:[],penalties:[{code:"checks-failed",detail:`${a.length} check(s) failed: ${a.map(p=>p.name).join(", ")}.`,delta:0}],calibration:eu};let l=0,u=i.detectability.some(p=>p==="compile-time"||p==="link-or-import"||p==="manifest");for(let p of s){let f=/type|compile|build|lint/i.test(p.name),g=/test|spec/i.test(p.name)?.45:f?u?.4:.15:.1;l+=g,r.push({code:`passed:${p.name}`,detail:f&&!u?`\`${p.name}\` passed, but this change is not detectable at compile time \u2014 it does not confirm the behaviour is right.`:`\`${p.name}\` passed.`,delta:g})}for(let p of c)o.push({code:`did-not-run:${p.name}`,detail:`\`${p.name}\` was ${p.status} and proves nothing.`,delta:0});let d=new Set(s.flatMap(p=>p.covers??[]));return d.size>0&&n.length>0?n.filter(f=>d.has(f)).length===0&&(l+=-.2,o.push({code:"no-coverage",detail:"The checks that passed do not cover any of the affected files.",delta:-.2})):n.length>0&&o.push({code:"coverage-unknown",detail:"Which code paths the passing checks cover could not be established.",delta:0}),VF(l,r,o)}function I7(e){let t=zF({change:e.change,evidence:e.evidence}),n=tMe({change:e.change,taxonomy:e.taxonomy,sites:e.sites,localizationRan:e.localizationRan,localizationComplete:e.localizationComplete,runtimeState:e.runtimeState}),i=rMe({outcomes:e.outcomes??[],affectedFiles:[...new Set(e.sites.map(a=>a.file))],taxonomy:e.taxonomy}),r=[...e.gaps??[]],o=[];t.band==="high"&&n.band==="none"&&o.push({code:"upstream-only",detail:"The upstream change is well established, but nothing in this repository was shown to be affected. High upstream confidence is not a reason to edit code.",delta:0});let s=t.band==="high"&&(n.band==="high"||n.band==="medium")&&!r.some(a=>a.automaticExecution==="blocks");return{upstream:t,localImpact:n,verification:i,automaticExecutionEligible:s,reasons:o,checkedSurfaces:[...e.checkedSurfaces??[]],gaps:r}}function GF(e){let{upstream:t,localImpact:n,verification:i}=e,r=n.band==="none"?Math.min(t.score,.55):Math.min(t.score,n.score),o=i.score>0?Math.min(.1,i.score*.15):0,s=Math.round(Math.max(0,Math.min(1,r+o))*100),a=UF(s/100);return{score:s,band:a,label:$7[a]}}function A7(e){let t=e.upstream.band,n=e.localImpact.band;return n==="none"?t==="high"?"medium":x7(t):x7(iMe(t,n))}function x7(e){return e==="high"?"high":e==="medium"?"medium":"low"}function iMe(e,t){let n=["none","low","medium","high"];return n.indexOf(e)<=n.indexOf(t)?e:t}function E7(e){return e==="high"?2:e==="medium"?1:0}function VF(e,t,n){let i=Math.round(Math.max(0,Math.min(1,e))*100)/100;return{score:i,band:UF(i),evidence:t,penalties:n,calibration:eu}}async function YS(e,t,n){let{config:i,logger:r}=n,o=oMe(t),s=[];for(let a of e){let c=o.get(Vc(a))??[];s.push(...sMe(a.name,a.workspace,c))}for(let a of t)fY(a.source)&&s.push(...N7(a));if(i.llm.enabled){let a=await _7(e,t,s,{config:i,logger:r});s.push(...a)}return dMe(fMe(s),t)}function oMe(e){let t=new Map;for(let n of e){let i=Vc({name:n.dependency,workspace:n.workspace}),r=t.get(i);r?r.push(n):t.set(i,[n])}return t}function sMe(e,t,n){let i=[];for(let r of n){if(r.findings?.length){i.push(...N7(r));continue}if(r.source!=="semver-heuristic"){if(r.source==="registry-metadata"){i.push(...C7(r,e,t).filter(o=>o.kind==="runtime-requirement"));continue}i.push(...C7(r,e,t))}}return i}function aMe(e,t){return e.replace(/`default\.([\w$]+)`/g,`\`${t}.$1\``).replace(/`default` is no longer exported/g,`\`${t}\` no longer has a default export`).replace(/`default`/g,`the default export of \`${t}\``)}function N7(e){return(e.findings??[]).map(t=>{let n=h$(t.code),i=n==="module-system-change"?t.moduleSystem??{from:"dual",to:"esm",incompatibleUsage:["require"]}:void 0;return{id:St("bc",e.dependency,e.workspace,t.code,t.symbol,i?.affectedSpecifiers?.join(",")??"",i?.affectedSpecifierPatterns?.join(",")??""),dependency:e.dependency,workspace:e.workspace,kind:n==="removed-export"&&t.replacement?"renamed-export":n,summary:aMe(t.detail,e.dependency),...t.replacement?{replacementSymbols:[t.replacement]}:{},...n==="runtime-requirement"&&t.after?{runtime:{kind:"minimum-runtime",runtime:"java",requirement:`>=${t.after}`,sourceText:t.detail}}:{},before:t.before,after:t.after,...t.fromKind?{fromKind:t.fromKind}:{},...t.toKind?{toKind:t.toKind}:{},remediation:d5(t,e.dependency),symbols:cMe(t),...i?{moduleSystem:{...i,incompatibleUsage:[...i.incompatibleUsage],...i.affectedSpecifiers?{affectedSpecifiers:[...i.affectedSpecifiers]}:{},...i.affectedSpecifierPatterns?{affectedSpecifierPatterns:[...i.affectedSpecifierPatterns]}:{}}}:{},confidence:"high",taxonomy:ap(n,t.code),citations:[e.id]}})}function cMe(e){if(h$(e.code)==="module-system-change")return[];let t=new Set([e.symbol]);if(e.symbol.includes(".")&&!/\s/.test(e.symbol)){let i=e.symbol.split("."),r=i[i.length-1];if(r&&!R7(r)&&t.add(r),i.length>2){let o=i[i.length-2];o&&t.add(`${o}.${r}`)}if(i.length>=2&&h$(e.code)==="required-field-added"){let o=i[i.length-2];o&&!R7(o)&&t.add(o)}}let n=/^[A-Z]+\s+(\/\S*)$/.exec(e.symbol);if(n?.[1]){t.add(n[1]);let i=n[1].split("{")[0]?.replace(/\/$/,"");i&&i.length>1&&t.add(i)}return[...t]}function R7(e){return/^__\w+__$/.test(e)?!0:lMe.has(e.toLowerCase())}var lMe=new Set(["add","all","any","append","apply","build","call","check","clear","clone","close","connect","copy","count","create","define","delete","each","emit","end","execute","exists","extend","fetch","filter","find","first","flush","format","get","handle","has","index","init","insert","is","items","iter","join","keys","last","length","list","load","log","main","map","match","new","next","open","parse","pop","push","put","query","read","remove","render","reset","resolve","run","save","send","set","size","sort","split","start","stop","update","wait","write","args","body","config","content","context","data","error","file","header","headers","host","id","key","name","options","params","path","port","result","root","status","text","type","url","value","values","and","or","not","if","elif","else","for","while","do","in","of","as","with","from","to","try","catch","finally","throw","raise","except","switch","case","break","continue","return","yield","class","def","function","lambda","const","let","var","this","self","super","null","nil","none","true","false","async","await","typeof","instanceof","void","enum","interface","extends","implements","export","import","static","public","private","protected","default","pass","then"]);function C7(e,t,n){let i=[],r=new Set,o=p5(e.content);for(let s of e.content.split(` +`))for(let a of f5(s,{anchored:o})){let c=`${a.kind}:${a.symbols.join(",")}`;if(r.has(c))continue;r.add(c);let l=a.symbols.length>0||a.kind==="module-system-change"?a.symbols:[t];i.push({id:St("bc",t,n,a.ruleId,a.symbols.join(",")),dependency:t,workspace:n,kind:a.kind,summary:a.summary,remediation:m5(a,t),symbols:l,...a.runtime?{runtime:a.runtime}:{},replacementSymbols:a.replacementSymbols.length?a.replacementSymbols:void 0,...a.moduleSystem?{moduleSystem:a.moduleSystem}:{},confidence:uMe(e),taxonomy:ap(a.kind),citations:[e.id]})}return i}function uMe(e){return e.weight>=.95?"high":e.weight>=.6?"medium":"low"}function dMe(e,t){return e.map(n=>{let i=zF({change:n,evidence:t});return{...n,confidence:pMe(i.band)}})}function pMe(e){return e==="high"?"high":e==="medium"?"medium":"low"}function fMe(e){let t=new Map;for(let i of e){let r=mMe(i),o=t.get(r);if(!o){t.set(r,{...i,citations:[...new Set(i.citations)]});continue}t.set(r,{...o,summary:o.summary.length>=i.summary.length?o.summary:i.summary,symbols:[...new Set([...o.symbols,...i.symbols])],replacementSymbols:[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])].filter(Boolean).length?[...new Set([...o.replacementSymbols??[],...i.replacementSymbols??[]])]:void 0,moduleSystem:gMe(o.moduleSystem,i.moduleSystem),confidence:yMe(o.confidence,i.confidence),taxonomy:hMe(Dr(o),Dr(i)),citations:[...new Set([...o.citations,...i.citations])]})}let n={high:0,medium:1,low:2};return[...t.values()].sort((i,r)=>n[i.confidence]-n[r.confidence]||i.dependency.localeCompare(r.dependency))}function mMe(e){let t=Vc({name:e.dependency,workspace:e.workspace});return e.kind==="module-system-change"?[t,e.kind,[...e.moduleSystem?.incompatibleUsage??[]].sort().join(","),e.moduleSystem?.affectedSpecifiers?.length?[...e.moduleSystem.affectedSpecifiers].sort().join(","):"*",e.moduleSystem?.affectedSpecifierPatterns?.length?[...e.moduleSystem.affectedSpecifierPatterns].sort().join(","):"*"].join("|"):`${t}|${e.kind}|${[...e.symbols].sort().join(",")}`}function gMe(e,t){if(!e)return t;if(!t)return e;let n=[...new Set([...e.incompatibleUsage,...t.incompatibleUsage])],i=e.affectedSpecifiers||t.affectedSpecifiers?[...new Set([...e.affectedSpecifiers??[],...t.affectedSpecifiers??[]])]:void 0,r=e.affectedSpecifierPatterns||t.affectedSpecifierPatterns?[...new Set([...e.affectedSpecifierPatterns??[],...t.affectedSpecifierPatterns??[]])]:void 0;return{from:e.from??t.from,to:e.to??t.to,incompatibleUsage:n,...i?{affectedSpecifiers:i}:{},...r?{affectedSpecifierPatterns:r}:{}}}function hMe(e,t){let n={computed:3,rule:2,"llm-normalized":1,default:0};return n[e.origin]>=n[t.origin]?e:t}function yMe(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]?e:t}function BF(e,t){let n={low:0,medium:1,high:2};return n[e]>=n[t]}function QS(e){return e.keys??[e.packageName]}function Sf(e){let t=[],n=new Map,i=new Set(e.map(s=>s.path));for(let s of e){let a=bMe(s),c=ZMe(s);t.push({path:s.path,language:s.language,lineCount:s.lineCount,imports:a,localImports:vMe(s),units:c,summary:nLe(s,c,a)});for(let l of new Set(a.flatMap(QS))){let u=n.get(l);u?u.push(s.path):n.set(l,[s.path])}}let r=new Map,o=$Me(i);for(let s of t)for(let a of s.localImports){let c=SMe(s.path,a.specifier,i,o);if(!c||c===s.path)continue;let l=r.get(c),u={from:s.path,bindings:a.bindings,reExport:a.reExport,line:a.line};l?l.push(u):r.set(c,[u])}return{files:t,importers:n,localImporters:r,stats:{fileCount:t.length,unitCount:t.reduce((s,a)=>s+a.units.length,0),totalLines:t.reduce((s,a)=>s+a.lineCount,0)}}}function WF(e,t){let n;for(let i of e.units)ti.endLine||(!n||i.endLine-i.startLine]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&t.push({specifier:o,line:i+1,bindings:[],reExport:!0})}return t}function $Me(e){let t=new Map,n=(i,r)=>{let o=t.get(i);o?o.push(r):t.set(i,[r])};for(let i of e){let r=i.split("/").pop()??i;n(r.toLowerCase(),i)}return t}var P7=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".py"];function SMe(e,t,n,i){if(t.startsWith(".")){let s=e.split("/").slice(0,-1),a=xMe([...s,...t.split("/")]);if(a===void 0)return;let l=/^\.+$/.test(t)||!t.includes("/")&&t.startsWith(".")?[`${D7(e,t)}.py`,`${D7(e,t)}/__init__.py`]:[a,...P7.map(u=>a+u),...P7.map(u=>`${a}/index${u}`),`${a}/__init__.py`];for(let u of l)if(u&&n.has(u))return u;return}let r=(t.split("/").pop()??t).toLowerCase(),o=(i.get(r)??[]).filter(s=>s.toLowerCase().endsWith(t.toLowerCase()));return o.length===1?o[0]:void 0}function xMe(e){let t=[];for(let n of e)if(!(n===""||n===".")){if(n===".."){if(t.length===0)return;t.pop();continue}t.push(n)}return t.join("/")}function D7(e,t){let n=/^\.+/.exec(t)?.[0].length??1,i=t.slice(n).split(".").filter(Boolean);return[...e.split("/").slice(0,-n),...i].join("/")}function EMe(e){let t=[],n=e.split(` +`);for(let i=0;i]+)>|"([^"]+)")/.exec(n[i]),o=r?.[1]??r?.[2];o&&(o.startsWith(".")||t.push({specifier:o,packageName:TMe(o),bindings:[],line:i+1,reExport:!0}))}return t}function TMe(e){return(e.split("/")[0]??e).replace(/\.(h|hpp|hh|hxx|inl|tpp|h\+\+)$/i,"").toLowerCase()}function IMe(e){let t=$O(e),n=[],i=U7(t),r=d=>j7(i,d),o=/\bimport\s+(?!\()(?:(?:type\s+)?([\w$]+)\s*,\s*)?(?:type\s+)?(?:\{([^}]+)\}|\*\s+as\s+([\w$]+)|([\w$]+))\s+from\s+['"]([^'"]+)['"]|\bimport\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(o)){let p=d[5]??d[6];if(!p||kf(p))continue;let f=qF(d[1],d[2],d[3],d[4]),m=d[1]??d[4];n.push({specifier:p,packageName:_f(p),bindings:f,...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"esm-static"})}let s=/\b(?:const|let|var)\s+(\{[^}]+\}|[\w$]+)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(s)){let p=d[2];if(kf(p))continue;let f=d[1],m=f.startsWith("{")?void 0:f;n.push({specifier:p,packageName:_f(p),bindings:AMe(f),...m?{defaultBinding:m}:{},line:r(d.index??0),loadStyle:"commonjs-require"})}let a=/\bimport\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of t.matchAll(a)){let p=d[1];kf(p)||n.push({specifier:p,packageName:_f(p),bindings:[],line:r(d.index??0),loadStyle:"esm-dynamic"})}let c=/\bexport\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(c)){let p=d[2];kf(p)||n.push({specifier:p,packageName:_f(p),bindings:qF(void 0,d[1],void 0,void 0),line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let l=/\bexport\s+\*\s+as\s+([\w$]+)\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(l)){let p=d[2];kf(p)||n.push({specifier:p,packageName:_f(p),bindings:["*",d[1]],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}let u=/\bexport\s+\*\s+from\s+['"]([^'"]+)['"]/g;for(let d of t.matchAll(u)){let p=d[1];kf(p)||n.push({specifier:p,packageName:_f(p),bindings:["*"],line:r(d.index??0),reExport:!0,loadStyle:"re-export"})}return n.sort((d,p)=>d.line-p.line||d.specifier.localeCompare(p.specifier))}function qF(e,t,n,i){let r=[];if(e&&r.push(e),i&&r.push(i),n&&r.push("*",n),t)for(let o of t.split(",")){let s=o.replace(/\btype\s+/g,"").trim();if(!s)continue;let[a,c]=s.split(/\s+as\s+/).map(l=>l.trim());a&&r.push(c||a,a)}return[...new Set(r)]}function AMe(e){let t=e.trim();return t.startsWith("{")?t.replace(/[{}]/g,"").split(",").flatMap(n=>{let[i,r]=n.split(":").map(o=>o.trim());return[i,r].filter(o=>!!o)}):[t]}function RMe(e,t){let n=[],i=e.split(` +`),r=t.endsWith("/__init__.py")||t==="__init__.py";for(let o=0;o{let n=/^\s*(\w+)(?:\s+as\s+(\w+))?/.exec(t);return n?[n[1],n[2]].filter(Boolean):[]}).flat()}function CMe(e){let t=[],n=e.split(` +`),i=!1;for(let r=0;r{let r=i.trim();if(!r)return;let o=r.indexOf("{");if(o!==-1){let c=r.lastIndexOf("}"),l=r.slice(o+1,c===-1?void 0:c);for(let u of DMe(l))n(u);return}let s=/\bas\s+([\w*]+)\s*$/.exec(r);if(s?.[1]){t.push(s[1]);return}let a=r.split("::").pop()?.trim();if(a&&(t.push(a==="*"?"*":a),a==="self")){let c=r.split("::").slice(-2,-1)[0]?.trim();c&&t.push(c)}};return n(e),[...new Set(t.filter(i=>i!=="self"))]}function DMe(e){let t=[],n=0,i="";for(let r of e){if(r==="{"?n+=1:r==="}"&&(n-=1),r===","&&n===0){t.push(i),i="";continue}i+=r}return t.push(i),t}function OMe(e){let t=[],n=e.split(` +`);for(let i=0;io.slice(0,a+1).join("\\")).reverse()}}function zMe(e){let t=[],n=new Set,i=e.split(` +`),r=(s,a,c,l=!1)=>{let u=s.split(".")[0];if(!/^[A-Z]/.test(u)||GMe.has(u)||n.has(s))return;n.add(s);let d=s.split(".");t.push({specifier:s,packageName:u,bindings:[...new Set([a,s])],line:c,keys:d.map((p,f)=>d.slice(0,f+1).join(".")).reverse(),...l?{synthetic:!0}:{}})},o=!1;for(let s=0;s{HMe.has(l)||n.has(l)||(n.add(l),t.push({specifier:l,packageName:l,bindings:[l],line:r+1,...u?{synthetic:!0}:{}}))},a=/^\s*open\s+([A-Z][\w']*)/.exec(o);if(a?.[1]){s(a[1]);continue}let c=/^\s*module\s+[A-Z][\w']*\s*=\s*([A-Z][\w']*)/.exec(o);if(c?.[1]){s(c[1]);continue}for(let l of o.matchAll(/\b([A-Z][\w']*)\.[a-z_]/g))s(l[1],!0)}return t}var HMe=new Set(["Stdlib","List","Array","String","Bytes","Char","Int","Int32","Int64","Float","Bool","Option","Result","Hashtbl","Map","Set","Buffer","Printf","Format","Sys","Unix","Filename","Sort","Queue","Stack","Lazy","Seq","Fun","Either","Printexc","Random","Digest","Obj"]);function JMe(e){let t=e.trim();if(!t)return["*"];let n=[],i=/\bshow\s+([\w\s,]+)/.exec(t);i?.[1]&&n.push(...i[1].split(",").map(o=>o.trim()).filter(Boolean));let r=/\bas\s+(\w+)/.exec(t);return r?.[1]&&n.push(r[1]),n.length===0&&n.push("*"),[...new Set(n)]}function kf(e){return e.startsWith(".")||e.startsWith("/")||e.startsWith("#")}function _f(e){let t=e.split("/");return e.startsWith("@")?t.slice(0,2).join("/"):t[0]??e}function ZMe(e){return e.language==="typescript"||e.language==="javascript"?YMe(e.content,e.path):eLe(e.content,e.language)}function YMe(e,t){let n=[],i=e.split(` +`),r=XMe(i),o=(s,a,c,l,u,d)=>{n.push({name:s,kind:a,startLine:c,endLine:l,summary:V7(u),exported:d})};for(let s=0;s|^\s*=\s*(?:async\s*)?function\b/.test(h);o(m[1],b?"function":"variable",s+1,M7(i,s)+1,`${b?"const fn":"const"} ${m[1]}`,l);continue}let g=/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([\w$]+)/.exec(c);g&&o(g[1],"module",s+1,$f(i,s)+1,`module ${g[1]}`,l)}return n}function QMe(e,t,n,i,r){let o=0;for(let s=t;s{let a=r.slice(s+1).find(c=>c.indent<=o.indent);return{name:o.name,kind:o.kind,startLine:o.line,endLine:a?a.line-1:i.length,summary:o.summary,exported:!0}})}var tLe={python:[{pattern:/^(?:async\s+)?def\s+(\w+)\s*\(/,kind:"function"},{pattern:/^class\s+(\w+)\s*[(:]/,kind:"class"}],go:[{pattern:/^func\s+(?:\([^)]*\)\s*)?(\w+)\s*[[(]/,kind:"function"},{pattern:/^type\s+(\w+)\s+(?:struct|interface)\s*\{/,kind:"type"}],rust:[{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?fn\s+(\w+)/,kind:"function"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+(\w+)/,kind:"class"},{pattern:/^(?:pub(?:\([^)]*\))?\s+)?(?:enum|trait)\s+(\w+)/,kind:"type"},{pattern:/^impl(?:<[^>]*>)?\s+(?:\w+\s+for\s+)?(\w+)/,kind:"class"}],java:[{pattern:/^(?:public|private|protected|abstract|final|static|\s)*(?:class|interface|enum|record)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|static|final|synchronized|abstract|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],ruby:[{pattern:/^def\s+(?:self\.)?(\w+[?!=]?)/,kind:"method"},{pattern:/^(?:class|module)\s+([\w:]+)/,kind:"class"}],dotnet:[{pattern:/^(?:public|private|protected|internal|sealed|abstract|static|partial|\s)*(?:class|interface|struct|record|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public|private|protected|internal|static|virtual|override|async|sealed|\s)+[\w<>[\],.?\s]+\s+(\w+)\s*\(/,kind:"method"}],php:[{pattern:/^(?:abstract\s+|final\s+|readonly\s+)*(?:class|interface|trait|enum)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|private\s+|protected\s+|static\s+|abstract\s+|final\s+)*function\s+&?(\w+)\s*\(/,kind:"function"}],elixir:[{pattern:/^\s*defmodule\s+([A-Z][\w.]*)/,kind:"module"},{pattern:/^\s*(?:def|defp|defmacro|defmacrop|defguard|defdelegate)\s+([a-z_]\w*[!?]?)/,kind:"function"},{pattern:/^\s*(?:defstruct|defexception|defprotocol|defimpl)\s+([A-Z][\w.]*)?/,kind:"type"}],erlang:[{pattern:/^([a-z]\w*)\s*\(.*\)\s*(?:when\b.*)?->/,kind:"function"},{pattern:/^-record\(\s*(\w+)/,kind:"type"}],swift:[{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|final\s+|@\w+\s+)*(?:class|struct|enum|protocol|actor|extension)\s+(\w+)/,kind:"class"},{pattern:/^(?:public\s+|internal\s+|private\s+|fileprivate\s+|open\s+|static\s+|final\s+|override\s+|mutating\s+|@\w+\s+)*func\s+(\w+)/,kind:"function"}],dart:[{pattern:/^(?:abstract\s+|base\s+|final\s+|sealed\s+|interface\s+)*(?:class|mixin|enum|extension)\s+(\w+)/,kind:"class"},{pattern:/^typedef\s+(\w+)/,kind:"type"}],ocaml:[{pattern:/^let\s+(?:rec\s+)?([a-z_]\w*)/,kind:"function"},{pattern:/^(?:module|module\s+type)\s+([A-Z]\w*)/,kind:"module"},{pattern:/^type\s+(?:'\w+\s+)?([a-z_]\w*)/,kind:"type"}],c:L7(),cpp:[{pattern:/^(?:template\s*<[^>]*>\s*)?(?:class|struct)\s+(?:\w+_API\s+|\w+_EXPORT\s+)?(\w+)\s*(?::|\{|$)/,kind:"class"},{pattern:/^namespace\s+(\w+)/,kind:"module"},...L7()]};function L7(){return[{pattern:/^typedef\s+(?:struct|union|enum)?\s*[\w\s*]*?(\w+)\s*;/,kind:"type"},{pattern:/^(?:typedef\s+)?(?:struct|union|enum)\s+(\w+)\s*\{?\s*$/,kind:"class"},{pattern:/^(?!(?:return|if|while|for|switch|case|else|do|sizeof|typeof|delete|throw|catch|assert)\b)(?:(?:static|extern|inline|const|constexpr|virtual|explicit|friend|unsigned|signed|struct|enum|class|\w+_API|\w+_EXPORT)\s+)*[\w:<>,\s]*?[\w>]\s*[*&\s]\s*(\w+)\s*\([^;]*\)\s*(?:const\s*)?(?:noexcept\s*)?[{;]?\s*$/,kind:"function"},{pattern:/^#\s*define\s+(\w+)\s*\(/,kind:"function"}]}function nLe(e,t,n){let i=t.filter(a=>a.exported).map(a=>a.name),r=i.slice(0,8),o=[...new Set(n.map(a=>a.packageName))].slice(0,6),s=[`${e.path} (${e.language}, ${e.lineCount} lines)`];return r.length&&s.push(`defines ${r.join(", ")}${i.length>r.length?`, +${i.length-r.length} more`:""}`),o.length&&s.push(`imports ${o.join(", ")}`),s.join(" \u2014 ")}function V7(e){return e.replace(/\s+/g," ").trim().slice(0,200)}function ZF(e,t){return`${e}|${t}`}var rLe=2e4;async function XS(e,t){let n=new Map;for(let s of e){if(!JF[s.ecosystem])continue;let a=ZF(s.ecosystem,s.name);n.has(a)||n.set(a,s)}let i=new Map;if(n.size===0)return i;let r=[...n.entries()],o=await Bn(r,t.concurrency??6,async([s,a])=>{let c=a.to??a.from;if(!c)return[s,void 0];try{let l=await mLe(`${s}|${c}`,()=>JF[a.ecosystem](a.name,c,{timeoutMs:t.timeoutMs??rLe}));return[s,l]}catch(l){return t.logger.debug(`Module map failed for ${s}: ${l.message}`),[s,void 0]}});for(let[s,a]of o)a&&a.names.length>0&&i.set(s,a);return t.logger.debug(`Resolved ${i.size} of ${n.size} module map(s) from published artefacts`),i}var iLe=async(e,t,{timeoutMs:n})=>{let r=(await _e(`https://pypi.org/pypi/${encodeURIComponent(e)}/${encodeURIComponent(t)}/json`,{timeoutMs:n,immutable:!0}))?.urls?.find(l=>l.packagetype==="bdist_wheel"&&l.url);if(!r?.url)return;let o=await Dy(r.url,n);if(!o)return;let s=o.find(l=>/(^|\/)[^/]+\.dist-info\/top_level\.txt$/.test(l.path));if(s){let l=Py(s).split(` +`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));if(l.length>0)return{names:[...new Set(l)],source:`${r.filename??"wheel"} top_level.txt`}}let a=o.find(l=>/(^|\/)[^/]+\.dist-info\/RECORD$/.test(l.path));if(!a)return;let c=new Set;for(let l of Py(a).split(` +`)){let u=l.split(",")[0]?.trim();if(!u)continue;let d=u.split("/")[0];!d||d.startsWith(".")||/\.(dist-info|data)$/.test(d)||c.add(d.endsWith(".py")?d.slice(0,-3):d)}return c.delete(""),c.size>0?{names:[...c],source:`${r.filename??"wheel"} RECORD`}:void 0},oLe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split(":");if(!i||!r)return;let s=`https://repo1.maven.org/maven2/${i.replace(/\./g,"/")}/${r}/${t}/${r}-${t}.jar`,a=await Dy(s,n);if(!a)return;let c=new Set;for(let l of a){if(!l.path.endsWith(".class")||l.path.startsWith("META-INF/"))continue;let u=l.path.split("/").slice(0,-1);u.length!==0&&c.add(u.join("."))}return c.size>0?{names:[...c],source:`${r}-${t}.jar`}:void 0},sLe=async(e,t,{timeoutMs:n})=>{let i=e.toLowerCase(),r=t.toLowerCase(),o=`https://api.nuget.org/v3-flatcontainer/${encodeURIComponent(i)}/${encodeURIComponent(r)}/${encodeURIComponent(i)}.${encodeURIComponent(r)}.nupkg`,s=await Dy(o,n);if(!s)return;let{readAssembly:a}=await Promise.resolve().then(()=>(BO(),I9)),c=new Set;for(let l of s){if(!/^lib\/.+\.dll$/i.test(l.path)&&!/^ref\/.+\.dll$/i.test(l.path))continue;let u;try{u=a(l.read())}catch{continue}for(let d of u??[]){let p=d.fullName.lastIndexOf(".");p>0&&c.add(d.fullName.slice(0,p))}if(c.size>0)break}return c.size>0?{names:[...c],source:`${e} ${t} assembly metadata`}:void 0},aLe=async(e,t,{timeoutMs:n})=>{let r=(await _e(`https://repo.packagist.org/p2/${e.toLowerCase()}.json`,{timeoutMs:n}))?.packages?.[e.toLowerCase()];if(!r?.length)return;let o=Jk(r),a=(Zk(o,t)??o[0])?.autoload??void 0,c=new Set;for(let l of[a?.["psr-4"],a?.["psr-0"]])for(let u of Object.keys(l??{})){let d=u.replace(/\\+$/,"");d&&c.add(d)}return c.size>0?{names:[...c],source:`${e} composer.json autoload`}:void 0},cLe=async(e,t,{timeoutMs:n})=>{let i=await Dy(`https://repo.hex.pm/tarballs/${encodeURIComponent(e)}-${encodeURIComponent(t)}.tar`,n);if(!i)return;let r=i.find(c=>c.path==="contents.tar.gz"||c.path.endsWith("/contents.tar.gz"));if(!r)return;let o;try{o=Ln(r.read())}catch{return}let s=new Set;for(let c of o)if(/^(lib|src)\//.test(c.path)){if(/\.(ex|exs)$/.test(c.path)){for(let l of lLe(Py(c)))s.add(l);continue}if(/\.erl$/.test(c.path)){let l=/^\s*-module\(\s*'?([a-z][\w]*)'?\s*\)/m.exec(Py(c));l?.[1]&&s.add(l[1])}}if(s.size===0)return;let a=new Set;for(let c of s)a.add(c.split(".")[0]);return{names:[...new Set([...s,...a])],source:`${e} ${t} hex tarball`}};function lLe(e){let t=[],n=[],i=!1;for(let r of e.split(` +`)){let o=(r.match(/"""/g)??[]).length;if(i){o%2===1&&(i=!1);continue}if(o%2===1){i=!0;continue}let s=/^(\s*)defmodule\s+([A-Z][\w.]*)/.exec(r);if(!s)continue;let a=s[1].length;for(;n.length>0&&n[n.length-1].indent>=a;)n.pop();let c=n[n.length-1]?.name,l=c?`${c}.${s[2]}`:s[2];n.push({indent:a,name:l}),t.push(l)}return t}var uLe=async(e,t,{timeoutMs:n})=>{let i=await Dy(`https://rubygems.org/downloads/${encodeURIComponent(e)}-${encodeURIComponent(t)}.gem`,n);if(!i)return;let r=i.find(c=>c.path==="data.tar.gz"||c.path.endsWith("/data.tar.gz"));if(!r)return;let o;try{o=Ln(r.read())}catch{return}let s=new Set,a=new Set;for(let c of o){let l=/^lib\/(.+)\.rb$/.exec(c.path);if(l?.[1]&&(s.add(l[1]),s.add(l[1].split("/")[0]),!(l[1].split("/").length>2)))for(let u of Py(c).matchAll(/^(?:module|class)\s+([A-Z][\w:]*)/gm))a.add(u[1].split("::")[0])}if(!(s.size===0&&a.size===0))return{names:[...new Set([...s,...a])],source:`${e}-${t}.gem`}},dLe=async(e,t,{timeoutMs:n})=>{let[i,r]=e.split("/");if(!(!i||!r))for(let o of[t,`v${t}`]){let s=await rt(`https://raw.githubusercontent.com/${i}/${r}/${encodeURIComponent(o)}/Package.swift`,{timeoutMs:n,immutable:!0});if(!s)continue;let a=new Set;for(let c of s.matchAll(/\.(?:library|target|executableTarget)\s*\(\s*name:\s*"([^"]+)"/g))a.add(c[1]);for(let c of s.matchAll(/targets:\s*\[([^\]]*)\]/g))for(let l of c[1].matchAll(/"([^"]+)"/g))a.add(l[1]);if(a.size>0)return{names:[...a],source:`${e}@${o} Package.swift`}}},pLe=async(e,t,{timeoutMs:n})=>{let i=await Kk(e,t,{timeoutMs:n});if(!i)return;let r=i.moduleName??(i.name??e).replace(/[-.]/g,"_");return{names:[...new Set([r,e])],source:`${e} ${t} podspec`}},JF={pypi:iLe,maven:oLe,nuget:sLe,packagist:aLe,hex:cLe,rubygems:uLe,swift:dLe,cocoapods:pLe},pyt=Object.keys(JF),fLe=64*1024*1024;async function Dy(e,t){try{let n=await Bt(e,{timeoutMs:t,retries:0,maxBytes:fLe});return n.ok?Ln(n.bytes):void 0}catch{return}}var KF=new Map,HF=new Map;function mLe(e,t){let n=KF.get(e);if(n!==void 0)return Promise.resolve(n??void 0);let i=HF.get(e);if(i)return i;let r=t().then(o=>(KF.set(e,o??null),o)).catch(()=>{KF.set(e,null)}).finally(()=>HF.delete(e));return HF.set(e,r),r}function Py(e){try{return e.read().toString("utf8")}catch{return""}}var $s=gt(Mc(),1),_n=gt(gc(),1);function gLe(e){return e.split(".").map(t=>Number.parseInt(t,10))}function xf(e,t){let n=Math.max(e.length,t.length);for(let i=0;i0}}function q7(e,t){if(!e)return t;if(!t)return e;let n=xf(e.value,t.value);return n!==0?n>0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function W7(e,t){if(!e)return t;if(!t)return e;let n=xf(e.value,t.value);return n!==0?n<0?e:t:!e.inclusive||!t.inclusive?{value:e.value,inclusive:!1}:e}function ex(e,t){return q7(e,t)}function Oy(e,t){return W7(e,t)}function K7(e){let t=e.split(",").map(o=>o.trim()).filter(Boolean);if(t.length===0)return{min:null,max:null,imprecise:!1};let n=null,i=null,r=!1;for(let o of t){let s=/^(===|~=|==|!=|<=|>=|<|>)?\s*v?(\d[\w.*]*)$/.exec(o);if(!s){r=!0;continue}let[,a,c]=s,l=!a,u=a??"==",d=hLe(c);if(d.imprecise){r=!0;continue}let{release:p,wildcard:f}=d;if(f&&u!=="=="&&u!=="!="){r=!0;continue}if(u==="~="&&p.length<2){r=!0;continue}let m=l||f;switch(u){case">=":n=ex(n,{value:p,inclusive:!0});break;case">":n=ex(n,{value:p,inclusive:!1});break;case"<=":i=Oy(i,{value:p,inclusive:!0});break;case"<":i=Oy(i,{value:p,inclusive:!1});break;case"==":n=ex(n,{value:p,inclusive:!0}),i=m?Oy(i,{value:B7(p),inclusive:!1}):Oy(i,{value:p,inclusive:!0});break;case"===":r=!0;break;case"~=":n=ex(n,{value:p,inclusive:!0}),i=Oy(i,{value:B7(p.slice(0,-1)),inclusive:!1});break;case"!=":r=!0;break;default:r=!0}}return!r&&yLe(n,i)?{min:n,max:i,imprecise:!0}:{min:n,max:i,imprecise:r}}function yLe(e,t){if(!e||!t)return!1;let n=xf(e.value,t.value);return n>0?!0:n<0?!1:!(e.inclusive&&t.inclusive)}function bLe(e,t){if(!t)return!0;if(!e)return!1;let n=xf(e.value,t.value);return n!==0?n>0:!(e.inclusive&&!t.inclusive)}function vLe(e,t){if(!t)return!0;if(!e)return!1;let n=xf(e.value,t.value);return n!==0?n<0:!(e.inclusive&&!t.inclusive)}function YF(e,t){return e.imprecise||t.imprecise?!1:bLe(e.min,t.min)&&vLe(e.max,t.max)}function QF(e,t){if(e.imprecise||t.imprecise)return!0;let n=q7(e.min,t.min),i=W7(e.max,t.max);if(!n||!i)return!0;let r=xf(n.value,i.value);return r!==0?r<0:n.inclusive&&i.inclusive}var Z7=gt(Mc(),1);var wLe=/^nightly-(\d{4}-\d{2}-\d{2})$/,kLe=/^beta-(\d{4}-\d{2}-\d{2})$/;function nx(e){let t=e.trim().replace(/^rust-/i,"");if(!t)return{kind:"unknown"};let n=wLe.exec(H7(t,"nightly"));if(n)return{kind:"dated-nightly",date:n[1]};if(kLe.test(H7(t,"beta")))return{kind:"moving-beta"};if(/^stable$/i.test(t)||/^stable-/i.test(t))return{kind:"moving-stable"};if(/^beta$/i.test(t)||/^beta-/i.test(t))return{kind:"moving-beta"};if(/^nightly$/i.test(t)||/^nightly-/i.test(t))return{kind:"moving-nightly"};let i=_Le(t);return i?{kind:"exact",version:i}:{kind:"unknown"}}function H7(e,t){let n=new RegExp(`^(${t}(?:-\\d{4}-\\d{2}-\\d{2})?)`).exec(e);return n?n[1]:e}function _Le(e){let t=e.split(/-(?=[a-z])/i)[0].trim();return Z7.default.valid(t)?t:/^\d+\.\d+$/.test(t)?`${t}.0`:null}var tx=new Map,$Le=e=>`https://static.rust-lang.org/dist/${e}/channel-rust-nightly.toml`,J7=e=>`rust-nightly-version:v1:${e}`;async function Y7(e){let t=tx.get(e);if(t)return t;let n=await Ca(J7(e));if(n?.version)return tx.set(e,n.version),n.version;let i=null;try{i=await rt($Le(e),{immutable:!0,retries:1})}catch{i=null}let r=i?SLe(i):null;return r&&(tx.set(e,r),await Na(J7(e),{version:r})),r}function Q7(e){return tx.get(e)??null}function SLe(e){let t=/\[pkg\.rust\]([\s\S]*?)(?:\n\[|$)/.exec(e);if(!t)return null;let n=/(?:^|\n)\s*version\s*=\s*"([^"]+)"/.exec(t[1]);if(!n)return null;let i=/^\d+\.\d+\.\d+/.exec(n[1].trim());return i?i[0]:null}async function XF(e){let t=new Set;for(let n of e){let i=nx(n);i.kind==="dated-nightly"&&t.add(i.date)}await Promise.all([...t].map(n=>Y7(n)))}function n1(e,t,n,i){return Tf(e,t,n,i).resolved}function Tf(e,t,n,i){let r=tFe(e,n,i),o={resolved:[],unresolved:[]};for(let{path:s,content:a}of r){if(!LP(s))continue;let c=(s.split("/").pop()??"").toLowerCase();if(xLe[t].includes(c)){ELe(s,c,a,t,o);continue}if(c===".tool-versions"){ALe(s,a,t,o);continue}if(c.startsWith("dockerfile")||c.startsWith("containerfile")){RLe(s,a,t,o);continue}if(t==="node"&&c==="package.json"){NLe(s,a,o);continue}if(t==="python"&&["pyproject.toml","setup.cfg","setup.py"].includes(c)){PLe(s,c,a,o);continue}if(t==="ruby")c==="gemfile"?DLe(s,a,o,r):c.endsWith(".gemspec")&&OLe(s,a,o);else if(t==="go"&&c==="go.mod")MLe(s,a,o);else if(t==="java")c==="pom.xml"?LLe(s,a,o):(c==="build.gradle"||c==="build.gradle.kts")&&ULe(s,a,o);else if(t==="rust"&&c==="cargo.toml"){let l=jLe(a,"rust-version");l&&er(o,t,s,l.line,l.requirement,"manifest",l.requirement)}e1(s)&&BLe(s,a,t,o,n,i)}if(n!==void 0&&(i?.length??0)>1){for(let s of o.resolved)!s.scope&&!e1(s.file)&&(s.scope=eee(s.file,n,i));for(let s of o.unresolved)!s.scope&&!e1(s.file)&&(s.scope=eee(s.file,n,i))}if(n!==void 0&&(i?.length??0)>1){let s=c=>c==="member"?2:c==="ambiguous"?0:1,a=Math.max(0,...o.resolved.map(c=>s(c.scope)),...o.unresolved.map(c=>s(c.scope)));o.resolved=o.resolved.filter(c=>s(c.scope)===a),o.unresolved=o.unresolved.filter(c=>s(c.scope)===a)}return o.resolved=YLe(o.resolved),o.unresolved=QLe(o.unresolved),o}var xLe={node:[".nvmrc",".node-version"],python:[".python-version","runtime.txt"],ruby:[".ruby-version"],rust:["rust-toolchain","rust-toolchain.toml"],go:[],java:[]};function er(e,t,n,i,r,o,s,a){s?e.resolved.push({file:n,line:i,requirement:s,...a?{scope:a}:{}}):e.unresolved.push({runtime:t,file:n,line:i,rawText:r,source:o,...a?{scope:a}:{}})}function ic(e){return/[$`%]|\{\{|\}\}/.test(e)}function ELe(e,t,n,i,r){if(t==="rust-toolchain.toml"){let a=ZLe(n,/^\s*channel\s*=\s*['"]([^'"]+)['"]/);if(!a)return;er(r,i,e,a.line,a.requirement,"version-file",rc(a.requirement));return}if(t===".python-version"){for(let[a,c]of n.split(` +`).entries()){let l=c.trim();if(!(!l||l.startsWith("#")))for(let u of l.split(/\s+/))er(r,i,e,a+1,u,"version-file",rc(u))}return}let o=n.trim().split(` +`)[0]?.trim();if(!o)return;let s=t==="runtime.txt"?o.replace(/^python-/i,"").trim():o.replace(/^(?:ruby-|go|rust-)?v?/i,"").trim();s&&er(r,i,e,1,o,"version-file",rc(s))}function rc(e){return ic(e)?null:e}function r1(e,t,n){if(e==="node")return oee(t,n);if(e==="python")return see(t,n);let i=[],r=sx(ix(e,n).text);for(let o of t){let s=ix(e,o.requirement),a=sx(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!r){i.push({...o,...c,verdict:"unknown"});continue}let l;try{$s.default.subset(a,r,{loose:!0})?l="compatible":$s.default.intersects(a,r,{loose:!0})?l="partial":l="incompatible"}catch{l="unknown"}i.push({...o,...c,verdict:l})}return i}function ix(e,t){if(e==="java")return{text:ax(t)??t};if(e==="rust"){let n=nx(t);if(n.kind==="exact")return{text:n.version,resolved:n.version};if(n.kind==="dated-nightly"){let i=Q7(n.date);return i?{text:i,resolved:i}:{text:"\0unresolved-nightly"}}return n.kind!=="unknown"?{text:"\0moving-channel"}:{text:t}}return{text:t}}function tee(e,t,n){if(e==="python")return TLe(t,n);let i=sx(ix(e,n).text),r=[];for(let o of t){let s=ix(e,o.requirement),a=sx(s.text),c=s.resolved?{resolvedRequirement:s.resolved}:{};if(!a||!i){r.push({...o,...c,verdict:"unknown"});continue}let l;try{$s.default.subset(a,i,{loose:!0})?l="incompatible":$s.default.intersects(a,i,{loose:!0})?l="partial":l="compatible"}catch{l="unknown"}r.push({...o,...c,verdict:l})}return r}function Ef(e,t="minimum"){let n=t==="unsupported"?e.replace(/\.x$/i,".*"):e;if(/^\s*(?:\^|~(?![=>]))/.test(n))return{status:"unknown",reason:"unsupported-grammar"};let i=K7(n);return i.imprecise||i.min===null&&i.max===null?{status:"unknown",reason:"unparseable"}:{status:"parsed",value:i}}function TLe(e,t){let n=Ef(t,"unsupported"),i=[];for(let r of e){let o=Ef(r.requirement),s;n.status==="unknown"||o.status==="unknown"?s="unknown":YF(o.value,n.value)?s="incompatible":QF(o.value,n.value)?s="partial":s="compatible",i.push({...r,verdict:s})}return i}var ILe={node:["node","nodejs"],python:["python","python3"],go:["go","golang"],ruby:["ruby"],java:["java"],rust:["rust"]};function ALe(e,t,n,i){for(let[r,o]of t.split(` +`).entries()){let s=/^\s*([\w-]+)\s+([^\s#]+)/.exec(o);if(!s||!ILe[n].includes(s[1].toLowerCase()))continue;let a=o.slice(s.index+s[0].length-s[2].length).split("#",1)[0].split(/\s+/).filter(Boolean);for(let c of a){let l=ic(c)||/^(?:system|path:|ref:)/i.test(c)?null:n==="java"?ax(c):c;er(i,n,e,r+1,c,"tool-versions",l)}}}function RLe(e,t,n,i){for(let[r,o]of t.split(` +`).entries()){let s=/^\s*FROM\s+(?:--platform=\S+\s+)?(\S+)/i.exec(o)?.[1];s&&nee(i,n,e,r+1,s,"container")}}function nee(e,t,n,i,r,o,s){let a=ree(r);if(!a||a.runtime!==t)return;let c=a.version;er(e,t,n,i,r,o,c&&!ic(c)?ox(c):null,s)}var CLe={node:"node",python:"python",ruby:"ruby",golang:"go",openjdk:"java","eclipse-temurin":"java",amazoncorretto:"java",rust:"rust"};function ree(e){let t=e.trim().replace(/^['"]|['"]$/g,"");if(!t||t.startsWith("$"))return null;let n=t.split("@",1)[0],i=n.lastIndexOf("/"),r=n.lastIndexOf(":"),o=r>i,s=(o?n.slice(0,r):n).split("/").at(-1)?.toLowerCase();if(!s)return null;let a=CLe[s];if(!a)return null;let c=o?n.slice(r+1):void 0;return c?{runtime:a,version:c}:{runtime:a}}function NLe(e,t,n){let i=nFe(t);i&&er(n,"node",e,t1(t,/"node"\s*:/),i.raw,"manifest",i.requirement)}function PLe(e,t,n,i){if(t==="setup.py"){let o=oFe(n);o&&er(i,"python",e,o.line,o.raw,"manifest",o.requirement);return}let r=t==="pyproject.toml"?rFe(n):t==="setup.cfg"?lFe(n):null;r&&er(i,"python",e,r.line,r.requirement,"manifest",rc(r.requirement))}function DLe(e,t,n,i){for(let[r,o]of t.split(` +`).entries()){let s=/^\s*ruby\s+(.+?)\s*(?:#.*)?$/.exec(o)?.[1]?.trim();if(!s)continue;let a=/^(['"])([^'"]+)\1/.exec(s)?.[2],c=/^file\s*:\s*(['"])([^'"]+)\1/.exec(s)?.[2];if(c){let l=i.find(u=>u.path===c||u.path.endsWith(`/${c}`));if(l){let u=l.content.trim().split(/\s+/)[0];if(u&&!ic(u))continue}}er(n,"ruby",e,r+1,s,"manifest",a?rc(a):null)}}function OLe(e,t,n){for(let[i,r]of t.split(` +`).entries()){let o=/\.required_ruby_version\s*=\s*(.+?)\s*(?:#.*)?$/.exec(r)?.[1]?.trim();if(!o)continue;let s=/^(['"])([^'"]+)\1/.exec(o)?.[2];er(n,"ruby",e,i+1,o,"manifest",s?rc(s):null)}}function MLe(e,t,n){for(let[i,r]of t.split(` +`).entries()){let o=/^\s*(go|toolchain)\s+(?:go)?(\d+(?:\.\d+){0,3})\s*(?:\/\/.*)?$/.exec(r);o?.[2]&&er(n,"go",e,i+1,o[2],"manifest",o[2])}}function LLe(e,t,n){let i=[],r=/\s*([^<]+?)\s*<\//g;for(let s of t.matchAll(r))i.push({line:t.slice(0,s.index).split(` +`).length,raw:s[1]});let o=FLe(t);for(let{line:s,raw:a}of i){if(/^\s*\$\{[^}]+\}\s*$/.test(a)&&X7(t,a))continue;let c=X7(t,a),l=c?ax(c):null;er(n,"java",e,s,a,"manifest",o?l:null)}}function FLe(e){return/\s*maven-toolchains?-plugin\s*<\/artifactId>/i.test(e)?/[\s\S]*?\s*\$\{java\.version\}\s*<\/version>[\s\S]*?<\/jdk>/i.test(e):!1}function X7(e,t){let n=/^\$\{([^}]+)\}$/.exec(t.trim())?.[1];if(!n)return ic(t)?null:t;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<${i}>\\s*([^<]+?)\\s*`).exec(e)?.[1];return r&&!ic(r)?r:null}function ULe(e,t,n){let i=[/JavaLanguageVersion\.of\(\s*([^)]+?)\s*\)/];for(let[r,o]of t.split(` +`).entries())for(let s of i){let a=s.exec(o)?.[1];a&&er(n,"java",e,r+1,a,"build-config",ic(a)?null:ax(a))}}function ax(e){let t=ox(e.replace(/_/g,"."));return t?.startsWith("1.")?t.slice(2):t}function jLe(e,t){let n=!1;for(let[i,r]of e.split(` +`).entries()){let o=/^\s*\[([^\]]+)\]\s*$/.exec(r);if(o){n=o[1]==="package";continue}if(!n)continue;let s=new RegExp(`^\\s*${t.replace("-","\\-")}\\s*=\\s*['"]([^'"]+)['"]`).exec(r);if(s?.[1])return{line:i+1,requirement:s[1]}}return null}function e1(e){return/^\.github\/workflows\/.+\.ya?ml$/i.test(e)||/^\.(?:gitlab-ci|circleci)(?:\/|\.|$)/i.test(e)}var zLe={node:"node-version",python:"python-version",ruby:"ruby-version",go:"go-version",java:"java-version",rust:"toolchain"};function GLe(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`^\\s*(?:-\\s*)?${n}\\s*:\\s*(.*?)\\s*$`,"i").exec(e);if(!i)return null;let r=i[1].replace(/\\s+#.*$/,"").trim();return{raw:/^(['"])(.*?)\1$/.exec(r)?.[2]??r}}function VLe(e){let t=Array.from({length:e.length},()=>!0),n=null,i=/(?:^\s*-\s*|:\s*)[>|](?:(?:[+-]?\d)|(?:\d[+-]?))?\s*(?:#.*)?$/;for(let[r,o]of e.entries()){let s=o.trim(),a=/^\s*/.exec(o)[0].length;if(n!==null){if(!s||a>n){t[r]=!1;continue}n=null}i.test(o)&&(n=a)}return t}function BLe(e,t,n,i,r,o){let s=t.split(` +`),a=VLe(s),{allowed:c,ambiguous:l,repositoryWide:u}=JLe(s,r,o),d=m=>l[m-1]?"ambiguous":u[m-1]?"repository":"member",p=/^\.github\/workflows\/.+\.ya?ml$/i.test(e)?KLe(t,s):null,f=(m,g,h,b)=>{er(i,n,e,m,g,h,l[m-1]?null:b,d(m))};for(let[m,g]of s.entries()){if(!a[m]||!c[m]||p?.insideMatrix(m))continue;let h=GLe(g,zLe[n]);if(h){let w=h.raw,k=p&&WLe(w),$=p&&k?p.resolve(m,k):null;if($?.ok)for(let S of $.values)f(S.line,S.value,"ci",ox(S.value));else f(m+1,w,"ci",ic(w)?null:ox(w))}if(/^\.github\/workflows\//i.test(e)){let w=/^\s*container\s*:\s*['"]?([^'"\s#]+)/i.exec(g)?.[1];if(w&&rx(i,n,e,m+1,w,"ci",l,d(m+1)),/^\s*container\s*:\s*$/i.test(g)){let k=/^\s*/.exec(g)[0].length;for(let $=m+1;$/^[ \t]*/.exec(l)[0].length,n=l=>!l.trim()||/^\s*#/.test(l),i=e.findIndex(l=>/^[ \t]*jobs:\s*(#.*)?$/.test(l));if(i===-1)return null;let r=t(e[i]),o=null,s=[],a=[],c=e.length;for(let l=i+1;l({name:a[u],start:l,end:u+10||!(0,_n.isMap)(n.contents))return null;let i=iee(t);if(!i)return null;let r=[];for(let a of i){let c=n.getIn(["jobs",a.name,"strategy","matrix"],!0);c?.range&&r.push([e.slice(0,c.range[0]).split(` `).length,e.slice(0,c.range[2]).split(` -`).length])}let o=new Map;return{resolve:(a,c)=>{let l=i.find(p=>a>=p.start&&a{let c=a+1;return r.some(([l,u])=>c>=l&&c<=u)}}}function zLe(e,t,n,i){let r=e.getIn(["jobs",n,"strategy","matrix"],!0);if(!(0,_n.isMap)(r))return{ok:!1};let o=g=>{let h=g?.range;return h?t.slice(0,h[0]).split(` -`).length:1},s=g=>{if(!(0,_n.isScalar)(g))return null;let h=g.value;if(typeof h!="string"&&typeof h!="number"&&typeof h!="boolean")return null;let b=String(h);return/\$\{\{/.test(b)?null:{value:b,line:o(g)}},a=[],c=new Map;for(let g of r.items){let h=(0,_n.isScalar)(g.key)?String(g.key.value):null;if(h===null||h==="include"||h==="exclude")continue;if(a.push(h),(0,_n.isScalar)(g.value)){let y=s(g.value);if(!y)return{ok:!1};c.set(h,[y]);continue}if(!(0,_n.isSeq)(g.value))return{ok:!1};let b=[];for(let y of g.value.items){let w=s(y);if(!w)return{ok:!1};b.push(w)}c.set(h,b)}let l=a.length>0?[new Map]:[];for(let g of a){let h=[];for(let b of l)for(let y of c.get(g)??[]){let w=new Map(b);w.set(g,y),h.push(w)}l=h}let u=new Set(a),d=r.get("exclude",!0);if(r.has("exclude")&&!(0,_n.isSeq)(d))return{ok:!1};if((0,_n.isSeq)(d))for(let g of d.items){if(!(0,_n.isMap)(g))return{ok:!1};let h=[];for(let b of g.items){let y=(0,_n.isScalar)(b.key)?String(b.key.value):null,w=s(b.value);if(y===null||!w)return{ok:!1};h.push({k:y,value:w.value})}l=l.filter(b=>!h.every(y=>b.get(y.k)?.value===y.value))}let p=r.get("include",!0);if(r.has("include")&&!(0,_n.isSeq)(p))return{ok:!1};if((0,_n.isSeq)(p)){let g=l.slice();for(let h of p.items){if(!(0,_n.isMap)(h))return{ok:!1};let b=[];for(let w of h.items){let k=(0,_n.isScalar)(w.key)?String(w.key.value):null;if(k===null)return{ok:!1};let _=s(w.value);if(!_){if(k===i||u.has(k))return{ok:!1};continue}b.push({k,value:_.value,line:_.line})}let y=!1;for(let w of g)if(!b.some(_=>u.has(_.k)&&w.has(_.k)&&w.get(_.k).value!==_.value)){for(let _ of b)w.set(_.k,{value:_.value,line:_.line});y=!0}y||l.push(new Map(b.map(w=>[w.k,{value:w.value,line:w.line}])))}}if(l.length===0)return{ok:!1};let f=[],m=new Set;for(let g of l){let h=g.get(i);if(!h)return{ok:!1};m.has(h.value)||(m.add(h.value),f.push({value:h.value,line:h.line}))}return{ok:!0,values:f}}function GLe(e,t,n){let i=Array.from({length:e.length},()=>!0),r=Array.from({length:e.length},()=>!1),o=Array.from({length:e.length},()=>!0);if(t===void 0)return{allowed:i,ambiguous:r,repositoryWide:o};let s=(n?.length??0)>1,a=()=>(s&&(r.fill(!0),o.fill(!1)),{allowed:i,ambiguous:r,repositoryWide:o}),c=T=>/^[ \t]*/.exec(T)[0].length,l=Q7(e);if(!l)return a();o.fill(!1);let u=t.replace(/\\/g,"/"),d=0,p=u.length;for(;dd&&u[p-1]==="/";)p--;let f=u.slice(d,p),m=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=f?new RegExp(m,"i"):null,h=/(?:working-directory\s*:|paths(?!-ignore)\s*:)/i,b=/paths-ignore\s*:/i,y=f?new RegExp(`(?:working-directory|paths(?!-ignore)|run)\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,w=f?new RegExp(`paths-ignore\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,k=/^([ \t]*)(?:-\s*)?paths(?!-ignore)\s*:\s*(#.*)?$/i,_=/^([ \t]*)(?:-\s*)?paths-ignore\s*:\s*(#.*)?$/i,S=(T,A)=>{if(!g)return!1;let L=T.split(` -`);for(let F=0;F(y?.test(T)??!1)||S(T,k),E=T=>(w?.test(T)??!1)||S(T,_);i.fill(!1);for(let T of l){let A=e.slice(T.start,T.end).join(` -`);if(!(b.test(A)&&E(A))){if(h.test(A)){if(x(A))for(let L=T.start;L{let i=`${n.file}:${n.line}:${n.requirement}`;return t.has(i)?!1:(t.add(i),!0)})}function qLe(e){let t=new Set;return e.filter(n=>{let i=`${n.file}:${n.line}:${n.rawText}`;return t.has(i)?!1:(t.add(i),!0)})}function Tf(e,t,n){return KF(e,"node",t,n)}var WLe=new Set(["package.json","pyproject.toml","setup.cfg","setup.py","gemfile","go.mod","pom.xml","build.gradle","build.gradle.kts","cargo.toml"]),HLe=new Set([".nvmrc",".node-version",".ruby-version",".python-version","runtime.txt",".tool-versions","rust-toolchain","rust-toolchain.toml"]);function K7(e,t,n){return t===void 0||(n?.length??0)<=1?"repository":Fc(e,n??[])===t?"member":"repository"}function KLe(e,t,n){if(t===void 0)return e;let i=n??[],r=s=>(s.split("/").pop()??"").toLowerCase(),o=new Set(e.filter(s=>HLe.has(r(s.path))&&Fc(s.path,i)===t).map(s=>r(s.path)));return e.filter(s=>{let a=Fc(s.path,i);if(a===t)return!0;let c=r(s.path);return o.has(c)?!1:a===null?!0:a===""?!WLe.has(c)&&!c.endsWith(".gemspec"):!1})}function JLe(e){try{let t=JSON.parse(e);if(!t.engines||!Object.prototype.hasOwnProperty.call(t.engines,"node"))return null;let n=t.engines.node;return typeof n=="string"?{raw:n,requirement:rc(n)}:{raw:JSON.stringify(n),requirement:null}}catch{return null}}function HF(e,t){let n=e.split(` -`).findIndex(i=>t.test(i));return n>=0?n+1:1}function X7(e,t){let n=[];for(let i of e){if(!_s.default.validRange(i.requirement,{loose:!0})){n.push({...i,verdict:"unknown"});continue}let r;try{_s.default.subset(i.requirement,t,{loose:!0})?r="compatible":_s.default.intersects(i.requirement,t,{loose:!0})?r="partial":r="incompatible"}catch{r="unknown"}n.push({...i,verdict:r})}return n}function If(e,t,n){return KF(e,"python",t,n)}function ZLe(e){let t=e.split(` -`),n=!1;for(let i=0;i{let l=i.find(p=>a>=p.start&&a{let c=a+1;return r.some(([l,u])=>c>=l&&c<=u)}}}function HLe(e,t,n,i){let r=e.getIn(["jobs",n,"strategy","matrix"],!0);if(!(0,_n.isMap)(r))return{ok:!1};let o=g=>{let h=g?.range;return h?t.slice(0,h[0]).split(` +`).length:1},s=g=>{if(!(0,_n.isScalar)(g))return null;let h=g.value;if(typeof h!="string"&&typeof h!="number"&&typeof h!="boolean")return null;let b=String(h);return/\$\{\{/.test(b)?null:{value:b,line:o(g)}},a=[],c=new Map;for(let g of r.items){let h=(0,_n.isScalar)(g.key)?String(g.key.value):null;if(h===null||h==="include"||h==="exclude")continue;if(a.push(h),(0,_n.isScalar)(g.value)){let y=s(g.value);if(!y)return{ok:!1};c.set(h,[y]);continue}if(!(0,_n.isSeq)(g.value))return{ok:!1};let b=[];for(let y of g.value.items){let w=s(y);if(!w)return{ok:!1};b.push(w)}c.set(h,b)}let l=a.length>0?[new Map]:[];for(let g of a){let h=[];for(let b of l)for(let y of c.get(g)??[]){let w=new Map(b);w.set(g,y),h.push(w)}l=h}let u=new Set(a),d=r.get("exclude",!0);if(r.has("exclude")&&!(0,_n.isSeq)(d))return{ok:!1};if((0,_n.isSeq)(d))for(let g of d.items){if(!(0,_n.isMap)(g))return{ok:!1};let h=[];for(let b of g.items){let y=(0,_n.isScalar)(b.key)?String(b.key.value):null,w=s(b.value);if(y===null||!w)return{ok:!1};h.push({k:y,value:w.value})}l=l.filter(b=>!h.every(y=>b.get(y.k)?.value===y.value))}let p=r.get("include",!0);if(r.has("include")&&!(0,_n.isSeq)(p))return{ok:!1};if((0,_n.isSeq)(p)){let g=l.slice();for(let h of p.items){if(!(0,_n.isMap)(h))return{ok:!1};let b=[];for(let w of h.items){let k=(0,_n.isScalar)(w.key)?String(w.key.value):null;if(k===null)return{ok:!1};let $=s(w.value);if(!$){if(k===i||u.has(k))return{ok:!1};continue}b.push({k,value:$.value,line:$.line})}let y=!1;for(let w of g)if(!b.some($=>u.has($.k)&&w.has($.k)&&w.get($.k).value!==$.value)){for(let $ of b)w.set($.k,{value:$.value,line:$.line});y=!0}y||l.push(new Map(b.map(w=>[w.k,{value:w.value,line:w.line}])))}}if(l.length===0)return{ok:!1};let f=[],m=new Set;for(let g of l){let h=g.get(i);if(!h)return{ok:!1};m.has(h.value)||(m.add(h.value),f.push({value:h.value,line:h.line}))}return{ok:!0,values:f}}function JLe(e,t,n){let i=Array.from({length:e.length},()=>!0),r=Array.from({length:e.length},()=>!1),o=Array.from({length:e.length},()=>!0);if(t===void 0)return{allowed:i,ambiguous:r,repositoryWide:o};let s=(n?.length??0)>1,a=()=>(s&&(r.fill(!0),o.fill(!1)),{allowed:i,ambiguous:r,repositoryWide:o}),c=T=>/^[ \t]*/.exec(T)[0].length,l=iee(e);if(!l)return a();o.fill(!1);let u=t.replace(/\\/g,"/"),d=0,p=u.length;for(;dd&&u[p-1]==="/";)p--;let f=u.slice(d,p),m=f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=f?new RegExp(m,"i"):null,h=/(?:working-directory\s*:|paths(?!-ignore)\s*:)/i,b=/paths-ignore\s*:/i,y=f?new RegExp(`(?:working-directory|paths(?!-ignore)|run)\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,w=f?new RegExp(`paths-ignore\\s*:[^\\n]*${m}(?:[/\\s"']|$)`,"i"):null,k=/^([ \t]*)(?:-\s*)?paths(?!-ignore)\s*:\s*(#.*)?$/i,$=/^([ \t]*)(?:-\s*)?paths-ignore\s*:\s*(#.*)?$/i,S=(T,A)=>{if(!g)return!1;let L=T.split(` +`);for(let F=0;F(y?.test(T)??!1)||S(T,k),E=T=>(w?.test(T)??!1)||S(T,$);i.fill(!1);for(let T of l){let A=e.slice(T.start,T.end).join(` +`);if(!(b.test(A)&&E(A))){if(h.test(A)){if(x(A))for(let L=T.start;L{let i=`${n.file}:${n.line}:${n.requirement}`;return t.has(i)?!1:(t.add(i),!0)})}function QLe(e){let t=new Set;return e.filter(n=>{let i=`${n.file}:${n.line}:${n.rawText}`;return t.has(i)?!1:(t.add(i),!0)})}function If(e,t,n){return n1(e,"node",t,n)}var XLe=new Set(["package.json","pyproject.toml","setup.cfg","setup.py","gemfile","go.mod","pom.xml","build.gradle","build.gradle.kts","cargo.toml"]),eFe=new Set([".nvmrc",".node-version",".ruby-version",".python-version","runtime.txt",".tool-versions","rust-toolchain","rust-toolchain.toml"]);function eee(e,t,n){return t===void 0||(n?.length??0)<=1?"repository":jc(e,n??[])===t?"member":"repository"}function tFe(e,t,n){if(t===void 0)return e;let i=n??[],r=s=>(s.split("/").pop()??"").toLowerCase(),o=new Set(e.filter(s=>eFe.has(r(s.path))&&jc(s.path,i)===t).map(s=>r(s.path)));return e.filter(s=>{let a=jc(s.path,i);if(a===t)return!0;let c=r(s.path);return o.has(c)?!1:a===null?!0:a===""?!XLe.has(c)&&!c.endsWith(".gemspec"):!1})}function nFe(e){try{let t=JSON.parse(e);if(!t.engines||!Object.prototype.hasOwnProperty.call(t.engines,"node"))return null;let n=t.engines.node;return typeof n=="string"?{raw:n,requirement:rc(n)}:{raw:JSON.stringify(n),requirement:null}}catch{return null}}function t1(e,t){let n=e.split(` +`).findIndex(i=>t.test(i));return n>=0?n+1:1}function oee(e,t){let n=[];for(let i of e){if(!$s.default.validRange(i.requirement,{loose:!0})){n.push({...i,verdict:"unknown"});continue}let r;try{$s.default.subset(i.requirement,t,{loose:!0})?r="compatible":$s.default.intersects(i.requirement,t,{loose:!0})?r="partial":r="incompatible"}catch{r="unknown"}n.push({...i,verdict:r})}return n}function Af(e,t,n){return n1(e,"python",t,n)}function rFe(e){let t=e.split(` +`),n=!1;for(let i=0;i/^\s*#/.test(s)?"":s).join(` -`),i=[...t.matchAll(YLe)].at(-1);if(!i)return null;let r=i.index+i[0].length-1,o=eFe(t,r);return o===null?null:t.slice(r,o+1)}function eFe(e,t){let n=0,i=t;for(;io.kind==="runtime-requirement"&&o.runtime?.runtime),i=new Set(n.map(o=>o.id)),r=new Map;for(let o of t){if(!i.has(o.changeId))continue;let s=r.get(o.changeId);s?s.push(o):r.set(o.changeId,[o])}return n.map(o=>{let s=r.get(o.id)??[];if(s.length===1&&s[0].runtime===o.runtime?.runtime)return s[0];let a=o.runtime?.runtime;return a?{changeId:o.id,runtime:a,requirement:o.runtime?.requirement??"",state:"unknown",reason:"not-analyzed",declarations:[],unresolved:[],sites:[],statement:`Drift could not complete runtime compatibility analysis for this ${a} requirement.`}:s[0]})}function ZF(e,t,n,i){let r=e.runtime;if(!r?.runtime||!r.requirement)return null;let o=r.runtime,s=o==="python"?xf(r.requirement,r.kind==="unsupported-runtime-range"?"unsupported":"minimum"):null;if(r.rangeParseStatus==="unknown"||s?.status==="unknown")return{changeId:e.id,runtime:o,requirement:r.requirement,state:"unknown",reason:"unparseable",declarations:[],unresolved:[],sites:[],statement:`${nee(r)}; Drift could not interpret that version range for ${YF[o]}, so it could not determine compatibility.`};let a=Ef(t,o,n,i),c=r.kind==="unsupported-runtime-range"?J7(o,a.resolved,r.requirement):JF(o,a.resolved,r.requirement),l=rFe(c,a.unresolved),u=iFe(l,c,a.unresolved);return{changeId:e.id,runtime:o,requirement:r.requirement,state:l,reason:u,declarations:c,unresolved:a.unresolved,sites:oFe(e,o,c,a.unresolved,t),statement:sFe(r,o,l,u,c,a.unresolved)}}function rFe(e,t){return e.some(n=>n.verdict==="incompatible")?"incompatible":e.some(n=>n.verdict==="partial")?"partial":e.some(n=>n.verdict==="unknown")||t.length>0?"unknown":e.length>0?"compatible":"unknown"}function iFe(e,t,n){return e==="incompatible"?"violates":e==="partial"?"overlaps":e==="compatible"?"satisfies":t.some(i=>i.verdict==="unknown")?"unparseable":n.length>0?"dynamic":"no-declaration"}function oFe(e,t,n,i,r){let o=(c,l)=>r.find(u=>u.path===c)?.content.split(` -`)[l-1]?.trim().slice(0,200)??"",s=new Map,a=c=>{let l=`${c.file}:${c.line}`,u=s.get(l);(!u||tee(c.runtimeVerdict)>tee(u.runtimeVerdict))&&s.set(l,c)};for(let c of n)c.verdict!=="compatible"&&a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:c.verdict==="unknown"?"low":"high",runtimeVerdict:c.verdict,siteKind:"runtime-declaration"});for(let c of i)a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:"low",runtimeVerdict:"unknown",siteKind:"runtime-declaration"});return[...s.values()]}function tee(e){return e==="incompatible"?3:e==="partial"?2:1}var YF={node:"Node",python:"Python",ruby:"Ruby",go:"Go",java:"Java",rust:"Rust"};function nee(e){let t=YF[e.runtime];return e.kind==="minimum-runtime"?`Upstream requires ${t} ${e.requirement}`:`Upstream no longer supports ${t} ${e.requirement}`}function sFe(e,t,n,i,r,o){let s=YF[t],a=nee(e),c=l=>[...new Set(l.map(u=>`${u.requirement} in ${u.file}`))].join(", ");if(n==="compatible")return`${a}; this repository declares ${s} ${c(r)}, which satisfies it.`;if(n==="incompatible"){let l=r.filter(u=>u.verdict==="incompatible");return`${a}; this repository declares ${s} ${c(l)}.`}if(n==="partial"){let l=r.filter(u=>u.verdict==="partial");return`${a}; this repository allows ${c(l)}, so its declared range includes versions this requirement rejects.`}if(i==="dynamic")return`${a}; ${cFe(o)} ${o.length===1?"declares":"declare"} ${s} through a dynamic value, so Drift could not determine compatibility.`;if(i==="unparseable"){let l=r.filter(u=>u.verdict==="unknown");return`${a}; this repository's ${s} declaration (${c(l)}) is not a version range Drift could evaluate, so it could not determine compatibility.`}return i==="not-analyzed"?`${a}; Drift did not complete localization, so runtime compatibility remains unknown.`:`${a}; Drift could not find an authoritative ${s} version declaration for this workspace.`}var aFe={"version-file":"a version file",manifest:"the package manifest",container:"a container image",ci:"CI configuration","tool-versions":"`.tool-versions`","build-config":"the build configuration"};function cFe(e){let t=[...new Set(e.map(n=>`${aFe[n.source]} (${n.file})`))];return t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`}function QF(e){return!e||e.length===0?void 0:["incompatible","partial","unknown","compatible"].find(n=>e.some(i=>i.state===n))}function XF(e){return e==="unknown"||e==="partial"}function nx(e,t,n,i,r){let{logger:o,maxSitesPerChange:s=100,member:a,members:c,moduleMaps:l,maxReExportDepth:u=3}=r,d=new Map(i.map(w=>[w.path,w.content])),p=new Map(n.files.map(w=>[w.path,w])),f=new Map;for(let w of t){let k=f.get(w.name);k?k.includes(w.ecosystem)||k.push(w.ecosystem):f.set(w.name,[w.ecosystem])}let m=[],g=[],h=new Map,b=(w,k)=>{let _=h.get(w.dependency)??{dependency:w.dependency,ecosystem:(f.get(w.dependency)??[])[0]??"npm",importerCandidateFiles:0,changesSearched:0,sitesFound:0};k.importerCandidateFiles!==void 0&&(_.importerCandidateFiles=Math.max(_.importerCandidateFiles,k.importerCandidateFiles)),k.searched&&(_.changesSearched+=1),k.sitesFound&&(_.sitesFound+=k.sitesFound),_.importerCandidateFiles=Math.max(_.importerCandidateFiles,_.sitesFound),h.set(w.dependency,_)},y=new Map;for(let w of e){if(w.kind==="runtime-requirement"){let L=mFe(w,d,a,c);L&&(g.push(L),m.push(...L.sites));continue}if(w.kind==="module-system-change"){let L=fFe(lFe(w,n,d,f.get(w.dependency)??[],l),a);m.push(...L),b(w,{searched:!0,sitesFound:L.length});continue}let k=w.kind==="removed-endpoint"||w.kind==="changed-endpoint",_=k?void 0:y.get(w.dependency),{files:S,names:x,reach:E}=_??hFe(w,n,f.get(w.dependency)??[],l,u,p);!k&&!_&&y.set(w.dependency,{files:S,names:x,reach:E});let T=S.filter(L=>a===void 0||xP(L.path,a));if(b(w,{importerCandidateFiles:T.length,searched:!0}),T.length===0){o.debug(`No importers found for ${w.dependency}; ${w.id} has no impact sites`);continue}let A=_Fe(w,T,d,p,s,x,E);m.push(...A),b(w,{sitesFound:A.length}),A.length>=s&&o.warn(`${w.dependency}: ${w.summary} matched at least ${s} locations; the plan lists the first ${s}.`)}return{sites:m,runtimeAnalyses:g,diagnostics:[...h.values()]}}function lFe(e,t,n,i,r){let o=e.moduleSystem?.incompatibleUsage??[];if(o.length===0)return[];let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,{names:c,exact:l}=lee(e.dependency,i,r),u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(eu(p,c))for(let m of f)u.add(m)}let d=[];for(let p of t.files){if(!u.has(p.path))continue;let f=n.get(p.path);if(!f)continue;let m=f.split(` -`);for(let g of p.imports){if(!eu(g,c)||!uFe(g.specifier,s,a)||!pFe(g,o))continue;let h=m[g.line-1]??"",b=FF(p,g.line),y=h.indexOf(g.specifier);d.push({breakingChangeId:e.id,file:p.path,line:g.line,excerpt:h.trim().slice(0,200),enclosingSymbol:b?.name,matchedSymbol:g.loadStyle==="commonjs-require"?"require":g.specifier,...y>=0?{column:y,matchedText:g.specifier}:{},confidence:"high"})}}return gee(d)}function uFe(e,t,n){return!t?.length&&!n?.length||t?.includes(e)?!0:n?.some(i=>dFe(e,i))??!1}function dFe(e,t){if([...t.matchAll(/\*/g)].length!==1)return!1;let[i,r]=t.split("*");return!e.startsWith(i)||!e.endsWith(r)?!1:e.length>i.length+r.length}function pFe(e,t){switch(e.loadStyle){case"commonjs-require":return t.includes("require");case"esm-static":return t.includes("static-import");case"esm-dynamic":return t.includes("dynamic-import");case"re-export":return t.includes("re-export");default:return!1}}function fFe(e,t){return t===void 0?[...e]:e.filter(n=>xP(n.file,t))}function mFe(e,t,n,i){let r=[...t].map(([o,s])=>({path:o,content:s}));return ZF(e,r,n,i)}function gFe(e){let t=new Set;for(let n of e){let i=n.trim(),r=i.search(/[(<]/),o=r===-1?i:i.slice(0,r);if(!o.includes("."))continue;let s=o.split(".").filter(Boolean),a=-1;for(let c=s.length-1;c>=0;c--)if(/^[A-Z]/.test(s[c])){a=c;break}a<1||(t.add(s.slice(0,a+1).join(".")),t.add(s.slice(0,a).join(".")))}return[...t].filter(Boolean)}function hFe(e,t,n,i,r,o){if(e.kind==="removed-endpoint"||e.kind==="changed-endpoint")return{files:t.files,names:[],reach:new Map};let a=lee(e.dependency,n,i),c=n.includes("maven")?[...new Set([...a.names,...gFe(e.symbols)])]:a.names,l=a.exact,u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(eu(p,c))for(let m of f)u.add(m)}let d=new Map;for(let p of u)d.set(p,{direct:!0,inherited:new Set});return r>0&&yFe(t,c,d,r,o),{files:t.files.filter(p=>d.has(p.path)),names:c,reach:d}}function lee(e,t,n){let i=new Set;for(let o of t){let s=n?.get(GF(o,e));for(let a of s?.names??[])i.add(a)}return i.size>0?{names:[...new Set([...i,e])],exact:!0}:{names:t.length>0?[...new Set(t.flatMap(o=>iee(e,o)))]:iee(e,void 0),exact:!1}}function yFe(e,t,n,i,r){let o=[...n.keys()].filter(s=>vFe(r.get(s),t));for(let s=0;s0;s++){let a=[];for(let c of o)for(let l of e.localImporters.get(c)??[]){if(n.size>=bFe)return;let u=n.get(l.from);if(u){for(let d of l.bindings)u.inherited.add(d);continue}n.set(l.from,{direct:!1,inherited:new Set(l.bindings)}),l.reExport&&a.push(l.from)}o=a}}var bFe=400;function vFe(e,t){return e?e.imports.some(n=>n.reExport===!0&&(t.length===0||eu(n,t))):!1}function eu(e,t){return(typeof e=="string"?[e]:qS(e)).some(i=>t.some(r=>ree(i,r)||ree(r,i)))}function ree(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;let n=e[t.length];return n==="/"||n==="."||n===":"||n==="\\"}function iee(e,t){let n=new Set([e]);switch(t){case"pypi":{let i=e.toLowerCase().replace(/-/g,"_");n.add(i);let r=kFe[e.toLowerCase()];r&&n.add(r);break}case"maven":{let[i]=e.split(":");i&&n.add(i);break}case"cargo":n.add(e.replace(/-/g,"_"));break;case"conan":case"vcpkg":case"arduino":{let i=e.toLowerCase();n.add(i),n.add(i.replace(/[-_]/g,"")),n.add(i.replace(/[-_]/g,"/"));let r=wFe[i];r&&n.add(r),i.startsWith("lib")&&i.length>4&&n.add(i.slice(3));break}case"packagist":{let[i,r]=e.split("/");i&&r&&(n.add(`${Xl(i)}\\${Xl(r)}`),n.add(Xl(i)));break}case"hex":{n.add(Xl(e)),n.add(e.toLowerCase());break}case"swift":{let i=e.split("/").pop()??e;n.add(i),n.add(Xl(i)),i.toLowerCase().startsWith("swift-")&&n.add(Xl(i.slice(6)));break}case"cocoapods":n.add(e.replace(/[-.]/g,"_"));break;case"opam":n.add(Xl(e.replace(/\./g,"_"))),n.add(uee(e.replace(/\./g,"_")));break;default:break}return[...n]}function Xl(e){return e.split(/[-_.]/).filter(Boolean).map(t=>uee(t)).join("")}function uee(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}var wFe={nlohmann_json:"nlohmann","libjpeg-turbo":"jpeglib",libxml2:"libxml",sdl:"sdl2",protobuf:"google",grpc:"grpcpp",abseil:"absl","ms-gsl":"gsl",gtest:"gtest"},kFe={beautifulsoup4:"bs4",pillow:"PIL",pyyaml:"yaml","python-dateutil":"dateutil","msgpack-python":"msgpack",attrs:"attr","scikit-learn":"sklearn","opencv-python":"cv2","python-dotenv":"dotenv",protobuf:"google","google-cloud-storage":"google","psycopg2-binary":"psycopg2",mysqlclient:"MySQLdb","django-cors-headers":"corsheaders",djangorestframework:"rest_framework","pytest-cov":"pytest_cov","typing-extensions":"typing_extensions"},oee=new WeakMap;function $Fe(e,t){let n=oee.get(e);if(n)return n;let i=t.split(` -`),r,o,s={lines:i,withStrings:()=>r??=cee(i,{blankStrings:!1}),withoutStrings:()=>o??=cee(i,{blankStrings:!0})};return oee.set(e,s),s}function _Fe(e,t,n,i,r,o,s){let a=[];for(let c of t){if(a.length>=r)break;let l=n.get(c.path);if(!l)continue;let u=i.get(c.path),d=o.length===0?c.imports:c.imports.filter(A=>eu(A,o)),p=new Set(d.flatMap(A=>A.bindings)),f=d.length>0,m=s.get(c.path),g=m!==void 0&&!m.direct,h=new Set(c.imports.filter(A=>!eu(A,o)).flatMap(A=>A.bindings).filter(A=>A!=="*")),b=new Set(c.units.filter(A=>A.kind!=="method").map(A=>A.name)),y=new Set(c.units.filter(A=>A.kind==="method").map(A=>A.name.split(".").pop()??A.name)),w=new Map;for(let A of c.units){if(A.kind==="variable")continue;let L=A.name.split(".").pop()??A.name,F=w.get(A.startLine)??new Set;F.add(A.name),F.add(L),w.set(A.startLine,F)}let k=FFe.has(c.language)&&f&&!g&&d.every(A=>A.synthetic!==!0&&!A.bindings.includes("*")),_=new Set(c.imports.filter(A=>A.synthetic!==!0).map(A=>A.line)),S=SFe(e.kind),x=xFe(e.kind)&&EFe(c.language),E=$Fe(c,l),{lines:T}=E;for(let A of e.symbols){let L=zFe(e,A),F=L?BFe(L,d,l,m?.inherited):new Set,K=L?qFe(l,F):new Set,te=new Set([...F,...K]),D=L?GFe(e,A,d):p.has(A),X=L?VFe(e,A,o):!1,re=x?IFe(A):pee(A);if(!re||jFe(A,p,h)||WFe(A,p,b))continue;let ie=see(A),ke=ie?E.withStrings():E.withoutStrings(),We=S||ie;for(let ye=0;yeF.has(sn)));if(!Mt&&!vt)continue;zn=vt}if(!Ci&&Cn!==void 0&&LFe.has(Cn)||!Ci&&Cn!==void 0&&y.has(A)||w.get(ye+1)?.has(A))continue;let Pi=p.has(A)||p.has(A.split(".")[0]??A)||p.has("*"),fe=!A.includes(".")&&!see(A);if(k&&fe&&!Pi&&!Ci&&!zn||x&&AFe(e,ke,ye,pt))continue;let ae=u?FF(u,ye+1):void 0,be=Cn!==void 0&&!Ci&&!zn;a.push({breakingChangeId:e.id,file:c.path,line:ye+1,excerpt:xt.trim().slice(0,200),enclosingSymbol:ae?.name,matchedSymbol:A,...pt?{column:pt.index,matchedText:pt[0]}:{},confidence:HFe(A,p,f,g,m?.inherited,be,zn)})}}}return gee(a)}function SFe(e){return e==="removed-export"||e==="renamed-export"||e==="moved-export"||e==="unknown"}function xFe(e){return e==="signature-change"}function EFe(e){return!TFe.has(e)}var TFe=new Set(["ruby","elixir","erlang","ocaml","other","config"]);function IFe(e){let t=e.trim();if(!t||t.length<2)return null;if(t.startsWith("/")||t.startsWith("@"))return pee(t);let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)"),i=/^\w/.test(t)?"\\b":"(?)?";return new RegExp(`(?:new\\s+)?${i}${n}${r}\\s*\\(|(?1&&(o=!0);continue}if(l===")"||l==="]"||l==="}"){if(i-=1,i<0)return null;if(i===0)return l!==")"?null:o?r+1:0;continue}if(i===1&&l===","){r+=1,o=!0;continue}if(l==="`")return null;/\s/.test(l)||(o=!0)}}return null}var NFe=200;function CFe(e,t,n){if(n===void 0||!/^\s*\(/.test(n))return!1;let i=e.trim(),r=i.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&"),o=/^\w/.test(i)?"\\b":"(?)\s*$/:/([A-Za-z_$][\w$]*)\s*(?:\.|::)\s*$/,r=[],o=e.slice(0,t);for(let s=0;s<8;s++){let a=i.exec(o);if(!a)break;r.unshift(a[1]),o=o.slice(0,a.index)}return r.length>0?r:void 0}function MFe(e,t,n){if(n!=="c"&&n!=="cpp")return!1;let i=e.slice(0,t).trim(),r=e.slice(t);return!i||!/^\w+\s*\(/.test(r)||/(?:\.|::|->)\s*$/.test(i)||/^(?:return|co_return|throw|case|delete|new)$/.test(i)?!1:/^(?:(?:virtual|static|inline|constexpr|consteval|constinit|explicit|friend|extern)\s+)*(?:const\s+)?(?:(?:unsigned|signed|long|short)\s+)*[\w:<>]+(?:\s*[*&])?$/.test(i)}var LFe=new Set(["this","$this","self","Self","super","cls","me"]),FFe=new Set(["typescript","javascript","python","go","rust","java"]);function UFe(e,t,n){return n!=="elixir"&&n!=="erlang"&&n!=="ruby"?!1:e[t-1]===":"&&e[t-2]!==":"}function jFe(e,t,n){let i=e.split(".")[0]??e;return t.has(e)||t.has(i)||t.has("*")?!1:n.has(e)||n.has(i)}function pee(e){let t=e.trim();if(!t||t.length<2)return null;let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)");if(t.startsWith("/"))return new RegExp(n);let i=/^\w/.test(t)?"\\b":"(?=2)return i.at(-2)}}function mee(e,t){return e.symbols.filter(n=>n===t||!n.includes(".")&&!n.includes("::")?!1:n.split(/[.:]+/).filter(Boolean).at(-1)===t)}function Ay(e){return e.replace(/^@/,"").replace(/::|[\\/]/g,".").replace(/\.+/g,".").replace(/^\.|\.$/g,"").toLowerCase()}function GFe(e,t,n){for(let i of mee(e,t)){let r=i.split(/[.:]+/).filter(Boolean),o=Ay(r.slice(0,-1).join("."));if(o)for(let s of n){if(!s.bindings.includes(t))continue;if(new Set([s.specifier,s.packageName,...qS(s)].map(Ay)).has(o))return!0;for(let c of[Ay(s.specifier)]){if(!o.startsWith(`${c}.`))continue;if(o.slice(c.length+1).split(".").every(u=>/^[a-z_][a-z0-9_]*$/.test(u)))return!0}}}return!1}function VFe(e,t,n){let i=new Set(n.map(Ay));return mee(e,t).some(r=>{let o=r.split(/[.:]+/).filter(Boolean);return i.has(Ay(o.slice(0,-1).join(".")))})}function BFe(e,t,n,i){let r=new Set;i?.has(e)&&r.add(e);let o=n.split(` -`);for(let s of t){(s.bindings.includes(e)||s.bindings.includes("*"))&&r.add(e),e==="default"&&s.defaultBinding&&r.add(s.defaultBinding);let a=e.includes("."),c=e.split(".").pop();a&&c&&(s.specifier===e&&r.add(c),s.bindings.includes("*")&&e.startsWith(`${s.specifier}.`)&&r.add(c));let l=o[s.line-1]??"",u=new RegExp(`\\b${fee(e)}\\s+as\\s+([A-Za-z_$][\\w$]*)`).exec(l)?.[1];u&&r.add(u)}return r}function qFe(e,t){let n=new Set;for(let i of t){let r=fee(i),o=[new RegExp(`\\b(?:const|let|var|val|final|auto|let(?:\\s+mut)?)\\s+([A-Za-z_$][\\w$]*)\\s*(?::\\s*[^=]+)?=\\s*(?:new\\s+)?${r}(?:::new)?\\s*[({]`,"g"),new RegExp(`\\b(?:new\\s+)?${r}\\s*\\(.*?\\)\\s*as\\s+([A-Za-z_$][\\w$]*)`,"g"),new RegExp(`^\\s*([A-Za-z_$][\\w$]*)\\s*=\\s*${r}\\s*\\(`,"gm"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${r}\\s*\\(`,"g"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*${r}::new\\s*\\(`,"g"),new RegExp(`(?)?(?:\\s*\\[\\])?\\s+([A-Za-z_$][\\w$]*)\\s*(?:[({;=,)]|:(?!:))`,"g"),new RegExp(`([A-Za-z_$][\\w$]*)\\s*:\\s*(?:readonly\\s+)?${r}\\b(?!\\s*\\.)`,"g")];for(let s of o)for(let a of e.matchAll(s))a[1]&&n.add(a[1])}return n}function see(e){let t=e.trim();return t.startsWith("/")||t.startsWith("@")||t.includes("/")}function WFe(e,t,n){if(t.has(e)||t.has("*"))return!1;let i=e.split(".")[0]??e;return t.has(i)?!1:n.has(e)||e!==i&&n.has(i)}function HFe(e,t,n,i,r,o,s=!1){let a=e.split(".")[0]??e;return i?r&&(r.has(e)||r.has(a))?"medium":"low":t.has(e)||t.has(a)||t.has("*")||s?"high":o?"low":n?"medium":"low"}function gee(e){let t=new Map;for(let n of e){let i=`${n.breakingChangeId}|${n.file}|${n.line}`,r=t.get(i);(!r||aee(n.confidence)>aee(r.confidence))&&t.set(i,n)}return[...t.values()].sort((n,i)=>n.file.localeCompare(i.file)||n.line-i.line)}function aee(e){return e==="high"?2:e==="medium"?1:0}function KFe(e){let t=e.trim();return t.startsWith("#")?!JFe.test(t):t.startsWith("%")||t.startsWith("(*")?!0:t.startsWith("//")||t.startsWith("*")||t.startsWith("/*")}var JFe=/^#\s*(include|define|undef|if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\b/;function cee(e,t){let n=[],i=!1,r=null;for(let o of e){let s="",a=0,c=null;for(;ah.has(b.line-1)).length)}return c.length===0?null:{transform:{ruleId:"rename-identifier",from:r,to:o,anchors:l},edits:c,sitesResolved:u}}function YFe(e,t,n){let i=e.replacementSymbols?.[0];if(!i||!rx.test(i))return null;let o=e.symbols.find(d=>/^[\w$]+\.[\w$]+$/.test(d))?.split(".")[1];if(!o||!rx.test(o)||o===i)return null;let s=e.dependency,a=[],c=[],l=0,u=new Map;for(let d of t)u.set(d.file,[...u.get(d.file)??[],d]);for(let[d,p]of u){let f=n.get(d);if(f===void 0)continue;let m=yee(f,s,o,i);if(m){a.push({file:d,before:f,after:m.content});for(let g of m.touched)c.push({file:d,line:g.text,lineNumber:g.number});l+=p.filter(g=>m.touched.some(h=>h.number===g.line)).length}}return a.length===0||l===0?null:{transform:{ruleId:"namespace-member-to-named-import",from:o,to:i,packageName:s,anchors:c},edits:a,sitesResolved:l}}var QFe=e=>{let t=ro(e);return[new RegExp(`^(\\s*)import\\s+(?:\\*\\s+as\\s+)?([A-Za-z_$][\\w$]*)\\s+from\\s+(['"\`])${t}\\3(\\s*;?)\\s*$`),new RegExp(`^(\\s*)(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\(\\s*(['"\`])${t}\\3\\s*\\)(\\s*;?)\\s*$`)]};function yee(e,t,n,i){let r=e.split(` -`),o=QFe(t),s=-1,a="",c="";for(let[f,m]of r.entries()){for(let[g,h]of o.entries()){let b=h.exec(m);if(!b)continue;s=f,a=b[2];let[y,,,w,k]=[b[1],b[2],"",b[3],b[4]??""];c=g===0?`${y}import { ${i} } from ${w}${t}${w}${k}`:`${y}const { ${i} } = require(${w}${t}${w})${k}`;break}if(s>=0)break}if(s<0||!a)return null;let l=new RegExp(`(?r.file===n))return e;let i=yee(e,t.packageName,t.from,t.to);return i?i.content:e}default:return e}}function XFe(e,t,n,i,r){let o=i.filter(u=>u.file===r);if(o.length===0)return e;let s=e.split(` -`),a=new Map;for(let u of s)a.set(u,(a.get(u)??0)+1);let c=new Set;for(let u of o){let d=u.lineNumber-1;if(s[d]===u.line){c.add(d);continue}if((a.get(u.line)??0)===1){let p=s.indexOf(u.line);p!==-1&&c.add(p)}}if(c.size===0)return e;let l=new RegExp(`(?c.has(d)?vee(u,l,n):u).join(` -`)}function vee(e,t,n){return t1(e,t,n)}function wee(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return"proven";case"insert-argument":case"wrap-call":return"checked"}}var e1e={type:"array",minItems:1,maxItems:8,items:{type:"object",oneOf:[{type:"object",properties:{kind:{const:"rename-identifier"},from:{type:"string",description:"The old bare identifier, exactly as it appears in code."},to:{type:"string",description:"The new bare identifier."}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"rename-member"},from:{type:"string",description:"The old member name, without the dot or the receiver."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"replace-import-path"},from:{type:"string",description:"The old module specifier, exactly as written between the quotes."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"insert-argument"},callee:{type:"string",description:"The function being called, e.g. `connect` or `client.connect`."},index:{type:"integer",minimum:0,maximum:8,description:"0-based position in the argument list."},text:{type:"string",description:"A literal only: a quoted string, a number, a boolean, null, or a flat object literal. Never a function call or an expression."}},required:["kind","callee","index","text"],additionalProperties:!1},{type:"object",properties:{kind:{const:"wrap-call"},callee:{type:"string"},wrapper:{type:"string",enum:["await","new"]}},required:["kind","callee","wrapper"],additionalProperties:!1}]}},t1e={type:"object",properties:{applicable:{type:"boolean",description:"False when this migration cannot be expressed as the listed operations. Answering false is correct and common."},migration:{type:"string",description:"One sentence stating the migration, for a human reviewer."},rationale:{type:"string",description:"Why this is the correct fix, quoting the evidence. Two sentences at most."},citations:{type:"array",items:{type:"string"},description:"Ids of the evidence blocks that state this replacement. Copy them exactly."},ops:e1e},required:["applicable","migration","rationale","citations","ops"],additionalProperties:!1},n1e=`You write migration rules for an automated refactoring tool. +`),i=[...t.matchAll(iFe)].at(-1);if(!i)return null;let r=i.index+i[0].length-1,o=aFe(t,r);return o===null?null:t.slice(r,o+1)}function aFe(e,t){let n=0,i=t;for(;io.kind==="runtime-requirement"&&o.runtime?.runtime),i=new Set(n.map(o=>o.id)),r=new Map;for(let o of t){if(!i.has(o.changeId))continue;let s=r.get(o.changeId);s?s.push(o):r.set(o.changeId,[o])}return n.map(o=>{let s=r.get(o.id)??[];if(s.length===1&&s[0].runtime===o.runtime?.runtime)return s[0];let a=o.runtime?.runtime;return a?{changeId:o.id,runtime:a,requirement:o.runtime?.requirement??"",state:"unknown",reason:"not-analyzed",declarations:[],unresolved:[],sites:[],statement:`Drift could not complete runtime compatibility analysis for this ${a} requirement.`}:s[0]})}function i1(e,t,n,i){let r=e.runtime;if(!r?.runtime||!r.requirement)return null;let o=r.runtime,s=o==="python"?Ef(r.requirement,r.kind==="unsupported-runtime-range"?"unsupported":"minimum"):null;if(r.rangeParseStatus==="unknown"||s?.status==="unknown")return{changeId:e.id,runtime:o,requirement:r.requirement,state:"unknown",reason:"unparseable",declarations:[],unresolved:[],sites:[],statement:`${cee(r)}; Drift could not interpret that version range for ${o1[o]}, so it could not determine compatibility.`};let a=Tf(t,o,n,i),c=r.kind==="unsupported-runtime-range"?tee(o,a.resolved,r.requirement):r1(o,a.resolved,r.requirement),l=uFe(c,a.unresolved),u=dFe(l,c,a.unresolved);return{changeId:e.id,runtime:o,requirement:r.requirement,state:l,reason:u,declarations:c,unresolved:a.unresolved,sites:pFe(e,o,c,a.unresolved,t),statement:fFe(r,o,l,u,c,a.unresolved)}}function uFe(e,t){return e.some(n=>n.verdict==="incompatible")?"incompatible":e.some(n=>n.verdict==="partial")?"partial":e.some(n=>n.verdict==="unknown")||t.length>0?"unknown":e.length>0?"compatible":"unknown"}function dFe(e,t,n){return e==="incompatible"?"violates":e==="partial"?"overlaps":e==="compatible"?"satisfies":t.some(i=>i.verdict==="unknown")?"unparseable":n.length>0?"dynamic":"no-declaration"}function pFe(e,t,n,i,r){let o=(c,l)=>r.find(u=>u.path===c)?.content.split(` +`)[l-1]?.trim().slice(0,200)??"",s=new Map,a=c=>{let l=`${c.file}:${c.line}`,u=s.get(l);(!u||aee(c.runtimeVerdict)>aee(u.runtimeVerdict))&&s.set(l,c)};for(let c of n)c.verdict!=="compatible"&&a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:c.verdict==="unknown"?"low":"high",runtimeVerdict:c.verdict,siteKind:"runtime-declaration"});for(let c of i)a({breakingChangeId:e.id,file:c.file,line:c.line,excerpt:o(c.file,c.line),matchedSymbol:t,confidence:"low",runtimeVerdict:"unknown",siteKind:"runtime-declaration"});return[...s.values()]}function aee(e){return e==="incompatible"?3:e==="partial"?2:1}var o1={node:"Node",python:"Python",ruby:"Ruby",go:"Go",java:"Java",rust:"Rust"};function cee(e){let t=o1[e.runtime];return e.kind==="minimum-runtime"?`Upstream requires ${t} ${e.requirement}`:`Upstream no longer supports ${t} ${e.requirement}`}function fFe(e,t,n,i,r,o){let s=o1[t],a=cee(e),c=l=>[...new Set(l.map(u=>`${u.requirement} in ${u.file}`))].join(", ");if(n==="compatible")return`${a}; this repository declares ${s} ${c(r)}, which satisfies it.`;if(n==="incompatible"){let l=r.filter(u=>u.verdict==="incompatible");return`${a}; this repository declares ${s} ${c(l)}.`}if(n==="partial"){let l=r.filter(u=>u.verdict==="partial");return`${a}; this repository allows ${c(l)}, so its declared range includes versions this requirement rejects.`}if(i==="dynamic")return`${a}; ${gFe(o)} ${o.length===1?"declares":"declare"} ${s} through a dynamic value, so Drift could not determine compatibility.`;if(i==="unparseable"){let l=r.filter(u=>u.verdict==="unknown");return`${a}; this repository's ${s} declaration (${c(l)}) is not a version range Drift could evaluate, so it could not determine compatibility.`}return i==="not-analyzed"?`${a}; Drift did not complete localization, so runtime compatibility remains unknown.`:`${a}; Drift could not find an authoritative ${s} version declaration for this workspace.`}var mFe={"version-file":"a version file",manifest:"the package manifest",container:"a container image",ci:"CI configuration","tool-versions":"`.tool-versions`","build-config":"the build configuration"};function gFe(e){let t=[...new Set(e.map(n=>`${mFe[n.source]} (${n.file})`))];return t.length===1?t[0]:`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`}function s1(e){return!e||e.length===0?void 0:["incompatible","partial","unknown","compatible"].find(n=>e.some(i=>i.state===n))}function a1(e){return e==="unknown"||e==="partial"}function lx(e,t,n,i,r){let{logger:o,maxSitesPerChange:s=100,member:a,members:c,moduleMaps:l,maxReExportDepth:u=3}=r,d=new Map(i.map(w=>[w.path,w.content])),p=new Map(n.files.map(w=>[w.path,w])),f=new Map;for(let w of t){let k=f.get(w.name);k?k.includes(w.ecosystem)||k.push(w.ecosystem):f.set(w.name,[w.ecosystem])}let m=[],g=[],h=new Map,b=(w,k)=>{let $=h.get(w.dependency)??{dependency:w.dependency,ecosystem:(f.get(w.dependency)??[])[0]??"npm",importerCandidateFiles:0,changesSearched:0,sitesFound:0};k.importerCandidateFiles!==void 0&&($.importerCandidateFiles=Math.max($.importerCandidateFiles,k.importerCandidateFiles)),k.searched&&($.changesSearched+=1),k.sitesFound&&($.sitesFound+=k.sitesFound),$.importerCandidateFiles=Math.max($.importerCandidateFiles,$.sitesFound),h.set(w.dependency,$)},y=new Map;for(let w of e){if(w.kind==="runtime-requirement"){let L=kFe(w,d,a,c);L&&(g.push(L),m.push(...L.sites));continue}if(w.kind==="module-system-change"){let L=wFe(hFe(w,n,d,f.get(w.dependency)??[],l),a);m.push(...L),b(w,{searched:!0,sitesFound:L.length});continue}let k=w.kind==="removed-endpoint"||w.kind==="changed-endpoint",$=k?void 0:y.get(w.dependency),{files:S,names:x,reach:E}=$??$Fe(w,n,f.get(w.dependency)??[],l,u,p);!k&&!$&&y.set(w.dependency,{files:S,names:x,reach:E});let T=S.filter(L=>a===void 0||PP(L.path,a));if(b(w,{importerCandidateFiles:T.length,searched:!0}),T.length===0){o.debug(`No importers found for ${w.dependency}; ${w.id} has no impact sites`);continue}let A=RFe(w,T,d,p,s,x,E);m.push(...A),b(w,{sitesFound:A.length}),A.length>=s&&o.warn(`${w.dependency}: ${w.summary} matched at least ${s} locations; the plan lists the first ${s}.`)}return{sites:m,runtimeAnalyses:g,diagnostics:[...h.values()]}}function hFe(e,t,n,i,r){let o=e.moduleSystem?.incompatibleUsage??[];if(o.length===0)return[];let s=e.moduleSystem?.affectedSpecifiers,a=e.moduleSystem?.affectedSpecifierPatterns,{names:c,exact:l}=gee(e.dependency,i,r),u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(nu(p,c))for(let m of f)u.add(m)}let d=[];for(let p of t.files){if(!u.has(p.path))continue;let f=n.get(p.path);if(!f)continue;let m=f.split(` +`);for(let g of p.imports){if(!nu(g,c)||!yFe(g.specifier,s,a)||!vFe(g,o))continue;let h=m[g.line-1]??"",b=WF(p,g.line),y=h.indexOf(g.specifier);d.push({breakingChangeId:e.id,file:p.path,line:g.line,excerpt:h.trim().slice(0,200),enclosingSymbol:b?.name,matchedSymbol:g.loadStyle==="commonjs-require"?"require":g.specifier,...y>=0?{column:y,matchedText:g.specifier}:{},confidence:"high"})}}return kee(d)}function yFe(e,t,n){return!t?.length&&!n?.length||t?.includes(e)?!0:n?.some(i=>bFe(e,i))??!1}function bFe(e,t){if([...t.matchAll(/\*/g)].length!==1)return!1;let[i,r]=t.split("*");return!e.startsWith(i)||!e.endsWith(r)?!1:e.length>i.length+r.length}function vFe(e,t){switch(e.loadStyle){case"commonjs-require":return t.includes("require");case"esm-static":return t.includes("static-import");case"esm-dynamic":return t.includes("dynamic-import");case"re-export":return t.includes("re-export");default:return!1}}function wFe(e,t){return t===void 0?[...e]:e.filter(n=>PP(n.file,t))}function kFe(e,t,n,i){let r=[...t].map(([o,s])=>({path:o,content:s}));return i1(e,r,n,i)}function _Fe(e){let t=new Set;for(let n of e){let i=n.trim(),r=i.search(/[(<]/),o=r===-1?i:i.slice(0,r);if(!o.includes("."))continue;let s=o.split(".").filter(Boolean),a=-1;for(let c=s.length-1;c>=0;c--)if(/^[A-Z]/.test(s[c])){a=c;break}a<1||(t.add(s.slice(0,a+1).join(".")),t.add(s.slice(0,a).join(".")))}return[...t].filter(Boolean)}function $Fe(e,t,n,i,r,o){if(e.kind==="removed-endpoint"||e.kind==="changed-endpoint")return{files:t.files,names:[],reach:new Map};let a=gee(e.dependency,n,i),c=n.includes("maven")?[...new Set([...a.names,..._Fe(e.symbols)])]:a.names,l=a.exact,u=new Set;for(let p of c)for(let f of t.importers.get(p)??[])u.add(f);if(u.size===0&&!l){for(let[p,f]of t.importers)if(nu(p,c))for(let m of f)u.add(m)}let d=new Map;for(let p of u)d.set(p,{direct:!0,inherited:new Set});return r>0&&SFe(t,c,d,r,o),{files:t.files.filter(p=>d.has(p.path)),names:c,reach:d}}function gee(e,t,n){let i=new Set;for(let o of t){let s=n?.get(ZF(o,e));for(let a of s?.names??[])i.add(a)}return i.size>0?{names:[...new Set([...i,e])],exact:!0}:{names:t.length>0?[...new Set(t.flatMap(o=>uee(e,o)))]:uee(e,void 0),exact:!1}}function SFe(e,t,n,i,r){let o=[...n.keys()].filter(s=>EFe(r.get(s),t));for(let s=0;s0;s++){let a=[];for(let c of o)for(let l of e.localImporters.get(c)??[]){if(n.size>=xFe)return;let u=n.get(l.from);if(u){for(let d of l.bindings)u.inherited.add(d);continue}n.set(l.from,{direct:!1,inherited:new Set(l.bindings)}),l.reExport&&a.push(l.from)}o=a}}var xFe=400;function EFe(e,t){return e?e.imports.some(n=>n.reExport===!0&&(t.length===0||nu(n,t))):!1}function nu(e,t){return(typeof e=="string"?[e]:QS(e)).some(i=>t.some(r=>lee(i,r)||lee(r,i)))}function lee(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;let n=e[t.length];return n==="/"||n==="."||n===":"||n==="\\"}function uee(e,t){let n=new Set([e]);switch(t){case"pypi":{let i=e.toLowerCase().replace(/-/g,"_");n.add(i);let r=IFe[e.toLowerCase()];r&&n.add(r);break}case"maven":{let[i]=e.split(":");i&&n.add(i);break}case"cargo":n.add(e.replace(/-/g,"_"));break;case"conan":case"vcpkg":case"arduino":{let i=e.toLowerCase();n.add(i),n.add(i.replace(/[-_]/g,"")),n.add(i.replace(/[-_]/g,"/"));let r=TFe[i];r&&n.add(r),i.startsWith("lib")&&i.length>4&&n.add(i.slice(3));break}case"packagist":{let[i,r]=e.split("/");i&&r&&(n.add(`${tu(i)}\\${tu(r)}`),n.add(tu(i)));break}case"hex":{n.add(tu(e)),n.add(e.toLowerCase());break}case"swift":{let i=e.split("/").pop()??e;n.add(i),n.add(tu(i)),i.toLowerCase().startsWith("swift-")&&n.add(tu(i.slice(6)));break}case"cocoapods":n.add(e.replace(/[-.]/g,"_"));break;case"opam":n.add(tu(e.replace(/\./g,"_"))),n.add(hee(e.replace(/\./g,"_")));break;default:break}return[...n]}function tu(e){return e.split(/[-_.]/).filter(Boolean).map(t=>hee(t)).join("")}function hee(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}var TFe={nlohmann_json:"nlohmann","libjpeg-turbo":"jpeglib",libxml2:"libxml",sdl:"sdl2",protobuf:"google",grpc:"grpcpp",abseil:"absl","ms-gsl":"gsl",gtest:"gtest"},IFe={beautifulsoup4:"bs4",pillow:"PIL",pyyaml:"yaml","python-dateutil":"dateutil","msgpack-python":"msgpack",attrs:"attr","scikit-learn":"sklearn","opencv-python":"cv2","python-dotenv":"dotenv",protobuf:"google","google-cloud-storage":"google","psycopg2-binary":"psycopg2",mysqlclient:"MySQLdb","django-cors-headers":"corsheaders",djangorestframework:"rest_framework","pytest-cov":"pytest_cov","typing-extensions":"typing_extensions"},dee=new WeakMap;function AFe(e,t){let n=dee.get(e);if(n)return n;let i=t.split(` +`),r,o,s={lines:i,withStrings:()=>r??=mee(i,{blankStrings:!1}),withoutStrings:()=>o??=mee(i,{blankStrings:!0})};return dee.set(e,s),s}function RFe(e,t,n,i,r,o,s){let a=[];for(let c of t){if(a.length>=r)break;let l=n.get(c.path);if(!l)continue;let u=i.get(c.path),d=o.length===0?c.imports:c.imports.filter(A=>nu(A,o)),p=new Set(d.flatMap(A=>A.bindings)),f=d.length>0,m=s.get(c.path),g=m!==void 0&&!m.direct,h=new Set(c.imports.filter(A=>!nu(A,o)).flatMap(A=>A.bindings).filter(A=>A!=="*")),b=new Set(c.units.filter(A=>A.kind!=="method").map(A=>A.name)),y=new Set(c.units.filter(A=>A.kind==="method").map(A=>A.name.split(".").pop()??A.name)),w=new Map;for(let A of c.units){if(A.kind==="variable")continue;let L=A.name.split(".").pop()??A.name,F=w.get(A.startLine)??new Set;F.add(A.name),F.add(L),w.set(A.startLine,F)}let k=qFe.has(c.language)&&f&&!g&&d.every(A=>A.synthetic!==!0&&!A.bindings.includes("*")),$=new Set(c.imports.filter(A=>A.synthetic!==!0).map(A=>A.line)),S=CFe(e.kind),x=NFe(e.kind)&&PFe(c.language),E=AFe(c,l),{lines:T}=E;for(let A of e.symbols){let L=HFe(e,A),F=L?YFe(L,d,l,m?.inherited):new Set,H=L?QFe(l,F):new Set,te=new Set([...F,...H]),D=L?JFe(e,A,d):p.has(A),X=L?ZFe(e,A,o):!1,re=x?OFe(A):bee(A);if(!re||KFe(A,p,h)||XFe(A,p,b))continue;let ie=pee(A),ke=ie?E.withStrings():E.withoutStrings(),We=S||ie;for(let ye=0;yeF.has(on)));if(!Mt&&!vt)continue;jn=vt}if(!Ni&&Rn!==void 0&&BFe.has(Rn)||!Ni&&Rn!==void 0&&y.has(A)||w.get(ye+1)?.has(A))continue;let Pi=p.has(A)||p.has(A.split(".")[0]??A)||p.has("*"),fe=!A.includes(".")&&!pee(A);if(k&&fe&&!Pi&&!Ni&&!jn||x&&MFe(e,ke,ye,pt))continue;let ae=u?WF(u,ye+1):void 0,be=Rn!==void 0&&!Ni&&!jn;a.push({breakingChangeId:e.id,file:c.path,line:ye+1,excerpt:xt.trim().slice(0,200),enclosingSymbol:ae?.name,matchedSymbol:A,...pt?{column:pt.index,matchedText:pt[0]}:{},confidence:e1e(A,p,f,g,m?.inherited,be,jn)})}}}return kee(a)}function CFe(e){return e==="removed-export"||e==="renamed-export"||e==="moved-export"||e==="unknown"}function NFe(e){return e==="signature-change"}function PFe(e){return!DFe.has(e)}var DFe=new Set(["ruby","elixir","erlang","ocaml","other","config"]);function OFe(e){let t=e.trim();if(!t||t.length<2)return null;if(t.startsWith("/")||t.startsWith("@"))return bee(t);let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)"),i=/^\w/.test(t)?"\\b":"(?)?";return new RegExp(`(?:new\\s+)?${i}${n}${r}\\s*\\(|(?1&&(o=!0);continue}if(l===")"||l==="]"||l==="}"){if(i-=1,i<0)return null;if(i===0)return l!==")"?null:o?r+1:0;continue}if(i===1&&l===","){r+=1,o=!0;continue}if(l==="`")return null;/\s/.test(l)||(o=!0)}}return null}var FFe=200;function UFe(e,t,n){if(n===void 0||!/^\s*\(/.test(n))return!1;let i=e.trim(),r=i.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&"),o=/^\w/.test(i)?"\\b":"(?)\s*$/:/([A-Za-z_$][\w$]*)\s*(?:\.|::)\s*$/,r=[],o=e.slice(0,t);for(let s=0;s<8;s++){let a=i.exec(o);if(!a)break;r.unshift(a[1]),o=o.slice(0,a.index)}return r.length>0?r:void 0}function VFe(e,t,n){if(n!=="c"&&n!=="cpp")return!1;let i=e.slice(0,t).trim(),r=e.slice(t);return!i||!/^\w+\s*\(/.test(r)||/(?:\.|::|->)\s*$/.test(i)||/^(?:return|co_return|throw|case|delete|new)$/.test(i)?!1:/^(?:(?:virtual|static|inline|constexpr|consteval|constinit|explicit|friend|extern)\s+)*(?:const\s+)?(?:(?:unsigned|signed|long|short)\s+)*[\w:<>]+(?:\s*[*&])?$/.test(i)}var BFe=new Set(["this","$this","self","Self","super","cls","me"]),qFe=new Set(["typescript","javascript","python","go","rust","java"]);function WFe(e,t,n){return n!=="elixir"&&n!=="erlang"&&n!=="ruby"?!1:e[t-1]===":"&&e[t-2]!==":"}function KFe(e,t,n){let i=e.split(".")[0]??e;return t.has(e)||t.has(i)||t.has("*")?!1:n.has(e)||n.has(i)}function bee(e){let t=e.trim();if(!t||t.length<2)return null;let n=t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&").replace(/\\\./g,"(?:\\.|::)");if(t.startsWith("/"))return new RegExp(n);let i=/^\w/.test(t)?"\\b":"(?=2)return i.at(-2)}}function wee(e,t){return e.symbols.filter(n=>n===t||!n.includes(".")&&!n.includes("::")?!1:n.split(/[.:]+/).filter(Boolean).at(-1)===t)}function My(e){return e.replace(/^@/,"").replace(/::|[\\/]/g,".").replace(/\.+/g,".").replace(/^\.|\.$/g,"").toLowerCase()}function JFe(e,t,n){for(let i of wee(e,t)){let r=i.split(/[.:]+/).filter(Boolean),o=My(r.slice(0,-1).join("."));if(o)for(let s of n){if(!s.bindings.includes(t))continue;if(new Set([s.specifier,s.packageName,...QS(s)].map(My)).has(o))return!0;for(let c of[My(s.specifier)]){if(!o.startsWith(`${c}.`))continue;if(o.slice(c.length+1).split(".").every(u=>/^[a-z_][a-z0-9_]*$/.test(u)))return!0}}}return!1}function ZFe(e,t,n){let i=new Set(n.map(My));return wee(e,t).some(r=>{let o=r.split(/[.:]+/).filter(Boolean);return i.has(My(o.slice(0,-1).join(".")))})}function YFe(e,t,n,i){let r=new Set;i?.has(e)&&r.add(e);let o=n.split(` +`);for(let s of t){(s.bindings.includes(e)||s.bindings.includes("*"))&&r.add(e),e==="default"&&s.defaultBinding&&r.add(s.defaultBinding);let a=e.includes("."),c=e.split(".").pop();a&&c&&(s.specifier===e&&r.add(c),s.bindings.includes("*")&&e.startsWith(`${s.specifier}.`)&&r.add(c));let l=o[s.line-1]??"",u=new RegExp(`\\b${vee(e)}\\s+as\\s+([A-Za-z_$][\\w$]*)`).exec(l)?.[1];u&&r.add(u)}return r}function QFe(e,t){let n=new Set;for(let i of t){let r=vee(i),o=[new RegExp(`\\b(?:const|let|var|val|final|auto|let(?:\\s+mut)?)\\s+([A-Za-z_$][\\w$]*)\\s*(?::\\s*[^=]+)?=\\s*(?:new\\s+)?${r}(?:::new)?\\s*[({]`,"g"),new RegExp(`\\b(?:new\\s+)?${r}\\s*\\(.*?\\)\\s*as\\s+([A-Za-z_$][\\w$]*)`,"g"),new RegExp(`^\\s*([A-Za-z_$][\\w$]*)\\s*=\\s*${r}\\s*\\(`,"gm"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${r}\\s*\\(`,"g"),new RegExp(`\\b([A-Za-z_$][\\w$]*)\\s*=\\s*${r}::new\\s*\\(`,"g"),new RegExp(`(?)?(?:\\s*\\[\\])?\\s+([A-Za-z_$][\\w$]*)\\s*(?:[({;=,)]|:(?!:))`,"g"),new RegExp(`([A-Za-z_$][\\w$]*)\\s*:\\s*(?:readonly\\s+)?${r}\\b(?!\\s*\\.)`,"g")];for(let s of o)for(let a of e.matchAll(s))a[1]&&n.add(a[1])}return n}function pee(e){let t=e.trim();return t.startsWith("/")||t.startsWith("@")||t.includes("/")}function XFe(e,t,n){if(t.has(e)||t.has("*"))return!1;let i=e.split(".")[0]??e;return t.has(i)?!1:n.has(e)||e!==i&&n.has(i)}function e1e(e,t,n,i,r,o,s=!1){let a=e.split(".")[0]??e;return i?r&&(r.has(e)||r.has(a))?"medium":"low":t.has(e)||t.has(a)||t.has("*")||s?"high":o?"low":n?"medium":"low"}function kee(e){let t=new Map;for(let n of e){let i=`${n.breakingChangeId}|${n.file}|${n.line}`,r=t.get(i);(!r||fee(n.confidence)>fee(r.confidence))&&t.set(i,n)}return[...t.values()].sort((n,i)=>n.file.localeCompare(i.file)||n.line-i.line)}function fee(e){return e==="high"?2:e==="medium"?1:0}function t1e(e){let t=e.trim();return t.startsWith("#")?!n1e.test(t):t.startsWith("%")||t.startsWith("(*")?!0:t.startsWith("//")||t.startsWith("*")||t.startsWith("/*")}var n1e=/^#\s*(include|define|undef|if|ifdef|ifndef|elif|else|endif|pragma|error|warning|line)\b/;function mee(e,t){let n=[],i=!1,r=null;for(let o of e){let s="",a=0,c=null;for(;ah.has(b.line-1)).length)}return c.length===0?null:{transform:{ruleId:"rename-identifier",from:r,to:o,anchors:l},edits:c,sitesResolved:u}}function i1e(e,t,n){let i=e.replacementSymbols?.[0];if(!i||!ux.test(i))return null;let o=e.symbols.find(d=>/^[\w$]+\.[\w$]+$/.test(d))?.split(".")[1];if(!o||!ux.test(o)||o===i)return null;let s=e.dependency,a=[],c=[],l=0,u=new Map;for(let d of t)u.set(d.file,[...u.get(d.file)??[],d]);for(let[d,p]of u){let f=n.get(d);if(f===void 0)continue;let m=$ee(f,s,o,i);if(m){a.push({file:d,before:f,after:m.content});for(let g of m.touched)c.push({file:d,line:g.text,lineNumber:g.number});l+=p.filter(g=>m.touched.some(h=>h.number===g.line)).length}}return a.length===0||l===0?null:{transform:{ruleId:"namespace-member-to-named-import",from:o,to:i,packageName:s,anchors:c},edits:a,sitesResolved:l}}var o1e=e=>{let t=ro(e);return[new RegExp(`^(\\s*)import\\s+(?:\\*\\s+as\\s+)?([A-Za-z_$][\\w$]*)\\s+from\\s+(['"\`])${t}\\3(\\s*;?)\\s*$`),new RegExp(`^(\\s*)(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\(\\s*(['"\`])${t}\\3\\s*\\)(\\s*;?)\\s*$`)]};function $ee(e,t,n,i){let r=e.split(` +`),o=o1e(t),s=-1,a="",c="";for(let[f,m]of r.entries()){for(let[g,h]of o.entries()){let b=h.exec(m);if(!b)continue;s=f,a=b[2];let[y,,,w,k]=[b[1],b[2],"",b[3],b[4]??""];c=g===0?`${y}import { ${i} } from ${w}${t}${w}${k}`:`${y}const { ${i} } = require(${w}${t}${w})${k}`;break}if(s>=0)break}if(s<0||!a)return null;let l=new RegExp(`(?r.file===n))return e;let i=$ee(e,t.packageName,t.from,t.to);return i?i.content:e}default:return e}}function s1e(e,t,n,i,r){let o=i.filter(u=>u.file===r);if(o.length===0)return e;let s=e.split(` +`),a=new Map;for(let u of s)a.set(u,(a.get(u)??0)+1);let c=new Set;for(let u of o){let d=u.lineNumber-1;if(s[d]===u.line){c.add(d);continue}if((a.get(u.line)??0)===1){let p=s.indexOf(u.line);p!==-1&&c.add(p)}}if(c.size===0)return e;let l=new RegExp(`(?c.has(d)?xee(u,l,n):u).join(` +`)}function xee(e,t,n){return l1(e,t,n)}function Eee(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return"proven";case"insert-argument":case"wrap-call":return"checked"}}var a1e={type:"array",minItems:1,maxItems:8,items:{type:"object",oneOf:[{type:"object",properties:{kind:{const:"rename-identifier"},from:{type:"string",description:"The old bare identifier, exactly as it appears in code."},to:{type:"string",description:"The new bare identifier."}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"rename-member"},from:{type:"string",description:"The old member name, without the dot or the receiver."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"replace-import-path"},from:{type:"string",description:"The old module specifier, exactly as written between the quotes."},to:{type:"string"}},required:["kind","from","to"],additionalProperties:!1},{type:"object",properties:{kind:{const:"insert-argument"},callee:{type:"string",description:"The function being called, e.g. `connect` or `client.connect`."},index:{type:"integer",minimum:0,maximum:8,description:"0-based position in the argument list."},text:{type:"string",description:"A literal only: a quoted string, a number, a boolean, null, or a flat object literal. Never a function call or an expression."}},required:["kind","callee","index","text"],additionalProperties:!1},{type:"object",properties:{kind:{const:"wrap-call"},callee:{type:"string"},wrapper:{type:"string",enum:["await","new"]}},required:["kind","callee","wrapper"],additionalProperties:!1}]}},c1e={type:"object",properties:{applicable:{type:"boolean",description:"False when this migration cannot be expressed as the listed operations. Answering false is correct and common."},migration:{type:"string",description:"One sentence stating the migration, for a human reviewer."},rationale:{type:"string",description:"Why this is the correct fix, quoting the evidence. Two sentences at most."},citations:{type:"array",items:{type:"string"},description:"Ids of the evidence blocks that state this replacement. Copy them exactly."},ops:a1e},required:["applicable","migration","rationale","citations","ops"],additionalProperties:!1},l1e=`You write migration rules for an automated refactoring tool. You are given one breaking change in a dependency, the evidence that documents it, and a sample of the real lines in a repository that use the affected API. You return a small set of mechanical operations that, applied to those lines, complete the migration. @@ -1493,195 +1493,195 @@ Rules you must follow: 4. \`rename-identifier\` matches bare identifiers only and never a member after a dot. \`rename-member\` matches members after a dot only. Choose based on how the sample lines actually read; if both forms appear, return both operations. 5. \`insert-argument\` text must be a literal. Never a function call, never an expression, never a lambda. 6. Operations are applied in the order you list them, to each line, and must converge: applying them twice must give the same result as applying them once. -7. Prefer fewer operations. A migration needing more than about three is usually not mechanical, and \`applicable: false\` is the better answer.`,r1e=24;async function kee(e){let{change:t,evidence:n,sites:i,fileContents:r,config:o,logger:s}=e,a=e.client;if(!a)return null;let c=o1e(t,i,r);if(c.length===0)return s.debug(`No readable call sites for ${t.id}; not authoring a fix plan.`),null;let l=n.filter(m=>t.citations.includes(m.id));if(l.length===0)return s.debug(`${t.id} cites no retrievable evidence; not authoring a fix plan.`),null;let u;try{u=await a.messages.create({model:o.llm.model,max_tokens:8e3,system:n1e,thinking:{type:"adaptive"},output_config:{effort:o.llm.effort,format:{type:"json_schema",schema:t1e}},messages:[{role:"user",content:s1e(t,e.dependencyChange,l,c)}]})}catch(m){return s.warn(`Could not author a fix plan for ${t.dependency}: ${m.message}`),null}if(u.stop_reason==="refusal")return s.warn(`The model declined to author a fix plan for ${t.dependency}.`),null;let d=u.content.find(m=>m.type==="text")?.text;if(!d)return s.warn(`The model returned no text when asked for a fix plan for ${t.dependency}${u.stop_reason?` (stop reason: ${u.stop_reason})`:""}.`),null;let p;try{p=JSON.parse(d)}catch(m){return s.warn(`The model's fix plan for ${t.dependency} was not readable as JSON (${m.message}).`),null}if(p.applicable===!1)return s.info(`No mechanical fix plan for ${t.dependency}: ${p.rationale?.trim()||"the model judged this migration not expressible as a rule"}. Falling back to a per-site agent.`),null;let f=i1e(p.ops??[]);return f.length===0?(s.info(`The model proposed no usable operations for ${t.dependency}; falling back to a per-site agent.`),null):n1({change:t,dependencyChange:e.dependencyChange,migration:p.migration?.trim()||t.summary,rationale:p.rationale?.trim()||"",citations:(p.citations??[]).filter(m=>typeof m=="string"),ops:f,provenance:{author:"model",model:o.llm.model,authoredAt:new Date().toISOString()}})}function n1(e){let{change:t,dependencyChange:n,ops:i}=e,r=n?.from??null,o=n?.to??null;return{schemaVersion:2,id:St("fp",t.dependency,r??"",o??"",t.kind,[...t.symbols].sort().join(","),JSON.stringify(i)),breakingChangeId:t.id,dependency:t.dependency,fromVersion:r,toVersion:o,changeKind:t.kind,migration:e.migration,rationale:e.rationale,ops:i,citations:e.citations,provenance:e.provenance}}function i1e(e){let t=[];for(let n of e){if(typeof n!="object"||n===null)continue;let i=n;switch(i.kind){case"rename-identifier":case"rename-member":case"replace-import-path":typeof i.from=="string"&&typeof i.to=="string"&&t.push({kind:i.kind,from:i.from.trim(),to:i.to.trim()});break;case"insert-argument":typeof i.callee=="string"&&typeof i.text=="string"&&Number.isInteger(i.index)&&t.push({kind:"insert-argument",callee:i.callee.trim(),index:i.index,text:i.text.trim()});break;case"wrap-call":typeof i.callee=="string"&&(i.wrapper==="await"||i.wrapper==="new")&&t.push({kind:"wrap-call",callee:i.callee.trim(),wrapper:i.wrapper});break;default:break}}return t}function o1e(e,t,n){let i=new Set,r=[];for(let o of t){if(o.breakingChangeId!==e.id)continue;if(r.length>=r1e)break;let s=n.get(o.file);if(s===void 0)continue;let a=s.split(` -`)[o.line-1];if(a===void 0)continue;let c=a.trim();!c||i.has(c)||(i.add(c),r.push({file:o.file,line:o.line,text:a}))}return r}function s1e(e,t,n,i){let r=n.map(s=>` -${a1e(s.content,4e3)} +7. Prefer fewer operations. A migration needing more than about three is usually not mechanical, and \`applicable: false\` is the better answer.`,u1e=24;async function Tee(e){let{change:t,evidence:n,sites:i,fileContents:r,config:o,logger:s}=e,a=e.client;if(!a)return null;let c=p1e(t,i,r);if(c.length===0)return s.debug(`No readable call sites for ${t.id}; not authoring a fix plan.`),null;let l=n.filter(m=>t.citations.includes(m.id));if(l.length===0)return s.debug(`${t.id} cites no retrievable evidence; not authoring a fix plan.`),null;let u;try{u=await a.messages.create({model:o.llm.model,max_tokens:8e3,system:l1e,thinking:{type:"adaptive"},output_config:{effort:o.llm.effort,format:{type:"json_schema",schema:c1e}},messages:[{role:"user",content:f1e(t,e.dependencyChange,l,c)}]})}catch(m){return s.warn(`Could not author a fix plan for ${t.dependency}: ${m.message}`),null}if(u.stop_reason==="refusal")return s.warn(`The model declined to author a fix plan for ${t.dependency}.`),null;let d=u.content.find(m=>m.type==="text")?.text;if(!d)return s.warn(`The model returned no text when asked for a fix plan for ${t.dependency}${u.stop_reason?` (stop reason: ${u.stop_reason})`:""}.`),null;let p;try{p=JSON.parse(d)}catch(m){return s.warn(`The model's fix plan for ${t.dependency} was not readable as JSON (${m.message}).`),null}if(p.applicable===!1)return s.info(`No mechanical fix plan for ${t.dependency}: ${p.rationale?.trim()||"the model judged this migration not expressible as a rule"}. Falling back to a per-site agent.`),null;let f=d1e(p.ops??[]);return f.length===0?(s.info(`The model proposed no usable operations for ${t.dependency}; falling back to a per-site agent.`),null):u1({change:t,dependencyChange:e.dependencyChange,migration:p.migration?.trim()||t.summary,rationale:p.rationale?.trim()||"",citations:(p.citations??[]).filter(m=>typeof m=="string"),ops:f,provenance:{author:"model",model:o.llm.model,authoredAt:new Date().toISOString()}})}function u1(e){let{change:t,dependencyChange:n,ops:i}=e,r=n?.from??null,o=n?.to??null;return{schemaVersion:2,id:St("fp",t.dependency,r??"",o??"",t.kind,[...t.symbols].sort().join(","),JSON.stringify(i)),breakingChangeId:t.id,dependency:t.dependency,fromVersion:r,toVersion:o,changeKind:t.kind,migration:e.migration,rationale:e.rationale,ops:i,citations:e.citations,provenance:e.provenance}}function d1e(e){let t=[];for(let n of e){if(typeof n!="object"||n===null)continue;let i=n;switch(i.kind){case"rename-identifier":case"rename-member":case"replace-import-path":typeof i.from=="string"&&typeof i.to=="string"&&t.push({kind:i.kind,from:i.from.trim(),to:i.to.trim()});break;case"insert-argument":typeof i.callee=="string"&&typeof i.text=="string"&&Number.isInteger(i.index)&&t.push({kind:"insert-argument",callee:i.callee.trim(),index:i.index,text:i.text.trim()});break;case"wrap-call":typeof i.callee=="string"&&(i.wrapper==="await"||i.wrapper==="new")&&t.push({kind:"wrap-call",callee:i.callee.trim(),wrapper:i.wrapper});break;default:break}}return t}function p1e(e,t,n){let i=new Set,r=[];for(let o of t){if(o.breakingChangeId!==e.id)continue;if(r.length>=u1e)break;let s=n.get(o.file);if(s===void 0)continue;let a=s.split(` +`)[o.line-1];if(a===void 0)continue;let c=a.trim();!c||i.has(c)||(i.add(c),r.push({file:o.file,line:o.line,text:a}))}return r}function f1e(e,t,n,i){let r=n.map(s=>` +${m1e(s.content,4e3)} `).join(` `),o=i.map(s=>`${s.file}:${s.line} ${s.text}`).join(` `);return[`Dependency: ${e.dependency}`,t?`Version change: ${t.from} \u2192 ${t.to}`:"",`Breaking change (${e.kind}): ${e.summary}`,e.before?`Declaration before: ${e.before}`:"",e.after?`Declaration after: ${e.after}`:"",e.symbols.length?`Affected symbols: ${e.symbols.join(", ")}`:"",e.replacementSymbols?.length?`Known replacements: ${e.replacementSymbols.join(", ")}`:"","","Evidence:",r,"",`Real lines in this repository that use the affected API (${i.length} distinct shapes):`,o].filter(Boolean).join(` -`)}function a1e(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function c1e(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var Ss=require("node:fs/promises"),$ee=require("node:os"),Af=require("node:path");function _ee(e,t){return St("mig",String(2),e.dependency,t?.from??"",t?.to??"",e.kind,[...e.symbols].sort().join(","))}function r1(){if(process.env.DRIFT_NO_CACHE==="1")return null;let e=process.env.DRIFT_CACHE_DIR||(0,Af.join)((0,$ee.homedir)(),".drift","cache");return(0,Af.join)(e,"fixplans")}function See(e){return{async get(t){try{let n=await(0,Ss.readFile)((0,Af.join)(e,`${t}.json`),"utf8"),i=JSON.parse(n);return i.schemaVersion!==2?null:i}catch{return null}},async put(t,n){try{await(0,Ss.mkdir)(e,{recursive:!0}),await(0,Ss.writeFile)((0,Af.join)(e,`${t}.json`),`${JSON.stringify(n,null,2)} -`,"utf8")}catch{}},async all(){try{let t=await(0,Ss.readdir)(e),n=[];for(let i of t)if(i.endsWith(".json"))try{let r=JSON.parse(await(0,Ss.readFile)((0,Af.join)(e,i),"utf8"));r.schemaVersion===2&&n.push(r)}catch{}return n.sort((i,r)=>i.dependency.localeCompare(r.dependency)||i.id.localeCompare(r.id))}catch{return[]}}}}function Cy(){return{async get(){return null},async put(){},async all(){return[]}}}function xee(e){return{...e,provenance:{...e.provenance,author:"cache",sourceId:e.id}}}function Tee(e,t,n){let i=n.column,r=i+n.matchedText.length;if(i<0||r>e.length||e.slice(i,r)!==n.matchedText)return null;switch(t.kind){case"rename-identifier":return Eee(e,t.from,t.to,i,r,"bare");case"rename-member":return Eee(e,t.from,t.to,i,r,"member");case"replace-import-path":return u1e(e,t.from,t.to,i,r);case"insert-argument":return p1e(e,t.callee,t.index,t.text,i,r);case"wrap-call":return f1e(e,t.callee,t.wrapper,i,r)}}function Eee(e,t,n,i,r,o){let s=Ry(e),a=new RegExp(`(?r||l1e(s,l.index)===(o==="member")&&c.push(l.index);return c.length!==1?null:{start:c[0],end:c[0]+t.length,text:n}}function l1e(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n-=1;return n>=0&&e[n]==="."}function u1e(e,t,n,i,r){if(!d1e.test(e))return null;let o=e1(e).filter(c=>c.content===t);if(o.length===0)return null;let s=o.filter(c=>c.start=r),a=s.length===1?s[0]:o.length===1?o[0]:null;return a?{start:a.start+1,end:a.end,text:n}:null}var d1e=/(^|[^\w$])(import|export|require|from|use|include|using|open|extern|source|load)([^\w$]|$)/;function p1e(e,t,n,i,r,o){let s=Ry(e),a=Iee(s,t,r,o);if(!a)return null;let c=g1e(s,a.open,a.close);if(c===null||n>c.length)return null;let l=c[n];if(l&&s.slice(l.start,l.end).trim()===i.trim())return null;if(c.length===0)return{start:a.open+1,end:a.open+1,text:i};if(n===c.length){let u=c[c.length-1];return{start:u.end,end:u.end,text:`, ${i}`}}return{start:c[n].start,end:c[n].start,text:`${i}, `}}function f1e(e,t,n,i,r){let o=Ry(e),s=Iee(o,t,i,r);return!s||new RegExp(`\\b${n}\\s+$`).test(o.slice(0,s.start))?null:{start:s.start,end:s.start,text:`${n} `}}function Iee(e,t,n,i){let r=new RegExp(`(?=i)continue;let a=s.index+s[0].length-1,c=m1e(e,a);c!==-1&&o.push({start:s.index,open:a,close:c})}return o.length===1?o[0]:null}function m1e(e,t){let n=0;for(let i=t;ie[o]===t.line&&e[o].slice(t.column,t.column+t.matchedText.length)===t.matchedText,i=t.lineNumber-1;if(i>=0&&ia.file===i);if(r.length===0)return e;let o=e.split(` -`),s=new Map;for(let a of r){let c=h1e(o,a);if(c===null)continue;let l=ix(o[c],t,{column:a.column,matchedText:a.matchedText});if(!l)continue;let u=s.get(c);u?u.push(l.edit):s.set(c,[l.edit])}for(let[a,c]of s){let l=o[a],u=[...c].sort((p,f)=>f.start-p.start),d=Number.POSITIVE_INFINITY;for(let p of u)p.end>d||(l=l.slice(0,p.start)+p.text+l.slice(p.end),d=p.start);o[a]=l}return o.join(` -`)}function y1e(e){let t=[];for(let n of e.matchAll(/[A-Za-z_$][\w$]*/g)){t.push({column:n.index,matchedText:n[0]});let i=e.slice(n.index+n[0].length),r=/^\s*\(/.exec(i);r&&t.push({column:n.index,matchedText:n[0]+r[0]})}for(let n of e1(e))t.push({column:n.start+1,matchedText:n.content});return t}function Ree(e,t){for(let n of y1e(e)){let i=Tee(e,t,n);if(!i)continue;let r=e.slice(0,i.start)+i.text+e.slice(i.end);if(r!==e)return r}return e}var Nee=/^[A-Za-z_$][\w$]*$/,Cee=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)*$/,Pee=/^[\w@.][\w@.:/+-]*$/,b1e=/^(?!.*=>)(?!.*\blambda\b)(?!.*\bfunction\b)[\w$]*\s*[:=]?\s*(?:"[^"\\]*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|True|False|null|None|nil|nullptr|undefined|\{[^{}()`]*\}|\[[^\[\]()`]*\])$/,i1=8;function Dee(e){let{plan:t,change:n,sites:i,fileContents:r,evidence:o}=e,s=[];if(t.schemaVersion!==2)return s.push(`The plan declares schema version ${t.schemaVersion}; this build of Drift reads version ${2}.`),Rf(t,s);if(t.ops.length===0)return s.push("The plan contains no operations, so there is nothing it could deterministically change."),Rf(t,s);if(t.ops.length>i1)return s.push(`The plan contains ${t.ops.length} operations; ${i1} is the most Drift will apply as a single migration. A migration needing more than that is not one rule, and should be split into separate findings.`),Rf(t,s);for(let g of t.ops){let h=w1e(g);h&&s.push(h)}for(let g of t.ops){let h=k1e(g,n);h&&s.push(h)}let a=o.filter(g=>t.citations.includes(g.id)),c=t.citations.filter(g=>!o.some(h=>h.id===g));c.length>0&&s.push(`The plan cites evidence Drift did not gather (${c.join(", ")}), so its provenance cannot be checked.`),t.provenance.author==="recipe"&&!t.provenance.recipe&&s.push("The plan claims to come from a community recipe but names none, so there is nothing to audit it against."),t.provenance.author==="model"&&a.length===0&&s.push("The plan cites no retrievable evidence. A migration Drift cannot trace back to something it actually read is not one it will apply to every call site.");let l=S1e(n,a,t);for(let g of t.ops)for(let h of $1e(g))x1e(l,h)||s.push(`Nothing in the cited evidence mentions \`${h}\`, which this plan would introduce at every call site. Drift will not apply a replacement it cannot find stated upstream.`);if(s.length>0)return Rf(t,s);let u=v1e(t.ops,n,i,r),d=u.map(g=>g.outcome);for(let{outcome:g,anchor:h}of u){if(g.status!=="covered"||g.after===void 0||!h)continue;if(g.after.includes(` -`)){s.push(`Applying this plan to ${g.file}:${g.line} would split one line into several. Every operation Drift executes is line-preserving, so this plan cannot be one of Drift's.`);continue}ix(g.after,t.ops,{column:h.column,matchedText:h.matchedText})&&s.push(`Applying this plan twice to ${g.file}:${g.line} does not give the same result as applying it once. A rule that keeps changing its own output cannot be safely re-applied, and Drift re-applies every rule against live file contents rather than a snapshot.`)}if(s.length>0)return Rf(t,s);let p=u.filter(g=>g.outcome.status==="covered");if(p.length===0)return s.push("No operation in the plan matched any of the call sites Drift localized for this finding. The plan may be correct about the upstream change and wrong about how this repository uses it."),Rf(t,s);let f=new Set(p.map(g=>g.outcome.op)),m=t.ops.some(g=>f.has(g.kind)&&wee(g)==="checked")?"checked":"proven";return{plan:t,verdict:p.length===d.length?"accepted":"partial",assurance:m,sites:d,covered:p.length,residual:d.length-p.length,rejections:[],anchors:p.map(g=>g.anchor)}}function v1e(e,t,n,i){let r=[],o=new Set;for(let s of n){if(s.breakingChangeId!==t.id)continue;let a=`${s.file}\0${s.line}\0${s.column??"line"}`;if(o.has(a))continue;o.add(a);let c=(m,g)=>r.push({outcome:{file:s.file,line:s.line,before:m,status:"residual",reason:g}}),l=i.get(s.file);if(l===void 0){c(s.excerpt,"Drift no longer has this file\u2019s contents, so it could not check the rule against the real line.");continue}let u=l.split(` -`)[s.line-1];if(u===void 0){c(s.excerpt,"The file no longer has a line here.");continue}if(Ny(u)){c(u,"This line is a comment. Drift does not rewrite prose, even prose that names the changed symbol.");continue}if(s.column===void 0||s.matchedText===void 0){c(u,"Drift matched this line but not a specific occurrence on it, so there is no exact position a deterministic rule could edit. An agent can read the surrounding code; a line-based rule cannot.");continue}let d={column:s.column,matchedText:s.matchedText};if(u.slice(d.column,d.column+d.matchedText.length)!==d.matchedText){c(u,"The line no longer reads the way it did when this occurrence was localized, so Drift cannot confirm it would edit the right one.");continue}let p=ix(u,e,d);if(!p){c(u,"No operation in the plan applies at the exact occurrence Drift localized, so this call site is shaped differently from the ones the plan describes.");continue}let f=u.slice(0,p.edit.start)+p.edit.text+u.slice(p.edit.end);r.push({outcome:{file:s.file,line:s.line,before:u,after:f,status:"covered",op:p.op},anchor:{file:s.file,line:u,lineNumber:s.line,column:d.column,matchedText:d.matchedText}})}return r}function w1e(e){switch(e.kind){case"rename-identifier":case"rename-member":return Nee.test(e.from)?Nee.test(e.to)?e.from===e.to?`\`${e.kind}\` was given the same name on both sides, which would change nothing.`:null:`\`${e.to}\` is not a plain identifier, so \`${e.kind}\` cannot produce it.`:`\`${e.from}\` is not a plain identifier, so \`${e.kind}\` cannot act on it.`;case"replace-import-path":return Pee.test(e.from)?Pee.test(e.to)?e.from===e.to?"The import path rule was given the same path on both sides, which would change nothing.":null:`\`${e.to}\` is not a module path Drift can write.`:`\`${e.from}\` is not a module path Drift can match on.`;case"insert-argument":return Cee.test(e.callee)?!Number.isInteger(e.index)||e.index<0||e.index>i1?`Argument position ${e.index} is out of range.`:b1e.test(e.text.trim())?null:`\`${e.text}\` is not a literal. Drift only inserts literal arguments, because an expression could call something and a rule whose effect depends on running code is not a rule Drift can state in advance.`:`\`${e.callee}\` is not a callable name Drift can locate.`;case"wrap-call":return Cee.test(e.callee)?null:`\`${e.callee}\` is not a callable name Drift can locate.`}}function k1e(e,t){let n=new Set;for(let o of t.symbols){n.add(o);for(let s of o.split(/[./]/))s&&n.add(s)}let i=e.kind==="insert-argument"||e.kind==="wrap-call"?e.callee:(e.kind==="replace-import-path",e.from);if(e.kind==="replace-import-path")return i===t.dependency||i.startsWith(`${t.dependency}/`)||n.has(i)?null:`The plan rewrites imports of \`${i}\`, which is neither \`${t.dependency}\` nor a symbol this finding names.`;let r=i.split(".");return n.has(i)||r.some(o=>n.has(o))?null:`The plan acts on \`${i}\`, which this finding never mentions. Drift will not apply a rule about one symbol to sites localized for another.`}function $1e(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];case"insert-argument":return(e.text.match(/[A-Za-z_$][\w$]*/g)??[]).filter(n=>!_1e.has(n));case"wrap-call":return[]}}var _1e=new Set(["true","false","True","False","null","None","nil","nullptr","undefined"]);function S1e(e,t,n){return[...e.replacementSymbols??[],e.before??"",e.after??"",e.summary,e.remediation,...t.map(i=>`${i.title} +`)}function m1e(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function g1e(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}var Ss=require("node:fs/promises"),Iee=require("node:os"),Rf=require("node:path");function Aee(e,t){return St("mig",String(2),e.dependency,t?.from??"",t?.to??"",e.kind,[...e.symbols].sort().join(","))}function d1(){if(process.env.DRIFT_NO_CACHE==="1")return null;let e=process.env.DRIFT_CACHE_DIR||(0,Rf.join)((0,Iee.homedir)(),".drift","cache");return(0,Rf.join)(e,"fixplans")}function Ree(e){return{async get(t){try{let n=await(0,Ss.readFile)((0,Rf.join)(e,`${t}.json`),"utf8"),i=JSON.parse(n);return i.schemaVersion!==2?null:i}catch{return null}},async put(t,n){try{await(0,Ss.mkdir)(e,{recursive:!0}),await(0,Ss.writeFile)((0,Rf.join)(e,`${t}.json`),`${JSON.stringify(n,null,2)} +`,"utf8")}catch{}},async all(){try{let t=await(0,Ss.readdir)(e),n=[];for(let i of t)if(i.endsWith(".json"))try{let r=JSON.parse(await(0,Ss.readFile)((0,Rf.join)(e,i),"utf8"));r.schemaVersion===2&&n.push(r)}catch{}return n.sort((i,r)=>i.dependency.localeCompare(r.dependency)||i.id.localeCompare(r.id))}catch{return[]}}}}function Uy(){return{async get(){return null},async put(){},async all(){return[]}}}function Cee(e){return{...e,provenance:{...e.provenance,author:"cache",sourceId:e.id}}}function Pee(e,t,n){let i=n.column,r=i+n.matchedText.length;if(i<0||r>e.length||e.slice(i,r)!==n.matchedText)return null;switch(t.kind){case"rename-identifier":return Nee(e,t.from,t.to,i,r,"bare");case"rename-member":return Nee(e,t.from,t.to,i,r,"member");case"replace-import-path":return y1e(e,t.from,t.to,i,r);case"insert-argument":return v1e(e,t.callee,t.index,t.text,i,r);case"wrap-call":return w1e(e,t.callee,t.wrapper,i,r)}}function Nee(e,t,n,i,r,o){let s=Ly(e),a=new RegExp(`(?r||h1e(s,l.index)===(o==="member")&&c.push(l.index);return c.length!==1?null:{start:c[0],end:c[0]+t.length,text:n}}function h1e(e,t){let n=t-1;for(;n>=0&&/\s/.test(e[n]);)n-=1;return n>=0&&e[n]==="."}function y1e(e,t,n,i,r){if(!b1e.test(e))return null;let o=c1(e).filter(c=>c.content===t);if(o.length===0)return null;let s=o.filter(c=>c.start=r),a=s.length===1?s[0]:o.length===1?o[0]:null;return a?{start:a.start+1,end:a.end,text:n}:null}var b1e=/(^|[^\w$])(import|export|require|from|use|include|using|open|extern|source|load)([^\w$]|$)/;function v1e(e,t,n,i,r,o){let s=Ly(e),a=Dee(s,t,r,o);if(!a)return null;let c=_1e(s,a.open,a.close);if(c===null||n>c.length)return null;let l=c[n];if(l&&s.slice(l.start,l.end).trim()===i.trim())return null;if(c.length===0)return{start:a.open+1,end:a.open+1,text:i};if(n===c.length){let u=c[c.length-1];return{start:u.end,end:u.end,text:`, ${i}`}}return{start:c[n].start,end:c[n].start,text:`${i}, `}}function w1e(e,t,n,i,r){let o=Ly(e),s=Dee(o,t,i,r);return!s||new RegExp(`\\b${n}\\s+$`).test(o.slice(0,s.start))?null:{start:s.start,end:s.start,text:`${n} `}}function Dee(e,t,n,i){let r=new RegExp(`(?=i)continue;let a=s.index+s[0].length-1,c=k1e(e,a);c!==-1&&o.push({start:s.index,open:a,close:c})}return o.length===1?o[0]:null}function k1e(e,t){let n=0;for(let i=t;ie[o]===t.line&&e[o].slice(t.column,t.column+t.matchedText.length)===t.matchedText,i=t.lineNumber-1;if(i>=0&&ia.file===i);if(r.length===0)return e;let o=e.split(` +`),s=new Map;for(let a of r){let c=$1e(o,a);if(c===null)continue;let l=dx(o[c],t,{column:a.column,matchedText:a.matchedText});if(!l)continue;let u=s.get(c);u?u.push(l.edit):s.set(c,[l.edit])}for(let[a,c]of s){let l=o[a],u=[...c].sort((p,f)=>f.start-p.start),d=Number.POSITIVE_INFINITY;for(let p of u)p.end>d||(l=l.slice(0,p.start)+p.text+l.slice(p.end),d=p.start);o[a]=l}return o.join(` +`)}function S1e(e){let t=[];for(let n of e.matchAll(/[A-Za-z_$][\w$]*/g)){t.push({column:n.index,matchedText:n[0]});let i=e.slice(n.index+n[0].length),r=/^\s*\(/.exec(i);r&&t.push({column:n.index,matchedText:n[0]+r[0]})}for(let n of c1(e))t.push({column:n.start+1,matchedText:n.content});return t}function Mee(e,t){for(let n of S1e(e)){let i=Pee(e,t,n);if(!i)continue;let r=e.slice(0,i.start)+i.text+e.slice(i.end);if(r!==e)return r}return e}var Lee=/^[A-Za-z_$][\w$]*$/,Fee=/^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)*$/,Uee=/^[\w@.][\w@.:/+-]*$/,x1e=/^(?!.*=>)(?!.*\blambda\b)(?!.*\bfunction\b)[\w$]*\s*[:=]?\s*(?:"[^"\\]*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|True|False|null|None|nil|nullptr|undefined|\{[^{}()`]*\}|\[[^\[\]()`]*\])$/,p1=8;function jee(e){let{plan:t,change:n,sites:i,fileContents:r,evidence:o}=e,s=[];if(t.schemaVersion!==2)return s.push(`The plan declares schema version ${t.schemaVersion}; this build of Drift reads version ${2}.`),Cf(t,s);if(t.ops.length===0)return s.push("The plan contains no operations, so there is nothing it could deterministically change."),Cf(t,s);if(t.ops.length>p1)return s.push(`The plan contains ${t.ops.length} operations; ${p1} is the most Drift will apply as a single migration. A migration needing more than that is not one rule, and should be split into separate findings.`),Cf(t,s);for(let g of t.ops){let h=T1e(g);h&&s.push(h)}for(let g of t.ops){let h=I1e(g,n);h&&s.push(h)}let a=o.filter(g=>t.citations.includes(g.id)),c=t.citations.filter(g=>!o.some(h=>h.id===g));c.length>0&&s.push(`The plan cites evidence Drift did not gather (${c.join(", ")}), so its provenance cannot be checked.`),t.provenance.author==="recipe"&&!t.provenance.recipe&&s.push("The plan claims to come from a community recipe but names none, so there is nothing to audit it against."),t.provenance.author==="model"&&a.length===0&&s.push("The plan cites no retrievable evidence. A migration Drift cannot trace back to something it actually read is not one it will apply to every call site.");let l=C1e(n,a,t);for(let g of t.ops)for(let h of A1e(g))N1e(l,h)||s.push(`Nothing in the cited evidence mentions \`${h}\`, which this plan would introduce at every call site. Drift will not apply a replacement it cannot find stated upstream.`);if(s.length>0)return Cf(t,s);let u=E1e(t.ops,n,i,r),d=u.map(g=>g.outcome);for(let{outcome:g,anchor:h}of u){if(g.status!=="covered"||g.after===void 0||!h)continue;if(g.after.includes(` +`)){s.push(`Applying this plan to ${g.file}:${g.line} would split one line into several. Every operation Drift executes is line-preserving, so this plan cannot be one of Drift's.`);continue}dx(g.after,t.ops,{column:h.column,matchedText:h.matchedText})&&s.push(`Applying this plan twice to ${g.file}:${g.line} does not give the same result as applying it once. A rule that keeps changing its own output cannot be safely re-applied, and Drift re-applies every rule against live file contents rather than a snapshot.`)}if(s.length>0)return Cf(t,s);let p=u.filter(g=>g.outcome.status==="covered");if(p.length===0)return s.push("No operation in the plan matched any of the call sites Drift localized for this finding. The plan may be correct about the upstream change and wrong about how this repository uses it."),Cf(t,s);let f=new Set(p.map(g=>g.outcome.op)),m=t.ops.some(g=>f.has(g.kind)&&Eee(g)==="checked")?"checked":"proven";return{plan:t,verdict:p.length===d.length?"accepted":"partial",assurance:m,sites:d,covered:p.length,residual:d.length-p.length,rejections:[],anchors:p.map(g=>g.anchor)}}function E1e(e,t,n,i){let r=[],o=new Set;for(let s of n){if(s.breakingChangeId!==t.id)continue;let a=`${s.file}\0${s.line}\0${s.column??"line"}`;if(o.has(a))continue;o.add(a);let c=(m,g)=>r.push({outcome:{file:s.file,line:s.line,before:m,status:"residual",reason:g}}),l=i.get(s.file);if(l===void 0){c(s.excerpt,"Drift no longer has this file\u2019s contents, so it could not check the rule against the real line.");continue}let u=l.split(` +`)[s.line-1];if(u===void 0){c(s.excerpt,"The file no longer has a line here.");continue}if(Fy(u)){c(u,"This line is a comment. Drift does not rewrite prose, even prose that names the changed symbol.");continue}if(s.column===void 0||s.matchedText===void 0){c(u,"Drift matched this line but not a specific occurrence on it, so there is no exact position a deterministic rule could edit. An agent can read the surrounding code; a line-based rule cannot.");continue}let d={column:s.column,matchedText:s.matchedText};if(u.slice(d.column,d.column+d.matchedText.length)!==d.matchedText){c(u,"The line no longer reads the way it did when this occurrence was localized, so Drift cannot confirm it would edit the right one.");continue}let p=dx(u,e,d);if(!p){c(u,"No operation in the plan applies at the exact occurrence Drift localized, so this call site is shaped differently from the ones the plan describes.");continue}let f=u.slice(0,p.edit.start)+p.edit.text+u.slice(p.edit.end);r.push({outcome:{file:s.file,line:s.line,before:u,after:f,status:"covered",op:p.op},anchor:{file:s.file,line:u,lineNumber:s.line,column:d.column,matchedText:d.matchedText}})}return r}function T1e(e){switch(e.kind){case"rename-identifier":case"rename-member":return Lee.test(e.from)?Lee.test(e.to)?e.from===e.to?`\`${e.kind}\` was given the same name on both sides, which would change nothing.`:null:`\`${e.to}\` is not a plain identifier, so \`${e.kind}\` cannot produce it.`:`\`${e.from}\` is not a plain identifier, so \`${e.kind}\` cannot act on it.`;case"replace-import-path":return Uee.test(e.from)?Uee.test(e.to)?e.from===e.to?"The import path rule was given the same path on both sides, which would change nothing.":null:`\`${e.to}\` is not a module path Drift can write.`:`\`${e.from}\` is not a module path Drift can match on.`;case"insert-argument":return Fee.test(e.callee)?!Number.isInteger(e.index)||e.index<0||e.index>p1?`Argument position ${e.index} is out of range.`:x1e.test(e.text.trim())?null:`\`${e.text}\` is not a literal. Drift only inserts literal arguments, because an expression could call something and a rule whose effect depends on running code is not a rule Drift can state in advance.`:`\`${e.callee}\` is not a callable name Drift can locate.`;case"wrap-call":return Fee.test(e.callee)?null:`\`${e.callee}\` is not a callable name Drift can locate.`}}function I1e(e,t){let n=new Set;for(let o of t.symbols){n.add(o);for(let s of o.split(/[./]/))s&&n.add(s)}let i=e.kind==="insert-argument"||e.kind==="wrap-call"?e.callee:(e.kind==="replace-import-path",e.from);if(e.kind==="replace-import-path")return i===t.dependency||i.startsWith(`${t.dependency}/`)||n.has(i)?null:`The plan rewrites imports of \`${i}\`, which is neither \`${t.dependency}\` nor a symbol this finding names.`;let r=i.split(".");return n.has(i)||r.some(o=>n.has(o))?null:`The plan acts on \`${i}\`, which this finding never mentions. Drift will not apply a rule about one symbol to sites localized for another.`}function A1e(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];case"insert-argument":return(e.text.match(/[A-Za-z_$][\w$]*/g)??[]).filter(n=>!R1e.has(n));case"wrap-call":return[]}}var R1e=new Set(["true","false","True","False","null","None","nil","nullptr","undefined"]);function C1e(e,t,n){return[...e.replacementSymbols??[],e.before??"",e.after??"",e.summary,e.remediation,...t.map(i=>`${i.title} ${i.content}`),...t.flatMap(i=>(i.findings??[]).map(r=>`${r.symbol} ${r.detail} ${r.before??""} ${r.after??""}`)),n.provenance.recipe?`${n.provenance.recipe.name} ${n.migration}`:""].join(` -`)}function x1e(e,t){return new RegExp(`(^|[^\\w$])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}([^\\w$]|$)`).test(e)}function Rf(e,t){return{plan:e,verdict:"rejected",assurance:"checked",sites:[],covered:0,residual:0,rejections:t,anchors:[]}}async function Oee(e){let{changes:t,sites:n,evidence:i,config:r,logger:o}=e,s=e.cache??Cy(),a=new Map,c=new Map,l=new Map;for(let d of n){let p=l.get(d.breakingChangeId);p?p.push(d):l.set(d.breakingChangeId,[d])}let u=new Map(e.dependencyChanges.map(d=>[`${d.workspace??""}::${d.name}`,d]));for(let d of t){let p=l.get(d.id);if(!p||p.length===0)continue;let f=u.get(`${d.workspace??""}::${d.dependency}`),m=_ee(d,f),g=null;for(let h of E1e(e,d,f,m,s)){let b=await h();if(!b)continue;let y=Dee({plan:b,change:d,sites:p,fileContents:e.fileContents,evidence:i});if(y.verdict==="rejected"){o.info(`Rejected a ${b.provenance.author}-proposed fix plan for ${d.dependency}: ${y.rejections[0]}`),g=y;continue}let w=y.covered+y.residual,k=w===0?0:y.covered/w;if(k0||c.size>0)&&o.info(`Fix plans: ${a.size} accepted, ${c.size} rejected. ${r.remediation.fixPlans.enabled?"":"(authoring disabled)"}`.trim()),{accepted:a,rejected:c}}function E1e(e,t,n,i,r){let o=[];return o.push(async()=>{let s=await r.get(i);return s?xee(s):null}),e.proposeFromRecipe&&o.push(()=>e.proposeFromRecipe(t)),e.client&&o.push(()=>kee({change:t,dependencyChange:n,evidence:e.evidence,sites:e.sites,fileContents:e.fileContents,config:e.config,logger:e.logger,client:e.client})),o}var on=require("node:fs/promises"),Nn=require("node:path"),s1=require("node:os"),Nf=require("node:crypto");async function ax(e,t,n={}){let i=n.exec??Xe,r=n.env??process.env,o=n.at??"HEAD",s=await i("git",["rev-parse","--git-common-dir"],{cwd:e,env:r});if(s.code!==0){if(n.at!==void 0&&n.at!=="HEAD")throw new Error(`\`${e}\` is not a git repository, so \`${n.at}\` cannot be checked out to test an upgrade.`);return A1e(e,t,n.runId??Lee)}let a=s.stdout.trim()||".git",c=(0,Nn.isAbsolute)(a)?a:(0,Nn.join)(e,a),l=n.runId??Lee,u=(0,Nn.join)((0,s1.tmpdir)(),"drift-worktrees",(0,Nf.createHash)("sha256").update(c).digest("hex").slice(0,12)),d=(0,Nn.join)(u,sx(l),sx(t));I1e(u),await Mee(e,d,i,r);let p=await i("git",["worktree","add","--detach",d,o],{cwd:e,env:r});if(p.code!==0)throw new Error(`Could not create a worktree to test upgrades in: ${p.stderr.trim()||p.stdout.trim()||"git failed"}`);let{copied:f,oversized:m,secrets:g}=n.copyIgnoredFiles===!1?{copied:[],oversized:[],secrets:[]}:await D1e(e,d,i,r,void 0,n.allowedGlobs),[h,b,y]=await Promise.all([o1(e,f,i,r),o1(e,m,i,r),o1(e,g,i,r)]),w=!1;return{path:d,copiedFiles:f,copiedRules:h,oversizedFiles:m,oversizedRules:b,skippedSecrets:g,skippedSecretRules:y,async dispose(){w||(w=!0,await Mee(e,d,i,r))}}}async function Mee(e,t,n,i){let r=`${t}.trash-${(0,Nf.randomUUID)().slice(0,8)}`;await(0,on.rename)(t,r).then(()=>!0,()=>!1)?T1e(r):await(0,on.rm)(t,{recursive:!0,force:!0}).then(()=>!0,()=>!1)||await n("git",["worktree","remove","--force",t],{cwd:e,env:i}).catch(()=>{}),await n("git",["worktree","prune"],{cwd:e,env:i}).catch(()=>{})}var ox=new Set;function T1e(e){let t=(0,on.rm)(e,{recursive:!0,force:!0}).catch(()=>{}).then(()=>{ox.delete(t)});ox.add(t)}async function a1(){for(;ox.size>0;)await Promise.all([...ox])}function I1e(e){(0,on.readdir)(e,{withFileTypes:!0}).then(t=>Promise.all(t.filter(n=>n.isDirectory()).map(n=>(0,on.readdir)((0,Nn.join)(e,n.name),{withFileTypes:!0}).then(i=>Promise.all(i.filter(r=>r.name.includes(".trash-")).map(r=>(0,on.rm)((0,Nn.join)(e,n.name,r.name),{recursive:!0,force:!0}).catch(()=>{}))),()=>{})))).catch(()=>{})}async function A1e(e,t,n){let i=(0,Nn.join)((0,s1.tmpdir)(),"drift-worktrees",sx(n),sx(t));await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),await(0,on.mkdir)(i,{recursive:!0});let r=[];try{await(0,on.cp)(e,i,{recursive:!0,filter:s=>{let a=(0,Nn.relative)(e,s);if(a==="")return!0;let c=a.split(Nn.sep).join("/");return a.split(Nn.sep).some(l=>jee.has(l))?!1:zee(c)?(r.push(c),!1):!0}})}catch(s){throw await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),new Error(`Could not copy \`${e}\` into a temp checkout to test an upgrade: ${s instanceof Error?s.message:String(s)}`)}let o=!1;return{path:i,copiedFiles:[],copiedRules:[],oversizedFiles:[],oversizedRules:[],skippedSecrets:r.sort(),skippedSecretRules:[],async dispose(){o||(o=!0,await(0,on.rm)(i,{recursive:!0,force:!0}).catch(()=>{}))}}}var Lee=`${process.pid}-${(0,Nf.randomBytes)(4).toString("hex")}`;async function Uee(e,t,n,i={}){let r=await ax(e,t,i);try{return await n(r)}finally{await r.dispose()}}var jee=new Set(["node_modules",".git","dist","build","out",".next",".nuxt",".output",".svelte-kit",".cache",".parcel-cache",".turbo",".angular","coverage","target","vendor",".venv","venv","__pycache__",".pytest_cache",".gradle",".idea",".vscode","tmp",".tmp"]),R1e=25*1024*1024,N1e=[/(^|\/)\.env(\..*)?$/i,/(^|\/)\.npmrc$/i,/(^|\/)\.yarnrc(\.yml)?$/i,/(^|\/)\.netrc$/i,/(^|\/)\.pgpass$/i,/(^|\/)\.git-credentials$/i,/(^|\/)\.dockercfg$/i,/(^|\/)\.docker\/config\.json$/i,/(^|\/)id_(rsa|dsa|ecdsa|ed25519)(\.pub)?$/i,/\.(pem|key|p12|pfx|jks|keystore|ppk)$/i,/(^|\/)(\.aws\/credentials|\.aws\/config)$/i,/(^|\/)application_default_credentials\.json$/i,/(service[-_]?account|credentials?|secrets?)[^/]*\.(json|ya?ml|txt)$/i];function zee(e){return N1e.some(t=>t.test(e))}function C1e(e){let t="";for(let n=0;nC1e(n).test(e))}async function D1e(e,t,n,i,r=R1e,o){let s=await n("git",["ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:e,env:i});if(s.code!==0||!s.stdout)return{copied:[],oversized:[],secrets:[]};let a=s.stdout.split("\0").filter(d=>d.length>0&&!d.split("/").some(p=>jee.has(p))),c=[],l=[],u=[];for(let d of a){if(zee(d)){u.push(d);continue}if(o&&o.length>0&&!P1e(d,o))continue;let p=(0,Nn.join)(e,d),f=await(0,on.stat)(p).catch(()=>null);if(!f||!f.isFile())continue;if(f.size>r){l.push(d);continue}let m=(0,Nn.join)(t,d);await(0,on.mkdir)((0,Nn.dirname)(m),{recursive:!0}),await(0,on.copyFile)(p,m).catch(()=>{}),c.push(d)}return{copied:c,oversized:l,secrets:u}}var Fee=200;async function o1(e,t,n,i){if(t.length===0)return[];let r=new Set;for(let o=0;o0?t.slice(0,80):"probe"}var Zee=require("node:fs/promises"),Yee=require("node:path");async function Vee(e,t,n={}){let i=n.exec??Xe,r=await i("git",["status","--porcelain"],{cwd:t});if(r.failure)return{status:"failed",changedFiles:[],message:"Could not inspect the worktree before running the recipe."};let o=Bee(r.stdout||""),s=await qee(t,[...o.keys()],i),a=M1e(e);if(!a)return{status:"failed",changedFiles:[],message:`Drift does not know how to run a "${e.provider}" recipe.`};n.logger?.info(`Running community recipe ${e.name}@${e.version} (${e.provider})`);let c=await i(a.bin,a.args,{cwd:t,timeoutMs:3e5});if(c.failure||c.code!==0){let u=c.failure==="not-found"?`${a.bin} is not installed`:c.stderr.trim()||c.stdout.trim();return{status:"failed",changedFiles:await Gee(t,o,s,i),message:`Recipe ${e.name}@${e.version} failed: ${u||`exit code ${c.code}`}`.trim()}}let l=await Gee(t,o,s,i);return l.length===0?{status:"no-changes",changedFiles:[],message:`Recipe ${e.name}@${e.version} made no changes here.`}:{status:"applied",changedFiles:l,message:`Applied community recipe ${e.name}@${e.version} from ${e.publisher} \u2014 no agent call was made.`}}function Bee(e){let t=new Map;for(let n of e.split(` -`)){let i=n.trimEnd();if(!i.trim())continue;let r=i.slice(0,2),o=i.slice(2).trim(),s=o.indexOf(" -> ");s!==-1&&(o=o.slice(s+4).trim()),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o&&t.set(o,r)}return t}async function qee(e,t,n){let i=new Map;for(let r of t){let o=await n("git",["hash-object","--",r],{cwd:e});!o.failure&&o.code===0&&i.set(r,o.stdout.trim())}return i}async function Gee(e,t,n,i){let r=await i("git",["status","--porcelain"],{cwd:e}),o=Bee(r.stdout||""),s=new Set,a=[];for(let[l,u]of o)t.get(l)!==u?s.add(l):a.push(l);let c=await qee(e,a,i);for(let l of a)n.get(l)!==c.get(l)&&s.add(l);return[...s]}function M1e(e){switch(e.provider){case"codemod.com":return{bin:"npx",args:["--yes","codemod@latest","run",`${e.name}@${e.version}`]};case"openrewrite":return{bin:"mvn",args:["-q","org.openrewrite.maven:rewrite-maven-plugin:run",`-Drewrite.activeRecipes=${e.name}`,`-Drewrite.recipeArtifactCoordinates=${e.source}:${e.version}`]};default:return null}}var L1e=8;function Jee(e){let t=e.filter(r=>r.before!==r.after);if(t.length===0)return{ops:[],unexplained:[]};let n=[];for(;n.lengthcx(n,a.before)!==a.after);if(r.length===0)break;let o=new Map;for(let a of r){let c=cx(n,a.before);for(let l of F1e({...a,before:c}))o.set(JSON.stringify(l),l)}let s=null;for(let[a,c]of o){let l=[...n,c],u=r.filter(d=>cx(l,d.before)===d.after).length;u!==0&&(!s||u>s.score||u===s.score&&acx(n,r.before)!==r.after);return{ops:n,unexplained:i}}function cx(e,t){let n=t;for(let i of e)n=Ree(n,i);return n}function F1e(e){let t=[],n=Wee(e.before),i=Wee(e.after),r=n.filter(c=>!i.includes(c)),o=i.filter(c=>!n.includes(c));for(let c of new Set(r))for(let l of new Set(o))t.push({kind:"rename-identifier",from:c,to:l}),t.push({kind:"rename-member",from:c,to:l}),t.push({kind:"replace-import-path",from:c,to:l});let s=Hee(e.before),a=Hee(e.after);for(let c of s.filter(l=>!a.includes(l)))for(let l of a.filter(u=>!s.includes(u)))t.push({kind:"replace-import-path",from:c,to:l});for(let c of["await","new"])if(!(e.before.includes(`${c} `)||!e.after.includes(`${c} `)))for(let l of Kee(e.after))t.push({kind:"wrap-call",callee:l,wrapper:c});for(let c of Kee(e.before))for(let l of U1e(e.before,e.after))for(let u=0;u<=4;u++)t.push({kind:"insert-argument",callee:c,index:u,text:l});return t}function Wee(e){return e.match(/[A-Za-z_$][\w$]*/g)??[]}function Hee(e){return[...e.matchAll(/"([^"\\]*)"|'([^'\\]*)'/g)].map(t=>t[1]??t[2]??"")}function Kee(e){return[...e.matchAll(/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g)].map(t=>t[1])}function U1e(e,t){let n=[...t.match(/\{[^{}]*\}/g)??[],...t.match(/"[^"\\]*"|'[^'\\]*'/g)??[],...t.match(/\b(?:true|false|null|None|nil)\b/g)??[]];return[...new Set(n.filter(i=>!e.includes(i)))]}async function Qee(e){let{candidate:t,change:n,sandbox:i,relevantFiles:r,logger:o}=e,s=e.exec??Xe,a=await Vee(t,i,{exec:s,logger:o});if(a.status!=="applied"||a.changedFiles.length===0)return o.debug(`${t.name}@${t.version} changed nothing Drift could learn a rule from.`),null;let c=[],l=!1;for(let d of a.changedFiles){if(!r.has(d)){l=!0;continue}let p=await j1e(i,d,s);if(!p){l=!0;continue}let f=p.before.split(` +`)}function N1e(e,t){return new RegExp(`(^|[^\\w$])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}([^\\w$]|$)`).test(e)}function Cf(e,t){return{plan:e,verdict:"rejected",assurance:"checked",sites:[],covered:0,residual:0,rejections:t,anchors:[]}}async function zee(e){let{changes:t,sites:n,evidence:i,config:r,logger:o}=e,s=e.cache??Uy(),a=new Map,c=new Map,l=new Map;for(let d of n){let p=l.get(d.breakingChangeId);p?p.push(d):l.set(d.breakingChangeId,[d])}let u=new Map(e.dependencyChanges.map(d=>[`${d.workspace??""}::${d.name}`,d]));for(let d of t){let p=l.get(d.id);if(!p||p.length===0)continue;let f=u.get(`${d.workspace??""}::${d.dependency}`),m=Aee(d,f),g=null;for(let h of P1e(e,d,f,m,s)){let b=await h();if(!b)continue;let y=jee({plan:b,change:d,sites:p,fileContents:e.fileContents,evidence:i});if(y.verdict==="rejected"){o.info(`Rejected a ${b.provenance.author}-proposed fix plan for ${d.dependency}: ${y.rejections[0]}`),g=y;continue}let w=y.covered+y.residual,k=w===0?0:y.covered/w;if(k0||c.size>0)&&o.info(`Fix plans: ${a.size} accepted, ${c.size} rejected. ${r.remediation.fixPlans.enabled?"":"(authoring disabled)"}`.trim()),{accepted:a,rejected:c}}function P1e(e,t,n,i,r){let o=[];return o.push(async()=>{let s=await r.get(i);return s?Cee(s):null}),e.proposeFromRecipe&&o.push(()=>e.proposeFromRecipe(t)),e.client&&o.push(()=>Tee({change:t,dependencyChange:n,evidence:e.evidence,sites:e.sites,fileContents:e.fileContents,config:e.config,logger:e.logger,client:e.client})),o}var rn=require("node:fs/promises"),An=require("node:path"),m1=require("node:os"),Nf=require("node:crypto");async function mx(e,t,n={}){let i=n.exec??Xe,r=n.env??process.env,o=n.at??"HEAD",s=await i("git",["rev-parse","--git-common-dir"],{cwd:e,env:r});if(s.code!==0){if(n.at!==void 0&&n.at!=="HEAD")throw new Error(`\`${e}\` is not a git repository, so \`${n.at}\` cannot be checked out to test an upgrade.`);return M1e(e,t,n.runId??Vee)}let a=s.stdout.trim()||".git",c=(0,An.isAbsolute)(a)?a:(0,An.join)(e,a),l=n.runId??Vee,u=(0,An.join)((0,m1.tmpdir)(),"drift-worktrees",(0,Nf.createHash)("sha256").update(c).digest("hex").slice(0,12)),d=(0,An.join)(u,fx(l),fx(t));O1e(u),await Gee(e,d,i,r);let p=await i("git",["worktree","add","--detach",d,o],{cwd:e,env:r});if(p.code!==0)throw new Error(`Could not create a worktree to test upgrades in: ${p.stderr.trim()||p.stdout.trim()||"git failed"}`);let{copied:f,oversized:m,secrets:g}=n.copyIgnoredFiles===!1?{copied:[],oversized:[],secrets:[]}:await z1e(e,d,i,r,void 0,n.allowedGlobs),[h,b,y]=await Promise.all([f1(e,f,i,r),f1(e,m,i,r),f1(e,g,i,r)]),w=!1;return{path:d,copiedFiles:f,copiedRules:h,oversizedFiles:m,oversizedRules:b,skippedSecrets:g,skippedSecretRules:y,async dispose(){w||(w=!0,await Gee(e,d,i,r))}}}async function Gee(e,t,n,i){let r=`${t}.trash-${(0,Nf.randomUUID)().slice(0,8)}`;await(0,rn.rename)(t,r).then(()=>!0,()=>!1)?D1e(r):await(0,rn.rm)(t,{recursive:!0,force:!0}).then(()=>!0,()=>!1)||await n("git",["worktree","remove","--force",t],{cwd:e,env:i}).catch(()=>{}),await n("git",["worktree","prune"],{cwd:e,env:i}).catch(()=>{})}var px=new Set;function D1e(e){let t=(0,rn.rm)(e,{recursive:!0,force:!0}).catch(()=>{}).then(()=>{px.delete(t)});px.add(t)}async function g1(){for(;px.size>0;)await Promise.all([...px])}function O1e(e){(0,rn.readdir)(e,{withFileTypes:!0}).then(t=>Promise.all(t.filter(n=>n.isDirectory()).map(n=>(0,rn.readdir)((0,An.join)(e,n.name),{withFileTypes:!0}).then(i=>Promise.all(i.filter(r=>r.name.includes(".trash-")).map(r=>(0,rn.rm)((0,An.join)(e,n.name,r.name),{recursive:!0,force:!0}).catch(()=>{}))),()=>{})))).catch(()=>{})}async function M1e(e,t,n){let i=(0,An.join)((0,m1.tmpdir)(),"drift-worktrees",fx(n),fx(t));await(0,rn.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),await(0,rn.mkdir)(i,{recursive:!0});let r=[];try{await(0,rn.cp)(e,i,{recursive:!0,filter:s=>{let a=(0,An.relative)(e,s);if(a==="")return!0;let c=a.split(An.sep).join("/");return a.split(An.sep).some(l=>Wee.has(l))?!1:Kee(c)?(r.push(c),!1):!0}})}catch(s){throw await(0,rn.rm)(i,{recursive:!0,force:!0}).catch(()=>{}),new Error(`Could not copy \`${e}\` into a temp checkout to test an upgrade: ${s instanceof Error?s.message:String(s)}`)}let o=!1;return{path:i,copiedFiles:[],copiedRules:[],oversizedFiles:[],oversizedRules:[],skippedSecrets:r.sort(),skippedSecretRules:[],async dispose(){o||(o=!0,await(0,rn.rm)(i,{recursive:!0,force:!0}).catch(()=>{}))}}}var Vee=`${process.pid}-${(0,Nf.randomBytes)(4).toString("hex")}`;async function qee(e,t,n,i={}){let r=await mx(e,t,i);try{return await n(r)}finally{await r.dispose()}}var Wee=new Set(["node_modules",".git","dist","build","out",".next",".nuxt",".output",".svelte-kit",".cache",".parcel-cache",".turbo",".angular","coverage","target","vendor",".venv","venv","__pycache__",".pytest_cache",".gradle",".idea",".vscode","tmp",".tmp"]),L1e=25*1024*1024,F1e=[/(^|\/)\.env(\..*)?$/i,/(^|\/)\.npmrc$/i,/(^|\/)\.yarnrc(\.yml)?$/i,/(^|\/)\.netrc$/i,/(^|\/)\.pgpass$/i,/(^|\/)\.git-credentials$/i,/(^|\/)\.dockercfg$/i,/(^|\/)\.docker\/config\.json$/i,/(^|\/)id_(rsa|dsa|ecdsa|ed25519)(\.pub)?$/i,/\.(pem|key|p12|pfx|jks|keystore|ppk)$/i,/(^|\/)(\.aws\/credentials|\.aws\/config)$/i,/(^|\/)application_default_credentials\.json$/i,/(service[-_]?account|credentials?|secrets?)[^/]*\.(json|ya?ml|txt)$/i];function Kee(e){return F1e.some(t=>t.test(e))}function U1e(e){let t="";for(let n=0;nU1e(n).test(e))}async function z1e(e,t,n,i,r=L1e,o){let s=await n("git",["ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:e,env:i});if(s.code!==0||!s.stdout)return{copied:[],oversized:[],secrets:[]};let a=s.stdout.split("\0").filter(d=>d.length>0&&!d.split("/").some(p=>Wee.has(p))),c=[],l=[],u=[];for(let d of a){if(Kee(d)){u.push(d);continue}if(o&&o.length>0&&!j1e(d,o))continue;let p=(0,An.join)(e,d),f=await(0,rn.stat)(p).catch(()=>null);if(!f||!f.isFile())continue;if(f.size>r){l.push(d);continue}let m=(0,An.join)(t,d);await(0,rn.mkdir)((0,An.dirname)(m),{recursive:!0}),await(0,rn.copyFile)(p,m).catch(()=>{}),c.push(d)}return{copied:c,oversized:l,secrets:u}}var Bee=200;async function f1(e,t,n,i){if(t.length===0)return[];let r=new Set;for(let o=0;o0?t.slice(0,80):"probe"}var nte=require("node:fs/promises"),rte=require("node:path");async function Jee(e,t,n={}){let i=n.exec??Xe,r=await i("git",["status","--porcelain"],{cwd:t});if(r.failure)return{status:"failed",changedFiles:[],message:"Could not inspect the worktree before running the recipe."};let o=Zee(r.stdout||""),s=await Yee(t,[...o.keys()],i),a=V1e(e);if(!a)return{status:"failed",changedFiles:[],message:`Drift does not know how to run a "${e.provider}" recipe.`};n.logger?.info(`Running community recipe ${e.name}@${e.version} (${e.provider})`);let c=await i(a.bin,a.args,{cwd:t,timeoutMs:3e5});if(c.failure||c.code!==0){let u=c.failure==="not-found"?`${a.bin} is not installed`:c.stderr.trim()||c.stdout.trim();return{status:"failed",changedFiles:await Hee(t,o,s,i),message:`Recipe ${e.name}@${e.version} failed: ${u||`exit code ${c.code}`}`.trim()}}let l=await Hee(t,o,s,i);return l.length===0?{status:"no-changes",changedFiles:[],message:`Recipe ${e.name}@${e.version} made no changes here.`}:{status:"applied",changedFiles:l,message:`Applied community recipe ${e.name}@${e.version} from ${e.publisher} \u2014 no agent call was made.`}}function Zee(e){let t=new Map;for(let n of e.split(` +`)){let i=n.trimEnd();if(!i.trim())continue;let r=i.slice(0,2),o=i.slice(2).trim(),s=o.indexOf(" -> ");s!==-1&&(o=o.slice(s+4).trim()),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o&&t.set(o,r)}return t}async function Yee(e,t,n){let i=new Map;for(let r of t){let o=await n("git",["hash-object","--",r],{cwd:e});!o.failure&&o.code===0&&i.set(r,o.stdout.trim())}return i}async function Hee(e,t,n,i){let r=await i("git",["status","--porcelain"],{cwd:e}),o=Zee(r.stdout||""),s=new Set,a=[];for(let[l,u]of o)t.get(l)!==u?s.add(l):a.push(l);let c=await Yee(e,a,i);for(let l of a)n.get(l)!==c.get(l)&&s.add(l);return[...s]}function V1e(e){switch(e.provider){case"codemod.com":return{bin:"npx",args:["--yes","codemod@latest","run",`${e.name}@${e.version}`]};case"openrewrite":return{bin:"mvn",args:["-q","org.openrewrite.maven:rewrite-maven-plugin:run",`-Drewrite.activeRecipes=${e.name}`,`-Drewrite.recipeArtifactCoordinates=${e.source}:${e.version}`]};default:return null}}var B1e=8;function tte(e){let t=e.filter(r=>r.before!==r.after);if(t.length===0)return{ops:[],unexplained:[]};let n=[];for(;n.lengthgx(n,a.before)!==a.after);if(r.length===0)break;let o=new Map;for(let a of r){let c=gx(n,a.before);for(let l of q1e({...a,before:c}))o.set(JSON.stringify(l),l)}let s=null;for(let[a,c]of o){let l=[...n,c],u=r.filter(d=>gx(l,d.before)===d.after).length;u!==0&&(!s||u>s.score||u===s.score&&agx(n,r.before)!==r.after);return{ops:n,unexplained:i}}function gx(e,t){let n=t;for(let i of e)n=Mee(n,i);return n}function q1e(e){let t=[],n=Qee(e.before),i=Qee(e.after),r=n.filter(c=>!i.includes(c)),o=i.filter(c=>!n.includes(c));for(let c of new Set(r))for(let l of new Set(o))t.push({kind:"rename-identifier",from:c,to:l}),t.push({kind:"rename-member",from:c,to:l}),t.push({kind:"replace-import-path",from:c,to:l});let s=Xee(e.before),a=Xee(e.after);for(let c of s.filter(l=>!a.includes(l)))for(let l of a.filter(u=>!s.includes(u)))t.push({kind:"replace-import-path",from:c,to:l});for(let c of["await","new"])if(!(e.before.includes(`${c} `)||!e.after.includes(`${c} `)))for(let l of ete(e.after))t.push({kind:"wrap-call",callee:l,wrapper:c});for(let c of ete(e.before))for(let l of W1e(e.before,e.after))for(let u=0;u<=4;u++)t.push({kind:"insert-argument",callee:c,index:u,text:l});return t}function Qee(e){return e.match(/[A-Za-z_$][\w$]*/g)??[]}function Xee(e){return[...e.matchAll(/"([^"\\]*)"|'([^'\\]*)'/g)].map(t=>t[1]??t[2]??"")}function ete(e){return[...e.matchAll(/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g)].map(t=>t[1])}function W1e(e,t){let n=[...t.match(/\{[^{}]*\}/g)??[],...t.match(/"[^"\\]*"|'[^'\\]*'/g)??[],...t.match(/\b(?:true|false|null|None|nil)\b/g)??[]];return[...new Set(n.filter(i=>!e.includes(i)))]}async function ite(e){let{candidate:t,change:n,sandbox:i,relevantFiles:r,logger:o}=e,s=e.exec??Xe,a=await Jee(t,i,{exec:s,logger:o});if(a.status!=="applied"||a.changedFiles.length===0)return o.debug(`${t.name}@${t.version} changed nothing Drift could learn a rule from.`),null;let c=[],l=!1;for(let d of a.changedFiles){if(!r.has(d)){l=!0;continue}let p=await K1e(i,d,s);if(!p){l=!0;continue}let f=p.before.split(` `),m=p.after.split(` -`);if(f.length!==m.length)return o.debug(`${t.name} changed the line count of ${d}; that is not expressible as a Drift operation.`),null;for(let g=0;g0?(o.info(`Drift could not re-derive what ${t.name}@${t.version} did to ${u.unexplained.length||c.length} line(s), so it will not apply it. This finding falls through to an agent.`),null):(l&&o.info(`${t.name}@${t.version} also changed files outside this finding's call sites; those edits were not learned from and will not be applied.`),n1({change:n,dependencyChange:e.dependencyChange,migration:t.migration,rationale:`Inferred from ${c.length} edit(s) made by ${t.name}@${t.version} in an isolated worktree, then re-derived as Drift operations. The recipe's own output was discarded.`,citations:[],ops:u.ops,provenance:{author:"recipe",recipe:{name:t.name,version:t.version,publisher:t.publisher,source:t.source},authoredAt:new Date().toISOString()}}))}async function j1e(e,t,n){let i=await n("git",["show",`HEAD:${t}`],{cwd:e});if(i.code!==0)return null;try{return{before:i.stdout,after:await(0,Zee.readFile)((0,Yee.join)(e,t),"utf8")}}catch{return null}}async function Xee(e){let{change:t,candidate:n,sites:i,workspace:r,headSha:o,logger:s}=e;if(!n)return null;let a=new Set(i.filter(c=>c.breakingChangeId===t.id).map(c=>c.file));if(a.size===0)return null;try{return await Uee(r,`fixplan-${n.provider}`,c=>Qee({candidate:n,change:t,dependencyChange:e.dependencyChange,sandbox:c.path,relevantFiles:a,logger:s}),{at:o,...e.env?{env:e.env}:{},copyIgnoredFiles:!1})}catch(c){return s.warn(`Could not observe ${n.name}@${n.version} in an isolated worktree (${c.message}); this finding gets no recipe-derived fix plan.`),null}}var z1e="https://api.codemod.com",l1="https://search.maven.org",u1=6e3;async function tte(e,t){if(!t)return null;let n=rte(t.name),i=t.name.toLowerCase(),r=`${z1e}/registry?search=${encodeURIComponent(n)}`,o=await $e(r,{timeoutMs:u1,cacheTtlMs:3600*1e3});if(!o)return null;let s=Array.isArray(o)?o:o.entries??o.results??o.data??[];if(!Array.isArray(s))return null;let a=s.map(p=>({entry:p,confidence:G1e(p,i,n)})).filter(p=>p.confidence!=="none");if(a.length===0)return null;let c={exact:2,"base-name":1,text:0};a.sort((p,f)=>c[f.confidence]-c[p.confidence]||Number(c1(f.entry))-Number(c1(p.entry)));let l=a[0].entry,u=l.slug??l.name,d=l.version??l.latestVersion;return!u||!d?null:{provider:"codemod.com",name:u,version:d,publisher:l.owner?.name??l.author??l.publisher??"Codemod.com",source:`https://app.codemod.com/registry/${encodeURIComponent(l.slug??u)}`,migration:l.description??l.summary??`Migrates ${t.name} usages.`,official:c1(l)}}function G1e(e,t,n){let i=e.applicability?.flatMap(s=>s.packages??[])??[];if(i.some(s=>s.toLowerCase()===t))return"exact";if(i.some(s=>!s.includes("/")&&s.toLowerCase()===n))return"base-name";let r=`${e.slug??""} ${e.name??""} ${e.description??""} ${e.summary??""}`.toLowerCase(),o=new RegExp(`(?:^|[^a-z0-9])${V1e(n)}(?:$|[^a-z0-9])`);return n&&o.test(r)?"text":"none"}function V1e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function c1(e){if(e.verified||e.official)return!0;let t=(e.owner?.name??e.owner?.slug??e.author??e.publisher??"").toLowerCase();return t==="codemod"||t==="codemod.com"}var B1e=/\borg\.openrewrite\.[a-zA-Z0-9_.]*[A-Z][a-zA-Z0-9_]*\b/;async function nte(e,t){if(!t||t.ecosystem!=="maven")return null;let n=rte(t.name).replace(/[^a-z0-9]/g,"-"),i=await ete(`rewrite-${n}`)??await ete(n);if(!i?.latestVersion)return null;let r=await q1e(i.g,i.a,i.latestVersion),o=r?B1e.exec(r)?.[0]:void 0;return o?{provider:"openrewrite",name:o,version:i.latestVersion,publisher:"OpenRewrite",source:`${l1}/artifact/${i.g}/${i.a}/${i.latestVersion}`,migration:r??`Runs ${o} from ${i.g}:${i.a}.`,official:!0}:null}async function ete(e){let t=encodeURIComponent(`g:org.openrewrite.recipe AND a:${e}`),n=`${l1}/solrsearch/select?q=${t}&core=gav&rows=1&wt=json`,r=(await $e(n,{timeoutMs:u1,cacheTtlMs:3600*1e3}))?.response?.docs?.[0];return r?.g==="org.openrewrite.recipe"?r:null}async function q1e(e,t,n){let i=e.replace(/\./g,"/"),r=`${l1}/remotecontent?filepath=${i}/${t}/${n}/${t}-${n}.pom`,o=await rt(r,{timeoutMs:u1,cacheTtlMs:1440*60*1e3,immutable:!0});if(!o)return null;let s=/([\s\S]*?)<\/description>/.exec(o);return s?s[1].trim():null}function rte(e){return e.replace(/^@[^/]+\//,"").toLowerCase()}var W1e=[tte,nte];async function ite(e,t,n=W1e){let r=(await Promise.all(n.map(o=>o(e,t).catch(()=>null)))).filter(o=>o!==null);return r.length===0?null:(r.sort((o,s)=>Number(s.official)-Number(o.official)),r[0])}var ste={branch:"{prefix}upgrade-{summary}-{date}",title:"chore(deps): upgrade {summary}",prefix:"drift/"};function ate(e,t){let{changes:n}=e,i=e.now??new Date,r=n[0],o=r?n.length===1?`${r.name}-${r.from??"unknown"}-to-${r.to??"unknown"}`:`${n.length}-packages`:"dependencies",s=r?n.length===1?`${r.name} to ${r.to??"a new version"}`:`${n.length} packages`:"dependencies";return{prefix:t,summary:o,"summary-text":s,name:r?.name??"dependencies",from:r?.from??"",to:r?.to??"",count:String(n.length),date:i.toISOString().slice(0,10)}}function cte(e,t){return e.replace(/\{([a-z-]+)\}/g,(n,i)=>t[i]??n)}function ote(e){return(e.toLowerCase().replace(/[^a-z0-9/_.-]+/g,"-").replace(/(?<=[^/])\/(?=[^/])/g,"-").replace(/\.{2,}/g,".").replace(/-{2,}/g,"-").replace(/^[-./]+|[-./]+$/g,"").replace(/\.lock$/,"-lock")||"drift-upgrade").slice(0,200).replace(/[-./]+$/,"")}function lte(e,t={}){let n={...ste,...t},i=n.prefix?`${n.prefix.replace(/\/+$/,"")}/`:"",r=cte(n.branch,ate(e,i));return r.startsWith(i)&&i?`${i}${ote(r.slice(i.length))}`:ote(r)}function ute(e,t={}){let n={...ste,...t},i=ate(e,n.prefix);return cte(n.title,{...i,summary:i["summary-text"]}).trim()}var dte={"runtime-requirement":0,"config-change":1,"module-system-change":1,"moved-export":1,"removed-export":2,"renamed-export":2,"removed-endpoint":3,"changed-endpoint":3,"signature-change":4,"type-change":4,"required-field-added":5,"default-change":5,"behaviour-change":6,unknown:7};function H1e(e){switch(e){case"runtime-requirement":case"config-change":case"module-system-change":return"build";case"behaviour-change":case"default-change":return"fix";default:return"refactor"}}function hte({breakingChanges:e,impactSites:t,dispositions:n,config:i,changes:r=[],codemods:o,recipes:s,fixPlans:a}){let c=K1e(t),l=new Map((n??[]).map(k=>[k.changeId,k.actionableSites])),u=new Map(n?.map(k=>[k.changeId,k])),d=e.filter(k=>{let _=u.get(k.id);return _?_.state==="actionable"&&_.actionableSites.length>0:(c.get(k.id)??[]).some(S=>S.confidence==="high"&&S.runtimeVerdict===void 0)});if(d.length===0)return{commits:[],edges:[],cohorts:mte(r),blockers:[]};let f=[...i.remediation.commitGranularity==="single"?[d]:i.remediation.commitGranularity==="per-dependency"?J1e(d):d.map(k=>[k])].sort(Z1e),m=mte(r),g=new Map;for(let k of m)for(let _ of k.dependencies)g.set(_,k);let h=f.map((k,_)=>Y1e(k,_+1,l,f.length,o,s,a)),b=tUe(h,e,t,g),y=oUe(h,b),w=y.cycle.length>0?sUe(y.cycle,b):void 0;return{commits:y.commits,edges:b,cohorts:m,blockers:w?[w]:[]}}function K1e(e){let t=new Map;for(let n of e){let i=t.get(n.breakingChangeId);i?i.push(n):t.set(n.breakingChangeId,[n])}return t}function J1e(e){let t=new Map;for(let n of e){let i=t.get(n.dependency);i?i.push(n):t.set(n.dependency,[n])}return[...t.values()]}function Z1e(e,t){let n=Math.min(...e.map(s=>dte[s.kind])),i=Math.min(...t.map(s=>dte[s.kind]));if(n!==i)return n-i;let r=e[0]?.dependency??"",o=t[0]?.dependency??"";return r.localeCompare(o)}function Y1e(e,t,n,i,r,o,s){let a=e.flatMap(f=>n.get(f.id)??[]),c=[...new Set(a.map(f=>f.file))].sort(),l=e[0],u=r?eUe(e,n,r):void 0,d=!u&&s?Q1e(e,n,s):void 0,p=!u&&o?X1e(e,o):void 0;return{id:St("unit",e.map(f=>f.id).sort().join(","),c.join(","),l.dependency,l.kind),order:t,message:dUe(e,c.length),body:mUe(e,a,u,p),breakingChangeIds:e.map(f=>f.id),files:c,allowedFiles:c,allowedSymbols:[...new Set(e.flatMap(f=>f.symbols))].sort(),instructions:gUe(e,a,t,i),dependsOn:[],dependencyReasons:[],executionLayer:0,expectedChecks:aUe(e,c),invalidationTriggers:cUe(e,c),...u?{codemod:u}:{},...d?{fixPlan:d}:{},...p?{recipe:p}:{}}}function Q1e(e,t,n){let i=e.map(a=>n.get(a.id)).filter(a=>!!a);if(i.length===0)return;let r=e.filter(a=>!n.has(a.id)).flatMap(a=>(t.get(a.id)??[]).map(c=>({file:c.file,line:c.line,reason:`No fix plan was accepted for "${a.summary}", so this site needs an agent.`}))),o=i[0],s=i.flatMap(a=>a.anchors);return{plan:o.plan,assurance:i.some(a=>a.assurance==="checked")?"checked":"proven",files:[...new Set(s.map(a=>a.file))].sort(),anchors:s,covered:i.reduce((a,c)=>a+c.covered,0),residual:i.reduce((a,c)=>a+c.residual,0)+r.length,residualSites:[...i.flatMap(a=>a.sites.filter(c=>c.status==="residual").map(c=>({file:c.file,line:c.line,reason:c.reason??"No rule matched."}))),...r]}}function X1e(e,t){let n=[];for(let i of e){let r=t.get(i.id);if(!r)return;n.push(r)}return n.length>0?n:void 0}function eUe(e,t,n){let i=new Set,r=[];for(let o of e){let s=t.get(o.id)??[],a=n.get(o.id);if(!a||a.sitesResolvedl.file))];if(c.some(l=>i.has(l)))return;for(let l of c)i.add(l);r.push({...a.transform,files:c})}return r.length>0?r:void 0}function tUe(e,t,n,i){let r=new Map,o=new Map(t.map(c=>[c.id,c])),s=new Map;for(let c of n){let l=s.get(c.file);l?l.push(c):s.set(c.file,[c])}let a=(c,l,u,d)=>{if(c.id===l.id)return;let p=`${c.id}\0${l.id}\0${u}`;r.has(p)||r.set(p,{from:c.id,to:l.id,reason:u,evidence:[...new Set(d)].sort()})};for(let c=0;cf.dependency)),p=new Set(l.allowedFiles);for(let f=c+1;fk.dependency)),b=m.allowedFiles.filter(k=>p.has(k));b.length>0&&a(l,m,"same-file-conflict",b),u.some(k=>k.kind==="runtime-requirement")&&a(l,m,"runtime-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="config-change"||k.kind==="module-system-change")&&g.some(k=>d.has(k.dependency))&&a(l,m,"configuration-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="moved-export")&&rUe(u,g)&&a(l,m,"import-prerequisite",u.flatMap(k=>k.symbols)),l.allowedFiles.some(d1)&&!m.allowedFiles.every(d1)&&nUe(d,h)&&a(l,m,"generated-output",l.allowedFiles.filter(d1));let y=[...d].map(k=>i.get(k)).filter(k=>!!k).filter(k=>g.some(_=>k.dependencies.includes(_.dependency)));for(let k of y)a(l,m,"package-cohort",[`${k.id}: ${k.reason}`]);let w=iUe(l,m,s);w.length>0&&a(l,m,"symbol-dependency",w)}}return[...r.values()].sort(yte)}function pte(e,t){return e.breakingChangeIds.map(n=>t.get(n)).filter(n=>!!n)}function nUe(e,t){for(let n of e)if(t.has(n))return!0;return!1}function rUe(e,t){let n=e.filter(i=>i.kind==="moved-export");if(n.length===0)return!1;for(let i of n){let r=new Set([...i.symbols,...i.replacementSymbols??[]]);if(t.some(o=>o.dependency===i.dependency&&o.symbols.some(s=>r.has(s))))return!0}return!1}function d1(e){return/(^|\/)(__generated__|generated|gen)\//i.test(e)||/\.(generated|gen)\./i.test(e)}function iUe(e,t,n){let i=new Set(e.allowedSymbols??[]);if(i.size===0)return[];let r=[];for(let o of t.allowedFiles)for(let s of n.get(o)??[])s.enclosingSymbol&&i.has(s.enclosingSymbol)&&r.push(`${o}:${s.line} is inside ${s.enclosingSymbol}`);return r}function yte(e,t){return e.from.localeCompare(t.from)||e.to.localeCompare(t.to)||e.reason.localeCompare(t.reason)||e.evidence.join("\0").localeCompare(t.evidence.join("\0"))}function oUe(e,t){let n=new Map(e.map(a=>[a.id,a])),i=new Map;for(let a of e)i.set(a.id,new Set);for(let a of t)!n.has(a.from)||!n.has(a.to)||i.get(a.to).add(a.from);let r=new Set(e.map(a=>a.id)),o=new Map,s=0;for(;r.size>0;){let a=[...r].filter(c=>[...i.get(c)??[]].every(l=>!r.has(l))).map(c=>n.get(c)).sort((c,l)=>c.order-l.order||c.id.localeCompare(l.id));if(a.length===0)return{commits:fte(e,t,o),cycle:[...r].sort()};for(let c of a)o.set(c.id,s),r.delete(c.id);s+=1}return{commits:fte(e,t,o),cycle:[]}}function fte(e,t,n){let i=new Map;for(let r of t){let o=i.get(r.to);o?o.push(r):i.set(r.to,[r])}return e.map(r=>{let o=[...i.get(r.id)??[]].sort(yte);return{...r,dependsOn:o.map(s=>s.from).sort(),dependencyReasons:o,executionLayer:n.get(r.id)??0}}).sort((r,o)=>r.executionLayer-o.executionLayer||r.order-o.order||r.id.localeCompare(o.id)).map((r,o)=>({...r,order:o+1}))}function sUe(e,t){let n=t.filter(i=>e.includes(i.from)&&e.includes(i.to)).slice(0,5).map(i=>`${i.from} -> ${i.to} (${i.reason})`).join("; ");return`The remediation graph contains a dependency cycle across ${e.length} commit unit(s): ${n}. Drift cannot automatically execute this plan until the inseparable work is combined or reviewed manually.`}function aUe(e,t){let n=[];return e.some(i=>i.kind==="signature-change"||i.kind==="type-change"||i.kind==="removed-export"||i.kind==="renamed-export"||i.kind==="moved-export")&&n.push({id:St("check","typecheck",e.map(i=>i.id).sort().join(",")),kind:"typecheck",reason:"API-shape and type-contract migrations should be checked by the repository type checker when available."}),e.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push({id:St("check","test",e.map(i=>i.id).sort().join(",")),kind:"test",reason:"Behavioural and default changes need tests because compilation can still succeed with wrong behaviour."}),t.some(i=>/(^|\/)(package\.json|tsconfig\.json|vite\.config|webpack\.config|rollup\.config)/.test(i))&&n.push({id:St("check","build",t.join(",")),kind:"build",reason:"Configuration and package-entry changes can alter the build graph."}),n}function cUe(e,t){let n=[...t.map(i=>`file:${i}`),...e.flatMap(i=>i.symbols.map(r=>`symbol:${r}`)),...e.map(i=>`dependency:${i.dependency}`)];return[...new Set(n)].sort()}function mte(e){let t=[],n=new Map;for(let i of e){let r=n.get(i.ecosystem);r?r.push(i):n.set(i.ecosystem,[i])}for(let[i,r]of n)for(let o of lUe(r)){if(o.length<2)continue;let s=o.map(a=>a.name).sort();t.push({id:St("cohort",i,s.join(",")),ecosystem:o[0].ecosystem,dependencies:s,constraints:o.map(a=>({dependency:a.name,ecosystem:a.ecosystem,range:a.rawTo??a.to??"*",source:"workspace-family"})),candidatePaths:[...new Set(o.map(a=>a.manifestPath))].sort(),reason:`These ${i} packages appear to be part of the same ${uUe(o[0].name)} upgrade family and should be reviewed together.`})}return t.sort((i,r)=>i.id.localeCompare(r.id))}function lUe(e){let t=new Map;for(let n of e){let i=bte(n.name);if(!i)continue;let r=t.get(i);r?r.push(n):t.set(i,[n])}return[...t.values()]}function bte(e){let t=[/^(@angular)\//,/^(@babel)\//,/^(@nestjs)\//,/^(@types)\//,/^(@vue)\//,/^(react)(?:$|-)/,/^(next)(?:$|-)/,/^(eslint)(?:$|-)/,/^(jest)(?:$|-)/,/^(webpack)(?:$|-)/,/^(vite)(?:$|-)/];for(let n of t){let i=n.exec(e);if(i?.[1])return i[1]}if(e.startsWith("@")){let n=e.split("/")[0];return n&&n!==e?n:null}return null}function uUe(e){return pK(bte(e)??e,32)}function dUe(e,t){let n=e[0],i=H1e(n.kind),r=fUe(e);return e.length===1?gte(`${i}(${r}): ${pUe(n)}`):gte(`${i}(${r}): update ${e.length} usages for the new ${n.dependency} API`)}function pUe(e){let t=e.symbols[0],n=e.replacementSymbols?.[0];switch(e.kind){case"removed-export":return t?`replace removed \`${t}\``:"replace removed API";case"renamed-export":return t&&n?`migrate \`${t}\` to \`${n}\``:`migrate renamed \`${t??"API"}\``;case"moved-export":return`import ${t?`\`${t}\``:"the API"} from its new entry point`;case"signature-change":return t?`update \`${t}\` call sites for the new signature`:"update call sites for new signatures";case"type-change":return t?`adapt to the new \`${t}\` type`:"adapt to changed types";case"removed-endpoint":return t?`migrate calls to removed endpoint \`${t}\``:"migrate removed endpoint calls";case"changed-endpoint":return t?`update requests to \`${t}\``:"update API requests";case"required-field-added":return t?`supply now-required \`${t}\``:"supply newly-required fields";case"default-change":return t?`pin previous default for \`${t}\``:"account for changed defaults";case"runtime-requirement":return e.summary.toLowerCase().startsWith("minimum")?e.summary.charAt(0).toLowerCase()+e.summary.slice(1):"raise the minimum runtime version";case"config-change":return"update configuration for the new version";case"module-system-change":return/commonjs/i.test(e.summary)?"replace dropped CommonJS usage":"migrate incompatible module loading";case"behaviour-change":return t?`handle changed \`${t}\` behaviour`:"handle changed behaviour";default:return`update usage of \`${e.dependency}\``}}function fUe(e){let t=[...new Set(e.map(n=>n.dependency))];if(t.length===1){let n=t[0];return n.startsWith("@")?n.split("/")[1]??n:n.split(":").pop()??n}return"deps"}function gte(e){return e.length<=72?e:`${e.slice(0,69)}...`}function mUe(e,t,n,i){let r=[];for(let s of e)r.push(s.summary),r.push(""),r.push(s.remediation),r.push("");let o=[...new Set(t.map(s=>s.file))];if(r.push(`Affects ${t.length} location(s) across ${o.length} file(s).`),r.push(""),n){let s=new Set(n.flatMap(a=>a.files)).size;r.push(`Resolved deterministically by Drift's codemod engine across ${s} file(s) \u2014 no model call was made for this commit.`)}else if(i&&i.length>0){let s=[...new Map(i.map(c=>[`${c.provider}:${c.name}@${c.version}`,c])).values()],a=s.map(c=>`${c.name}@${c.version} (${c.provider}, published by ${c.publisher})`).join(", ");r.push(`Community recipe available: ${a}. Not applied without an explicit choice \u2014 see ${s[0].source}.`)}else r.push("Identified by Drift from upstream evidence; see the pull request"),r.push("description for the citations behind this change.");return r.join(` -`).trim()}function gUe(e,t,n,i){let r=[];r.push(`## Commit ${n} of ${i}`),r.push("");for(let o of e){r.push(`### ${o.summary}`),r.push(""),r.push(`- Dependency: \`${o.dependency}\``),r.push(`- Change type: ${o.kind}`),r.push(`- Confidence: ${o.confidence}`),r.push(""),r.push(o.remediation),r.push("");let s=t.filter(a=>a.breakingChangeId===o.id);if(s.length>0){r.push("Known locations (verify each; there may be others):"),r.push("");for(let a of s.slice(0,40)){let c=a.enclosingSymbol?` in \`${a.enclosingSymbol}\``:"";r.push(`- \`${a.file}:${a.line}\`${c} \u2014 \`${a.excerpt}\``)}s.length>40&&r.push(`- \u2026and ${s.length-40} more matches of the same symbols`),r.push("")}}return r.join(` -`).trim()}var vte=["detect","evidence","surface","static-analysis","upgrade-discovery","upgrade-install","verify","fix","pull-request"],m1={detect:"Detect",evidence:"Evidence",surface:"API surface","static-analysis":"Static analysis","upgrade-discovery":"Find upgrades","upgrade-install":"Install a version",verify:"Verify",fix:"Fix","pull-request":"Automated PR"},ge=()=>({level:"full"}),he=(e,t)=>({level:"partial",note:e,...t?{requires:t}:{}}),tu=e=>({level:"none",note:e}),sc="Resolves imports against the module names the published package declares, follows re-exports inside your repository, and matches references to symbols named in the evidence. Cannot see through reflection, dynamic dispatch, or generated code.",hUe="Matches imports and references to symbols named in the evidence, using the ecosystem's own module-naming convention where no published module list exists. Cannot see through reflection, dynamic dispatch, or generated code.",p1="Compares the declarations in both versions' public headers, which is what a consumer compiles against. Declarations behind preprocessor conditionals are read as written, not per build configuration.",f1="Matches `#include` directives and references to symbols named in the evidence, following includes through your own headers so a library reached indirectly still counts. A macro-generated call site is invisible.",yUe={npm:{ecosystem:"npm",localizationBasis:"declared",label:"JavaScript / TypeScript",files:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","npm-shrinkwrap.json"],managers:["npm","pnpm","Yarn (classic)","Yarn (berry)","Bun"],support:{detect:ge(),evidence:ge(),surface:he("Diffs published TypeScript declarations. A package that ships no declarations of its own falls back to prose evidence rather than reporting a clean comparison."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs the typecheck, test, and build scripts the project's package.json actually declares."),fix:ge(),"pull-request":ge()}},pypi:{ecosystem:"pypi",localizationBasis:"published",label:"Python",files:["pyproject.toml","requirements.in","requirements.txt","setup.py","poetry.lock","uv.lock","Pipfile"],managers:["pip","Poetry","uv"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public surface reconstructed from published type stubs. Packages without stubs fall back to prose evidence.","a local Python interpreter"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs mypy/pyright and pytest when the project declares them."),fix:ge(),"pull-request":ge()}},go:{ecosystem:"go",localizationBasis:"declared",label:"Go",files:["go.mod","go.sum"],managers:["Go modules"],support:{detect:ge(),evidence:ge(),surface:he("Compares the exported API of both module versions.","the Go toolchain"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `go vet`, `go test`, and `go build`.","the Go toolchain"),fix:ge(),"pull-request":ge()}},cargo:{ecosystem:"cargo",localizationBasis:"declared",label:"Rust",files:["Cargo.toml","Cargo.lock"],managers:["Cargo"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public API of both crate versions.","cargo-public-api"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `cargo check`, `cargo test`, and `cargo build`.","the Rust toolchain"),fix:ge(),"pull-request":ge()}},maven:{ecosystem:"maven",localizationBasis:"published",label:"Java / Kotlin / Scala",files:["pom.xml","build.gradle","build.gradle.kts","gradle/libs.versions.toml","build.sbt"],managers:["Maven","Gradle","sbt"],support:{detect:he("Reads pom.xml, Gradle build files and version catalogs, and sbt coordinates. Gradle versions computed at configuration time are not visible without running Gradle."),evidence:ge(),surface:he("Compares both published JARs.","japicmp"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs Maven or Gradle. sbt projects verify through sbt when it is installed."),fix:he("Maven and sbt are edited through the build file; Gradle versions declared outside a version catalog may need a manual edit."),"pull-request":ge()}},rubygems:{ecosystem:"rubygems",localizationBasis:"published",label:"Ruby",files:["Gemfile","Gemfile.lock","*.gemspec"],managers:["Bundler"],support:{detect:ge(),evidence:ge(),surface:tu("Ruby has no static public API surface to compare, so upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs RSpec or Rake when the Gemfile declares them.","Bundler"),fix:ge(),"pull-request":ge()}},nuget:{ecosystem:"nuget",localizationBasis:"published",label:".NET",files:["*.csproj","*.fsproj","*.vbproj","Directory.Packages.props","packages.lock.json"],managers:["NuGet"],support:{detect:ge(),evidence:he("Registry metadata, published versions, deprecation, and OSV advisories. Release notes depend on the package declaring a GitHub repository."),surface:he("Compares the public types and member signatures in both versions' published assemblies, preferring the reference assembly and a common target framework. A package that ships only native binaries, analyzers, or nothing at all has no surface to compare."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dotnet build` and `dotnet test`.","the .NET SDK"),fix:ge(),"pull-request":ge()}},packagist:{ecosystem:"packagist",localizationBasis:"published",label:"PHP",files:["composer.json","composer.lock"],managers:["Composer"],support:{detect:ge(),evidence:he("Registry metadata, published versions, abandonment notices, and OSV advisories. Release notes depend on the package declaring a source repository."),surface:tu("PHP publishes no machine-comparable API artefact; upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he("Resolves `use` statements against the PSR-4 and PSR-0 roots the package declares in its own composer.json, read from Packagist. A package that autoloads only by classmap declares no namespace root and is not localized."),"upgrade-discovery":ge(),verify:he("Runs PHPUnit when composer.json declares it.","Composer"),fix:ge(),"pull-request":ge()}},hex:{ecosystem:"hex",localizationBasis:"published",label:"Elixir / Erlang",files:["mix.exs","mix.lock"],managers:["Mix"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retirement notices, and OSV advisories."),surface:he("Compares the public modules and their functions, by name and arity, in both versions' published sources \u2014 `def` and `defmacro` in Elixir, `-export` in Erlang. A function a macro generates at compile time is not visible without compiling."),"static-analysis":he("Resolves module references against every module the released tarball defines, so a fully qualified call needs no `alias` to be found. Cannot see through `apply/3` or a module name computed at runtime."),"upgrade-discovery":ge(),verify:he("Runs `mix compile --warnings-as-errors` and `mix test`.","Elixir and Mix"),fix:ge(),"pull-request":ge()}},pub:{ecosystem:"pub",localizationBasis:"declared",label:"Dart / Flutter",files:["pubspec.yaml","pubspec.lock"],managers:["Dart pub","Flutter"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retraction, and OSV advisories. Release notes depend on the package declaring a repository."),surface:he("Compares the public declarations of both versions' published libraries, following each `export` out of the private `lib/src` tree the way a consumer's import does. Read from source rather than from a compiled artefact."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dart analyze` and `dart test`, or their Flutter equivalents.","the Dart or Flutter SDK"),fix:ge(),"pull-request":ge()}},swift:{ecosystem:"swift",localizationBasis:"published",label:"Swift",files:["Package.swift","Package.resolved"],managers:["Swift Package Manager"],support:{detect:he("Reads literal `.package(...)` declarations and Package.resolved. Versions computed by Swift code at manifest-evaluation time are not visible without running SwiftPM."),evidence:he("Source repository, releases, and changelogs, because SwiftPM identifies packages by git URL. There is no central registry to query for deprecation."),surface:tu("Comparing two Swift module interfaces needs a local toolchain and a built artefact Drift does not produce; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the library and target names declared in the dependency's own Package.swift at the resolved version. A module name a manifest computes at evaluation time is not visible without running SwiftPM."),"upgrade-discovery":he("Versions are git tags, since SwiftPM has no package registry to ask. Drift lists them for packages hosted on GitHub; anything on another git host is reported as unchecked rather than up to date."),verify:he("Runs `swift build` and `swift test`.","the Swift toolchain"),fix:ge(),"pull-request":ge()}},cocoapods:{ecosystem:"cocoapods",localizationBasis:"published",label:"CocoaPods",files:["Podfile","Podfile.lock","*.podspec"],managers:["CocoaPods"],support:{detect:ge(),evidence:he("Release notes and changelogs when the pod declares a GitHub source. CocoaPods publishes no queryable metadata API, so there is no deprecation or advisory signal."),surface:tu("Drift does not compare compiled iOS frameworks; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the `module_name` the pod declares in its podspec, read from the CocoaPods CDN. A pod that builds its module name in Ruby at podspec-evaluation time is not visible without running CocoaPods."),"upgrade-discovery":ge(),verify:tu("Building an iOS target needs Xcode and a scheme Drift cannot infer; verification stays with the developer."),fix:ge(),"pull-request":ge()}},opam:{ecosystem:"opam",localizationBasis:"convention",label:"OCaml",files:["*.opam","dune-project","*.opam.locked"],managers:["opam"],support:{detect:ge(),evidence:he("Release notes and changelogs when the package declares a GitHub source. opam has no JSON metadata API, so there is no registry deprecation signal."),surface:tu("Comparing two OCaml module interfaces needs a built switch Drift does not create; upgrades rest on prose evidence."),"static-analysis":he(hUe),"upgrade-discovery":he("opam publishes no version API, so releases are read from the package directories in the opam-repository index. A package published only in a custom repository is reported as unchecked rather than up to date."),verify:he("Runs `dune build` and `dune runtest`.","opam and dune"),fix:ge(),"pull-request":ge()}},conan:{ecosystem:"conan",localizationBasis:"convention",label:"C / C++ (Conan)",files:["conanfile.txt","conanfile.py","conan.lock"],managers:["Conan"],support:{detect:he("Reads conanfile.txt, conan.lock, and the literal `requires` declarations in conanfile.py. A reference a recipe builds at evaluation time is not visible without running Python."),evidence:he("Versions from the ConanCenter recipe index, and releases and changelogs from the upstream project the recipe builds \u2014 not from the recipe itself. ConanCenter publishes no deprecation signal, and OSV has no Conan ecosystem."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":he("Conan version schemes are package-defined, so Drift can analyze exact version changes but does not invent an ordering to select a newer release automatically."),verify:he("Runs `conan build`, which is the compiler \u2014 in C and C++ an incompatible header change is a build failure rather than a runtime surprise.","Conan"),fix:ge(),"pull-request":ge()}},vcpkg:{ecosystem:"vcpkg",localizationBasis:"convention",label:"C / C++ (vcpkg)",files:["vcpkg.json","vcpkg-configuration.json"],managers:["vcpkg"],support:{detect:he("Reads declared dependencies, `version>=` floors, and `overrides`. A registry baseline moving changes every unpinned version at once; Drift reports the baseline move rather than resolving it to versions."),evidence:he("Versions from the vcpkg versions database, and releases and changelogs from the port's upstream project. vcpkg publishes no deprecation signal, and OSV has no vcpkg ecosystem."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":he("vcpkg versions are port-defined and baseline resolution can change every dependency, so Drift analyzes exact overrides but does not invent an ordering or resolve baseline moves automatically."),verify:he("Runs the project's CMake build, which is where an incompatible header change surfaces.","CMake"),fix:ge(),"pull-request":ge()}},arduino:{ecosystem:"arduino",localizationBasis:"convention",label:"Arduino / PlatformIO",files:["library.properties","platformio.ini"],managers:["Arduino CLI","PlatformIO"],support:{detect:ge(),evidence:he("Versions and repositories from the Arduino Library Manager index, plus releases and changelogs from the library's own repository. A library published only to PlatformIO has metadata but no version history, because that registry serves only the current release."),surface:he(p1),"static-analysis":he(f1),"upgrade-discovery":ge(),verify:he("Runs `arduino-cli compile` or `pio run`, and `pio test` where the project has tests.","Arduino CLI or PlatformIO"),fix:ge(),"pull-request":ge()}}};function bUe(e){let t=ua.filter(s=>s.ecosystem===e),n={name:"example",version:"1.0.0",kind:"runtime"},i=t.filter(s=>s.upgrade(n)!==null),r=t.filter(s=>s.upgrade(n)===null);if(r.length===0)return ge();let o=s=>s.map(a=>a.label).join(", ");return i.length===0?tu(`${o(r)} ${r.length===1?"has":"have"} no command that pins a version \u2014 the coordinate lives in a build file the tool will not rewrite. Drift reports the version to set and where, and leaves the edit to you.`):he(`${o(i)} can install a chosen version directly. ${o(r)} cannot: the version lives in a build file the tool will not rewrite, so Drift tells you what to change instead of running something that silently changes nothing.`)}var vUe=Object.values(yUe).map(e=>({...e,support:{...e.support,"upgrade-install":bUe(e.ecosystem)}})),wUe=Object.fromEntries(vUe.map(e=>[e.ecosystem,e]));function wte(e){return wUe[e]}var g1=require("node:crypto");var Cf=3,h1=[Cf];function ri(e){return e===null||typeof e!="object"?JSON.stringify(e??null)??"null":Array.isArray(e)?`[${e.map(n=>ri(n)).join(",")}]`:`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>ni?1:0).map(([n,i])=>`${JSON.stringify(n)}:${ri(i)}`).join(",")}}`}function kUe(e){return{id:e.id,source:e.source,dependency:e.dependency,url:e.url??null,locator:e.locator??null,title:e.title,contentHash:(0,g1.createHash)("sha256").update(e.content).digest("hex"),weight:e.weight,findings:(e.findings??[]).map(t=>({code:t.code,symbol:t.symbol,detail:t.detail,before:t.before??null,after:t.after??null}))}}function $Ue(e){return{nature:e.nature,detectability:[...e.detectability].sort(),scope:e.scope,visibility:[...e.visibility].sort(),origin:e.origin}}function _Ue(e){return{schemaVersion:Cf,id:e.id,baseBranch:e.baseBranch,headSha:e.headSha,risk:e.risk,blockers:[...e.blockers],warnings:[...e.warnings],changes:e.changes.map(t=>({name:t.name,ecosystem:t.ecosystem,from:t.from,to:t.to,kind:t.kind,bump:t.bump,manifestPath:t.manifestPath,workspace:t.workspace??null})),breakingChanges:e.breakingChanges.map(t=>({id:t.id,dependency:t.dependency,kind:t.kind,summary:t.summary,remediation:t.remediation,symbols:[...t.symbols].sort(),replacementSymbols:[...t.replacementSymbols??[]].sort(),confidence:t.confidence,taxonomy:$Ue(Or(t)),assessment:t.assessment?{upstream:t.assessment.upstream.score,localImpact:t.assessment.localImpact.score,verification:t.assessment.verification.score,automaticExecutionEligible:t.assessment.automaticExecutionEligible,calibration:t.assessment.upstream.calibration}:null,citations:[...t.citations].sort()})),impactSites:e.impactSites.map(t=>({breakingChangeId:t.breakingChangeId,file:t.file,line:t.line,matchedSymbol:t.matchedSymbol,enclosingSymbol:t.enclosingSymbol??null,confidence:t.confidence})),commits:e.commits.map(t=>({id:t.id,order:t.order,message:t.message,body:t.body,breakingChangeIds:[...t.breakingChangeIds].sort(),files:[...t.files].sort(),allowedFiles:[...t.allowedFiles].sort(),allowedSymbols:[...t.allowedSymbols??[]].sort(),instructions:t.instructions,dependsOn:[...t.dependsOn].sort(),dependencyReasons:[...t.dependencyReasons].map(n=>({from:n.from,to:n.to,reason:n.reason,evidence:[...n.evidence].sort()})).sort((n,i)=>ri(n).localeCompare(ri(i))),executionLayer:t.executionLayer,expectedChecks:[...t.expectedChecks].map(n=>({id:n.id,kind:n.kind,command:n.command??null,reason:n.reason})).sort((n,i)=>ri(n).localeCompare(ri(i))),invalidationTriggers:[...t.invalidationTriggers].sort()})),planEdges:[...e.planEdges].map(t=>({from:t.from,to:t.to,reason:t.reason,evidence:[...t.evidence].sort()})).sort((t,n)=>ri(t).localeCompare(ri(n))),upgradeCohorts:[...e.upgradeCohorts].map(t=>({id:t.id,ecosystem:t.ecosystem,dependencies:[...t.dependencies].sort(),constraints:[...t.constraints].map(n=>({dependency:n.dependency,ecosystem:n.ecosystem,range:n.range,source:n.source})).sort((n,i)=>ri(n).localeCompare(ri(i))),candidatePaths:[...t.candidatePaths].sort(),reason:t.reason})).sort((t,n)=>t.id.localeCompare(n.id)),evidence:e.evidence.map(kUe),gaps:[...e.gaps].map(t=>({stage:t.stage,dependency:t.dependency??null,ecosystem:t.ecosystem??null,surface:t.surface,severity:t.severity,automaticExecution:t.automaticExecution})).sort((t,n)=>ri(t).localeCompare(ri(n)))}}function lx(e){return(0,g1.createHash)("sha256").update(ri(_Ue(e))).digest("hex")}function SUe(e,t,n){return t.breakingChangeId!==e.id||t.confidence!=="high"?!1:e.kind!=="runtime-requirement"?!0:n?.changeId===e.id&&n.state==="incompatible"&&t.runtimeVerdict==="incompatible"}function xUe(e){let t=new Set,n=[];for(let i of e){let r=`${i.file}:${i.line}:${i.column??""}:${i.matchedSymbol??""}`;t.has(r)||(t.add(r),n.push(i))}return n}function Pf(e,t,n,i,r=!0){let o=new Map;for(let s of n){let a=o.get(s.changeId);a?a.push(s):o.set(s.changeId,[s])}return e.map(s=>{let a=xUe(t.filter(d=>d.breakingChangeId===s.id)),c=o.get(s.id)??[],l=c.length===1?c[0]:void 0,u=a.filter(d=>SUe(s,d,l));if(s.kind==="runtime-requirement"){if(!l)return{changeId:s.id,state:"unknown",reason:"not-localized",sites:a,actionableSites:u};let d={changeId:s.id,sites:a,actionableSites:u,runtimeAnalysis:{runtime:l.runtime,state:l.state,reason:l.reason}};return l.state==="incompatible"?{...d,state:"actionable",reason:"runtime-incompatible"}:l.state==="partial"?{...d,state:"review-only",reason:"runtime-partial"}:l.state==="unknown"?{...d,state:"review-only",reason:"runtime-unknown"}:{...d,state:"unaffected",reason:"runtime-compatible"}}return u.length>0?{changeId:s.id,state:"actionable",reason:"high-confidence-impact",sites:a,actionableSites:u}:a.length>0?{changeId:s.id,state:"review-only",reason:"low-confidence-impact",sites:a,actionableSites:u}:i?r?{changeId:s.id,state:"unknown",reason:"impact-unresolved",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"localization-incomplete",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"not-localized",sites:[],actionableSites:[]}})}function kte(e){return e.assessment?_7(e.assessment):e.confidence}function ux(e){let{repo:t,config:n,changes:i,evidence:r,impactSites:o}=e,s=EUe(e),a=Pf(s,o,e.runtimeAnalyses??e.rationale?.flatMap(m=>m.runtimeAnalyses??[])??[],e.localizationRan??!0,e.localizationComplete??!0),c=hte({breakingChanges:s,impactSites:o,dispositions:a,config:n,changes:i,codemods:e.codemods,recipes:e.recipes,fixPlans:e.fixPlans}),l=c.commits,u=y1(i,s,o,(e.rationale??[]).map(m=>m.assessment.runtimeCompatibility),a),d=TUe(e,s,l),{blockers:p,warnings:f}=RUe(e,s,l,u,d);return{schemaVersion:Cf,id:St("plan",t.owner,t.repo,t.afterSha),branchName:AUe(n,i,t.afterSha),baseBranch:t.baseBranch,headSha:t.afterSha,changes:[...i],evidence:[...r],breakingChanges:s,upstreamBreakingCount:s.length,impactSites:[...o],dispositions:a,localizationRan:e.localizationRan??!0,localizationComplete:e.localizationComplete??!0,runtimeConfigComplete:e.runtimeConfigComplete??!0,commits:l,planEdges:c.edges,upgradeCohorts:c.cohorts,...e.rationale?{rationale:[...e.rationale]}:{},risk:u,gaps:d,checkedSurfaces:[...e.checkedSurfaces??[]],confirmedRegressions:[...e.confirmedRegressions??[]],blockers:[...c.blockers,...p],warnings:f,createdAt:new Date().toISOString()}}function EUe(e){let{evidence:t,breakingChanges:n,impactSites:i}=e,r=e.localizationRan??!0,o=e.localizationComplete??!0;return n.map(s=>{let a=i.filter(p=>p.breakingChangeId===s.id),c=Or(s),l=(e.runtimeAnalyses??[]).find(p=>p.changeId===s.id)?.state,u=(e.verification??[]).filter(p=>p.breakingChangeIds!==void 0?p.breakingChangeIds.includes(s.id):p.dependency===void 0?!0:p.dependency===s.dependency&&p.workspace===s.workspace),d=$7({change:s,taxonomy:c,evidence:t,sites:a,localizationRan:r,localizationComplete:o,runtimeState:l,outcomes:u,checkedSurfaces:e.checkedSurfaces??[],gaps:[]});return{...s,taxonomy:c,assessment:d}})}function TUe(e,t,n){let{changes:i,evidence:r,impactSites:o,config:s}=e,a=[],c=e.localizationRan??!0;c&&e.localizationComplete===!1&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:e.runtimeConfigComplete===!1?"Source localization was incomplete, and at least one authoritative runtime configuration file could not be indexed. Zero local API sites is not an exhaustive absence claim.":"Source localization reached its file limit. Runtime configuration was indexed completely, but zero local API sites is not an exhaustive absence claim.",severity:"blocking",automaticExecution:"blocks",remediation:"Raise the source indexing limit or narrow the scan to the relevant workspace."}),!c&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:'No checkout was available, so Drift could not search this repository for affected code. Zero impact sites here means "not searched", not "not affected".',severity:"blocking",automaticExecution:"blocks",remediation:"Run Drift as a GitHub Action or from the CLI in a checkout. The webhook runner cannot localize \u2014 see docs/deployment.md."});for(let u of i)r.filter(f=>f.dependency===u.name&&f.workspace===u.workspace).filter(f=>f.source!=="semver-heuristic"&&f.source!=="registry-metadata").length===0&&a.push({stage:"evidence",ecosystem:u.ecosystem,dependency:u.name,surface:"upstream release evidence",reason:`No changelog, release notes, migration guide, or API diff could be retrieved for ${u.name}. Drift will not dispatch a fix based on a version number alone.`,severity:"significant",automaticExecution:s.guardrails.requireEvidence&&t.length>0?"blocks":"degrades",remediation:"Check the package publishes release notes Drift can reach, or review this upgrade by hand."});for(let u of t)o.filter(p=>p.breakingChangeId===u.id).length>0||u_(Or(u))&&a.push({stage:"localize",dependency:u.dependency,surface:`reachability of ${u.symbols.slice(0,3).join(", ")||u.dependency}`,reason:`${u.summary} is only observable at runtime, so searching the source cannot establish whether this repository is affected.`,severity:"significant",automaticExecution:"degrades",remediation:"Confirm by exercising the affected paths, or review the upstream notes directly."});(e.verification??[]).filter(u=>!u.name.startsWith("behavioural:")).length===0&&n.length>0&&a.push({stage:"verify",surface:"build, typecheck, and test",reason:"No checks were run against this plan, so nothing confirms the findings were understood correctly or that a fix would compile.",severity:"significant",automaticExecution:"degrades",remediation:"Configure the repository checks Drift should run, or review the resulting pull request against CI before merging."});for(let u of[...new Set(i.map(d=>d.ecosystem))].sort()){let d=wte(u);for(let p of vte)d.support[p].level==="none"&&a.push({stage:IUe(p),ecosystem:u,surface:m1[p],reason:d.support[p].note??`${m1[p]} does not run for ${u}.`,severity:"significant",automaticExecution:"degrades",remediation:`Drift cannot run this stage for ${u}; review this surface by hand.`})}return a}function IUe(e){switch(e){case"detect":return"detect";case"evidence":case"surface":return"evidence";case"static-analysis":return"localize";case"verify":return"verify";default:return"plan"}}function AUe(e,t,n){return lte({changes:t},{branch:e.pullRequest.branchTemplate,prefix:e.remediation.branchPrefix})}function y1(e,t,n,i=[],r){let o=i.some(p=>p==="unknown"||p==="partial"),s=r?.some(p=>p.state==="review-only"||p.state==="unknown")??!1,a=r?r.flatMap(p=>p.actionableSites):n;if(t.length===0||a.length===0)return o||s?"low":"none";let c="low",l=p=>{N2(p,c)>0&&(c=p)},u=new Set(a.map(p=>p.file)).size;(u>5||a.length>20)&&l("medium"),(u>20||a.length>75)&&l("high");let d=new Set((r??[]).filter(p=>p.state!=="unaffected").map(p=>p.changeId));for(let p of t.filter(f=>d.size===0||d.has(f.id)))(p.kind==="behaviour-change"||p.kind==="default-change")&&l("high"),p.kind==="unknown"&&l("medium"),p.confidence==="low"&&l("medium");for(let p of e)p.bump==="major"&&l("medium"),Tg(p.from,p.to,p.ecosystem)&&l("high");return a.some(p=>$te(p.file))&&l("medium"),c}function RUe(e,t,n,i,r){let{config:o,changes:s,impactSites:a,skipped:c=[]}=e,l=o.guardrails,u=[],d=[],p=[...new Set(n.flatMap(_=>_.files))];p.length>l.maxFilesChanged&&u.push(`This plan would touch ${p.length} files, above the \`maxFilesChanged\` limit of ${l.maxFilesChanged}. A change this wide should be read by a person before an agent starts editing.`),s.length>l.maxDependenciesPerRun&&u.push(`${s.length} dependencies moved in one commit, above the \`maxDependenciesPerRun\` limit of ${l.maxDependenciesPerRun}. Batched upgrades make it hard to attribute a regression to the dependency that caused it.`);let f=p.filter(_=>Yo(l.protectedPaths,_));f.length>0&&u.push(`Impact sites fall inside protected paths: ${f.slice(0,5).join(", ")}${f.length>5?`, +${f.length-5} more`:""}. Drift will not direct an agent to edit these.`);let m=s.filter(_=>Yo(o.alwaysApprove,_.name));m.length>0&&u.push(`${m.map(_=>_.name).join(", ")} matched \`alwaysApprove\` in drift.yml.`);let g=new Set(n.flatMap(_=>_.breakingChangeIds)),h=t.filter(_=>g.has(_.id)&&!MF(kte(_),l.minConfidence));if(h.length>0){let _=h.slice(0,3).map(S=>`\`${S.dependency}\`: ${S.summary}`).join("; ");l.experimentalDispatchBelowMinConfidence?d.push(`${h.length} finding(s) are below the \`minConfidence\` threshold of \`${l.minConfidence}\` but \`experimentalDispatchBelowMinConfidence\` is on, so Drift will dispatch anyway. ${_}.`):u.push(`${h.length} finding(s) Drift planned commits for are below the \`minConfidence\` threshold of \`${l.minConfidence}\`: ${_}. The plan is filed for review rather than dispatched.`)}let b=t.filter(_=>!g.has(_.id)&&!MF(kte(_),l.minConfidence));b.length>0&&d.push(`${b.length} finding(s) are below the \`minConfidence\` threshold and no commit was planned for them. They are listed for awareness.`);let y=r.filter(_=>_.automaticExecution==="blocks");for(let _ of y)u.push(`${_.reason} ${_.remediation}`);mC(i,o.maxAutoRisk)||u.push(`Assessed risk is \`${i}\`, above the \`maxAutoRisk\` ceiling of \`${o.maxAutoRisk}\`.`);let w=a.filter(_=>$te(_.file));w.length>0&&d.push(`${w.length} impact site(s) are in test files. Confirm the fix updates tests to match the new API rather than weakening what they assert.`);let k=t.filter(_=>!a.some(S=>S.breakingChangeId===_.id));k.length>0&&d.push(`${k.length} breaking change(s) were identified upstream but no usage was found in this repository. They are listed for awareness and no commit was planned for them.`);for(let _ of c)d.push(`Skipped \`${_.change.name}\`: ${_.reason}.`);return{blockers:u,warnings:d}}function $te(e){let t=e.toLowerCase();return/(^|\/)(tests?|__tests__|spec|specs|e2e|integration_tests)\//.test(t)||/\.(test|spec)\.[jt]sx?$/.test(t)||/(^|\/)test_[^/]+\.py$/.test(t)||/_test\.(py|go|rb)$/.test(t)||/_spec\.rb$/.test(t)||/Test\.java$/.test(e)||/Tests?\.kt$/.test(e)}function _te(e,t){return t.mode!=="auto"||e.blockers.length>0||e.commits.length===0?!1:mC(e.risk,t.maxAutoRisk)}var Py=require("node:fs/promises"),io=require("node:path");async function Ste(e,t,n){let i=n.replace(/\\/g,"/").trim();if(!i||/[\n\r\0]/.test(i))return null;let r;try{r=await(0,Py.realpath)(e)}catch{return null}let o=(0,io.isAbsolute)(i)||/^[A-Za-z]:\//.test(i)?[i]:[...new Set([t?(0,io.join)(r,t,i):null,(0,io.join)(r,i)].filter(s=>s!==null))];for(let s of o){let a;try{if(a=await(0,Py.realpath)(s),!(await(0,Py.stat)(a)).isFile())continue}catch{continue}let c=(0,io.relative)(r,a);if(!(!c||c.startsWith("..")||(0,io.isAbsolute)(c))&&!c.split(io.sep).includes(".git"))return c.split(io.sep).join("/")}return null}var xte="https://api.osv.dev/v1/query",NUe="https://api.osv.dev/v1/querybatch",CUe="https://api.osv.dev/v1/vulns",Rte={npm:"npm",pypi:"PyPI",go:"Go",cargo:"crates.io",maven:"Maven",rubygems:"RubyGems",nuget:"NuGet",packagist:"Packagist",hex:"Hex",pub:"Pub",swift:"SwiftURL",cocoapods:null,opam:null,conan:null,vcpkg:null,arduino:null};async function Dy(e,t,n,i,r={}){let o=Rte[t];if(!o)return Uo(`OSV has no advisory coverage for ${t} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`);let s=r.fetch??jUe,[a,c]=await Promise.all([s(xte,dx(e,o,n)),s(xte,dx(e,o,i))]);return Nte(a,c,n,i,t)}async function Oy(e,t={}){let n=new Map,i=[];for(let a of e){let c=Rte[a.ecosystem];c?i.push({lookup:a,osvEcosystem:c}):n.set(a,Uo(`OSV has no advisory coverage for ${a.ecosystem} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`))}if(i.length===0)return n;if(i.length===1&&!t.batchFetch){let{lookup:a}=i[0];return n.set(a,await Dy(a.name,a.ecosystem,a.from,a.to,t)),n}if(t.fetch&&!t.batchFetch){let a=await Promise.all(i.map(({lookup:c})=>Dy(c.name,c.ecosystem,c.from,c.to,t)));return i.forEach(({lookup:c},l)=>n.set(c,a[l])),n}let r=i.flatMap(({lookup:a,osvEcosystem:c})=>[dx(a.name,c,a.from),dx(a.name,c,a.to)]),s=await(t.batchFetch??zUe)(r);if(nu(s)){for(let{lookup:a}of i)n.set(a,Uo(`${s.osvFailure}, so this upgrade's effect on known vulnerabilities is unknown.`));return n}for(let a=0;a!b1(d,a)),l=a.filter(d=>!b1(d,s)),u=s.filter(d=>b1(d,a));return{checked:!0,current:s,target:a,resolved:c,introduced:l,carried:u,direction:PUe(c,l)}}function dx(e,t,n){return{version:n,package:{name:e,ecosystem:t}}}function b1(e,t){let n=new Set([e.id,...e.aliases]);return t.some(i=>n.has(i.id)||i.aliases.some(r=>n.has(r)))}function PUe(e,t){return e.length>0&&t.length>0?"mixed":e.length>0?"improves":t.length>0?"worsens":"preserves"}function Uo(e){return{checked:!1,...e?{reason:e}:{},current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"}}function Ete(e,t,n="npm"){let i=e?.vulns;if(!Array.isArray(i))return[];let r=[];for(let o of i)!o.id||o.withdrawn||r.push({id:o.id,aliases:(o.aliases??[]).filter(s=>typeof s=="string"),summary:FUe(o.summary||o.details||"No summary published."),severity:OUe(o),url:LUe(o),fixedIn:MUe(o,t,n)});return Cte(r,n).sort((o,s)=>Tte[o.severity]-Tte[s.severity])}function Cte(e,t="npm"){let n=new Map,i=[];for(let r of e){let o=[r.id,...r.aliases],a=o.map(c=>n.get(c)).find(c=>c!==void 0)??i.push([])-1;i[a].push(r);for(let c of o)n.set(c,a)}return i.filter(r=>r.length>0).map(r=>{let o=r.find(a=>a.severity!=="unknown")??r[0],s=new Set(r.flatMap(a=>[a.id,...a.aliases]));return s.delete(o.id),{...o,aliases:[...s].sort(),fixedIn:DUe(r.map(a=>a.fixedIn),t),summary:r.find(a=>a.summary!=="No summary published.")?.summary??o.summary}})}function DUe(e,t){return e.filter(i=>!!i).map(i=>({raw:i,parsed:Te(i,t)})).filter(i=>i.parsed!==null).sort((i,r)=>Qe(i.parsed,r.parsed)??0)[0]?.raw??e.find(i=>!!i)??null}var Tte={critical:0,high:1,medium:2,low:3,unknown:4};function OUe(e){let t=e.database_specific?.severity??e.affected?.find(r=>r.database_specific?.severity)?.database_specific?.severity??e.affected?.find(r=>r.ecosystem_specific?.severity)?.ecosystem_specific?.severity;if(t){let r=t.toLowerCase();if(r==="critical")return"critical";if(r==="high")return"high";if(r==="moderate"||r==="medium")return"medium";if(r==="low")return"low"}let n=e.severity?.find(r=>r.score)?.score,i=n?Pte(n):null;return i===null?"unknown":i>=9?"critical":i>=7?"high":i>=4?"medium":"low"}function Pte(e){if(!/^CVSS:3\.[01]\//.test(e))return null;let t=new Map;for(let w of e.split("/").slice(1)){let[k,_]=w.split(":");k&&_&&t.set(k,_)}let n={N:.85,A:.62,L:.55,P:.2},i={L:.77,H:.44},r={N:.85,R:.62},o={H:.56,L:.22,N:0},s=t.get("S")==="C",a=s?{N:.85,L:.68,H:.5}:{N:.85,L:.62,H:.27},c=n[t.get("AV")??""],l=i[t.get("AC")??""],u=a[t.get("PR")??""],d=r[t.get("UI")??""],p=o[t.get("C")??""],f=o[t.get("I")??""],m=o[t.get("A")??""];if([c,l,u,d,p,f,m].some(w=>w===void 0))return null;let g=1-(1-p)*(1-f)*(1-m),h=s?7.52*(g-.029)-3.25*(g-.02)**15:6.42*g;if(h<=0)return 0;let b=8.22*c*l*u*d,y=Math.min(s?1.08*(h+b):h+b,10);return Math.ceil(y*10)/10}function MUe(e,t,n="npm"){let i=Te(t,n),r=[];for(let a of e.affected??[])for(let c of a.ranges??[])for(let l of c.events??[])l.fixed&&r.push(l.fixed);if(r.length===0)return null;let o=r.map(a=>({raw:a,parsed:Te(a,n)})).filter(a=>a.parsed!==null);return!i||o.length===0?r[0]??null:(o.filter(a=>(Qe(a.parsed,i)??-1)>0).sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0]??o.sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0])?.raw??null}function LUe(e){return e.references?.find(n=>n.type==="ADVISORY"&&n.url)?.url??`https://osv.dev/vulnerability/${e.id}`}function FUe(e){let t=e.replace(/\s+/g," ").trim(),n=t.search(/\.\s|\.$/),i=n>0?t.slice(0,n+1):t;return i.length>300?`${i.slice(0,299)}\u2026`:i}var Ite=1e4,Ate=2,UUe=200;function nu(e){return typeof e=="object"&&e!==null&&"osvFailure"in e}var jUe=async(e,t)=>Dte(e,t),zUe=async e=>{let t=Array.from({length:e.length},()=>({vulns:[]})),n=e.map((r,o)=>({query:r,index:o}));for(;n.length>0;){let r=await Dte(NUe,{queries:n.map(a=>a.query)});if(nu(r))return r;let o=r?.results;if(!Array.isArray(o)||o.length!==n.length)return{osvFailure:"OSV returned a malformed batch response"};let s=[];for(let a=0;a!!u?.id)),l.next_page_token&&s.push({index:c.index,query:{...c.query,page_token:l.next_page_token}})}n=s}let i=await GUe(t.flatMap(r=>r.vulns));return nu(i)?i:t.map(r=>({vulns:r.vulns.map(o=>i.get(o.id)??o)}))};async function GUe(e){let t=[...new Set(e.map(r=>r.id).filter(r=>!!r))],n=await Promise.all(t.map(async r=>{let o=await VUe(`${CUe}/${encodeURIComponent(r)}`);return nu(o)?o:[r,o]})),i=n.find(nu);return i||new Map(n)}async function Dte(e,t){return Ote(e,{method:"POST",body:JSON.stringify(t)})}async function VUe(e){return Ote(e,{method:"GET"})}async function Ote(e,t){let n=null;for(let i=0;i<=Ate;i+=1){let r=await BUe(e,t);if(!nu(r)||!r.transient||i===Ate)return r;n=r,await HUe(UUe*2**i)}return n??{osvFailure:"OSV could not be reached (network error)"}}async function BUe(e,t){let n=new AbortController,i=setTimeout(()=>n.abort(),Ite);try{let r=await fetch(e,{method:t.method,signal:n.signal,headers:{"Content-Type":"application/json","User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"},...t.method==="POST"?{body:t.body}:{}});return r.ok?await r.json():{osvFailure:r.status===429?"OSV rate-limited this scan (HTTP 429). Lowering `drift.analysis.concurrency` will fetch fewer advisories at once.":`OSV answered HTTP ${r.status} ${r.statusText}`.trim(),transient:r.status===408||r.status===429||r.status>=500}}catch(r){let o=r;return{osvFailure:o?.name==="AbortError"||o?.name==="TimeoutError"?`OSV did not answer within ${Ite/1e3}s${Mte(o)}`:`OSV could not be reached (${qUe(o)})`,transient:!0}}finally{clearTimeout(i)}}function qUe(e){return`${e?.message||"network error"}${Mte(e)}`}function Mte(e){let t=e?.cause;return t==null?"":`; cause: ${WUe(t)}`}function WUe(e){if(e instanceof Error)return e.message||e.name;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function HUe(e){return new Promise(t=>setTimeout(t,e))}var KUe=gt(Dc(),1);function w1(e){let{name:t,registry:n,repository:i,currentVersion:r,targetVersion:o}=e,s=e.now??new Date,a=[],c=o?.withdrawn??n?.deprecated??void 0;c&&a.push({statement:`The maintainer has withdrawn ${t} ${e.to}: ${c}`,url:n?.homepage??void 0,concerning:!0,polarity:"blocks"}),i?.archived?a.push({statement:"The upstream repository is archived. It will not receive further fixes.",url:i.url,concerning:!0,polarity:"blocks"}):i?.pushedAt&&a.push({statement:`The repository was last pushed to ${v1(i.pushedAt,s)}.`,url:i.url}),r?.withdrawn&&!c&&a.push({statement:`The version currently installed, ${e.from}, has been withdrawn: ${r.withdrawn}`,concerning:!0,polarity:"favors"});let l=YUe(n?.versions??[],e.ecosystem);if(l){let p=Te(e.to,e.ecosystem),f=Te(l,e.ecosystem),m=p&&f?Qe(f,p):null;m===0?a.push({statement:`${e.to} is the latest stable release.`}):m!==null&&m>0&&a.push({statement:`${e.to} is not the latest release; ${l} is also available.`})}o?.releasedAt&&a.push({statement:`The target version was released ${v1(o.releasedAt,s)}.`});let u=JUe(r,o);u&&a.push(u);let d=ZUe(e,l);return d&&a.push(d),{facts:a,...c?{deprecated:c}:{},...i?.archived?{archived:!0}:{},...l?{latestStable:l}:{},...o?.releasedAt?{targetReleasedAt:o.releasedAt}:{}}}function JUe(e,t){let n=e?.runtime,i=t?.runtime;return!i||n&&n.requirement===i.requirement?null:{statement:!n?`The target version requires ${i.name} ${i.requirement}.`:`The required ${i.name} version changed from ${n.requirement} to ${i.requirement}.`,concerning:!1,polarity:"context"}}function ZUe(e,t){let n=Te(e.from,e.ecosystem),i=t?Te(t,e.ecosystem):null;if(!n?.release||!i?.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let r=(i.release[0]??0)-(n.release[0]??0);return r<1?null:{statement:`The installed version ${e.from} is ${r} major version${r===1?"":"s"} behind the latest release, ${t}. Maintainers rarely backport fixes that far.`}}function YUe(e,t){return e.map(i=>Te(i,t)).filter(i=>i!==null&&!i.prerelease).sort((i,r)=>-(Qe(i,r)??0))[0]?.raw??null}function v1(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return`on ${e}`;let i=Math.floor((t.getTime()-n.getTime())/864e5);if(i<0)return`on ${n.toISOString().slice(0,10)}`;if(i===0)return"today";if(i===1)return"yesterday";if(i<60)return`${i} days ago`;let r=Math.round(i/30.44);return r<24?`about ${r} months ago`:`about ${Math.round(i/365.25)} years ago`}var QUe=12;async function $1(e){let{name:t,currentVersion:n,targetVersion:i,repository:r,policy:o}=e,s=n?.license??null,a=i?.license??r?.license??null,c=o.enabled?await XUe(e):[],l=p=>_1(p,o),u=c.filter(p=>!p.allowed),d=()=>`This upgrade newly introduces ${u.map(p=>`${p.name} (${p.license??"no declared license"})`).join(", ")}, which the repository policy does not permit.`;if(!a&&!s){if(!l(a)||u.length>0){let p=[];return l(a)||p.push(`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read. The repository policy requires a declared license.`),u.length>0&&p.push(d()),p.push(`The policy permits ${px(o)}.`),{verdict:"policy-violation",statement:p.join(" "),introduced:c}}return{verdict:o.enabled?"unknown":"ok",statement:o.enabled?`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read, so this upgrade's licensing position could not be checked.`:"No license metadata was published for either version.",introduced:c}}if(s&&a&&!tje(s,a)){let p=!l(a);if(p||u.length>0){let f=[];return f.push(p?`The declared license changed from ${s} to ${a}, which the repository policy does not permit.`:`The declared license changed from ${s} to ${a}.`),u.length>0&&f.push(d()),f.push(`The policy permits ${px(o)}.`),{verdict:"policy-violation",from:s,to:a,statement:f.join(" "),introduced:c}}return{verdict:"changed",from:s,to:a,statement:`The declared license changed from ${s} to ${a}. It remains within this repository's configured policy.`,introduced:c}}return l(a)?u.length>0?{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:`${d()} The policy permits ${px(o)}.`,introduced:c}:a?{verdict:"ok",...s?{from:s}:{},to:a,statement:`The license is unchanged at ${a}.`,introduced:c}:{verdict:"unknown",...s?{from:s}:{},statement:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}.`,introduced:c}:{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:a?`${t} is licensed ${a}, which the repository policy does not permit. The policy permits ${px(o)}.`:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}. The repository policy requires a declared license.`,introduced:c}}async function XUe(e){let{currentVersion:t,targetVersion:n,ecosystem:i,policy:r}=e;if(!t||!n)return[];let o=new Set(t.dependencies),s=n.dependencies.filter(c=>!o.has(c)).slice(0,QUe);return s.length===0?[]:await Promise.all(s.map(async c=>{let u=(await ca(c,i,"latest").catch(()=>null))?.license??null;return{name:c,license:u,allowed:_1(u,r)}}))}function _1(e,t){if(!t.enabled)return!0;if(!e)return!t.requireDeclared;let n=eje(e);return t.deny.length>0&&n.some(i=>k1(i,t.deny))?!1:t.allow.length===0?!0:e.includes(" OR ")?n.some(i=>k1(i,t.allow)):n.every(i=>k1(i,t.allow))}function eje(e){return e.replace(/[()]/g," ").split(/\s+(?:OR|AND|WITH)\s+/i).map(t=>t.trim()).filter(Boolean)}function k1(e,t){let n=e.toLowerCase().replace(/\+$/,"");return t.some(i=>i.toLowerCase().replace(/\+$/,"")===n)}function tje(e,t){let n=i=>i.toLowerCase().replace(/[\s._]/g,"-").replace(/-+/g,"-");return n(e)===n(t)}function px(e){return e.allow.length>0?e.allow.join(", "):e.deny.length>0?`anything except ${e.deny.join(", ")}`:"no licenses in particular"}var nje=[{category:"security",pattern:/\b(CVE-\d{4}-\d+|GHSA-[\w-]+|GO-\d{4}-\d+|security fix|vulnerabilit|XSS|CSRF|SSRF|remote code execution|prototype pollution|path traversal|SQL injection|denial of service|ReDoS)\b/i},{category:"breaking",pattern:/\b(BREAKING|breaking change|no longer|has been removed|was removed|is removed|removed entirely|removed support|dropped support|drop support|renamed to|has been renamed|is now required|must now|now (?:requires?|returns?|expects?|accepts?|takes?)|migrate to|migration guide|incompatible)\b/i},{category:"performance",pattern:/\b(faster|speed ?up|sped up|reduces? (?:the )?(?:allocation|memory|latency)|allocation|throughput|optimi[sz]|performance (?:improvement|gain|boost|work|regression)|improv(?:e|es|ed|ing) performance)\b/i},{category:"fix",pattern:/^\s*(?:fix(?:e[sd])?|bugfix|resolve[sd]?|correct(?:s|ed)?)\b/i}];function S1(e){let{dependency:t,evidence:n,breakingChanges:i,impactSites:r}=e,o=new Map;for(let u of r)o.set(u.breakingChangeId,(o.get(u.breakingChangeId)??0)+1);let s=[],a=new Set;for(let u of i){if(u.dependency!==t)continue;let d=o.get(u.id)??0,p=Ute(u.summary);a.has(p)||(a.add(p),s.push({category:"breaking",text:u.summary,...d>0?{affectedSites:d}:{},...Fte(u,n)?{url:Fte(u,n)}:{},...u.citations[0]?{citation:u.citations[0]}:{}}))}let c=0,l=new Map;for(let u of n)if(u.dependency===t&&!(u.source==="semver-heuristic"||u.source==="type-surface-diff"))for(let d of jte(u.content)){let p=Ute(d);if(!p||a.has(p))continue;a.add(p);let f=T1(d);if(f==="breaking"&&s.some(g=>ije(g.text,d)))continue;let m=l.get(f)??0;if(m>=6){c++;continue}l.set(f,m+1),s.push({category:f,text:d,...u.url?{url:u.url}:{},citation:u.id})}return{changes:rje(s),unrelated:c}}function x1(e){return e.changes.filter(t=>t.category==="performance").map(t=>({statement:t.text,...t.url?{url:t.url}:{},...t.citation?{citation:t.citation}:{}}))}function E1(e,t){if(e.length===0)return null;let n=e.filter(o=>o.kind==="package-added").length,i=e.length-n,r=[];return n>0&&r.push(`${n} new package${n===1?"":"s"}`),i>0&&r.push(`${i} new exported symbol${i===1?"":"s"}`),r.length===0?null:{statement:`The target version adds ${r.join(" and ")}, none of which can break existing code. Computed from ${t}.`}}function T1(e){for(let{category:t,pattern:n}of nje)if(n.test(e))return t;return"improvement"}var Lte={breaking:0,security:1,fix:2,performance:3,improvement:4};function rje(e){return[...e].sort((t,n)=>{let i=Lte[t.category]-Lte[n.category];return i!==0?i:(n.affectedSites??0)-(t.affectedSites??0)})}function jte(e){let t=[],n=null;for(let i of e.split(` -`)){let r=i.trim();if(!r||/^[-=]{3,}$/.test(r))continue;if(r.startsWith("#")){n=null;continue}let o=/^[-*+]\s+/.test(r)||/^\d+\.\s+/.test(r),s=r.replace(/^[-*+]\s+/,"").replace(/^\d+\.\s+/,"").trim();if(!(s.length<12)&&!/^(?:by\s+@|thanks|co-authored-by|https?:\/\/\S+$)/i.test(s)){if(!o&&/:\s*$/.test(s)&&T1(s)==="breaking"){n=s;continue}t.push(oje(n&&o?`${n} ${s}`:s,240)),!o&&!/:\s*$/.test(s)&&(n=null)}}return t}function Fte(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function ije(e,t){let n=r=>new Set(r.match(/`([^`]+)`/g)??[]),i=n(e);return i.size===0?!1:[...n(t)].some(r=>i.has(r))}function Ute(e){return e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function oje(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var zte={critical:0,high:1,medium:2,low:3,unknown:4};function I1(e,t){return zte[e]-zte[t]}function A1(e){return e.reduce((t,n)=>I1(n.severity,t)<0?n.severity:t,"unknown")}var sje=new Set(["behaviour-change","signature-change","default-change","moved-export","runtime-requirement"]);function My(e){let t=[],{security:n,maintenance:i,license:r,impactSites:o}=e,s=o.length,a=new Set(o.map(F=>F.file)).size,c=new Map(e.breakingChanges.map(F=>[F.id,F])),l=o.filter(F=>c.get(F.breakingChangeId)?.kind!=="runtime-requirement"),u=new Set(l.map(F=>F.file)).size,d=o.filter(F=>c.get(F.breakingChangeId)?.kind==="runtime-requirement"),p=e.breakingChanges.filter(F=>F.kind==="runtime-requirement"&&F.runtime?.runtime),f=tx(e.breakingChanges,e.runtimeAnalyses??[]),m=QF(f),g=p.length>0&&XF(m??"unknown"),h=p.length>0?m??"unknown":void 0,b=Pf(e.breakingChanges,o,f,e.localizationRan??!0,e.localizationComplete??!0),y=new Set(b.filter(F=>F.state==="actionable").map(F=>F.changeId)),w=e.breakingChanges.filter(F=>y.has(F.id)),k=new Set(b.flatMap(F=>F.actionableSites.map(K=>`${K.breakingChangeId}:${K.file}:${K.line}`))),_=l.filter(F=>!k.has(`${F.breakingChangeId}:${F.file}:${F.line}`)),S=w.filter(F=>sje.has(F.kind)),x=w.length-S.length,E=Df(e.breakingChanges);n.checked&&(n.resolved.length>0&&t.push(`Fixes ${n.resolved.length} known ${wr(n.resolved.length,"vulnerability","vulnerabilities")} (worst: ${A1(n.resolved)}).`),n.introduced.length>0&&t.push(`Introduces ${n.introduced.length} known ${wr(n.introduced.length,"vulnerability","vulnerabilities")} not present in the installed version (worst: ${A1(n.introduced)}).`),n.carried.length>0&&t.push(`${n.carried.length} known ${wr(n.carried.length,"vulnerability affects","vulnerabilities affect")} both versions; this upgrade does not address ${n.carried.length===1?"it":"them"}.`),n.resolved.length===0&&n.target.length===0&&t.push("No known vulnerabilities were found for the target version."));let T=l.filter(F=>k.has(`${F.breakingChangeId}:${F.file}:${F.line}`));T.length>0&&t.push(E?`${T.length} ${wr(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${wr(new Set(T.map(F=>F.file)).size,"file","files")} match${T.length===1?"es":""} ${E} entries this upgrade changes.`:`${T.length} ${wr(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${wr(new Set(T.map(F=>F.file)).size,"file","files")} use${T.length===1?"s":""} an API this upgrade changes.`),_.length>0&&t.push(`${_.length} local API match${_.length===1?"":"es"} require review; Drift did not establish a safe edit.`);for(let F of f)t.push(F.statement);if(d.length>0&&f.length===0&&t.push(...uje(d)),s>0)x>0&&t.push(`${x} of the locally affected changes can be applied mechanically.`),S.length>0&&t.push(`${S.length} locally affected ${wr(S.length,"change requires","changes require")} a developer decision rather than a substitution.`);else if(e.breakingChanges.some(F=>F.kind!=="runtime-requirement")&&!g){let F=e.breakingChanges.filter(K=>K.kind!=="runtime-requirement").length;t.push(E?`${F} published ${E} ${wr(F,"change","changes")} require review; these package-role contracts are assessed independently of source call signatures.`:`${F} upstream API breaking ${wr(F,"change","changes")}; no usage of the changed parts was located in this repository \u2014 review before upgrading.`)}for(let F of i.facts)F.concerning&&t.push(F.statement);r.verdict==="policy-violation"&&t.push(r.statement);let A=aje(e,{affected:s,decisions:S.length,actionable:w.length>0,runtimeUnresolved:g,localizationUnresolved:b.some(F=>F.reason==="localization-incomplete"||F.reason==="impact-unresolved"),roleContractChanged:E!==null}),L=cje(e);return e.gaps.length>0&&t.push(...e.gaps),{recommendation:A,reasons:t,confidence:L.level,confidenceBasis:L.basis,...h?{runtimeCompatibility:h}:{}}}function aje(e,t){let{security:n,maintenance:i,license:r}=e;if(n.checked&&n.introduced.length>0||i.deprecated||r.verdict==="policy-violation"||i.facts.some(a=>a.polarity==="blocks"))return"do-not-upgrade-yet";if(t.affected>0)return t.actionable&&t.decisions>0?"manual-migration-required":"upgrade-after-review";if(t.runtimeUnresolved||t.localizationUnresolved||t.roleContractChanged)return"upgrade-after-review";let o=n.checked&&n.resolved.length>0,s=i.facts.some(a=>a.polarity==="favors");return e.breakingChanges.length===0&&!R1(e)?o||s?"upgrade-recommended":"insufficient-evidence":o||s?"upgrade-recommended":"safe-to-upgrade"}function R1(e){return e.surfaceCompared||(e.proseRead??0)>0||Vte(e).length>0}function Vte(e){return e.evidence.filter(t=>t.dependency===e.dependency&&t.workspace===e.workspace&&(t.source==="github-release"||t.source==="changelog"||t.source==="migration-guide"))}function cje(e){let t=Math.max(Vte(e).length,e.proseRead??0),n=[];if(e.surfaceCompared){let r=Df(e.breakingChanges);n.push(r?`the computed ${r} diff`:"the computed API diff")}return t>0&&n.push(t===1?"release notes":"release notes and changelog"),e.security.checked&&n.push("the OSV advisory database"),n.length===0?{level:"low",basis:"Nothing but the version numbers could be read for this dependency."}:{level:e.surfaceCompared||n.length>=2?"high":"medium",basis:n.length===1?`${Gte(n[0])} is the available evidence.`:`${Gte(lje(n))} agree.`}}function Df(e){let t=e.filter(n=>n.kind!=="runtime-requirement");return t.length===0?null:t.every(n=>n.symbols.some(i=>i.startsWith("pom:")))?"Maven POM contract":t.every(n=>n.symbols.some(i=>i.startsWith("nuget:")))?"NuGet package contract":t.every(n=>n.symbols.some(i=>i.startsWith("pub:")))?"Pub package contract":null}function lje(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function Gte(e){return e.charAt(0).toUpperCase()+e.slice(1)}function uje(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime ${wr(o,"declaration","declarations")} in this repository ${wr(o,"does not satisfy","do not satisfy")} this upgrade's runtime requirement.`)}if(i.length>0){let o=i.length;t.push(`${o} runtime ${wr(o,"declaration allows","declarations allow")} versions this upgrade's runtime requirement rejects.`)}if(r.length>0){let o=r.length;t.push(`${o} runtime ${wr(o,"declaration is","declarations are")} dynamically defined; Drift could not determine whether ${wr(o,"it satisfies","they satisfy")} this upgrade's runtime requirement.`)}return t}function wr(e,t,n){return e===1?t:n}var ru={"safe-to-upgrade":"Safe to upgrade","upgrade-recommended":"Upgrade recommended","upgrade-after-review":"Upgrade after review","manual-migration-required":"Migration required","insufficient-evidence":"Insufficient evidence","do-not-upgrade-yet":"Do not upgrade yet"};var dje={"rate-limited":"rate limited","server-error":"server error","network-error":"network error"};async function N1(e,t){return Br("rationale.prepare",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to},async()=>{let{config:n}=t,i=e.from,r=e.to,o=h=>t.onProgress?.(h);o("Checking package metadata");let s=Wn(e.name,e.ecosystem,r),a=ca(e.name,e.ecosystem,i).catch(()=>null),c=ca(e.name,e.ecosystem,r).catch(()=>null),l=n.rationale.security?(t.securityLookup??Promise.resolve(t.security).then(h=>h?.get(e)).then(h=>h??Dy(e.name,e.ecosystem,i,r,t.osv??{}))).catch(h=>Uo(`Advisory lookup failed unexpectedly (${h instanceof Error?h.message:String(h)}), so this upgrade's effect on known vulnerabilities is unknown.`)):Promise.resolve(Uo("Advisory lookup is switched off for this repository (`rationale.security`), so this upgrade\u2019s effect on known vulnerabilities was not checked.")),u=await s;o("Checking repository status");let d=u?.githubRepo?await YH(u.githubRepo,t.githubToken,(h,b)=>o(`Checking repository status (${dje[b]}, retrying \u2014 attempt ${h})`)).catch(()=>null):null;o("Checking security advisories");let[p,f,m]=await Promise.all([a,c,l]);o("Checking license");let g=await $1({name:e.name,ecosystem:e.ecosystem,from:i,to:r,currentVersion:p,targetVersion:f,repository:d,policy:n.licenses});return{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}})}async function fx(e,t){let n=e.changes.filter(s=>s.from&&s.to),i=n.filter(s=>!t.preparedFacts?.has(s)),r=i.map(s=>({name:s.name,ecosystem:s.ecosystem,from:s.from,to:s.to})),o=t.config.rationale.security?Oy(r,t.osv??{}).then(s=>new Map(i.map((a,c)=>[a,s.get(r[c])]))):void 0;return qn(n,4,async s=>{try{return await pje(s,e,{...t,security:o})}catch(a){return t.logger.debug(`Rationale failed for ${s.name}: ${a.message}`),bje(s,`Drift could not assemble an upgrade rationale for ${s.name}.`)}})}async function pje(e,t,n){let i=s=>n.onProgress?.(e,s),r=n.preparedFacts?.get(e),o=await(r??N1(e,{config:n.config,...n.githubToken?{githubToken:n.githubToken}:{},...n.osv?{osv:n.osv}:{},...n.security?{security:n.security}:{},onProgress:i}));return fje(e,t,o,n,{shared:r!==void 0})}async function fje(e,t,n,i,r){return Br("rationale.finalize",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to,shared:r?.shared??i.preparedFacts?.has(e)??!1},async()=>{let{config:o,logger:s}=i,a=e.from,c=e.to,l=D=>i.onProgress?.(e,D),{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}=n,h=t.breakingChanges.filter(D=>D.dependency===e.name&&D.workspace===e.workspace),b=new Set(h.map(D=>D.id)),y=t.impactSites.filter(D=>b.has(D.breakingChangeId)),w=(t.runtimeAnalyses??[]).filter(D=>b.has(D.changeId));l("Checking maintenance signals");let k=o.rationale.maintenance?w1({name:e.name,ecosystem:e.ecosystem,from:a,to:c,registry:u,repository:d,currentVersion:p,targetVersion:f,repoRuntime:(e.workspace!==void 0?i.repoRuntimeByWorkspace?.get(e.workspace):void 0)??i.repoRuntime,pythonRuntime:(e.workspace!==void 0?i.pythonRuntimeByWorkspace?.get(e.workspace):void 0)??i.pythonRuntime,analyzedRuntimeRequirements:w.map(D=>({runtime:D.runtime,requirement:D.requirement}))}):{facts:[]},_=cn(e),S=i.additions?.get(_),x=i.surfaceCompared?.has(_)??S!==void 0,E=o.rationale.summary?S1({dependency:e.name,evidence:t.evidence,breakingChanges:h,impactSites:y,additions:S?.additions}):{changes:[],unrelated:0},T=[...x1(E)],A=S?E1(S.additions,S.locator):null;A&&T.push(A);let L=i.prose?.get(_)??i.prose?.get(e.name)??[],F=mje(e,{surfaceCompared:x,surfaceGap:i.surfaceGaps?.get(_),security:m,registry:u,evidence:t.evidence,prose:L,licenseUnknown:g.verdict==="unknown"}),K={dependency:e.name,workspace:e.workspace,breakingChanges:h,impactSites:y,evidence:t.evidence,security:m,maintenance:k,license:g,gaps:F,surfaceCompared:x,proseRead:L.length,runtimeAnalyses:w,localizationRan:t.localizationRan,localizationComplete:t.localizationComplete},te=My(K);return s.debug(`${e.name} ${a} \u2192 ${c}: ${te.recommendation}`),{dependency:e.name,from:a,to:c,security:m,maintenance:k,improvements:T,license:g,summary:E,assessment:te,runtimeAnalyses:w.map(({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})=>({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})),gaps:F,hasCompatibilityEvidence:R1(K)}})}function mje(e,t){let n=[],i=t.evidence.filter(s=>s.dependency===e.name&&s.workspace===e.workspace&&(s.source==="github-release"||s.source==="changelog"||s.source==="migration-guide")),r=t.surfaceGap,o=i.length>0?null:t.prose.length>0?t.surfaceCompared?null:`Drift read ${hje(t.prose)} for ${e.name} ${e.to} and found nothing in ${t.prose.length===1?"it":"them"} that announces a breaking change. That is weaker than a clean API comparison: it means nothing was flagged, not that nothing broke.`:`No release notes, changelog, or migration guide was reachable for ${e.name} ${e.to}${t.registry?.githubRepo?"":", and no source repository could be resolved for it"}.`;return r&&o?n.push(`${qte(r.detail)}. ${o}${r.remedy?` ${r.remedy}`:""}`):r?n.push(`${qte(r.detail)}.${r.remedy?` ${r.remedy}`:""}`):o&&n.push(o),t.security.checked||n.push(t.security.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."),yje(n)}var gje={"github-release":{one:"the release notes",many:"sets of release notes"},changelog:{one:"the changelog",many:"changelog files"},"migration-guide":{one:"the migration guide",many:"migration guides"}};function hje(e){let t=i=>e.filter(r=>r.kind===i),n=[];for(let i of["github-release","changelog","migration-guide"]){let r=t(i);if(r.length===0)continue;let o=gje[i];if(r.length===1){n.push(`${o.one} (${Bte(r[0])})`);continue}n.push(`${r.length} ${o.many} (${r.map(Bte).join(", ")})`)}return n.length===0?"the published release prose":n.length===1?n[0]:`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`}function Bte(e){return`[${e.label}](${e.url})`}function yje(e){let t=new Set,n=[];for(let i of e){let r=i.toLowerCase().replace(/[^a-z0-9]+/g," ").trim();t.has(r)||(t.add(r),n.push(i))}return n}function qte(e){return e.replace(/\.\s*$/,"")}function bje(e,t){return{dependency:e.name,from:e.from??"",to:e.to??"",security:{checked:!1,current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"},maintenance:{facts:[]},improvements:[],license:{verdict:"unknown",statement:"Not checked.",introduced:[]},summary:{changes:[],unrelated:0},hasCompatibilityEvidence:!1,assessment:{recommendation:"insufficient-evidence",reasons:[t],confidence:"low",confidenceBasis:t},gaps:[t]}}var Kte=require("node:crypto"),Ni=require("node:fs/promises"),gx=require("node:os"),iu=require("node:path"),Jte=require("node:url"),Zte=require("node:child_process");var Aje={},Yte="behavioural-diff-npm-ts-v1",vje=new Set(["behaviour-change","default-change","type-change","signature-change","required-field-added"]);function wje(e,t){let n=t.verification.behavioural;if(!n.enabled)return[];let i=[];for(let r of e.breakingChanges){if(!vje.has(r.kind))continue;let o=e.impactSites.filter(a=>a.breakingChangeId===r.id);if(o.length===0)continue;let s=Or(r);if(!(!s.nature.includes("behaviour")&&s.nature!=="type-contract"&&r.kind!=="default-change"))for(let a of r.symbols.slice(0,n.maxSymbols-i.length)){let c=_je(r),l=[{id:"default",args:[],contracts:c}],u=new Set;for(let d of o){if(l.length>=n.maxCasesPerSymbol)break;if(d.matchedSymbol!==a)continue;let p=kje(d.excerpt,a);if(!p)continue;let f=JSON.stringify(p);u.has(f)||(u.add(f),l.push({id:`site-${l.length}`,args:p,contracts:c}))}if(i.push({dependency:r.dependency,workspace:r.workspace,symbol:a,modulePath:"",exportName:a,cases:l}),i.length>=n.maxSymbols)return i}}return i}function kje(e,t){let i=new RegExp(`\\b${$je(t)}\\s*\\(([^;]*)\\)`).exec(e);if(!i)return null;let r=i[1].trim();if(r==="")return[];let o=`[${r}]`.replace(/'/g,'"').replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":');try{let s=JSON.parse(o);return Array.isArray(s)?s:null}catch{return null}}function $je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _je(e){switch(e.kind){case"default-change":return["configured-defaults","return-shape"];case"type-change":case"signature-change":case"required-field-added":return["return-shape","thrown-error","argument-mutation","promise-state"];case"behaviour-change":return["return-shape","thrown-error","argument-mutation","promise-state","serialization-output"];default:return["return-shape"]}}async function Sje(e){let{config:t,oldEnvironment:n,newEnvironment:i}=e,r=e.probes.slice(0,t.maxSymbols),o=[],s=[];if(!t.enabled)return{evidence:[],observations:[],gaps:["behavioural probing disabled"]};if(t.sandbox!=="required")return{evidence:[],observations:[],gaps:["behavioural probing requires a sandbox"]};for(let a of r){let c=a.cases.slice(0,t.maxCasesPerSymbol);for(let l of c){let u=await mx(t,n,a,l),d=await mx(t,n,a,l),p=await mx(t,i,a,l),f=await mx(t,i,a,l),m=!C1(u,d)||!C1(p,f);o.push({dependency:a.dependency,workspace:a.workspace,symbol:a.symbol,caseId:l.id,generatedInput:l.args,oldResult:u,newResult:p,observedDifference:m?"nondeterministic result; no compatibility conclusion drawn":Eje(u,p),nondeterministic:m,limitations:Tje(t,l.contracts)})}}return{observations:o,gaps:s,evidence:o.map(Qte)}}async function xje(){return typeof __dirname<"u"?(0,iu.join)(__dirname,"behavioural-worker.js"):(0,Jte.fileURLToPath)(new URL("./behavioural-worker.js",Aje.url))}async function mx(e,t,n,i){let r=await(0,Ni.mkdtemp)((0,iu.join)((0,gx.tmpdir)(),"drift-behavioural-")),o=await(0,Ni.realpath)(r),s=(0,iu.join)(r,"case.json"),a=await(0,Ni.realpath)(await xje()),c=(0,iu.resolve)(t.modulePath||n.modulePath),l=await(0,Ni.realpath)(c),u=(0,iu.resolve)(t.packageRoot);await(0,Ni.writeFile)(s,JSON.stringify({modulePath:l,exportName:n.exportName,args:i.args,network:e.network}));let d=[a,u,await(0,Ni.realpath)(u),c,l,s,await(0,Ni.realpath)(s)],p=[Number(process.versions.node.split(".")[0])>=24?"--permission":"--experimental-permission",...[...new Set(d)].map(f=>`--allow-fs-read=${f}`),`--max-old-space-size=${e.memoryMb}`,a,s];try{return await new Promise(f=>{let m=(0,Zte.spawn)(process.execPath,p,{stdio:["ignore","pipe","pipe"],env:{PATH:process.env.PATH??"",HOME:o,TMPDIR:o,DRIFT_BEHAVIOURAL_SANDBOX:"1"}});if(m.pid&&e.cpuLimit<1)try{(0,gx.setPriority)(m.pid,Math.round(10*(1-e.cpuLimit)))}catch{}let g="",h="",b=64*1024,y=setTimeout(()=>{m.kill("SIGKILL")},e.timeoutSeconds*1e3);m.stdout.on("data",w=>{g=(g+w.toString("utf8")).slice(-b)}),m.stderr.on("data",w=>{h=(h+w.toString("utf8")).slice(-b)}),m.on("close",(w,k)=>{if(clearTimeout(y),k){f({status:"timed-out",signal:k,stdoutDigest:Ly(g),stderrDigest:Ly(h)});return}let _=g.trim().split(` -`).at(-1)??"",S=Ije(_);f(S??{status:"worker-failed",stdoutDigest:Ly(g),stderrDigest:Ly(h)})}),m.on("error",w=>{clearTimeout(y),f({status:"worker-failed",error:{name:w.name,messageCategory:"spawn"}})})})}finally{e.retainArtifacts||await(0,Ni.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}function C1(e,t){return JSON.stringify(Wte(e))===JSON.stringify(Wte(t))}function Wte(e){return{status:e.status,value:e.value??null,error:e.error??null,mutations:e.mutations??[]}}var Hte=new Set(["worker-failed","timed-out"]);function Eje(e,t){return Hte.has(e.status)&&Hte.has(t.status)?`probe unavailable: neither version could be observed (${e.status})`:C1(e,t)?"no observed difference for this contract and generated input domain":e.status!==t.status?`status changed from ${e.status} to ${t.status}`:JSON.stringify(e.value??null)!==JSON.stringify(t.value??null)?"returned value changed":JSON.stringify(e.error??null)!==JSON.stringify(t.error??null)?"thrown error changed":JSON.stringify(e.mutations??[])!==JSON.stringify(t.mutations??[])?"argument mutation changed":"observable result changed"}function Tje(e,t){let n=[`Harness ${Yte}; bounded to ${t.join(", ")||"return-shape"} contracts.`,"No observed difference is not proof of behavioural compatibility outside these generated inputs.",`CPU limit requested: ${e.cpuLimit} (best-effort process priority; no OS-level quota). Node subprocess enforces wall-clock, memory, output, filesystem, and network policy, and cannot spawn its own children or threads \u2014 the wall-clock timeout is the actual hard bound on CPU consumption.`];return e.network||n.push("Network APIs were disabled for the probe."),n}function Qte(e){let t=JSON.stringify({generatedInput:e.generatedInput,normalizedOldResult:e.oldResult,normalizedNewResult:e.newResult,observedDifference:e.observedDifference,testHarnessVersion:Yte,nondeterminismHandling:e.nondeterministic?"Repeated runs disagreed, so Drift records the observation but draws no compatibility conclusion.":"Old and new observations were repeated once and matched within each version.",limitations:e.limitations},null,2);return{id:`ev_behaviour_${Ly(`${e.workspace??""}:${e.dependency}:${e.symbol}:${e.caseId}`).slice(0,12)}`,source:"behavioural-diff",dependency:e.dependency,...e.workspace!==void 0?{workspace:e.workspace}:{},locator:`${e.symbol}:${e.caseId}`,title:`Behavioural differential probe for ${e.symbol}`,content:t,weight:e.observedDifference.startsWith("probe unavailable")?0:e.observedDifference.startsWith("no observed difference")?.25:.8,findings:[{code:"behavioural-observation",symbol:e.symbol,detail:e.observedDifference}]}}async function Xte(e){let t=e.config.verification.behavioural,n=[],i=new Map,r=[];if(!t.enabled)return{evidence:n,citationsByChangeId:i,gaps:r};let o=wje({breakingChanges:e.breakingChanges,impactSites:e.impactSites},e.config);if(o.length===0)return{evidence:n,citationsByChangeId:i,gaps:r};let s=new Map;for(let a of o){let c=zc({name:a.dependency,workspace:a.workspace}),l=s.get(c);l?l.probes.push(a):s.set(c,{dependency:a.dependency,workspace:a.workspace,probes:[a]})}for(let{dependency:a,workspace:c,probes:l}of s.values()){let u=e.dependencyChanges.find(f=>f.name===a&&f.workspace===c&&f.ecosystem==="npm");if(!u?.from||!u.to){r.push(`${a}: behavioural probing needs both a resolved old and new version; skipped.`);continue}let d=await e.resolveEnvironments(u);if(!d){r.push(`${a}: could not resolve ${u.from} and ${u.to} to executable code for behavioural probing; skipped.`);continue}let p=await Sje({config:t,probes:l,oldEnvironment:d.oldEnvironment,newEnvironment:d.newEnvironment});r.push(...p.gaps);for(let f of p.observations){let m=Qte(f);n.push(m);for(let g of e.breakingChanges){if(g.dependency!==a||g.workspace!==c||!g.symbols.includes(f.symbol))continue;let h=i.get(g.id);h?h.push(m.id):i.set(g.id,[m.id])}}}return{evidence:n,citationsByChangeId:i,gaps:r}}function ene(e){return e.startsWith("probe unavailable")?"probe-unavailable":e.startsWith("no observed difference")?"no-difference":e.includes("returned value changed")?"return-value":e.startsWith("status changed")?"thrown-error":e.includes("argument mutation")?"argument-mutation":"behaviour"}function Ije(e){try{return JSON.parse(e)}catch{return null}}function Ly(e){return(0,Kte.createHash)("sha256").update(e).digest("hex")}var oo=require("node:fs/promises"),nne=require("node:os"),ou=require("node:path");function Rje(e){return Nje(e.exports)??e.module??e.main??"index.js"}function Nje(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e,n="."in t?t["."]:t,i=(r,o)=>{if(o>6||r==null)return null;if(typeof r=="string")return r;if(typeof r!="object")return null;let s=r;for(let a of["import","require","default","node"]){if(!(a in s))continue;let c=i(s[a],o+1);if(c)return c}return null};return i(n,0)}var tne="https://cdn.jsdelivr.net/npm";async function P1(e,t,n){let i=await $e(`${tne}/${t}@${n}/package.json`);if(!i)return null;let r=Rje(i).replace(/^\.\//,""),o=await rt(`${tne}/${t}@${n}/${r}`);if(o===null)return null;let s=await(0,oo.mkdtemp)((0,ou.join)((0,nne.tmpdir)(),"drift-behavioural-env-")),a=(0,ou.join)(s,r);return await(0,oo.mkdir)((0,ou.dirname)(a),{recursive:!0}),await(0,oo.writeFile)(a,o),await(0,oo.writeFile)((0,ou.join)(s,"package.json"),JSON.stringify(i)),{label:e,packageRoot:await(0,oo.realpath)(s),modulePath:await(0,oo.realpath)(a)}}var Tx=require("node:path");function D1(){return{probes:new Map}}function Cje(e,t,n,i){let r=Pje(t,n),o=i?.probes.get(r);if(o)return o;let s=e(t,["--version"],{timeoutMs:2e4,...n?{env:n}:{}}).then(a=>a.failure!=="not-found").catch(()=>!0);return i?.probes.set(r,s),s}async function rne(e,t,n,i){let r=[...new Set(t)],o=await Promise.all(r.map(s=>Cje(e,s,n,i)));return new Map(r.map((s,a)=>[s,o[a]]))}function Pje(e,t){let n=t??process.env,i=n.PATH??n.Path??n.path??"",r=n.PATHEXT??n.PathExt??"";return JSON.stringify([e,i,r,process.platform])}var hx=require("node:os");function yx(){try{return Math.max(1,(0,hx.availableParallelism)())}catch{return 4}}function Dje(){try{return Math.max(2,Math.floor((0,hx.totalmem)()/(512*1024*1024)))}catch{return 8}}function O1(e,t,n){return Math.max(t,Math.min(n,Math.floor(e)))}function M1(e,t){let n=t[e];if(!n)return;let i=Number(n);return Number.isFinite(i)&&i>=1?Math.floor(i):void 0}function bx(e=process.env){return M1("DRIFT_NETWORK_CONCURRENCY",e)??O1(yx()*4,8,32)}function L1(e=process.env){return M1("DRIFT_CONCURRENCY",e)??O1(Math.min(yx()*2,Dje()),4,16)}function vx(e=process.env){return M1("DRIFT_LOCAL_CONCURRENCY",e)??O1(yx()/4,2,6)}function ine(e=process.env){return`${yx()} cores \xB7 ${bx(e)} network, ${L1(e)} analysis, ${vx(e)} local`}var F1=require("node:crypto");var Oje=1,wvt=10080*60*1e3;function one(e){let t=(0,F1.createHash)("sha256");t.update(`v${Oje} +`);if(f.length!==m.length)return o.debug(`${t.name} changed the line count of ${d}; that is not expressible as a Drift operation.`),null;for(let g=0;g0?(o.info(`Drift could not re-derive what ${t.name}@${t.version} did to ${u.unexplained.length||c.length} line(s), so it will not apply it. This finding falls through to an agent.`),null):(l&&o.info(`${t.name}@${t.version} also changed files outside this finding's call sites; those edits were not learned from and will not be applied.`),u1({change:n,dependencyChange:e.dependencyChange,migration:t.migration,rationale:`Inferred from ${c.length} edit(s) made by ${t.name}@${t.version} in an isolated worktree, then re-derived as Drift operations. The recipe's own output was discarded.`,citations:[],ops:u.ops,provenance:{author:"recipe",recipe:{name:t.name,version:t.version,publisher:t.publisher,source:t.source},authoredAt:new Date().toISOString()}}))}async function K1e(e,t,n){let i=await n("git",["show",`HEAD:${t}`],{cwd:e});if(i.code!==0)return null;try{return{before:i.stdout,after:await(0,nte.readFile)((0,rte.join)(e,t),"utf8")}}catch{return null}}async function ote(e){let{change:t,candidate:n,sites:i,workspace:r,headSha:o,logger:s}=e;if(!n)return null;let a=new Set(i.filter(c=>c.breakingChangeId===t.id).map(c=>c.file));if(a.size===0)return null;try{return await qee(r,`fixplan-${n.provider}`,c=>ite({candidate:n,change:t,dependencyChange:e.dependencyChange,sandbox:c.path,relevantFiles:a,logger:s}),{at:o,...e.env?{env:e.env}:{},copyIgnoredFiles:!1})}catch(c){return s.warn(`Could not observe ${n.name}@${n.version} in an isolated worktree (${c.message}); this finding gets no recipe-derived fix plan.`),null}}var H1e="https://api.codemod.com",y1="https://search.maven.org",b1=6e3;async function ate(e,t){if(!t)return null;let n=lte(t.name),i=t.name.toLowerCase(),r=`${H1e}/registry?search=${encodeURIComponent(n)}`,o=await _e(r,{timeoutMs:b1,cacheTtlMs:3600*1e3});if(!o)return null;let s=Array.isArray(o)?o:o.entries??o.results??o.data??[];if(!Array.isArray(s))return null;let a=s.map(p=>({entry:p,confidence:J1e(p,i,n)})).filter(p=>p.confidence!=="none");if(a.length===0)return null;let c={exact:2,"base-name":1,text:0};a.sort((p,f)=>c[f.confidence]-c[p.confidence]||Number(h1(f.entry))-Number(h1(p.entry)));let l=a[0].entry,u=l.slug??l.name,d=l.version??l.latestVersion;return!u||!d?null:{provider:"codemod.com",name:u,version:d,publisher:l.owner?.name??l.author??l.publisher??"Codemod.com",source:`https://app.codemod.com/registry/${encodeURIComponent(l.slug??u)}`,migration:l.description??l.summary??`Migrates ${t.name} usages.`,official:h1(l)}}function J1e(e,t,n){let i=e.applicability?.flatMap(s=>s.packages??[])??[];if(i.some(s=>s.toLowerCase()===t))return"exact";if(i.some(s=>!s.includes("/")&&s.toLowerCase()===n))return"base-name";let r=`${e.slug??""} ${e.name??""} ${e.description??""} ${e.summary??""}`.toLowerCase(),o=new RegExp(`(?:^|[^a-z0-9])${Z1e(n)}(?:$|[^a-z0-9])`);return n&&o.test(r)?"text":"none"}function Z1e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function h1(e){if(e.verified||e.official)return!0;let t=(e.owner?.name??e.owner?.slug??e.author??e.publisher??"").toLowerCase();return t==="codemod"||t==="codemod.com"}var Y1e=/\borg\.openrewrite\.[a-zA-Z0-9_.]*[A-Z][a-zA-Z0-9_]*\b/;async function cte(e,t){if(!t||t.ecosystem!=="maven")return null;let n=lte(t.name).replace(/[^a-z0-9]/g,"-"),i=await ste(`rewrite-${n}`)??await ste(n);if(!i?.latestVersion)return null;let r=await Q1e(i.g,i.a,i.latestVersion),o=r?Y1e.exec(r)?.[0]:void 0;return o?{provider:"openrewrite",name:o,version:i.latestVersion,publisher:"OpenRewrite",source:`${y1}/artifact/${i.g}/${i.a}/${i.latestVersion}`,migration:r??`Runs ${o} from ${i.g}:${i.a}.`,official:!0}:null}async function ste(e){let t=encodeURIComponent(`g:org.openrewrite.recipe AND a:${e}`),n=`${y1}/solrsearch/select?q=${t}&core=gav&rows=1&wt=json`,r=(await _e(n,{timeoutMs:b1,cacheTtlMs:3600*1e3}))?.response?.docs?.[0];return r?.g==="org.openrewrite.recipe"?r:null}async function Q1e(e,t,n){let i=e.replace(/\./g,"/"),r=`${y1}/remotecontent?filepath=${i}/${t}/${n}/${t}-${n}.pom`,o=await rt(r,{timeoutMs:b1,cacheTtlMs:1440*60*1e3,immutable:!0});if(!o)return null;let s=/([\s\S]*?)<\/description>/.exec(o);return s?s[1].trim():null}function lte(e){return e.replace(/^@[^/]+\//,"").toLowerCase()}var X1e=[ate,cte];async function ute(e,t,n=X1e){let r=(await Promise.all(n.map(o=>o(e,t).catch(()=>null)))).filter(o=>o!==null);return r.length===0?null:(r.sort((o,s)=>Number(s.official)-Number(o.official)),r[0])}var pte={branch:"{prefix}upgrade-{summary}-{date}",title:"chore(deps): upgrade {summary}",prefix:"drift/"};function fte(e,t){let{changes:n}=e,i=e.now??new Date,r=n[0],o=r?n.length===1?`${r.name}-${r.from??"unknown"}-to-${r.to??"unknown"}`:`${n.length}-packages`:"dependencies",s=r?n.length===1?`${r.name} to ${r.to??"a new version"}`:`${n.length} packages`:"dependencies";return{prefix:t,summary:o,"summary-text":s,name:r?.name??"dependencies",from:r?.from??"",to:r?.to??"",count:String(n.length),date:i.toISOString().slice(0,10)}}function mte(e,t){return e.replace(/\{([a-z-]+)\}/g,(n,i)=>t[i]??n)}function dte(e){return(e.toLowerCase().replace(/[^a-z0-9/_.-]+/g,"-").replace(/(?<=[^/])\/(?=[^/])/g,"-").replace(/\.{2,}/g,".").replace(/-{2,}/g,"-").replace(/^[-./]+|[-./]+$/g,"").replace(/\.lock$/,"-lock")||"drift-upgrade").slice(0,200).replace(/[-./]+$/,"")}function gte(e,t={}){let n={...pte,...t},i=n.prefix?`${n.prefix.replace(/\/+$/,"")}/`:"",r=mte(n.branch,fte(e,i));return r.startsWith(i)&&i?`${i}${dte(r.slice(i.length))}`:dte(r)}function hte(e,t={}){let n={...pte,...t},i=fte(e,n.prefix);return mte(n.title,{...i,summary:i["summary-text"]}).trim()}var yte={"runtime-requirement":0,"config-change":1,"module-system-change":1,"moved-export":1,"removed-export":2,"renamed-export":2,"removed-endpoint":3,"changed-endpoint":3,"signature-change":4,"type-change":4,"required-field-added":5,"default-change":5,"behaviour-change":6,unknown:7};function eUe(e){switch(e){case"runtime-requirement":case"config-change":case"module-system-change":return"build";case"behaviour-change":case"default-change":return"fix";default:return"refactor"}}function _te({breakingChanges:e,impactSites:t,dispositions:n,config:i,changes:r=[],codemods:o,recipes:s,fixPlans:a}){let c=tUe(t),l=new Map((n??[]).map(k=>[k.changeId,k.actionableSites])),u=new Map(n?.map(k=>[k.changeId,k])),d=e.filter(k=>{let $=u.get(k.id);return $?$.state==="actionable"&&$.actionableSites.length>0:(c.get(k.id)??[]).some(S=>S.confidence==="high"&&S.runtimeVerdict===void 0)});if(d.length===0)return{commits:[],edges:[],cohorts:wte(r),blockers:[]};let f=[...i.remediation.commitGranularity==="single"?[d]:i.remediation.commitGranularity==="per-dependency"?nUe(d):d.map(k=>[k])].sort(rUe),m=wte(r),g=new Map;for(let k of m)for(let $ of k.dependencies)g.set($,k);let h=f.map((k,$)=>iUe(k,$+1,l,f.length,o,s,a)),b=cUe(h,e,t,g),y=pUe(h,b),w=y.cycle.length>0?fUe(y.cycle,b):void 0;return{commits:y.commits,edges:b,cohorts:m,blockers:w?[w]:[]}}function tUe(e){let t=new Map;for(let n of e){let i=t.get(n.breakingChangeId);i?i.push(n):t.set(n.breakingChangeId,[n])}return t}function nUe(e){let t=new Map;for(let n of e){let i=t.get(n.dependency);i?i.push(n):t.set(n.dependency,[n])}return[...t.values()]}function rUe(e,t){let n=Math.min(...e.map(s=>yte[s.kind])),i=Math.min(...t.map(s=>yte[s.kind]));if(n!==i)return n-i;let r=e[0]?.dependency??"",o=t[0]?.dependency??"";return r.localeCompare(o)}function iUe(e,t,n,i,r,o,s){let a=e.flatMap(f=>n.get(f.id)??[]),c=[...new Set(a.map(f=>f.file))].sort(),l=e[0],u=r?aUe(e,n,r):void 0,d=!u&&s?oUe(e,n,s):void 0,p=!u&&o?sUe(e,o):void 0;return{id:St("unit",e.map(f=>f.id).sort().join(","),c.join(","),l.dependency,l.kind),order:t,message:bUe(e,c.length),body:kUe(e,a,u,p),breakingChangeIds:e.map(f=>f.id),files:c,allowedFiles:c,allowedSymbols:[...new Set(e.flatMap(f=>f.symbols))].sort(),instructions:_Ue(e,a,t,i),dependsOn:[],dependencyReasons:[],executionLayer:0,expectedChecks:mUe(e,c),invalidationTriggers:gUe(e,c),...u?{codemod:u}:{},...d?{fixPlan:d}:{},...p?{recipe:p}:{}}}function oUe(e,t,n){let i=e.map(a=>n.get(a.id)).filter(a=>!!a);if(i.length===0)return;let r=e.filter(a=>!n.has(a.id)).flatMap(a=>(t.get(a.id)??[]).map(c=>({file:c.file,line:c.line,reason:`No fix plan was accepted for "${a.summary}", so this site needs an agent.`}))),o=i[0],s=i.flatMap(a=>a.anchors);return{plan:o.plan,assurance:i.some(a=>a.assurance==="checked")?"checked":"proven",files:[...new Set(s.map(a=>a.file))].sort(),anchors:s,covered:i.reduce((a,c)=>a+c.covered,0),residual:i.reduce((a,c)=>a+c.residual,0)+r.length,residualSites:[...i.flatMap(a=>a.sites.filter(c=>c.status==="residual").map(c=>({file:c.file,line:c.line,reason:c.reason??"No rule matched."}))),...r]}}function sUe(e,t){let n=[];for(let i of e){let r=t.get(i.id);if(!r)return;n.push(r)}return n.length>0?n:void 0}function aUe(e,t,n){let i=new Set,r=[];for(let o of e){let s=t.get(o.id)??[],a=n.get(o.id);if(!a||a.sitesResolvedl.file))];if(c.some(l=>i.has(l)))return;for(let l of c)i.add(l);r.push({...a.transform,files:c})}return r.length>0?r:void 0}function cUe(e,t,n,i){let r=new Map,o=new Map(t.map(c=>[c.id,c])),s=new Map;for(let c of n){let l=s.get(c.file);l?l.push(c):s.set(c.file,[c])}let a=(c,l,u,d)=>{if(c.id===l.id)return;let p=`${c.id}\0${l.id}\0${u}`;r.has(p)||r.set(p,{from:c.id,to:l.id,reason:u,evidence:[...new Set(d)].sort()})};for(let c=0;cf.dependency)),p=new Set(l.allowedFiles);for(let f=c+1;fk.dependency)),b=m.allowedFiles.filter(k=>p.has(k));b.length>0&&a(l,m,"same-file-conflict",b),u.some(k=>k.kind==="runtime-requirement")&&a(l,m,"runtime-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="config-change"||k.kind==="module-system-change")&&g.some(k=>d.has(k.dependency))&&a(l,m,"configuration-prerequisite",u.map(k=>k.summary)),u.some(k=>k.kind==="moved-export")&&uUe(u,g)&&a(l,m,"import-prerequisite",u.flatMap(k=>k.symbols)),l.allowedFiles.some(v1)&&!m.allowedFiles.every(v1)&&lUe(d,h)&&a(l,m,"generated-output",l.allowedFiles.filter(v1));let y=[...d].map(k=>i.get(k)).filter(k=>!!k).filter(k=>g.some($=>k.dependencies.includes($.dependency)));for(let k of y)a(l,m,"package-cohort",[`${k.id}: ${k.reason}`]);let w=dUe(l,m,s);w.length>0&&a(l,m,"symbol-dependency",w)}}return[...r.values()].sort($te)}function bte(e,t){return e.breakingChangeIds.map(n=>t.get(n)).filter(n=>!!n)}function lUe(e,t){for(let n of e)if(t.has(n))return!0;return!1}function uUe(e,t){let n=e.filter(i=>i.kind==="moved-export");if(n.length===0)return!1;for(let i of n){let r=new Set([...i.symbols,...i.replacementSymbols??[]]);if(t.some(o=>o.dependency===i.dependency&&o.symbols.some(s=>r.has(s))))return!0}return!1}function v1(e){return/(^|\/)(__generated__|generated|gen)\//i.test(e)||/\.(generated|gen)\./i.test(e)}function dUe(e,t,n){let i=new Set(e.allowedSymbols??[]);if(i.size===0)return[];let r=[];for(let o of t.allowedFiles)for(let s of n.get(o)??[])s.enclosingSymbol&&i.has(s.enclosingSymbol)&&r.push(`${o}:${s.line} is inside ${s.enclosingSymbol}`);return r}function $te(e,t){return e.from.localeCompare(t.from)||e.to.localeCompare(t.to)||e.reason.localeCompare(t.reason)||e.evidence.join("\0").localeCompare(t.evidence.join("\0"))}function pUe(e,t){let n=new Map(e.map(a=>[a.id,a])),i=new Map;for(let a of e)i.set(a.id,new Set);for(let a of t)!n.has(a.from)||!n.has(a.to)||i.get(a.to).add(a.from);let r=new Set(e.map(a=>a.id)),o=new Map,s=0;for(;r.size>0;){let a=[...r].filter(c=>[...i.get(c)??[]].every(l=>!r.has(l))).map(c=>n.get(c)).sort((c,l)=>c.order-l.order||c.id.localeCompare(l.id));if(a.length===0)return{commits:vte(e,t,o),cycle:[...r].sort()};for(let c of a)o.set(c.id,s),r.delete(c.id);s+=1}return{commits:vte(e,t,o),cycle:[]}}function vte(e,t,n){let i=new Map;for(let r of t){let o=i.get(r.to);o?o.push(r):i.set(r.to,[r])}return e.map(r=>{let o=[...i.get(r.id)??[]].sort($te);return{...r,dependsOn:o.map(s=>s.from).sort(),dependencyReasons:o,executionLayer:n.get(r.id)??0}}).sort((r,o)=>r.executionLayer-o.executionLayer||r.order-o.order||r.id.localeCompare(o.id)).map((r,o)=>({...r,order:o+1}))}function fUe(e,t){let n=t.filter(i=>e.includes(i.from)&&e.includes(i.to)).slice(0,5).map(i=>`${i.from} -> ${i.to} (${i.reason})`).join("; ");return`The remediation graph contains a dependency cycle across ${e.length} commit unit(s): ${n}. Drift cannot automatically execute this plan until the inseparable work is combined or reviewed manually.`}function mUe(e,t){let n=[];return e.some(i=>i.kind==="signature-change"||i.kind==="type-change"||i.kind==="removed-export"||i.kind==="renamed-export"||i.kind==="moved-export")&&n.push({id:St("check","typecheck",e.map(i=>i.id).sort().join(",")),kind:"typecheck",reason:"API-shape and type-contract migrations should be checked by the repository type checker when available."}),e.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push({id:St("check","test",e.map(i=>i.id).sort().join(",")),kind:"test",reason:"Behavioural and default changes need tests because compilation can still succeed with wrong behaviour."}),t.some(i=>/(^|\/)(package\.json|tsconfig\.json|vite\.config|webpack\.config|rollup\.config)/.test(i))&&n.push({id:St("check","build",t.join(",")),kind:"build",reason:"Configuration and package-entry changes can alter the build graph."}),n}function gUe(e,t){let n=[...t.map(i=>`file:${i}`),...e.flatMap(i=>i.symbols.map(r=>`symbol:${r}`)),...e.map(i=>`dependency:${i.dependency}`)];return[...new Set(n)].sort()}function wte(e){let t=[],n=new Map;for(let i of e){let r=n.get(i.ecosystem);r?r.push(i):n.set(i.ecosystem,[i])}for(let[i,r]of n)for(let o of hUe(r)){if(o.length<2)continue;let s=o.map(a=>a.name).sort();t.push({id:St("cohort",i,s.join(",")),ecosystem:o[0].ecosystem,dependencies:s,constraints:o.map(a=>({dependency:a.name,ecosystem:a.ecosystem,range:a.rawTo??a.to??"*",source:"workspace-family"})),candidatePaths:[...new Set(o.map(a=>a.manifestPath))].sort(),reason:`These ${i} packages appear to be part of the same ${yUe(o[0].name)} upgrade family and should be reviewed together.`})}return t.sort((i,r)=>i.id.localeCompare(r.id))}function hUe(e){let t=new Map;for(let n of e){let i=Ste(n.name);if(!i)continue;let r=t.get(i);r?r.push(n):t.set(i,[n])}return[...t.values()]}function Ste(e){let t=[/^(@angular)\//,/^(@babel)\//,/^(@nestjs)\//,/^(@types)\//,/^(@vue)\//,/^(react)(?:$|-)/,/^(next)(?:$|-)/,/^(eslint)(?:$|-)/,/^(jest)(?:$|-)/,/^(webpack)(?:$|-)/,/^(vite)(?:$|-)/];for(let n of t){let i=n.exec(e);if(i?.[1])return i[1]}if(e.startsWith("@")){let n=e.split("/")[0];return n&&n!==e?n:null}return null}function yUe(e){return bH(Ste(e)??e,32)}function bUe(e,t){let n=e[0],i=eUe(n.kind),r=wUe(e);return e.length===1?kte(`${i}(${r}): ${vUe(n)}`):kte(`${i}(${r}): update ${e.length} usages for the new ${n.dependency} API`)}function vUe(e){let t=e.symbols[0],n=e.replacementSymbols?.[0];switch(e.kind){case"removed-export":return t?`replace removed \`${t}\``:"replace removed API";case"renamed-export":return t&&n?`migrate \`${t}\` to \`${n}\``:`migrate renamed \`${t??"API"}\``;case"moved-export":return`import ${t?`\`${t}\``:"the API"} from its new entry point`;case"signature-change":return t?`update \`${t}\` call sites for the new signature`:"update call sites for new signatures";case"type-change":return t?`adapt to the new \`${t}\` type`:"adapt to changed types";case"removed-endpoint":return t?`migrate calls to removed endpoint \`${t}\``:"migrate removed endpoint calls";case"changed-endpoint":return t?`update requests to \`${t}\``:"update API requests";case"required-field-added":return t?`supply now-required \`${t}\``:"supply newly-required fields";case"default-change":return t?`pin previous default for \`${t}\``:"account for changed defaults";case"runtime-requirement":return e.summary.toLowerCase().startsWith("minimum")?e.summary.charAt(0).toLowerCase()+e.summary.slice(1):"raise the minimum runtime version";case"config-change":return"update configuration for the new version";case"module-system-change":return/commonjs/i.test(e.summary)?"replace dropped CommonJS usage":"migrate incompatible module loading";case"behaviour-change":return t?`handle changed \`${t}\` behaviour`:"handle changed behaviour";default:return`update usage of \`${e.dependency}\``}}function wUe(e){let t=[...new Set(e.map(n=>n.dependency))];if(t.length===1){let n=t[0];return n.startsWith("@")?n.split("/")[1]??n:n.split(":").pop()??n}return"deps"}function kte(e){return e.length<=72?e:`${e.slice(0,69)}...`}function kUe(e,t,n,i){let r=[];for(let s of e)r.push(s.summary),r.push(""),r.push(s.remediation),r.push("");let o=[...new Set(t.map(s=>s.file))];if(r.push(`Affects ${t.length} location(s) across ${o.length} file(s).`),r.push(""),n){let s=new Set(n.flatMap(a=>a.files)).size;r.push(`Resolved deterministically by Drift's codemod engine across ${s} file(s) \u2014 no model call was made for this commit.`)}else if(i&&i.length>0){let s=[...new Map(i.map(c=>[`${c.provider}:${c.name}@${c.version}`,c])).values()],a=s.map(c=>`${c.name}@${c.version} (${c.provider}, published by ${c.publisher})`).join(", ");r.push(`Community recipe available: ${a}. Not applied without an explicit choice \u2014 see ${s[0].source}.`)}else r.push("Identified by Drift from upstream evidence; see the pull request"),r.push("description for the citations behind this change.");return r.join(` +`).trim()}function _Ue(e,t,n,i){let r=[];r.push(`## Commit ${n} of ${i}`),r.push("");for(let o of e){r.push(`### ${o.summary}`),r.push(""),r.push(`- Dependency: \`${o.dependency}\``),r.push(`- Change type: ${o.kind}`),r.push(`- Confidence: ${o.confidence}`),r.push(""),r.push(o.remediation),r.push("");let s=t.filter(a=>a.breakingChangeId===o.id);if(s.length>0){r.push("Known locations (verify each; there may be others):"),r.push("");for(let a of s.slice(0,40)){let c=a.enclosingSymbol?` in \`${a.enclosingSymbol}\``:"";r.push(`- \`${a.file}:${a.line}\`${c} \u2014 \`${a.excerpt}\``)}s.length>40&&r.push(`- \u2026and ${s.length-40} more matches of the same symbols`),r.push("")}}return r.join(` +`).trim()}var xte=["detect","evidence","surface","static-analysis","upgrade-discovery","upgrade-install","verify","fix","pull-request"],_1={detect:"Detect",evidence:"Evidence",surface:"API surface","static-analysis":"Static analysis","upgrade-discovery":"Find upgrades","upgrade-install":"Install a version",verify:"Verify",fix:"Fix","pull-request":"Automated PR"},ge=()=>({level:"full"}),he=(e,t)=>({level:"partial",note:e,...t?{requires:t}:{}}),ru=e=>({level:"none",note:e}),sc="Resolves imports against the module names the published package declares, follows re-exports inside your repository, and matches references to symbols named in the evidence. Cannot see through reflection, dynamic dispatch, or generated code.",$Ue="Matches imports and references to symbols named in the evidence, using the ecosystem's own module-naming convention where no published module list exists. Cannot see through reflection, dynamic dispatch, or generated code.",w1="Compares the declarations in both versions' public headers, which is what a consumer compiles against. Declarations behind preprocessor conditionals are read as written, not per build configuration.",k1="Matches `#include` directives and references to symbols named in the evidence, following includes through your own headers so a library reached indirectly still counts. A macro-generated call site is invisible.",SUe={npm:{ecosystem:"npm",localizationBasis:"declared",label:"JavaScript / TypeScript",files:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","npm-shrinkwrap.json"],managers:["npm","pnpm","Yarn (classic)","Yarn (berry)","Bun"],support:{detect:ge(),evidence:ge(),surface:he("Diffs published TypeScript declarations. A package that ships no declarations of its own falls back to prose evidence rather than reporting a clean comparison."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs the typecheck, test, and build scripts the project's package.json actually declares."),fix:ge(),"pull-request":ge()}},pypi:{ecosystem:"pypi",localizationBasis:"published",label:"Python",files:["pyproject.toml","requirements.in","requirements.txt","setup.py","poetry.lock","uv.lock","Pipfile"],managers:["pip","Poetry","uv"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public surface reconstructed from published type stubs. Packages without stubs fall back to prose evidence.","a local Python interpreter"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs mypy/pyright and pytest when the project declares them."),fix:ge(),"pull-request":ge()}},go:{ecosystem:"go",localizationBasis:"declared",label:"Go",files:["go.mod","go.sum"],managers:["Go modules"],support:{detect:ge(),evidence:ge(),surface:he("Compares the exported API of both module versions.","the Go toolchain"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `go vet`, `go test`, and `go build`.","the Go toolchain"),fix:ge(),"pull-request":ge()}},cargo:{ecosystem:"cargo",localizationBasis:"declared",label:"Rust",files:["Cargo.toml","Cargo.lock"],managers:["Cargo"],support:{detect:ge(),evidence:ge(),surface:he("Compares the public API of both crate versions.","cargo-public-api"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `cargo check`, `cargo test`, and `cargo build`.","the Rust toolchain"),fix:ge(),"pull-request":ge()}},maven:{ecosystem:"maven",localizationBasis:"published",label:"Java / Kotlin / Scala",files:["pom.xml","build.gradle","build.gradle.kts","gradle/libs.versions.toml","build.sbt"],managers:["Maven","Gradle","sbt"],support:{detect:he("Reads pom.xml, Gradle build files and version catalogs, and sbt coordinates. Gradle versions computed at configuration time are not visible without running Gradle."),evidence:ge(),surface:he("Compares both published JARs.","japicmp"),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs Maven or Gradle. sbt projects verify through sbt when it is installed."),fix:he("Maven and sbt are edited through the build file; Gradle versions declared outside a version catalog may need a manual edit."),"pull-request":ge()}},rubygems:{ecosystem:"rubygems",localizationBasis:"published",label:"Ruby",files:["Gemfile","Gemfile.lock","*.gemspec"],managers:["Bundler"],support:{detect:ge(),evidence:ge(),surface:ru("Ruby has no static public API surface to compare, so upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs RSpec or Rake when the Gemfile declares them.","Bundler"),fix:ge(),"pull-request":ge()}},nuget:{ecosystem:"nuget",localizationBasis:"published",label:".NET",files:["*.csproj","*.fsproj","*.vbproj","Directory.Packages.props","packages.lock.json"],managers:["NuGet"],support:{detect:ge(),evidence:he("Registry metadata, published versions, deprecation, and OSV advisories. Release notes depend on the package declaring a GitHub repository."),surface:he("Compares the public types and member signatures in both versions' published assemblies, preferring the reference assembly and a common target framework. A package that ships only native binaries, analyzers, or nothing at all has no surface to compare."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dotnet build` and `dotnet test`.","the .NET SDK"),fix:ge(),"pull-request":ge()}},packagist:{ecosystem:"packagist",localizationBasis:"published",label:"PHP",files:["composer.json","composer.lock"],managers:["Composer"],support:{detect:ge(),evidence:he("Registry metadata, published versions, abandonment notices, and OSV advisories. Release notes depend on the package declaring a source repository."),surface:ru("PHP publishes no machine-comparable API artefact; upgrades rest on release notes, changelogs, and advisories."),"static-analysis":he("Resolves `use` statements against the PSR-4 and PSR-0 roots the package declares in its own composer.json, read from Packagist. A package that autoloads only by classmap declares no namespace root and is not localized."),"upgrade-discovery":ge(),verify:he("Runs PHPUnit when composer.json declares it.","Composer"),fix:ge(),"pull-request":ge()}},hex:{ecosystem:"hex",localizationBasis:"published",label:"Elixir / Erlang",files:["mix.exs","mix.lock"],managers:["Mix"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retirement notices, and OSV advisories."),surface:he("Compares the public modules and their functions, by name and arity, in both versions' published sources \u2014 `def` and `defmacro` in Elixir, `-export` in Erlang. A function a macro generates at compile time is not visible without compiling."),"static-analysis":he("Resolves module references against every module the released tarball defines, so a fully qualified call needs no `alias` to be found. Cannot see through `apply/3` or a module name computed at runtime."),"upgrade-discovery":ge(),verify:he("Runs `mix compile --warnings-as-errors` and `mix test`.","Elixir and Mix"),fix:ge(),"pull-request":ge()}},pub:{ecosystem:"pub",localizationBasis:"declared",label:"Dart / Flutter",files:["pubspec.yaml","pubspec.lock"],managers:["Dart pub","Flutter"],support:{detect:ge(),evidence:he("Registry metadata, published versions, retraction, and OSV advisories. Release notes depend on the package declaring a repository."),surface:he("Compares the public declarations of both versions' published libraries, following each `export` out of the private `lib/src` tree the way a consumer's import does. Read from source rather than from a compiled artefact."),"static-analysis":he(sc),"upgrade-discovery":ge(),verify:he("Runs `dart analyze` and `dart test`, or their Flutter equivalents.","the Dart or Flutter SDK"),fix:ge(),"pull-request":ge()}},swift:{ecosystem:"swift",localizationBasis:"published",label:"Swift",files:["Package.swift","Package.resolved"],managers:["Swift Package Manager"],support:{detect:he("Reads literal `.package(...)` declarations and Package.resolved. Versions computed by Swift code at manifest-evaluation time are not visible without running SwiftPM."),evidence:he("Source repository, releases, and changelogs, because SwiftPM identifies packages by git URL. There is no central registry to query for deprecation."),surface:ru("Comparing two Swift module interfaces needs a local toolchain and a built artefact Drift does not produce; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the library and target names declared in the dependency's own Package.swift at the resolved version. A module name a manifest computes at evaluation time is not visible without running SwiftPM."),"upgrade-discovery":he("Versions are git tags, since SwiftPM has no package registry to ask. Drift lists them for packages hosted on GitHub; anything on another git host is reported as unchecked rather than up to date."),verify:he("Runs `swift build` and `swift test`.","the Swift toolchain"),fix:ge(),"pull-request":ge()}},cocoapods:{ecosystem:"cocoapods",localizationBasis:"published",label:"CocoaPods",files:["Podfile","Podfile.lock","*.podspec"],managers:["CocoaPods"],support:{detect:ge(),evidence:he("Release notes and changelogs when the pod declares a GitHub source. CocoaPods publishes no queryable metadata API, so there is no deprecation or advisory signal."),surface:ru("Drift does not compare compiled iOS frameworks; upgrades rest on prose evidence."),"static-analysis":he("Resolves `import` statements against the `module_name` the pod declares in its podspec, read from the CocoaPods CDN. A pod that builds its module name in Ruby at podspec-evaluation time is not visible without running CocoaPods."),"upgrade-discovery":ge(),verify:ru("Building an iOS target needs Xcode and a scheme Drift cannot infer; verification stays with the developer."),fix:ge(),"pull-request":ge()}},opam:{ecosystem:"opam",localizationBasis:"convention",label:"OCaml",files:["*.opam","dune-project","*.opam.locked"],managers:["opam"],support:{detect:ge(),evidence:he("Release notes and changelogs when the package declares a GitHub source. opam has no JSON metadata API, so there is no registry deprecation signal."),surface:ru("Comparing two OCaml module interfaces needs a built switch Drift does not create; upgrades rest on prose evidence."),"static-analysis":he($Ue),"upgrade-discovery":he("opam publishes no version API, so releases are read from the package directories in the opam-repository index. A package published only in a custom repository is reported as unchecked rather than up to date."),verify:he("Runs `dune build` and `dune runtest`.","opam and dune"),fix:ge(),"pull-request":ge()}},conan:{ecosystem:"conan",localizationBasis:"convention",label:"C / C++ (Conan)",files:["conanfile.txt","conanfile.py","conan.lock"],managers:["Conan"],support:{detect:he("Reads conanfile.txt, conan.lock, and the literal `requires` declarations in conanfile.py. A reference a recipe builds at evaluation time is not visible without running Python."),evidence:he("Versions from the ConanCenter recipe index, and releases and changelogs from the upstream project the recipe builds \u2014 not from the recipe itself. ConanCenter publishes no deprecation signal, and OSV has no Conan ecosystem."),surface:he(w1),"static-analysis":he(k1),"upgrade-discovery":he("Conan version schemes are package-defined, so Drift can analyze exact version changes but does not invent an ordering to select a newer release automatically."),verify:he("Runs `conan build`, which is the compiler \u2014 in C and C++ an incompatible header change is a build failure rather than a runtime surprise.","Conan"),fix:ge(),"pull-request":ge()}},vcpkg:{ecosystem:"vcpkg",localizationBasis:"convention",label:"C / C++ (vcpkg)",files:["vcpkg.json","vcpkg-configuration.json"],managers:["vcpkg"],support:{detect:he("Reads declared dependencies, `version>=` floors, and `overrides`. A registry baseline moving changes every unpinned version at once; Drift reports the baseline move rather than resolving it to versions."),evidence:he("Versions from the vcpkg versions database, and releases and changelogs from the port's upstream project. vcpkg publishes no deprecation signal, and OSV has no vcpkg ecosystem."),surface:he(w1),"static-analysis":he(k1),"upgrade-discovery":he("vcpkg versions are port-defined and baseline resolution can change every dependency, so Drift analyzes exact overrides but does not invent an ordering or resolve baseline moves automatically."),verify:he("Runs the project's CMake build, which is where an incompatible header change surfaces.","CMake"),fix:ge(),"pull-request":ge()}},arduino:{ecosystem:"arduino",localizationBasis:"convention",label:"Arduino / PlatformIO",files:["library.properties","platformio.ini"],managers:["Arduino CLI","PlatformIO"],support:{detect:ge(),evidence:he("Versions and repositories from the Arduino Library Manager index, plus releases and changelogs from the library's own repository. A library published only to PlatformIO has metadata but no version history, because that registry serves only the current release."),surface:he(w1),"static-analysis":he(k1),"upgrade-discovery":ge(),verify:he("Runs `arduino-cli compile` or `pio run`, and `pio test` where the project has tests.","Arduino CLI or PlatformIO"),fix:ge(),"pull-request":ge()}}};function xUe(e){let t=ua.filter(s=>s.ecosystem===e),n={name:"example",version:"1.0.0",kind:"runtime"},i=t.filter(s=>s.upgrade(n)!==null),r=t.filter(s=>s.upgrade(n)===null);if(r.length===0)return ge();let o=s=>s.map(a=>a.label).join(", ");return i.length===0?ru(`${o(r)} ${r.length===1?"has":"have"} no command that pins a version \u2014 the coordinate lives in a build file the tool will not rewrite. Drift reports the version to set and where, and leaves the edit to you.`):he(`${o(i)} can install a chosen version directly. ${o(r)} cannot: the version lives in a build file the tool will not rewrite, so Drift tells you what to change instead of running something that silently changes nothing.`)}var EUe=Object.values(SUe).map(e=>({...e,support:{...e.support,"upgrade-install":xUe(e.ecosystem)}})),TUe=Object.fromEntries(EUe.map(e=>[e.ecosystem,e]));function Ete(e){return TUe[e]}var $1=require("node:crypto");var Pf=3,S1=[Pf];function ni(e){return e===null||typeof e!="object"?JSON.stringify(e??null)??"null":Array.isArray(e)?`[${e.map(n=>ni(n)).join(",")}]`:`{${Object.entries(e).filter(([,n])=>n!==void 0).sort(([n],[i])=>ni?1:0).map(([n,i])=>`${JSON.stringify(n)}:${ni(i)}`).join(",")}}`}function IUe(e){return{id:e.id,source:e.source,dependency:e.dependency,url:e.url??null,locator:e.locator??null,title:e.title,contentHash:(0,$1.createHash)("sha256").update(e.content).digest("hex"),weight:e.weight,findings:(e.findings??[]).map(t=>({code:t.code,symbol:t.symbol,detail:t.detail,before:t.before??null,after:t.after??null}))}}function AUe(e){return{nature:e.nature,detectability:[...e.detectability].sort(),scope:e.scope,visibility:[...e.visibility].sort(),origin:e.origin}}function RUe(e){return{schemaVersion:Pf,id:e.id,baseBranch:e.baseBranch,headSha:e.headSha,risk:e.risk,blockers:[...e.blockers],warnings:[...e.warnings],changes:e.changes.map(t=>({name:t.name,ecosystem:t.ecosystem,from:t.from,to:t.to,kind:t.kind,bump:t.bump,manifestPath:t.manifestPath,workspace:t.workspace??null})),breakingChanges:e.breakingChanges.map(t=>({id:t.id,dependency:t.dependency,kind:t.kind,summary:t.summary,remediation:t.remediation,symbols:[...t.symbols].sort(),replacementSymbols:[...t.replacementSymbols??[]].sort(),confidence:t.confidence,taxonomy:AUe(Dr(t)),assessment:t.assessment?{upstream:t.assessment.upstream.score,localImpact:t.assessment.localImpact.score,verification:t.assessment.verification.score,automaticExecutionEligible:t.assessment.automaticExecutionEligible,calibration:t.assessment.upstream.calibration}:null,citations:[...t.citations].sort()})),impactSites:e.impactSites.map(t=>({breakingChangeId:t.breakingChangeId,file:t.file,line:t.line,matchedSymbol:t.matchedSymbol,enclosingSymbol:t.enclosingSymbol??null,confidence:t.confidence})),commits:e.commits.map(t=>({id:t.id,order:t.order,message:t.message,body:t.body,breakingChangeIds:[...t.breakingChangeIds].sort(),files:[...t.files].sort(),allowedFiles:[...t.allowedFiles].sort(),allowedSymbols:[...t.allowedSymbols??[]].sort(),instructions:t.instructions,dependsOn:[...t.dependsOn].sort(),dependencyReasons:[...t.dependencyReasons].map(n=>({from:n.from,to:n.to,reason:n.reason,evidence:[...n.evidence].sort()})).sort((n,i)=>ni(n).localeCompare(ni(i))),executionLayer:t.executionLayer,expectedChecks:[...t.expectedChecks].map(n=>({id:n.id,kind:n.kind,command:n.command??null,reason:n.reason})).sort((n,i)=>ni(n).localeCompare(ni(i))),invalidationTriggers:[...t.invalidationTriggers].sort()})),planEdges:[...e.planEdges].map(t=>({from:t.from,to:t.to,reason:t.reason,evidence:[...t.evidence].sort()})).sort((t,n)=>ni(t).localeCompare(ni(n))),upgradeCohorts:[...e.upgradeCohorts].map(t=>({id:t.id,ecosystem:t.ecosystem,dependencies:[...t.dependencies].sort(),constraints:[...t.constraints].map(n=>({dependency:n.dependency,ecosystem:n.ecosystem,range:n.range,source:n.source})).sort((n,i)=>ni(n).localeCompare(ni(i))),candidatePaths:[...t.candidatePaths].sort(),reason:t.reason})).sort((t,n)=>t.id.localeCompare(n.id)),evidence:e.evidence.map(IUe),gaps:[...e.gaps].map(t=>({stage:t.stage,dependency:t.dependency??null,ecosystem:t.ecosystem??null,surface:t.surface,severity:t.severity,automaticExecution:t.automaticExecution})).sort((t,n)=>ni(t).localeCompare(ni(n)))}}function hx(e){return(0,$1.createHash)("sha256").update(ni(RUe(e))).digest("hex")}function CUe(e,t,n){return t.breakingChangeId!==e.id||t.confidence!=="high"?!1:e.kind!=="runtime-requirement"?!0:n?.changeId===e.id&&n.state==="incompatible"&&t.runtimeVerdict==="incompatible"}function NUe(e){let t=new Set,n=[];for(let i of e){let r=`${i.file}:${i.line}:${i.column??""}:${i.matchedSymbol??""}`;t.has(r)||(t.add(r),n.push(i))}return n}function Df(e,t,n,i,r=!0){let o=new Map;for(let s of n){let a=o.get(s.changeId);a?a.push(s):o.set(s.changeId,[s])}return e.map(s=>{let a=NUe(t.filter(d=>d.breakingChangeId===s.id)),c=o.get(s.id)??[],l=c.length===1?c[0]:void 0,u=a.filter(d=>CUe(s,d,l));if(s.kind==="runtime-requirement"){if(!l)return{changeId:s.id,state:"unknown",reason:"not-localized",sites:a,actionableSites:u};let d={changeId:s.id,sites:a,actionableSites:u,runtimeAnalysis:{runtime:l.runtime,state:l.state,reason:l.reason}};return l.state==="incompatible"?{...d,state:"actionable",reason:"runtime-incompatible"}:l.state==="partial"?{...d,state:"review-only",reason:"runtime-partial"}:l.state==="unknown"?{...d,state:"review-only",reason:"runtime-unknown"}:{...d,state:"unaffected",reason:"runtime-compatible"}}return u.length>0?{changeId:s.id,state:"actionable",reason:"high-confidence-impact",sites:a,actionableSites:u}:a.length>0?{changeId:s.id,state:"review-only",reason:"low-confidence-impact",sites:a,actionableSites:u}:i?r?{changeId:s.id,state:"unknown",reason:"impact-unresolved",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"localization-incomplete",sites:[],actionableSites:[]}:{changeId:s.id,state:"unknown",reason:"not-localized",sites:[],actionableSites:[]}})}function Tte(e){return e.assessment?A7(e.assessment):e.confidence}function yx(e){let{repo:t,config:n,changes:i,evidence:r,impactSites:o}=e,s=PUe(e),a=Df(s,o,e.runtimeAnalyses??e.rationale?.flatMap(m=>m.runtimeAnalyses??[])??[],e.localizationRan??!0,e.localizationComplete??!0),c=_te({breakingChanges:s,impactSites:o,dispositions:a,config:n,changes:i,codemods:e.codemods,recipes:e.recipes,fixPlans:e.fixPlans}),l=c.commits,u=x1(i,s,o,(e.rationale??[]).map(m=>m.assessment.runtimeCompatibility),a),d=DUe(e,s,l),{blockers:p,warnings:f}=LUe(e,s,l,u,d);return{schemaVersion:Pf,id:St("plan",t.owner,t.repo,t.afterSha),branchName:MUe(n,i,t.afterSha),baseBranch:t.baseBranch,headSha:t.afterSha,changes:[...i],evidence:[...r],breakingChanges:s,upstreamBreakingCount:s.length,impactSites:[...o],dispositions:a,localizationRan:e.localizationRan??!0,localizationComplete:e.localizationComplete??!0,runtimeConfigComplete:e.runtimeConfigComplete??!0,commits:l,planEdges:c.edges,upgradeCohorts:c.cohorts,...e.rationale?{rationale:[...e.rationale]}:{},risk:u,gaps:d,checkedSurfaces:[...e.checkedSurfaces??[]],confirmedRegressions:[...e.confirmedRegressions??[]],blockers:[...c.blockers,...p],warnings:f,createdAt:new Date().toISOString()}}function PUe(e){let{evidence:t,breakingChanges:n,impactSites:i}=e,r=e.localizationRan??!0,o=e.localizationComplete??!0;return n.map(s=>{let a=i.filter(p=>p.breakingChangeId===s.id),c=Dr(s),l=(e.runtimeAnalyses??[]).find(p=>p.changeId===s.id)?.state,u=(e.verification??[]).filter(p=>p.breakingChangeIds!==void 0?p.breakingChangeIds.includes(s.id):p.dependency===void 0?!0:p.dependency===s.dependency&&p.workspace===s.workspace),d=I7({change:s,taxonomy:c,evidence:t,sites:a,localizationRan:r,localizationComplete:o,runtimeState:l,outcomes:u,checkedSurfaces:e.checkedSurfaces??[],gaps:[]});return{...s,taxonomy:c,assessment:d}})}function DUe(e,t,n){let{changes:i,evidence:r,impactSites:o,config:s}=e,a=[],c=e.localizationRan??!0;c&&e.localizationComplete===!1&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:e.runtimeConfigComplete===!1?"Source localization was incomplete, and at least one authoritative runtime configuration file could not be indexed. Zero local API sites is not an exhaustive absence claim.":"Source localization reached its file limit. Runtime configuration was indexed completely, but zero local API sites is not an exhaustive absence claim.",severity:"blocking",automaticExecution:"blocks",remediation:"Raise the source indexing limit or narrow the scan to the relevant workspace."}),!c&&t.length>0&&a.push({stage:"localize",surface:"repository source",reason:'No checkout was available, so Drift could not search this repository for affected code. Zero impact sites here means "not searched", not "not affected".',severity:"blocking",automaticExecution:"blocks",remediation:"Run Drift as a GitHub Action or from the CLI in a checkout. The webhook runner cannot localize \u2014 see docs/deployment.md."});for(let u of i)r.filter(f=>f.dependency===u.name&&f.workspace===u.workspace).filter(f=>f.source!=="semver-heuristic"&&f.source!=="registry-metadata").length===0&&a.push({stage:"evidence",ecosystem:u.ecosystem,dependency:u.name,surface:"upstream release evidence",reason:`No changelog, release notes, migration guide, or API diff could be retrieved for ${u.name}. Drift will not dispatch a fix based on a version number alone.`,severity:"significant",automaticExecution:s.guardrails.requireEvidence&&t.length>0?"blocks":"degrades",remediation:"Check the package publishes release notes Drift can reach, or review this upgrade by hand."});for(let u of t)o.filter(p=>p.breakingChangeId===u.id).length>0||y$(Dr(u))&&a.push({stage:"localize",dependency:u.dependency,surface:`reachability of ${u.symbols.slice(0,3).join(", ")||u.dependency}`,reason:`${u.summary} is only observable at runtime, so searching the source cannot establish whether this repository is affected.`,severity:"significant",automaticExecution:"degrades",remediation:"Confirm by exercising the affected paths, or review the upstream notes directly."});(e.verification??[]).filter(u=>!u.name.startsWith("behavioural:")).length===0&&n.length>0&&a.push({stage:"verify",surface:"build, typecheck, and test",reason:"No checks were run against this plan, so nothing confirms the findings were understood correctly or that a fix would compile.",severity:"significant",automaticExecution:"degrades",remediation:"Configure the repository checks Drift should run, or review the resulting pull request against CI before merging."});for(let u of[...new Set(i.map(d=>d.ecosystem))].sort()){let d=Ete(u);for(let p of xte)d.support[p].level==="none"&&a.push({stage:OUe(p),ecosystem:u,surface:_1[p],reason:d.support[p].note??`${_1[p]} does not run for ${u}.`,severity:"significant",automaticExecution:"degrades",remediation:`Drift cannot run this stage for ${u}; review this surface by hand.`})}return a}function OUe(e){switch(e){case"detect":return"detect";case"evidence":case"surface":return"evidence";case"static-analysis":return"localize";case"verify":return"verify";default:return"plan"}}function MUe(e,t,n){return gte({changes:t},{branch:e.pullRequest.branchTemplate,prefix:e.remediation.branchPrefix})}function x1(e,t,n,i=[],r){let o=i.some(p=>p==="unknown"||p==="partial"),s=r?.some(p=>p.state==="review-only"||p.state==="unknown")??!1,a=r?r.flatMap(p=>p.actionableSites):n;if(t.length===0||a.length===0)return o||s?"low":"none";let c="low",l=p=>{L2(p,c)>0&&(c=p)},u=new Set(a.map(p=>p.file)).size;(u>5||a.length>20)&&l("medium"),(u>20||a.length>75)&&l("high");let d=new Set((r??[]).filter(p=>p.state!=="unaffected").map(p=>p.changeId));for(let p of t.filter(f=>d.size===0||d.has(f.id)))(p.kind==="behaviour-change"||p.kind==="default-change")&&l("high"),p.kind==="unknown"&&l("medium"),p.confidence==="low"&&l("medium");for(let p of e)p.bump==="major"&&l("medium"),Dg(p.from,p.to,p.ecosystem)&&l("high");return a.some(p=>Ite(p.file))&&l("medium"),c}function LUe(e,t,n,i,r){let{config:o,changes:s,impactSites:a,skipped:c=[]}=e,l=o.guardrails,u=[],d=[],p=[...new Set(n.flatMap($=>$.files))];p.length>l.maxFilesChanged&&u.push(`This plan would touch ${p.length} files, above the \`maxFilesChanged\` limit of ${l.maxFilesChanged}. A change this wide should be read by a person before an agent starts editing.`),s.length>l.maxDependenciesPerRun&&u.push(`${s.length} dependencies moved in one commit, above the \`maxDependenciesPerRun\` limit of ${l.maxDependenciesPerRun}. Batched upgrades make it hard to attribute a regression to the dependency that caused it.`);let f=p.filter($=>Yo(l.protectedPaths,$));f.length>0&&u.push(`Impact sites fall inside protected paths: ${f.slice(0,5).join(", ")}${f.length>5?`, +${f.length-5} more`:""}. Drift will not direct an agent to edit these.`);let m=s.filter($=>Yo(o.alwaysApprove,$.name));m.length>0&&u.push(`${m.map($=>$.name).join(", ")} matched \`alwaysApprove\` in drift.yml.`);let g=new Set(n.flatMap($=>$.breakingChangeIds)),h=t.filter($=>g.has($.id)&&!BF(Tte($),l.minConfidence));if(h.length>0){let $=h.slice(0,3).map(S=>`\`${S.dependency}\`: ${S.summary}`).join("; ");l.experimentalDispatchBelowMinConfidence?d.push(`${h.length} finding(s) are below the \`minConfidence\` threshold of \`${l.minConfidence}\` but \`experimentalDispatchBelowMinConfidence\` is on, so Drift will dispatch anyway. ${$}.`):u.push(`${h.length} finding(s) Drift planned commits for are below the \`minConfidence\` threshold of \`${l.minConfidence}\`: ${$}. The plan is filed for review rather than dispatched.`)}let b=t.filter($=>!g.has($.id)&&!BF(Tte($),l.minConfidence));b.length>0&&d.push(`${b.length} finding(s) are below the \`minConfidence\` threshold and no commit was planned for them. They are listed for awareness.`);let y=r.filter($=>$.automaticExecution==="blocks");for(let $ of y)u.push(`${$.reason} ${$.remediation}`);_N(i,o.maxAutoRisk)||u.push(`Assessed risk is \`${i}\`, above the \`maxAutoRisk\` ceiling of \`${o.maxAutoRisk}\`.`);let w=a.filter($=>Ite($.file));w.length>0&&d.push(`${w.length} impact site(s) are in test files. Confirm the fix updates tests to match the new API rather than weakening what they assert.`);let k=t.filter($=>!a.some(S=>S.breakingChangeId===$.id));k.length>0&&d.push(`${k.length} breaking change(s) were identified upstream but no usage was found in this repository. They are listed for awareness and no commit was planned for them.`);for(let $ of c)d.push(`Skipped \`${$.change.name}\`: ${$.reason}.`);return{blockers:u,warnings:d}}function Ite(e){let t=e.toLowerCase();return/(^|\/)(tests?|__tests__|spec|specs|e2e|integration_tests)\//.test(t)||/\.(test|spec)\.[jt]sx?$/.test(t)||/(^|\/)test_[^/]+\.py$/.test(t)||/_test\.(py|go|rb)$/.test(t)||/_spec\.rb$/.test(t)||/Test\.java$/.test(e)||/Tests?\.kt$/.test(e)}function Ate(e,t){return t.mode!=="auto"||e.blockers.length>0||e.commits.length===0?!1:_N(e.risk,t.maxAutoRisk)}var jy=require("node:fs/promises"),io=require("node:path");async function Rte(e,t,n){let i=n.replace(/\\/g,"/").trim();if(!i||/[\n\r\0]/.test(i))return null;let r;try{r=await(0,jy.realpath)(e)}catch{return null}let o=(0,io.isAbsolute)(i)||/^[A-Za-z]:\//.test(i)?[i]:[...new Set([t?(0,io.join)(r,t,i):null,(0,io.join)(r,i)].filter(s=>s!==null))];for(let s of o){let a;try{if(a=await(0,jy.realpath)(s),!(await(0,jy.stat)(a)).isFile())continue}catch{continue}let c=(0,io.relative)(r,a);if(!(!c||c.startsWith("..")||(0,io.isAbsolute)(c))&&!c.split(io.sep).includes(".git"))return c.split(io.sep).join("/")}return null}var Cte="https://api.osv.dev/v1/query",FUe="https://api.osv.dev/v1/querybatch",UUe="https://api.osv.dev/v1/vulns",Mte={npm:"npm",pypi:"PyPI",go:"Go",cargo:"crates.io",maven:"Maven",rubygems:"RubyGems",nuget:"NuGet",packagist:"Packagist",hex:"Hex",pub:"Pub",swift:"SwiftURL",cocoapods:null,opam:null,conan:null,vcpkg:null,arduino:null};async function zy(e,t,n,i,r={}){let o=Mte[t];if(!o)return Uo(`OSV has no advisory coverage for ${t} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`);let s=r.fetch??KUe,[a,c]=await Promise.all([s(Cte,bx(e,o,n)),s(Cte,bx(e,o,i))]);return Lte(a,c,n,i,t)}async function Gy(e,t={}){let n=new Map,i=[];for(let a of e){let c=Mte[a.ecosystem];c?i.push({lookup:a,osvEcosystem:c}):n.set(a,Uo(`OSV has no advisory coverage for ${a.ecosystem} packages, so this upgrade's effect on known vulnerabilities could not be looked up.`))}if(i.length===0)return n;if(i.length===1&&!t.batchFetch){let{lookup:a}=i[0];return n.set(a,await zy(a.name,a.ecosystem,a.from,a.to,t)),n}if(t.fetch&&!t.batchFetch){let a=await Promise.all(i.map(({lookup:c})=>zy(c.name,c.ecosystem,c.from,c.to,t)));return i.forEach(({lookup:c},l)=>n.set(c,a[l])),n}let r=i.flatMap(({lookup:a,osvEcosystem:c})=>[bx(a.name,c,a.from),bx(a.name,c,a.to)]),s=await(t.batchFetch??HUe)(r);if(iu(s)){for(let{lookup:a}of i)n.set(a,Uo(`${s.osvFailure}, so this upgrade's effect on known vulnerabilities is unknown.`));return n}for(let a=0;a!E1(d,a)),l=a.filter(d=>!E1(d,s)),u=s.filter(d=>E1(d,a));return{checked:!0,current:s,target:a,resolved:c,introduced:l,carried:u,direction:jUe(c,l)}}function bx(e,t,n){return{version:n,package:{name:e,ecosystem:t}}}function E1(e,t){let n=new Set([e.id,...e.aliases]);return t.some(i=>n.has(i.id)||i.aliases.some(r=>n.has(r)))}function jUe(e,t){return e.length>0&&t.length>0?"mixed":e.length>0?"improves":t.length>0?"worsens":"preserves"}function Uo(e){return{checked:!1,...e?{reason:e}:{},current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"}}function Nte(e,t,n="npm"){let i=e?.vulns;if(!Array.isArray(i))return[];let r=[];for(let o of i)!o.id||o.withdrawn||r.push({id:o.id,aliases:(o.aliases??[]).filter(s=>typeof s=="string"),summary:qUe(o.summary||o.details||"No summary published."),severity:GUe(o),url:BUe(o),fixedIn:VUe(o,t,n)});return Fte(r,n).sort((o,s)=>Pte[o.severity]-Pte[s.severity])}function Fte(e,t="npm"){let n=new Map,i=[];for(let r of e){let o=[r.id,...r.aliases],a=o.map(c=>n.get(c)).find(c=>c!==void 0)??i.push([])-1;i[a].push(r);for(let c of o)n.set(c,a)}return i.filter(r=>r.length>0).map(r=>{let o=r.find(a=>a.severity!=="unknown")??r[0],s=new Set(r.flatMap(a=>[a.id,...a.aliases]));return s.delete(o.id),{...o,aliases:[...s].sort(),fixedIn:zUe(r.map(a=>a.fixedIn),t),summary:r.find(a=>a.summary!=="No summary published.")?.summary??o.summary}})}function zUe(e,t){return e.filter(i=>!!i).map(i=>({raw:i,parsed:Te(i,t)})).filter(i=>i.parsed!==null).sort((i,r)=>Qe(i.parsed,r.parsed)??0)[0]?.raw??e.find(i=>!!i)??null}var Pte={critical:0,high:1,medium:2,low:3,unknown:4};function GUe(e){let t=e.database_specific?.severity??e.affected?.find(r=>r.database_specific?.severity)?.database_specific?.severity??e.affected?.find(r=>r.ecosystem_specific?.severity)?.ecosystem_specific?.severity;if(t){let r=t.toLowerCase();if(r==="critical")return"critical";if(r==="high")return"high";if(r==="moderate"||r==="medium")return"medium";if(r==="low")return"low"}let n=e.severity?.find(r=>r.score)?.score,i=n?Ute(n):null;return i===null?"unknown":i>=9?"critical":i>=7?"high":i>=4?"medium":"low"}function Ute(e){if(!/^CVSS:3\.[01]\//.test(e))return null;let t=new Map;for(let w of e.split("/").slice(1)){let[k,$]=w.split(":");k&&$&&t.set(k,$)}let n={N:.85,A:.62,L:.55,P:.2},i={L:.77,H:.44},r={N:.85,R:.62},o={H:.56,L:.22,N:0},s=t.get("S")==="C",a=s?{N:.85,L:.68,H:.5}:{N:.85,L:.62,H:.27},c=n[t.get("AV")??""],l=i[t.get("AC")??""],u=a[t.get("PR")??""],d=r[t.get("UI")??""],p=o[t.get("C")??""],f=o[t.get("I")??""],m=o[t.get("A")??""];if([c,l,u,d,p,f,m].some(w=>w===void 0))return null;let g=1-(1-p)*(1-f)*(1-m),h=s?7.52*(g-.029)-3.25*(g-.02)**15:6.42*g;if(h<=0)return 0;let b=8.22*c*l*u*d,y=Math.min(s?1.08*(h+b):h+b,10);return Math.ceil(y*10)/10}function VUe(e,t,n="npm"){let i=Te(t,n),r=[];for(let a of e.affected??[])for(let c of a.ranges??[])for(let l of c.events??[])l.fixed&&r.push(l.fixed);if(r.length===0)return null;let o=r.map(a=>({raw:a,parsed:Te(a,n)})).filter(a=>a.parsed!==null);return!i||o.length===0?r[0]??null:(o.filter(a=>(Qe(a.parsed,i)??-1)>0).sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0]??o.sort((a,c)=>Qe(a.parsed,c.parsed)??0)[0])?.raw??null}function BUe(e){return e.references?.find(n=>n.type==="ADVISORY"&&n.url)?.url??`https://osv.dev/vulnerability/${e.id}`}function qUe(e){let t=e.replace(/\s+/g," ").trim(),n=t.search(/\.\s|\.$/),i=n>0?t.slice(0,n+1):t;return i.length>300?`${i.slice(0,299)}\u2026`:i}var Dte=1e4,Ote=2,WUe=200;function iu(e){return typeof e=="object"&&e!==null&&"osvFailure"in e}var KUe=async(e,t)=>jte(e,t),HUe=async e=>{let t=Array.from({length:e.length},()=>({vulns:[]})),n=e.map((r,o)=>({query:r,index:o}));for(;n.length>0;){let r=await jte(FUe,{queries:n.map(a=>a.query)});if(iu(r))return r;let o=r?.results;if(!Array.isArray(o)||o.length!==n.length)return{osvFailure:"OSV returned a malformed batch response"};let s=[];for(let a=0;a!!u?.id)),l.next_page_token&&s.push({index:c.index,query:{...c.query,page_token:l.next_page_token}})}n=s}let i=await JUe(t.flatMap(r=>r.vulns));return iu(i)?i:t.map(r=>({vulns:r.vulns.map(o=>i.get(o.id)??o)}))};async function JUe(e){let t=[...new Set(e.map(r=>r.id).filter(r=>!!r))],n=await Promise.all(t.map(async r=>{let o=await ZUe(`${UUe}/${encodeURIComponent(r)}`);return iu(o)?o:[r,o]})),i=n.find(iu);return i||new Map(n)}async function jte(e,t){return zte(e,{method:"POST",body:JSON.stringify(t)})}async function ZUe(e){return zte(e,{method:"GET"})}async function zte(e,t){let n=null;for(let i=0;i<=Ote;i+=1){let r=await YUe(e,t);if(!iu(r)||!r.transient||i===Ote)return r;n=r,await eje(WUe*2**i)}return n??{osvFailure:"OSV could not be reached (network error)"}}async function YUe(e,t){let n=new AbortController,i=setTimeout(()=>n.abort(),Dte);try{let r=await fetch(e,{method:t.method,signal:n.signal,headers:{"Content-Type":"application/json","User-Agent":"drift-bot/0.1 (+https://github.com/trydrift/drift)"},...t.method==="POST"?{body:t.body}:{}});return r.ok?await r.json():{osvFailure:r.status===429?"OSV rate-limited this scan (HTTP 429). Lowering `drift.analysis.concurrency` will fetch fewer advisories at once.":`OSV answered HTTP ${r.status} ${r.statusText}`.trim(),transient:r.status===408||r.status===429||r.status>=500}}catch(r){let o=r;return{osvFailure:o?.name==="AbortError"||o?.name==="TimeoutError"?`OSV did not answer within ${Dte/1e3}s${Gte(o)}`:`OSV could not be reached (${QUe(o)})`,transient:!0}}finally{clearTimeout(i)}}function QUe(e){return`${e?.message||"network error"}${Gte(e)}`}function Gte(e){let t=e?.cause;return t==null?"":`; cause: ${XUe(t)}`}function XUe(e){if(e instanceof Error)return e.message||e.name;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function eje(e){return new Promise(t=>setTimeout(t,e))}var tje=gt(Mc(),1);function I1(e){let{name:t,registry:n,repository:i,currentVersion:r,targetVersion:o}=e,s=e.now??new Date,a=[],c=o?.withdrawn??n?.deprecated??void 0;c&&a.push({statement:`The maintainer has withdrawn ${t} ${e.to}: ${c}`,url:n?.homepage??void 0,concerning:!0,polarity:"blocks"}),i?.archived?a.push({statement:"The upstream repository is archived. It will not receive further fixes.",url:i.url,concerning:!0,polarity:"blocks"}):i?.pushedAt&&a.push({statement:`The repository was last pushed to ${T1(i.pushedAt,s)}.`,url:i.url}),r?.withdrawn&&!c&&a.push({statement:`The version currently installed, ${e.from}, has been withdrawn: ${r.withdrawn}`,concerning:!0,polarity:"favors"});let l=ije(n?.versions??[],e.ecosystem);if(l){let p=Te(e.to,e.ecosystem),f=Te(l,e.ecosystem),m=p&&f?Qe(f,p):null;m===0?a.push({statement:`${e.to} is the latest stable release.`}):m!==null&&m>0&&a.push({statement:`${e.to} is not the latest release; ${l} is also available.`})}o?.releasedAt&&a.push({statement:`The target version was released ${T1(o.releasedAt,s)}.`});let u=nje(r,o);u&&a.push(u);let d=rje(e,l);return d&&a.push(d),{facts:a,...c?{deprecated:c}:{},...i?.archived?{archived:!0}:{},...l?{latestStable:l}:{},...o?.releasedAt?{targetReleasedAt:o.releasedAt}:{}}}function nje(e,t){let n=e?.runtime,i=t?.runtime;return!i||n&&n.requirement===i.requirement?null:{statement:!n?`The target version requires ${i.name} ${i.requirement}.`:`The required ${i.name} version changed from ${n.requirement} to ${i.requirement}.`,concerning:!1,polarity:"context"}}function rje(e,t){let n=Te(e.from,e.ecosystem),i=t?Te(t,e.ecosystem):null;if(!n?.release||!i?.release||e.ecosystem==="maven"||e.ecosystem==="opam")return null;let r=(i.release[0]??0)-(n.release[0]??0);return r<1?null:{statement:`The installed version ${e.from} is ${r} major version${r===1?"":"s"} behind the latest release, ${t}. Maintainers rarely backport fixes that far.`}}function ije(e,t){return e.map(i=>Te(i,t)).filter(i=>i!==null&&!i.prerelease).sort((i,r)=>-(Qe(i,r)??0))[0]?.raw??null}function T1(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return`on ${e}`;let i=Math.floor((t.getTime()-n.getTime())/864e5);if(i<0)return`on ${n.toISOString().slice(0,10)}`;if(i===0)return"today";if(i===1)return"yesterday";if(i<60)return`${i} days ago`;let r=Math.round(i/30.44);return r<24?`about ${r} months ago`:`about ${Math.round(i/365.25)} years ago`}var oje=12;async function R1(e){let{name:t,currentVersion:n,targetVersion:i,repository:r,policy:o}=e,s=n?.license??null,a=i?.license??r?.license??null,c=o.enabled?await sje(e):[],l=p=>C1(p,o),u=c.filter(p=>!p.allowed),d=()=>`This upgrade newly introduces ${u.map(p=>`${p.name} (${p.license??"no declared license"})`).join(", ")}, which the repository policy does not permit.`;if(!a&&!s){if(!l(a)||u.length>0){let p=[];return l(a)||p.push(`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read. The repository policy requires a declared license.`),u.length>0&&p.push(d()),p.push(`The policy permits ${vx(o)}.`),{verdict:"policy-violation",statement:p.join(" "),introduced:c}}return{verdict:o.enabled?"unknown":"ok",statement:o.enabled?`Neither ${t} ${e.from} nor ${e.to} declares a license Drift could read, so this upgrade's licensing position could not be checked.`:"No license metadata was published for either version.",introduced:c}}if(s&&a&&!cje(s,a)){let p=!l(a);if(p||u.length>0){let f=[];return f.push(p?`The declared license changed from ${s} to ${a}, which the repository policy does not permit.`:`The declared license changed from ${s} to ${a}.`),u.length>0&&f.push(d()),f.push(`The policy permits ${vx(o)}.`),{verdict:"policy-violation",from:s,to:a,statement:f.join(" "),introduced:c}}return{verdict:"changed",from:s,to:a,statement:`The declared license changed from ${s} to ${a}. It remains within this repository's configured policy.`,introduced:c}}return l(a)?u.length>0?{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:`${d()} The policy permits ${vx(o)}.`,introduced:c}:a?{verdict:"ok",...s?{from:s}:{},to:a,statement:`The license is unchanged at ${a}.`,introduced:c}:{verdict:"unknown",...s?{from:s}:{},statement:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}.`,introduced:c}:{verdict:"policy-violation",...s?{from:s}:{},...a?{to:a}:{},statement:a?`${t} is licensed ${a}, which the repository policy does not permit. The policy permits ${vx(o)}.`:`${t} ${e.to} declares no license Drift could read, though ${e.from} declared ${s}. The repository policy requires a declared license.`,introduced:c}}async function sje(e){let{currentVersion:t,targetVersion:n,ecosystem:i,policy:r}=e;if(!t||!n)return[];let o=new Set(t.dependencies),s=n.dependencies.filter(c=>!o.has(c)).slice(0,oje);return s.length===0?[]:await Promise.all(s.map(async c=>{let u=(await ca(c,i,"latest").catch(()=>null))?.license??null;return{name:c,license:u,allowed:C1(u,r)}}))}function C1(e,t){if(!t.enabled)return!0;if(!e)return!t.requireDeclared;let n=aje(e);return t.deny.length>0&&n.some(i=>A1(i,t.deny))?!1:t.allow.length===0?!0:e.includes(" OR ")?n.some(i=>A1(i,t.allow)):n.every(i=>A1(i,t.allow))}function aje(e){return e.replace(/[()]/g," ").split(/\s+(?:OR|AND|WITH)\s+/i).map(t=>t.trim()).filter(Boolean)}function A1(e,t){let n=e.toLowerCase().replace(/\+$/,"");return t.some(i=>i.toLowerCase().replace(/\+$/,"")===n)}function cje(e,t){let n=i=>i.toLowerCase().replace(/[\s._]/g,"-").replace(/-+/g,"-");return n(e)===n(t)}function vx(e){return e.allow.length>0?e.allow.join(", "):e.deny.length>0?`anything except ${e.deny.join(", ")}`:"no licenses in particular"}var lje=[{category:"security",pattern:/\b(CVE-\d{4}-\d+|GHSA-[\w-]+|GO-\d{4}-\d+|security fix|vulnerabilit|XSS|CSRF|SSRF|remote code execution|prototype pollution|path traversal|SQL injection|denial of service|ReDoS)\b/i},{category:"breaking",pattern:/\b(BREAKING|breaking change|no longer|has been removed|was removed|is removed|removed entirely|removed support|dropped support|drop support|renamed to|has been renamed|is now required|must now|now (?:requires?|returns?|expects?|accepts?|takes?)|migrate to|migration guide|incompatible)\b/i},{category:"performance",pattern:/\b(faster|speed ?up|sped up|reduces? (?:the )?(?:allocation|memory|latency)|allocation|throughput|optimi[sz]|performance (?:improvement|gain|boost|work|regression)|improv(?:e|es|ed|ing) performance)\b/i},{category:"fix",pattern:/^\s*(?:fix(?:e[sd])?|bugfix|resolve[sd]?|correct(?:s|ed)?)\b/i}];function N1(e){let{dependency:t,evidence:n,breakingChanges:i,impactSites:r}=e,o=new Map;for(let u of r)o.set(u.breakingChangeId,(o.get(u.breakingChangeId)??0)+1);let s=[],a=new Set;for(let u of i){if(u.dependency!==t)continue;let d=o.get(u.id)??0,p=qte(u.summary);a.has(p)||(a.add(p),s.push({category:"breaking",text:u.summary,...d>0?{affectedSites:d}:{},...Bte(u,n)?{url:Bte(u,n)}:{},...u.citations[0]?{citation:u.citations[0]}:{}}))}let c=0,l=new Map;for(let u of n)if(u.dependency===t&&!(u.source==="semver-heuristic"||u.source==="type-surface-diff"))for(let d of Wte(u.content)){let p=qte(d);if(!p||a.has(p))continue;a.add(p);let f=O1(d);if(f==="breaking"&&s.some(g=>dje(g.text,d)))continue;let m=l.get(f)??0;if(m>=6){c++;continue}l.set(f,m+1),s.push({category:f,text:d,...u.url?{url:u.url}:{},citation:u.id})}return{changes:uje(s),unrelated:c}}function P1(e){return e.changes.filter(t=>t.category==="performance").map(t=>({statement:t.text,...t.url?{url:t.url}:{},...t.citation?{citation:t.citation}:{}}))}function D1(e,t){if(e.length===0)return null;let n=e.filter(o=>o.kind==="package-added").length,i=e.length-n,r=[];return n>0&&r.push(`${n} new package${n===1?"":"s"}`),i>0&&r.push(`${i} new exported symbol${i===1?"":"s"}`),r.length===0?null:{statement:`The target version adds ${r.join(" and ")}, none of which can break existing code. Computed from ${t}.`}}function O1(e){for(let{category:t,pattern:n}of lje)if(n.test(e))return t;return"improvement"}var Vte={breaking:0,security:1,fix:2,performance:3,improvement:4};function uje(e){return[...e].sort((t,n)=>{let i=Vte[t.category]-Vte[n.category];return i!==0?i:(n.affectedSites??0)-(t.affectedSites??0)})}function Wte(e){let t=[],n=null;for(let i of e.split(` +`)){let r=i.trim();if(!r||/^[-=]{3,}$/.test(r))continue;if(r.startsWith("#")){n=null;continue}let o=/^[-*+]\s+/.test(r)||/^\d+\.\s+/.test(r),s=r.replace(/^[-*+]\s+/,"").replace(/^\d+\.\s+/,"").trim();if(!(s.length<12)&&!/^(?:by\s+@|thanks|co-authored-by|https?:\/\/\S+$)/i.test(s)){if(!o&&/:\s*$/.test(s)&&O1(s)==="breaking"){n=s;continue}t.push(pje(n&&o?`${n} ${s}`:s,240)),!o&&!/:\s*$/.test(s)&&(n=null)}}return t}function Bte(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function dje(e,t){let n=r=>new Set(r.match(/`([^`]+)`/g)??[]),i=n(e);return i.size===0?!1:[...n(t)].some(r=>i.has(r))}function qte(e){return e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function pje(e,t){return e.length<=t?e:`${e.slice(0,t-1)}\u2026`}var Kte={critical:0,high:1,medium:2,low:3,unknown:4};function M1(e,t){return Kte[e]-Kte[t]}function L1(e){return e.reduce((t,n)=>M1(n.severity,t)<0?n.severity:t,"unknown")}var fje=new Set(["behaviour-change","signature-change","default-change","moved-export","runtime-requirement"]);function Vy(e){let t=[],{security:n,maintenance:i,license:r,impactSites:o}=e,s=o.length,a=new Set(o.map(F=>F.file)).size,c=new Map(e.breakingChanges.map(F=>[F.id,F])),l=o.filter(F=>c.get(F.breakingChangeId)?.kind!=="runtime-requirement"),u=new Set(l.map(F=>F.file)).size,d=o.filter(F=>c.get(F.breakingChangeId)?.kind==="runtime-requirement"),p=e.breakingChanges.filter(F=>F.kind==="runtime-requirement"&&F.runtime?.runtime),f=cx(e.breakingChanges,e.runtimeAnalyses??[]),m=s1(f),g=p.length>0&&a1(m??"unknown"),h=p.length>0?m??"unknown":void 0,b=Df(e.breakingChanges,o,f,e.localizationRan??!0,e.localizationComplete??!0),y=new Set(b.filter(F=>F.state==="actionable").map(F=>F.changeId)),w=e.breakingChanges.filter(F=>y.has(F.id)),k=new Set(b.flatMap(F=>F.actionableSites.map(H=>`${H.breakingChangeId}:${H.file}:${H.line}`))),$=l.filter(F=>!k.has(`${F.breakingChangeId}:${F.file}:${F.line}`)),S=w.filter(F=>fje.has(F.kind)),x=w.length-S.length,E=Of(e.breakingChanges);n.checked&&(n.resolved.length>0&&t.push(`Fixes ${n.resolved.length} known ${br(n.resolved.length,"vulnerability","vulnerabilities")} (worst: ${L1(n.resolved)}).`),n.introduced.length>0&&t.push(`Introduces ${n.introduced.length} known ${br(n.introduced.length,"vulnerability","vulnerabilities")} not present in the installed version (worst: ${L1(n.introduced)}).`),n.carried.length>0&&t.push(`${n.carried.length} known ${br(n.carried.length,"vulnerability affects","vulnerabilities affect")} both versions; this upgrade does not address ${n.carried.length===1?"it":"them"}.`),n.resolved.length===0&&n.target.length===0&&t.push("No known vulnerabilities were found for the target version."));let T=l.filter(F=>k.has(`${F.breakingChangeId}:${F.file}:${F.line}`));T.length>0&&t.push(E?`${T.length} ${br(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${br(new Set(T.map(F=>F.file)).size,"file","files")} match${T.length===1?"es":""} ${E} entries this upgrade changes.`:`${T.length} ${br(T.length,"place","places")} in ${new Set(T.map(F=>F.file)).size} ${br(new Set(T.map(F=>F.file)).size,"file","files")} use${T.length===1?"s":""} an API this upgrade changes.`),$.length>0&&t.push(`${$.length} local API match${$.length===1?"":"es"} require review; Drift did not establish a safe edit.`);for(let F of f)t.push(F.statement);if(d.length>0&&f.length===0&&t.push(...yje(d)),s>0)x>0&&t.push(`${x} of the locally affected changes can be applied mechanically.`),S.length>0&&t.push(`${S.length} locally affected ${br(S.length,"change requires","changes require")} a developer decision rather than a substitution.`);else if(e.breakingChanges.some(F=>F.kind!=="runtime-requirement")&&!g){let F=e.breakingChanges.filter(H=>H.kind!=="runtime-requirement").length;t.push(E?`${F} published ${E} ${br(F,"change","changes")} require review; these package-role contracts are assessed independently of source call signatures.`:`${F} upstream API breaking ${br(F,"change","changes")}; no usage of the changed parts was located in this repository \u2014 review before upgrading.`)}for(let F of i.facts)F.concerning&&t.push(F.statement);r.verdict==="policy-violation"&&t.push(r.statement);let A=mje(e,{affected:s,decisions:S.length,actionable:w.length>0,runtimeUnresolved:g,localizationUnresolved:b.some(F=>F.reason==="localization-incomplete"||F.reason==="impact-unresolved"),roleContractChanged:E!==null}),L=gje(e);return e.gaps.length>0&&t.push(...e.gaps),{recommendation:A,reasons:t,confidence:L.level,confidenceBasis:L.basis,...h?{runtimeCompatibility:h}:{}}}function mje(e,t){let{security:n,maintenance:i,license:r}=e;if(n.checked&&n.introduced.length>0||i.deprecated||r.verdict==="policy-violation"||i.facts.some(a=>a.polarity==="blocks"))return"do-not-upgrade-yet";if(t.affected>0)return t.actionable&&t.decisions>0?"manual-migration-required":"upgrade-after-review";if(t.runtimeUnresolved||t.localizationUnresolved||t.roleContractChanged)return"upgrade-after-review";let o=n.checked&&n.resolved.length>0,s=i.facts.some(a=>a.polarity==="favors");return e.breakingChanges.length===0&&!F1(e)?o||s?"upgrade-recommended":"insufficient-evidence":o||s?"upgrade-recommended":"safe-to-upgrade"}function F1(e){return e.surfaceCompared||(e.proseRead??0)>0||Jte(e).length>0}function Jte(e){return e.evidence.filter(t=>t.dependency===e.dependency&&t.workspace===e.workspace&&(t.source==="github-release"||t.source==="changelog"||t.source==="migration-guide"))}function gje(e){let t=Math.max(Jte(e).length,e.proseRead??0),n=[];if(e.surfaceCompared){let r=Of(e.breakingChanges);n.push(r?`the computed ${r} diff`:"the computed API diff")}return t>0&&n.push(t===1?"release notes":"release notes and changelog"),e.security.checked&&n.push("the OSV advisory database"),n.length===0?{level:"low",basis:"Nothing but the version numbers could be read for this dependency."}:{level:e.surfaceCompared||n.length>=2?"high":"medium",basis:n.length===1?`${Hte(n[0])} is the available evidence.`:`${Hte(hje(n))} agree.`}}function Of(e){let t=e.filter(n=>n.kind!=="runtime-requirement");return t.length===0?null:t.every(n=>n.symbols.some(i=>i.startsWith("pom:")))?"Maven POM contract":t.every(n=>n.symbols.some(i=>i.startsWith("nuget:")))?"NuGet package contract":t.every(n=>n.symbols.some(i=>i.startsWith("pub:")))?"Pub package contract":null}function hje(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function Hte(e){return e.charAt(0).toUpperCase()+e.slice(1)}function yje(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime ${br(o,"declaration","declarations")} in this repository ${br(o,"does not satisfy","do not satisfy")} this upgrade's runtime requirement.`)}if(i.length>0){let o=i.length;t.push(`${o} runtime ${br(o,"declaration allows","declarations allow")} versions this upgrade's runtime requirement rejects.`)}if(r.length>0){let o=r.length;t.push(`${o} runtime ${br(o,"declaration is","declarations are")} dynamically defined; Drift could not determine whether ${br(o,"it satisfies","they satisfy")} this upgrade's runtime requirement.`)}return t}function br(e,t,n){return e===1?t:n}var ou={"safe-to-upgrade":"Safe to upgrade","upgrade-recommended":"Upgrade recommended","upgrade-after-review":"Upgrade after review","manual-migration-required":"Migration required","insufficient-evidence":"Insufficient evidence","do-not-upgrade-yet":"Do not upgrade yet"};var bje={"rate-limited":"rate limited","server-error":"server error","network-error":"network error"};async function U1(e,t){return Vr("rationale.prepare",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to},async()=>{let{config:n}=t,i=e.from,r=e.to,o=h=>t.onProgress?.(h);o("Checking package metadata");let s=qn(e.name,e.ecosystem,r),a=ca(e.name,e.ecosystem,i).catch(()=>null),c=ca(e.name,e.ecosystem,r).catch(()=>null),l=n.rationale.security?(t.securityLookup??Promise.resolve(t.security).then(h=>h?.get(e)).then(h=>h??zy(e.name,e.ecosystem,i,r,t.osv??{}))).catch(h=>Uo(`Advisory lookup failed unexpectedly (${h instanceof Error?h.message:String(h)}), so this upgrade's effect on known vulnerabilities is unknown.`)):Promise.resolve(Uo("Advisory lookup is switched off for this repository (`rationale.security`), so this upgrade\u2019s effect on known vulnerabilities was not checked.")),u=await s;o("Checking repository status");let d=u?.githubRepo?await rH(u.githubRepo,t.githubToken,(h,b)=>o(`Checking repository status (${bje[b]}, retrying \u2014 attempt ${h})`)).catch(()=>null):null;o("Checking security advisories");let[p,f,m]=await Promise.all([a,c,l]);o("Checking license");let g=await R1({name:e.name,ecosystem:e.ecosystem,from:i,to:r,currentVersion:p,targetVersion:f,repository:d,policy:n.licenses});return{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}})}async function wx(e,t){let n=e.changes.filter(s=>s.from&&s.to),i=n.filter(s=>!t.preparedFacts?.has(s)),r=i.map(s=>({name:s.name,ecosystem:s.ecosystem,from:s.from,to:s.to})),o=t.config.rationale.security?Gy(r,t.osv??{}).then(s=>new Map(i.map((a,c)=>[a,s.get(r[c])]))):void 0;return Bn(n,4,async s=>{try{return await vje(s,e,{...t,security:o})}catch(a){return t.logger.debug(`Rationale failed for ${s.name}: ${a.message}`),xje(s,`Drift could not assemble an upgrade rationale for ${s.name}.`)}})}async function vje(e,t,n){let i=s=>n.onProgress?.(e,s),r=n.preparedFacts?.get(e),o=await(r??U1(e,{config:n.config,...n.githubToken?{githubToken:n.githubToken}:{},...n.osv?{osv:n.osv}:{},...n.security?{security:n.security}:{},onProgress:i}));return wje(e,t,o,n,{shared:r!==void 0})}async function wje(e,t,n,i,r){return Vr("rationale.finalize",{package:e.name,ecosystem:e.ecosystem,from:e.from,to:e.to,shared:r?.shared??i.preparedFacts?.has(e)??!1},async()=>{let{config:o,logger:s}=i,a=e.from,c=e.to,l=D=>i.onProgress?.(e,D),{registry:u,repository:d,currentVersion:p,targetVersion:f,security:m,license:g}=n,h=t.breakingChanges.filter(D=>D.dependency===e.name&&D.workspace===e.workspace),b=new Set(h.map(D=>D.id)),y=t.impactSites.filter(D=>b.has(D.breakingChangeId)),w=(t.runtimeAnalyses??[]).filter(D=>b.has(D.changeId));l("Checking maintenance signals");let k=o.rationale.maintenance?I1({name:e.name,ecosystem:e.ecosystem,from:a,to:c,registry:u,repository:d,currentVersion:p,targetVersion:f,repoRuntime:(e.workspace!==void 0?i.repoRuntimeByWorkspace?.get(e.workspace):void 0)??i.repoRuntime,pythonRuntime:(e.workspace!==void 0?i.pythonRuntimeByWorkspace?.get(e.workspace):void 0)??i.pythonRuntime,analyzedRuntimeRequirements:w.map(D=>({runtime:D.runtime,requirement:D.requirement}))}):{facts:[]},$=an(e),S=i.additions?.get($),x=i.surfaceCompared?.has($)??S!==void 0,E=o.rationale.summary?N1({dependency:e.name,evidence:t.evidence,breakingChanges:h,impactSites:y,additions:S?.additions}):{changes:[],unrelated:0},T=[...P1(E)],A=S?D1(S.additions,S.locator):null;A&&T.push(A);let L=i.prose?.get($)??i.prose?.get(e.name)??[],F=kje(e,{surfaceCompared:x,surfaceGap:i.surfaceGaps?.get($),security:m,registry:u,evidence:t.evidence,prose:L,licenseUnknown:g.verdict==="unknown"}),H={dependency:e.name,workspace:e.workspace,breakingChanges:h,impactSites:y,evidence:t.evidence,security:m,maintenance:k,license:g,gaps:F,surfaceCompared:x,proseRead:L.length,runtimeAnalyses:w,localizationRan:t.localizationRan,localizationComplete:t.localizationComplete},te=Vy(H);return s.debug(`${e.name} ${a} \u2192 ${c}: ${te.recommendation}`),{dependency:e.name,from:a,to:c,security:m,maintenance:k,improvements:T,license:g,summary:E,assessment:te,runtimeAnalyses:w.map(({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})=>({changeId:D,runtime:X,requirement:re,state:ie,reason:ke,statement:We})),gaps:F,hasCompatibilityEvidence:F1(H)}})}function kje(e,t){let n=[],i=t.evidence.filter(s=>s.dependency===e.name&&s.workspace===e.workspace&&(s.source==="github-release"||s.source==="changelog"||s.source==="migration-guide")),r=t.surfaceGap,o=i.length>0?null:t.prose.length>0?t.surfaceCompared?null:`Drift read ${$je(t.prose)} for ${e.name} ${e.to} and found nothing in ${t.prose.length===1?"it":"them"} that announces a breaking change. That is weaker than a clean API comparison: it means nothing was flagged, not that nothing broke.`:`No release notes, changelog, or migration guide was reachable for ${e.name} ${e.to}${t.registry?.githubRepo?"":", and no source repository could be resolved for it"}.`;return r&&o?n.push(`${Yte(r.detail)}. ${o}${r.remedy?` ${r.remedy}`:""}`):r?n.push(`${Yte(r.detail)}.${r.remedy?` ${r.remedy}`:""}`):o&&n.push(o),t.security.checked||n.push(t.security.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."),Sje(n)}var _je={"github-release":{one:"the release notes",many:"sets of release notes"},changelog:{one:"the changelog",many:"changelog files"},"migration-guide":{one:"the migration guide",many:"migration guides"}};function $je(e){let t=i=>e.filter(r=>r.kind===i),n=[];for(let i of["github-release","changelog","migration-guide"]){let r=t(i);if(r.length===0)continue;let o=_je[i];if(r.length===1){n.push(`${o.one} (${Zte(r[0])})`);continue}n.push(`${r.length} ${o.many} (${r.map(Zte).join(", ")})`)}return n.length===0?"the published release prose":n.length===1?n[0]:`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`}function Zte(e){return`[${e.label}](${e.url})`}function Sje(e){let t=new Set,n=[];for(let i of e){let r=i.toLowerCase().replace(/[^a-z0-9]+/g," ").trim();t.has(r)||(t.add(r),n.push(i))}return n}function Yte(e){return e.replace(/\.\s*$/,"")}function xje(e,t){return{dependency:e.name,from:e.from??"",to:e.to??"",security:{checked:!1,current:[],target:[],resolved:[],introduced:[],carried:[],direction:"unknown"},maintenance:{facts:[]},improvements:[],license:{verdict:"unknown",statement:"Not checked.",introduced:[]},summary:{changes:[],unrelated:0},hasCompatibilityEvidence:!1,assessment:{recommendation:"insufficient-evidence",reasons:[t],confidence:"low",confidenceBasis:t},gaps:[t]}}var ene=require("node:crypto"),Ci=require("node:fs/promises"),_x=require("node:os"),su=require("node:path"),tne=require("node:url"),nne=require("node:child_process");var Mje={},rne="behavioural-diff-npm-ts-v1",Eje=new Set(["behaviour-change","default-change","type-change","signature-change","required-field-added"]);function Tje(e,t){let n=t.verification.behavioural;if(!n.enabled)return[];let i=[];for(let r of e.breakingChanges){if(!Eje.has(r.kind))continue;let o=e.impactSites.filter(a=>a.breakingChangeId===r.id);if(o.length===0)continue;let s=Dr(r);if(!(!s.nature.includes("behaviour")&&s.nature!=="type-contract"&&r.kind!=="default-change"))for(let a of r.symbols.slice(0,n.maxSymbols-i.length)){let c=Rje(r),l=[{id:"default",args:[],contracts:c}],u=new Set;for(let d of o){if(l.length>=n.maxCasesPerSymbol)break;if(d.matchedSymbol!==a)continue;let p=Ije(d.excerpt,a);if(!p)continue;let f=JSON.stringify(p);u.has(f)||(u.add(f),l.push({id:`site-${l.length}`,args:p,contracts:c}))}if(i.push({dependency:r.dependency,workspace:r.workspace,symbol:a,modulePath:"",exportName:a,cases:l}),i.length>=n.maxSymbols)return i}}return i}function Ije(e,t){let i=new RegExp(`\\b${Aje(t)}\\s*\\(([^;]*)\\)`).exec(e);if(!i)return null;let r=i[1].trim();if(r==="")return[];let o=`[${r}]`.replace(/'/g,'"').replace(/([{,]\s*)([A-Za-z_$][\w$]*)\s*:/g,'$1"$2":');try{let s=JSON.parse(o);return Array.isArray(s)?s:null}catch{return null}}function Aje(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rje(e){switch(e.kind){case"default-change":return["configured-defaults","return-shape"];case"type-change":case"signature-change":case"required-field-added":return["return-shape","thrown-error","argument-mutation","promise-state"];case"behaviour-change":return["return-shape","thrown-error","argument-mutation","promise-state","serialization-output"];default:return["return-shape"]}}async function Cje(e){let{config:t,oldEnvironment:n,newEnvironment:i}=e,r=e.probes.slice(0,t.maxSymbols),o=[],s=[];if(!t.enabled)return{evidence:[],observations:[],gaps:["behavioural probing disabled"]};if(t.sandbox!=="required")return{evidence:[],observations:[],gaps:["behavioural probing requires a sandbox"]};for(let a of r){let c=a.cases.slice(0,t.maxCasesPerSymbol);for(let l of c){let u=await kx(t,n,a,l),d=await kx(t,n,a,l),p=await kx(t,i,a,l),f=await kx(t,i,a,l),m=!j1(u,d)||!j1(p,f);o.push({dependency:a.dependency,workspace:a.workspace,symbol:a.symbol,caseId:l.id,generatedInput:l.args,oldResult:u,newResult:p,observedDifference:m?"nondeterministic result; no compatibility conclusion drawn":Pje(u,p),nondeterministic:m,limitations:Dje(t,l.contracts)})}}return{observations:o,gaps:s,evidence:o.map(ine)}}async function Nje(){return typeof __dirname<"u"?(0,su.join)(__dirname,"behavioural-worker.js"):(0,tne.fileURLToPath)(new URL("./behavioural-worker.js",Mje.url))}async function kx(e,t,n,i){let r=await(0,Ci.mkdtemp)((0,su.join)((0,_x.tmpdir)(),"drift-behavioural-")),o=await(0,Ci.realpath)(r),s=(0,su.join)(r,"case.json"),a=await(0,Ci.realpath)(await Nje()),c=(0,su.resolve)(t.modulePath||n.modulePath),l=await(0,Ci.realpath)(c),u=(0,su.resolve)(t.packageRoot);await(0,Ci.writeFile)(s,JSON.stringify({modulePath:l,exportName:n.exportName,args:i.args,network:e.network}));let d=[a,u,await(0,Ci.realpath)(u),c,l,s,await(0,Ci.realpath)(s)],p=[Number(process.versions.node.split(".")[0])>=24?"--permission":"--experimental-permission",...[...new Set(d)].map(f=>`--allow-fs-read=${f}`),`--max-old-space-size=${e.memoryMb}`,a,s];try{return await new Promise(f=>{let m=(0,nne.spawn)(process.execPath,p,{stdio:["ignore","pipe","pipe"],env:{PATH:process.env.PATH??"",HOME:o,TMPDIR:o,DRIFT_BEHAVIOURAL_SANDBOX:"1"}});if(m.pid&&e.cpuLimit<1)try{(0,_x.setPriority)(m.pid,Math.round(10*(1-e.cpuLimit)))}catch{}let g="",h="",b=64*1024,y=setTimeout(()=>{m.kill("SIGKILL")},e.timeoutSeconds*1e3);m.stdout.on("data",w=>{g=(g+w.toString("utf8")).slice(-b)}),m.stderr.on("data",w=>{h=(h+w.toString("utf8")).slice(-b)}),m.on("close",(w,k)=>{if(clearTimeout(y),k){f({status:"timed-out",signal:k,stdoutDigest:By(g),stderrDigest:By(h)});return}let $=g.trim().split(` +`).at(-1)??"",S=Oje($);f(S??{status:"worker-failed",stdoutDigest:By(g),stderrDigest:By(h)})}),m.on("error",w=>{clearTimeout(y),f({status:"worker-failed",error:{name:w.name,messageCategory:"spawn"}})})})}finally{e.retainArtifacts||await(0,Ci.rm)(r,{recursive:!0,force:!0}).catch(()=>{})}}function j1(e,t){return JSON.stringify(Qte(e))===JSON.stringify(Qte(t))}function Qte(e){return{status:e.status,value:e.value??null,error:e.error??null,mutations:e.mutations??[]}}var Xte=new Set(["worker-failed","timed-out"]);function Pje(e,t){return Xte.has(e.status)&&Xte.has(t.status)?`probe unavailable: neither version could be observed (${e.status})`:j1(e,t)?"no observed difference for this contract and generated input domain":e.status!==t.status?`status changed from ${e.status} to ${t.status}`:JSON.stringify(e.value??null)!==JSON.stringify(t.value??null)?"returned value changed":JSON.stringify(e.error??null)!==JSON.stringify(t.error??null)?"thrown error changed":JSON.stringify(e.mutations??[])!==JSON.stringify(t.mutations??[])?"argument mutation changed":"observable result changed"}function Dje(e,t){let n=[`Harness ${rne}; bounded to ${t.join(", ")||"return-shape"} contracts.`,"No observed difference is not proof of behavioural compatibility outside these generated inputs.",`CPU limit requested: ${e.cpuLimit} (best-effort process priority; no OS-level quota). Node subprocess enforces wall-clock, memory, output, filesystem, and network policy, and cannot spawn its own children or threads \u2014 the wall-clock timeout is the actual hard bound on CPU consumption.`];return e.network||n.push("Network APIs were disabled for the probe."),n}function ine(e){let t=JSON.stringify({generatedInput:e.generatedInput,normalizedOldResult:e.oldResult,normalizedNewResult:e.newResult,observedDifference:e.observedDifference,testHarnessVersion:rne,nondeterminismHandling:e.nondeterministic?"Repeated runs disagreed, so Drift records the observation but draws no compatibility conclusion.":"Old and new observations were repeated once and matched within each version.",limitations:e.limitations},null,2);return{id:`ev_behaviour_${By(`${e.workspace??""}:${e.dependency}:${e.symbol}:${e.caseId}`).slice(0,12)}`,source:"behavioural-diff",dependency:e.dependency,...e.workspace!==void 0?{workspace:e.workspace}:{},locator:`${e.symbol}:${e.caseId}`,title:`Behavioural differential probe for ${e.symbol}`,content:t,weight:e.observedDifference.startsWith("probe unavailable")?0:e.observedDifference.startsWith("no observed difference")?.25:.8,findings:[{code:"behavioural-observation",symbol:e.symbol,detail:e.observedDifference}]}}async function one(e){let t=e.config.verification.behavioural,n=[],i=new Map,r=[];if(!t.enabled)return{evidence:n,citationsByChangeId:i,gaps:r};let o=Tje({breakingChanges:e.breakingChanges,impactSites:e.impactSites},e.config);if(o.length===0)return{evidence:n,citationsByChangeId:i,gaps:r};let s=new Map;for(let a of o){let c=Vc({name:a.dependency,workspace:a.workspace}),l=s.get(c);l?l.probes.push(a):s.set(c,{dependency:a.dependency,workspace:a.workspace,probes:[a]})}for(let{dependency:a,workspace:c,probes:l}of s.values()){let u=e.dependencyChanges.find(f=>f.name===a&&f.workspace===c&&f.ecosystem==="npm");if(!u?.from||!u.to){r.push(`${a}: behavioural probing needs both a resolved old and new version; skipped.`);continue}let d=await e.resolveEnvironments(u);if(!d){r.push(`${a}: could not resolve ${u.from} and ${u.to} to executable code for behavioural probing; skipped.`);continue}let p=await Cje({config:t,probes:l,oldEnvironment:d.oldEnvironment,newEnvironment:d.newEnvironment});r.push(...p.gaps);for(let f of p.observations){let m=ine(f);n.push(m);for(let g of e.breakingChanges){if(g.dependency!==a||g.workspace!==c||!g.symbols.includes(f.symbol))continue;let h=i.get(g.id);h?h.push(m.id):i.set(g.id,[m.id])}}}return{evidence:n,citationsByChangeId:i,gaps:r}}function sne(e){return e.startsWith("probe unavailable")?"probe-unavailable":e.startsWith("no observed difference")?"no-difference":e.includes("returned value changed")?"return-value":e.startsWith("status changed")?"thrown-error":e.includes("argument mutation")?"argument-mutation":"behaviour"}function Oje(e){try{return JSON.parse(e)}catch{return null}}function By(e){return(0,ene.createHash)("sha256").update(e).digest("hex")}var oo=require("node:fs/promises"),cne=require("node:os"),au=require("node:path");function Lje(e){return Fje(e.exports)??e.module??e.main??"index.js"}function Fje(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e,n="."in t?t["."]:t,i=(r,o)=>{if(o>6||r==null)return null;if(typeof r=="string")return r;if(typeof r!="object")return null;let s=r;for(let a of["import","require","default","node"]){if(!(a in s))continue;let c=i(s[a],o+1);if(c)return c}return null};return i(n,0)}var ane="https://cdn.jsdelivr.net/npm";async function z1(e,t,n){let i=await _e(`${ane}/${t}@${n}/package.json`);if(!i)return null;let r=Lje(i).replace(/^\.\//,""),o=await rt(`${ane}/${t}@${n}/${r}`);if(o===null)return null;let s=await(0,oo.mkdtemp)((0,au.join)((0,cne.tmpdir)(),"drift-behavioural-env-")),a=(0,au.join)(s,r);return await(0,oo.mkdir)((0,au.dirname)(a),{recursive:!0}),await(0,oo.writeFile)(a,o),await(0,oo.writeFile)((0,au.join)(s,"package.json"),JSON.stringify(i)),{label:e,packageRoot:await(0,oo.realpath)(s),modulePath:await(0,oo.realpath)(a)}}var Dx=require("node:path");function G1(){return{probes:new Map}}function Uje(e,t,n,i){let r=jje(t,n),o=i?.probes.get(r);if(o)return o;let s=e(t,["--version"],{timeoutMs:2e4,...n?{env:n}:{}}).then(a=>a.failure!=="not-found").catch(()=>!0);return i?.probes.set(r,s),s}async function lne(e,t,n,i){let r=[...new Set(t)],o=await Promise.all(r.map(s=>Uje(e,s,n,i)));return new Map(r.map((s,a)=>[s,o[a]]))}function jje(e,t){let n=t??process.env,i=n.PATH??n.Path??n.path??"",r=n.PATHEXT??n.PathExt??"";return JSON.stringify([e,i,r,process.platform])}var $x=require("node:os");function Sx(){try{return Math.max(1,(0,$x.availableParallelism)())}catch{return 4}}function zje(){try{return Math.max(2,Math.floor((0,$x.totalmem)()/(512*1024*1024)))}catch{return 8}}function V1(e,t,n){return Math.max(t,Math.min(n,Math.floor(e)))}function B1(e,t){let n=t[e];if(!n)return;let i=Number(n);return Number.isFinite(i)&&i>=1?Math.floor(i):void 0}function xx(e=process.env){return B1("DRIFT_NETWORK_CONCURRENCY",e)??V1(Sx()*4,8,32)}function q1(e=process.env){return B1("DRIFT_CONCURRENCY",e)??V1(Math.min(Sx()*2,zje()),4,16)}function Ex(e=process.env){return B1("DRIFT_LOCAL_CONCURRENCY",e)??V1(Sx()/4,2,6)}function une(e=process.env){return`${Sx()} cores \xB7 ${xx(e)} network, ${q1(e)} analysis, ${Ex(e)} local`}var W1=require("node:crypto");var Gje=1,Tvt=10080*60*1e3;function dne(e){let t=(0,W1.createHash)("sha256");t.update(`v${Gje} `),t.update(`${e.head} `),t.update(`${e.dir} `),t.update(`${e.packageManager} `),t.update(`${[...e.kinds].sort().join(",")} `),t.update(`${e.runtime} `);for(let n of[...e.files].sort((i,r)=>i.path.localeCompare(r.path)))t.update(`${n.path} -`),t.update((0,F1.createHash)("sha256").update(n.content).digest("hex")),t.update(` -`);return t.digest("hex")}var Mje={async read(){return null},async write(){}};function U1(){return Mje}var _x=require("node:path");var sne=["typecheck","test","build"],Lje={typecheck:["typecheck","type-check","types","check-types","tsc","check"],test:["test","tests","test:unit"],build:["build","compile"]};function kx(e,t){let n=Fje(e,t);return sne.flatMap(i=>n.filter(r=>r.kind===i))}function Fje(e,t){switch(e){case"npm":case"pnpm":case"yarn":case"yarn-berry":case"bun":return jje(e,t);case"cargo":return[Oe("typecheck",{command:"cargo",args:["check"]},"the Cargo toolchain"),Oe("test",{command:"cargo",args:["test"]},"the Cargo toolchain"),Oe("build",{command:"cargo",args:["build"]},"the Cargo toolchain",!0)];case"go":return[Oe("typecheck",{command:"go",args:["vet","./..."]},"the Go toolchain"),Oe("test",{command:"go",args:["test","./..."]},"the Go toolchain"),Oe("build",{command:"go",args:["build","./..."]},"the Go toolchain",!0)];case"poetry":case"uv":case"pip":return Vje(e,t);case"bundler":return Bje(t);case"maven":return[Oe("typecheck",{command:"mvn",args:["-q","test-compile"]},"Maven"),Oe("test",{command:"mvn",args:["-q","test"]},"Maven"),Oe("build",{command:"mvn",args:["-q","package","-DskipTests"]},"Maven",!0)];case"gradle":return[Oe("typecheck",{command:"gradle",args:["compileTestJava"]},"Gradle"),Oe("test",{command:"gradle",args:["test"]},"Gradle"),Oe("build",{command:"gradle",args:["build","-x","test"]},"Gradle",!0)];case"sbt":return[Oe("typecheck",{command:"sbt",args:["Test/compile"]},"sbt"),Oe("test",{command:"sbt",args:["test"]},"sbt"),Oe("build",{command:"sbt",args:["package"]},"sbt",!0)];case"dotnet":return[Oe("typecheck",{command:"dotnet",args:["build","--nologo"]},"the .NET SDK"),Oe("test",{command:"dotnet",args:["test","--nologo"]},"the .NET SDK"),Oe("build",{command:"dotnet",args:["publish","--nologo"]},"the .NET SDK",!0)];case"composer":return Uje(t);case"mix":return[Oe("typecheck",{command:"mix",args:["compile","--warnings-as-errors"]},"Mix"),Oe("test",{command:"mix",args:["test"]},"Mix"),Oe("build",{command:"mix",args:["compile"]},"Mix",!0)];case"rebar":return[Oe("typecheck",{command:"rebar3",args:["compile"]},"Rebar3"),Oe("test",{command:"rebar3",args:["eunit"]},"Rebar3")];case"dart":return[Oe("typecheck",{command:"dart",args:["analyze"]},"the Dart SDK"),Oe("test",{command:"dart",args:["test"]},"the Dart SDK")];case"flutter":return[Oe("typecheck",{command:"flutter",args:["analyze"]},"the Flutter SDK"),Oe("test",{command:"flutter",args:["test"]},"the Flutter SDK")];case"swiftpm":return[Oe("typecheck",{command:"swift",args:["build"]},"the Swift toolchain"),Oe("test",{command:"swift",args:["test"]},"the Swift toolchain")];case"cocoapods":return[];case"opam":return[Oe("typecheck",{command:"dune",args:["build","@check"]},"dune"),Oe("test",{command:"dune",args:["runtest"]},"dune"),Oe("build",{command:"dune",args:["build"]},"dune",!0)];case"conan":case"vcpkg":return[Oe("build",e==="conan"?{command:"conan",args:["build","."]}:{command:"cmake",args:["--build","build"]},e==="conan"?"Conan":"CMake",!0)];case"arduino-cli":return[Oe("build",{command:"arduino-cli",args:["compile","--warnings","all"]},"Arduino CLI",!0)];case"platformio":return[Oe("build",{command:"pio",args:["run"]},"PlatformIO",!0),Oe("test",{command:"pio",args:["test"]},"PlatformIO")]}}function Uje(e){let t=Gt(e??""),n=[];if(t?.scripts&&"test"in t.scripts)return n.push(Oe("test",{command:"composer",args:["run","test"]},"`scripts.test` in composer.json")),n;let i=t?.["require-dev"]??{};return"phpunit/phpunit"in i?n.push(Oe("test",{command:"vendor/bin/phpunit",args:[]},"phpunit, declared in composer.json",!1,wx("composer"))):"pestphp/pest"in i&&n.push(Oe("test",{command:"vendor/bin/pest",args:[]},"pest, declared in composer.json",!1,wx("composer"))),"phpstan/phpstan"in i?n.push(Oe("typecheck",{command:"vendor/bin/phpstan",args:["analyse"]},"phpstan, declared in composer.json",!0,wx("composer"))):"vimeo/psalm"in i&&n.push(Oe("typecheck",{command:"vendor/bin/psalm",args:[]},"psalm, declared in composer.json",!0,wx("composer"))),n}function jje(e,t){let n=Gt(t??"")?.scripts;if(!n)return[];let i=e==="yarn"||e==="yarn-berry"?"yarn":e,r=[];for(let o of sne){let s=Lje[o].find(c=>typeof n[c]=="string");if(!s)continue;let a=s==="test"&&e!=="yarn"&&e!=="yarn-berry"?["test"]:i==="yarn"?[s]:["run",s];r.push(Oe(o,{command:i,args:a},`\`scripts.${s}\` in package.json`,o!=="test"&&Gje(n[s])))}return r}var zje=new Set(["tsc","vue-tsc","svelte-check"]);function Gje(e){return e.split(/&&|\|\||;/).some(t=>{let n=t.trim().split(/\s+/).filter(Boolean),i=0;for(;n[i]&&/^[\w.]+=/.test(n[i]);)i+=1;return n[i]==="npx"&&(i+=1),n[i]!==void 0&&zje.has(n[i])})}function Vje(e,t){let n=t??"",i=pi(n),r=l=>i.some(u=>u.header===l||u.header.startsWith(`${l}.`)),o=l=>new RegExp(`["']${l}\\b`,"i").test(n),s=e==="poetry"?["poetry","run"]:e==="uv"?["uv","run"]:null,a=(l,u)=>s?{command:s[0],args:[...s.slice(1),l,...u]}:{command:l,args:u},c=[];return r("tool.mypy")||o("mypy")?c.push(Oe("typecheck",a("mypy",["."]),"mypy, declared in pyproject.toml")):(r("tool.pyright")||o("pyright"))&&c.push(Oe("typecheck",a("pyright",[]),"pyright, declared in pyproject.toml")),(r("tool.pytest")||r("tool.pytest.ini_options")||o("pytest"))&&c.push(Oe("test",a("pytest",[]),"pytest, declared in pyproject.toml")),c}function Bje(e){let t=e??"",n=[];return/gem\s+["']rspec/.test(t)?n.push(Oe("test",{command:"bundle",args:["exec","rspec"]},"rspec, declared in the Gemfile")):/gem\s+["'](minitest|rake)/.test(t)&&n.push(Oe("test",{command:"bundle",args:["exec","rake","test"]},"rake, declared in the Gemfile")),n}function Oe(e,t,n,i=e==="typecheck",r={kind:"host",command:t.command}){return{kind:e,label:[t.command,...t.args].join(" "),command:t,source:n,commandOrigin:r,compileCapable:i}}function wx(...e){return{kind:"post-install",requiredHostCommands:e}}var qje=40,Wje=10*6e4;async function Sx(e,t="",n=Hn(),i){let r=t?(0,_x.join)(e,t):e,o=await n.readDirectory(r);if(o.length===0)return[];let s=da({entries:o}),a=i?s.find(u=>u.manager.id===i):void 0,c=a?[a,...s.filter(u=>u.manager.ecosystem!==a.manager.ecosystem)]:s,l=[];for(let{manager:u}of c){let d=u.manifests.find(f=>o.includes(f)),p=d?await n.readFile((0,_x.join)(r,d)):null;for(let f of kx(u.id,p))l.some(m=>m.label===f.label)||l.push(f)}return l}async function xx(e){let t=e.dir?(0,_x.join)(e.root,e.dir):e.root,n=e.exec??Xe,i=e.env??process.env,r=[],o=e.checks.length,s=!1;for(let[a,c]of e.checks.entries()){if(s){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:0,output:"",reason:"An earlier check already failed, so this one was not run."}));continue}if(e.token?.isCancellationRequested){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"cancelled",durationMs:0,output:"",reason:"Cancelled before this check ran."}));continue}e.onProgress?.(c,a,o);let l=Date.now(),u=await n(c.command.command,c.command.args,{cwd:t,env:i,timeoutMs:e.timeoutMs??Wje,...e.signal?{signal:e.signal}:{},...e.onOutput?{onOutput:p=>e.onOutput(c,p)}:{}}),d=Date.now()-l;if(u.failure==="not-found"){r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:d,output:"",reason:e.notFoundReason?.(c.command.command)??`\`${c.command.command}\` was not found on PATH, so this check could not run.`}));continue}u.code!==0&&e.stopOnFirstFailure&&(s=!0),r.push($x(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:u.code===0?"passed":"failed",durationMs:d,output:Hje(`${u.stdout} +`),t.update((0,W1.createHash)("sha256").update(n.content).digest("hex")),t.update(` +`);return t.digest("hex")}var Vje={async read(){return null},async write(){}};function K1(){return Vje}var Rx=require("node:path");var pne=["typecheck","test","build"],Bje={typecheck:["typecheck","type-check","types","check-types","tsc","check"],test:["test","tests","test:unit"],build:["build","compile"]};function Ix(e,t){let n=qje(e,t);return pne.flatMap(i=>n.filter(r=>r.kind===i))}function qje(e,t){switch(e){case"npm":case"pnpm":case"yarn":case"yarn-berry":case"bun":return Kje(e,t);case"cargo":return[De("typecheck",{command:"cargo",args:["check"]},"the Cargo toolchain"),De("test",{command:"cargo",args:["test"]},"the Cargo toolchain"),De("build",{command:"cargo",args:["build"]},"the Cargo toolchain",!0)];case"go":return[De("typecheck",{command:"go",args:["vet","./..."]},"the Go toolchain"),De("test",{command:"go",args:["test","./..."]},"the Go toolchain"),De("build",{command:"go",args:["build","./..."]},"the Go toolchain",!0)];case"poetry":case"uv":case"pip":return Zje(e,t);case"bundler":return Yje(t);case"maven":return[De("typecheck",{command:"mvn",args:["-q","test-compile"]},"Maven"),De("test",{command:"mvn",args:["-q","test"]},"Maven"),De("build",{command:"mvn",args:["-q","package","-DskipTests"]},"Maven",!0)];case"gradle":return[De("typecheck",{command:"gradle",args:["compileTestJava"]},"Gradle"),De("test",{command:"gradle",args:["test"]},"Gradle"),De("build",{command:"gradle",args:["build","-x","test"]},"Gradle",!0)];case"sbt":return[De("typecheck",{command:"sbt",args:["Test/compile"]},"sbt"),De("test",{command:"sbt",args:["test"]},"sbt"),De("build",{command:"sbt",args:["package"]},"sbt",!0)];case"dotnet":return[De("typecheck",{command:"dotnet",args:["build","--nologo"]},"the .NET SDK"),De("test",{command:"dotnet",args:["test","--nologo"]},"the .NET SDK"),De("build",{command:"dotnet",args:["publish","--nologo"]},"the .NET SDK",!0)];case"composer":return Wje(t);case"mix":return[De("typecheck",{command:"mix",args:["compile","--warnings-as-errors"]},"Mix"),De("test",{command:"mix",args:["test"]},"Mix"),De("build",{command:"mix",args:["compile"]},"Mix",!0)];case"rebar":return[De("typecheck",{command:"rebar3",args:["compile"]},"Rebar3"),De("test",{command:"rebar3",args:["eunit"]},"Rebar3")];case"dart":return[De("typecheck",{command:"dart",args:["analyze"]},"the Dart SDK"),De("test",{command:"dart",args:["test"]},"the Dart SDK")];case"flutter":return[De("typecheck",{command:"flutter",args:["analyze"]},"the Flutter SDK"),De("test",{command:"flutter",args:["test"]},"the Flutter SDK")];case"swiftpm":return[De("typecheck",{command:"swift",args:["build"]},"the Swift toolchain"),De("test",{command:"swift",args:["test"]},"the Swift toolchain")];case"cocoapods":return[];case"opam":return[De("typecheck",{command:"dune",args:["build","@check"]},"dune"),De("test",{command:"dune",args:["runtest"]},"dune"),De("build",{command:"dune",args:["build"]},"dune",!0)];case"conan":case"vcpkg":return[De("build",e==="conan"?{command:"conan",args:["build","."]}:{command:"cmake",args:["--build","build"]},e==="conan"?"Conan":"CMake",!0)];case"arduino-cli":return[De("build",{command:"arduino-cli",args:["compile","--warnings","all"]},"Arduino CLI",!0)];case"platformio":return[De("build",{command:"pio",args:["run"]},"PlatformIO",!0),De("test",{command:"pio",args:["test"]},"PlatformIO")]}}function Wje(e){let t=Gt(e??""),n=[];if(t?.scripts&&"test"in t.scripts)return n.push(De("test",{command:"composer",args:["run","test"]},"`scripts.test` in composer.json")),n;let i=t?.["require-dev"]??{};return"phpunit/phpunit"in i?n.push(De("test",{command:"vendor/bin/phpunit",args:[]},"phpunit, declared in composer.json",!1,Tx("composer"))):"pestphp/pest"in i&&n.push(De("test",{command:"vendor/bin/pest",args:[]},"pest, declared in composer.json",!1,Tx("composer"))),"phpstan/phpstan"in i?n.push(De("typecheck",{command:"vendor/bin/phpstan",args:["analyse"]},"phpstan, declared in composer.json",!0,Tx("composer"))):"vimeo/psalm"in i&&n.push(De("typecheck",{command:"vendor/bin/psalm",args:[]},"psalm, declared in composer.json",!0,Tx("composer"))),n}function Kje(e,t){let n=Gt(t??"")?.scripts;if(!n)return[];let i=e==="yarn"||e==="yarn-berry"?"yarn":e,r=[];for(let o of pne){let s=Bje[o].find(c=>typeof n[c]=="string");if(!s)continue;let a=s==="test"&&e!=="yarn"&&e!=="yarn-berry"?["test"]:i==="yarn"?[s]:["run",s];r.push(De(o,{command:i,args:a},`\`scripts.${s}\` in package.json`,o!=="test"&&Jje(n[s])))}return r}var Hje=new Set(["tsc","vue-tsc","svelte-check"]);function Jje(e){return e.split(/&&|\|\||;/).some(t=>{let n=t.trim().split(/\s+/).filter(Boolean),i=0;for(;n[i]&&/^[\w.]+=/.test(n[i]);)i+=1;return n[i]==="npx"&&(i+=1),n[i]!==void 0&&Hje.has(n[i])})}function Zje(e,t){let n=t??"",i=pi(n),r=l=>i.some(u=>u.header===l||u.header.startsWith(`${l}.`)),o=l=>new RegExp(`["']${l}\\b`,"i").test(n),s=e==="poetry"?["poetry","run"]:e==="uv"?["uv","run"]:null,a=(l,u)=>s?{command:s[0],args:[...s.slice(1),l,...u]}:{command:l,args:u},c=[];return r("tool.mypy")||o("mypy")?c.push(De("typecheck",a("mypy",["."]),"mypy, declared in pyproject.toml")):(r("tool.pyright")||o("pyright"))&&c.push(De("typecheck",a("pyright",[]),"pyright, declared in pyproject.toml")),(r("tool.pytest")||r("tool.pytest.ini_options")||o("pytest"))&&c.push(De("test",a("pytest",[]),"pytest, declared in pyproject.toml")),c}function Yje(e){let t=e??"",n=[];return/gem\s+["']rspec/.test(t)?n.push(De("test",{command:"bundle",args:["exec","rspec"]},"rspec, declared in the Gemfile")):/gem\s+["'](minitest|rake)/.test(t)&&n.push(De("test",{command:"bundle",args:["exec","rake","test"]},"rake, declared in the Gemfile")),n}function De(e,t,n,i=e==="typecheck",r={kind:"host",command:t.command}){return{kind:e,label:[t.command,...t.args].join(" "),command:t,source:n,commandOrigin:r,compileCapable:i}}function Tx(...e){return{kind:"post-install",requiredHostCommands:e}}var Qje=40,Xje=10*6e4;async function Cx(e,t="",n=Wn(),i){let r=t?(0,Rx.join)(e,t):e,o=await n.readDirectory(r);if(o.length===0)return[];let s=da({entries:o}),a=i?s.find(u=>u.manager.id===i):void 0,c=a?[a,...s.filter(u=>u.manager.ecosystem!==a.manager.ecosystem)]:s,l=[];for(let{manager:u}of c){let d=u.manifests.find(f=>o.includes(f)),p=d?await n.readFile((0,Rx.join)(r,d)):null;for(let f of Ix(u.id,p))l.some(m=>m.label===f.label)||l.push(f)}return l}async function Nx(e){let t=e.dir?(0,Rx.join)(e.root,e.dir):e.root,n=e.exec??Xe,i=e.env??process.env,r=[],o=e.checks.length,s=!1;for(let[a,c]of e.checks.entries()){if(s){r.push(Ax(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:0,output:"",reason:"An earlier check already failed, so this one was not run."}));continue}if(e.token?.isCancellationRequested){r.push(Ax(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"cancelled",durationMs:0,output:"",reason:"Cancelled before this check ran."}));continue}e.onProgress?.(c,a,o);let l=Date.now(),u=await n(c.command.command,c.command.args,{cwd:t,env:i,timeoutMs:e.timeoutMs??Xje,...e.signal?{signal:e.signal}:{},...e.onOutput?{onOutput:p=>e.onOutput(c,p)}:{}}),d=Date.now()-l;if(u.failure==="not-found"){r.push(Ax(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:"not-run",durationMs:d,output:"",reason:e.notFoundReason?.(c.command.command)??`\`${c.command.command}\` was not found on PATH, so this check could not run.`}));continue}u.code!==0&&e.stopOnFirstFailure&&(s=!0),r.push(Ax(e,a,{kind:c.kind,label:c.label,compileCapable:c.compileCapable,status:u.code===0?"passed":"failed",durationMs:d,output:eze(`${u.stdout} ${u.stderr}`),fullOutput:`${u.stdout} -${u.stderr}`,...u.failure==="timeout"?{reason:"Timed out."}:{}}))}return r}function $x(e,t,n){return e.onResult?.(n,t,e.checks.length),n}function Hje(e){let t=e.split(` -`).filter(i=>i.trim().length>0),n=t.slice(-qje);return n.lengthi.trim().length>0),n=t.slice(-Qje);return n.length]+\((\w[\w$]*\.(?:java|kt|scala)):(\d+)\)/;function Of(e){return e.replace(/\x1b\[[0-9;]*m/g,"").trim().slice(0,300)}function Ex(e,t){let n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(t){let i=t.replace(/\\/g,"/").replace(/\/+$/,"");if(n===i)return n;n.startsWith(`${i}/`)&&(n=n.slice(i.length+1))}return n}function cne(e,t){let n=[],i=new Set,r=s=>{let a=`${s.file}|${s.line}|${s.column??""}|${s.code??""}|${s.message}`;i.has(a)||(i.add(a),n.push(s))},o=null;for(let s of e.split(` -`)){let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=Xje.exec(a);if(c){o={testClass:c[2]??c[3],testName:c[1]??c[4],message:null,frames:0};continue}if(o){let f=eze.exec(a);if(f){let g=f[1].split("$")[0];if(g===o.testClass.split("$")[0]&&o.frames<3){o.frames++;let h=g.includes(".")?`${g.slice(0,g.lastIndexOf(".")).replace(/\./g,"/")}/`:"";r({file:`${h}${f[2]}`,line:Number(f[3]),message:Of(o.message??`${o.testName} failed`),severity:"error",origin:"stack-frame"})}continue}o.message===null&&a.trim().length>0&&(o.message=Of(a))}let l=Kje.exec(a);if(l){let f=Number(l[2]??l[4]),m=Number(l[3]??l[5]);r({file:Ex(l[1],t),line:f,...Number.isFinite(m)&&m>0?{column:m-1}:{},code:l[7].toUpperCase(),message:Of(l[8]??""),severity:(l[6]??"error").toLowerCase()==="warning"?"warning":"error"});continue}let u=Jje.exec(a);if(u){let f=Number(u[3]);r({file:Ex(u[1],t),line:Number(u[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:Of(u[4]??""),severity:/^\s*\[WARNING\]/.test(a)?"warning":"error"});continue}let d=Zje.exec(a);if(d){r({file:Ex(d[1],t),line:Number(d[2]),message:Of(d[4]??""),severity:(d[3]??"error").toLowerCase()==="warning"?"warning":"error"});continue}if(Yje.test(a))continue;let p=Qje.exec(a);if(p){let f=Number(p[3]),m=Of(p[4]??"");if(m.length===0)continue;r({file:Ex(p[1],t),line:Number(p[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:m,severity:/warning/i.test(m)?"warning":"error"})}}return n}function ane(e){let t=e.message.toLowerCase().replace(/['"`].*?['"`]/g,"\u2039\u203A").replace(/\s+/g," ").slice(0,80);return`${e.file}|${e.code??""}|${t}`}function lne(e,t){let n=new Set(t.map(ane));return e.filter(i=>i.severity==="error"&&!n.has(ane(i)))}var hne=["typecheck","build","test"];async function yne(e){let t={...e,toolAvailability:D1()},n=new Map,i=(a,c)=>{n.set(a.id,c),t.onVerified?.(a,c)};if(t.targets.length===0)return n;let r=[...fze(t.targets)],o=0,s=t.targets.length;return await qn(r,Math.max(1,t.concurrency??vx()),async([a,c])=>{if(t.token?.isCancellationRequested){for(let u of c)i(u,B1());return}let l=mze(a);await tze(t,l,c,{report:(u,d,p)=>t.onProgress?.({phase:u,detail:d,done:o,total:s,...p?{targets:p.map(f=>f.id)}:{}}),output:u=>t.onProgress?.({phase:"",detail:"",done:o,total:s,output:u}),settle:(u,d)=>{o+=1,i(u,d)}})}),await a1(),n}async function tze(e,t,n,i){let r=e.exec??Xe,o=au(e.env??process.env),s=wne(e.root,t),a=await(e.warm?.take(t,n[0].packageManager)??bne(e,t,n[0].packageManager,i));if(!a.ok){for(let d of n)i.settle(d,jo(a.reason));return}let{worktree:c,usable:l,manager:u}=a;for(let d of a.notes)i.report(`Preparing a test checkout of ${s}`,d);try{let d={exec:r,env:o,dir:t,root:c.path,usable:l,install:u?.install,...e.installTogether?{installTogether:e.installTogether}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{},...e.token?{token:e.token}:{}};await G1(d,n,i)}finally{await c.dispose()}}var nze=4;async function G1(e,t,n){if(e.token?.isCancellationRequested){for(let c of t)n.settle(c,B1());return!0}let i=t.length===1?t[0]:void 0;if(i)return une(e,i,n);let r=await aze(e,t,n);if(r!=="inconclusive")return r==="settled";if(t.length<=nze){for(let[c,l]of t.entries()){if(e.token?.isCancellationRequested){n.settle(l,B1());continue}if(!await une(e,l,n))return gne(t,c+1,n),!1}return!0}let o=Math.ceil(t.length/2),s=t.slice(0,o),a=t.slice(o);return await G1(e,s,n)?G1(e,a,n):(gne(a,0,n),!1)}async function une(e,t,n){let i=`Testing ${t.name}@${t.selected}`;n.report(i,"installing into the test checkout",[t]);try{await t.install(e.root)}catch(r){return n.settle(t,jo(`${t.name}@${t.selected} could not be installed, so it could not be tested. ${Ix(r)}`)),V1(e)}return n.report(i,e.usable.map(r=>r.label).join(", "),[t]),n.settle(t,W1(await kne(e,n,i,[t]),e.root)),V1(e)}async function dne(e,t,n,i){let r=[...new Set(t.flatMap(pne))];if(r.length===0)return{usable:t,missing:[]};let o=await rne(e,r,n,i),s=c=>pne(c).every(l=>o.get(l)===!0);return{usable:t.filter(s),missing:r.filter(c=>o.get(c)===!1)}}function pne(e){return e.commandOrigin.kind==="host"?[e.commandOrigin.command]:[...e.commandOrigin.requiredHostCommands]}function rze(e,t,n){let i=e.install?[{kind:"build",label:`${e.install.command} ${e.install.args.join(" ")}`.trim(),command:e.install,source:`${e.label} install`,commandOrigin:{kind:"host",command:e.install.command},compileCapable:!1}]:[],r=kx(e.id,null).filter(s=>n.includes(s.kind)),o=i.length>0?t.filter(s=>n.includes(s.kind)):[];return ize([...i,...r,...o])}function ize(e){let t=[];for(let n of e)t.some(i=>i.label===n.label)||t.push(n);return t}function fne(e){return e.length===1?`\`${e[0]}\` is`:`${e.slice(0,-1).map(t=>`\`${t}\``).join(", ")} and \`${e.at(-1)}\` are`}async function bne(e,t,n,i){let r=e.exec??Xe,o=au(e.env??process.env),s=e.kinds??hne,a=wne(e.root,t),c=Uc(n),l=c?await Sx(e.root,t,e.fs??Hn(),n).catch(()=>[]):[],u=c?rze(c,l,s):[];if(u.length>0){let E=await dne(r,u,o,e.toolAvailability);if(E.usable.length===0)return nt("verify.skipped.noTool"),{ok:!1,reason:`${fne(E.missing)} not installed, so ${a} could not be built or tested against the upgrade.`}}i.report(`Preparing a test checkout of ${a}`,"checking out a clean copy");let d,p=It("verify","worktree",{project:a});try{d=await ax(e.root,`probe-${t||"root"}`,{exec:r,env:o,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}}),p.end()}catch(E){return p.end({failed:!0}),{ok:!1,reason:Ix(E)}}let f=[];d.copiedFiles.length>0&&f.push(`carried over ${j1(d.copiedFiles,d.copiedRules)} not tracked by git`),d.oversizedFiles.length>0&&f.push(`skipped ${j1(d.oversizedFiles,d.oversizedRules)} \u2014 too large to carry over automatically, which may make a check fail for a reason unrelated to this upgrade`),d.skippedSecrets.length>0&&f.push(`never copied ${j1(d.skippedSecrets,d.skippedSecretRules)} \u2014 ${d.skippedSecrets.length===1?"it looked":"they looked"} like credentials, which may make a check fail for a reason unrelated to this upgrade; see \`verify.generatedSourceGlobs\` if the project genuinely needs ${d.skippedSecrets.length===1?"it":"one of them"}`);let m=async E=>(await d.dispose(),{ok:!1,reason:E}),g=(await Sx(d.path,t,e.fs??Hn(),n)).filter(E=>s.includes(E.kind));if(g.length===0)return m("This project declares no typecheck or build that Drift could run against the upgrade.");let h=await dne(r,g,o,e.toolAvailability),b=h.usable;if(b.length===0)return m(h.missing.length>0?`${fne(h.missing)} not installed, so ${a} could not be built or tested against the upgrade.`:"This project declares checks, but none of them could run in the current environment.");let y=c?.install;if(y){i.report(`Installing ${a}'s dependencies`,`\`${y.command} ${y.args.join(" ")}\``),nt("verify.install");let E=await En("verify","install",()=>r(y.command,y.args,{cwd:t?`${d.path}/${t}`:d.path,env:o,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{},onOutput:i.output}),{project:a,manager:y.command});if(E.code!==0){let T=(E.stderr||E.stdout).trim().split(` -`).slice(-3).join(" ");return m(`\`${y.command} ${y.args.join(" ")}\` failed in a clean checkout, so there was nothing to test the upgrade against. ${T}`.trim())}}if(e.token?.isCancellationRequested)return m("Cancelled before this upgrade could be tested.");let w=e.baselineCache??U1(),k=await oze(e,d.path,t,n,b),_=k?await w.read(k):null,S;if(_)nt("verify.baseline.cached"),i.report(`Checking ${a} as it is`,`reusing the baseline measured earlier for this commit (${_.filter(E=>E.status==="passed").length} of ${_.length} checks green)`),S=_;else{nt("verify.baseline.measured");let E=It("verify","baseline",{project:a,checks:b.length});i.report(`Checking ${a} as it is`,`${b.map(A=>A.label).join(", ")}`);let T=await xx({root:d.path,dir:t,checks:b,env:o,exec:r,onProgress:A=>i.report(`Checking ${a} as it is`,`\`${A.label}\``),onOutput:(A,L)=>i.output(L),...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}});E.end(),S=T,k&&!e.token?.isCancellationRequested&&await w.write(k,T)}let x=b.filter(E=>S.some(T=>T.label===E.label&&T.status==="passed"));return x.length===0?m(pze(S)):{ok:!0,worktree:d,usable:x,manager:c,notes:f}}async function oze(e,t,n,i,r){if(!e.baselineCache)return null;let o=e.exec??Xe,s=au(e.env??process.env),a=await o("git",["rev-parse","HEAD"],{cwd:t,env:s}).catch(()=>null);if(!a||a.code!==0)return null;let c=e.fs??Hn(),l=n?`${t}/${n}`:t,d=(await c.readDirectory(l).catch(()=>[])).filter(f=>sze.test(f)||Oc(f)).sort();if(d.length===0)return null;let p=[];for(let f of d){let m=await c.readFile(`${l}/${f}`).catch(()=>null);if(m===null)return null;p.push({path:f,content:m})}return one({head:a.stdout.trim(),dir:n,packageManager:i,kinds:r.map(f=>f.kind),files:p,runtime:`${process.version}/${process.platform}/${process.arch}`})}var sze=/^(package\.json|package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|pyproject\.toml|setup\.py|setup\.cfg|poetry\.lock|uv\.lock|Pipfile(\.lock)?|go\.mod|go\.sum|Cargo\.(toml|lock)|Gemfile(\.lock)?|[^/]*\.gemspec|pom\.xml|build\.gradle(\.kts)?|gradle\.lockfile|build\.sbt|composer\.(json|lock)|mix\.(exs|lock)|pubspec\.(yaml|lock)|Package\.(swift|resolved)|Podfile(\.lock)?|[^/]*\.opam|conanfile\.(txt|py)|conan\.lock|vcpkg\.json|platformio\.ini|library\.properties|.*\.csproj|.*\.fsproj|packages\.lock\.json)$/i;function vne(e,t,n){let i={...e,toolAvailability:D1()},r=new Map,o={report:(u,d)=>n?.({phase:u,detail:d,done:0,total:0}),output:u=>n?.({phase:"",detail:"",done:0,total:0,output:u})},s=Math.max(1,i.concurrency??vx()),a=0,c=[],l=async u=>{a>=s&&await new Promise(d=>c.push(d)),a+=1;try{return await u()}finally{a-=1,c.shift()?.()}};for(let{dir:u,packageManager:d}of t)r.has(u)||r.set(u,{packageManager:d,prepared:l(()=>bne(i,u,d,o)).catch(p=>({ok:!1,reason:Ix(p)}))});return{take(u,d){let p=r.get(u);if(p&&p.packageManager===d)return r.delete(u),p.prepared},async dispose(){let u=[...r.values()];r.clear(),await Promise.all(u.map(({prepared:d})=>d.then(p=>p.ok?p.worktree.dispose():void 0,()=>{}))),await a1()}}}function wne(e,t){return t||(0,Tx.basename)(e)||"the repository"}async function aze(e,t,n){n.report(`Testing ${t.length} upgrades together`,t.map(a=>`${a.name}@${a.selected}`).join(", "),t);let r=await cze(e,t)&&!e.token?.isCancellationRequested?await kne(e,n,`Testing ${t.length} upgrades together`,t,{stopOnFirstFailure:!0}):[],o=r.length>0&&r.every(a=>a.status==="passed"),s=await V1(e);if(o){for(let a of t)n.settle(a,{...W1(r,e.root),measuredWith:t.length});return"settled"}if(!s){for(let a of t)n.settle(a,jo("The test checkout could not be reset to a clean state after testing these upgrades together, so they could not be attributed individually."));return"contaminated"}return"inconclusive"}async function cze(e,t){if(e.token?.isCancellationRequested)return!1;nt("verify.install");let n=It("verify","install",{packages:t.length});try{return await lze(e,t)}finally{n.end()}}async function lze(e,t){if(e.installTogether)try{if(await e.installTogether(e.root,t))return!0}catch{return!1}for(let n of t){if(e.token?.isCancellationRequested)return!1;try{await n.install(e.root)}catch{return!1}}return!0}function kne(e,t,n,i,r){return nt("verify.checkPass"),En("verify","checks",()=>xx({root:e.root,dir:e.dir,checks:e.usable,env:e.env,exec:e.exec,...r?.stopOnFirstFailure?{stopOnFirstFailure:!0}:{},...t&&n?{onProgress:o=>t.report(n,`\`${o.label}\``,i)}:{},...t?{onOutput:(o,s)=>t.output(s)}:{},...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}))}var q1=15*6e4;async function $ne(e){let t=e.exec??Xe,n=au(e.env??process.env),i=await mne(e,e.afterSha,t,n,"with the change");if(i.status!=="failed"||!e.beforeSha)return i;let r=await mne(e,e.beforeSha,t,n,"without it");return uze(i,r,e.beforeSha)}function uze(e,t,n){if(t.checks.length===0)return jo(`The project could not be checked at ${su(n)}, so there is nothing to compare the failure against.`);let i=new Map(t.checks.map(a=>[a.label,a])),r=e.checks.filter(a=>a.status==="failed"&&i.get(a.label)?.status==="passed");if(r.length===0){let a=[...new Set(e.checks.filter(c=>c.status==="failed").map(c=>i.get(c.label)?`\`${c.label}\` already failed at ${su(n)}`:`\`${c.label}\` has no baseline at ${su(n)} to compare against`))];return jo(`${a.join("; ")}, so the failure afterwards proves nothing about this dependency.`)}let o=r.map(a=>`$ ${a.label} +`)}var tze=/^\s*(?:\x1b\[[0-9;]*m)*([^\s()][^()]*?)(?:\((\d+),(\d+)\)|:(\d+):(\d+))\s*[-:]?\s*(error|warning)\s+(TS\d+)\s*:\s*(.*)$/i,nze=/^\s*(?:\[(?:ERROR|WARNING)\]\s*)?(\/?[^\s:]+\.(?:java|kt|scala)):\[(\d+),(\d+)\]\s*(.*)$/,rze=/^\s*(?:\[(?:ERROR|WARNING)\]\s*)?(\/?[^\s:]+\.(?:java|kt|scala)):(\d+):\s*(error|warning)\s*:\s*(.*)$/i,ize=/^\s*at\s+(?:.*?\((?:[A-Za-z]:)?[^()]+:\d+:\d+\)|(?:[A-Za-z]:)?\S+:\d+:\d+)\s*$/,oze=/^\s*([^\s:][^:]*\.\w+):(\d+)(?::(\d+))?:\s*(.*)$/,sze=/^\s*(?:\[ERROR\]\s*)?(?:(\w+)\((\S+?)\)|([\w.$]+)\.(\w+))\s+Time elapsed:.*<<<\s*(FAILURE|ERROR)!/,aze=/^\s*at\s+([\w.$]+)\.[\w$<>]+\((\w[\w$]*\.(?:java|kt|scala)):(\d+)\)/;function Mf(e){return e.replace(/\x1b\[[0-9;]*m/g,"").trim().slice(0,300)}function Px(e,t){let n=e.replace(/\\/g,"/").replace(/^\.\//,"");if(t){let i=t.replace(/\\/g,"/").replace(/\/+$/,"");if(n===i)return n;n.startsWith(`${i}/`)&&(n=n.slice(i.length+1))}return n}function mne(e,t){let n=[],i=new Set,r=s=>{let a=`${s.file}|${s.line}|${s.column??""}|${s.code??""}|${s.message}`;i.has(a)||(i.add(a),n.push(s))},o=null;for(let s of e.split(` +`)){let a=s.replace(/\x1b\[[0-9;]*m/g,""),c=sze.exec(a);if(c){o={testClass:c[2]??c[3],testName:c[1]??c[4],message:null,frames:0};continue}if(o){let f=aze.exec(a);if(f){let g=f[1].split("$")[0];if(g===o.testClass.split("$")[0]&&o.frames<3){o.frames++;let h=g.includes(".")?`${g.slice(0,g.lastIndexOf(".")).replace(/\./g,"/")}/`:"";r({file:`${h}${f[2]}`,line:Number(f[3]),message:Mf(o.message??`${o.testName} failed`),severity:"error",origin:"stack-frame"})}continue}o.message===null&&a.trim().length>0&&(o.message=Mf(a))}let l=tze.exec(a);if(l){let f=Number(l[2]??l[4]),m=Number(l[3]??l[5]);r({file:Px(l[1],t),line:f,...Number.isFinite(m)&&m>0?{column:m-1}:{},code:l[7].toUpperCase(),message:Mf(l[8]??""),severity:(l[6]??"error").toLowerCase()==="warning"?"warning":"error"});continue}let u=nze.exec(a);if(u){let f=Number(u[3]);r({file:Px(u[1],t),line:Number(u[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:Mf(u[4]??""),severity:/^\s*\[WARNING\]/.test(a)?"warning":"error"});continue}let d=rze.exec(a);if(d){r({file:Px(d[1],t),line:Number(d[2]),message:Mf(d[4]??""),severity:(d[3]??"error").toLowerCase()==="warning"?"warning":"error"});continue}if(ize.test(a))continue;let p=oze.exec(a);if(p){let f=Number(p[3]),m=Mf(p[4]??"");if(m.length===0)continue;r({file:Px(p[1],t),line:Number(p[2]),...Number.isFinite(f)&&f>0?{column:f-1}:{},message:m,severity:/warning/i.test(m)?"warning":"error"})}}return n}function fne(e){let t=e.message.toLowerCase().replace(/['"`].*?['"`]/g,"\u2039\u203A").replace(/\s+/g," ").slice(0,80);return`${e.file}|${e.code??""}|${t}`}function gne(e,t){let n=new Set(t.map(fne));return e.filter(i=>i.severity==="error"&&!n.has(fne(i)))}var _ne=["typecheck","build","test"];async function $ne(e){let t={...e,toolAvailability:G1()},n=new Map,i=(a,c)=>{n.set(a.id,c),t.onVerified?.(a,c)};if(t.targets.length===0)return n;let r=[...wze(t.targets)],o=0,s=t.targets.length;return await Bn(r,Math.max(1,t.concurrency??Ex()),async([a,c])=>{if(t.token?.isCancellationRequested){for(let u of c)i(u,Q1());return}let l=kze(a);await cze(t,l,c,{report:(u,d,p)=>t.onProgress?.({phase:u,detail:d,done:o,total:s,...p?{targets:p.map(f=>f.id)}:{}}),output:u=>t.onProgress?.({phase:"",detail:"",done:o,total:s,output:u}),settle:(u,d)=>{o+=1,i(u,d)}})}),await g1(),n}async function cze(e,t,n,i){let r=e.exec??Xe,o=lu(e.env??process.env),s=Ene(e.root,t),a=await(e.warm?.take(t,n[0].packageManager)??Sne(e,t,n[0].packageManager,i));if(!a.ok){for(let d of n)i.settle(d,jo(a.reason));return}let{worktree:c,usable:l,manager:u}=a;for(let d of a.notes)i.report(`Preparing a test checkout of ${s}`,d);try{let d={exec:r,env:o,dir:t,root:c.path,usable:l,install:u?.install,...e.installTogether?{installTogether:e.installTogether}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{},...e.token?{token:e.token}:{}};await Z1(d,n,i)}finally{await c.dispose()}}var lze=4;async function Z1(e,t,n){if(e.token?.isCancellationRequested){for(let c of t)n.settle(c,Q1());return!0}let i=t.length===1?t[0]:void 0;if(i)return hne(e,i,n);let r=await mze(e,t,n);if(r!=="inconclusive")return r==="settled";if(t.length<=lze){for(let[c,l]of t.entries()){if(e.token?.isCancellationRequested){n.settle(l,Q1());continue}if(!await hne(e,l,n))return kne(t,c+1,n),!1}return!0}let o=Math.ceil(t.length/2),s=t.slice(0,o),a=t.slice(o);return await Z1(e,s,n)?Z1(e,a,n):(kne(a,0,n),!1)}async function hne(e,t,n){let i=`Testing ${t.name}@${t.selected}`;n.report(i,"installing into the test checkout",[t]);try{await t.install(e.root)}catch(r){return n.settle(t,jo(`${t.name}@${t.selected} could not be installed, so it could not be tested. ${Ox(r)}`)),Y1(e)}return n.report(i,e.usable.map(r=>r.label).join(", "),[t]),n.settle(t,eU(await Tne(e,n,i,[t]),e.root)),Y1(e)}async function yne(e,t,n,i){let r=[...new Set(t.flatMap(bne))];if(r.length===0)return{usable:t,missing:[]};let o=await lne(e,r,n,i),s=c=>bne(c).every(l=>o.get(l)===!0);return{usable:t.filter(s),missing:r.filter(c=>o.get(c)===!1)}}function bne(e){return e.commandOrigin.kind==="host"?[e.commandOrigin.command]:[...e.commandOrigin.requiredHostCommands]}function uze(e,t,n){let i=e.install?[{kind:"build",label:`${e.install.command} ${e.install.args.join(" ")}`.trim(),command:e.install,source:`${e.label} install`,commandOrigin:{kind:"host",command:e.install.command},compileCapable:!1}]:[],r=Ix(e.id,null).filter(s=>n.includes(s.kind)),o=i.length>0?t.filter(s=>n.includes(s.kind)):[];return dze([...i,...r,...o])}function dze(e){let t=[];for(let n of e)t.some(i=>i.label===n.label)||t.push(n);return t}function vne(e){return e.length===1?`\`${e[0]}\` is`:`${e.slice(0,-1).map(t=>`\`${t}\``).join(", ")} and \`${e.at(-1)}\` are`}async function Sne(e,t,n,i){let r=e.exec??Xe,o=lu(e.env??process.env),s=e.kinds??_ne,a=Ene(e.root,t),c=zc(n),l=c?await Cx(e.root,t,e.fs??Wn(),n).catch(()=>[]):[],u=c?uze(c,l,s):[];if(u.length>0){let E=await yne(r,u,o,e.toolAvailability);if(E.usable.length===0)return nt("verify.skipped.noTool"),{ok:!1,reason:`${vne(E.missing)} not installed, so ${a} could not be built or tested against the upgrade.`}}i.report(`Preparing a test checkout of ${a}`,"checking out a clean copy");let d,p=It("verify","worktree",{project:a});try{d=await mx(e.root,`probe-${t||"root"}`,{exec:r,env:o,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}}),p.end()}catch(E){return p.end({failed:!0}),{ok:!1,reason:Ox(E)}}let f=[];d.copiedFiles.length>0&&f.push(`carried over ${H1(d.copiedFiles,d.copiedRules)} not tracked by git`),d.oversizedFiles.length>0&&f.push(`skipped ${H1(d.oversizedFiles,d.oversizedRules)} \u2014 too large to carry over automatically, which may make a check fail for a reason unrelated to this upgrade`),d.skippedSecrets.length>0&&f.push(`never copied ${H1(d.skippedSecrets,d.skippedSecretRules)} \u2014 ${d.skippedSecrets.length===1?"it looked":"they looked"} like credentials, which may make a check fail for a reason unrelated to this upgrade; see \`verify.generatedSourceGlobs\` if the project genuinely needs ${d.skippedSecrets.length===1?"it":"one of them"}`);let m=async E=>(await d.dispose(),{ok:!1,reason:E}),g=(await Cx(d.path,t,e.fs??Wn(),n)).filter(E=>s.includes(E.kind));if(g.length===0)return m("This project declares no typecheck or build that Drift could run against the upgrade.");let h=await yne(r,g,o,e.toolAvailability),b=h.usable;if(b.length===0)return m(h.missing.length>0?`${vne(h.missing)} not installed, so ${a} could not be built or tested against the upgrade.`:"This project declares checks, but none of them could run in the current environment.");let y=c?.install;if(y){i.report(`Installing ${a}'s dependencies`,`\`${y.command} ${y.args.join(" ")}\``),nt("verify.install");let E=await Sn("verify","install",()=>r(y.command,y.args,{cwd:t?`${d.path}/${t}`:d.path,env:o,timeoutMs:e.timeoutMs??X1,...e.signal?{signal:e.signal}:{},onOutput:i.output}),{project:a,manager:y.command});if(E.code!==0){let T=(E.stderr||E.stdout).trim().split(` +`).slice(-3).join(" ");return m(`\`${y.command} ${y.args.join(" ")}\` failed in a clean checkout, so there was nothing to test the upgrade against. ${T}`.trim())}}if(e.token?.isCancellationRequested)return m("Cancelled before this upgrade could be tested.");let w=e.baselineCache??K1(),k=await pze(e,d.path,t,n,b),$=k?await w.read(k):null,S;if($)nt("verify.baseline.cached"),i.report(`Checking ${a} as it is`,`reusing the baseline measured earlier for this commit (${$.filter(E=>E.status==="passed").length} of ${$.length} checks green)`),S=$;else{nt("verify.baseline.measured");let E=It("verify","baseline",{project:a,checks:b.length});i.report(`Checking ${a} as it is`,`${b.map(A=>A.label).join(", ")}`);let T=await Nx({root:d.path,dir:t,checks:b,env:o,exec:r,onProgress:A=>i.report(`Checking ${a} as it is`,`\`${A.label}\``),onOutput:(A,L)=>i.output(L),...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}});E.end(),S=T,k&&!e.token?.isCancellationRequested&&await w.write(k,T)}let x=b.filter(E=>S.some(T=>T.label===E.label&&T.status==="passed"));return x.length===0?m(vze(S)):{ok:!0,worktree:d,usable:x,manager:c,notes:f}}async function pze(e,t,n,i,r){if(!e.baselineCache)return null;let o=e.exec??Xe,s=lu(e.env??process.env),a=await o("git",["rev-parse","HEAD"],{cwd:t,env:s}).catch(()=>null);if(!a||a.code!==0)return null;let c=e.fs??Wn(),l=n?`${t}/${n}`:t,d=(await c.readDirectory(l).catch(()=>[])).filter(f=>fze.test(f)||Lc(f)).sort();if(d.length===0)return null;let p=[];for(let f of d){let m=await c.readFile(`${l}/${f}`).catch(()=>null);if(m===null)return null;p.push({path:f,content:m})}return dne({head:a.stdout.trim(),dir:n,packageManager:i,kinds:r.map(f=>f.kind),files:p,runtime:`${process.version}/${process.platform}/${process.arch}`})}var fze=/^(package\.json|package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|bun\.lockb?|pyproject\.toml|setup\.py|setup\.cfg|poetry\.lock|uv\.lock|Pipfile(\.lock)?|go\.mod|go\.sum|Cargo\.(toml|lock)|Gemfile(\.lock)?|[^/]*\.gemspec|pom\.xml|build\.gradle(\.kts)?|gradle\.lockfile|build\.sbt|composer\.(json|lock)|mix\.(exs|lock)|pubspec\.(yaml|lock)|Package\.(swift|resolved)|Podfile(\.lock)?|[^/]*\.opam|conanfile\.(txt|py)|conan\.lock|vcpkg\.json|platformio\.ini|library\.properties|.*\.csproj|.*\.fsproj|packages\.lock\.json)$/i;function xne(e,t,n){let i={...e,toolAvailability:G1()},r=new Map,o={report:(u,d)=>n?.({phase:u,detail:d,done:0,total:0}),output:u=>n?.({phase:"",detail:"",done:0,total:0,output:u})},s=Math.max(1,i.concurrency??Ex()),a=0,c=[],l=async u=>{a>=s&&await new Promise(d=>c.push(d)),a+=1;try{return await u()}finally{a-=1,c.shift()?.()}};for(let{dir:u,packageManager:d}of t)r.has(u)||r.set(u,{packageManager:d,prepared:l(()=>Sne(i,u,d,o)).catch(p=>({ok:!1,reason:Ox(p)}))});return{take(u,d){let p=r.get(u);if(p&&p.packageManager===d)return r.delete(u),p.prepared},async dispose(){let u=[...r.values()];r.clear(),await Promise.all(u.map(({prepared:d})=>d.then(p=>p.ok?p.worktree.dispose():void 0,()=>{}))),await g1()}}}function Ene(e,t){return t||(0,Dx.basename)(e)||"the repository"}async function mze(e,t,n){n.report(`Testing ${t.length} upgrades together`,t.map(a=>`${a.name}@${a.selected}`).join(", "),t);let r=await gze(e,t)&&!e.token?.isCancellationRequested?await Tne(e,n,`Testing ${t.length} upgrades together`,t,{stopOnFirstFailure:!0}):[],o=r.length>0&&r.every(a=>a.status==="passed"),s=await Y1(e);if(o){for(let a of t)n.settle(a,{...eU(r,e.root),measuredWith:t.length});return"settled"}if(!s){for(let a of t)n.settle(a,jo("The test checkout could not be reset to a clean state after testing these upgrades together, so they could not be attributed individually."));return"contaminated"}return"inconclusive"}async function gze(e,t){if(e.token?.isCancellationRequested)return!1;nt("verify.install");let n=It("verify","install",{packages:t.length});try{return await hze(e,t)}finally{n.end()}}async function hze(e,t){if(e.installTogether)try{if(await e.installTogether(e.root,t))return!0}catch{return!1}for(let n of t){if(e.token?.isCancellationRequested)return!1;try{await n.install(e.root)}catch{return!1}}return!0}function Tne(e,t,n,i,r){return nt("verify.checkPass"),Sn("verify","checks",()=>Nx({root:e.root,dir:e.dir,checks:e.usable,env:e.env,exec:e.exec,...r?.stopOnFirstFailure?{stopOnFirstFailure:!0}:{},...t&&n?{onProgress:o=>t.report(n,`\`${o.label}\``,i)}:{},...t?{onOutput:(o,s)=>t.output(s)}:{},...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}))}var X1=15*6e4;async function Ine(e){let t=e.exec??Xe,n=lu(e.env??process.env),i=await wne(e,e.afterSha,t,n,"with the change");if(i.status!=="failed"||!e.beforeSha)return i;let r=await wne(e,e.beforeSha,t,n,"without it");return yze(i,r,e.beforeSha)}function yze(e,t,n){if(t.checks.length===0)return jo(`The project could not be checked at ${cu(n)}, so there is nothing to compare the failure against.`);let i=new Map(t.checks.map(a=>[a.label,a])),r=e.checks.filter(a=>a.status==="failed"&&i.get(a.label)?.status==="passed");if(r.length===0){let a=[...new Set(e.checks.filter(c=>c.status==="failed").map(c=>i.get(c.label)?`\`${c.label}\` already failed at ${cu(n)}`:`\`${c.label}\` has no baseline at ${cu(n)} to compare against`))];return jo(`${a.join("; ")}, so the failure afterwards proves nothing about this dependency.`)}let o=r.map(a=>`$ ${a.label} ${a.fullOutput??a.output}`).join(` -`),s=lne(e.parsedDiagnostics??[],t.parsedDiagnostics??[]);return{status:"failed",checks:e.checks,diagnostics:o,failedFiles:_ne(o),...s.length>0?{introducedDiagnostics:s}:{}}}async function mne(e,t,n,i,r){let o=e.dir??"",s=e.kinds??hne;e.onProgress?.({phase:`Checking the project ${r}`,detail:su(t),done:0,total:1});let a;try{a=await ax(e.workspace,`change-${su(t)}`,{at:t,exec:n,env:i,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}})}catch(c){return jo(Ix(c))}try{let c=(await Sx(a.path,o,e.fs??Hn(),e.packageManager)).filter(u=>s.includes(u.kind));if(c.length===0)return jo(`This project declares no typecheck or build at ${su(t)} that Drift could run.`);let l=Uc(e.packageManager);if(l?.install){let u=await n(l.install.command,l.install.args,{cwd:o?`${a.path}/${o}`:a.path,env:i,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{}});if(u.code!==0){let d=(u.stderr||u.stdout).trim().split(` -`).slice(-3).join(" ");return jo(`\`${l.install.command} ${l.install.args.join(" ")}\` failed at ${su(t)}, so the project could not be checked ${r}. ${d}`.trim())}}return W1(await xx({root:a.path,dir:o,checks:c,env:i,exec:n,...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}),a.path)}finally{await a.dispose()}}function su(e){return/^[0-9a-f]{7,40}$/i.test(e)?e.slice(0,7):e}async function V1(e){nt("verify.reset");let t=It("verify","reset");try{return await dze(e)}finally{t.end()}}async function dze(e){return(await e.exec("git",["checkout","--","."],{cwd:e.root,env:e.env}).catch(()=>({code:1}))).code!==0?!1:e.install?(await e.exec(e.install.command,e.install.args,{cwd:e.dir?`${e.root}/${e.dir}`:e.root,env:e.env,timeoutMs:e.timeoutMs??q1,...e.signal?{signal:e.signal}:{}}).catch(()=>({code:1}))).code===0:!0}function gne(e,t,n){for(let i of e.slice(t))n.settle(i,jo("The test checkout could not be reset to a clean state after testing an earlier upgrade in this group, so testing stopped rather than risk attributing one candidate\u2019s breakage to another."))}function W1(e,t){let n=e.filter(o=>o.status==="failed");if(n.length>0){let o=n.map(a=>`$ ${a.label} +`),s=gne(e.parsedDiagnostics??[],t.parsedDiagnostics??[]);return{status:"failed",checks:e.checks,diagnostics:o,failedFiles:Ane(o),...s.length>0?{introducedDiagnostics:s}:{}}}async function wne(e,t,n,i,r){let o=e.dir??"",s=e.kinds??_ne;e.onProgress?.({phase:`Checking the project ${r}`,detail:cu(t),done:0,total:1});let a;try{a=await mx(e.workspace,`change-${cu(t)}`,{at:t,exec:n,env:i,...e.allowedGlobs?{allowedGlobs:e.allowedGlobs}:{}})}catch(c){return jo(Ox(c))}try{let c=(await Cx(a.path,o,e.fs??Wn(),e.packageManager)).filter(u=>s.includes(u.kind));if(c.length===0)return jo(`This project declares no typecheck or build at ${cu(t)} that Drift could run.`);let l=zc(e.packageManager);if(l?.install){let u=await n(l.install.command,l.install.args,{cwd:o?`${a.path}/${o}`:a.path,env:i,timeoutMs:e.timeoutMs??X1,...e.signal?{signal:e.signal}:{}});if(u.code!==0){let d=(u.stderr||u.stdout).trim().split(` +`).slice(-3).join(" ");return jo(`\`${l.install.command} ${l.install.args.join(" ")}\` failed at ${cu(t)}, so the project could not be checked ${r}. ${d}`.trim())}}return eU(await Nx({root:a.path,dir:o,checks:c,env:i,exec:n,...e.token?{token:e.token}:{},...e.timeoutMs?{timeoutMs:e.timeoutMs}:{},...e.signal?{signal:e.signal}:{}}),a.path)}finally{await a.dispose()}}function cu(e){return/^[0-9a-f]{7,40}$/i.test(e)?e.slice(0,7):e}async function Y1(e){nt("verify.reset");let t=It("verify","reset");try{return await bze(e)}finally{t.end()}}async function bze(e){return(await e.exec("git",["checkout","--","."],{cwd:e.root,env:e.env}).catch(()=>({code:1}))).code!==0?!1:e.install?(await e.exec(e.install.command,e.install.args,{cwd:e.dir?`${e.root}/${e.dir}`:e.root,env:e.env,timeoutMs:e.timeoutMs??X1,...e.signal?{signal:e.signal}:{}}).catch(()=>({code:1}))).code===0:!0}function kne(e,t,n){for(let i of e.slice(t))n.settle(i,jo("The test checkout could not be reset to a clean state after testing an earlier upgrade in this group, so testing stopped rather than risk attributing one candidate\u2019s breakage to another."))}function eU(e,t){let n=e.filter(o=>o.status==="failed");if(n.length>0){let o=n.map(a=>`$ ${a.label} ${a.fullOutput??a.output}`).join(` -`),s=cne(o,t).filter(a=>a.severity==="error");return{status:"failed",checks:[...e],diagnostics:o,failedFiles:_ne(o),...s.length>0?{parsedDiagnostics:s}:{}}}let i=e.filter(o=>o.status==="not-run"||o.status==="cancelled");return i.length>0?{status:"skipped",reason:i.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":i.find(o=>o.reason)?.reason??"One or more project checks could not run against this upgrade.",checks:[...e],failedFiles:[]}:e.filter(o=>o.status==="passed").length===0?{status:"skipped",reason:e.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":"None of the project\u2019s checks could run against this upgrade.",checks:[...e],failedFiles:[]}:{status:"passed",checks:[...e],failedFiles:[]}}function pze(e){let t=e.filter(i=>i.status==="failed");if(t.length>0){let i=t.map(o=>o.label),r=t.map(o=>`$ ${o.label} +`),s=mne(o,t).filter(a=>a.severity==="error");return{status:"failed",checks:[...e],diagnostics:o,failedFiles:Ane(o),...s.length>0?{parsedDiagnostics:s}:{}}}let i=e.filter(o=>o.status==="not-run"||o.status==="cancelled");return i.length>0?{status:"skipped",reason:i.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":i.find(o=>o.reason)?.reason??"One or more project checks could not run against this upgrade.",checks:[...e],failedFiles:[]}:e.filter(o=>o.status==="passed").length===0?{status:"skipped",reason:e.some(o=>o.status==="cancelled")?"Cancelled before this upgrade could be tested.":"None of the project\u2019s checks could run against this upgrade.",checks:[...e],failedFiles:[]}:{status:"passed",checks:[...e],failedFiles:[]}}function vze(e){let t=e.filter(i=>i.status==="failed");if(t.length>0){let i=t.map(o=>o.label),r=t.map(o=>`$ ${o.label} ${(o.output??o.reason??"").trim()||"(no output captured)"}`).join(` `);return`\`${i.join("`, `")}\` already fails on this commit before any upgrade is applied, so a failure afterwards would prove nothing. -${r}`}return e.find(i=>i.reason)?.reason??"None of the project\u2019s checks could be run in a clean checkout."}function _ne(e){let t=new Set;for(let n of e.split(` -`)){let r=/^\s*(?:[A-Za-z]:)?([\w./\\@+-]+\.\w+)(?:\((\d+),\d+\)|:(\d+):\d+)/.exec(n)?.[1];r&&t.add(r.replace(/\\/g,"/").replace(/^\.\//,""))}return[...t]}function fze(e){let t=new Map;for(let n of e){let i=t.get(n.manifestPath);i?i.push(n):t.set(n.manifestPath,[n])}return t}function j1(e,t){let n=`${e.length} gitignored file${e.length===1?"":"s"}`;if(e.length===0)return n;if(e.length<=z1)return`${n} (${e.join(", ")})`;let i=e.slice(0,z1).join(", "),r=t.length>0?`, matching: ${t.join(", ")}`:"";return`${n} (${i}, and ${e.length-z1} more${r})`}var z1=4;function mze(e){let t=(0,Tx.dirname)(e);return t==="."||t==="/"?"":t}function jo(e){return{status:"skipped",reason:e,checks:[],failedFiles:[]}}function B1(){return jo("Cancelled before this upgrade could be tested.")}function Ix(e){return e instanceof Error?e.message:String(e)}function au(e){let t=/token|secret|password|passwd|credential|api[_-]?key|private[_-]?key|_key$/i,n={};for(let[i,r]of Object.entries(e))i.startsWith("INPUT_")||i==="GITHUB_TOKEN"||t.test(i)||(n[i]=r);return n}function H1(e){return Or(e).detectability.some(t=>t==="compile-time"||t==="link-or-import")}function Fy(e){if(e.status!=="skipped")return e.measuredWith&&e.measuredWith>1?"batch":"isolated"}function Ax(e,t,n){return K1(hze(e,t,n))}var gze="build, typecheck, and test";function K1(e){let t=e.gaps.findIndex(c=>c.stage==="verify"&&c.surface===gze),n=e.verification;if(t===-1||!n)return e;let i=n.checks.filter(c=>c.status==="passed"||c.status==="failed"),r=i.map(c=>c.label).join(", "),o,s;if(n.status==="failed")o=`This project's checks (${r||"the configured checks"}) ran with the upgrade installed and failed where they passed before: a measured regression. No fix has been checked against them yet.`,s="Fix the measured failures, then run the same checks again before merging.";else if(n.status==="passed"&&i.length>0)o=`This project's checks (${r}) passed with the upgrade installed, before any fix. They confirm only what they exercise; findings on code they do not reach remain unconfirmed.`,s="Review the findings the checks do not exercise, and run the checks again after any fix.";else{let c=n.reason?.replace(/\s+/g," ").trim();o=`Verification did not run the project's checks${c?`: ${c.length>200?`${c.slice(0,199)}\u2026`:c}`:""}. Nothing measured confirms or refutes the findings.`,s="Resolve what stopped verification, or review the resulting pull request against CI before merging."}let a=[...e.gaps];return a[t]={...a[t],reason:o,remediation:s},{...e,gaps:a}}function hze(e,t,n){if(t.status!=="passed")return{...e,verification:t};if(!t.checks.some(o=>o.status==="passed"&&o.compileCapable))return{...e,verification:t};if(Fy(t)==="batch")return{...e,verification:t};let i=o=>n===void 0||(o.workspace??"")===n,r=new Set(e.breakingChanges.filter(o=>i(o)&&H1(o)).map(o=>o.id));return r.size===0?{...e,verification:t}:yze(e,r,t)}function yze(e,t,n){let i=e.breakingChanges.filter(l=>!t.has(l.id)),r=e.impactSites.filter(l=>!t.has(l.breakingChangeId)),o=e.dispositions?.filter(l=>!t.has(l.changeId)),s=e.commits.map(l=>({...l,breakingChangeIds:l.breakingChangeIds.filter(u=>!t.has(u))})).filter(l=>l.breakingChangeIds.length>0),a=new Set(s.map(l=>l.id)),c={...e,breakingChanges:i,impactSites:r,...o?{dispositions:o}:{},verification:n,planEdges:e.planEdges.filter(l=>a.has(l.from)&&a.has(l.to)),commits:s.map(l=>({...l,dependsOn:l.dependsOn.filter(u=>a.has(u)),dependencyReasons:l.dependencyReasons.filter(u=>a.has(u.from)&&a.has(u.to))}))};return bze(c)}function bze(e){let t=new Map;for(let s of e.rationale??[])for(let a of s.runtimeAnalyses??[])t.set(a.changeId,{changeId:a.changeId,runtime:a.runtime,requirement:a.requirement??"",state:a.state,reason:a.reason,declarations:[],unresolved:[],sites:e.impactSites.filter(c=>c.breakingChangeId===a.changeId),statement:a.statement??""});let n=[...t.values()].filter(s=>e.breakingChanges.some(a=>a.id===s.changeId)),i=Pf(e.breakingChanges,e.impactSites,n,e.localizationRan??!0),r=(e.rationale??[]).map(s=>{let a=e.changes.find(d=>d.name===s.dependency)?.workspace,c=e.breakingChanges.filter(d=>d.dependency===s.dependency&&(a===void 0||d.workspace===a)),l=new Set(c.map(d=>d.id)),u=My({dependency:s.dependency,...a!==void 0?{workspace:a}:{},breakingChanges:c,impactSites:e.impactSites.filter(d=>l.has(d.breakingChangeId)),evidence:e.evidence,security:s.security,maintenance:s.maintenance,license:s.license,gaps:s.gaps,surfaceCompared:s.hasCompatibilityEvidence,runtimeAnalyses:n.filter(d=>l.has(d.changeId)),localizationRan:e.localizationRan??!0});return{...s,assessment:{...u,confidence:s.assessment.confidence,confidenceBasis:s.assessment.confidenceBasis}}}),o=y1(e.changes,e.breakingChanges,e.impactSites,r.map(s=>s.assessment.runtimeCompatibility),i);return{...e,dispositions:i,risk:o,...e.rationale?{rationale:r}:{}}}function Sne(e){if(e.length===0||e.every(o=>!o))return;let t=e.filter(o=>!!o),n=t.flatMap(o=>o.checks),i=t.filter(o=>o.status==="failed");if(i.length>0){let o=i.flatMap(c=>c.introducedDiagnostics??[]),s=[],a=new Set;for(let c of o){let l=`${c.file}|${c.line}|${c.column??""}|${c.code??""}`;a.has(l)||(a.add(l),s.push(c))}return{status:"failed",checks:n,diagnostics:i.map(c=>c.diagnostics).filter(c=>!!c).join(` +${r}`}return e.find(i=>i.reason)?.reason??"None of the project\u2019s checks could be run in a clean checkout."}function Ane(e){let t=new Set;for(let n of e.split(` +`)){let r=/^\s*(?:[A-Za-z]:)?([\w./\\@+-]+\.\w+)(?:\((\d+),\d+\)|:(\d+):\d+)/.exec(n)?.[1];r&&t.add(r.replace(/\\/g,"/").replace(/^\.\//,""))}return[...t]}function wze(e){let t=new Map;for(let n of e){let i=t.get(n.manifestPath);i?i.push(n):t.set(n.manifestPath,[n])}return t}function H1(e,t){let n=`${e.length} gitignored file${e.length===1?"":"s"}`;if(e.length===0)return n;if(e.length<=J1)return`${n} (${e.join(", ")})`;let i=e.slice(0,J1).join(", "),r=t.length>0?`, matching: ${t.join(", ")}`:"";return`${n} (${i}, and ${e.length-J1} more${r})`}var J1=4;function kze(e){let t=(0,Dx.dirname)(e);return t==="."||t==="/"?"":t}function jo(e){return{status:"skipped",reason:e,checks:[],failedFiles:[]}}function Q1(){return jo("Cancelled before this upgrade could be tested.")}function Ox(e){return e instanceof Error?e.message:String(e)}function lu(e){let t=/token|secret|password|passwd|credential|api[_-]?key|private[_-]?key|_key$/i,n={};for(let[i,r]of Object.entries(e))i.startsWith("INPUT_")||i==="GITHUB_TOKEN"||t.test(i)||(n[i]=r);return n}function tU(e){return Dr(e).detectability.some(t=>t==="compile-time"||t==="link-or-import")}function qy(e){if(e.status!=="skipped")return e.measuredWith&&e.measuredWith>1?"batch":"isolated"}function Mx(e,t,n){return nU($ze(e,t,n))}var _ze="build, typecheck, and test";function nU(e){let t=e.gaps.findIndex(c=>c.stage==="verify"&&c.surface===_ze),n=e.verification;if(t===-1||!n)return e;let i=n.checks.filter(c=>c.status==="passed"||c.status==="failed"),r=i.map(c=>c.label).join(", "),o,s;if(n.status==="failed")o=`This project's checks (${r||"the configured checks"}) ran with the upgrade installed and failed where they passed before: a measured regression. No fix has been checked against them yet.`,s="Fix the measured failures, then run the same checks again before merging.";else if(n.status==="passed"&&i.length>0)o=`This project's checks (${r}) passed with the upgrade installed, before any fix. They confirm only what they exercise; findings on code they do not reach remain unconfirmed.`,s="Review the findings the checks do not exercise, and run the checks again after any fix.";else{let c=n.reason?.replace(/\s+/g," ").trim();o=`Verification did not run the project's checks${c?`: ${c.length>200?`${c.slice(0,199)}\u2026`:c}`:""}. Nothing measured confirms or refutes the findings.`,s="Resolve what stopped verification, or review the resulting pull request against CI before merging."}let a=[...e.gaps];return a[t]={...a[t],reason:o,remediation:s},{...e,gaps:a}}function $ze(e,t,n){if(t.status!=="passed")return{...e,verification:t};if(!t.checks.some(o=>o.status==="passed"&&o.compileCapable))return{...e,verification:t};if(qy(t)==="batch")return{...e,verification:t};let i=o=>n===void 0||(o.workspace??"")===n,r=new Set(e.breakingChanges.filter(o=>i(o)&&tU(o)).map(o=>o.id));return r.size===0?{...e,verification:t}:Sze(e,r,t)}function Sze(e,t,n){let i=e.breakingChanges.filter(l=>!t.has(l.id)),r=e.impactSites.filter(l=>!t.has(l.breakingChangeId)),o=e.dispositions?.filter(l=>!t.has(l.changeId)),s=e.commits.map(l=>({...l,breakingChangeIds:l.breakingChangeIds.filter(u=>!t.has(u))})).filter(l=>l.breakingChangeIds.length>0),a=new Set(s.map(l=>l.id)),c={...e,breakingChanges:i,impactSites:r,...o?{dispositions:o}:{},verification:n,planEdges:e.planEdges.filter(l=>a.has(l.from)&&a.has(l.to)),commits:s.map(l=>({...l,dependsOn:l.dependsOn.filter(u=>a.has(u)),dependencyReasons:l.dependencyReasons.filter(u=>a.has(u.from)&&a.has(u.to))}))};return xze(c)}function xze(e){let t=new Map;for(let s of e.rationale??[])for(let a of s.runtimeAnalyses??[])t.set(a.changeId,{changeId:a.changeId,runtime:a.runtime,requirement:a.requirement??"",state:a.state,reason:a.reason,declarations:[],unresolved:[],sites:e.impactSites.filter(c=>c.breakingChangeId===a.changeId),statement:a.statement??""});let n=[...t.values()].filter(s=>e.breakingChanges.some(a=>a.id===s.changeId)),i=Df(e.breakingChanges,e.impactSites,n,e.localizationRan??!0),r=(e.rationale??[]).map(s=>{let a=e.changes.find(d=>d.name===s.dependency)?.workspace,c=e.breakingChanges.filter(d=>d.dependency===s.dependency&&(a===void 0||d.workspace===a)),l=new Set(c.map(d=>d.id)),u=Vy({dependency:s.dependency,...a!==void 0?{workspace:a}:{},breakingChanges:c,impactSites:e.impactSites.filter(d=>l.has(d.breakingChangeId)),evidence:e.evidence,security:s.security,maintenance:s.maintenance,license:s.license,gaps:s.gaps,surfaceCompared:s.hasCompatibilityEvidence,runtimeAnalyses:n.filter(d=>l.has(d.changeId)),localizationRan:e.localizationRan??!0});return{...s,assessment:{...u,confidence:s.assessment.confidence,confidenceBasis:s.assessment.confidenceBasis}}}),o=x1(e.changes,e.breakingChanges,e.impactSites,r.map(s=>s.assessment.runtimeCompatibility),i);return{...e,dispositions:i,risk:o,...e.rationale?{rationale:r}:{}}}function Rne(e){if(e.length===0||e.every(o=>!o))return;let t=e.filter(o=>!!o),n=t.flatMap(o=>o.checks),i=t.filter(o=>o.status==="failed");if(i.length>0){let o=i.flatMap(c=>c.introducedDiagnostics??[]),s=[],a=new Set;for(let c of o){let l=`${c.file}|${c.line}|${c.column??""}|${c.code??""}`;a.has(l)||(a.add(l),s.push(c))}return{status:"failed",checks:n,diagnostics:i.map(c=>c.diagnostics).filter(c=>!!c).join(` -`),failedFiles:[...new Set(i.flatMap(c=>c.failedFiles))],...s.length>0?{introducedDiagnostics:s}:{}}}let r=e.filter(o=>!o||o.status==="skipped");return r.length>0?{status:"skipped",reason:[...new Set(r.map(s=>s?.reason??"One of these upgrades was not tested, and no reason was recorded."))].join(" "),checks:n,failedFiles:[]}:{status:"passed",checks:n,failedFiles:[]}}function Uy(e){let t=e.checks.filter(n=>n.status==="passed"||n.status==="failed").map(n=>`\`${n.label}\``);if(e.status==="passed"){let n=Fy(e)==="batch"?` (measured with ${e.measuredWith-1} other upgrade${e.measuredWith===2?"":"s"} from the same manifest installed alongside it)`:"";return t.length>0?`${t.join(", ")} ${t.length===1?"passes":"pass"} with this upgrade installed${n}.`:`This upgrade was installed and the project still checks out clean${n}.`}if(e.status==="failed"){let n=e.checks.filter(a=>a.status==="failed"),i=n.map(a=>`\`${a.label}\``),r=e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:"",o=`${i.join(", ")} fails with this upgrade installed${r} \u2014 measured, not predicted.`,s=n.map(a=>`$ ${a.label} +`),failedFiles:[...new Set(i.flatMap(c=>c.failedFiles))],...s.length>0?{introducedDiagnostics:s}:{}}}let r=e.filter(o=>!o||o.status==="skipped");return r.length>0?{status:"skipped",reason:[...new Set(r.map(s=>s?.reason??"One of these upgrades was not tested, and no reason was recorded."))].join(" "),checks:n,failedFiles:[]}:{status:"passed",checks:n,failedFiles:[]}}function Wy(e){let t=e.checks.filter(n=>n.status==="passed"||n.status==="failed").map(n=>`\`${n.label}\``);if(e.status==="passed"){let n=qy(e)==="batch"?` (measured with ${e.measuredWith-1} other upgrade${e.measuredWith===2?"":"s"} from the same manifest installed alongside it)`:"";return t.length>0?`${t.join(", ")} ${t.length===1?"passes":"pass"} with this upgrade installed${n}.`:`This upgrade was installed and the project still checks out clean${n}.`}if(e.status==="failed"){let n=e.checks.filter(a=>a.status==="failed"),i=n.map(a=>`\`${a.label}\``),r=e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:"",o=`${i.join(", ")} fails with this upgrade installed${r} \u2014 measured, not predicted.`,s=n.map(a=>`$ ${a.label} ${a.output.trim()||"(no output captured)"}`).join(` `);return s?`${o} -${s}`:o}return e.reason??"This upgrade was not tested."}var Tne={"no-incompatible-change-in-checked-surfaces":"No incompatible change detected in the surfaces that were checked","detected-not-locally-reachable":"Breaking change detected upstream \u2014 Drift could not establish whether this repository is affected; review before upgrading","locally-affected":"This repository is affected","insufficient-evidence":"Insufficient evidence to say","verification-incomplete":"Verification incomplete"};function Ine(e,t){return e==="locally-affected"&&t&&t.localImpact.band!=="high"?"This repository may be affected":Tne[e]}function Y1(e){let t=e.assessment;return!t||t.upstream.band==="none"||t.upstream.band==="low"?"insufficient-evidence":t.localImpact.band==="none"?Df([e])||t.localImpact.penalties.some(i=>i.code==="localization-unavailable"||i.code==="not-locally-checkable")?"verification-incomplete":"detected-not-locally-reachable":"locally-affected"}var xne=new Set(["no-incompatible-change-in-checked-surfaces"]);var vze=new Set(["no-incompatible-change-in-checked-surfaces","detected-not-locally-reachable"]);function wze(e,t,n){if(t){if(e.length>0)return e[0];let r=n.some(s=>s.surface==="api-surface"&&s.status==="checked"),o=n.some(s=>s.surface==="localization"&&s.status==="checked");return r&&o?"no-incompatible-change-in-checked-surfaces":"insufficient-evidence"}return["locally-affected","insufficient-evidence","verification-incomplete","detected-not-locally-reachable","no-incompatible-change-in-checked-surfaces"].find(r=>e.includes(r))??e[0]??"insufficient-evidence"}function kze(e){let t=e.breakingChanges.map(i=>Y1(i)),n=wze(t,e.breakingChanges.length===0,e.checkedSurfaces);return e.confirmedRegressions.length>0&&vze.has(n)?"locally-affected":(xne.has(n)||n==="detected-not-locally-reachable")&&!Sze(e)||xne.has(n)&&$ze(e)&&!_ze(e)?"insufficient-evidence":n}function $ze(e){return e.checkedSurfaces.some(t=>t.surface==="api-surface"&&t.status==="checked"&&(t.unruledChanges??0)>0)}function _ze(e){return e.verification?.status==="passed"&&(e.verification.checks??[]).some(t=>t.compileCapable&&t.status==="passed")}function Sze(e){let t=new Set(e.checkedSurfaces.filter(n=>n.surface==="api-surface"&&n.status==="checked").map(n=>Ene(n.dependency,n.ecosystem,n.workspace)));return e.changes.every(n=>t.has(Ene(n.name,n.ecosystem,n.workspace)))}function Ene(e,t,n){return cn({name:e??"",ecosystem:t,workspace:n})}var Q1="The project's own checks failed after this change was applied in ";function Lf(e){let t=kze(e);if(e.confirmedRegressions.length>0){let n=e.blockers.find(r=>r.startsWith(Q1)),i=e.impactSites.filter(r=>r.breakingChangeId.startsWith("measured:"));if(i.length>0){let r=i.slice(0,3).map(s=>`${s.file}:${s.line}`).join(", "),o=i.length>3?`, +${i.length-3} more`:"";return`Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, at ${r}${o}.`}return n?`Drift confirmed this repository is affected, even though static analysis found nothing to point at: ${n}`:"Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, even though static analysis found nothing to point at."}return t!=="locally-affected"&&e.blockers.length>0?`Could not establish whether this repository is affected: ${e.blockers[0]}`:Tne[t]}var xze={high:"\u{1F7E2}",medium:"\u{1F7E1}",low:"\u{1F7E0}",none:"\u26AA"};function Eze(e){return xze[e]??"\u26AA"}function J1(e){return`${Eze(e.band)} ${e.band} (${e.score.toFixed(2)})`}function Ane(e){return e>=.9?"very strong source":e>=.7?"strong source":e>=.5?"moderate source":e>=.3?"weak source":"very weak source"}function Tze(e){let t=DF(e);return`${t.score}/100 \u2014 ${t.label}`}function Rx(e){if(e.assessment){let t=DF(e.assessment);return{text:Tze(e.assessment),band:t.band,score:t.score,label:t.label}}return{text:"Confidence unavailable",band:"none",score:null,label:"Confidence unavailable"}}function Rne(e){return["| Dimension | Confidence | Why |","|---|---|---|",`| Upstream \u2014 did this change happen? | ${J1(e.upstream)} | ${Z1(e.upstream)} |`,`| Local impact \u2014 does it reach this repo? | ${J1(e.localImpact)} | ${Z1(e.localImpact)} |`,`| Verification \u2014 did anything run? | ${J1(e.verification)} | ${Z1(e.verification)} |`].join(` -`)}function Z1(e){let t=e.penalties[0];if(t)return Mf(t.detail);let n=[...e.evidence].sort((i,r)=>r.delta-i.delta)[0];return n?Mf(n.detail):"\u2014"}function Mf(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\n+/g," ")}function Nne(e){let t=Or(e),n=[`**Nature:** ${t.nature}`,`**Scope:** ${t.scope}`,`**Detectable at:** ${t.detectability.join(", ")}`,`**Reached via:** ${t.visibility.join(", ")}`],r=!t.detectability.some(o=>["manifest","link-or-import","compile-time","static-semantic"].includes(o))?` +${s}`:o}return e.reason??"This upgrade was not tested."}var Pne={"no-incompatible-change-in-checked-surfaces":"No incompatible change detected in the surfaces that were checked","detected-not-locally-reachable":"Breaking change detected upstream \u2014 Drift could not establish whether this repository is affected; review before upgrading","locally-affected":"This repository is affected","insufficient-evidence":"Insufficient evidence to say","verification-incomplete":"Verification incomplete"};function Dne(e,t){return e==="locally-affected"&&t&&t.localImpact.band!=="high"?"This repository may be affected":Pne[e]}function oU(e){let t=e.assessment;return!t||t.upstream.band==="none"||t.upstream.band==="low"?"insufficient-evidence":t.localImpact.band==="none"?Of([e])||t.localImpact.penalties.some(i=>i.code==="localization-unavailable"||i.code==="not-locally-checkable")?"verification-incomplete":"detected-not-locally-reachable":"locally-affected"}var Cne=new Set(["no-incompatible-change-in-checked-surfaces"]);var Eze=new Set(["no-incompatible-change-in-checked-surfaces","detected-not-locally-reachable"]);function Tze(e,t,n){if(t){if(e.length>0)return e[0];let r=n.some(s=>s.surface==="api-surface"&&s.status==="checked"),o=n.some(s=>s.surface==="localization"&&s.status==="checked");return r&&o?"no-incompatible-change-in-checked-surfaces":"insufficient-evidence"}return["locally-affected","insufficient-evidence","verification-incomplete","detected-not-locally-reachable","no-incompatible-change-in-checked-surfaces"].find(r=>e.includes(r))??e[0]??"insufficient-evidence"}function Ize(e){let t=e.breakingChanges.map(i=>oU(i)),n=Tze(t,e.breakingChanges.length===0,e.checkedSurfaces);return e.confirmedRegressions.length>0&&Eze.has(n)?"locally-affected":(Cne.has(n)||n==="detected-not-locally-reachable")&&!Cze(e)||Cne.has(n)&&Aze(e)&&!Rze(e)?"insufficient-evidence":n}function Aze(e){return e.checkedSurfaces.some(t=>t.surface==="api-surface"&&t.status==="checked"&&(t.unruledChanges??0)>0)}function Rze(e){return e.verification?.status==="passed"&&(e.verification.checks??[]).some(t=>t.compileCapable&&t.status==="passed")}function Cze(e){let t=new Set(e.checkedSurfaces.filter(n=>n.surface==="api-surface"&&n.status==="checked").map(n=>Nne(n.dependency,n.ecosystem,n.workspace)));return e.changes.every(n=>t.has(Nne(n.name,n.ecosystem,n.workspace)))}function Nne(e,t,n){return an({name:e??"",ecosystem:t,workspace:n})}var sU="The project's own checks failed after this change was applied in ";function Ff(e){let t=Ize(e);if(e.confirmedRegressions.length>0){let n=e.blockers.find(r=>r.startsWith(sU)),i=e.impactSites.filter(r=>r.breakingChangeId.startsWith("measured:"));if(i.length>0){let r=i.slice(0,3).map(s=>`${s.file}:${s.line}`).join(", "),o=i.length>3?`, +${i.length-3} more`:"";return`Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, at ${r}${o}.`}return n?`Drift confirmed this repository is affected, even though static analysis found nothing to point at: ${n}`:"Drift confirmed this repository is affected: the project's own checks passed before this change and failed after it, even though static analysis found nothing to point at."}return t!=="locally-affected"&&e.blockers.length>0?`Could not establish whether this repository is affected: ${e.blockers[0]}`:Pne[t]}var Nze={high:"\u{1F7E2}",medium:"\u{1F7E1}",low:"\u{1F7E0}",none:"\u26AA"};function Pze(e){return Nze[e]??"\u26AA"}function rU(e){return`${Pze(e.band)} ${e.band} (${e.score.toFixed(2)})`}function One(e){return e>=.9?"very strong source":e>=.7?"strong source":e>=.5?"moderate source":e>=.3?"weak source":"very weak source"}function Dze(e){let t=GF(e);return`${t.score}/100 \u2014 ${t.label}`}function Lx(e){if(e.assessment){let t=GF(e.assessment);return{text:Dze(e.assessment),band:t.band,score:t.score,label:t.label}}return{text:"Confidence unavailable",band:"none",score:null,label:"Confidence unavailable"}}function Mne(e){return["| Dimension | Confidence | Why |","|---|---|---|",`| Upstream \u2014 did this change happen? | ${rU(e.upstream)} | ${iU(e.upstream)} |`,`| Local impact \u2014 does it reach this repo? | ${rU(e.localImpact)} | ${iU(e.localImpact)} |`,`| Verification \u2014 did anything run? | ${rU(e.verification)} | ${iU(e.verification)} |`].join(` +`)}function iU(e){let t=e.penalties[0];if(t)return Lf(t.detail);let n=[...e.evidence].sort((i,r)=>r.delta-i.delta)[0];return n?Lf(n.detail):"\u2014"}function Lf(e){return e.replace(/\\/g,"\\\\").replace(/\|/g,"\\|").replace(/\n+/g," ")}function Lne(e){let t=Dr(e),n=[`**Nature:** ${t.nature}`,`**Scope:** ${t.scope}`,`**Detectable at:** ${t.detectability.join(", ")}`,`**Reached via:** ${t.visibility.join(", ")}`],r=!t.detectability.some(o=>["manifest","link-or-import","compile-time","static-semantic"].includes(o))?` -> This change is only observable when the code runs. Neither a compiler nor a source search can confirm whether this repository is affected.`:"";return`${n.join(" \xB7 ")}${r}`}function X1(e){if(e.length===0)return"";let t=["## What Drift could not check","","These are surfaces Drift did not establish. A limit of the tool is not a finding","about the upgrade \u2014 an absence here is not evidence that nothing is wrong.","","| Stage | Surface | Why it matters | What to do |","|---|---|---|---|"];for(let n of e){let i=n.automaticExecution==="blocks"?"**blocks automatic execution**":n.automaticExecution==="degrades"?"lowers confidence":"noted",r=n.dependency?`${n.surface} (\`${n.dependency}\`)`:n.surface;t.push(`| ${n.stage} | ${Mf(r)} | ${Mf(n.reason)} \u2014 ${i} | ${Mf(n.remediation)} |`)}return t.join(` -`)}function eU(e){if(e.checkedSurfaces.length===0)return"";let t=["## What Drift checked","","| Surface | Dependency | Result |","|---|---|---|"];for(let n of e.checkedSurfaces){let i=n.status==="checked"?"\u2705 checked":n.status==="skipped"?"\u23ED\uFE0F skipped":"\u26A0\uFE0F unavailable";t.push(`| ${n.surface} | ${n.dependency?`\`${n.dependency}\``:"\u2014"} | ${i} \u2014 ${Mf(n.detail)} |`)}return t.join(` -`)}function Cne(e){if(e.automaticExecutionEligible)return"**Automatic execution:** eligible \u2014 upstream evidence and local impact are both established.";let t=[];e.upstream.band!=="high"&&t.push("upstream evidence is not conclusive"),e.localImpact.band==="none"?t.push("no local impact was established"):e.localImpact.band==="low"&&t.push("local impact is weakly established");for(let n of e.gaps)n.automaticExecution==="blocks"&&t.push(n.surface);return`**Automatic execution:** not eligible \u2014 ${t.join("; ")||"insufficient evidence"}.`}async function jy(e){let{repo:t,config:n,logger:i,provider:r,githubToken:o,onProgress:s}=e,a=e.workspace??t.workspace,c=Date.now(),l=(fe,ae)=>{let be=Date.now();i.debug(`${fe} (+${be-c}ms): ${ae}`),c=be,s?.(fe,ae)};l("detect","Reading manifest changes");let u=await Lze(r,t,i);if(u.length===0)return tU("No dependency manifest changed in this range.");let d=a?await Ed(a,Hn()):[],p=a?(await Kk(a,Hn(),Td(d))).map(fe=>({kind:"undeclared-nested",ecosystem:fe.ecosystem,declaredIn:fe.manifestPath,members:[{dir:fe.dir,name:null,ecosystem:fe.ecosystem}]})):[],f=[...d,...p];if(f.length>0){let fe=new Map;for(let ae of f){let be=fe.get(ae.kind)??{layouts:0,members:0};fe.set(ae.kind,{layouts:be.layouts+1,members:be.members+ae.members.length})}i.info(`Workspace: ${[...fe].map(([ae,{layouts:be,members:Mt}])=>be===1?`${ae} (${Mt} member(s))`:`${ae} \xD7${be} (${Mt} member(s))`).join(", ")}`)}let m=nK(yH(u),f);if(m.length===0)return tU("Manifests changed, but no dependency versions moved.");let g=await XH(m,{logger:i});i.info(`Detected ${g.length} dependency change(s)`);let{actionable:h,skipped:b}=bH(g,n);for(let fe of b)i.info(` - ${fe.change.name}: skipped \u2014 ${fe.reason}`);if(h.length===0)return tU(g.length===1?"The 1 dependency change found doesn't match the analysis criteria in drift.yml (see reason above).":`None of the ${g.length} dependency changes found match the analysis criteria in drift.yml (see reasons above).`);l("triage",`${h.length} change(s) to analyse`),l("evidence",`Gathering evidence for ${h.map(fe=>fe.name).join(", ")}`);let y=new Map,w=new Map,k=new Map,_=new Set,S=new Map,x=[],E=await t5(h,{config:n,logger:i,githubToken:o,...e.env?{env:e.env}:{},readRepoFile:(fe,ae)=>r.readFile(fe,ae),...r.listFiles?{listRepoFiles:fe=>r.listFiles(fe)}:{},beforeSha:t.beforeSha,afterSha:t.afterSha,...a?{workspaceRoot:a}:{},onSurfaceComputed:(fe,ae)=>{let be=cn(fe);ae.weight>=.8&&_.add(be),ae.sourceIncompatibleCount&&S.set(be,ae.sourceIncompatibleCount),y.set(be,{additions:ae.additions??[],locator:ae.locator})},onUnavailableSurface:(fe,ae)=>w.set(cn(fe),ae),onProseConsulted:(fe,ae)=>{let be=cn(fe);k.set(be,[...k.get(be)??[],ae])},onSpecComputed:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"checked",detail:`${fe} was compared between the two commits by ${ae.tool}.`}),onUnavailableSpec:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"unavailable",detail:ae.remedy?`${ae.detail} ${ae.remedy}`:ae.detail})});i.info(`Gathered ${E.length} evidence record(s)`),l("analyze","Identifying breaking changes");let T=await BS(h,E,{config:n,logger:i});i.info(`Identified ${T.length} breaking change(s)`);let A=[],L=[],F=[],K=[],te=[],D,X,re=!!a,ie=new Map,ke=new Map,We=new Map,ye=new Map;if(a){let fe=Td(f),ae=await Ad(a,{members:fe});if(K=Tf(ae),te=If(ae),f.length>0&&(D=new Map(fe.map(be=>[be,Tf(ae,be,fe)])),X=new Map(fe.map(be=>[be,If(ae,be,fe)]))),T.some(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust")&&await qF([...Ef(ae,"rust",void 0,fe).resolved.map(be=>be.requirement),...T.flatMap(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust"&&be.runtime.requirement?[be.runtime.requirement]:[])]),T.length>0){l("localize","Searching for affected code");let be=_f(ae),Mt=await WS(h,{logger:i});for(let[_t,tt]of Mze(h)){let Gn=new Set(tt.map(Vn=>Vn.name)),tb=T.filter(Vn=>Gn.has(Vn.dependency)&&Vn.workspace===_t);if(tb.length===0)continue;let Ts=nx(tb,tt,be,ae,{logger:i,member:_t,members:fe,moduleMaps:Mt});A.push(...Ts.sites),L.push(...Ts.runtimeAnalyses);for(let Vn of Ts.diagnostics){let Go=F.find(fu=>fu.dependency===Vn.dependency&&fu.ecosystem===Vn.ecosystem);Go?(Go.importerCandidateFiles+=Vn.importerCandidateFiles,Go.changesSearched+=Vn.changesSearched,Go.sitesFound+=Vn.sitesFound):F.push({...Vn})}}i.info(`Found ${A.length} impact site(s)`);let vt=new Map;for(let _t of A){let tt=vt.get(_t.breakingChangeId);tt?tt.push(_t):vt.set(_t.breakingChangeId,[_t])}let sn=new Map(ae.map(_t=>[_t.path,_t.content])),oi=new Map(h.map(_t=>[`${_t.workspace??""}::${_t.name}`,_t])),so=[];for(let _t of T){let tt=vt.get(_t.id);if(!tt||tt.length===0)continue;let Gn=hee(_t,tt,sn);Gn?ie.set(_t.id,Gn):so.push(_t)}if(n.remediation.communityRecipes&&so.length>0){let _t=await qn(so,4,async tt=>{let Gn=oi.get(`${tt.workspace??""}::${tt.dependency}`);return[tt.id,await ite(tt,Gn)]});for(let[tt,Gn]of _t)Gn&&ke.set(tt,Gn)}if(so.length>0){l("plan","Resolving deterministic fix plans");let _t=await Oee({changes:so,sites:A,evidence:E,dependencyChanges:h,fileContents:sn,config:n,logger:i,cache:n.remediation.fixPlans.cache?r1()?See(r1()):Cy():Cy(),client:n.remediation.fixPlans.enabled&&n.llm.enabled?await RF(n,i)??void 0:void 0,proposeFromRecipe:n.remediation.communityRecipes&&a?tt=>Xee({change:tt,candidate:ke.get(tt.id),dependencyChange:oi.get(`${tt.workspace??""}::${tt.dependency}`),sites:A,workspace:a,headSha:t.afterSha,env:e.env,logger:i}):void 0});for(let[tt,Gn]of _t.accepted)We.set(tt,Gn);for(let[tt,Gn]of _t.rejected)ye.set(tt,Gn)}}}else T.length>0&&i.warn("No local checkout available; affected code cannot be located.");let xt=[],bt=[],pt=!1;if(n.verification.behavioural.enabled&&T.length>0&&A.length>0){l("verify","Probing dependency behaviour for reachable findings"),pt=!0;let fe=await Xte({config:n,breakingChanges:T,dependencyChanges:h,impactSites:A,resolveEnvironments:async ae=>{if(!ae.from||!ae.to)return null;let[be,Mt]=await Promise.all([P1("old",ae.name,ae.from),P1("new",ae.name,ae.to)]);return be&&Mt?{oldEnvironment:be,newEnvironment:Mt}:null}});for(let ae of fe.gaps)xt.push({stage:"verify",surface:"behavioural-diff",reason:ae,severity:"minor",automaticExecution:"none",remediation:"Behavioural probing is experimental; see `verification.behavioural` in drift.yml."});if(fe.evidence.length>0){E=[...E,...fe.evidence],T=T.map(be=>{let Mt=fe.citationsByChangeId.get(be.id);return Mt?.length?{...be,citations:[...be.citations,...Mt]}:be}),i.info(`Behavioural probing added ${fe.evidence.length} observation(s) of evidence`);let ae=new Map;for(let[be,Mt]of fe.citationsByChangeId)for(let vt of Mt){let sn=ae.get(vt);sn?sn.push(be):ae.set(vt,[be])}for(let be of fe.evidence){let Mt=be.findings?.[0]?.detail??"",vt=ene(Mt);bt.push({name:`behavioural:${be.dependency}`,command:"drift verify --behavioural (bounded differential probe)",status:vt==="probe-unavailable"?"unavailable":"passed",detail:Mt,dependency:be.dependency,workspace:be.workspace,breakingChangeIds:ae.get(be.id)??[]})}}}let ft=[...x];n.verification.behavioural.enabled&&ft.push({surface:"behavioural-diff",status:pt?"checked":"skipped",detail:pt?"Old and new dependency code were run against generated and observed inputs and compared.":"No breaking change had a local impact site to probe, so behavioural probing did not run."});for(let fe of h){let ae=cn(fe),be=E.filter(oi=>oi.dependency===fe.name&&oi.workspace===fe.workspace),Mt=w.get(ae),vt=_.has(ae)||be.some(oi=>oi.findings?.length);ft.push({surface:"api-surface",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:Mt?"unavailable":vt?"checked":"unavailable",...S.get(ae)?{unruledChanges:S.get(ae)}:{},detail:Mt?Mt.reason:vt?"A computed diff of the published API surface was produced.":"No computed API diff was available for this ecosystem or version pair."});let sn=k.get(ae)?.filter(oi=>oi.kind==="changelog"||oi.kind==="github-release");ft.push({surface:"release-notes",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:sn&&sn.length>0?"checked":"unavailable",detail:sn&&sn.length>0?`${sn.length} release note or changelog section(s) retrieved.`:"No changelog or release notes could be retrieved."})}ft.push({surface:"localization",status:re?"checked":"skipped",detail:re?`Searched the files importing each changed dependency; ${A.length} affected location(s).`:"No checkout was available, so this repository was not searched."});let Cn=tx(T,L);l("rationale","Weighing what each upgrade is worth");let Ci=await fx({changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Cn,localizationRan:re},{config:n,logger:i,githubToken:o,additions:y,surfaceCompared:_,surfaceGaps:w,prose:k,repoRuntime:K,pythonRuntime:te,repoRuntimeByWorkspace:D,pythonRuntimeByWorkspace:X});l("plan","Building the remediation plan");let zn=ux({repo:t,config:n,changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Cn,rationale:Ci,skipped:b,localizationRan:re,verification:bt,checkedSurfaces:ft,codemods:ie,recipes:ke,fixPlans:We});l("done","Analysis complete");let Pi=xt.length>0?{...zn,gaps:[...zn.gaps,...xt]}:zn;return{plan:Pi,summary:Pne(Pi),...re?{localizationDiagnostics:F}:{}}}function Pne(e){return e.commits.length>0?`${e.breakingChanges.length} breaking change(s), ${new Set(e.impactSites.map(t=>t.file)).size} file(s) affected`:Lf(e)}async function nU(e,t){if(!e.plan)return e;let n=t.workspace??t.repo.workspace,i=Date.now(),r=(s,a)=>{let c=Date.now();t.logger.debug(`${s} (+${c-i}ms): ${a}`),i=c,t.onProgress?.(s,a)},o=await Ize(e.plan,{...t,...n?{workspace:n}:{},progress:r});return o===e.plan?e:{plan:o,summary:Pne(o),...e.localizationDiagnostics?{localizationDiagnostics:e.localizationDiagnostics}:{}}}async function Ize(e,t){let{repo:n,config:i,workspace:r}=t;if(!i.verify.enabled||!r||e.changes.length===0)return e;let o=new Map;for(let p of e.changes){let f=p.workspace??"",m=o.get(f);m?m.push(p):o.set(f,[p])}let s=e,a=[],c=[],l=[],u=[];for(let[p,f]of o){let m=await Oze(r,p,f[0].ecosystem);if(!m)continue;t.progress("verify",`Installing the change in ${p||"the repository root"} and running ${i.verify.checks.join(", ")}`);let g=await $ne({workspace:r,dir:p,packageManager:m,afterSha:n.afterSha,...n.beforeSha?{beforeSha:n.beforeSha}:{},kinds:i.verify.checks,timeoutMs:i.verify.timeoutMs,...t.signal?{signal:t.signal,token:{get isCancellationRequested(){return t.signal.aborted}}}:{},...i.verify.generatedSourceGlobs.length>0?{allowedGlobs:i.verify.generatedSourceGlobs}:{},logger:t.logger,...t.env?{env:t.env}:{},onProgress:({phase:h,detail:b})=>t.progress("verify",`${h}: ${b}`)});if(t.logger.info(`Verification (${p||"root"}): ${Uy(g)}`),a.push(g),g.status==="failed"&&(c.push(p||"the repository root"),f.length===1)){let h=cn(f[0]);l.push(h);let b=await Pze(g.introducedDiagnostics??[],h,f[0].name,p,r);if(u.push(...b),b.length===0){let y=await Cze(r,f[0],h);y&&u.push(y)}}s=Ax(s,g,p)}let d=Sne(a);if(d&&(s=K1({...s,verification:d})),c.length>0&&(s={...s,blockers:[...s.blockers,`${Q1}${c.join(", ")}, which static analysis did not predict. See the verification output for what broke.`]}),l.length>0&&(s={...s,confirmedRegressions:[...s.confirmedRegressions,...l]}),u.length>0){let p=new Set(s.impactSites.map(m=>`${m.file}:${m.line}`)),f=u.filter(m=>!p.has(`${m.file}:${m.line}`));f.length>0&&(s={...s,impactSites:[...s.impactSites,...f]})}return s}var Aze=["","src/test/java/","src/main/java/","src/test/kotlin/","src/main/kotlin/","src/test/scala/","src/main/scala/"];async function Rze(e,t,n,i){for(let r of[t,...i])for(let o of Aze){let s=[r,o+n].filter(Boolean).join("/").replace(/\/{2,}/g,"/");try{if((await(0,Ff.stat)((0,Cx.join)(e,s))).isFile())return s}catch{}}}async function Nze(e,t,n){let i;try{i=await(0,Ff.readFile)((0,Cx.join)(e,t),"utf8")}catch{return}let o=(n.includes(":")?n.slice(n.indexOf(":")+1):n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=[new RegExp(`\\s*${o}\\s*`),new RegExp(`["'\`]${o}["'\`]\\s*[:=]`),new RegExp(`(^|\\s)${o}\\s*(==|>=|<=|~=|=|:|$)`)],a=i.split(` -`);for(let c of s){let l=a.findIndex(u=>c.test(u));if(l!==-1)return{line:l+1,excerpt:a[l].trim().slice(0,200)}}}async function Cze(e,t,n){let i=await Nze(e,t.manifestPath,t.name);if(i)return{breakingChangeId:`measured:${n}`,file:t.manifestPath,line:i.line,excerpt:i.excerpt,matchedSymbol:t.name,confidence:"high",siteKind:"manifest"}}async function Pze(e,t,n,i,r){let o=[],s=new Set,a,c=async()=>{if(a)return a;try{a=(await(0,Ff.readdir)(r,{withFileTypes:!0})).filter(u=>u.isDirectory()&&!u.name.startsWith(".")&&u.name!=="target").map(u=>u.name)}catch{a=[]}return a};for(let l of e){if(/(^|\/)(node_modules|\.venv|venv|site-packages|target\/|dist\/|build\/)/.test(l.file))continue;let u;if(l.origin==="stack-frame"){let p=await Rze(r,i,l.file,await c());if(!p)continue;u=p}else{let p=await Ste(r,i,l.file);if(!p)continue;u=p}let d=`${u}:${l.line}:${l.column??""}`;s.has(d)||(s.add(d),o.push({breakingChangeId:`measured:${t}`,file:u,line:l.line,...l.column!==void 0?{column:l.column}:{},excerpt:(l.code?`${l.code}: ${l.message}`:l.message).slice(0,200),matchedSymbol:l.code??Dze(l.message)??n,confidence:"high"}))}return o}function Dze(e){return/[`'"]([A-Za-z_$][\w$.]*)[`'"]/.exec(e)?.[1]}async function Oze(e,t,n){let i=Hn(),r=await i.readDirectory(t?(0,Cx.join)(e,t):e);if(r.length===0)return null;let o=da({entries:r}).filter(a=>a.manager.ecosystem===n),s=o.find(a=>a.fromLockfile);if(s)return s.manager.id;if(t){let a=await i.readDirectory(e),c=da({entries:a}).find(l=>l.manager.ecosystem===n&&l.fromLockfile);if(c)return c.manager.id}return o[0]?.manager.id??null}function Mze(e){let t=new Map;for(let n of e){let i=n.workspace,r=t.get(i)??[];r.push(n),t.set(i,r)}return[...t.entries()]}async function Lze(e,t,n){let r=(await e.changedFiles()).filter(hH);return r.length===0?[]:(n.debug(`Changed manifests: ${r.join(", ")}`),(await Promise.all(r.map(async s=>{let[a,c]=await Promise.all([e.readFile(s,t.beforeSha),e.readFile(s,t.afterSha)]);return{path:s,before:a,after:c}}))).filter(s=>s.before!==null||s.after!==null))}function tU(e){return{plan:null,summary:e}}var Fze={critical:"\u{1F534} critical",high:"\u{1F7E0} high",medium:"\u{1F7E1} medium",low:"\u{1F535} low",unknown:"\u26AA severity not stated"},Uze={high:"\u{1F7E2} High",medium:"\u{1F7E1} Medium",low:"\u{1F7E0} Low"},jze=8;function iU(e){let t=e.rationale??[];if(t.length===0)return"";let n=t.map(zze).filter(Boolean);return n.length===0?"":["## Upgrade assessment","",n.join(` +> This change is only observable when the code runs. Neither a compiler nor a source search can confirm whether this repository is affected.`:"";return`${n.join(" \xB7 ")}${r}`}function aU(e){if(e.length===0)return"";let t=["## What Drift could not check","","These are surfaces Drift did not establish. A limit of the tool is not a finding","about the upgrade \u2014 an absence here is not evidence that nothing is wrong.","","| Stage | Surface | Why it matters | What to do |","|---|---|---|---|"];for(let n of e){let i=n.automaticExecution==="blocks"?"**blocks automatic execution**":n.automaticExecution==="degrades"?"lowers confidence":"noted",r=n.dependency?`${n.surface} (\`${n.dependency}\`)`:n.surface;t.push(`| ${n.stage} | ${Lf(r)} | ${Lf(n.reason)} \u2014 ${i} | ${Lf(n.remediation)} |`)}return t.join(` +`)}function cU(e){if(e.checkedSurfaces.length===0)return"";let t=["## What Drift checked","","| Surface | Dependency | Result |","|---|---|---|"];for(let n of e.checkedSurfaces){let i=n.status==="checked"?"\u2705 checked":n.status==="skipped"?"\u23ED\uFE0F skipped":"\u26A0\uFE0F unavailable";t.push(`| ${n.surface} | ${n.dependency?`\`${n.dependency}\``:"\u2014"} | ${i} \u2014 ${Lf(n.detail)} |`)}return t.join(` +`)}function Fne(e){if(e.automaticExecutionEligible)return"**Automatic execution:** eligible \u2014 upstream evidence and local impact are both established.";let t=[];e.upstream.band!=="high"&&t.push("upstream evidence is not conclusive"),e.localImpact.band==="none"?t.push("no local impact was established"):e.localImpact.band==="low"&&t.push("local impact is weakly established");for(let n of e.gaps)n.automaticExecution==="blocks"&&t.push(n.surface);return`**Automatic execution:** not eligible \u2014 ${t.join("; ")||"insufficient evidence"}.`}async function Ky(e){let{repo:t,config:n,logger:i,provider:r,githubToken:o,onProgress:s}=e,a=e.workspace??t.workspace,c=Date.now(),l=(fe,ae)=>{let be=Date.now();i.debug(`${fe} (+${be-c}ms): ${ae}`),c=be,s?.(fe,ae)};l("detect","Reading manifest changes");let u=await Bze(r,t,i);if(u.length===0)return lU("No dependency manifest changed in this range.");let d=a?await Td(a,Wn()):[],p=a?(await t_(a,Wn(),Id(d))).map(fe=>({kind:"undeclared-nested",ecosystem:fe.ecosystem,declaredIn:fe.manifestPath,members:[{dir:fe.dir,name:null,ecosystem:fe.ecosystem}]})):[],f=[...d,...p];if(f.length>0){let fe=new Map;for(let ae of f){let be=fe.get(ae.kind)??{layouts:0,members:0};fe.set(ae.kind,{layouts:be.layouts+1,members:be.members+ae.members.length})}i.info(`Workspace: ${[...fe].map(([ae,{layouts:be,members:Mt}])=>be===1?`${ae} (${Mt} member(s))`:`${ae} \xD7${be} (${Mt} member(s))`).join(", ")}`)}let m=cH($K(u),f);if(m.length===0)return lU("Manifests changed, but no dependency versions moved.");let g=await oH(m,{logger:i});i.info(`Detected ${g.length} dependency change(s)`);let{actionable:h,skipped:b}=SK(g,n);for(let fe of b)i.info(` - ${fe.change.name}: skipped \u2014 ${fe.reason}`);if(h.length===0)return lU(g.length===1?"The 1 dependency change found doesn't match the analysis criteria in drift.yml (see reason above).":`None of the ${g.length} dependency changes found match the analysis criteria in drift.yml (see reasons above).`);l("triage",`${h.length} change(s) to analyse`),l("evidence",`Gathering evidence for ${h.map(fe=>fe.name).join(", ")}`);let y=new Map,w=new Map,k=new Map,$=new Set,S=new Map,x=[],E=await a5(h,{config:n,logger:i,githubToken:o,...e.env?{env:e.env}:{},readRepoFile:(fe,ae)=>r.readFile(fe,ae),...r.listFiles?{listRepoFiles:fe=>r.listFiles(fe)}:{},beforeSha:t.beforeSha,afterSha:t.afterSha,...a?{workspaceRoot:a}:{},onSurfaceComputed:(fe,ae)=>{let be=an(fe);ae.weight>=.8&&$.add(be),ae.sourceIncompatibleCount&&S.set(be,ae.sourceIncompatibleCount),y.set(be,{additions:ae.additions??[],locator:ae.locator})},onUnavailableSurface:(fe,ae)=>w.set(an(fe),ae),onProseConsulted:(fe,ae)=>{let be=an(fe);k.set(be,[...k.get(be)??[],ae])},onSpecComputed:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"checked",detail:`${fe} was compared between the two commits by ${ae.tool}.`}),onUnavailableSpec:(fe,ae)=>x.push({surface:"contract-document",dependency:fe,status:"unavailable",detail:ae.remedy?`${ae.detail} ${ae.remedy}`:ae.detail})});i.info(`Gathered ${E.length} evidence record(s)`),l("analyze","Identifying breaking changes");let T=await YS(h,E,{config:n,logger:i});i.info(`Identified ${T.length} breaking change(s)`);let A=[],L=[],F=[],H=[],te=[],D,X,re=!!a,ie=new Map,ke=new Map,We=new Map,ye=new Map;if(a){let fe=Id(f),ae=await Rd(a,{members:fe});if(H=If(ae),te=Af(ae),f.length>0&&(D=new Map(fe.map(be=>[be,If(ae,be,fe)])),X=new Map(fe.map(be=>[be,Af(ae,be,fe)]))),T.some(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust")&&await XF([...Tf(ae,"rust",void 0,fe).resolved.map(be=>be.requirement),...T.flatMap(be=>be.kind==="runtime-requirement"&&be.runtime?.runtime==="rust"&&be.runtime.requirement?[be.runtime.requirement]:[])]),T.length>0){l("localize","Searching for affected code");let be=Sf(ae),Mt=await XS(h,{logger:i});for(let[$t,tt]of Vze(h)){let zn=new Set(tt.map(Gn=>Gn.name)),cb=T.filter(Gn=>zn.has(Gn.dependency)&&Gn.workspace===$t);if(cb.length===0)continue;let Ts=lx(cb,tt,be,ae,{logger:i,member:$t,members:fe,moduleMaps:Mt});A.push(...Ts.sites),L.push(...Ts.runtimeAnalyses);for(let Gn of Ts.diagnostics){let Go=F.find(gu=>gu.dependency===Gn.dependency&&gu.ecosystem===Gn.ecosystem);Go?(Go.importerCandidateFiles+=Gn.importerCandidateFiles,Go.changesSearched+=Gn.changesSearched,Go.sitesFound+=Gn.sitesFound):F.push({...Gn})}}i.info(`Found ${A.length} impact site(s)`);let vt=new Map;for(let $t of A){let tt=vt.get($t.breakingChangeId);tt?tt.push($t):vt.set($t.breakingChangeId,[$t])}let on=new Map(ae.map($t=>[$t.path,$t.content])),ii=new Map(h.map($t=>[`${$t.workspace??""}::${$t.name}`,$t])),so=[];for(let $t of T){let tt=vt.get($t.id);if(!tt||tt.length===0)continue;let zn=_ee($t,tt,on);zn?ie.set($t.id,zn):so.push($t)}if(n.remediation.communityRecipes&&so.length>0){let $t=await Bn(so,4,async tt=>{let zn=ii.get(`${tt.workspace??""}::${tt.dependency}`);return[tt.id,await ute(tt,zn)]});for(let[tt,zn]of $t)zn&&ke.set(tt,zn)}if(so.length>0){l("plan","Resolving deterministic fix plans");let $t=await zee({changes:so,sites:A,evidence:E,dependencyChanges:h,fileContents:on,config:n,logger:i,cache:n.remediation.fixPlans.cache?d1()?Ree(d1()):Uy():Uy(),client:n.remediation.fixPlans.enabled&&n.llm.enabled?await FF(n,i)??void 0:void 0,proposeFromRecipe:n.remediation.communityRecipes&&a?tt=>ote({change:tt,candidate:ke.get(tt.id),dependencyChange:ii.get(`${tt.workspace??""}::${tt.dependency}`),sites:A,workspace:a,headSha:t.afterSha,env:e.env,logger:i}):void 0});for(let[tt,zn]of $t.accepted)We.set(tt,zn);for(let[tt,zn]of $t.rejected)ye.set(tt,zn)}}}else T.length>0&&i.warn("No local checkout available; affected code cannot be located.");let xt=[],bt=[],pt=!1;if(n.verification.behavioural.enabled&&T.length>0&&A.length>0){l("verify","Probing dependency behaviour for reachable findings"),pt=!0;let fe=await one({config:n,breakingChanges:T,dependencyChanges:h,impactSites:A,resolveEnvironments:async ae=>{if(!ae.from||!ae.to)return null;let[be,Mt]=await Promise.all([z1("old",ae.name,ae.from),z1("new",ae.name,ae.to)]);return be&&Mt?{oldEnvironment:be,newEnvironment:Mt}:null}});for(let ae of fe.gaps)xt.push({stage:"verify",surface:"behavioural-diff",reason:ae,severity:"minor",automaticExecution:"none",remediation:"Behavioural probing is experimental; see `verification.behavioural` in drift.yml."});if(fe.evidence.length>0){E=[...E,...fe.evidence],T=T.map(be=>{let Mt=fe.citationsByChangeId.get(be.id);return Mt?.length?{...be,citations:[...be.citations,...Mt]}:be}),i.info(`Behavioural probing added ${fe.evidence.length} observation(s) of evidence`);let ae=new Map;for(let[be,Mt]of fe.citationsByChangeId)for(let vt of Mt){let on=ae.get(vt);on?on.push(be):ae.set(vt,[be])}for(let be of fe.evidence){let Mt=be.findings?.[0]?.detail??"",vt=sne(Mt);bt.push({name:`behavioural:${be.dependency}`,command:"drift verify --behavioural (bounded differential probe)",status:vt==="probe-unavailable"?"unavailable":"passed",detail:Mt,dependency:be.dependency,workspace:be.workspace,breakingChangeIds:ae.get(be.id)??[]})}}}let ft=[...x];n.verification.behavioural.enabled&&ft.push({surface:"behavioural-diff",status:pt?"checked":"skipped",detail:pt?"Old and new dependency code were run against generated and observed inputs and compared.":"No breaking change had a local impact site to probe, so behavioural probing did not run."});for(let fe of h){let ae=an(fe),be=E.filter(ii=>ii.dependency===fe.name&&ii.workspace===fe.workspace),Mt=w.get(ae),vt=$.has(ae)||be.some(ii=>ii.findings?.length);ft.push({surface:"api-surface",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:Mt?"unavailable":vt?"checked":"unavailable",...S.get(ae)?{unruledChanges:S.get(ae)}:{},detail:Mt?Mt.reason:vt?"A computed diff of the published API surface was produced.":"No computed API diff was available for this ecosystem or version pair."});let on=k.get(ae)?.filter(ii=>ii.kind==="changelog"||ii.kind==="github-release");ft.push({surface:"release-notes",dependency:fe.name,ecosystem:fe.ecosystem,workspace:fe.workspace,status:on&&on.length>0?"checked":"unavailable",detail:on&&on.length>0?`${on.length} release note or changelog section(s) retrieved.`:"No changelog or release notes could be retrieved."})}ft.push({surface:"localization",status:re?"checked":"skipped",detail:re?`Searched the files importing each changed dependency; ${A.length} affected location(s).`:"No checkout was available, so this repository was not searched."});let Rn=cx(T,L);l("rationale","Weighing what each upgrade is worth");let Ni=await wx({changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Rn,localizationRan:re},{config:n,logger:i,githubToken:o,additions:y,surfaceCompared:$,surfaceGaps:w,prose:k,repoRuntime:H,pythonRuntime:te,repoRuntimeByWorkspace:D,pythonRuntimeByWorkspace:X});l("plan","Building the remediation plan");let jn=yx({repo:t,config:n,changes:h,evidence:E,breakingChanges:T,impactSites:A,runtimeAnalyses:Rn,rationale:Ni,skipped:b,localizationRan:re,verification:bt,checkedSurfaces:ft,codemods:ie,recipes:ke,fixPlans:We});l("done","Analysis complete");let Pi=xt.length>0?{...jn,gaps:[...jn.gaps,...xt]}:jn;return{plan:Pi,summary:Une(Pi),...re?{localizationDiagnostics:F}:{}}}function Une(e){return e.commits.length>0?`${e.breakingChanges.length} breaking change(s), ${new Set(e.impactSites.map(t=>t.file)).size} file(s) affected`:Ff(e)}async function uU(e,t){if(!e.plan)return e;let n=t.workspace??t.repo.workspace,i=Date.now(),r=(s,a)=>{let c=Date.now();t.logger.debug(`${s} (+${c-i}ms): ${a}`),i=c,t.onProgress?.(s,a)},o=await Oze(e.plan,{...t,...n?{workspace:n}:{},progress:r});return o===e.plan?e:{plan:o,summary:Une(o),...e.localizationDiagnostics?{localizationDiagnostics:e.localizationDiagnostics}:{}}}async function Oze(e,t){let{repo:n,config:i,workspace:r}=t;if(!i.verify.enabled||!r||e.changes.length===0)return e;let o=new Map;for(let p of e.changes){let f=p.workspace??"",m=o.get(f);m?m.push(p):o.set(f,[p])}let s=e,a=[],c=[],l=[],u=[];for(let[p,f]of o){let m=await Gze(r,p,f[0].ecosystem);if(!m)continue;t.progress("verify",`Installing the change in ${p||"the repository root"} and running ${i.verify.checks.join(", ")}`);let g=await Ine({workspace:r,dir:p,packageManager:m,afterSha:n.afterSha,...n.beforeSha?{beforeSha:n.beforeSha}:{},kinds:i.verify.checks,timeoutMs:i.verify.timeoutMs,...t.signal?{signal:t.signal,token:{get isCancellationRequested(){return t.signal.aborted}}}:{},...i.verify.generatedSourceGlobs.length>0?{allowedGlobs:i.verify.generatedSourceGlobs}:{},logger:t.logger,...t.env?{env:t.env}:{},onProgress:({phase:h,detail:b})=>t.progress("verify",`${h}: ${b}`)});if(t.logger.info(`Verification (${p||"root"}): ${Wy(g)}`),a.push(g),g.status==="failed"&&(c.push(p||"the repository root"),f.length===1)){let h=an(f[0]);l.push(h);let b=await jze(g.introducedDiagnostics??[],h,f[0].name,p,r);if(u.push(...b),b.length===0){let y=await Uze(r,f[0],h);y&&u.push(y)}}s=Mx(s,g,p)}let d=Rne(a);if(d&&(s=nU({...s,verification:d})),c.length>0&&(s={...s,blockers:[...s.blockers,`${sU}${c.join(", ")}, which static analysis did not predict. See the verification output for what broke.`]}),l.length>0&&(s={...s,confirmedRegressions:[...s.confirmedRegressions,...l]}),u.length>0){let p=new Set(s.impactSites.map(m=>`${m.file}:${m.line}`)),f=u.filter(m=>!p.has(`${m.file}:${m.line}`));f.length>0&&(s={...s,impactSites:[...s.impactSites,...f]})}return s}var Mze=["","src/test/java/","src/main/java/","src/test/kotlin/","src/main/kotlin/","src/test/scala/","src/main/scala/"];async function Lze(e,t,n,i){for(let r of[t,...i])for(let o of Mze){let s=[r,o+n].filter(Boolean).join("/").replace(/\/{2,}/g,"/");try{if((await(0,Uf.stat)((0,Ux.join)(e,s))).isFile())return s}catch{}}}async function Fze(e,t,n){let i;try{i=await(0,Uf.readFile)((0,Ux.join)(e,t),"utf8")}catch{return}let o=(n.includes(":")?n.slice(n.indexOf(":")+1):n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=[new RegExp(`\\s*${o}\\s*`),new RegExp(`["'\`]${o}["'\`]\\s*[:=]`),new RegExp(`(^|\\s)${o}\\s*(==|>=|<=|~=|=|:|$)`)],a=i.split(` +`);for(let c of s){let l=a.findIndex(u=>c.test(u));if(l!==-1)return{line:l+1,excerpt:a[l].trim().slice(0,200)}}}async function Uze(e,t,n){let i=await Fze(e,t.manifestPath,t.name);if(i)return{breakingChangeId:`measured:${n}`,file:t.manifestPath,line:i.line,excerpt:i.excerpt,matchedSymbol:t.name,confidence:"high",siteKind:"manifest"}}async function jze(e,t,n,i,r){let o=[],s=new Set,a,c=async()=>{if(a)return a;try{a=(await(0,Uf.readdir)(r,{withFileTypes:!0})).filter(u=>u.isDirectory()&&!u.name.startsWith(".")&&u.name!=="target").map(u=>u.name)}catch{a=[]}return a};for(let l of e){if(/(^|\/)(node_modules|\.venv|venv|site-packages|target\/|dist\/|build\/)/.test(l.file))continue;let u;if(l.origin==="stack-frame"){let p=await Lze(r,i,l.file,await c());if(!p)continue;u=p}else{let p=await Rte(r,i,l.file);if(!p)continue;u=p}let d=`${u}:${l.line}:${l.column??""}`;s.has(d)||(s.add(d),o.push({breakingChangeId:`measured:${t}`,file:u,line:l.line,...l.column!==void 0?{column:l.column}:{},excerpt:(l.code?`${l.code}: ${l.message}`:l.message).slice(0,200),matchedSymbol:l.code??zze(l.message)??n,confidence:"high"}))}return o}function zze(e){return/[`'"]([A-Za-z_$][\w$.]*)[`'"]/.exec(e)?.[1]}async function Gze(e,t,n){let i=Wn(),r=await i.readDirectory(t?(0,Ux.join)(e,t):e);if(r.length===0)return null;let o=da({entries:r}).filter(a=>a.manager.ecosystem===n),s=o.find(a=>a.fromLockfile);if(s)return s.manager.id;if(t){let a=await i.readDirectory(e),c=da({entries:a}).find(l=>l.manager.ecosystem===n&&l.fromLockfile);if(c)return c.manager.id}return o[0]?.manager.id??null}function Vze(e){let t=new Map;for(let n of e){let i=n.workspace,r=t.get(i)??[];r.push(n),t.set(i,r)}return[...t.entries()]}async function Bze(e,t,n){let r=(await e.changedFiles()).filter(_K);return r.length===0?[]:(n.debug(`Changed manifests: ${r.join(", ")}`),(await Promise.all(r.map(async s=>{let[a,c]=await Promise.all([e.readFile(s,t.beforeSha),e.readFile(s,t.afterSha)]);return{path:s,before:a,after:c}}))).filter(s=>s.before!==null||s.after!==null))}function lU(e){return{plan:null,summary:e}}var qze={critical:"\u{1F534} critical",high:"\u{1F7E0} high",medium:"\u{1F7E1} medium",low:"\u{1F535} low",unknown:"\u26AA severity not stated"},Wze={high:"\u{1F7E2} High",medium:"\u{1F7E1} Medium",low:"\u{1F7E0} Low"},Kze=8;function pU(e){let t=e.rationale??[];if(t.length===0)return"";let n=t.map(Hze).filter(Boolean);return n.length===0?"":["## Upgrade assessment","",n.join(` --- `)].join(` -`)}function zze(e){let t=[`### \`${e.dependency}\` ${e.from} \u2192 ${e.to}`,"",`**Recommendation: ${ru[e.assessment.recommendation]}**`,""],n=Gze(e.security);n&&t.push(n,"");let i=Vze(e.maintenance);if(i&&t.push(i,""),e.improvements.length>0){t.push("**Other improvements**","");for(let s of e.improvements)t.push(`- ${s.statement}${s.url?` ([source](${s.url}))`:""}`);t.push("")}let r=Bze(e.license);r&&t.push(r,"");let o=qze(e.summary);if(o&&t.push(o,""),t.push(`**Evidence confidence:** ${Uze[e.assessment.confidence]} \u2014 ${e.assessment.confidenceBasis}`,""),e.assessment.reasons.length>0){t.push("
Why Drift concluded this","");for(let s of e.assessment.reasons)t.push(`- ${s}`);t.push("","
")}return t.join(` -`).trim()}function Gze(e){if(!e.checked)return`**Security** - -${e.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."}`;let t=["**Security**",""];return e.resolved.length>0&&(t.push(`Upgrading resolves ${zy(e.resolved.length,"known vulnerability","known vulnerabilities")}:`),t.push(...rU(e.resolved)),t.push("")),e.introduced.length>0&&(t.push(`The target version is affected by ${zy(e.introduced.length,"advisory","advisories")} that ${e.introduced.length===1?"does":"do"} not affect the installed version:`),t.push(...rU(e.introduced)),t.push("")),e.carried.length>0&&(t.push(`${zy(e.carried.length,"advisory affects","advisories affect")} both versions and ${e.carried.length===1?"is":"are"} not addressed by this upgrade:`),t.push(...rU(e.carried)),t.push("")),e.target.length===0&&t.push("No known vulnerabilities were found for the target version."),t.join(` -`).trim()}function rU(e){let t=e.slice(0,jze),n=t.map(i=>{let r=i.aliases.find(a=>a.startsWith("CVE-")),o=r&&r!==i.id?`${i.id} (${r})`:i.id,s=i.fixedIn?` \u2014 first fixed in ${i.fixedIn}`:" \u2014 no fixed version published";return`- [${o}](${i.url}) \u2014 ${Fze[i.severity]}${s}. ${i.summary}`});return e.length>t.length&&n.push(`- \u2026and ${e.length-t.length} more.`),n}function Vze(e){return e.facts.length===0?"":["**Maintenance**","",...[...e.facts].sort((n,i)=>Number(i.concerning??!1)-Number(n.concerning??!1)).map(n=>`- ${n.statement}${n.url?` ([source](${n.url}))`:""}`)].join(` -`)}function Bze(e){if(e.verdict==="ok"||e.verdict==="changed")return"";let n=[e.verdict==="policy-violation"?"**License review required**":"**License**","",e.statement],i=e.introduced.filter(r=>!r.allowed);if(i.length>0){n.push("","Newly introduced dependencies of this package:");for(let r of i)n.push(`- \`${r.name}\` \u2014 ${r.license??"no declared license"}`);n.push("","This covers the dependencies this package itself declares. Drift does not resolve the full transitive graph during analysis.")}return n.push("","_Drift reports what the metadata says and how it compares to your configured policy. It does not give legal advice._"),n.join(` -`)}function qze(e){if(e.changes.length===0)return"";let t=[["Breaking changes",e.changes.filter(i=>i.category==="breaking")],["Security",e.changes.filter(i=>i.category==="security")],["Improvements",e.changes.filter(i=>i.category==="performance"||i.category==="improvement")],["Fixes",e.changes.filter(i=>i.category==="fix")]],n=["
What changed upstream",""];for(let[i,r]of t)if(r.length!==0){n.push(`**${i}**`,"");for(let o of r){let s=o.affectedSites!==void 0?` Drift found ${zy(o.affectedSites,"affected call","affected calls")} in this repository.`:"";n.push(`- ${o.text}${s}${o.url?` ([source](${o.url}))`:""}`)}n.push("")}return e.unrelated>0&&n.push("**Unrelated changes**","",`- ${zy(e.unrelated,"further change","further changes")} were read and judged not to concern this repository.`,""),n.push("
"),n.join(` -`)}function zy(e,t,n){return`${e} ${e===1?t:n}`}var Wze=["drift-schema","drift-plan","drift-plan-digest","drift-commit","drift-base-branch"],Hze=/^[ \t]*[ \t]*$/gm,Kze=/^[0-9a-f]{40}$/,Jze=/^plan_[0-9a-f]{10}$/,Zze=/^[0-9a-f]{64}$/;function Yze(e){return!(!e||e.length>255||/[\x00-\x20~^:?*[\\]/.test(e)||e.includes("..")||e.includes("@{")||e.startsWith("/")||e.endsWith("/")||e.includes("//")||e.startsWith("-")||e.startsWith(".")||e.endsWith(".")||e.endsWith(".lock"))}function Dne(e){return[``,``,``,``,``].join(` -`)}function One(e){if(!e)return{ok:!1,reason:"the issue has no body"};let t=new Map;for(let l of e.matchAll(Hze)){let u=l[1],d=(l[2]??"").trim(),p=t.get(u);p?p.push(d):t.set(u,[d])}if(t.size===0)return{ok:!1,reason:"the issue has no Drift plan footer, so it is not a Drift approval issue"};for(let l of Wze){let u=t.get(l);if(!u)return{ok:!1,reason:`the plan footer is missing \`${l}\``};if(u.length>1)return{ok:!1,reason:`the plan footer declares \`${l}\` ${u.length} times; a Drift issue declares each key exactly once`};if(u[0]==="")return{ok:!1,reason:`the plan footer has an empty \`${l}\``}}let n=l=>t.get(l)[0],i=n("drift-schema");if(!/^\d+$/.test(i))return{ok:!1,reason:`\`drift-schema\` must be an integer, not \`${oU(i)}\``};let r=Number(i);if(!h1.includes(r))return{ok:!1,reason:`this issue records plan schema v${r}, which this version of Drift cannot verify (it supports v${h1.join(", v")}). Re-run Drift to generate a current plan.`};let o=n("drift-plan");if(!Jze.test(o))return{ok:!1,reason:`\`drift-plan\` is not a Drift plan id: \`${oU(o)}\``};let s=n("drift-plan-digest");if(!Zze.test(s))return{ok:!1,reason:"`drift-plan-digest` is not a 64-character SHA-256 digest"};let a=n("drift-commit");if(!Kze.test(a))return{ok:!1,reason:"`drift-commit` must be a full 40-character commit SHA; an abbreviated SHA does not name one commit unambiguously"};let c=n("drift-base-branch");return Yze(c)?{ok:!0,metadata:{schemaVersion:r,planId:o,planDigest:s,headSha:a,baseBranch:c}}:{ok:!1,reason:`\`drift-base-branch\` is not a valid branch name: \`${oU(c)}\``}}function Mne(e){let t=[``,``];return e.taskId&&t.push(``),e.pullRequestNumber!==void 0&&t.push(``),t.join(` -`)}function Lne(e,t){for(let n of e){if(!n.authorIsDrift||!n.body)continue;let i=//.exec(n.body)?.[1];if(i!==t)continue;let r=//.exec(n.body)?.[1]?.trim(),o=//.exec(n.body)?.[1]?.trim(),s=//.exec(n.body)?.[1];return{planDigest:i,...r?{branchName:r}:{},...o?{taskId:o}:{},...s?{pullRequestNumber:Number(s)}:{}}}return null}function oU(e){let t=e.replace(/[`\r\n]/g," ").trim();return t.length<=40?t:`${t.slice(0,40)}\u2026`}var hU=require("node:crypto");var kr=require("node:path");var Vne=require("node:fs"),zo=require("node:fs/promises"),Bne=require("node:child_process"),qne=require("node:util");function Qze(e){return e.verification?e.verification.status==="passed"?"passed":e.verification.status==="failed"?"failed":"skipped":"not-run"}function Gy(e){if(e.status==="pending")return"pending";if(e.status==="error")return"error";let t=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial";if((e.actionableImpactCount??(t?e.runtimeDeclarationSiteCount!==void 0?Math.max(0,e.impactCount-e.runtimeDeclarationSiteCount):e.impactConfidence==="high"?e.impactCount:0:e.impactConfidence==="low"||e.impactConfidence==="medium"?0:e.impactCount))>0)return"affected";if(e.verification?.status==="failed")return"verification-failed";let i=t?e.runtimeDeclarationSiteCount:0;if((i===void 0?t?0:e.impactCount:Math.max(0,e.impactCount-i))>0)return"review-required";if(e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial")return"runtime-unresolved";let o=e.runtimeAnalyses?.length??0,s=Math.max(0,e.breakingCount-o);return s>0&&(e.sourceCoverage?.localizationComplete===!1||e.sourceCoverage?.sourceTruncated)?"localization-incomplete":s>0?e.verifiedUnaffected===!0?"upstream-only":"review-required":e.breakingCount>0?"upstream-only":e.recommendation==="insufficient-evidence"?"evidence-missing":e.recommendation?"clean":e.gaps&&e.gaps.length>0?"evidence-missing":"clean"}function Une(e){let t=Qze(e),n=t==="not-run"?" \u2014 not deeply verified":t==="skipped"?" \u2014 deep verification did not complete":"",i=eGe(e);switch(Gy(e)){case"pending":return"Not checked yet";case"error":return"Could not check";case"affected":{let r=e.actionableImpactCount!==void 0,o=e.actionableImpactFiles??e.impactFiles,s=e.actionableImpactCount??e.impactCount,a=r?"actionable site":"site",c=e.impactConfidence&&e.impactConfidence!=="high"||e.runtimeCompatibility==="partial"?"May affect":"Affects",l=e.impactPendingIsolatedClearance?" \u2014 not yet confirmed alone: a batch check passed without testing this package in isolation":"",u=t==="failed"?" \u2014 and its own checks fail with this installed, measured not predicted":n,d=i?` \xB7 ${i}`:"";return`${c} your code \xB7 ${s} ${a}${s===1?"":"s"} in ${o} file${o===1?"":"s"}${d}${l}${u}`}case"verification-failed":{let r=(e.verification?.checks??[]).filter(o=>o.status==="failed").map(o=>o.label);return r.length>0?`Verified breaking \xB7 ${r.join(", ")} failed with this upgrade installed \u2014 measured, not predicted`:"Verified breaking \xB7 this upgrade broke the project's own checks \u2014 measured, not predicted"}case"upstream-only":{let r=`${e.breakingCount} upstream change${e.breakingCount===1?"":"s"}, none used here`;return e.verifiedUnaffected===!0?`Verified safe \xB7 ${r}, and your own checks pass`:`Safe for your code \xB7 ${r}`}case"review-required":{let r=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial"?e.runtimeDeclarationSiteCount??0:0;if(e.impactCount-r<=0){let a=e.breakingCount;return`Review Required \xB7 ${a} breaking change${a===1?"":"s"} upstream; Drift found no usage in this repository but could not prove none \u2014 verify before upgrading`+(i?` \xB7 ${i}`:"")}let o=Math.max(1,e.impactCount-r),s=i?` \xB7 ${i}`:"";return e.impactConfidence==="low"||e.impactConfidence==="medium"?`May affect your code \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm \u2014 Review required; check before upgrading${s}`:`Review Required \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm${s}`}case"runtime-unresolved":return i?`Runtime Unknown \xB7 ${i}`:"Runtime Unknown \xB7 Drift could not resolve this repository\u2019s runtime compatibility";case"localization-incomplete":return"Localization Incomplete \xB7 Drift searched the indexed source subset, but the file limit prevented proving the breaking API is unused";case"evidence-missing":return"Evidence Missing \xB7 Drift could not obtain enough upstream evidence to decide";case"clean":{let r=e.recommendation==="upgrade-recommended";return t==="passed"?r?"Verified worth taking \xB7 no breaking changes, it improves on what you have, and your own checks pass":"Verified safe \xB7 no breaking changes found, and your own checks pass":r?`Worth taking \xB7 no breaking changes, and it improves on what you have${n}`:`Safe for your code \xB7 no breaking changes found${n}`}}}function Fne(e){return{affected:0,"verification-failed":1,error:2,"review-required":3,"runtime-unresolved":4,"localization-incomplete":5,"evidence-missing":6,"upstream-only":7,pending:8,clean:9}[e]}function Xze(e,t){return Fne(e)-Fne(t)}function jne(e,t){return Xze(Gy(e),Gy(t))}function eGe(e){if(e.runtimeCompatibility!=="unknown"&&e.runtimeCompatibility!=="partial")return;let t=e.runtimeAnalyses?.find(i=>i.state==="unknown"||i.state==="partial");if(t?.statement)return t.statement;if(t?.reason==="config-incomplete")return"Drift could not index every authoritative runtime configuration file";let n=e.runtimeDeclarationSiteCount??0;return n>0?`${n} runtime declaration${n===1?"":"s"} to review`:"Drift could not resolve this repository\u2019s runtime compatibility"}function sU(e,t){return Te(e,t)}function ac(e,t){return Qe(e,t)??0}function Px(e){switch(e){case"npm":return"the npm registry";case"pypi":return"PyPI";case"cargo":return"crates.io";case"go":return"the Go module proxy";case"maven":return"Maven Central";case"rubygems":return"RubyGems";case"nuget":return"NuGet";case"packagist":return"Packagist";case"hex":return"Hex";case"pub":return"pub.dev";case"cocoapods":return"CocoaPods Trunk";case"conan":return"ConanCenter";case"vcpkg":return"the vcpkg registry";case"arduino":return"the Arduino Library Manager";case"swift":return"the package\u2019s git tags";case"opam":return"the opam repository"}}async function zne(e){try{return await tGe(e)}catch(t){return{outcome:"unchecked",reason:`Checking ${Px(e.ecosystem)} for ${e.name} failed: ${t.message}`}}}async function tGe(e){let{name:t,ecosystem:n,current:i,range:r}=e,o=Px(n),s=sU(i,n);if(!s)return{outcome:"unchecked",reason:`${t} is installed at \u201C${i}\u201D, which Drift cannot compare against published versions.`};let a=await cU(e);if(!a)return{outcome:"unchecked",reason:`Drift could not reach ${o} for ${t}.`};if(a.complete===!1)return{outcome:"unchecked",reason:`Drift could not enumerate all of ${o} for ${t}, so it cannot establish whether a newer compatible version exists.`};if(a.versions.length===0)return{outcome:"unchecked",reason:`${o} returned no versions for ${t}, so Drift has nothing to compare against.`};let l=(n==="swift"?a.versions.filter(y=>aU(y)===aU(i)):a.versions).map(y=>sU(y,n)).filter(y=>y!==null);if(l.length===0)return n==="swift"?{outcome:"unchecked",reason:`${o} returned no tags in the installed version's ${aU(i)} family for ${t}.`}:{outcome:"unchecked",reason:`Drift could not read any of the ${a.versions.length} version numbers ${o} published for ${t}.`};let d=(s.prerelease?l:l.filter(y=>!y.prerelease)).filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)),p=a.latest?sU(a.latest,n):null,f=n==="swift"?d[0]:p&&(s.prerelease||!p.prerelease)?p:d[0];if(!f||ac(f,s)<=0)return{outcome:"up-to-date"};let m=lGe(d,s,r,n),g=d,h=cGe(g,s,n),b=[...new Map([f,...m?[m]:[],...h?[h]:[],...g.slice(0,18)].map(y=>[y.raw,y])).values()].filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)).map(y=>y.raw);return{outcome:"upgrade",latest:f.raw,...m?{safeLatest:m.raw}:{},...h?{latestMinor:h.raw}:{},versions:b}}function aU(e){let t=e.trim().replace(/^[^\d]*/,"");return/^\d{4}[.-]\d{1,2}[.-]\d{1,2}(?:[.-]\d+)?(?:$|[-+])/.test(t)?"calendar":Te(e,"swift")?"semver":"unknown"}var nGe="https://repo1.maven.org/maven2";async function cU(e){switch(e.ecosystem){case"npm":return oGe(e.name);case"swift":return sGe(e.name,e.githubToken);case"opam":return aGe(e.name,e.githubToken);case"maven":return rGe(e.name);default:{let t=await Wn(e.name,e.ecosystem,null);return t?{latest:null,versions:t.versions}:null}}}async function rGe(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await rt(`${nGe}/${t.replace(/\./g,"/")}/${n}/maven-metadata.xml`);if(i===null){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}let r=/([^<]+)<\/release>/.exec(i)?.[1]?.trim()??null,o=[...i.matchAll(/([^<]+)<\/version>/g)].map(s=>s[1].trim());if(o.length===0){let s=await Wn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}return{latest:r,versions:o}}var iGe="application/vnd.npm.install-v1+json, application/json";async function oGe(e){let t=await $e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`,{timeoutMs:12e3,headers:{Accept:iGe}});return t?{latest:t["dist-tags"]?.latest?.trim()??null,versions:Object.keys(t.versions??{})}:null}function Gne(e){return{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28",...e?{Authorization:`Bearer ${e}`}:{}}}async function sGe(e,t){if(!/^[\w.-]+\/[\w.-]+$/.test(e))return null;let n=100,i=20,r=[];for(let o=1;o<=i;o++){let s=await $e(`https://api.github.com/repos/${e}/tags?per_page=${n}&page=${o}`,{headers:Gne(t)});if(!s)return o===1?null:{latest:null,versions:[...new Set(r)],complete:!1};if(r.push(...s.map(a=>a.name).filter(a=>!!a)),s.lengthi.sameCompatibilityLine(t,r)===!0).sort((r,o)=>ac(o,r))[0]}function lGe(e,t,n,i){let r=Gi(i),s=e.filter(a=>ac(a,t)>0).map(a=>({version:a,satisfies:r.satisfies(a,n)}));if(!s.some(a=>a.satisfies===null))return s.filter(a=>a.satisfies).map(a=>a.version).sort((a,c)=>ac(c,a))[0]}function Dx(e,t,n,i,r){if(!r)return e>0?`${e} breaking change${e===1?"":"s"} found in ${i}.`:`No breaking changes found for this version of ${i}.`;let{assessment:o,security:s}=r,a=ru[o.recommendation],c=[],l=new Map(t.map(g=>[g.id,g])),u=n.filter(g=>l.get(g.breakingChangeId)?.kind!=="runtime-requirement"),d=n.filter(g=>l.get(g.breakingChangeId)?.kind==="runtime-requirement");u.length>0&&c.push(`${u.length} place${u.length===1?"":"s"} in this repository use${u.length===1?"s":""} an API that ${i} changed`),c.push(...uGe(d));let p=o.runtimeCompatibility,f=p==="unknown"||p==="partial";d.length===0&&p==="unknown"&&c.push("this upgrade's runtime requirement could not be checked against this repository");let m=t.filter(g=>g.kind!=="runtime-requirement").length;if(u.length===0&&d.length===0&&m>0&&!f){let g=Df(t);c.push(g?`${m} published ${g} change${m===1?"":"s"} ${m===1?"requires":"require"} review; ${m===1?"this package-role contract is":"these package-role contracts are"} assessed independently of source call signatures`:`${m} upstream API breaking change${m===1?"":"s"}, no usage of the changed parts located in this repository \u2014 review before upgrading`)}return s.checked&&s.resolved.length>0&&c.push(`fixes ${s.resolved.length} known ${s.resolved.length===1?"vulnerability":"vulnerabilities"}`),s.checked&&s.introduced.length>0&&c.push(`introduces ${s.introduced.length} known ${s.introduced.length===1?"vulnerability":"vulnerabilities"}`),c.length===0&&r.gaps.length>0?`${a}. ${r.gaps.join(" ")}`:c.length===0?`${a}. No breaking changes found for this version of ${i}.`:`${a}. ${dGe(c.join("; "))}.`}function uGe(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime declaration${o===1?"":"s"} in this repository do${o===1?"es":""} not satisfy this upgrade's runtime requirement`)}if(i.length>0){let o=i.length;t.push(`${o} runtime declaration${o===1?"":"s"} only partially satisf${o===1?"ies":"y"} this upgrade's runtime requirement`)}if(r.length>0){let o=r.length;t.push(`${o} runtime declaration${o===1?"":"s"} could not be resolved, so compatibility is unknown`)}return t}function dGe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ox(e,t){let n={...e,verification:t};if(!n.plan||(n.plan=Ax(n.plan,t),t.status==="skipped"))return n;n.breakingCount=n.plan.upstreamBreakingCount??n.plan.breakingChanges.length,n.impactCount=n.plan.impactSites.length,n.impactFiles=new Set(n.plan.impactSites.map(r=>r.file)).size;let i=n.plan.dispositions;return i&&(n.actionableImpactCount=i.reduce((r,o)=>r+o.actionableSites.length,0),n.actionableImpactFiles=new Set(i.flatMap(r=>r.actionableSites.map(o=>o.file))).size,n.runtimeDeclarationSiteCount=i.filter(r=>r.runtimeAnalysis!==void 0).reduce((r,o)=>r+o.sites.length,0)),n.rationale&&(n.rationale=n.plan.rationale?.find(r=>r.dependency===n.rationale.dependency)??n.plan.rationale?.[0]??n.rationale),n.risk=n.plan.risk,n.verifiedUnaffected=t.status==="passed"&&Fy(t)==="isolated"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&Array.isArray(n.plan.dispositions)&&n.plan.dispositions.every(r=>r.state==="unaffected")&&(n.plan.breakingChanges.length>0||(n.plan.upstreamBreakingCount??0)>0),n.impactPendingIsolatedClearance=Fy(t)==="batch"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&n.plan.impactSites.some(r=>{let o=n.plan.breakingChanges.find(s=>s.id===r.breakingChangeId);return o!==void 0&&H1(o)}),n.summary=Dx(n.breakingCount,n.plan.breakingChanges,n.plan.impactSites,n.name,n.rationale),n}var Wne=(0,qne.promisify)(Bne.execFile);function pGe(e,t){return t?[...e]:e.map(n=>n.state==="incompatible"||n.state==="partial"?n:{...n,state:"unknown",reason:"config-incomplete",statement:`${n.statement} Drift could not index every authoritative runtime configuration file, so this result is incomplete.`})}function Hne(e,t){return`${e}\0${t}`}var fGe={includeDev:!0,maxSites:40,maxPackages:0};function Kne(e){return{available:!1,reason:e.reason,inspection:e.reason==="no-public-surface"?"succeeded":e.reason==="artifact-type-unsupported"?"not-applicable":"failed",tool:e.tool,detail:e.detail,...e.packageRole?{packageRole:e.packageRole}:{},...e.diagnostic?{diagnostic:e.diagnostic}:{}}}async function dU(e,t=[""],n=new Map,i=Hn()){let r=[],o=[],s=await hGe(e,i);for(let a of t){let c=a?(0,kr.join)(e,a):e,l=await i.readDirectory(c);if(l.length===0)continue;let u=[...l,...await mGe(c,l,i)],d=da({entries:u,read:p=>tre((0,kr.join)(c,p))});if(d.length!==0){for(let p of oK(d))(n.get(Hne(a,p.ecosystem))??(a?s.get(p.ecosystem):void 0))||o.push({...p,dir:a});for(let p of gGe(d,a,n,s)){let f=p.manager.manifestPattern?u.filter(h=>p.manager.manifestPattern.test(h)):[],m=p.manager.manifests.find(h=>u.includes(h))??f.find(lP)??f[0];if(!m)continue;let g=p.manager.lockfiles.find(h=>u.includes(h))??null;if(p.manager.id==="pip"&&lP(m)){let h=m.replace(/\.in$/i,".txt");if(u.includes(h)){let b=await i.readFile((0,kr.join)(c,h));b&&Ok(b)&&(g=h)}}r.push({manager:p.manager,dir:a,manifestPath:a?`${a}/${m}`:m,lockfilePath:g?a?`${a}/${g}`:g:null})}}}return{targets:r,ambiguities:o}}async function mGe(e,t,n){let i=new Set;for(let o of ua)for(let s of[...o.manifests,...o.lockfiles])s.includes("/")&&i.add(s);let r=[];for(let o of i){if(t.includes(o))continue;let s=o.slice(0,o.indexOf("/"));t.includes(s)&&await n.readFile((0,kr.join)(e,o))!==null&&r.push(o)}return r}function gGe(e,t,n,i=new Map){let r=new Set,o=[];for(let s of new Set(e.map(a=>a.manager.ecosystem))){let a=e.filter(u=>u.manager.ecosystem===s),c=n.get(Hne(t,s)),l=a.find(u=>u.manager.id===c)??a.find(u=>u.manager.id===i.get(s))??a[0];r.has(s)||(r.add(s),o.push(l))}return o}async function hGe(e,t){let n=await t.readDirectory(e),i=da({entries:n,read:o=>tre((0,kr.join)(e,o))}),r=new Map;for(let o of i)o.fromLockfile&&r.set(o.manager.ecosystem,o.manager.id);return r}async function Jne(e){let{root:t,repo:n,config:i,logger:r,githubToken:o,onProgress:s,onCandidate:a,onDropped:c,onOutdated:l,token:u,repoLabel:d}=e,p=e.breadth??fGe,f=e.fs??Hn(),m=e.env??process.env,g=Math.max(1,Math.min(32,Math.floor(e.concurrency??L1(m))||1));r.debug(`Scan parallelism: ${ine(m)}`);let h={enabled:(e.verify?.enabled??!1)&&i.verify.enabled,checks:e.verify?.checks??i.verify.checks,timeoutMs:e.verify?.timeoutMs??i.verify.timeoutMs,generatedSourceGlobs:e.verify?.generatedSourceGlobs??i.verify.generatedSourceGlobs,baselineCache:e.verify?.baselineCache},b=Date.now(),y=(z,Y,Re=0,Ee=0)=>{let Ge=Date.now();r.debug(`${z} (+${Ge-b}ms): ${Y}`),b=Ge,s?.({phase:z,detail:Y,done:Re,total:Ee})},w=It("scan","total"),k=It("discover","manifests");y("Looking for manifests",t);let _=await Ed(t,f),S=Td(_),x=await Kk(t,f,S).catch(()=>[]),E=x.filter(z=>z.hasOwnGit),T=x.filter(z=>!z.hasOwnGit).map(z=>z.dir),A=[...S,...T],L=e.dirs??A;if(_.length>0||T.length>0){let z=[..._.map(Y=>Y.kind),...T.length>0?["undeclared"]:[]];y("Reading the workspace",`${L.length} package${L.length===1?"":"s"} \xB7 ${z.join(", ")}`)}let F=Mc("manifest.discovery"),{targets:K,ambiguities:te}=await dU(t,L,e.managers??new Map,f);if(K.length===0)return k.end({targets:0}),F.end({targets:0}),w.end({checked:0,candidates:0}),{candidates:[],checked:0,upToDate:0,unchecked:[],targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E};let D=new Map;for(let z of _)for(let Y of z.members)Y.name&&D.set(Y.dir,Y.name);for(let z of K){if(D.has(z.dir))continue;let Y=z.manifestPath.includes("/")?z.manifestPath.slice(z.manifestPath.lastIndexOf("/")+1):z.manifestPath,Re=await Lg(t,f,z.dir,Y,z.manager.ecosystem).catch(()=>null);Re&&D.set(z.dir,Re)}k.end({targets:K.length}),F.end({targets:K.length,manifests:K.length});let X=new Set(i.ecosystems),re=A.length>1||new Set(K.map(z=>z.dir)).size>1,ie=new Set,ke=(z,Y)=>{ie.add(Lx(z,d?t:void 0)),a?.(ere({dep:z,member:re?z.target.dir:void 0,memberName:re?D.get(z.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,phase:Y}))},We=(z,Y)=>_Ge(z,Y,"Waiting to be checked",{...re?{member:z.target.dir}:{},...re&&D.get(z.target.dir)?{memberName:D.get(z.target.dir)}:{},...d?{repoRoot:t,repoLabel:d}:{}}),ye=()=>{for(let z of ae)ie.delete(z.id);for(let z of ie)c?.(z);ie.clear()},xt=z=>{let Y=Lx(z,d?t:void 0);ie.delete(Y),c?.(Y)},bt=[],pt=[];for(let z of K){if(!X.has(z.manager.ecosystem))continue;y("Reading manifest",z.manifestPath);let Y=await pU(t,z,p.includeDev,f),Re=p.maxPackages>0?Math.max(0,p.maxPackages-bt.length):Y.dependencies.length;for(let Ee of Y.dependencies.slice(0,Re))ke(Ee,"Waiting to be checked");bt.push(...Y.dependencies),pt.push(...Y.unresolved)}if(pt.length>0){let z=[];await lU(pt,bx(m),async Y=>{let Re=Y.ecosystem,Ee=Y.current==="unspecified"?"*":Y.current,Ge=K.find(ao=>ao.manifestPath===Y.manifestPath);if(!Ge){z.push(Y);return}let Di=((await cU({name:Y.name,ecosystem:Re,current:Ee,range:Ee,...o?{githubToken:o}:{}}).catch(()=>null))?.versions??[]).filter(ao=>xW(ao,Ee,Re)===!0).sort((ao,iE)=>Eg(iE,ao,Re)??0)[0];if(!Di){z.push(Y);return}let nb={name:Y.name,kind:Y.kind,current:Di,range:Ee,assumed:!0,target:Ge};ke(nb,"Waiting to be checked"),bt.push(nb)}),pt.length=0,pt.push(...z)}let ft=p.maxPackages>0?bt.slice(0,p.maxPackages):bt;y("Indexing your code","Walking source files",0,ft.length);let Cn=It("index","walk+build"),Ci=Ad(t,{members:L}).then(z=>{y("Indexing your code",`${z.length} file${z.length===1?"":"s"} indexed \xB7 ${ft.length} direct dependenc${ft.length===1?"y":"ies"} to check`,0,ft.length);let Y={files:z,index:_f(z)};return Cn.end({files:z.length}),Y});Ci.catch(()=>{});let zn=0,Pi=0,fe=0,ae=[],be=[...pt],Mt=z=>h.enabled&&z.size>0&&!u?.isCancellationRequested?vne({root:t,targets:[],kinds:h.checks,env:m,logger:r,timeoutMs:h.timeoutMs,...h.generatedSourceGlobs?{allowedGlobs:h.generatedSourceGlobs}:{},...h.baselineCache?{baselineCache:h.baselineCache}:{},...u?{token:u}:{}},[...new Map(K.filter(Y=>z.has(Y.dir)).map(Y=>[Y.dir,Y])).values()].map(Y=>({dir:Y.dir,packageManager:Y.manager.id})),Y=>Y.output!==void 0?s?.({phase:"",detail:"",done:0,total:0,output:Y.output}):y(Y.phase,Y.detail)):void 0;y("Checking registries",`${ft.length} direct dependenc${ft.length===1?"y":"ies"}`,0,ft.length);let vt=[],sn=new Map,oi=It("phase","version-discovery");await Br("version.discovery",{dependencies:ft.length},()=>lU(ft,bx(m),async z=>{if(u?.isCancellationRequested)return;let Y=Px(z.target.manager.ecosystem);ke(z,`Asking ${Y} what has been published`);let Re=Mc("registry.lookup",{package:z.name}),Ee=JSON.stringify([z.target.manager.ecosystem,z.name,z.current,z.range??null]),Ge=sn.get(Ee);Ge||(Ge=En("versions",z.target.manager.ecosystem,()=>zne({name:z.name,ecosystem:z.target.manager.ecosystem,current:z.current,range:z.range,...o?{githubToken:o}:{}})),sn.set(Ee,Ge),Ge.then(si=>{si.outcome==="unchecked"&&sn.get(Ee)===Ge&&sn.delete(Ee)},()=>{sn.get(Ee)===Ge&&sn.delete(Ee)}));let Et=await Ge;if(Re.end({outcome:Et.outcome}),Et.outcome==="up-to-date"){zn+=1,Pi+=1,xt(z),y("Up to date",`${z.name}@${z.current}`,Pi,ft.length);return}if(Et.outcome==="unchecked"){be.push({name:z.name,kind:z.kind,ecosystem:z.target.manager.ecosystem,packageManager:z.target.manager.id,manifestPath:z.target.manifestPath,current:z.current,reason:Et.reason}),Pi+=1,xt(z),y("Could not check",`${z.name}@${z.current} \xB7 ${Et.reason}`,Pi,ft.length);return}vt.push({dep:z,available:Et}),Pi+=1,a?.(We(z,Et)),y("Outdated",`${z.name} ${z.current} \u2192 ${Et.safeLatest??Et.latest}`,Pi,ft.length)})),oi.end({checked:ft.length,outdated:vt.length}),vt.sort((z,Y)=>z.dep.name.localeCompare(Y.dep.name));let so=Mt(new Set(vt.map(({dep:z})=>z.target.dir)));if(l?.({outdated:vt.map(({dep:z,available:Y})=>We(z,Y)),checked:ft.length,upToDate:zn,unchecked:[...be]}),u?.isCancellationRequested)return ye(),await so?.dispose(),w.end({cancelled:!0}),{candidates:[],checked:ft.length,upToDate:zn,unchecked:be,targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E};let _t=It("phase","analysis"),tt=new Map;for(let{dep:z,available:Y}of vt){let Re=Y.safeLatest??Y.latest,Ee=NP({ecosystem:z.target.manager.ecosystem,name:z.name,from:z.current,to:Re});tt.has(Ee)||tt.set(Ee,{name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Re})}let Gn=i.rationale.security&&tt.size>0?Br("security.batch",{upgrades:tt.size},async()=>{let z=[...tt.keys()],Y=[...tt.values()];try{let Re=await Oy(Y,{});return new Map(z.map((Ee,Ge)=>[Ee,Re.get(Y[Ge])??Uo("The OSV advisory batch lookup did not return a result for this upgrade, so its effect on known vulnerabilities is unknown.")]))}catch(Re){let Ee=`The OSV advisory batch lookup failed unexpectedly (${Re.message}), so this upgrade's effect on known vulnerabilities is unknown.`;return new Map(z.map(Ge=>[Ge,Uo(Ee)]))}}):void 0;Gn?.catch(()=>{});let tb=z=>Gn?.then(Y=>Y.get(z)),Ts=new Map,Vn=new Map,Go=new Map,fu=new Map,rE=(z,Y,Re)=>{fu.set(z,[Y,Re]);for(let Ee of Go.get(z)??[])Ee(Y,Re)},Pie=(z,Y)=>{let Re=Go.get(z);Re||(Re=new Set,Go.set(z,Re)),Re.add(Y);let Ee=fu.get(z);return Ee&&Y(Ee[0],Ee[1]),()=>{Re.delete(Y),Re.size===0&&(Go.delete(z),fu.delete(z))}},Die=(z,Y,Re)=>{let Ee={name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Y,kind:z.kind,bump:ta(z.current,Y,z.target.manager.ecosystem),manifestPath:z.target.manifestPath,rawFrom:z.current,rawTo:Y},Ge=NP(Ee),Et=`${z.name} ${Ee.from} \u2192 ${Ee.to}`,si=Re?Pie(Ge,Re):void 0,Di=Ts.get(Ge),nb=Di!==void 0;if(!Di){let co=new Map,mu=new Map,jU=new Set,oE=new Map,sE=new Map;rE(Ge,"Reading release notes and changelog",Et);let rb=Br("upstream.analysis",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,shared:!1},()=>UO(Ee,{config:i,logger:r,...o?{githubToken:o}:{},env:m,workspaceRoot:t,onSurfaceComputed:(cc,Oi)=>{let Vo=cn(cc);Oi.weight>=.8&&jU.add(Vo),oE.set(Vo,{available:!0,inspection:"succeeded",tool:Oi.tool,...Oi.packageRole?{packageRole:Oi.packageRole}:{}}),co.set(Vo,{additions:Oi.additions??[],locator:Oi.locator}),rE(Ge,"Comparing the public API surface",Et)},onUnavailableSurface:(cc,Oi)=>{let Vo=cn(cc);mu.set(Vo,Oi),oE.set(Vo,Kne(Oi))},onProseConsulted:(cc,Oi)=>{let Vo=cn(cc);sE.set(Vo,[...sE.get(Vo)??[],Oi])}}).then(cc=>({evidence:cc,additions:co,surfaceGaps:mu,surfaceCompared:jU,surfaceAssessments:oE,prose:sE})));Ts.set(Ge,rb),Di=rb,rb.catch(()=>{Ts.get(Ge)===rb&&Ts.delete(Ge)})}let ao=Vn.get(Ge),iE=ao!==void 0;if(!ao){let co=N1(Ee,{config:i,...o?{githubToken:o}:{},securityLookup:tb(Ge),onProgress:mu=>rE(Ge,mu,Et)});Vn.set(Ge,co),ao=co,co.catch(()=>{Vn.get(Ge)===co&&Vn.delete(Ge)})}let Oie=Di,UU=ao;return Br("upstream.wait",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,evidenceShared:nb,rationaleShared:iE},async()=>{let[co,mu]=await Promise.allSettled([Oie,UU]);return si?.(),{evidence:co.status==="fulfilled"?co.value:void 0,rationaleFacts:mu.status==="fulfilled"?UU:void 0}})};try{await Br("analysis",{packages:vt.length},()=>lU(vt,g,async({dep:Y,available:Re})=>{if(u?.isCancellationRequested)return;let Ee=Re.safeLatest??Re.latest,Ge;try{Ge=await Die(Y,Ee,(si,Di)=>{y(si,Di,fe,vt.length),ke(Y,si)})}catch(si){r.debug(`Shared upstream analysis failed for ${Y.name} ${Y.current} \u2192 ${Ee}: ${si.message}. Falling back to independent analysis for this row.`)}let Et=await Br("package",{package:Y.name,ecosystem:Y.target.manager.ecosystem,from:Y.current,to:Ee},()=>wGe({dep:Y,selected:Ee,versions:Re.versions,latest:Re.latest,safeLatest:Re.safeLatest,latestMinor:Re.latestMinor,repo:n,config:i,githubToken:o,root:t,indexing:Ci,logger:r,env:m,maxSites:p.maxSites,member:re?Y.target.dir:void 0,allMembers:re?A:void 0,memberName:re?D.get(Y.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,prepared:Ge,onProgress:(si,Di)=>{y(si,Di,fe,vt.length),ke(Y,si)}}));ae.push(Et),a?.(h.enabled?{...Et,status:"checking",phase:"Waiting to be installed and tested"}:Et),fe+=1,y(Gy(Et)==="affected"?"Needs your attention":"Checked",`${Et.name} ${Et.current} \u2192 ${Et.selected} \xB7 ${Une(Et).toLowerCase()}`,fe,vt.length)})),_t.end({packages:vt.length});let z=It("phase","verification");try{h.enabled&&ae.length>0&&!u?.isCancellationRequested&&await Br("verification",{candidates:ae.length},()=>yGe({root:t,candidates:ae,checks:h.checks,timeoutMs:h.timeoutMs,generatedSourceGlobs:h.generatedSourceGlobs,...h.baselineCache?{baselineCache:h.baselineCache}:{},env:m,logger:r,...so?{warm:so}:{},...u?{token:u}:{},onProgress:Y=>{if(Y.output!==void 0){s?.({phase:"",detail:"",done:Y.done,total:Y.total,output:Y.output});return}y(Y.phase,Y.detail,Y.done,Y.total);for(let Re of Y.targets??[]){let Ee=ae.findIndex(Et=>Et.id===Re),Ge=Ee>=0?ae[Ee]:void 0;!Ge||Ge.verification||a?.({...Ge,status:"checking",phase:Y.detail?`${Y.phase} \xB7 ${Y.detail}`:Y.phase})}},onCandidate:a}))}finally{if(h.enabled)for(let[Y,Re]of ae.entries()){if(Re.verification)continue;let Ee=Ox(Re,{status:"skipped",reason:u?.isCancellationRequested?`The scan was stopped before ${Re.name} ${Re.selected} could be installed and checked, so the findings below are predictions.`:`${Re.name} ${Re.selected} was not installed and checked, so the findings below are predictions.`,checks:[],failedFiles:[]});ae[Y]=Ee,a?.(Ee)}await so?.dispose(),z.end({candidates:ae.length})}}finally{ye()}return w.end({checked:ft.length,candidates:ae.length}),{candidates:ae.sort(xGe),checked:ft.length,upToDate:zn,unchecked:be,targets:K,workspaces:_,ambiguities:te,nestedGitRepos:E}}async function yGe(e){let t=new Map(e.candidates.map(o=>[o.id,o])),n=e.candidates.filter(o=>o.rationale?.maintenance.deprecated);for(let o of n){let s=o.rationale?.maintenance.deprecated,a=Ox(o,{status:"skipped",reason:`${o.name} ${o.selected} has been withdrawn (${s}), so it cannot be installed to test.`,checks:[],failedFiles:[]}),c=e.candidates.indexOf(o);c>=0&&(e.candidates[c]=a),e.onCandidate?.(a)}let r=e.candidates.filter(o=>!n.includes(o)).map(o=>({id:o.id,name:o.name,current:o.current,selected:o.selected,manifestPath:o.manifestPath,packageManager:o.packageManager,install:s=>bGe(s,o,"safe",au(e.env))}));await yne({root:e.root,targets:r,installTogether:(o,s)=>vGe(o,s.map(a=>t.get(a.id)).filter(a=>a!==void 0),"safe",au(e.env)),kinds:e.checks,env:e.env,logger:e.logger,timeoutMs:e.timeoutMs,...e.generatedSourceGlobs?{allowedGlobs:e.generatedSourceGlobs}:{},...e.baselineCache?{baselineCache:e.baselineCache}:{},...e.warm?{warm:e.warm}:{},...e.token?{token:e.token}:{},onProgress:o=>e.onProgress?.({phase:o.phase,detail:o.detail,done:o.done,total:o.total,...o.targets?{targets:o.targets}:{},...o.output!==void 0?{output:o.output}:{}}),onVerified:(o,s)=>{let a=t.get(o.id);if(!a)return;let c=Ox(a,s),l=e.candidates.indexOf(a);l>=0&&(e.candidates[l]=c);let u=(a.plan?.breakingChanges.length??0)-(c.plan?.breakingChanges.length??0);e.logger.info(`${o.name}@${o.selected}: ${Uy(s)}`+(u>0?` ${u} predicted finding(s) dropped as disproved.`:"")),e.onCandidate?.(c)}})}async function lU(e,t,n){let i=0,r=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let o=i;i+=1;let s=e[o];if(s===void 0)return;await n(s)}});await Promise.all(r)}var uU=class extends Error{constructor(n){super(`${n.packageManager} cannot pin a version from the command line. Edit ${n.manifestPath} to require ${n.name} ${n.selected}, then re-run the scan.`);this.candidate=n}candidate};function Zne(e,t="safe"){let n=Yne(e,t);return n?sK(n):null}function Yne(e,t){let i=Uc(e.packageManager)?.upgrade(Mx(e));return i?t==="force"&&e.packageManager==="npm"?{...i,args:[...i.args,"--force"]}:i:null}function Mx(e){return{name:e.name,version:e.selected,kind:e.kind,...e.cargo?{cargo:e.cargo}:{}}}async function bGe(e,t,n="safe",i=process.env){let r=Yne(t,n);if(!r)throw new uU(t);let o=Uc(t.packageManager),s=(0,kr.join)(e,t.manifestPath),a=(0,kr.dirname)(s),c=await Qne([s,...(o?.lockfiles??[]).map(l=>(0,kr.join)(a,l))]);try{if(o?.rewriteManifest){let l=await(0,zo.readFile)(s,"utf8"),u=o.rewriteManifest(l,Mx(t),t.manifestPath);u!==l&&await(0,zo.writeFile)(s,u,"utf8")}await Wne(r.command,r.args,{cwd:a,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}catch(l){throw await Xne(c),l.code==="ENOENT"?new Error(`${r.command} was not found on PATH. Run \`command -v ${r.command}\` to check, and install it if it is genuinely missing.`):l}}async function vGe(e,t,n="safe",i=process.env){if(t.length===0)return!1;let r=t[0];if(!t.every(d=>d.manifestPath===r.manifestPath&&d.packageManager===r.packageManager))return!1;let s=Uc(r.packageManager);if(!s)return!1;let a=iK(s,t.map(Mx));if(!a)return!1;let c=(0,kr.join)(e,r.manifestPath),l=(0,kr.dirname)(c),u=await Qne([c,...(s.lockfiles??[]).map(d=>(0,kr.join)(l,d))]);try{if(s.rewriteManifest){let d=await(0,zo.readFile)(c,"utf8"),p=d;for(let f of t)p=s.rewriteManifest(p,Mx(f),f.manifestPath);p!==d&&await(0,zo.writeFile)(c,p,"utf8")}for(let d of a){let p=n==="force"&&r.packageManager==="npm"?[...d.args,"--force"]:d.args;await Wne(d.command,p,{cwd:l,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}}catch(d){throw await Xne(u),d.code==="ENOENT"?new Error(`${a[0].command} was not found on PATH. Run \`command -v ${a[0].command}\` to check, and install it if it is genuinely missing.`):d}return!0}async function Qne(e){return Promise.all(e.map(async t=>({path:t,content:await(0,zo.readFile)(t,"utf8").catch(()=>null)})))}async function Xne(e){await Promise.all(e.map(async({path:t,content:n})=>{try{n===null?await(0,zo.rm)(t,{force:!0}):await(0,zo.writeFile)(t,n,"utf8")}catch{}}))}async function wGe(e){let t=`${e.dep.name} ${e.dep.current} \u2192 ${e.selected}`,n=e.onProgress??(()=>{}),{target:i}=e.dep,r={name:e.dep.name,ecosystem:i.manager.ecosystem,from:e.dep.current,to:e.selected,kind:e.dep.kind,bump:ta(e.dep.current,e.selected,i.manager.ecosystem),manifestPath:i.manifestPath,rawFrom:e.dep.current,rawTo:e.selected,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{}},o={id:Lx(e.dep,e.repoRoot),name:e.dep.name,kind:e.dep.kind,ecosystem:i.manager.ecosystem,packageManager:i.manager.id,manifestPath:i.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},...e.allMembers?{allMembers:e.allMembers}:{},current:e.dep.current,...e.dep.assumed?{assumed:!0}:{},range:e.dep.range,safeLatest:e.safeLatest,latestMinor:e.latestMinor,selected:e.selected,latest:e.latest,versions:e.versions};try{n("Reading release notes and changelog",t);let s=new Map,a=new Map,c=new Set,l=new Map,u=new Map,d=e.prepared?.evidence?.evidence.map(T=>e.member===void 0?T:{...T,workspace:e.member})??await Br("evidence",{package:e.dep.name,ecosystem:i.manager.ecosystem},()=>En("evidence",i.manager.ecosystem,()=>UO(r,{config:e.config,logger:e.logger,githubToken:e.githubToken,env:e.env,workspaceRoot:e.root,onSurfaceComputed:(T,A)=>{let L=cn(T);A.weight>=.8&&c.add(L),l.set(L,{available:!0,inspection:"succeeded",tool:A.tool,...A.packageRole?{packageRole:A.packageRole}:{}}),s.set(L,{additions:A.additions??[],locator:A.locator})},onUnavailableSurface:(T,A)=>{let L=cn(T);a.set(L,A),l.set(L,Kne(A))},onProseConsulted:(T,A)=>{let L=cn(T);u.set(L,[...u.get(L)??[],A])}}),{package:e.dep.name}));if(e.prepared?.evidence){let T=cn(r),A=cn({...r,workspace:void 0}),L=e.prepared.evidence;s.clear();let F=L.additions.get(A);F&&s.set(T,F),a.clear();let K=L.surfaceGaps.get(A);K&&a.set(T,K),L.surfaceCompared.has(A)&&c.add(T),l.clear();let te=L.surfaceAssessments.get(A);te&&l.set(T,te),u.clear();let D=L.prose.get(A);D&&u.set(T,D)}n("Comparing the public API surface",`${t} \xB7 ${d.length} evidence source${d.length===1?"":"s"}`);let p=await Br("api.diff",{package:e.dep.name,evidenceSources:d.length},()=>En("analyze",i.manager.ecosystem,()=>BS([r],d,{config:e.config,logger:e.logger})));n(p.length>0?`Searching your code for ${p.length} breaking change${p.length===1?"":"s"}`:"No breaking changes to look for",t);let f=p.length>0?await En("module-maps",i.manager.ecosystem,()=>WS([r],{logger:e.logger})):void 0,m=It("index-wait",i.manager.ecosystem),{files:g,index:h}=await e.indexing;m.end();let b=It("localize",i.manager.ecosystem,{changes:p.length}),y=Mc("localization",{package:e.dep.name,changes:p.length,filesConsidered:g.length}),{sites:w,runtimeAnalyses:k}=nx(p,[r],h,g,{logger:e.logger,maxSitesPerChange:e.maxSites??40,member:e.member,members:e.allMembers,...f?{moduleMaps:f}:{}}),_=pGe(k,g.coverage.runtimeConfigComplete);b.end({sites:w.length}),y.end({sites:w.length}),n("Weighing what this upgrade is worth",t);let[S]=await En("rationale",i.manager.ecosystem,()=>fx({changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:_,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated},{config:e.config,logger:e.logger,githubToken:e.githubToken,additions:s,surfaceCompared:c,surfaceGaps:a,prose:u,...e.prepared?.rationaleFacts?{preparedFacts:new Map([[r,e.prepared.rationaleFacts]])}:{},repoRuntime:Tf(g,e.member,e.allMembers),pythonRuntime:If(g,e.member,e.allMembers),onProgress:(T,A)=>n(A,t)})),x=ux({repo:e.repo,config:e.config,changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:_,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated,runtimeConfigComplete:g.coverage.runtimeConfigComplete,...S?{rationale:[S]}:{}}),E=l.get(cn(r));return{...o,status:p.length>0?"ready":"clean",evidenceCount:d.length,breakingCount:p.length,impactCount:w.length,actionableImpactCount:(x.dispositions??[]).reduce((T,A)=>T+A.actionableSites.length,0),actionableImpactFiles:new Set((x.dispositions??[]).flatMap(T=>T.actionableSites.map(A=>A.file))).size,runtimeDeclarationSiteCount:(x.dispositions??[]).filter(T=>T.runtimeAnalysis!==void 0).reduce((T,A)=>T+A.sites.length,0),impactFiles:new Set(w.map(T=>T.file)).size,impactConfidence:kGe(w),sourceCoverage:g.coverage,...E?{surfaceAssessment:E}:{},risk:x.risk,summary:Dx(p.length,p,w,e.dep.name,S),gaps:S?.gaps??[],toolRequests:$Ge(a),...S?{rationale:S,recommendation:S.assessment.recommendation,...S.assessment.runtimeCompatibility?{runtimeCompatibility:S.assessment.runtimeCompatibility}:{},..._.length>0?{runtimeAnalyses:_.map(T=>({changeId:T.changeId,runtime:T.runtime,state:T.state,reason:T.reason,siteCount:T.sites.length,declarationCount:T.declarations.length,unresolvedCount:T.unresolved.length,statement:T.statement}))}:{}}:{},plan:x}}catch(s){return{...o,status:"error",evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"Could not inspect this upgrade",gaps:[],toolRequests:[],error:s.message}}}function kGe(e){return e.some(t=>t.confidence==="high")?"high":e.some(t=>t.confidence==="medium")?"medium":e.some(t=>t.confidence==="low")?"low":"none"}function $Ge(e){let t=new Set,n=[];for(let i of e.values())!i.install||t.has(i.install.id)||(t.add(i.install.id),n.push(i.install));return n}function Lx(e,t){return`${t?`${t}::`:""}${e.target.manifestPath}#${e.name}@${e.current}`}function ere(e){let{dep:t}=e;return{id:Lx(t,e.repoRoot),name:t.name,kind:t.kind,...t.cargo?{cargo:t.cargo}:{},ecosystem:t.target.manager.ecosystem,packageManager:t.target.manager.id,manifestPath:t.target.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},current:t.current,...t.assumed?{assumed:!0}:{},range:t.range,selected:t.current,latest:t.current,versions:[],status:"pending",phase:e.phase,evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"",gaps:[],toolRequests:[]}}function _Ge(e,t,n,i){return{...ere({dep:e,phase:n,...i?.member===void 0?{}:{member:i.member},...i?.memberName?{memberName:i.memberName}:{},...i?.repoRoot?{repoRoot:i.repoRoot}:{},...i?.repoLabel?{repoLabel:i.repoLabel}:{}}),selected:t.safeLatest??t.latest,latest:t.latest,...t.safeLatest?{safeLatest:t.safeLatest}:{},...t.latestMinor?{latestMinor:t.latestMinor}:{},versions:t.versions}}async function SGe(e){let t=new Map,n=new Map,i=c=>{let l=c;for(let u=0;u<4&&l.includes("${");u+=1)l=l.replace(/\$\{([^}]+)\}/g,(d,p)=>n.get(p)??d);return l},r=c=>{for(let[u,d]of c.properties)n.has(u)||n.set(u,d);let l=[];for(let[u,d]of c.dependencyManagement){let p=d.split("|"),f=p[0]??"";f&&(p.includes("import")?l.push(`${u}:${f}`):t.has(u)||t.set(u,f))}return l},o;try{o=IO(e)}catch{return t}let s=r(o);o.parent&&s.push(o.parent);let a=new Set;for(let c=0;c<8&&s.length>0;c+=1){let l=s.shift(),[u,d,p]=l.split(":");if(!u||!d||!p)continue;let f=i(p),m=`${u}:${d}:${f}`;if(a.has(m)||f.includes("${"))continue;a.add(m);let g=await i_({groupId:u,artifactId:d},f);if(g.ok){for(let h of r(g.contract))s.push(h);g.contract.parent&&s.push(g.contract.parent)}}for(let[c,l]of t)t.set(c,i(l));return t}async function pU(e,t,n,i){let r=Mk(t.manifestPath),o=await i.readFile((0,kr.join)(e,t.manifestPath));if(!r||o===null)return{dependencies:[],unresolved:[]};let s=r.parse(o,t.manifestPath),a=t.lockfilePath?await i.readFile((0,kr.join)(e,t.lockfilePath)):null,c=a!==null&&t.lockfilePath?Mk(t.lockfilePath)?.parse(a,t.lockfilePath):void 0,l=n?["runtime","dev","optional","peer"]:["runtime"],u=[],d=[];for(let[p,f]of s){if(!l.includes(f.kind))continue;let m=t.manager.ecosystem,g=c?.get(p)?.version??null,h=Gi(m),b=g?h.exactVersion(g)??h.parse(g)?.raw??null:h.exactVersion(f.version??"");if(!b){let y=f.version?.trim()??"";d.push({name:p,kind:f.kind,ecosystem:m,packageManager:t.manager.id,manifestPath:t.manifestPath,current:y||"unspecified",reason:y?`no lockfile entry, and "${y}" is a range rather than one version`:m==="maven"?"no version here and none in a lockfile \u2014 it is set by a parent POM or an imported BOM, which Drift does not fetch yet":"no version declared here, and no lockfile entry to resolve one from"});continue}u.push({name:p,kind:f.kind,...f.cargo?{cargo:f.cargo}:{},current:b,range:f.version??b,target:t})}if(d.length>0&&t.manager.ecosystem==="maven"&&t.manifestPath.endsWith("pom.xml")){let p=await SGe(o);if(p.size>0){let f=Gi("maven"),m=[];for(let g of d){let h=p.get(g.name),b=h?f.exactVersion(h):null;if(!b){m.push(g);continue}u.push({name:g.name,kind:g.kind,current:b,range:h??b,target:t})}d.length=0,d.push(...m)}}return{dependencies:u,unresolved:d}}function tre(e){try{return(0,Vne.readFileSync)(e,"utf8")}catch{return null}}function xGe(e,t){let n=jne(e,t);if(n!==0)return n;if(e.impactCount!==t.impactCount)return t.impactCount-e.impactCount;let i=e.name.localeCompare(t.name);return i!==0?i:e.manifestPath.localeCompare(t.manifestPath)}var EGe=12;async function nre(e,t){if(!t)return e;let n=e.breakingChanges.filter(s=>s.symbols.length>0&&e.impactSites.some(a=>a.breakingChangeId===s.id));if(n.length===0)return e;let i=new Map,r=new Map,o=0;for(let s of n){if(o>=EGe)break;let a=e.changes.find(u=>u.name===s.dependency&&(u.workspace??"")===(s.workspace??""));if(!a?.to||a.ecosystem!=="npm")continue;let c=i.get(a.name);if(c===void 0&&(c=(await Wn(a.name,a.ecosystem,a.to))?.githubRepo??null,i.set(a.name,c)),!c)continue;o++;let l=await TGe(c,a.to,s.symbols[0],t);l&&r.set(s.id,l.url)}return r.size===0?e:{...e,breakingChanges:e.breakingChanges.map(s=>r.has(s.id)?{...s,sourceUrl:r.get(s.id)}:s)}}async function TGe(e,t,n,i){let r={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};i&&(r.Authorization=`Bearer ${i}`);let o=await IGe(e,t,r);if(!o)return null;let s=await AGe(e,n,r);if(!s)return null;let a=await RGe(e,o,s,n);return a?{url:`https://github.com/${e}/blob/${o}/${s.split("/").map(encodeURIComponent).join("/")}#L${a}`,line:a}:null}async function IGe(e,t,n){return(await $e(`https://api.github.com/repos/${e}/tags?per_page=100`,{headers:n})??[]).find(o=>!!o.name&&Xd(o.name,t))?.name??null}async function AGe(e,t,n){let i=encodeURIComponent(`${t} repo:${e} language:TypeScript`);return((await $e(`https://api.github.com/search/code?q=${i}&per_page=5`,{headers:n}))?.items??[]).map(s=>s.path).find(s=>!!s&&!s.endsWith(".d.ts")&&!s.includes("node_modules/"))??null}async function RGe(e,t,n,i){let r=await rt(`https://raw.githubusercontent.com/${e}/${t}/${n}`);if(!r)return null;let o=new RegExp(`\\b(export\\s+)?(declare\\s+)?(default\\s+)?(function|const|class|interface|type|enum)\\s+${NGe(i)}\\b`),a=r.split(` -`).findIndex(c=>o.test(c));return a===-1?null:a+1}function NGe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var CGe="Drift",rre="https://github.com/trydrift/drift",mU=9;function lre(e,t){let n=new Map;for(let i of e)n.has(i.ruleId)||n.set(i.ruleId,{id:i.ruleId,name:i.ruleName,...i.helpUri?{helpUri:i.helpUri}:{}});return{$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:CGe,informationUri:rre,rules:[...n.values()].map(i=>({id:i.id,name:i.name,shortDescription:{text:i.name},fullDescription:{text:"A Drift finding: what changed, where it's used, and the fix \u2014 see the alert body."},helpUri:i.helpUri??rre,defaultConfiguration:{level:"warning"},properties:{tags:["dependencies","drift"]}}))}},...t?{automationDetails:{id:t}}:{},results:e.map(i=>({ruleId:i.ruleId,level:i.level,message:{text:PGe(i.message),markdown:i.message},locations:[ore(i.primaryLocation,i.snippetOk)],...i.relatedLocations.length>0?{relatedLocations:i.relatedLocations.map((r,o)=>({id:o+1,...ore(r)}))}:{},partialFingerprints:{primaryLocationLineHash:OGe(i)}}))}]}}function PGe(e){return e.replace(/\[([^\]]*)\]\(([^)]+)\)/g,"$1 ($2)").replace(/\*\*(.*?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function ire(e){return e.replace(/&/g,"&").replace(//g,">")}function DGe(e,t,n){let i=n?`${n}/${e}#L${t}`:`${e}#L${t}`;return`[\`${e}:${t}\`](${i})`}function ore(e,t=!1){return{physicalLocation:{artifactLocation:{uri:e.file},region:{startLine:Math.max(1,e.line),...t&&e.excerpt?{snippet:{text:e.excerpt}}:{}}}}}function OGe(e){let t=`${e.ruleId}|${e.primaryLocation.file}|${(e.primaryLocation.excerpt??"").trim()}`;return(0,hU.createHash)("sha256").update(t).digest("hex").slice(0,40)}async function yU(e,t={}){let n=t.includeInformational??!1,i=t.granularity??"package",r=t.repoBlobUrl,o=[];e=await nre(e,t.githubToken);for(let s of e.changes){let a=e.breakingChanges.filter(g=>g.dependency===s.name&&(g.workspace??"")===(s.workspace??"")),c=e.rationale?.find(g=>g.dependency===s.name),l=[],u=0,d=[...a].sort((g,h)=>Ux(h.confidence)-Ux(g.confidence));for(let g of d){let h=e.impactSites.filter(b=>b.breakingChangeId===g.id);if(h.length===0){u++;continue}l.push({breaking:g,block:zGe(g,h,e.evidence)})}let p=[];if(LGe(c)&&p.push(BGe(c)),e.verification?.status==="failed"&&p.push(qGe(e.verification)),l.length===0&&p.length===0)if(u>0){if(!n)continue;p.push(HGe(s,u))}else{if(!n||!c)continue;p.push(WGe(s,c))}let f=e.commits.find(g=>a.some(h=>g.breakingChangeIds.includes(h.id))),m=t.fixOf?.(s)??YGe(f,e);if(i==="package"){let g=[...l.map(h=>h.block),...p];o.push(Fx({change:s,blocks:g,upstreamOnlyCount:u,fix:m,repoBlobUrl:r,ruleName:g.length===1&&g[0].ruleNameSuffix?`${s.name}: ${g[0].ruleNameSuffix}`:void 0}));continue}for(let{breaking:g,block:h}of l)if(i==="affectedSite"){let b=[h.primaryCandidate,...h.relatedCandidates].filter(y=>y!==void 0);for(let y of b)o.push(Fx({change:s,blocks:[{...h,primaryCandidate:y,relatedCandidates:[]}],upstreamOnlyCount:0,fix:m,ruleIdSuffix:`${g.id}/${MGe(y)}`,ruleName:sre(s,g),snippetOk:!0,repoBlobUrl:r}))}else o.push(Fx({change:s,blocks:[h],upstreamOnlyCount:0,fix:m,ruleIdSuffix:g.id,ruleName:sre(s,g),snippetOk:!0,repoBlobUrl:r}));for(let g of p)o.push(Fx({change:s,blocks:[g],upstreamOnlyCount:0,fix:m,ruleIdSuffix:"other",ruleName:g.ruleNameSuffix?`${s.name}: ${g.ruleNameSuffix}`:void 0,repoBlobUrl:r}))}return o}function MGe(e){return(0,hU.createHash)("sha256").update(`${e.file}|${(e.excerpt??"").trim()}`).digest("hex").slice(0,10)}function LGe(e){if(!e)return!1;let t=e.security;return t.checked&&(t.resolved.length>0||t.introduced.length>0||t.current.length>0)}async function ure(e,t={}){let n=[];for(let i of e){if(!i.plan)continue;let r=()=>{if(i.plan.commits.length>0)return;let o=Zne(i);if(o)return{description:i.verification?.status==="failed"?"The project's own checks failed with this upgrade installed \u2014 measured, not predicted. Do not treat this as safe to upgrade without investigating.":i.breakingCount>0?"The upstream API changed, but no code in this repository was found to use the affected parts. Review before upgrading.":"Safe to upgrade \u2014 no breaking changes found.",command:o}};n.push(...await yU(i.plan,{...t,fixOf:r}))}return n}var FGe={"removed-export":"Removed export used in this repository","renamed-export":"Renamed export used in this repository","moved-export":"Export moved to a different module","signature-change":"Call signature changed","type-change":"Type changed in a breaking way","behaviour-change":"Runtime behaviour changed","removed-endpoint":"API endpoint removed","changed-endpoint":"API endpoint changed","required-field-added":"New required field","default-change":"Default value changed","config-change":"Configuration shape changed","module-system-change":"Module loading compatibility changed","runtime-requirement":"Runtime requirement changed",unknown:"Unclassified breaking change"};function dre(e){return FGe[e]??"Breaking change"}function sre(e,t){let n=`${e.name}: ${dre(t.kind)}`;if(t.symbols.length===0)return n;let i=t.symbols.slice(0,2).join(", "),r=t.symbols.length>2?", \u2026":"";return`${n} (${i}${r})`}var Vy={runtime:"dependency",dev:"devDependency",peer:"peerDependency",optional:"optionalDependency",transitive:"transitive dependency"};function UGe(e){return Vy[e]??e}var are={error:2,warning:1,note:0};function jGe(e){return e.reduce((t,n)=>are[n]>are[t]?n:t,"note")}function zGe(e,t,n){let i=[...t].sort((d,p)=>Ux(p.confidence)-Ux(d.confidence)||d.file.localeCompare(p.file)||d.line-p.line),r=i[0],o=i.slice(1,1+mU),s=r.confidence,a=new Set(t.map(d=>d.file)),c=KGe(e,n),l=e.sourceUrl??(c?JGe(c,e):void 0),u=[`**${dre(e.kind)}:** ${GGe(e.summary,l)}`,"",`Upstream confidence: ${e.confidence}. Local confidence: ${s}`+(t.length>1?` (best of ${t.length} matches across ${a.size} file(s)).`:".")];return e.before&&e.after&&e.before!==e.after&&u.push("",`- \`${ire(gU(e.before,300))}\``,`+ \`${ire(gU(e.after,300))}\``),l&&u.push("",`${e.sourceUrl?"GitHub source":"Declaration source"}: ${l}`),{level:VGe(e.confidence,s),lines:u,primaryCandidate:{file:r.file,line:r.line,excerpt:r.excerpt},relatedCandidates:o.map(d=>({file:d.file,line:d.line,excerpt:d.excerpt})),helpUri:l}}function gU(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}function GGe(e,t){return t?e.replace(/`([^`]+)`/g,(n,i)=>`[\`${i}\`](${t})`):e}function VGe(e,t){return e==="high"&&t==="high"?"error":e==="high"||t==="high"||e==="medium"&&t==="medium"?"warning":"note"}function Ux(e){return e==="high"?2:e==="medium"?1:0}function BGe(e){let t=e.security,n,i,r=[];if(t.current.length>0){n=`Currently affected by ${t.current.length} known ${Uf(t.current.length,"advisory","advisories")}`;let s=cre(t.current);i=s==="critical"||s==="high"?"error":"warning",r.push(["**Currently affected:**",...t.current.map(a=>`- ${fU(a)}`)].join(` -`))}else if(t.introduced.length>0){n=`Upgrading would introduce ${t.introduced.length} new known ${Uf(t.introduced.length,"advisory","advisories")}`;let s=cre(t.introduced);i=s==="critical"||s==="high"?"error":"warning"}else n=`Resolves ${t.resolved.length} known ${Uf(t.resolved.length,"advisory","advisories")}`,i="note";t.introduced.length>0&&r.push(["**Would introduce:**",...t.introduced.map(s=>`- ${fU(s)}`)].join(` -`)),t.resolved.length>0&&r.push(["**Resolves:**",...t.resolved.map(s=>`- ${fU(s)}`)].join(` -`));let o=[`**${n}**`];for(let s of r)o.push("",s);o.push("",`Drift's assessment: **${ru[e.assessment.recommendation]}**.`);for(let s of e.assessment.reasons)o.push(`- ${s}`);return{level:i,lines:o,relatedCandidates:[],helpUri:t.current[0]?.url??t.introduced[0]?.url??t.resolved[0]?.url,ruleNameSuffix:n}}function qGe(e){let n=e.checks.filter(o=>o.status==="failed").map(o=>`\`${o.label}\``).join(", "),r=[`**The project's own checks fail with this upgrade installed${e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:""}** \u2014 measured, not predicted. Drift's static analysis found no specific call site to point at, but the upgrade should not be treated as safe.`];return n&&r.push("",`Failing: ${n}`),e.diagnostics&&r.push("",gU(e.diagnostics,4e3)),{level:"error",lines:r,relatedCandidates:[],ruleNameSuffix:"Project's own checks fail with this upgrade"}}function WGe(e,t){return{level:"note",lines:[`**Update available** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}), with no breaking changes or advisories found.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 safe to upgrade"}}function HGe(e,t){return{level:"warning",lines:[`**Breaking change detected upstream** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}). ${t} upstream breaking ${Uf(t,"change was","changes were")} found, and no code in this repository was found to use the affected parts \u2014 but a completed search is not proof the change cannot reach this repository. Review before upgrading.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 review before upgrading"}}function Fx(e){let{change:t,blocks:n,upstreamOnlyCount:i,fix:r,ruleIdSuffix:o,ruleName:s,snippetOk:a,repoBlobUrl:c}=e,l=qk(t),u=t.to?`${t.from??"none"} \u2192 ${t.to}`:"removed",d=n.some(k=>k.primaryCandidate),p=UGe(t.kind),f=[l?`**${t.name}** (${t.ecosystem} ${p}) ${u} \u2014 ${l}`:`**${t.name}** (${t.ecosystem} ${p}) ${u}`];i>0&&f.push("",`${i} additional upstream breaking ${Uf(i,"change does","changes do")} not reach code in this repository and ${Uf(i,"is","are")} omitted here.`);let m=a?n.find(k=>k.primaryCandidate)?.primaryCandidate??{file:t.manifestPath,line:1}:{file:t.manifestPath,line:1},g=new Set([`${m.file}:${m.line}`]),h=[];for(let k of n){let _=k.primaryCandidate?[k.primaryCandidate,...k.relatedCandidates]:k.relatedCandidates;for(let S of _){let x=`${S.file}:${S.line}`;if(!g.has(x)&&(g.add(x),h.push(S),h.length>=mU))break}if(h.length>=mU)break}let b=new Map(h.map((k,_)=>[`${k.file}:${k.line}`,_+1])),y=k=>{let _=b.get(`${k.file}:${k.line}`);return _!==void 0?`[\`${k.file}:${k.line}\`](${_})`:DGe(k.file,k.line,c)},w=[f.join(` +`)}function Hze(e){let t=[`### \`${e.dependency}\` ${e.from} \u2192 ${e.to}`,"",`**Recommendation: ${ou[e.assessment.recommendation]}**`,""],n=Jze(e.security);n&&t.push(n,"");let i=Zze(e.maintenance);if(i&&t.push(i,""),e.improvements.length>0){t.push("**Other improvements**","");for(let s of e.improvements)t.push(`- ${s.statement}${s.url?` ([source](${s.url}))`:""}`);t.push("")}let r=Yze(e.license);r&&t.push(r,"");let o=Qze(e.summary);if(o&&t.push(o,""),t.push(`**Evidence confidence:** ${Wze[e.assessment.confidence]} \u2014 ${e.assessment.confidenceBasis}`,""),e.assessment.reasons.length>0){t.push("
Why Drift concluded this","");for(let s of e.assessment.reasons)t.push(`- ${s}`);t.push("","
")}return t.join(` +`).trim()}function Jze(e){if(!e.checked)return`**Security** + +${e.reason??"The OSV advisory database could not be reached, so this upgrade's effect on known vulnerabilities is unknown."}`;let t=["**Security**",""];return e.resolved.length>0&&(t.push(`Upgrading resolves ${Hy(e.resolved.length,"known vulnerability","known vulnerabilities")}:`),t.push(...dU(e.resolved)),t.push("")),e.introduced.length>0&&(t.push(`The target version is affected by ${Hy(e.introduced.length,"advisory","advisories")} that ${e.introduced.length===1?"does":"do"} not affect the installed version:`),t.push(...dU(e.introduced)),t.push("")),e.carried.length>0&&(t.push(`${Hy(e.carried.length,"advisory affects","advisories affect")} both versions and ${e.carried.length===1?"is":"are"} not addressed by this upgrade:`),t.push(...dU(e.carried)),t.push("")),e.target.length===0&&t.push("No known vulnerabilities were found for the target version."),t.join(` +`).trim()}function dU(e){let t=e.slice(0,Kze),n=t.map(i=>{let r=i.aliases.find(a=>a.startsWith("CVE-")),o=r&&r!==i.id?`${i.id} (${r})`:i.id,s=i.fixedIn?` \u2014 first fixed in ${i.fixedIn}`:" \u2014 no fixed version published";return`- [${o}](${i.url}) \u2014 ${qze[i.severity]}${s}. ${i.summary}`});return e.length>t.length&&n.push(`- \u2026and ${e.length-t.length} more.`),n}function Zze(e){return e.facts.length===0?"":["**Maintenance**","",...[...e.facts].sort((n,i)=>Number(i.concerning??!1)-Number(n.concerning??!1)).map(n=>`- ${n.statement}${n.url?` ([source](${n.url}))`:""}`)].join(` +`)}function Yze(e){if(e.verdict==="ok"||e.verdict==="changed")return"";let n=[e.verdict==="policy-violation"?"**License review required**":"**License**","",e.statement],i=e.introduced.filter(r=>!r.allowed);if(i.length>0){n.push("","Newly introduced dependencies of this package:");for(let r of i)n.push(`- \`${r.name}\` \u2014 ${r.license??"no declared license"}`);n.push("","This covers the dependencies this package itself declares. Drift does not resolve the full transitive graph during analysis.")}return n.push("","_Drift reports what the metadata says and how it compares to your configured policy. It does not give legal advice._"),n.join(` +`)}function Qze(e){if(e.changes.length===0)return"";let t=[["Breaking changes",e.changes.filter(i=>i.category==="breaking")],["Security",e.changes.filter(i=>i.category==="security")],["Improvements",e.changes.filter(i=>i.category==="performance"||i.category==="improvement")],["Fixes",e.changes.filter(i=>i.category==="fix")]],n=["
What changed upstream",""];for(let[i,r]of t)if(r.length!==0){n.push(`**${i}**`,"");for(let o of r){let s=o.affectedSites!==void 0?` Drift found ${Hy(o.affectedSites,"affected call","affected calls")} in this repository.`:"";n.push(`- ${o.text}${s}${o.url?` ([source](${o.url}))`:""}`)}n.push("")}return e.unrelated>0&&n.push("**Unrelated changes**","",`- ${Hy(e.unrelated,"further change","further changes")} were read and judged not to concern this repository.`,""),n.push("
"),n.join(` +`)}function Hy(e,t,n){return`${e} ${e===1?t:n}`}var Xze=["drift-schema","drift-plan","drift-plan-digest","drift-commit","drift-base-branch"],eGe=/^[ \t]*[ \t]*$/gm,tGe=/^[0-9a-f]{40}$/,nGe=/^plan_[0-9a-f]{10}$/,rGe=/^[0-9a-f]{64}$/;function iGe(e){return!(!e||e.length>255||/[\x00-\x20~^:?*[\\]/.test(e)||e.includes("..")||e.includes("@{")||e.startsWith("/")||e.endsWith("/")||e.includes("//")||e.startsWith("-")||e.startsWith(".")||e.endsWith(".")||e.endsWith(".lock"))}function jne(e){return[``,``,``,``,``].join(` +`)}function zne(e){if(!e)return{ok:!1,reason:"the issue has no body"};let t=new Map;for(let l of e.matchAll(eGe)){let u=l[1],d=(l[2]??"").trim(),p=t.get(u);p?p.push(d):t.set(u,[d])}if(t.size===0)return{ok:!1,reason:"the issue has no Drift plan footer, so it is not a Drift approval issue"};for(let l of Xze){let u=t.get(l);if(!u)return{ok:!1,reason:`the plan footer is missing \`${l}\``};if(u.length>1)return{ok:!1,reason:`the plan footer declares \`${l}\` ${u.length} times; a Drift issue declares each key exactly once`};if(u[0]==="")return{ok:!1,reason:`the plan footer has an empty \`${l}\``}}let n=l=>t.get(l)[0],i=n("drift-schema");if(!/^\d+$/.test(i))return{ok:!1,reason:`\`drift-schema\` must be an integer, not \`${fU(i)}\``};let r=Number(i);if(!S1.includes(r))return{ok:!1,reason:`this issue records plan schema v${r}, which this version of Drift cannot verify (it supports v${S1.join(", v")}). Re-run Drift to generate a current plan.`};let o=n("drift-plan");if(!nGe.test(o))return{ok:!1,reason:`\`drift-plan\` is not a Drift plan id: \`${fU(o)}\``};let s=n("drift-plan-digest");if(!rGe.test(s))return{ok:!1,reason:"`drift-plan-digest` is not a 64-character SHA-256 digest"};let a=n("drift-commit");if(!tGe.test(a))return{ok:!1,reason:"`drift-commit` must be a full 40-character commit SHA; an abbreviated SHA does not name one commit unambiguously"};let c=n("drift-base-branch");return iGe(c)?{ok:!0,metadata:{schemaVersion:r,planId:o,planDigest:s,headSha:a,baseBranch:c}}:{ok:!1,reason:`\`drift-base-branch\` is not a valid branch name: \`${fU(c)}\``}}function Gne(e){let t=[``,``];return e.taskId&&t.push(``),e.pullRequestNumber!==void 0&&t.push(``),t.join(` +`)}function Vne(e,t){for(let n of e){if(!n.authorIsDrift||!n.body)continue;let i=//.exec(n.body)?.[1];if(i!==t)continue;let r=//.exec(n.body)?.[1]?.trim(),o=//.exec(n.body)?.[1]?.trim(),s=//.exec(n.body)?.[1];return{planDigest:i,...r?{branchName:r}:{},...o?{taskId:o}:{},...s?{pullRequestNumber:Number(s)}:{}}}return null}function fU(e){let t=e.replace(/[`\r\n]/g," ").trim();return t.length<=40?t:`${t.slice(0,40)}\u2026`}var SU=require("node:crypto");var vr=require("node:path");var Jne=require("node:fs"),zo=require("node:fs/promises"),Zne=require("node:child_process"),Yne=require("node:util");function oGe(e){return e.verification?e.verification.status==="passed"?"passed":e.verification.status==="failed"?"failed":"skipped":"not-run"}function Jy(e){if(e.status==="pending")return"pending";if(e.status==="error")return"error";let t=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial";if((e.actionableImpactCount??(t?e.runtimeDeclarationSiteCount!==void 0?Math.max(0,e.impactCount-e.runtimeDeclarationSiteCount):e.impactConfidence==="high"?e.impactCount:0:e.impactConfidence==="low"||e.impactConfidence==="medium"?0:e.impactCount))>0)return"affected";if(e.verification?.status==="failed")return"verification-failed";let i=t?e.runtimeDeclarationSiteCount:0;if((i===void 0?t?0:e.impactCount:Math.max(0,e.impactCount-i))>0)return"review-required";if(e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial")return"runtime-unresolved";let o=e.runtimeAnalyses?.length??0,s=Math.max(0,e.breakingCount-o);return s>0&&(e.sourceCoverage?.localizationComplete===!1||e.sourceCoverage?.sourceTruncated)?"localization-incomplete":s>0?e.verifiedUnaffected===!0?"upstream-only":"review-required":e.breakingCount>0?"upstream-only":e.recommendation==="insufficient-evidence"?"evidence-missing":e.recommendation?"clean":e.gaps&&e.gaps.length>0?"evidence-missing":"clean"}function qne(e){let t=oGe(e),n=t==="not-run"?" \u2014 not deeply verified":t==="skipped"?" \u2014 deep verification did not complete":"",i=aGe(e);switch(Jy(e)){case"pending":return"Not checked yet";case"error":return"Could not check";case"affected":{let r=e.actionableImpactCount!==void 0,o=e.actionableImpactFiles??e.impactFiles,s=e.actionableImpactCount??e.impactCount,a=r?"actionable site":"site",c=e.impactConfidence&&e.impactConfidence!=="high"||e.runtimeCompatibility==="partial"?"May affect":"Affects",l=e.impactPendingIsolatedClearance?" \u2014 not yet confirmed alone: a batch check passed without testing this package in isolation":"",u=t==="failed"?" \u2014 and its own checks fail with this installed, measured not predicted":n,d=i?` \xB7 ${i}`:"";return`${c} your code \xB7 ${s} ${a}${s===1?"":"s"} in ${o} file${o===1?"":"s"}${d}${l}${u}`}case"verification-failed":{let r=(e.verification?.checks??[]).filter(o=>o.status==="failed").map(o=>o.label);return r.length>0?`Verified breaking \xB7 ${r.join(", ")} failed with this upgrade installed \u2014 measured, not predicted`:"Verified breaking \xB7 this upgrade broke the project's own checks \u2014 measured, not predicted"}case"upstream-only":{let r=`${e.breakingCount} upstream change${e.breakingCount===1?"":"s"}, none used here`;return e.verifiedUnaffected===!0?`Verified safe \xB7 ${r}, and your own checks pass`:`Safe for your code \xB7 ${r}`}case"review-required":{let r=e.runtimeCompatibility==="unknown"||e.runtimeCompatibility==="partial"?e.runtimeDeclarationSiteCount??0:0;if(e.impactCount-r<=0){let a=e.breakingCount;return`Review Required \xB7 ${a} breaking change${a===1?"":"s"} upstream; Drift found no usage in this repository but could not prove none \u2014 verify before upgrading`+(i?` \xB7 ${i}`:"")}let o=Math.max(1,e.impactCount-r),s=i?` \xB7 ${i}`:"";return e.impactConfidence==="low"||e.impactConfidence==="medium"?`May affect your code \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm \u2014 Review required; check before upgrading${s}`:`Review Required \xB7 ${o} local site${o===1?"":"s"} Drift flagged but could not confirm${s}`}case"runtime-unresolved":return i?`Runtime Unknown \xB7 ${i}`:"Runtime Unknown \xB7 Drift could not resolve this repository\u2019s runtime compatibility";case"localization-incomplete":return"Localization Incomplete \xB7 Drift searched the indexed source subset, but the file limit prevented proving the breaking API is unused";case"evidence-missing":return"Evidence Missing \xB7 Drift could not obtain enough upstream evidence to decide";case"clean":{let r=e.recommendation==="upgrade-recommended";return t==="passed"?r?"Verified worth taking \xB7 no breaking changes, it improves on what you have, and your own checks pass":"Verified safe \xB7 no breaking changes found, and your own checks pass":r?`Worth taking \xB7 no breaking changes, and it improves on what you have${n}`:`Safe for your code \xB7 no breaking changes found${n}`}}}function Bne(e){return{affected:0,"verification-failed":1,error:2,"review-required":3,"runtime-unresolved":4,"localization-incomplete":5,"evidence-missing":6,"upstream-only":7,pending:8,clean:9}[e]}function sGe(e,t){return Bne(e)-Bne(t)}function Wne(e,t){return sGe(Jy(e),Jy(t))}function aGe(e){if(e.runtimeCompatibility!=="unknown"&&e.runtimeCompatibility!=="partial")return;let t=e.runtimeAnalyses?.find(i=>i.state==="unknown"||i.state==="partial");if(t?.statement)return t.statement;if(t?.reason==="config-incomplete")return"Drift could not index every authoritative runtime configuration file";let n=e.runtimeDeclarationSiteCount??0;return n>0?`${n} runtime declaration${n===1?"":"s"} to review`:"Drift could not resolve this repository\u2019s runtime compatibility"}function mU(e,t){return Te(e,t)}function ac(e,t){return Qe(e,t)??0}function jx(e){switch(e){case"npm":return"the npm registry";case"pypi":return"PyPI";case"cargo":return"crates.io";case"go":return"the Go module proxy";case"maven":return"Maven Central";case"rubygems":return"RubyGems";case"nuget":return"NuGet";case"packagist":return"Packagist";case"hex":return"Hex";case"pub":return"pub.dev";case"cocoapods":return"CocoaPods Trunk";case"conan":return"ConanCenter";case"vcpkg":return"the vcpkg registry";case"arduino":return"the Arduino Library Manager";case"swift":return"the package\u2019s git tags";case"opam":return"the opam repository"}}async function Kne(e){try{return await cGe(e)}catch(t){return{outcome:"unchecked",reason:`Checking ${jx(e.ecosystem)} for ${e.name} failed: ${t.message}`}}}async function cGe(e){let{name:t,ecosystem:n,current:i,range:r}=e,o=jx(n),s=mU(i,n);if(!s)return{outcome:"unchecked",reason:`${t} is installed at \u201C${i}\u201D, which Drift cannot compare against published versions.`};let a=await hU(e);if(!a)return{outcome:"unchecked",reason:`Drift could not reach ${o} for ${t}.`};if(a.complete===!1)return{outcome:"unchecked",reason:`Drift could not enumerate all of ${o} for ${t}, so it cannot establish whether a newer compatible version exists.`};if(a.versions.length===0)return{outcome:"unchecked",reason:`${o} returned no versions for ${t}, so Drift has nothing to compare against.`};let l=(n==="swift"?a.versions.filter(y=>gU(y)===gU(i)):a.versions).map(y=>mU(y,n)).filter(y=>y!==null);if(l.length===0)return n==="swift"?{outcome:"unchecked",reason:`${o} returned no tags in the installed version's ${gU(i)} family for ${t}.`}:{outcome:"unchecked",reason:`Drift could not read any of the ${a.versions.length} version numbers ${o} published for ${t}.`};let d=(s.prerelease?l:l.filter(y=>!y.prerelease)).filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)),p=a.latest?mU(a.latest,n):null,f=n==="swift"?d[0]:p&&(s.prerelease||!p.prerelease)?p:d[0];if(!f||ac(f,s)<=0)return{outcome:"up-to-date"};let m=hGe(d,s,r,n),g=d,h=gGe(g,s,n),b=[...new Map([f,...m?[m]:[],...h?[h]:[],...g.slice(0,18)].map(y=>[y.raw,y])).values()].filter(y=>ac(y,s)>0).sort((y,w)=>ac(w,y)).map(y=>y.raw);return{outcome:"upgrade",latest:f.raw,...m?{safeLatest:m.raw}:{},...h?{latestMinor:h.raw}:{},versions:b}}function gU(e){let t=e.trim().replace(/^[^\d]*/,"");return/^\d{4}[.-]\d{1,2}[.-]\d{1,2}(?:[.-]\d+)?(?:$|[-+])/.test(t)?"calendar":Te(e,"swift")?"semver":"unknown"}var lGe="https://repo1.maven.org/maven2";async function hU(e){switch(e.ecosystem){case"npm":return pGe(e.name);case"swift":return fGe(e.name,e.githubToken);case"opam":return mGe(e.name,e.githubToken);case"maven":return uGe(e.name);default:{let t=await qn(e.name,e.ecosystem,null);return t?{latest:null,versions:t.versions}:null}}}async function uGe(e){let[t,n]=e.split(":");if(!t||!n)return null;let i=await rt(`${lGe}/${t.replace(/\./g,"/")}/${n}/maven-metadata.xml`);if(i===null){let s=await qn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}let r=/([^<]+)<\/release>/.exec(i)?.[1]?.trim()??null,o=[...i.matchAll(/([^<]+)<\/version>/g)].map(s=>s[1].trim());if(o.length===0){let s=await qn(e,"maven",null);return s?{latest:null,versions:s.versions}:null}return{latest:r,versions:o}}var dGe="application/vnd.npm.install-v1+json, application/json";async function pGe(e){let t=await _e(`https://registry.npmjs.org/${encodeURIComponent(e).replaceAll("%40","@")}`,{timeoutMs:12e3,headers:{Accept:dGe}});return t?{latest:t["dist-tags"]?.latest?.trim()??null,versions:Object.keys(t.versions??{})}:null}function Hne(e){return{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28",...e?{Authorization:`Bearer ${e}`}:{}}}async function fGe(e,t){if(!/^[\w.-]+\/[\w.-]+$/.test(e))return null;let n=100,i=20,r=[];for(let o=1;o<=i;o++){let s=await _e(`https://api.github.com/repos/${e}/tags?per_page=${n}&page=${o}`,{headers:Hne(t)});if(!s)return o===1?null:{latest:null,versions:[...new Set(r)],complete:!1};if(r.push(...s.map(a=>a.name).filter(a=>!!a)),s.lengthi.sameCompatibilityLine(t,r)===!0).sort((r,o)=>ac(o,r))[0]}function hGe(e,t,n,i){let r=Gi(i),s=e.filter(a=>ac(a,t)>0).map(a=>({version:a,satisfies:r.satisfies(a,n)}));if(!s.some(a=>a.satisfies===null))return s.filter(a=>a.satisfies).map(a=>a.version).sort((a,c)=>ac(c,a))[0]}function zx(e,t,n,i,r){if(!r)return e>0?`${e} breaking change${e===1?"":"s"} found in ${i}.`:`No breaking changes found for this version of ${i}.`;let{assessment:o,security:s}=r,a=ou[o.recommendation],c=[],l=new Map(t.map(g=>[g.id,g])),u=n.filter(g=>l.get(g.breakingChangeId)?.kind!=="runtime-requirement"),d=n.filter(g=>l.get(g.breakingChangeId)?.kind==="runtime-requirement");u.length>0&&c.push(`${u.length} place${u.length===1?"":"s"} in this repository use${u.length===1?"s":""} an API that ${i} changed`),c.push(...yGe(d));let p=o.runtimeCompatibility,f=p==="unknown"||p==="partial";d.length===0&&p==="unknown"&&c.push("this upgrade's runtime requirement could not be checked against this repository");let m=t.filter(g=>g.kind!=="runtime-requirement").length;if(u.length===0&&d.length===0&&m>0&&!f){let g=Of(t);c.push(g?`${m} published ${g} change${m===1?"":"s"} ${m===1?"requires":"require"} review; ${m===1?"this package-role contract is":"these package-role contracts are"} assessed independently of source call signatures`:`${m} upstream API breaking change${m===1?"":"s"}, no usage of the changed parts located in this repository \u2014 review before upgrading`)}return s.checked&&s.resolved.length>0&&c.push(`fixes ${s.resolved.length} known ${s.resolved.length===1?"vulnerability":"vulnerabilities"}`),s.checked&&s.introduced.length>0&&c.push(`introduces ${s.introduced.length} known ${s.introduced.length===1?"vulnerability":"vulnerabilities"}`),c.length===0&&r.gaps.length>0?`${a}. ${r.gaps.join(" ")}`:c.length===0?`${a}. No breaking changes found for this version of ${i}.`:`${a}. ${bGe(c.join("; "))}.`}function yGe(e){let t=[],n=e.filter(o=>o.runtimeVerdict!=="partial"&&o.runtimeVerdict!=="unknown"),i=e.filter(o=>o.runtimeVerdict==="partial"),r=e.filter(o=>o.runtimeVerdict==="unknown");if(n.length>0){let o=n.length;t.push(`${o} runtime declaration${o===1?"":"s"} in this repository do${o===1?"es":""} not satisfy this upgrade's runtime requirement`)}if(i.length>0){let o=i.length;t.push(`${o} runtime declaration${o===1?"":"s"} only partially satisf${o===1?"ies":"y"} this upgrade's runtime requirement`)}if(r.length>0){let o=r.length;t.push(`${o} runtime declaration${o===1?"":"s"} could not be resolved, so compatibility is unknown`)}return t}function bGe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Gx(e,t){let n={...e,verification:t};if(!n.plan||(n.plan=Mx(n.plan,t),t.status==="skipped"))return n;n.breakingCount=n.plan.upstreamBreakingCount??n.plan.breakingChanges.length,n.impactCount=n.plan.impactSites.length,n.impactFiles=new Set(n.plan.impactSites.map(r=>r.file)).size;let i=n.plan.dispositions;return i&&(n.actionableImpactCount=i.reduce((r,o)=>r+o.actionableSites.length,0),n.actionableImpactFiles=new Set(i.flatMap(r=>r.actionableSites.map(o=>o.file))).size,n.runtimeDeclarationSiteCount=i.filter(r=>r.runtimeAnalysis!==void 0).reduce((r,o)=>r+o.sites.length,0)),n.rationale&&(n.rationale=n.plan.rationale?.find(r=>r.dependency===n.rationale.dependency)??n.plan.rationale?.[0]??n.rationale),n.risk=n.plan.risk,n.verifiedUnaffected=t.status==="passed"&&qy(t)==="isolated"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&Array.isArray(n.plan.dispositions)&&n.plan.dispositions.every(r=>r.state==="unaffected")&&(n.plan.breakingChanges.length>0||(n.plan.upstreamBreakingCount??0)>0),n.impactPendingIsolatedClearance=qy(t)==="batch"&&t.checks.some(r=>r.status==="passed"&&r.compileCapable)&&n.plan.impactSites.some(r=>{let o=n.plan.breakingChanges.find(s=>s.id===r.breakingChangeId);return o!==void 0&&tU(o)}),n.summary=zx(n.breakingCount,n.plan.breakingChanges,n.plan.impactSites,n.name,n.rationale),n}var Qne=(0,Yne.promisify)(Zne.execFile);function vGe(e,t){return t?[...e]:e.map(n=>n.state==="incompatible"||n.state==="partial"?n:{...n,state:"unknown",reason:"config-incomplete",statement:`${n.statement} Drift could not index every authoritative runtime configuration file, so this result is incomplete.`})}function Xne(e,t){return`${e}\0${t}`}var wGe={includeDev:!0,maxSites:40,maxPackages:0};function ere(e){return{available:!1,reason:e.reason,inspection:e.reason==="no-public-surface"?"succeeded":e.reason==="artifact-type-unsupported"?"not-applicable":"failed",tool:e.tool,detail:e.detail,...e.packageRole?{packageRole:e.packageRole}:{},...e.diagnostic?{diagnostic:e.diagnostic}:{}}}async function vU(e,t=[""],n=new Map,i=Wn()){let r=[],o=[],s=await $Ge(e,i);for(let a of t){let c=a?(0,vr.join)(e,a):e,l=await i.readDirectory(c);if(l.length===0)continue;let u=[...l,...await kGe(c,l,i)],d=da({entries:u,read:p=>are((0,vr.join)(c,p))});if(d.length!==0){for(let p of dH(d))(n.get(Xne(a,p.ecosystem))??(a?s.get(p.ecosystem):void 0))||o.push({...p,dir:a});for(let p of _Ge(d,a,n,s)){let f=p.manager.manifestPattern?u.filter(h=>p.manager.manifestPattern.test(h)):[],m=p.manager.manifests.find(h=>u.includes(h))??f.find(yP)??f[0];if(!m)continue;let g=p.manager.lockfiles.find(h=>u.includes(h))??null;if(p.manager.id==="pip"&&yP(m)){let h=m.replace(/\.in$/i,".txt");if(u.includes(h)){let b=await i.readFile((0,vr.join)(c,h));b&&Gk(b)&&(g=h)}}r.push({manager:p.manager,dir:a,manifestPath:a?`${a}/${m}`:m,lockfilePath:g?a?`${a}/${g}`:g:null})}}}return{targets:r,ambiguities:o}}async function kGe(e,t,n){let i=new Set;for(let o of ua)for(let s of[...o.manifests,...o.lockfiles])s.includes("/")&&i.add(s);let r=[];for(let o of i){if(t.includes(o))continue;let s=o.slice(0,o.indexOf("/"));t.includes(s)&&await n.readFile((0,vr.join)(e,o))!==null&&r.push(o)}return r}function _Ge(e,t,n,i=new Map){let r=new Set,o=[];for(let s of new Set(e.map(a=>a.manager.ecosystem))){let a=e.filter(u=>u.manager.ecosystem===s),c=n.get(Xne(t,s)),l=a.find(u=>u.manager.id===c)??a.find(u=>u.manager.id===i.get(s))??a[0];r.has(s)||(r.add(s),o.push(l))}return o}async function $Ge(e,t){let n=await t.readDirectory(e),i=da({entries:n,read:o=>are((0,vr.join)(e,o))}),r=new Map;for(let o of i)o.fromLockfile&&r.set(o.manager.ecosystem,o.manager.id);return r}async function tre(e){let{root:t,repo:n,config:i,logger:r,githubToken:o,onProgress:s,onCandidate:a,onDropped:c,onOutdated:l,token:u,repoLabel:d}=e,p=e.breadth??wGe,f=e.fs??Wn(),m=e.env??process.env,g=Math.max(1,Math.min(32,Math.floor(e.concurrency??q1(m))||1));r.debug(`Scan parallelism: ${une(m)}`);let h={enabled:(e.verify?.enabled??!1)&&i.verify.enabled,checks:e.verify?.checks??i.verify.checks,timeoutMs:e.verify?.timeoutMs??i.verify.timeoutMs,generatedSourceGlobs:e.verify?.generatedSourceGlobs??i.verify.generatedSourceGlobs,baselineCache:e.verify?.baselineCache},b=Date.now(),y=(z,Y,Re=0,Ee=0)=>{let Ge=Date.now();r.debug(`${z} (+${Ge-b}ms): ${Y}`),b=Ge,s?.({phase:z,detail:Y,done:Re,total:Ee})},w=It("scan","total"),k=It("discover","manifests");y("Looking for manifests",t);let $=await Td(t,f),S=Id($),x=await t_(t,f,S).catch(()=>[]),E=x.filter(z=>z.hasOwnGit),T=x.filter(z=>!z.hasOwnGit).map(z=>z.dir),A=[...S,...T],L=e.dirs??A;if($.length>0||T.length>0){let z=[...$.map(Y=>Y.kind),...T.length>0?["undeclared"]:[]];y("Reading the workspace",`${L.length} package${L.length===1?"":"s"} \xB7 ${z.join(", ")}`)}let F=Fc("manifest.discovery"),{targets:H,ambiguities:te}=await vU(t,L,e.managers??new Map,f);if(H.length===0)return k.end({targets:0}),F.end({targets:0}),w.end({checked:0,candidates:0}),{candidates:[],checked:0,upToDate:0,unchecked:[],targets:H,workspaces:$,ambiguities:te,nestedGitRepos:E};let D=new Map;for(let z of $)for(let Y of z.members)Y.name&&D.set(Y.dir,Y.name);for(let z of H){if(D.has(z.dir))continue;let Y=z.manifestPath.includes("/")?z.manifestPath.slice(z.manifestPath.lastIndexOf("/")+1):z.manifestPath,Re=await Bg(t,f,z.dir,Y,z.manager.ecosystem).catch(()=>null);Re&&D.set(z.dir,Re)}k.end({targets:H.length}),F.end({targets:H.length,manifests:H.length});let X=new Set(i.ecosystems),re=A.length>1||new Set(H.map(z=>z.dir)).size>1,ie=new Set,ke=(z,Y)=>{ie.add(Bx(z,d?t:void 0)),a?.(sre({dep:z,member:re?z.target.dir:void 0,memberName:re?D.get(z.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,phase:Y}))},We=(z,Y)=>RGe(z,Y,"Waiting to be checked",{...re?{member:z.target.dir}:{},...re&&D.get(z.target.dir)?{memberName:D.get(z.target.dir)}:{},...d?{repoRoot:t,repoLabel:d}:{}}),ye=()=>{for(let z of ae)ie.delete(z.id);for(let z of ie)c?.(z);ie.clear()},xt=z=>{let Y=Bx(z,d?t:void 0);ie.delete(Y),c?.(Y)},bt=[],pt=[];for(let z of H){if(!X.has(z.manager.ecosystem))continue;y("Reading manifest",z.manifestPath);let Y=await wU(t,z,p.includeDev,f),Re=p.maxPackages>0?Math.max(0,p.maxPackages-bt.length):Y.dependencies.length;for(let Ee of Y.dependencies.slice(0,Re))ke(Ee,"Waiting to be checked");bt.push(...Y.dependencies),pt.push(...Y.unresolved)}if(pt.length>0){let z=[];await yU(pt,xx(m),async Y=>{let Re=Y.ecosystem,Ee=Y.current==="unspecified"?"*":Y.current,Ge=H.find(ao=>ao.manifestPath===Y.manifestPath);if(!Ge){z.push(Y);return}let Di=((await hU({name:Y.name,ecosystem:Re,current:Ee,range:Ee,...o?{githubToken:o}:{}}).catch(()=>null))?.versions??[]).filter(ao=>CW(ao,Ee,Re)===!0).sort((ao,dE)=>Pg(dE,ao,Re)??0)[0];if(!Di){z.push(Y);return}let lb={name:Y.name,kind:Y.kind,current:Di,range:Ee,assumed:!0,target:Ge};ke(lb,"Waiting to be checked"),bt.push(lb)}),pt.length=0,pt.push(...z)}let ft=p.maxPackages>0?bt.slice(0,p.maxPackages):bt;y("Indexing your code","Walking source files",0,ft.length);let Rn=It("index","walk+build"),Ni=Rd(t,{members:L}).then(z=>{y("Indexing your code",`${z.length} file${z.length===1?"":"s"} indexed \xB7 ${ft.length} direct dependenc${ft.length===1?"y":"ies"} to check`,0,ft.length);let Y={files:z,index:Sf(z)};return Rn.end({files:z.length}),Y});Ni.catch(()=>{});let jn=0,Pi=0,fe=0,ae=[],be=[...pt],Mt=z=>h.enabled&&z.size>0&&!u?.isCancellationRequested?xne({root:t,targets:[],kinds:h.checks,env:m,logger:r,timeoutMs:h.timeoutMs,...h.generatedSourceGlobs?{allowedGlobs:h.generatedSourceGlobs}:{},...h.baselineCache?{baselineCache:h.baselineCache}:{},...u?{token:u}:{}},[...new Map(H.filter(Y=>z.has(Y.dir)).map(Y=>[Y.dir,Y])).values()].map(Y=>({dir:Y.dir,packageManager:Y.manager.id})),Y=>Y.output!==void 0?s?.({phase:"",detail:"",done:0,total:0,output:Y.output}):y(Y.phase,Y.detail)):void 0;y("Checking registries",`${ft.length} direct dependenc${ft.length===1?"y":"ies"}`,0,ft.length);let vt=[],on=new Map,ii=It("phase","version-discovery");await Vr("version.discovery",{dependencies:ft.length},()=>yU(ft,xx(m),async z=>{if(u?.isCancellationRequested)return;let Y=jx(z.target.manager.ecosystem);ke(z,`Asking ${Y} what has been published`);let Re=Fc("registry.lookup",{package:z.name}),Ee=JSON.stringify([z.target.manager.ecosystem,z.name,z.current,z.range??null]),Ge=on.get(Ee);Ge||(Ge=Sn("versions",z.target.manager.ecosystem,()=>Kne({name:z.name,ecosystem:z.target.manager.ecosystem,current:z.current,range:z.range,...o?{githubToken:o}:{}})),on.set(Ee,Ge),Ge.then(oi=>{oi.outcome==="unchecked"&&on.get(Ee)===Ge&&on.delete(Ee)},()=>{on.get(Ee)===Ge&&on.delete(Ee)}));let Et=await Ge;if(Re.end({outcome:Et.outcome}),Et.outcome==="up-to-date"){jn+=1,Pi+=1,xt(z),y("Up to date",`${z.name}@${z.current}`,Pi,ft.length);return}if(Et.outcome==="unchecked"){be.push({name:z.name,kind:z.kind,ecosystem:z.target.manager.ecosystem,packageManager:z.target.manager.id,manifestPath:z.target.manifestPath,current:z.current,reason:Et.reason}),Pi+=1,xt(z),y("Could not check",`${z.name}@${z.current} \xB7 ${Et.reason}`,Pi,ft.length);return}vt.push({dep:z,available:Et}),Pi+=1,a?.(We(z,Et)),y("Outdated",`${z.name} ${z.current} \u2192 ${Et.safeLatest??Et.latest}`,Pi,ft.length)})),ii.end({checked:ft.length,outdated:vt.length}),vt.sort((z,Y)=>z.dep.name.localeCompare(Y.dep.name));let so=Mt(new Set(vt.map(({dep:z})=>z.target.dir)));if(l?.({outdated:vt.map(({dep:z,available:Y})=>We(z,Y)),checked:ft.length,upToDate:jn,unchecked:[...be]}),u?.isCancellationRequested)return ye(),await so?.dispose(),w.end({cancelled:!0}),{candidates:[],checked:ft.length,upToDate:jn,unchecked:be,targets:H,workspaces:$,ambiguities:te,nestedGitRepos:E};let $t=It("phase","analysis"),tt=new Map;for(let{dep:z,available:Y}of vt){let Re=Y.safeLatest??Y.latest,Ee=UP({ecosystem:z.target.manager.ecosystem,name:z.name,from:z.current,to:Re});tt.has(Ee)||tt.set(Ee,{name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Re})}let zn=i.rationale.security&&tt.size>0?Vr("security.batch",{upgrades:tt.size},async()=>{let z=[...tt.keys()],Y=[...tt.values()];try{let Re=await Gy(Y,{});return new Map(z.map((Ee,Ge)=>[Ee,Re.get(Y[Ge])??Uo("The OSV advisory batch lookup did not return a result for this upgrade, so its effect on known vulnerabilities is unknown.")]))}catch(Re){let Ee=`The OSV advisory batch lookup failed unexpectedly (${Re.message}), so this upgrade's effect on known vulnerabilities is unknown.`;return new Map(z.map(Ge=>[Ge,Uo(Ee)]))}}):void 0;zn?.catch(()=>{});let cb=z=>zn?.then(Y=>Y.get(z)),Ts=new Map,Gn=new Map,Go=new Map,gu=new Map,uE=(z,Y,Re)=>{gu.set(z,[Y,Re]);for(let Ee of Go.get(z)??[])Ee(Y,Re)},Uie=(z,Y)=>{let Re=Go.get(z);Re||(Re=new Set,Go.set(z,Re)),Re.add(Y);let Ee=gu.get(z);return Ee&&Y(Ee[0],Ee[1]),()=>{Re.delete(Y),Re.size===0&&(Go.delete(z),gu.delete(z))}},jie=(z,Y,Re)=>{let Ee={name:z.name,ecosystem:z.target.manager.ecosystem,from:z.current,to:Y,kind:z.kind,bump:ta(z.current,Y,z.target.manager.ecosystem),manifestPath:z.target.manifestPath,rawFrom:z.current,rawTo:Y},Ge=UP(Ee),Et=`${z.name} ${Ee.from} \u2192 ${Ee.to}`,oi=Re?Uie(Ge,Re):void 0,Di=Ts.get(Ge),lb=Di!==void 0;if(!Di){let co=new Map,hu=new Map,HU=new Set,pE=new Map,fE=new Map;uE(Ge,"Reading release notes and changelog",Et);let ub=Vr("upstream.analysis",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,shared:!1},()=>KO(Ee,{config:i,logger:r,...o?{githubToken:o}:{},env:m,workspaceRoot:t,onSurfaceComputed:(cc,Oi)=>{let Vo=an(cc);Oi.weight>=.8&&HU.add(Vo),pE.set(Vo,{available:!0,inspection:"succeeded",tool:Oi.tool,...Oi.packageRole?{packageRole:Oi.packageRole}:{}}),co.set(Vo,{additions:Oi.additions??[],locator:Oi.locator}),uE(Ge,"Comparing the public API surface",Et)},onUnavailableSurface:(cc,Oi)=>{let Vo=an(cc);hu.set(Vo,Oi),pE.set(Vo,ere(Oi))},onProseConsulted:(cc,Oi)=>{let Vo=an(cc);fE.set(Vo,[...fE.get(Vo)??[],Oi])}}).then(cc=>({evidence:cc,additions:co,surfaceGaps:hu,surfaceCompared:HU,surfaceAssessments:pE,prose:fE})));Ts.set(Ge,ub),Di=ub,ub.catch(()=>{Ts.get(Ge)===ub&&Ts.delete(Ge)})}let ao=Gn.get(Ge),dE=ao!==void 0;if(!ao){let co=U1(Ee,{config:i,...o?{githubToken:o}:{},securityLookup:cb(Ge),onProgress:hu=>uE(Ge,hu,Et)});Gn.set(Ge,co),ao=co,co.catch(()=>{Gn.get(Ge)===co&&Gn.delete(Ge)})}let zie=Di,KU=ao;return Vr("upstream.wait",{package:z.name,ecosystem:Ee.ecosystem,from:Ee.from,to:Ee.to,evidenceShared:lb,rationaleShared:dE},async()=>{let[co,hu]=await Promise.allSettled([zie,KU]);return oi?.(),{evidence:co.status==="fulfilled"?co.value:void 0,rationaleFacts:hu.status==="fulfilled"?KU:void 0}})};try{await Vr("analysis",{packages:vt.length},()=>yU(vt,g,async({dep:Y,available:Re})=>{if(u?.isCancellationRequested)return;let Ee=Re.safeLatest??Re.latest,Ge;try{Ge=await jie(Y,Ee,(oi,Di)=>{y(oi,Di,fe,vt.length),ke(Y,oi)})}catch(oi){r.debug(`Shared upstream analysis failed for ${Y.name} ${Y.current} \u2192 ${Ee}: ${oi.message}. Falling back to independent analysis for this row.`)}let Et=await Vr("package",{package:Y.name,ecosystem:Y.target.manager.ecosystem,from:Y.current,to:Ee},()=>TGe({dep:Y,selected:Ee,versions:Re.versions,latest:Re.latest,safeLatest:Re.safeLatest,latestMinor:Re.latestMinor,repo:n,config:i,githubToken:o,root:t,indexing:Ni,logger:r,env:m,maxSites:p.maxSites,member:re?Y.target.dir:void 0,allMembers:re?A:void 0,memberName:re?D.get(Y.target.dir):void 0,repoRoot:d?t:void 0,repoLabel:d,prepared:Ge,onProgress:(oi,Di)=>{y(oi,Di,fe,vt.length),ke(Y,oi)}}));ae.push(Et),a?.(h.enabled?{...Et,status:"checking",phase:"Waiting to be installed and tested"}:Et),fe+=1,y(Jy(Et)==="affected"?"Needs your attention":"Checked",`${Et.name} ${Et.current} \u2192 ${Et.selected} \xB7 ${qne(Et).toLowerCase()}`,fe,vt.length)})),$t.end({packages:vt.length});let z=It("phase","verification");try{h.enabled&&ae.length>0&&!u?.isCancellationRequested&&await Vr("verification",{candidates:ae.length},()=>SGe({root:t,candidates:ae,checks:h.checks,timeoutMs:h.timeoutMs,generatedSourceGlobs:h.generatedSourceGlobs,...h.baselineCache?{baselineCache:h.baselineCache}:{},env:m,logger:r,...so?{warm:so}:{},...u?{token:u}:{},onProgress:Y=>{if(Y.output!==void 0){s?.({phase:"",detail:"",done:Y.done,total:Y.total,output:Y.output});return}y(Y.phase,Y.detail,Y.done,Y.total);for(let Re of Y.targets??[]){let Ee=ae.findIndex(Et=>Et.id===Re),Ge=Ee>=0?ae[Ee]:void 0;!Ge||Ge.verification||a?.({...Ge,status:"checking",phase:Y.detail?`${Y.phase} \xB7 ${Y.detail}`:Y.phase})}},onCandidate:a}))}finally{if(h.enabled)for(let[Y,Re]of ae.entries()){if(Re.verification)continue;let Ee=Gx(Re,{status:"skipped",reason:u?.isCancellationRequested?`The scan was stopped before ${Re.name} ${Re.selected} could be installed and checked, so the findings below are predictions.`:`${Re.name} ${Re.selected} was not installed and checked, so the findings below are predictions.`,checks:[],failedFiles:[]});ae[Y]=Ee,a?.(Ee)}await so?.dispose(),z.end({candidates:ae.length})}}finally{ye()}return w.end({checked:ft.length,candidates:ae.length}),{candidates:ae.sort(NGe),checked:ft.length,upToDate:jn,unchecked:be,targets:H,workspaces:$,ambiguities:te,nestedGitRepos:E}}async function SGe(e){let t=new Map(e.candidates.map(o=>[o.id,o])),n=e.candidates.filter(o=>o.rationale?.maintenance.deprecated);for(let o of n){let s=o.rationale?.maintenance.deprecated,a=Gx(o,{status:"skipped",reason:`${o.name} ${o.selected} has been withdrawn (${s}), so it cannot be installed to test.`,checks:[],failedFiles:[]}),c=e.candidates.indexOf(o);c>=0&&(e.candidates[c]=a),e.onCandidate?.(a)}let r=e.candidates.filter(o=>!n.includes(o)).map(o=>({id:o.id,name:o.name,current:o.current,selected:o.selected,manifestPath:o.manifestPath,packageManager:o.packageManager,install:s=>xGe(s,o,"safe",lu(e.env))}));await $ne({root:e.root,targets:r,installTogether:(o,s)=>EGe(o,s.map(a=>t.get(a.id)).filter(a=>a!==void 0),"safe",lu(e.env)),kinds:e.checks,env:e.env,logger:e.logger,timeoutMs:e.timeoutMs,...e.generatedSourceGlobs?{allowedGlobs:e.generatedSourceGlobs}:{},...e.baselineCache?{baselineCache:e.baselineCache}:{},...e.warm?{warm:e.warm}:{},...e.token?{token:e.token}:{},onProgress:o=>e.onProgress?.({phase:o.phase,detail:o.detail,done:o.done,total:o.total,...o.targets?{targets:o.targets}:{},...o.output!==void 0?{output:o.output}:{}}),onVerified:(o,s)=>{let a=t.get(o.id);if(!a)return;let c=Gx(a,s),l=e.candidates.indexOf(a);l>=0&&(e.candidates[l]=c);let u=(a.plan?.breakingChanges.length??0)-(c.plan?.breakingChanges.length??0);e.logger.info(`${o.name}@${o.selected}: ${Wy(s)}`+(u>0?` ${u} predicted finding(s) dropped as disproved.`:"")),e.onCandidate?.(c)}})}async function yU(e,t,n){let i=0,r=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let o=i;i+=1;let s=e[o];if(s===void 0)return;await n(s)}});await Promise.all(r)}var bU=class extends Error{constructor(n){super(`${n.packageManager} cannot pin a version from the command line. Edit ${n.manifestPath} to require ${n.name} ${n.selected}, then re-run the scan.`);this.candidate=n}candidate};function nre(e,t="safe"){let n=rre(e,t);return n?pH(n):null}function rre(e,t){let i=zc(e.packageManager)?.upgrade(Vx(e));return i?t==="force"&&e.packageManager==="npm"?{...i,args:[...i.args,"--force"]}:i:null}function Vx(e){return{name:e.name,version:e.selected,kind:e.kind,...e.cargo?{cargo:e.cargo}:{}}}async function xGe(e,t,n="safe",i=process.env){let r=rre(t,n);if(!r)throw new bU(t);let o=zc(t.packageManager),s=(0,vr.join)(e,t.manifestPath),a=(0,vr.dirname)(s),c=await ire([s,...(o?.lockfiles??[]).map(l=>(0,vr.join)(a,l))]);try{if(o?.rewriteManifest){let l=await(0,zo.readFile)(s,"utf8"),u=o.rewriteManifest(l,Vx(t),t.manifestPath);u!==l&&await(0,zo.writeFile)(s,u,"utf8")}await Qne(r.command,r.args,{cwd:a,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}catch(l){throw await ore(c),l.code==="ENOENT"?new Error(`${r.command} was not found on PATH. Run \`command -v ${r.command}\` to check, and install it if it is genuinely missing.`):l}}async function EGe(e,t,n="safe",i=process.env){if(t.length===0)return!1;let r=t[0];if(!t.every(d=>d.manifestPath===r.manifestPath&&d.packageManager===r.packageManager))return!1;let s=zc(r.packageManager);if(!s)return!1;let a=uH(s,t.map(Vx));if(!a)return!1;let c=(0,vr.join)(e,r.manifestPath),l=(0,vr.dirname)(c),u=await ire([c,...(s.lockfiles??[]).map(d=>(0,vr.join)(l,d))]);try{if(s.rewriteManifest){let d=await(0,zo.readFile)(c,"utf8"),p=d;for(let f of t)p=s.rewriteManifest(p,Vx(f),f.manifestPath);p!==d&&await(0,zo.writeFile)(c,p,"utf8")}for(let d of a){let p=n==="force"&&r.packageManager==="npm"?[...d.args,"--force"]:d.args;await Qne(d.command,p,{cwd:l,env:i,shell:process.platform==="win32",windowsHide:!0,maxBuffer:8*1024*1024})}}catch(d){throw await ore(u),d.code==="ENOENT"?new Error(`${a[0].command} was not found on PATH. Run \`command -v ${a[0].command}\` to check, and install it if it is genuinely missing.`):d}return!0}async function ire(e){return Promise.all(e.map(async t=>({path:t,content:await(0,zo.readFile)(t,"utf8").catch(()=>null)})))}async function ore(e){await Promise.all(e.map(async({path:t,content:n})=>{try{n===null?await(0,zo.rm)(t,{force:!0}):await(0,zo.writeFile)(t,n,"utf8")}catch{}}))}async function TGe(e){let t=`${e.dep.name} ${e.dep.current} \u2192 ${e.selected}`,n=e.onProgress??(()=>{}),{target:i}=e.dep,r={name:e.dep.name,ecosystem:i.manager.ecosystem,from:e.dep.current,to:e.selected,kind:e.dep.kind,bump:ta(e.dep.current,e.selected,i.manager.ecosystem),manifestPath:i.manifestPath,rawFrom:e.dep.current,rawTo:e.selected,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{}},o={id:Bx(e.dep,e.repoRoot),name:e.dep.name,kind:e.dep.kind,ecosystem:i.manager.ecosystem,packageManager:i.manager.id,manifestPath:i.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},...e.allMembers?{allMembers:e.allMembers}:{},current:e.dep.current,...e.dep.assumed?{assumed:!0}:{},range:e.dep.range,safeLatest:e.safeLatest,latestMinor:e.latestMinor,selected:e.selected,latest:e.latest,versions:e.versions};try{n("Reading release notes and changelog",t);let s=new Map,a=new Map,c=new Set,l=new Map,u=new Map,d=e.prepared?.evidence?.evidence.map(T=>e.member===void 0?T:{...T,workspace:e.member})??await Vr("evidence",{package:e.dep.name,ecosystem:i.manager.ecosystem},()=>Sn("evidence",i.manager.ecosystem,()=>KO(r,{config:e.config,logger:e.logger,githubToken:e.githubToken,env:e.env,workspaceRoot:e.root,onSurfaceComputed:(T,A)=>{let L=an(T);A.weight>=.8&&c.add(L),l.set(L,{available:!0,inspection:"succeeded",tool:A.tool,...A.packageRole?{packageRole:A.packageRole}:{}}),s.set(L,{additions:A.additions??[],locator:A.locator})},onUnavailableSurface:(T,A)=>{let L=an(T);a.set(L,A),l.set(L,ere(A))},onProseConsulted:(T,A)=>{let L=an(T);u.set(L,[...u.get(L)??[],A])}}),{package:e.dep.name}));if(e.prepared?.evidence){let T=an(r),A=an({...r,workspace:void 0}),L=e.prepared.evidence;s.clear();let F=L.additions.get(A);F&&s.set(T,F),a.clear();let H=L.surfaceGaps.get(A);H&&a.set(T,H),L.surfaceCompared.has(A)&&c.add(T),l.clear();let te=L.surfaceAssessments.get(A);te&&l.set(T,te),u.clear();let D=L.prose.get(A);D&&u.set(T,D)}n("Comparing the public API surface",`${t} \xB7 ${d.length} evidence source${d.length===1?"":"s"}`);let p=await Vr("api.diff",{package:e.dep.name,evidenceSources:d.length},()=>Sn("analyze",i.manager.ecosystem,()=>YS([r],d,{config:e.config,logger:e.logger})));n(p.length>0?`Searching your code for ${p.length} breaking change${p.length===1?"":"s"}`:"No breaking changes to look for",t);let f=p.length>0?await Sn("module-maps",i.manager.ecosystem,()=>XS([r],{logger:e.logger})):void 0,m=It("index-wait",i.manager.ecosystem),{files:g,index:h}=await e.indexing;m.end();let b=It("localize",i.manager.ecosystem,{changes:p.length}),y=Fc("localization",{package:e.dep.name,changes:p.length,filesConsidered:g.length}),{sites:w,runtimeAnalyses:k}=lx(p,[r],h,g,{logger:e.logger,maxSitesPerChange:e.maxSites??40,member:e.member,members:e.allMembers,...f?{moduleMaps:f}:{}}),$=vGe(k,g.coverage.runtimeConfigComplete);b.end({sites:w.length}),y.end({sites:w.length}),n("Weighing what this upgrade is worth",t);let[S]=await Sn("rationale",i.manager.ecosystem,()=>wx({changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:$,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated},{config:e.config,logger:e.logger,githubToken:e.githubToken,additions:s,surfaceCompared:c,surfaceGaps:a,prose:u,...e.prepared?.rationaleFacts?{preparedFacts:new Map([[r,e.prepared.rationaleFacts]])}:{},repoRuntime:If(g,e.member,e.allMembers),pythonRuntime:Af(g,e.member,e.allMembers),onProgress:(T,A)=>n(A,t)})),x=yx({repo:e.repo,config:e.config,changes:[r],evidence:d,breakingChanges:p,impactSites:w,runtimeAnalyses:$,localizationRan:!0,localizationComplete:!g.coverage.sourceTruncated,runtimeConfigComplete:g.coverage.runtimeConfigComplete,...S?{rationale:[S]}:{}}),E=l.get(an(r));return{...o,status:p.length>0?"ready":"clean",evidenceCount:d.length,breakingCount:p.length,impactCount:w.length,actionableImpactCount:(x.dispositions??[]).reduce((T,A)=>T+A.actionableSites.length,0),actionableImpactFiles:new Set((x.dispositions??[]).flatMap(T=>T.actionableSites.map(A=>A.file))).size,runtimeDeclarationSiteCount:(x.dispositions??[]).filter(T=>T.runtimeAnalysis!==void 0).reduce((T,A)=>T+A.sites.length,0),impactFiles:new Set(w.map(T=>T.file)).size,impactConfidence:IGe(w),sourceCoverage:g.coverage,...E?{surfaceAssessment:E}:{},risk:x.risk,summary:zx(p.length,p,w,e.dep.name,S),gaps:S?.gaps??[],toolRequests:AGe(a),...S?{rationale:S,recommendation:S.assessment.recommendation,...S.assessment.runtimeCompatibility?{runtimeCompatibility:S.assessment.runtimeCompatibility}:{},...$.length>0?{runtimeAnalyses:$.map(T=>({changeId:T.changeId,runtime:T.runtime,state:T.state,reason:T.reason,siteCount:T.sites.length,declarationCount:T.declarations.length,unresolvedCount:T.unresolved.length,statement:T.statement}))}:{}}:{},plan:x}}catch(s){return{...o,status:"error",evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"Could not inspect this upgrade",gaps:[],toolRequests:[],error:s.message}}}function IGe(e){return e.some(t=>t.confidence==="high")?"high":e.some(t=>t.confidence==="medium")?"medium":e.some(t=>t.confidence==="low")?"low":"none"}function AGe(e){let t=new Set,n=[];for(let i of e.values())!i.install||t.has(i.install.id)||(t.add(i.install.id),n.push(i.install));return n}function Bx(e,t){return`${t?`${t}::`:""}${e.target.manifestPath}#${e.name}@${e.current}`}function sre(e){let{dep:t}=e;return{id:Bx(t,e.repoRoot),name:t.name,kind:t.kind,...t.cargo?{cargo:t.cargo}:{},ecosystem:t.target.manager.ecosystem,packageManager:t.target.manager.id,manifestPath:t.target.manifestPath,...e.member===void 0?{}:{workspace:e.member},...e.memberName?{workspaceName:e.memberName}:{},...e.repoRoot?{repoRoot:e.repoRoot,repoLabel:e.repoLabel}:{},current:t.current,...t.assumed?{assumed:!0}:{},range:t.range,selected:t.current,latest:t.current,versions:[],status:"pending",phase:e.phase,evidenceCount:0,breakingCount:0,impactCount:0,actionableImpactCount:0,actionableImpactFiles:0,runtimeDeclarationSiteCount:0,impactFiles:0,impactConfidence:"none",risk:"unknown",summary:"",gaps:[],toolRequests:[]}}function RGe(e,t,n,i){return{...sre({dep:e,phase:n,...i?.member===void 0?{}:{member:i.member},...i?.memberName?{memberName:i.memberName}:{},...i?.repoRoot?{repoRoot:i.repoRoot}:{},...i?.repoLabel?{repoLabel:i.repoLabel}:{}}),selected:t.safeLatest??t.latest,latest:t.latest,...t.safeLatest?{safeLatest:t.safeLatest}:{},...t.latestMinor?{latestMinor:t.latestMinor}:{},versions:t.versions}}async function CGe(e){let t=new Map,n=new Map,i=c=>{let l=c;for(let u=0;u<4&&l.includes("${");u+=1)l=l.replace(/\$\{([^}]+)\}/g,(d,p)=>n.get(p)??d);return l},r=c=>{for(let[u,d]of c.properties)n.has(u)||n.set(u,d);let l=[];for(let[u,d]of c.dependencyManagement){let p=d.split("|"),f=p[0]??"";f&&(p.includes("import")?l.push(`${u}:${f}`):t.has(u)||t.set(u,f))}return l},o;try{o=MO(e)}catch{return t}let s=r(o);o.parent&&s.push(o.parent);let a=new Set;for(let c=0;c<8&&s.length>0;c+=1){let l=s.shift(),[u,d,p]=l.split(":");if(!u||!d||!p)continue;let f=i(p),m=`${u}:${d}:${f}`;if(a.has(m)||f.includes("${"))continue;a.add(m);let g=await d$({groupId:u,artifactId:d},f);if(g.ok){for(let h of r(g.contract))s.push(h);g.contract.parent&&s.push(g.contract.parent)}}for(let[c,l]of t)t.set(c,i(l));return t}async function wU(e,t,n,i){let r=Vk(t.manifestPath),o=await i.readFile((0,vr.join)(e,t.manifestPath));if(!r||o===null)return{dependencies:[],unresolved:[]};let s=r.parse(o,t.manifestPath),a=t.lockfilePath?await i.readFile((0,vr.join)(e,t.lockfilePath)):null,c=a!==null&&t.lockfilePath?Vk(t.lockfilePath)?.parse(a,t.lockfilePath):void 0,l=n?["runtime","dev","optional","peer"]:["runtime"],u=[],d=[];for(let[p,f]of s){if(!l.includes(f.kind))continue;let m=t.manager.ecosystem,g=c?.get(p)?.version??null,h=Gi(m),b=g?h.exactVersion(g)??h.parse(g)?.raw??null:h.exactVersion(f.version??"");if(!b){let y=f.version?.trim()??"";d.push({name:p,kind:f.kind,ecosystem:m,packageManager:t.manager.id,manifestPath:t.manifestPath,current:y||"unspecified",reason:y?`no lockfile entry, and "${y}" is a range rather than one version`:m==="maven"?"no version here and none in a lockfile \u2014 it is set by a parent POM or an imported BOM, which Drift does not fetch yet":"no version declared here, and no lockfile entry to resolve one from"});continue}u.push({name:p,kind:f.kind,...f.cargo?{cargo:f.cargo}:{},current:b,range:f.version??b,target:t})}if(d.length>0&&t.manager.ecosystem==="maven"&&t.manifestPath.endsWith("pom.xml")){let p=await CGe(o);if(p.size>0){let f=Gi("maven"),m=[];for(let g of d){let h=p.get(g.name),b=h?f.exactVersion(h):null;if(!b){m.push(g);continue}u.push({name:g.name,kind:g.kind,current:b,range:h??b,target:t})}d.length=0,d.push(...m)}}return{dependencies:u,unresolved:d}}function are(e){try{return(0,Jne.readFileSync)(e,"utf8")}catch{return null}}function NGe(e,t){let n=Wne(e,t);if(n!==0)return n;if(e.impactCount!==t.impactCount)return t.impactCount-e.impactCount;let i=e.name.localeCompare(t.name);return i!==0?i:e.manifestPath.localeCompare(t.manifestPath)}var PGe=12;async function cre(e,t){if(!t)return e;let n=e.breakingChanges.filter(s=>s.symbols.length>0&&e.impactSites.some(a=>a.breakingChangeId===s.id));if(n.length===0)return e;let i=new Map,r=new Map,o=0;for(let s of n){if(o>=PGe)break;let a=e.changes.find(u=>u.name===s.dependency&&(u.workspace??"")===(s.workspace??""));if(!a?.to||a.ecosystem!=="npm")continue;let c=i.get(a.name);if(c===void 0&&(c=(await qn(a.name,a.ecosystem,a.to))?.githubRepo??null,i.set(a.name,c)),!c)continue;o++;let l=await DGe(c,a.to,s.symbols[0],t);l&&r.set(s.id,l.url)}return r.size===0?e:{...e,breakingChanges:e.breakingChanges.map(s=>r.has(s.id)?{...s,sourceUrl:r.get(s.id)}:s)}}async function DGe(e,t,n,i){let r={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};i&&(r.Authorization=`Bearer ${i}`);let o=await OGe(e,t,r);if(!o)return null;let s=await MGe(e,n,r);if(!s)return null;let a=await LGe(e,o,s,n);return a?{url:`https://github.com/${e}/blob/${o}/${s.split("/").map(encodeURIComponent).join("/")}#L${a}`,line:a}:null}async function OGe(e,t,n){return(await _e(`https://api.github.com/repos/${e}/tags?per_page=100`,{headers:n})??[]).find(o=>!!o.name&&ep(o.name,t))?.name??null}async function MGe(e,t,n){let i=encodeURIComponent(`${t} repo:${e} language:TypeScript`);return((await _e(`https://api.github.com/search/code?q=${i}&per_page=5`,{headers:n}))?.items??[]).map(s=>s.path).find(s=>!!s&&!s.endsWith(".d.ts")&&!s.includes("node_modules/"))??null}async function LGe(e,t,n,i){let r=await rt(`https://raw.githubusercontent.com/${e}/${t}/${n}`);if(!r)return null;let o=new RegExp(`\\b(export\\s+)?(declare\\s+)?(default\\s+)?(function|const|class|interface|type|enum)\\s+${FGe(i)}\\b`),a=r.split(` +`).findIndex(c=>o.test(c));return a===-1?null:a+1}function FGe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var UGe="Drift",lre="https://github.com/trydrift/drift",_U=9;function gre(e,t){let n=new Map;for(let i of e)n.has(i.ruleId)||n.set(i.ruleId,{id:i.ruleId,name:i.ruleName,...i.helpUri?{helpUri:i.helpUri}:{}});return{$schema:"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",version:"2.1.0",runs:[{tool:{driver:{name:UGe,informationUri:lre,rules:[...n.values()].map(i=>({id:i.id,name:i.name,shortDescription:{text:i.name},fullDescription:{text:"A Drift finding: what changed, where it's used, and the fix \u2014 see the alert body."},helpUri:i.helpUri??lre,defaultConfiguration:{level:"warning"},properties:{tags:["dependencies","drift"]}}))}},...t?{automationDetails:{id:t}}:{},results:e.map(i=>({ruleId:i.ruleId,level:i.level,message:{text:jGe(i.message),markdown:i.message},locations:[dre(i.primaryLocation,i.snippetOk)],...i.relatedLocations.length>0?{relatedLocations:i.relatedLocations.map((r,o)=>({id:o+1,...dre(r)}))}:{},partialFingerprints:{primaryLocationLineHash:GGe(i)}}))}]}}function jGe(e){return e.replace(/\[([^\]]*)\]\(([^)]+)\)/g,"$1 ($2)").replace(/\*\*(.*?)\*\*/g,"$1").replace(/`([^`]*)`/g,"$1").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function ure(e){return e.replace(/&/g,"&").replace(//g,">")}function zGe(e,t,n){let i=n?`${n}/${e}#L${t}`:`${e}#L${t}`;return`[\`${e}:${t}\`](${i})`}function dre(e,t=!1){return{physicalLocation:{artifactLocation:{uri:e.file},region:{startLine:Math.max(1,e.line),...t&&e.excerpt?{snippet:{text:e.excerpt}}:{}}}}}function GGe(e){let t=`${e.ruleId}|${e.primaryLocation.file}|${(e.primaryLocation.excerpt??"").trim()}`;return(0,SU.createHash)("sha256").update(t).digest("hex").slice(0,40)}async function xU(e,t={}){let n=t.includeInformational??!1,i=t.granularity??"package",r=t.repoBlobUrl,o=[];e=await cre(e,t.githubToken);for(let s of e.changes){let a=e.breakingChanges.filter(g=>g.dependency===s.name&&(g.workspace??"")===(s.workspace??"")),c=e.rationale?.find(g=>g.dependency===s.name),l=[],u=0,d=[...a].sort((g,h)=>Wx(h.confidence)-Wx(g.confidence));for(let g of d){let h=e.impactSites.filter(b=>b.breakingChangeId===g.id);if(h.length===0){u++;continue}l.push({breaking:g,block:HGe(g,h,e.evidence)})}let p=[];if(BGe(c)&&p.push(YGe(c)),e.verification?.status==="failed"&&p.push(QGe(e.verification)),l.length===0&&p.length===0)if(u>0){if(!n)continue;p.push(eVe(s,u))}else{if(!n||!c)continue;p.push(XGe(s,c))}let f=e.commits.find(g=>a.some(h=>g.breakingChangeIds.includes(h.id))),m=t.fixOf?.(s)??iVe(f,e);if(i==="package"){let g=[...l.map(h=>h.block),...p];o.push(qx({change:s,blocks:g,upstreamOnlyCount:u,fix:m,repoBlobUrl:r,ruleName:g.length===1&&g[0].ruleNameSuffix?`${s.name}: ${g[0].ruleNameSuffix}`:void 0}));continue}for(let{breaking:g,block:h}of l)if(i==="affectedSite"){let b=[h.primaryCandidate,...h.relatedCandidates].filter(y=>y!==void 0);for(let y of b)o.push(qx({change:s,blocks:[{...h,primaryCandidate:y,relatedCandidates:[]}],upstreamOnlyCount:0,fix:m,ruleIdSuffix:`${g.id}/${VGe(y)}`,ruleName:pre(s,g),snippetOk:!0,repoBlobUrl:r}))}else o.push(qx({change:s,blocks:[h],upstreamOnlyCount:0,fix:m,ruleIdSuffix:g.id,ruleName:pre(s,g),snippetOk:!0,repoBlobUrl:r}));for(let g of p)o.push(qx({change:s,blocks:[g],upstreamOnlyCount:0,fix:m,ruleIdSuffix:"other",ruleName:g.ruleNameSuffix?`${s.name}: ${g.ruleNameSuffix}`:void 0,repoBlobUrl:r}))}return o}function VGe(e){return(0,SU.createHash)("sha256").update(`${e.file}|${(e.excerpt??"").trim()}`).digest("hex").slice(0,10)}function BGe(e){if(!e)return!1;let t=e.security;return t.checked&&(t.resolved.length>0||t.introduced.length>0||t.current.length>0)}async function hre(e,t={}){let n=[];for(let i of e){if(!i.plan)continue;let r=()=>{if(i.plan.commits.length>0)return;let o=nre(i);if(o)return{description:i.verification?.status==="failed"?"The project's own checks failed with this upgrade installed \u2014 measured, not predicted. Do not treat this as safe to upgrade without investigating.":i.breakingCount>0?"The upstream API changed, but no code in this repository was found to use the affected parts. Review before upgrading.":"Safe to upgrade \u2014 no breaking changes found.",command:o}};n.push(...await xU(i.plan,{...t,fixOf:r}))}return n}var qGe={"removed-export":"Removed export used in this repository","renamed-export":"Renamed export used in this repository","moved-export":"Export moved to a different module","signature-change":"Call signature changed","type-change":"Type changed in a breaking way","behaviour-change":"Runtime behaviour changed","removed-endpoint":"API endpoint removed","changed-endpoint":"API endpoint changed","required-field-added":"New required field","default-change":"Default value changed","config-change":"Configuration shape changed","module-system-change":"Module loading compatibility changed","runtime-requirement":"Runtime requirement changed",unknown:"Unclassified breaking change"};function yre(e){return qGe[e]??"Breaking change"}function pre(e,t){let n=`${e.name}: ${yre(t.kind)}`;if(t.symbols.length===0)return n;let i=t.symbols.slice(0,2).join(", "),r=t.symbols.length>2?", \u2026":"";return`${n} (${i}${r})`}var Zy={runtime:"dependency",dev:"devDependency",peer:"peerDependency",optional:"optionalDependency",transitive:"transitive dependency"};function WGe(e){return Zy[e]??e}var fre={error:2,warning:1,note:0};function KGe(e){return e.reduce((t,n)=>fre[n]>fre[t]?n:t,"note")}function HGe(e,t,n){let i=[...t].sort((d,p)=>Wx(p.confidence)-Wx(d.confidence)||d.file.localeCompare(p.file)||d.line-p.line),r=i[0],o=i.slice(1,1+_U),s=r.confidence,a=new Set(t.map(d=>d.file)),c=tVe(e,n),l=e.sourceUrl??(c?nVe(c,e):void 0),u=[`**${yre(e.kind)}:** ${JGe(e.summary,l)}`,"",`Upstream confidence: ${e.confidence}. Local confidence: ${s}`+(t.length>1?` (best of ${t.length} matches across ${a.size} file(s)).`:".")];return e.before&&e.after&&e.before!==e.after&&u.push("",`- \`${ure($U(e.before,300))}\``,`+ \`${ure($U(e.after,300))}\``),l&&u.push("",`${e.sourceUrl?"GitHub source":"Declaration source"}: ${l}`),{level:ZGe(e.confidence,s),lines:u,primaryCandidate:{file:r.file,line:r.line,excerpt:r.excerpt},relatedCandidates:o.map(d=>({file:d.file,line:d.line,excerpt:d.excerpt})),helpUri:l}}function $U(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}function JGe(e,t){return t?e.replace(/`([^`]+)`/g,(n,i)=>`[\`${i}\`](${t})`):e}function ZGe(e,t){return e==="high"&&t==="high"?"error":e==="high"||t==="high"||e==="medium"&&t==="medium"?"warning":"note"}function Wx(e){return e==="high"?2:e==="medium"?1:0}function YGe(e){let t=e.security,n,i,r=[];if(t.current.length>0){n=`Currently affected by ${t.current.length} known ${jf(t.current.length,"advisory","advisories")}`;let s=mre(t.current);i=s==="critical"||s==="high"?"error":"warning",r.push(["**Currently affected:**",...t.current.map(a=>`- ${kU(a)}`)].join(` +`))}else if(t.introduced.length>0){n=`Upgrading would introduce ${t.introduced.length} new known ${jf(t.introduced.length,"advisory","advisories")}`;let s=mre(t.introduced);i=s==="critical"||s==="high"?"error":"warning"}else n=`Resolves ${t.resolved.length} known ${jf(t.resolved.length,"advisory","advisories")}`,i="note";t.introduced.length>0&&r.push(["**Would introduce:**",...t.introduced.map(s=>`- ${kU(s)}`)].join(` +`)),t.resolved.length>0&&r.push(["**Resolves:**",...t.resolved.map(s=>`- ${kU(s)}`)].join(` +`));let o=[`**${n}**`];for(let s of r)o.push("",s);o.push("",`Drift's assessment: **${ou[e.assessment.recommendation]}**.`);for(let s of e.assessment.reasons)o.push(`- ${s}`);return{level:i,lines:o,relatedCandidates:[],helpUri:t.current[0]?.url??t.introduced[0]?.url??t.resolved[0]?.url,ruleNameSuffix:n}}function QGe(e){let n=e.checks.filter(o=>o.status==="failed").map(o=>`\`${o.label}\``).join(", "),r=[`**The project's own checks fail with this upgrade installed${e.failedFiles.length>0?` in ${e.failedFiles.length} file${e.failedFiles.length===1?"":"s"}`:""}** \u2014 measured, not predicted. Drift's static analysis found no specific call site to point at, but the upgrade should not be treated as safe.`];return n&&r.push("",`Failing: ${n}`),e.diagnostics&&r.push("",$U(e.diagnostics,4e3)),{level:"error",lines:r,relatedCandidates:[],ruleNameSuffix:"Project's own checks fail with this upgrade"}}function XGe(e,t){return{level:"note",lines:[`**Update available** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}), with no breaking changes or advisories found.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 safe to upgrade"}}function eVe(e,t){return{level:"warning",lines:[`**Breaking change detected upstream** (${e.to?`${e.from??"none"} \u2192 ${e.to}`:"removed"}). ${t} upstream breaking ${jf(t,"change was","changes were")} found, and no code in this repository was found to use the affected parts \u2014 but a completed search is not proof the change cannot reach this repository. Review before upgrading.`],relatedCandidates:[],ruleNameSuffix:"Outdated \u2014 review before upgrading"}}function qx(e){let{change:t,blocks:n,upstreamOnlyCount:i,fix:r,ruleIdSuffix:o,ruleName:s,snippetOk:a,repoBlobUrl:c}=e,l=Qk(t),u=t.to?`${t.from??"none"} \u2192 ${t.to}`:"removed",d=n.some(k=>k.primaryCandidate),p=WGe(t.kind),f=[l?`**${t.name}** (${t.ecosystem} ${p}) ${u} \u2014 ${l}`:`**${t.name}** (${t.ecosystem} ${p}) ${u}`];i>0&&f.push("",`${i} additional upstream breaking ${jf(i,"change does","changes do")} not reach code in this repository and ${jf(i,"is","are")} omitted here.`);let m=a?n.find(k=>k.primaryCandidate)?.primaryCandidate??{file:t.manifestPath,line:1}:{file:t.manifestPath,line:1},g=new Set([`${m.file}:${m.line}`]),h=[];for(let k of n){let $=k.primaryCandidate?[k.primaryCandidate,...k.relatedCandidates]:k.relatedCandidates;for(let S of $){let x=`${S.file}:${S.line}`;if(!g.has(x)&&(g.add(x),h.push(S),h.length>=_U))break}if(h.length>=_U)break}let b=new Map(h.map((k,$)=>[`${k.file}:${k.line}`,$+1])),y=k=>{let $=b.get(`${k.file}:${k.line}`);return $!==void 0?`[\`${k.file}:${k.line}\`](${$})`:zGe(k.file,k.line,c)},w=[f.join(` `),...n.map(k=>{if(!k.primaryCandidate)return k.lines.join(` -`);let _=["**Seen at:**",`- ${y(k.primaryCandidate)}`,...k.relatedCandidates.map(S=>`- ${y(S)}`)];return[...k.lines,"","",..._].join(` -`)}),QGe(r,d)].join(` +`);let $=["**Seen at:**",`- ${y(k.primaryCandidate)}`,...k.relatedCandidates.map(S=>`- ${y(S)}`)];return[...k.lines,"","",...$].join(` +`)}),oVe(r,d)].join(` --- -`);return{ruleId:o?`drift/${t.ecosystem}/${t.name}/${o}`:`drift/${t.ecosystem}/${t.name}`,ruleName:s??`${t.name}: dependency finding`,dependency:t.name,ecosystem:t.ecosystem,dependencyKind:t.kind,from:t.from,to:t.to,manifestPath:t.manifestPath,workspace:t.workspace,workspaceLabel:l,level:jGe(n.map(k=>k.level)),message:w,primaryLocation:m,relatedLocations:h,snippetOk:a,fix:r,helpUri:n.find(k=>k.helpUri)?.helpUri}}function Uf(e,t,n){return e===1?t:n}function cre(e){return e.reduce((t,n)=>I1(n.severity,t)<0?n.severity:t,"unknown")}function fU(e){let t=e.fixedIn?`, fixed in ${e.fixedIn}`:"";return`[${e.id}](${e.url}) (${e.severity}${t}): ${e.summary}`}function KGe(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function JGe(e,t){let n=ZGe(t);return n?`${e}#:~:text=${encodeURIComponent(n)}`:e}function ZGe(e){let n=(e.after??e.before)?.split(` -`)[0]?.trim()||e.symbols[0];if(n)return n.length>80?n.slice(0,80):n}function YGe(e,t){if(!e)return;if((e.codemod?.length??0)>0)return{description:`Deterministic fix available: "${e.message}". Drift can commit this itself once approved.`};if(e.fixPlan){let{plan:i,covered:r,residual:o}=e.fixPlan,s=r+o;return{description:`Validated fix plan \`${i.id}\` covers ${r}/${s} call site(s): ${i.migration} `+(o>0?`The remaining ${o} need an agent. `:"")+"Run `drift fix --plan` to read the full plan before applying it."}}return{description:t.risk==="none"?"No deterministic fix; comment `/drift apply` on Drift's approval issue for this plan to dispatch GitHub Copilot.":`No deterministic fix, and this plan carries risk: \`${t.risk}\`. Review the plan Drift filed, then comment \`/drift apply\` to dispatch a fix.`}}function QGe(e,t){return e?.url?`**Fix:** ${e.description} \u2192 ${e.url}`:e?.command?`**Fix:** ${e.description} Run: \`${e.command}\``:e?`**Fix:** ${e.description}`:t?"**Fix:** Drift did not produce a plan for this finding \u2014 see the workflow run for why.":"**Fix:** No action required; this is informational."}function bU(e){switch(e.kind){case"rename-identifier":return`Rename the identifier \`${e.from}\` to \`${e.to}\` at each call site Drift localized (bare uses only \u2014 never \`something.${e.from}\`, and never another \`${e.from}\` on the same line that was not localized).`;case"rename-member":return`Rename the member \`.${e.from}\` to \`.${e.to}\` at each call site Drift localized (member access only, and only on the receiver that was localized \u2014 a different object's \`.${e.from}\` on the same line is left alone).`;case"replace-import-path":return`Change the import path \`${e.from}\` to \`${e.to}\`, on localized lines that actually import, and only where that specifier appears once.`;case"insert-argument":return`Insert \`${e.text}\` as argument ${e.index+1} of each localized \`${e.callee}(\u2026)\` call that closes on its own line.`;case"wrap-call":return`Prefix each localized \`${e.callee}(\u2026)\` call with \`${e.wrapper}\`, where it is not already prefixed.`}}function XGe(e){return e==="proven"?"Every operation swaps one token or string for another of the same kind, at one anchored occurrence, so applying this cannot change whether the file parses and cannot touch anything Drift did not localize.":"At least one operation changes the structure of an expression. Drift knows exactly what it will write, but cannot promise the result compiles \u2014 so this plan is only applied automatically once the project\u2019s own checks have actually passed."}function pre(e){let{provenance:t}=e;switch(t.author){case"model":return`Authored by \`${t.model??"a model"}\` from the cited evidence, then validated by Drift.`;case"builtin":return"Derived by Drift\u2019s own codemod engine from a computed API diff. No model was involved.";case"recipe":return t.recipe?`Inferred from what \`${t.recipe.name}@${t.recipe.version}\` (${t.recipe.publisher}) did in a throwaway worktree, then re-derived and validated by Drift. The recipe\u2019s own output was not used \u2014 see ${t.recipe.source}.`:"Inferred from a community recipe, then re-derived and validated by Drift.";case"cache":return`Restored from a previously validated plan for this same migration (\`${t.sourceId??e.id}\`), then re-validated against this repository\u2019s own call sites.`;case"user":return"Supplied by a human. Validated by Drift exactly as an authored plan would be."}}function By(e,t={}){let{plan:n}=e,i=t.headingLevel??3,r=s=>"#".repeat(Math.min(6,i+s)),o=[];if(o.push(`${r(0)} Fix plan: ${n.migration}`),o.push(""),o.push(`\`${n.id}\` \xB7 **${n.dependency}** ${n.fromVersion??"?"} \u2192 ${n.toVersion??"?"} \xB7 ${n.changeKind}`),o.push(""),e.verdict==="rejected"){o.push("**Drift rejected this plan.** It was not applied, and the finding falls through to the tier below."),o.push("");for(let s of e.rejections)o.push(`- ${s}`);return o.push(""),o.push(pre(n)),o.join(` -`)}o.push(`${r(1)} What it does`),o.push("");for(let s of n.ops)o.push(`1. ${bU(s)}`);return o.push(""),n.rationale&&(o.push(`${r(1)} Why`),o.push(""),o.push(n.rationale),o.push("")),o.push(`${r(1)} What Drift checked`),o.push(""),o.push("- **Grounding.** Every operation acts on a symbol this finding names."),o.push("- **Exact occurrences.** Every edit is anchored to one call site Drift localized \u2014 file, line, column, and the exact text matched there. An operation cannot reach a same-named identifier elsewhere on the line, let alone elsewhere in the file."),o.push(`- **Attestation.** Every name introduced (${n.ops.flatMap(tVe).map(s=>`\`${s}\``).join(", ")||"none"}) appears in the cited evidence${n.citations.length?` (${n.citations.map(s=>`\`${s}\``).join(", ")})`:""}.`),o.push("- **Convergence.** Applying the plan twice was tested, and gives the same result as applying it once."),o.push("- **Line preservation.** No operation splits or joins a line."),o.push(`- **Assurance.** ${XGe(e.assurance)}`),o.push(""),o.push(`${r(1)} Coverage`),o.push(""),o.push(e.residual===0?`All ${e.covered} call site${e.covered===1?"":"s"} are resolved deterministically. No agent is asked about this finding.`:`${e.covered} of ${e.covered+e.residual} call sites are resolved deterministically. The remaining ${e.residual} ${e.residual===1?"is":"are"} listed below and ${e.residual===1?"is":"are"} handed to an agent individually \u2014 the plan is not abandoned because of them.`),o.push(""),t.sites!==!1&&e.sites.length>0&&(o.push(eVe(e.sites)),o.push("")),o.push(pre(n)),o.join(` -`)}function mre(e){if(e.verdict==="rejected")return`Fix plan rejected: ${e.rejections[0]??"it did not pass validation"}`;let t=e.plan.ops.length,n=e.covered+e.residual;return`${t} deterministic rule${t===1?"":"s"} covering ${e.covered}/${n} call site${n===1?"":"s"} (${e.assurance})`}function eVe(e){let t=["| Site | Change |","| --- | --- |"];for(let n of e){let i=`\`${n.file}:${n.line}\``;n.status==="covered"?t.push(`| ${i} | \`${fre(n.before)}\` \u2192 \`${fre(n.after??"")}\` |`):t.push(`| ${i} | _Not covered_ \u2014 ${n.reason??"no rule matched."} |`)}return t.join(` -`)}function tVe(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];default:return[]}}function fre(e){let t=e.trim();return t.length<=90?t:`${t.slice(0,87)}\u2026`}var nVe={high:"\u{1F7E2} high",medium:"\u{1F7E1} medium",low:"\u{1F7E0} low"},rVe={none:"\u26AA none",low:"\u{1F7E2} low",medium:"\u{1F7E1} medium",high:"\u{1F534} high"};function jf(e,t){let n=[];return n.push(iVe(e)),n.push(hre(e)),e.blockers.length>0&&n.push(yre(e)),e.warnings.length>0&&n.push(bre(e)),n.push(vre(e)),n.push(iU(e)),n.push(wre(e)),n.push(uVe(e)),n.push(X1(e.gaps)),n.push(eU(e)),n.push(kre(e)),n.push(dVe(e,t)),n.push($re(e)),n.filter(Boolean).join(` - -`)}function gre(e,t){let n=[];return n.push("## Drift found breaking changes that need your call"),n.push(e.blockers.length>0?"Drift analysed this dependency change and prepared a fix, then stopped. The reasons are listed below.":"Drift analysed this dependency change and prepared a fix. This repository runs in `approve` mode, so nothing has been changed yet."),n.push(hre(e)),e.blockers.length>0&&n.push(yre(e)),e.warnings.length>0&&n.push(bre(e)),n.push(vre(e)),n.push(iU(e)),n.push(wre(e)),n.push(X1(e.gaps)),n.push(eU(e)),n.push(kre(e)),n.push(["## To proceed","","Comment `/drift apply` on this issue and Drift will create the branch and","hand the plan to GitHub Copilot, one commit at a time. You will get a pull","request to review \u2014 nothing merges automatically.","","Comment `/drift dismiss` to close this out.","","To stop being asked for changes like this, adjust `.github/drift.yml` \u2014 see the [configuration reference](https://github.com/trydrift/drift/blob/main/docs/configuration.md)."].join(` -`)),n.push($re(e)),n.filter(Boolean).join(` - -`)}function iVe(e){let t=new Set(e.changes.map(i=>i.workspace).filter(i=>i!==void 0));return["## Drift: dependency compatibility fix","",`${e.changes.map(i=>{let r=t.size>1?qk(i):null,o=i.kind==="runtime"?null:Vy[i.kind],s=[i.ecosystem,o].filter(Boolean).join(", ");return`\`${i.name}\` _(${s})_ ${i.from??"\u2014"} \u2192 **${i.to??"\u2014"}**${r?` _(in ${r})_`:""}`}).join(", ")}`,"",e.commits.length>0?`Drift found **${e.breakingChanges.length} breaking change(s)** affecting **${new Set(e.impactSites.map(i=>i.file)).size} file(s)** in this repository, and planned **${e.commits.length} commit(s)** to fix them.`:Lf(e)].join(` -`)}function hre(e){let t=new Set(e.impactSites.map(n=>n.file)).size;return["| | |","|---|---|",`| **Risk** | ${rVe[e.risk]??e.risk} |`,`| **Breaking changes** | ${e.upstreamBreakingCount??e.breakingChanges.length} |`,`| **Impact sites** | ${e.impactSites.length} across ${t} file(s) |`,`| **Planned commits** | ${e.commits.length} |`,`| **Evidence sources** | ${oVe(e.evidence)} |`,`| **Base branch** | \`${e.baseBranch}\` |`].join(` -`)}function oVe(e){let t=new Map;for(let n of e)t.set(n.source,(t.get(n.source)??0)+1);return t.size===0?"none":[...t.entries()].map(([n,i])=>`${n} (${i})`).join(", ")}function yre(e){return["## \u26D4 Why Drift stopped","","Drift did not dispatch this automatically. Each reason below is a guardrail","from `.github/drift.yml`:","",...e.blockers.map(t=>`- ${t}`)].join(` -`)}function bre(e){return["## \u26A0\uFE0F Worth checking","",...e.warnings.map(t=>`- ${t}`)].join(` -`)}function vre(e){if(e.breakingChanges.length===0)return["## Breaking changes","","None identified from the available evidence."].join(` -`);let t=new Map(e.evidence.map(i=>[i.id,i])),n=["## Breaking changes",""];for(let i of e.breakingChanges){let r=e.impactSites.filter(a=>a.breakingChangeId===i.id).length,o=Y1(i);n.push(`### ${Rx(i).text} \xB7 \`${i.dependency}\` \xB7 ${i.kind}`),n.push(""),n.push(i.summary),n.push(""),i.before&&i.after&&i.before!==i.after&&n.push("```diff",`- ${vU(i.before,300)}`,`+ ${vU(i.after,300)}`,"```",""),n.push(`**Verdict:** ${Ine(o,i.assessment)}.`),n.push(""),n.push(Nne(i)),n.push(""),i.assessment&&(n.push(Rne(i.assessment)),n.push(""),n.push(Cne(i.assessment)),n.push("")),i.symbols.length>0&&(n.push(`**Symbols:** ${i.symbols.map(a=>`\`${a}\``).join(", ")}`),n.push("")),n.push(r>0?`**Found in this repo:** ${r} location(s)`:i.assessment?.localImpact.penalties.some(a=>a.code==="localization-unavailable")?"**Found in this repo:** not searched \u2014 no checkout was available. This is not evidence the change is unused.":"**Found in this repo:** no usages found in the files that import this dependency \u2014 no fix planned"),n.push(""),n.push(...sVe(i.remediation)),n.push("");let s=i.citations.map(a=>t.get(a)).filter(a=>a!==void 0);if(s.length>0){n.push("**Evidence:**");for(let a of s)n.push(`- ${_re(a)}`);n.push("")}}return n.join(` -`).trim()}function sVe(e){let t=aVe(e);return t.length===1?[`**Fix:** ${t[0]}`]:["**Fix:**","",...t]}function aVe(e){let t=[],n=[],i=()=>{let r=n.join(" ").trim();n.length=0,r&&t.push(r)};for(let r of e.split(/\r?\n/)){let o=r.trim(),s=/^(before|after):(.*)$/i.exec(o);if(s){i(),t.push(`**${lVe(s[1])}:**`,"",cVe(s[2].trimStart()),"");continue}if(!o){i();continue}n.push(o)}return i(),t.filter((r,o,s)=>r||s[o-1]&&s[o+1])}function cVe(e){let t=e.match(/`+/g)?.reduce((i,r)=>Math.max(i,r.length),2)??2,n="`".repeat(t+1);return[n,e,n].join(` -`)}function lVe(e){return e&&`${e[0].toUpperCase()}${e.slice(1).toLowerCase()}`}function wre(e){if(e.commits.length===0)return["## Commit plan","",`No commits planned. ${Lf(e)}`].join(` -`);let t=["## Commit plan","","Each commit addresses one concern. The graph below records only necessary","dependencies; commits in the same execution layer have disjoint file scope and","may run in parallel.",""];for(let n of e.commits){if(t.push(`**${n.order}. \`${n.message}\`**`),t.push(""),t.push(`Unit: \`${n.id}\``),t.push(`Layer: ${n.executionLayer}`),n.dependsOn.length>0&&(t.push(`Depends on: ${n.dependsOn.map(i=>`\`${i}\``).join(", ")}`),t.push(`Why: ${n.dependencyReasons.map(i=>`${i.reason}${i.evidence.length?` (${i.evidence.slice(0,3).join("; ")})`:""}`).join("; ")}`)),t.push(`Files: ${n.allowedFiles.map(i=>`\`${i}\``).join(", ")}`),(n.allowedSymbols??[]).length>0&&t.push(`Symbols: ${n.allowedSymbols.map(i=>`\`${i}\``).join(", ")}`),n.expectedChecks.length>0&&t.push(`Expected checks: ${n.expectedChecks.map(i=>i.kind).join(", ")}`),n.codemod?.length){let i=n.codemod.map(r=>`\`${r.from}\` \u2192 \`${r.to}\``).join(", ");t.push(`**Resolved deterministically** by Drift's codemod engine (${i}) \u2014 no model call was needed for this commit.`)}else if(n.fixPlan){let{plan:i,covered:r,residual:o,assurance:s}=n.fixPlan,a=r+o;t.push(`**Deterministic fix plan** \`${i.id}\` \u2014 ${i.migration} ${i.ops.length} rule${i.ops.length===1?"":"s"}, ${r}/${a} call site${a===1?"":"s"} covered, assurance \`${s}\`.`);for(let c of i.ops)t.push(` - ${bU(c)}`);if(o>0&&t.push(` - ${o} call site${o===1?"":"s"} not covered by the plan; an agent handles ${o===1?"it":"them"} individually.`),n.recipe?.length){let c=[...new Map(n.recipe.map(l=>[`${l.provider}:${l.name}@${l.version}`,l])).values()];t.push(` - Consulted: ${c.map(l=>`[\`${l.name}@${l.version}\`](${l.source}) from ${l.publisher}`).join(", ")}`)}}else if(n.recipe?.length){let i=[...new Map(n.recipe.map(o=>[`${o.provider}:${o.name}@${o.version}`,o])).values()],r=i.map(o=>`[\`${o.name}@${o.version}\`](${o.source}) from ${o.publisher} (${o.provider})`).join(", ");t.push(`**Community recipe consulted**: ${r} \u2014 ${i[0].migration} Drift could not re-derive its edits as deterministic operations, so this commit goes to an agent.`)}t.push("")}return t.join(` -`).trim()}function uVe(e){if(e.impactSites.length===0)return"";let t=new Map;for(let i of e.impactSites){let r=t.get(i.file);r?r.push(i):t.set(i.file,[i])}let n=["
",`All ${e.impactSites.length} impact site(s)`,""];for(let[i,r]of[...t.entries()].sort()){let o=r.every(s=>s.siteKind==="manifest");n.push(`**\`${i}\`**${o?" \u2014 the declaration, not a call site":""}`),n.push("");for(let s of r.slice(0,25)){let a=s.enclosingSymbol?` (in \`${s.enclosingSymbol}\`)`:"";n.push(`- L${s.line}${a} \u2014 \`${s.excerpt}\` \xB7 ${nVe[s.confidence]}`)}r.length>25&&n.push(`- \u2026and ${r.length-25} more in this file`),n.push("")}return n.push("
"),n.join(` -`)}function kre(e){if(e.evidence.length===0)return"";let t=["
",`Evidence Drift used (${e.evidence.length} source(s))`,"","Every finding above traces back to one of these. Open them to check the work.",""];for(let n of e.evidence)t.push(`#### ${_re(n)}`),t.push(""),t.push(`\`${n.source}\` \xB7 ${Ane(n.weight)} (weight ${n.weight.toFixed(2)})`),t.push(""),t.push("```"),t.push(vU(n.content,2e3)),t.push("```"),t.push("");return t.push("
"),t.join(` -`)}function dVe(e,t){let n=["Every edit corresponds to a breaking change listed above \u2014 no unrelated refactoring crept in","The fixes match what the cited evidence actually says","CI passes on this branch"];return e.impactSites.some(i=>i.file.includes("test"))&&n.push("Test changes update assertions to the new API rather than weakening them"),e.breakingChanges.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push("Behaviour changes were handled deliberately \u2014 these compile either way, so the type checker will not catch a wrong choice"),e.breakingChanges.some(i=>i.confidence==="low")&&n.push("Low-confidence findings were verified against the upstream source before accepting"),["## Review checklist","",...n.map(i=>`- [ ] ${i}`)].join(` -`)}function $re(e){return["---","",Dne({schemaVersion:Cf,planId:e.id,planDigest:lx(e),headSha:e.headSha,baseBranch:e.baseBranch}),"",`Generated by [Drift](https://github.com/trydrift/drift) \xB7 plan \`${e.id}\` \xB7 ${e.createdAt}
`,"Drift reads dependency changes, proves which ones break your code, and drives","GitHub Copilot to fix them. It never merges anything.
"].join(` -`)}function _re(e){let t=e.title;return e.url?`[${t}](${e.url})`:e.locator?`${t} (\`${e.locator}\`)`:t}function vU(e,t){return e.length<=t?e:`${e.slice(0,t)} -\u2026(truncated)`}function jx(e){if(e.commits.length===0)return`${Lf(e)} (${e.changes.length} dependency change(s) checked)`;let t=new Set(e.impactSites.map(n=>n.file)).size;return`${e.breakingChanges.length} breaking change(s), ${t} file(s) affected, ${e.commits.length} commit(s) planned (risk: ${e.risk})`}var zf=require("node:fs/promises"),Wy=require("node:path");function Sre(e){return e.codemod?"builtin":e.fixPlan?"fix-plan":"ai"}function wU(e,t){let n=new Set(t.map(r=>r.id)),i=new Set(t.flatMap(r=>r.breakingChangeIds));return{...e,commits:e.commits.filter(r=>n.has(r.id)),breakingChanges:e.breakingChanges.filter(r=>i.has(r.id))}}function zx(e,t){let n=new Map(t);for(let s of e.codemod??[])for(let a of s.files){let c=n.get(a);c!==void 0&&n.set(a,bee(c,s,a))}let i=[];for(let[s,a]of t){let c=n.get(s);c!==void 0&&c!==a&&i.push({path:s,content:c})}if(i.length===0)return{status:"no-changes",edits:[],message:"The deterministic fix produced no changes here \u2014 likely already applied by an earlier commit."};let r=new Set(i.map(s=>s.path)).size,o=e.codemod?.length??0;return{status:"applied",edits:i,message:`Applied ${o} deterministic rename${o===1?"":"s"} across ${r} file${r===1?"":"s"} \u2014 no agent call was made.`}}function Gx(e,t){let n=e.fixPlan;if(!n)return{status:"no-changes",edits:[],message:"This commit has no fix plan."};let i=new Map(t);for(let a of n.files){let c=i.get(a);c!==void 0&&i.set(a,Aee(c,n.plan.ops,n.anchors,a))}let r=[];for(let[a,c]of t){let l=i.get(a);l!==void 0&&l!==c&&r.push({path:a,content:l})}if(r.length===0)return{status:"no-changes",edits:[],message:"The fix plan produced no changes here \u2014 likely already applied by an earlier commit."};let o=new Set(r.map(a=>a.path)).size,s=mre({plan:n.plan,verdict:n.residual===0?"accepted":"partial",assurance:n.assurance,sites:[],covered:n.covered,residual:n.residual,rejections:[],anchors:n.anchors});return{status:"applied",edits:r,message:`Applied fix plan \`${n.plan.id}\` \u2014 ${s} \u2014 across ${o} file${o===1?"":"s"}.`+(n.residual>0?` ${n.residual} call site${n.residual===1?"":"s"} remain${n.residual===1?"s":""} for an agent.`:" No agent call was made.")}}function Vx(e,t,n={}){let{fixPlans:i}=t.remediation;if(e.verdict==="rejected")return{action:"skip",reason:e.rejections[0]??"The plan did not pass validation."};let r=e.covered+e.residual,o=r===0?0:e.covered/r;return ok.level)),message:w,primaryLocation:m,relatedLocations:h,snippetOk:a,fix:r,helpUri:n.find(k=>k.helpUri)?.helpUri}}function jf(e,t,n){return e===1?t:n}function mre(e){return e.reduce((t,n)=>M1(n.severity,t)<0?n.severity:t,"unknown")}function kU(e){let t=e.fixedIn?`, fixed in ${e.fixedIn}`:"";return`[${e.id}](${e.url}) (${e.severity}${t}): ${e.summary}`}function tVe(e,t){for(let n of e.citations){let i=t.find(r=>r.id===n)?.url;if(i)return i}}function nVe(e,t){let n=rVe(t);return n?`${e}#:~:text=${encodeURIComponent(n)}`:e}function rVe(e){let n=(e.after??e.before)?.split(` +`)[0]?.trim()||e.symbols[0];if(n)return n.length>80?n.slice(0,80):n}function iVe(e,t){if(!e)return;if((e.codemod?.length??0)>0)return{description:`Deterministic fix available: "${e.message}". Drift can commit this itself once approved.`};if(e.fixPlan){let{plan:i,covered:r,residual:o}=e.fixPlan,s=r+o;return{description:`Validated fix plan \`${i.id}\` covers ${r}/${s} call site(s): ${i.migration} `+(o>0?`The remaining ${o} need an agent. `:"")+"Run `drift fix --plan` to read the full plan before applying it."}}return{description:t.risk==="none"?"No deterministic fix; comment `/drift apply` on Drift's approval issue for this plan to dispatch GitHub Copilot.":`No deterministic fix, and this plan carries risk: \`${t.risk}\`. Review the plan Drift filed, then comment \`/drift apply\` to dispatch a fix.`}}function oVe(e,t){return e?.url?`**Fix:** ${e.description} \u2192 ${e.url}`:e?.command?`**Fix:** ${e.description} Run: \`${e.command}\``:e?`**Fix:** ${e.description}`:t?"**Fix:** Drift did not produce a plan for this finding \u2014 see the workflow run for why.":"**Fix:** No action required; this is informational."}function EU(e){switch(e.kind){case"rename-identifier":return`Rename the identifier \`${e.from}\` to \`${e.to}\` at each call site Drift localized (bare uses only \u2014 never \`something.${e.from}\`, and never another \`${e.from}\` on the same line that was not localized).`;case"rename-member":return`Rename the member \`.${e.from}\` to \`.${e.to}\` at each call site Drift localized (member access only, and only on the receiver that was localized \u2014 a different object's \`.${e.from}\` on the same line is left alone).`;case"replace-import-path":return`Change the import path \`${e.from}\` to \`${e.to}\`, on localized lines that actually import, and only where that specifier appears once.`;case"insert-argument":return`Insert \`${e.text}\` as argument ${e.index+1} of each localized \`${e.callee}(\u2026)\` call that closes on its own line.`;case"wrap-call":return`Prefix each localized \`${e.callee}(\u2026)\` call with \`${e.wrapper}\`, where it is not already prefixed.`}}function sVe(e){return e==="proven"?"Every operation swaps one token or string for another of the same kind, at one anchored occurrence, so applying this cannot change whether the file parses and cannot touch anything Drift did not localize.":"At least one operation changes the structure of an expression. Drift knows exactly what it will write, but cannot promise the result compiles \u2014 so this plan is only applied automatically once the project\u2019s own checks have actually passed."}function bre(e){let{provenance:t}=e;switch(t.author){case"model":return`Authored by \`${t.model??"a model"}\` from the cited evidence, then validated by Drift.`;case"builtin":return"Derived by Drift\u2019s own codemod engine from a computed API diff. No model was involved.";case"recipe":return t.recipe?`Inferred from what \`${t.recipe.name}@${t.recipe.version}\` (${t.recipe.publisher}) did in a throwaway worktree, then re-derived and validated by Drift. The recipe\u2019s own output was not used \u2014 see ${t.recipe.source}.`:"Inferred from a community recipe, then re-derived and validated by Drift.";case"cache":return`Restored from a previously validated plan for this same migration (\`${t.sourceId??e.id}\`), then re-validated against this repository\u2019s own call sites.`;case"user":return"Supplied by a human. Validated by Drift exactly as an authored plan would be."}}function Yy(e,t={}){let{plan:n}=e,i=t.headingLevel??3,r=s=>"#".repeat(Math.min(6,i+s)),o=[];if(o.push(`${r(0)} Fix plan: ${n.migration}`),o.push(""),o.push(`\`${n.id}\` \xB7 **${n.dependency}** ${n.fromVersion??"?"} \u2192 ${n.toVersion??"?"} \xB7 ${n.changeKind}`),o.push(""),e.verdict==="rejected"){o.push("**Drift rejected this plan.** It was not applied, and the finding falls through to the tier below."),o.push("");for(let s of e.rejections)o.push(`- ${s}`);return o.push(""),o.push(bre(n)),o.join(` +`)}o.push(`${r(1)} What it does`),o.push("");for(let s of n.ops)o.push(`1. ${EU(s)}`);return o.push(""),n.rationale&&(o.push(`${r(1)} Why`),o.push(""),o.push(n.rationale),o.push("")),o.push(`${r(1)} What Drift checked`),o.push(""),o.push("- **Grounding.** Every operation acts on a symbol this finding names."),o.push("- **Exact occurrences.** Every edit is anchored to one call site Drift localized \u2014 file, line, column, and the exact text matched there. An operation cannot reach a same-named identifier elsewhere on the line, let alone elsewhere in the file."),o.push(`- **Attestation.** Every name introduced (${n.ops.flatMap(cVe).map(s=>`\`${s}\``).join(", ")||"none"}) appears in the cited evidence${n.citations.length?` (${n.citations.map(s=>`\`${s}\``).join(", ")})`:""}.`),o.push("- **Convergence.** Applying the plan twice was tested, and gives the same result as applying it once."),o.push("- **Line preservation.** No operation splits or joins a line."),o.push(`- **Assurance.** ${sVe(e.assurance)}`),o.push(""),o.push(`${r(1)} Coverage`),o.push(""),o.push(e.residual===0?`All ${e.covered} call site${e.covered===1?"":"s"} are resolved deterministically. No agent is asked about this finding.`:`${e.covered} of ${e.covered+e.residual} call sites are resolved deterministically. The remaining ${e.residual} ${e.residual===1?"is":"are"} listed below and ${e.residual===1?"is":"are"} handed to an agent individually \u2014 the plan is not abandoned because of them.`),o.push(""),t.sites!==!1&&e.sites.length>0&&(o.push(aVe(e.sites)),o.push("")),o.push(bre(n)),o.join(` +`)}function wre(e){if(e.verdict==="rejected")return`Fix plan rejected: ${e.rejections[0]??"it did not pass validation"}`;let t=e.plan.ops.length,n=e.covered+e.residual;return`${t} deterministic rule${t===1?"":"s"} covering ${e.covered}/${n} call site${n===1?"":"s"} (${e.assurance})`}function aVe(e){let t=["| Site | Change |","| --- | --- |"];for(let n of e){let i=`\`${n.file}:${n.line}\``;n.status==="covered"?t.push(`| ${i} | \`${vre(n.before)}\` \u2192 \`${vre(n.after??"")}\` |`):t.push(`| ${i} | _Not covered_ \u2014 ${n.reason??"no rule matched."} |`)}return t.join(` +`)}function cVe(e){switch(e.kind){case"rename-identifier":case"rename-member":case"replace-import-path":return[e.to];default:return[]}}function vre(e){let t=e.trim();return t.length<=90?t:`${t.slice(0,87)}\u2026`}var lVe={high:"\u{1F7E2} high",medium:"\u{1F7E1} medium",low:"\u{1F7E0} low"},uVe={none:"\u26AA none",low:"\u{1F7E2} low",medium:"\u{1F7E1} medium",high:"\u{1F534} high"};function zf(e,t){let n=[];return n.push(dVe(e)),n.push(_re(e)),e.blockers.length>0&&n.push($re(e)),e.warnings.length>0&&n.push(Sre(e)),n.push(xre(e)),n.push(pU(e)),n.push(Ere(e)),n.push(yVe(e)),n.push(aU(e.gaps)),n.push(cU(e)),n.push(Tre(e)),n.push(bVe(e,t)),n.push(Ire(e)),n.filter(Boolean).join(` + +`)}function kre(e,t){let n=[];return n.push("## Drift found breaking changes that need your call"),n.push(e.blockers.length>0?"Drift analysed this dependency change and prepared a fix, then stopped. The reasons are listed below.":"Drift analysed this dependency change and prepared a fix. This repository runs in `approve` mode, so nothing has been changed yet."),n.push(_re(e)),e.blockers.length>0&&n.push($re(e)),e.warnings.length>0&&n.push(Sre(e)),n.push(xre(e)),n.push(pU(e)),n.push(Ere(e)),n.push(aU(e.gaps)),n.push(cU(e)),n.push(Tre(e)),n.push(["## To proceed","","Comment `/drift apply` on this issue and Drift will create the branch and","hand the plan to GitHub Copilot, one commit at a time. You will get a pull","request to review \u2014 nothing merges automatically.","","Comment `/drift dismiss` to close this out.","","To stop being asked for changes like this, adjust `.github/drift.yml` \u2014 see the [configuration reference](https://github.com/trydrift/drift/blob/main/docs/configuration.md)."].join(` +`)),n.push(Ire(e)),n.filter(Boolean).join(` + +`)}function dVe(e){let t=new Set(e.changes.map(i=>i.workspace).filter(i=>i!==void 0));return["## Drift: dependency compatibility fix","",`${e.changes.map(i=>{let r=t.size>1?Qk(i):null,o=i.kind==="runtime"?null:Zy[i.kind],s=[i.ecosystem,o].filter(Boolean).join(", ");return`\`${i.name}\` _(${s})_ ${i.from??"\u2014"} \u2192 **${i.to??"\u2014"}**${r?` _(in ${r})_`:""}`}).join(", ")}`,"",e.commits.length>0?`Drift found **${e.breakingChanges.length} breaking change(s)** affecting **${new Set(e.impactSites.map(i=>i.file)).size} file(s)** in this repository, and planned **${e.commits.length} commit(s)** to fix them.`:Ff(e)].join(` +`)}function _re(e){let t=new Set(e.impactSites.map(n=>n.file)).size;return["| | |","|---|---|",`| **Risk** | ${uVe[e.risk]??e.risk} |`,`| **Breaking changes** | ${e.upstreamBreakingCount??e.breakingChanges.length} |`,`| **Impact sites** | ${e.impactSites.length} across ${t} file(s) |`,`| **Planned commits** | ${e.commits.length} |`,`| **Evidence sources** | ${pVe(e.evidence)} |`,`| **Base branch** | \`${e.baseBranch}\` |`].join(` +`)}function pVe(e){let t=new Map;for(let n of e)t.set(n.source,(t.get(n.source)??0)+1);return t.size===0?"none":[...t.entries()].map(([n,i])=>`${n} (${i})`).join(", ")}function $re(e){return["## \u26D4 Why Drift stopped","","Drift did not dispatch this automatically. Each reason below is a guardrail","from `.github/drift.yml`:","",...e.blockers.map(t=>`- ${t}`)].join(` +`)}function Sre(e){return["## \u26A0\uFE0F Worth checking","",...e.warnings.map(t=>`- ${t}`)].join(` +`)}function xre(e){if(e.breakingChanges.length===0)return["## Breaking changes","","None identified from the available evidence."].join(` +`);let t=new Map(e.evidence.map(i=>[i.id,i])),n=["## Breaking changes",""];for(let i of e.breakingChanges){let r=e.impactSites.filter(a=>a.breakingChangeId===i.id).length,o=oU(i);n.push(`### ${Lx(i).text} \xB7 \`${i.dependency}\` \xB7 ${i.kind}`),n.push(""),n.push(i.summary),n.push(""),i.before&&i.after&&i.before!==i.after&&n.push("```diff",`- ${TU(i.before,300)}`,`+ ${TU(i.after,300)}`,"```",""),n.push(`**Verdict:** ${Dne(o,i.assessment)}.`),n.push(""),n.push(Lne(i)),n.push(""),i.assessment&&(n.push(Mne(i.assessment)),n.push(""),n.push(Fne(i.assessment)),n.push("")),i.symbols.length>0&&(n.push(`**Symbols:** ${i.symbols.map(a=>`\`${a}\``).join(", ")}`),n.push("")),n.push(r>0?`**Found in this repo:** ${r} location(s)`:i.assessment?.localImpact.penalties.some(a=>a.code==="localization-unavailable")?"**Found in this repo:** not searched \u2014 no checkout was available. This is not evidence the change is unused.":"**Found in this repo:** no usages found in the files that import this dependency \u2014 no fix planned"),n.push(""),n.push(...fVe(i.remediation)),n.push("");let s=i.citations.map(a=>t.get(a)).filter(a=>a!==void 0);if(s.length>0){n.push("**Evidence:**");for(let a of s)n.push(`- ${Are(a)}`);n.push("")}}return n.join(` +`).trim()}function fVe(e){let t=mVe(e);return t.length===1?[`**Fix:** ${t[0]}`]:["**Fix:**","",...t]}function mVe(e){let t=[],n=[],i=()=>{let r=n.join(" ").trim();n.length=0,r&&t.push(r)};for(let r of e.split(/\r?\n/)){let o=r.trim(),s=/^(before|after):(.*)$/i.exec(o);if(s){i(),t.push(`**${hVe(s[1])}:**`,"",gVe(s[2].trimStart()),"");continue}if(!o){i();continue}n.push(o)}return i(),t.filter((r,o,s)=>r||s[o-1]&&s[o+1])}function gVe(e){let t=e.match(/`+/g)?.reduce((i,r)=>Math.max(i,r.length),2)??2,n="`".repeat(t+1);return[n,e,n].join(` +`)}function hVe(e){return e&&`${e[0].toUpperCase()}${e.slice(1).toLowerCase()}`}function Ere(e){if(e.commits.length===0)return["## Commit plan","",`No commits planned. ${Ff(e)}`].join(` +`);let t=["## Commit plan","","Each commit addresses one concern. The graph below records only necessary","dependencies; commits in the same execution layer have disjoint file scope and","may run in parallel.",""];for(let n of e.commits){if(t.push(`**${n.order}. \`${n.message}\`**`),t.push(""),t.push(`Unit: \`${n.id}\``),t.push(`Layer: ${n.executionLayer}`),n.dependsOn.length>0&&(t.push(`Depends on: ${n.dependsOn.map(i=>`\`${i}\``).join(", ")}`),t.push(`Why: ${n.dependencyReasons.map(i=>`${i.reason}${i.evidence.length?` (${i.evidence.slice(0,3).join("; ")})`:""}`).join("; ")}`)),t.push(`Files: ${n.allowedFiles.map(i=>`\`${i}\``).join(", ")}`),(n.allowedSymbols??[]).length>0&&t.push(`Symbols: ${n.allowedSymbols.map(i=>`\`${i}\``).join(", ")}`),n.expectedChecks.length>0&&t.push(`Expected checks: ${n.expectedChecks.map(i=>i.kind).join(", ")}`),n.codemod?.length){let i=n.codemod.map(r=>`\`${r.from}\` \u2192 \`${r.to}\``).join(", ");t.push(`**Resolved deterministically** by Drift's codemod engine (${i}) \u2014 no model call was needed for this commit.`)}else if(n.fixPlan){let{plan:i,covered:r,residual:o,assurance:s}=n.fixPlan,a=r+o;t.push(`**Deterministic fix plan** \`${i.id}\` \u2014 ${i.migration} ${i.ops.length} rule${i.ops.length===1?"":"s"}, ${r}/${a} call site${a===1?"":"s"} covered, assurance \`${s}\`.`);for(let c of i.ops)t.push(` - ${EU(c)}`);if(o>0&&t.push(` - ${o} call site${o===1?"":"s"} not covered by the plan; an agent handles ${o===1?"it":"them"} individually.`),n.recipe?.length){let c=[...new Map(n.recipe.map(l=>[`${l.provider}:${l.name}@${l.version}`,l])).values()];t.push(` - Consulted: ${c.map(l=>`[\`${l.name}@${l.version}\`](${l.source}) from ${l.publisher}`).join(", ")}`)}}else if(n.recipe?.length){let i=[...new Map(n.recipe.map(o=>[`${o.provider}:${o.name}@${o.version}`,o])).values()],r=i.map(o=>`[\`${o.name}@${o.version}\`](${o.source}) from ${o.publisher} (${o.provider})`).join(", ");t.push(`**Community recipe consulted**: ${r} \u2014 ${i[0].migration} Drift could not re-derive its edits as deterministic operations, so this commit goes to an agent.`)}t.push("")}return t.join(` +`).trim()}function yVe(e){if(e.impactSites.length===0)return"";let t=new Map;for(let i of e.impactSites){let r=t.get(i.file);r?r.push(i):t.set(i.file,[i])}let n=["
",`All ${e.impactSites.length} impact site(s)`,""];for(let[i,r]of[...t.entries()].sort()){let o=r.every(s=>s.siteKind==="manifest");n.push(`**\`${i}\`**${o?" \u2014 the declaration, not a call site":""}`),n.push("");for(let s of r.slice(0,25)){let a=s.enclosingSymbol?` (in \`${s.enclosingSymbol}\`)`:"";n.push(`- L${s.line}${a} \u2014 \`${s.excerpt}\` \xB7 ${lVe[s.confidence]}`)}r.length>25&&n.push(`- \u2026and ${r.length-25} more in this file`),n.push("")}return n.push("
"),n.join(` +`)}function Tre(e){if(e.evidence.length===0)return"";let t=["
",`Evidence Drift used (${e.evidence.length} source(s))`,"","Every finding above traces back to one of these. Open them to check the work.",""];for(let n of e.evidence)t.push(`#### ${Are(n)}`),t.push(""),t.push(`\`${n.source}\` \xB7 ${One(n.weight)} (weight ${n.weight.toFixed(2)})`),t.push(""),t.push("```"),t.push(TU(n.content,2e3)),t.push("```"),t.push("");return t.push("
"),t.join(` +`)}function bVe(e,t){let n=["Every edit corresponds to a breaking change listed above \u2014 no unrelated refactoring crept in","The fixes match what the cited evidence actually says","CI passes on this branch"];return e.impactSites.some(i=>i.file.includes("test"))&&n.push("Test changes update assertions to the new API rather than weakening them"),e.breakingChanges.some(i=>i.kind==="behaviour-change"||i.kind==="default-change")&&n.push("Behaviour changes were handled deliberately \u2014 these compile either way, so the type checker will not catch a wrong choice"),e.breakingChanges.some(i=>i.confidence==="low")&&n.push("Low-confidence findings were verified against the upstream source before accepting"),["## Review checklist","",...n.map(i=>`- [ ] ${i}`)].join(` +`)}function Ire(e){return["---","",jne({schemaVersion:Pf,planId:e.id,planDigest:hx(e),headSha:e.headSha,baseBranch:e.baseBranch}),"",`Generated by [Drift](https://github.com/trydrift/drift) \xB7 plan \`${e.id}\` \xB7 ${e.createdAt}
`,"Drift reads dependency changes, proves which ones break your code, and drives","GitHub Copilot to fix them. It never merges anything.
"].join(` +`)}function Are(e){let t=e.title;return e.url?`[${t}](${e.url})`:e.locator?`${t} (\`${e.locator}\`)`:t}function TU(e,t){return e.length<=t?e:`${e.slice(0,t)} +\u2026(truncated)`}function Kx(e){if(e.commits.length===0)return`${Ff(e)} (${e.changes.length} dependency change(s) checked)`;let t=new Set(e.impactSites.map(n=>n.file)).size;return`${e.breakingChanges.length} breaking change(s), ${t} file(s) affected, ${e.commits.length} commit(s) planned (risk: ${e.risk})`}var Gf=require("node:fs/promises"),Xy=require("node:path");function Rre(e){return e.codemod?"builtin":e.fixPlan?"fix-plan":"ai"}function IU(e,t){let n=new Set(t.map(r=>r.id)),i=new Set(t.flatMap(r=>r.breakingChangeIds));return{...e,commits:e.commits.filter(r=>n.has(r.id)),breakingChanges:e.breakingChanges.filter(r=>i.has(r.id))}}function Hx(e,t){let n=new Map(t);for(let s of e.codemod??[])for(let a of s.files){let c=n.get(a);c!==void 0&&n.set(a,See(c,s,a))}let i=[];for(let[s,a]of t){let c=n.get(s);c!==void 0&&c!==a&&i.push({path:s,content:c})}if(i.length===0)return{status:"no-changes",edits:[],message:"The deterministic fix produced no changes here \u2014 likely already applied by an earlier commit."};let r=new Set(i.map(s=>s.path)).size,o=e.codemod?.length??0;return{status:"applied",edits:i,message:`Applied ${o} deterministic rename${o===1?"":"s"} across ${r} file${r===1?"":"s"} \u2014 no agent call was made.`}}function Jx(e,t){let n=e.fixPlan;if(!n)return{status:"no-changes",edits:[],message:"This commit has no fix plan."};let i=new Map(t);for(let a of n.files){let c=i.get(a);c!==void 0&&i.set(a,Oee(c,n.plan.ops,n.anchors,a))}let r=[];for(let[a,c]of t){let l=i.get(a);l!==void 0&&l!==c&&r.push({path:a,content:l})}if(r.length===0)return{status:"no-changes",edits:[],message:"The fix plan produced no changes here \u2014 likely already applied by an earlier commit."};let o=new Set(r.map(a=>a.path)).size,s=wre({plan:n.plan,verdict:n.residual===0?"accepted":"partial",assurance:n.assurance,sites:[],covered:n.covered,residual:n.residual,rejections:[],anchors:n.anchors});return{status:"applied",edits:r,message:`Applied fix plan \`${n.plan.id}\` \u2014 ${s} \u2014 across ${o} file${o===1?"":"s"}.`+(n.residual>0?` ${n.residual} call site${n.residual===1?"":"s"} remain${n.residual===1?"s":""} for an agent.`:" No agent call was made.")}}function Zx(e,t,n={}){let{fixPlans:i}=t.remediation;if(e.verdict==="rejected")return{action:"skip",reason:e.rejections[0]??"The plan did not pass validation."};let r=e.covered+e.residual,o=r===0?0:e.covered/r;return ou.to),r=i.map(u=>u.name),o=i.map(u=>`${u.name} from ${u.from??"its previous version"} to ${u.to}`),s=n.id!==Bx,a=[`The dependenc${i.length===1?"y":"ies"} ${o.join(", ")||"in this repository"} ${i.length===1?"has":"have"} been upgraded.`,"","Update this repository so that it works correctly with the new version.",""];if(s){let u=t.breakingChanges.filter(p=>n.breakingChangeIds.includes(p.id)),d=t.impactSites.filter(p=>n.breakingChangeIds.includes(p.breakingChangeId));a.push("Fix only this problem, which the developer chose to fix on its own:","",...u.map(p=>`- ${p.summary}`),...d.slice(0,20).map(p=>` at ${p.file}:${p.line}`),"","Leave any other breakage for its own fix, and change another file only where","this fix needs it.","")}else a.push("Find and fix all relevant incompatibilities.","");let c=[...e.protectedPaths??[]];a.push(`Do not revert or downgrade ${r.length===1?"the dependency":"the dependencies"}. A companion package the new version requires may move with it.`,"","Run the appropriate tests/build/typecheck and leave the repository in a working state.","","Do not make a check pass by checking less: no lowered coverage thresholds, relaxed","compiler strictness, disabled lint rules, skipped or deleted tests, or suppression","directives."+(c.length?` Do not edit ${c.join(", ")}.`:""),"Drift reverts any file that breaks these rules.");let l=[a.join(` +${m.message}`)?(a.add(c.id),o.info(`Resolved commit ${c.order} directly (builtin): ${m.message}`)):await Qy(t.workspace,c.files,s);continue}let u=c.fixPlan,d=Zx({plan:u.plan,verdict:u.residual===0?"accepted":"partial",assurance:u.assurance,sites:[],covered:u.covered,residual:u.residual,rejections:[],anchors:u.anchors},i,{verificationPassed:n.verification?.status==="passed"});if(d.action!=="apply"){o.info(`Commit ${c.order} has a validated fix plan that will not be applied unattended: ${d.reason} The plan document is included for review.`);continue}let p=await wVe(t.workspace,c);if(!p){await Qy(t.workspace,c.files,s);continue}await r.commitFiles(t,n.branchName,p.edits,[`${c.message}`,"",c.body,"",p.message,"",Yy({plan:u.plan,verdict:u.residual===0?"accepted":"partial",assurance:u.assurance,sites:[],covered:u.covered,residual:u.residual,rejections:[],anchors:u.anchors},{sites:!1,headingLevel:2})].join(` +`))?(a.add(c.id),o.info(`Resolved commit ${c.order} directly (fix plan): ${p.message}`)):await Qy(t.workspace,c.files,s)}catch(u){o.warn(`Deterministic remediation failed for commit ${c.order}, falling back to an agent: ${u.message}`),await Qy(t.workspace,c.files,s)}}return{committedIds:a}}async function vVe(e,t){let n=new Map;for(let r of t.files)try{n.set(r,await(0,Gf.readFile)((0,Xy.join)(e,r),"utf8"))}catch{}let i=Hx(t,n);if(i.status!=="applied")return null;for(let r of i.edits)await(0,Gf.writeFile)((0,Xy.join)(e,r.path),r.content,"utf8");return{edits:i.edits,message:i.message}}async function wVe(e,t){let n=new Map;for(let r of t.fixPlan?.files??[])try{n.set(r,await(0,Gf.readFile)((0,Xy.join)(e,r),"utf8"))}catch{}let i=Jx(t,n);if(i.status!=="applied")return null;for(let r of i.edits)await(0,Gf.writeFile)((0,Xy.join)(e,r.path),r.content,"utf8");return{edits:i.edits,message:i.message}}async function Qy(e,t,n){t.length!==0&&await n("git",["checkout","--",...t],{cwd:e})}var qf=require("node:fs/promises"),Zre=require("node:crypto"),Yre=require("node:os"),Es=require("node:path");var Yx="upgrade";function kVe(e){return{plan:e.plan,commit:e.commit,files:e.files,customInstructions:e.customInstructions,context:e.context,diagnostics:e.diagnostics,revision:e.revision,repair:e.repair,mode:e.mode,protectedPaths:e.protectedPaths}}function Pre(e,t=""){let n=e.mode==="upgrade"?[]:["","## Your task","",e.commit.instructions];return[_Ve(e),...n,...t?["",t]:[]].join(` +`)}function _Ve(e){return $Ve(kVe(e))}function AU(e){let{plan:t,commit:n}=e,i=t.changes.filter(u=>u.to),r=i.map(u=>u.name),o=i.map(u=>`${u.name} from ${u.from??"its previous version"} to ${u.to}`),s=n.id!==Yx,a=[`The dependenc${i.length===1?"y":"ies"} ${o.join(", ")||"in this repository"} ${i.length===1?"has":"have"} been upgraded.`,"","Update this repository so that it works correctly with the new version.",""];if(s){let u=t.breakingChanges.filter(p=>n.breakingChangeIds.includes(p.id)),d=t.impactSites.filter(p=>n.breakingChangeIds.includes(p.breakingChangeId));a.push("Fix only this problem, which the developer chose to fix on its own:","",...u.map(p=>`- ${p.summary}`),...d.slice(0,20).map(p=>` at ${p.file}:${p.line}`),"","Leave any other breakage for its own fix, and change another file only where","this fix needs it.","")}else a.push("Find and fix all relevant incompatibilities.","");let c=[...e.protectedPaths??[]];a.push(`Do not revert or downgrade ${r.length===1?"the dependency":"the dependencies"}. A companion package the new version requires may move with it.`,"","Run the appropriate tests/build/typecheck and leave the repository in a working state.","","Do not make a check pass by checking less: no lowered coverage thresholds, relaxed","compiler strictness, disabled lint rules, skipped or deleted tests, or suppression","directives."+(c.length?` Do not edit ${c.join(", ")}.`:""),"Drift reverts any file that breaks these rules.");let l=[a.join(` `)];if(e.customInstructions?.trim()&&l.push(`## Repository conventions ${e.customInstructions.trim()}`),e.context?.length){let u=["## Context the developer attached","","Reference material. Read it to match this codebase, but do NOT edit any of it.",""];for(let d of e.context)u.push(`### ${d.kind}: ${d.value}`),d.content&&u.push("```",d.content.slice(0,4e3),"```"),u.push("");l.push(u.join(` `))}return e.revision?.guidance.trim()&&l.push(["## The developer rejected your previous attempt","",`This is attempt ${e.revision.attempt}. What they said:`,"","```",e.revision.guidance.trim().slice(0,4e3),"```"].join(` `)),l.join(` -`)}function hVe(e){if(e.mode==="upgrade")return kU(e);let{plan:t,commit:n}=e,i=new Map(t.evidence.map(s=>[s.id,s])),r=t.breakingChanges.filter(s=>n.breakingChangeIds.includes(s.id)),o=[];o.push(["You are fixing code that a dependency upgrade broke.","","The dependency versions have ALREADY been updated. Your job is to update","this repository's own code so it works with the new version.","",`Dependencies that moved: ${t.changes.map(s=>`${s.name} ${s.from??"\u2014"} \u2192 ${s.to??"\u2014"}`).join(", ")}`].join(` +`)}function $Ve(e){if(e.mode==="upgrade")return AU(e);let{plan:t,commit:n}=e,i=new Map(t.evidence.map(s=>[s.id,s])),r=t.breakingChanges.filter(s=>n.breakingChangeIds.includes(s.id)),o=[];o.push(["You are fixing code that a dependency upgrade broke.","","The dependency versions have ALREADY been updated. Your job is to update","this repository's own code so it works with the new version.","",`Dependencies that moved: ${t.changes.map(s=>`${s.name} ${s.from??"\u2014"} \u2192 ${s.to??"\u2014"}`).join(", ")}`].join(` `));for(let s of r){let a=[`## ${s.summary}`,""];a.push(`- Package: ${s.dependency}`),a.push(`- Kind: ${s.kind}`),a.push(`- Confidence: ${s.confidence}`),s.symbols.length&&a.push(`- Symbols: ${s.symbols.join(", ")}`),a.push(""),a.push(`**Required fix:** ${s.remediation}`),a.push("");for(let l of s.citations){let u=i.get(l);u&&(a.push(`Evidence \u2014 ${u.title}:`),a.push("```"),a.push(u.content.slice(0,1200)),a.push("```"),u.url&&a.push(`Source: ${u.url}`),a.push(""))}let c=t.impactSites.filter(l=>l.breakingChangeId===s.id);if(c.length){a.push("Known locations (verify each; there may be others):");for(let l of c.slice(0,30)){let u=l.enclosingSymbol?` in ${l.enclosingSymbol}`:"";a.push(`- ${l.file}:${l.line}${u} \u2014 ${l.excerpt}`)}a.push("")}o.push(a.join(` `))}if(e.diagnostics?.trim()&&o.push(["## What the project's own checks report right now","","These ran against the tree you are about to edit, after the dependency","versions moved. Unlike everything above, this is measured rather than","predicted \u2014 where it disagrees with the analysis, believe this.","","Diagnostics are grouped by root cause with a count. A problem reported","many times is one problem: find what it shares before editing any","individual site, and do not work through occurrences one by one.","","Some of these may have nothing to do with the upgrade. Fixing unrelated","pre-existing errors is out of scope \u2014 leave them alone.","",e.diagnostics.trim()].join(` -`)),o.push(["## Rules","",`0. You may edit ONLY these ${e.files.length} file${e.files.length===1?"":"s"}, whose current contents`," accompany this prompt \u2014 nothing else, including generated/bundled output,"," lockfiles, or a file you notice is *also* broken by this upgrade. This"," is enforced after you finish: an edit to any other file throws out"," this whole commit's work. If the real fix needs a file outside this"," list, say so and stop rather than making the edit.",` In scope: ${e.files.map(s=>s.path).join(", ")}`,"1. Change ONLY what is required for this specific fix. No refactoring,"," renaming, reformatting, or tidying of code you happen to pass by.","2. Do NOT change dependency versions in any manifest or lockfile.","3. Do NOT weaken, skip, or delete tests to make them pass. Update a test"," to exercise the new API while asserting the same behaviour.","4. If you cannot determine the correct fix for a location, leave it alone"," and add a `TODO(drift):` comment explaining what is unresolved. A"," flagged unknown is useful; a confident guess is not.","5. Do not invent APIs. If the evidence names no replacement, say so.","6. If a decision genuinely needs the developer \u2014 two valid migrations, a"," behaviour change only they can rule on \u2014 ask instead of guessing. Emit",` \`${yVe} |