@opensumi/cli-engine 3.8.1-next-1741095045.0 → 3.8.1-next-1741098925.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/browser.js +1 -1
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -30080,7 +30080,7 @@ and limitations under the License.
|
|
|
30080
30080
|
`)[0];let c,y=g.match(QUERY_WORD_REGEX)[0];switch(u){case 2:c=new RangeError(`Bad node name '${y}'`);break;case 3:c=new RangeError(`Bad field name '${y}'`);break;case 4:c=new RangeError(`Bad capture name @${y}`);break;case 5:c=new TypeError(`Bad pattern structure at offset ${E}: '${g}'...`),y="";break;default:c=new SyntaxError(`Bad syntax at offset ${E}: '${g}'...`),y=""}throw c.index=E,c.length=y.length,C._free(n),c}const o=C._ts_query_string_count(r),l=C._ts_query_capture_count(r),p=C._ts_query_pattern_count(r),v=new Array(l),m=new Array(o);for(let u=0;u<l;u++){const d=C._ts_query_capture_name_for_id(r,u,TRANSFER_BUFFER),E=getValue(TRANSFER_BUFFER,"i32");v[u]=UTF8ToString(d,E)}for(let u=0;u<o;u++){const d=C._ts_query_string_value_for_id(r,u,TRANSFER_BUFFER),E=getValue(TRANSFER_BUFFER,"i32");m[u]=UTF8ToString(d,E)}const _=new Array(p),s=new Array(p),f=new Array(p),a=new Array(p),h=new Array(p);for(let u=0;u<p;u++){const d=C._ts_query_predicates_for_pattern(r,u,TRANSFER_BUFFER),E=getValue(TRANSFER_BUFFER,"i32");a[u]=[],h[u]=[];const g=[];let c=d;for(let y=0;y<E;y++){const b=getValue(c,"i32");c+=SIZE_OF_INT;const S=getValue(c,"i32");if(c+=SIZE_OF_INT,b===PREDICATE_STEP_TYPE_CAPTURE)g.push({type:"capture",name:v[S]});else if(b===PREDICATE_STEP_TYPE_STRING)g.push({type:"string",value:m[S]});else if(g.length>0){if(g[0].type!=="string")throw new Error("Predicates must begin with a literal value");const A=g[0].value;let w,T=!0,D=!0;switch(A){case"any-not-eq?":case"not-eq?":T=!1;case"any-eq?":case"eq?":if(g.length!==3)throw new Error(`Wrong number of arguments to \`#${A}\` predicate. Expected 2, got ${g.length-1}`);if(g[1].type!=="capture")throw new Error(`First argument of \`#${A}\` predicate must be a capture. Got "${g[1].value}"`);if(D=!A.startsWith("any-"),g[2].type==="capture"){const O=g[1].name,P=g[2].name;h[u].push(k=>{const F=[],L=[];for(const j of k)j.name===O&&F.push(j.node),j.name===P&&L.push(j.node);const B=(j,W,U)=>U?j.text===W.text:j.text!==W.text;return D?F.every(j=>L.some(W=>B(j,W,T))):F.some(j=>L.some(W=>B(j,W,T)))})}else{w=g[1].name;const O=g[2].value,P=F=>F.text===O,k=F=>F.text!==O;h[u].push(F=>{const L=[];for(const j of F)j.name===w&&L.push(j.node);const B=T?P:k;return D?L.every(B):L.some(B)})}break;case"any-not-match?":case"not-match?":T=!1;case"any-match?":case"match?":if(g.length!==3)throw new Error(`Wrong number of arguments to \`#${A}\` predicate. Expected 2, got ${g.length-1}.`);if(g[1].type!=="capture")throw new Error(`First argument of \`#${A}\` predicate must be a capture. Got "${g[1].value}".`);if(g[2].type!=="string")throw new Error(`Second argument of \`#${A}\` predicate must be a string. Got @${g[2].value}.`);w=g[1].name;const I=new RegExp(g[2].value);D=!A.startsWith("any-"),h[u].push(O=>{const P=[];for(const F of O)F.name===w&&P.push(F.node.text);const k=(F,L)=>L?I.test(F):!I.test(F);return P.length===0?!T:D?P.every(F=>k(F,T)):P.some(F=>k(F,T))});break;case"set!":if(g.length<2||g.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${g.length-1}.`);if(g.some(O=>O.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');_[u]||(_[u]={}),_[u][g[1].value]=g[2]?g[2].value:null;break;case"is?":case"is-not?":if(g.length<2||g.length>3)throw new Error(`Wrong number of arguments to \`#${A}\` predicate. Expected 1 or 2. Got ${g.length-1}.`);if(g.some(O=>O.type!=="string"))throw new Error(`Arguments to \`#${A}\` predicate must be a strings.".`);const R=A==="is?"?s:f;R[u]||(R[u]={}),R[u][g[1].value]=g[2]?g[2].value:null;break;case"not-any-of?":T=!1;case"any-of?":if(g.length<2)throw new Error(`Wrong number of arguments to \`#${A}\` predicate. Expected at least 1. Got ${g.length-1}.`);if(g[1].type!=="capture")throw new Error(`First argument of \`#${A}\` predicate must be a capture. Got "${g[1].value}".`);for(let O=2;O<g.length;O++)if(g[O].type!=="string")throw new Error(`Arguments to \`#${A}\` predicate must be a strings.".`);w=g[1].name;const M=g.slice(2).map(O=>O.value);h[u].push(O=>{const P=[];for(const k of O)k.name===w&&P.push(k.node.text);return P.length===0?!T:P.every(k=>M.includes(k))===T});break;default:a[u].push({operator:A,operands:g.slice(1)})}g.length=0}}Object.freeze(_[u]),Object.freeze(s[u]),Object.freeze(f[u])}return C._free(n),new Query(INTERNAL,r,v,h,a,Object.freeze(_),Object.freeze(s),Object.freeze(f))}static load(t){let e;if(t instanceof Uint8Array)e=Promise.resolve(t);else{const n=t;if(typeof process<"u"&&process.versions&&process.versions.node){const r=__webpack_require__(83078);e=Promise.resolve(r.readFileSync(n))}else e=fetch(n).then(r=>r.arrayBuffer().then(o=>{if(r.ok)return new Uint8Array(o);{const l=new TextDecoder("utf-8").decode(o);throw new Error(`Language.load failed with status ${r.status}.
|
|
30081
30081
|
|
|
30082
30082
|
${l}`)}}))}return e.then(n=>loadWebAssemblyModule(n,{loadAsync:!0})).then(n=>{const r=Object.keys(n),o=r.find(p=>LANGUAGE_FUNCTION_REGEX.test(p)&&!p.includes("external_scanner_"));o||console.log(`Couldn't find language function in WASM file. Symbols:
|
|
30083
|
-
${JSON.stringify(r,null,2)}`);const l=n[o]();return new Language(INTERNAL,l)})}}class LookaheadIterable{constructor(t,e,n){assertInternal(t),this[0]=e,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(t){return C._ts_lookahead_iterator_reset_state(this[0],t)}reset(t,e){return!!C._ts_lookahead_iterator_reset(this[0],t[0],e)&&(this.language=t,!0)}[Symbol.iterator](){const t=this;return{next:()=>C._ts_lookahead_iterator_next(t[0])?{done:!1,value:t.currentType}:{done:!0,value:""}}}}class Query{constructor(t,e,n,r,o,l,p,v){assertInternal(t),this[0]=e,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=l,this.assertedProperties=p,this.refutedProperties=v,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:p=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_matches_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,p);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),_=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=new Array(v);this.exceededMatchLimit=!!_;let f=0,a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const d=getValue(a,"i32");a+=SIZE_OF_INT;const E=new Array(d);if(a=unmarshalCaptures(this,t.tree,a,E),this.textPredicates[u].every(g=>g(E))){s[f]={pattern:u,captures:E};const g=this.setProperties[u];g&&(s[f].setProperties=g);const c=this.assertedProperties[u];c&&(s[f].assertedProperties=c);const y=this.refutedProperties[u];y&&(s[f].refutedProperties=y),f++}}return s.length=f,C._free(m),s}captures(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:p=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_captures_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,p);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),_=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=[];this.exceededMatchLimit=!!_;const f=[];let a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const d=getValue(a,"i32");a+=SIZE_OF_INT;const E=getValue(a,"i32");if(a+=SIZE_OF_INT,f.length=d,a=unmarshalCaptures(this,t.tree,a,f),this.textPredicates[u].every(g=>g(f))){const g=f[E],c=this.setProperties[u];c&&(g.setProperties=c);const y=this.assertedProperties[u];y&&(g.assertedProperties=y);const b=this.refutedProperties[u];b&&(g.refutedProperties=b),s.push(g)}}return C._free(m),s}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){const e=lengthBytesUTF8(t),n=C._malloc(e+1);stringToUTF8(t,n,e+1),C._ts_query_disable_capture(this[0],n,e),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(x,t,e){const n=e-t;let r=x.textCallback(t,null,e);for(t+=r.length;t<e;){const o=x.textCallback(t,null,e);if(!(o&&o.length>0))break;t+=o.length,r+=o}return t>e&&(r=r.slice(0,n)),r}function unmarshalCaptures(x,t,e,n){for(let r=0,o=n.length;r<o;r++){const l=getValue(e,"i32"),p=unmarshalNode(t,e+=SIZE_OF_INT);e+=SIZE_OF_NODE,n[r]={name:x.captureNames[l],node:p}}return e}function assertInternal(x){if(x!==INTERNAL)throw new Error("Illegal constructor")}function isPoint(x){return x&&typeof x.row=="number"&&typeof x.column=="number"}function marshalNode(x){let t=TRANSFER_BUFFER;setValue(t,x.id,"i32"),t+=SIZE_OF_INT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.row,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.column,"i32"),t+=SIZE_OF_INT,setValue(t,x[0],"i32")}function unmarshalNode(x,t=TRANSFER_BUFFER){const e=getValue(t,"i32");if(e===0)return null;const n=getValue(t+=SIZE_OF_INT,"i32"),r=getValue(t+=SIZE_OF_INT,"i32"),o=getValue(t+=SIZE_OF_INT,"i32"),l=getValue(t+=SIZE_OF_INT,"i32"),p=new Node(INTERNAL,x);return p.id=e,p.startIndex=n,p.startPosition={row:r,column:o},p[0]=l,p}function marshalTreeCursor(x,t=TRANSFER_BUFFER){setValue(t+0*SIZE_OF_INT,x[0],"i32"),setValue(t+1*SIZE_OF_INT,x[1],"i32"),setValue(t+2*SIZE_OF_INT,x[2],"i32"),setValue(t+3*SIZE_OF_INT,x[3],"i32")}function unmarshalTreeCursor(x){x[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),x[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),x[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),x[3]=getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(x,t){setValue(x,t.row,"i32"),setValue(x+SIZE_OF_INT,t.column,"i32")}function unmarshalPoint(x){return{row:getValue(x,"i32")>>>0,column:getValue(x+SIZE_OF_INT,"i32")>>>0}}function marshalRange(x,t){marshalPoint(x,t.startPosition),marshalPoint(x+=SIZE_OF_POINT,t.endPosition),setValue(x+=SIZE_OF_POINT,t.startIndex,"i32"),setValue(x+=SIZE_OF_INT,t.endIndex,"i32"),x+=SIZE_OF_INT}function unmarshalRange(x){const t={};return t.startPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.endPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.startIndex=getValue(x,"i32")>>>0,x+=SIZE_OF_INT,t.endIndex=getValue(x,"i32")>>>0,t}function marshalEdit(x){let t=TRANSFER_BUFFER;marshalPoint(t,x.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.oldEndPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.newEndPosition),t+=SIZE_OF_POINT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.oldEndIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.newEndIndex,"i32"),t+=SIZE_OF_INT}for(const x of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,x,{value:ParserImpl.prototype[x],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser}();module.exports=TreeSitter},52730:(x,t,e)=>{"use strict";var n=e(80705),r=e(14834),o=e(28498),l=e(79818),p=e(69336),v=l("Object.prototype.toString"),m=e(51913)(),_=typeof globalThis>"u"?e.g:globalThis,s=r(),f=l("String.prototype.slice"),a=Object.getPrototypeOf,h=l("Array.prototype.indexOf",!0)||function(c,y){for(var b=0;b<c.length;b+=1)if(c[b]===y)return b;return-1},u={__proto__:null};m&&p&&a?n(s,function(g){var c=new _[g];if(Symbol.toStringTag in c){var y=a(c),b=p(y,Symbol.toStringTag);if(!b){var S=a(y);b=p(S,Symbol.toStringTag)}u["$"+g]=o(b.get)}}):n(s,function(g){var c=new _[g],y=c.slice||c.set;y&&(u["$"+g]=o(y))});var d=function(c){var y=!1;return n(u,function(b,S){if(!y)try{"$"+b(c)===S&&(y=f(S,1))}catch{}}),y},E=function(c){var y=!1;return n(u,function(b,S){if(!y)try{b(c),y=f(S,1)}catch{}}),y};x.exports=function(c){if(!c||typeof c!="object")return!1;if(!m){var y=f(v(c),8,-1);return h(s,y)>-1?y:y!=="Object"?!1:E(c)}return p?d(c):null}},97442:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const n=e(94705);t.ZodIssueCode=n.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const r=l=>JSON.stringify(l,null,2).replace(/"([^"]+)":/g,"$1:");t.quotelessJson=r;class o extends Error{get errors(){return this.issues}constructor(p){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};const v=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,v):this.__proto__=v,this.name="ZodError",this.issues=p}format(p){const v=p||function(s){return s.message},m={_errors:[]},_=s=>{for(const f of s.issues)if(f.code==="invalid_union")f.unionErrors.map(_);else if(f.code==="invalid_return_type")_(f.returnTypeError);else if(f.code==="invalid_arguments")_(f.argumentsError);else if(f.path.length===0)m._errors.push(v(f));else{let a=m,h=0;for(;h<f.path.length;){const u=f.path[h];h===f.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(v(f))):a[u]=a[u]||{_errors:[]},a=a[u],h++}}};return _(this),m}static assert(p){if(!(p instanceof o))throw new Error(`Not a ZodError: ${p}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(p=v=>v.message){const v={},m=[];for(const _ of this.issues)_.path.length>0?(v[_.path[0]]=v[_.path[0]]||[],v[_.path[0]].push(p(_))):m.push(p(_));return{formErrors:m,fieldErrors:v}}get formErrors(){return this.flatten()}}t.ZodError=o,o.create=l=>new o(l)},30548:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const r=n(e(28412));t.defaultErrorMap=r.default;let o=r.default;function l(v){o=v}t.setErrorMap=l;function p(){return o}t.getErrorMap=p},86340:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(o,l,p,v){v===void 0&&(v=p);var m=Object.getOwnPropertyDescriptor(l,p);(!m||("get"in m?!l.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return l[p]}}),Object.defineProperty(o,v,m)}:function(o,l,p,v){v===void 0&&(v=p),o[v]=l[p]}),r=this&&this.__exportStar||function(o,l){for(var p in o)p!=="default"&&!Object.prototype.hasOwnProperty.call(l,p)&&n(l,o,p)};Object.defineProperty(t,"__esModule",{value:!0}),r(e(30548),t),r(e(66258),t),r(e(29201),t),r(e(94705),t),r(e(75226),t),r(e(97442),t)},15759:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0;var e;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(e||(t.errorUtil=e={}))},66258:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const r=e(30548),o=n(e(28412)),l=u=>{const{data:d,path:E,errorMaps:g,issueData:c}=u,y=[...E,...c.path||[]],b={...c,path:y};if(c.message!==void 0)return{...c,path:y,message:c.message};let S="";const A=g.filter(w=>!!w).slice().reverse();for(const w of A)S=w(b,{data:d,defaultError:S}).message;return{...c,path:y,message:S}};t.makeIssue=l,t.EMPTY_PATH=[];function p(u,d){const E=(0,r.getErrorMap)(),g=(0,t.makeIssue)({issueData:d,data:u.data,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,E,E===o.default?void 0:o.default].filter(c=>!!c)});u.common.issues.push(g)}t.addIssueToContext=p;class v{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(d,E){const g=[];for(const c of E){if(c.status==="aborted")return t.INVALID;c.status==="dirty"&&d.dirty(),g.push(c.value)}return{status:d.value,value:g}}static async mergeObjectAsync(d,E){const g=[];for(const c of E){const y=await c.key,b=await c.value;g.push({key:y,value:b})}return v.mergeObjectSync(d,g)}static mergeObjectSync(d,E){const g={};for(const c of E){const{key:y,value:b}=c;if(y.status==="aborted"||b.status==="aborted")return t.INVALID;y.status==="dirty"&&d.dirty(),b.status==="dirty"&&d.dirty(),y.value!=="__proto__"&&(typeof b.value<"u"||c.alwaysSet)&&(g[y.value]=b.value)}return{status:d.value,value:g}}}t.ParseStatus=v,t.INVALID=Object.freeze({status:"aborted"});const m=u=>({status:"dirty",value:u});t.DIRTY=m;const _=u=>({status:"valid",value:u});t.OK=_;const s=u=>u.status==="aborted";t.isAborted=s;const f=u=>u.status==="dirty";t.isDirty=f;const a=u=>u.status==="valid";t.isValid=a;const h=u=>typeof Promise<"u"&&u instanceof Promise;t.isAsync=h},29201:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94705:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0;var e;(function(o){o.assertEqual=m=>m;function l(m){}o.assertIs=l;function p(m){throw new Error}o.assertNever=p,o.arrayToEnum=m=>{const _={};for(const s of m)_[s]=s;return _},o.getValidEnumValues=m=>{const _=o.objectKeys(m).filter(f=>typeof m[m[f]]!="number"),s={};for(const f of _)s[f]=m[f];return o.objectValues(s)},o.objectValues=m=>o.objectKeys(m).map(function(_){return m[_]}),o.objectKeys=typeof Object.keys=="function"?m=>Object.keys(m):m=>{const _=[];for(const s in m)Object.prototype.hasOwnProperty.call(m,s)&&_.push(s);return _},o.find=(m,_)=>{for(const s of m)if(_(s))return s},o.isInteger=typeof Number.isInteger=="function"?m=>Number.isInteger(m):m=>typeof m=="number"&&isFinite(m)&&Math.floor(m)===m;function v(m,_=" | "){return m.map(s=>typeof s=="string"?`'${s}'`:s).join(_)}o.joinValues=v,o.jsonStringifyReplacer=(m,_)=>typeof _=="bigint"?_.toString():_})(e||(t.util=e={}));var n;(function(o){o.mergeShapes=(l,p)=>({...l,...p})})(n||(t.objectUtil=n={})),t.ZodParsedType=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const r=o=>{switch(typeof o){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(o)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(o)?t.ZodParsedType.array:o===null?t.ZodParsedType.null:o.then&&typeof o.then=="function"&&o.catch&&typeof o.catch=="function"?t.ZodParsedType.promise:typeof Map<"u"&&o instanceof Map?t.ZodParsedType.map:typeof Set<"u"&&o instanceof Set?t.ZodParsedType.set:typeof Date<"u"&&o instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}};t.getParsedType=r},75995:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(v,m,_,s){s===void 0&&(s=_);var f=Object.getOwnPropertyDescriptor(m,_);(!f||("get"in f?!m.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return m[_]}}),Object.defineProperty(v,s,f)}:function(v,m,_,s){s===void 0&&(s=_),v[s]=m[_]}),r=this&&this.__setModuleDefault||(Object.create?function(v,m){Object.defineProperty(v,"default",{enumerable:!0,value:m})}:function(v,m){v.default=m}),o=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var m={};if(v!=null)for(var _ in v)_!=="default"&&Object.prototype.hasOwnProperty.call(v,_)&&n(m,v,_);return r(m,v),m},l=this&&this.__exportStar||function(v,m){for(var _ in v)_!=="default"&&!Object.prototype.hasOwnProperty.call(m,_)&&n(m,v,_)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const p=o(e(86340));t.z=p,l(e(86340),t),t.default=p},28412:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(94705),r=e(97442),o=(l,p)=>{let v;switch(l.code){case r.ZodIssueCode.invalid_type:l.received===n.ZodParsedType.undefined?v="Required":v=`Expected ${l.expected}, received ${l.received}`;break;case r.ZodIssueCode.invalid_literal:v=`Invalid literal value, expected ${JSON.stringify(l.expected,n.util.jsonStringifyReplacer)}`;break;case r.ZodIssueCode.unrecognized_keys:v=`Unrecognized key(s) in object: ${n.util.joinValues(l.keys,", ")}`;break;case r.ZodIssueCode.invalid_union:v="Invalid input";break;case r.ZodIssueCode.invalid_union_discriminator:v=`Invalid discriminator value. Expected ${n.util.joinValues(l.options)}`;break;case r.ZodIssueCode.invalid_enum_value:v=`Invalid enum value. Expected ${n.util.joinValues(l.options)}, received '${l.received}'`;break;case r.ZodIssueCode.invalid_arguments:v="Invalid function arguments";break;case r.ZodIssueCode.invalid_return_type:v="Invalid function return type";break;case r.ZodIssueCode.invalid_date:v="Invalid date";break;case r.ZodIssueCode.invalid_string:typeof l.validation=="object"?"includes"in l.validation?(v=`Invalid input: must include "${l.validation.includes}"`,typeof l.validation.position=="number"&&(v=`${v} at one or more positions greater than or equal to ${l.validation.position}`)):"startsWith"in l.validation?v=`Invalid input: must start with "${l.validation.startsWith}"`:"endsWith"in l.validation?v=`Invalid input: must end with "${l.validation.endsWith}"`:n.util.assertNever(l.validation):l.validation!=="regex"?v=`Invalid ${l.validation}`:v="Invalid";break;case r.ZodIssueCode.too_small:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at least":"more than"} ${l.minimum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at least":"over"} ${l.minimum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${l.minimum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(l.minimum))}`:v="Invalid input";break;case r.ZodIssueCode.too_big:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at most":"less than"} ${l.maximum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at most":"under"} ${l.maximum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="bigint"?v=`BigInt must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly":l.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(l.maximum))}`:v="Invalid input";break;case r.ZodIssueCode.custom:v="Invalid input";break;case r.ZodIssueCode.invalid_intersection_types:v="Intersection results could not be merged";break;case r.ZodIssueCode.not_multiple_of:v=`Number must be a multiple of ${l.multipleOf}`;break;case r.ZodIssueCode.not_finite:v="Number must be finite";break;default:v=p.defaultError,n.util.assertNever(l)}return{message:v}};t.default=o},75226:function(x,t,e){"use strict";var n=this&&this.__classPrivateFieldGet||function(ln,st,Ht,on){if(Ht==="a"&&!on)throw new TypeError("Private accessor was defined without a getter");if(typeof st=="function"?ln!==st||!on:!st.has(ln))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ht==="m"?on:Ht==="a"?on.call(ln):on?on.value:st.get(ln)},r=this&&this.__classPrivateFieldSet||function(ln,st,Ht,on,xn){if(on==="m")throw new TypeError("Private method is not writable");if(on==="a"&&!xn)throw new TypeError("Private accessor was defined without a setter");if(typeof st=="function"?ln!==st||!xn:!st.has(ln))throw new TypeError("Cannot write private member to an object whose class did not declare it");return on==="a"?xn.call(ln,Ht):xn?xn.value=Ht:st.set(ln,Ht),Ht},o,l;Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const p=e(30548),v=e(15759),m=e(66258),_=e(94705),s=e(97442);class f{constructor(st,Ht,on,xn){this._cachedPath=[],this.parent=st,this.data=Ht,this._path=on,this._key=xn}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(ln,st)=>{if((0,m.isValid)(st))return{success:!0,data:st.value};if(!ln.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const Ht=new s.ZodError(ln.common.issues);return this._error=Ht,this._error}}};function h(ln){if(!ln)return{};const{errorMap:st,invalid_type_error:Ht,required_error:on,description:xn}=ln;if(st&&(Ht||on))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return st?{errorMap:st,description:xn}:{errorMap:(Gi,Fi)=>{var oo,Mi;const{message:no}=ln;return Gi.code==="invalid_enum_value"?{message:no??Fi.defaultError}:typeof Fi.data>"u"?{message:(oo=no??on)!==null&&oo!==void 0?oo:Fi.defaultError}:Gi.code!=="invalid_type"?{message:Fi.defaultError}:{message:(Mi=no??Ht)!==null&&Mi!==void 0?Mi:Fi.defaultError}},description:xn}}class u{get description(){return this._def.description}_getType(st){return(0,_.getParsedType)(st.data)}_getOrReturnCtx(st,Ht){return Ht||{common:st.parent.common,data:st.data,parsedType:(0,_.getParsedType)(st.data),schemaErrorMap:this._def.errorMap,path:st.path,parent:st.parent}}_processInputParams(st){return{status:new m.ParseStatus,ctx:{common:st.parent.common,data:st.data,parsedType:(0,_.getParsedType)(st.data),schemaErrorMap:this._def.errorMap,path:st.path,parent:st.parent}}}_parseSync(st){const Ht=this._parse(st);if((0,m.isAsync)(Ht))throw new Error("Synchronous parse encountered promise.");return Ht}_parseAsync(st){const Ht=this._parse(st);return Promise.resolve(Ht)}parse(st,Ht){const on=this.safeParse(st,Ht);if(on.success)return on.data;throw on.error}safeParse(st,Ht){var on;const xn={common:{issues:[],async:(on=Ht?.async)!==null&&on!==void 0?on:!1,contextualErrorMap:Ht?.errorMap},path:Ht?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:st,parsedType:(0,_.getParsedType)(st)},Zn=this._parseSync({data:st,path:xn.path,parent:xn});return a(xn,Zn)}"~validate"(st){var Ht,on;const xn={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:st,parsedType:(0,_.getParsedType)(st)};if(!this["~standard"].async)try{const Zn=this._parseSync({data:st,path:[],parent:xn});return(0,m.isValid)(Zn)?{value:Zn.value}:{issues:xn.common.issues}}catch(Zn){!((on=(Ht=Zn?.message)===null||Ht===void 0?void 0:Ht.toLowerCase())===null||on===void 0)&&on.includes("encountered")&&(this["~standard"].async=!0),xn.common={issues:[],async:!0}}return this._parseAsync({data:st,path:[],parent:xn}).then(Zn=>(0,m.isValid)(Zn)?{value:Zn.value}:{issues:xn.common.issues})}async parseAsync(st,Ht){const on=await this.safeParseAsync(st,Ht);if(on.success)return on.data;throw on.error}async safeParseAsync(st,Ht){const on={common:{issues:[],contextualErrorMap:Ht?.errorMap,async:!0},path:Ht?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:st,parsedType:(0,_.getParsedType)(st)},xn=this._parse({data:st,path:on.path,parent:on}),Zn=await((0,m.isAsync)(xn)?xn:Promise.resolve(xn));return a(on,Zn)}refine(st,Ht){const on=xn=>typeof Ht=="string"||typeof Ht>"u"?{message:Ht}:typeof Ht=="function"?Ht(xn):Ht;return this._refinement((xn,Zn)=>{const Gi=st(xn),Fi=()=>Zn.addIssue({code:s.ZodIssueCode.custom,...on(xn)});return typeof Promise<"u"&&Gi instanceof Promise?Gi.then(oo=>oo?!0:(Fi(),!1)):Gi?!0:(Fi(),!1)})}refinement(st,Ht){return this._refinement((on,xn)=>st(on)?!0:(xn.addIssue(typeof Ht=="function"?Ht(on,xn):Ht),!1))}_refinement(st){return new $e({schema:this,typeName:St.ZodEffects,effect:{type:"refinement",refinement:st}})}superRefine(st){return this._refinement(st)}constructor(st){this.spa=this.safeParseAsync,this._def=st,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:Ht=>this["~validate"](Ht)}}optional(){return Ve.create(this,this._def)}nullable(){return at.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ie.create(this)}promise(){return Ue.create(this,this._def)}or(st){return fe.create([this,st],this._def)}and(st){return Se.create(this,st,this._def)}transform(st){return new $e({...h(this._def),schema:this,typeName:St.ZodEffects,effect:{type:"transform",transform:st}})}default(st){const Ht=typeof st=="function"?st:()=>st;return new qe({...h(this._def),innerType:this,defaultValue:Ht,typeName:St.ZodDefault})}brand(){return new yt({typeName:St.ZodBranded,type:this,...h(this._def)})}catch(st){const Ht=typeof st=="function"?st:()=>st;return new Ot({...h(this._def),innerType:this,catchValue:Ht,typeName:St.ZodCatch})}describe(st){const Ht=this.constructor;return new Ht({...this._def,description:st})}pipe(st){return tt.create(this,st)}readonly(){return dt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=u,t.Schema=u,t.ZodSchema=u;const d=/^c[^\s-]{8,}$/i,E=/^[0-9a-z]+$/,g=/^[0-9A-HJKMNP-TV-Z]{26}$/i,c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y=/^[a-z0-9_-]{21}$/i,b=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,S=/^[-+]?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)?)??$/,A=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let T;const D=/^(?:(?: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])$/,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])\/(3[0-2]|[12]?[0-9])$/,R=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,M=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,O=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,P=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,k="((\\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])))",F=new RegExp(`^${k}$`);function L(ln){let st="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return ln.precision?st=`${st}\\.\\d{${ln.precision}}`:ln.precision==null&&(st=`${st}(\\.\\d+)?`),st}function B(ln){return new RegExp(`^${L(ln)}$`)}function j(ln){let st=`${k}T${L(ln)}`;const Ht=[];return Ht.push(ln.local?"Z?":"Z"),ln.offset&&Ht.push("([+-]\\d{2}:?\\d{2})"),st=`${st}(${Ht.join("|")})`,new RegExp(`^${st}$`)}t.datetimeRegex=j;function W(ln,st){return!!((st==="v4"||!st)&&D.test(ln)||(st==="v6"||!st)&&R.test(ln))}function U(ln,st){if(!b.test(ln))return!1;try{const[Ht]=ln.split("."),on=Ht.replace(/-/g,"+").replace(/_/g,"/").padEnd(Ht.length+(4-Ht.length%4)%4,"="),xn=JSON.parse(atob(on));return!(typeof xn!="object"||xn===null||!xn.typ||!xn.alg||st&&xn.alg!==st)}catch{return!1}}function X(ln,st){return!!((st==="v4"||!st)&&I.test(ln)||(st==="v6"||!st)&&M.test(ln))}class V extends u{_parse(st){if(this._def.coerce&&(st.data=String(st.data)),this._getType(st)!==_.ZodParsedType.string){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.string,received:Zn.parsedType}),m.INVALID}const on=new m.ParseStatus;let xn;for(const Zn of this._def.checks)if(Zn.kind==="min")st.data.length<Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_small,minimum:Zn.value,type:"string",inclusive:!0,exact:!1,message:Zn.message}),on.dirty());else if(Zn.kind==="max")st.data.length>Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_big,maximum:Zn.value,type:"string",inclusive:!0,exact:!1,message:Zn.message}),on.dirty());else if(Zn.kind==="length"){const Gi=st.data.length>Zn.value,Fi=st.data.length<Zn.value;(Gi||Fi)&&(xn=this._getOrReturnCtx(st,xn),Gi?(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_big,maximum:Zn.value,type:"string",inclusive:!0,exact:!0,message:Zn.message}):Fi&&(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_small,minimum:Zn.value,type:"string",inclusive:!0,exact:!0,message:Zn.message}),on.dirty())}else if(Zn.kind==="email")A.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"email",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="emoji")T||(T=new RegExp(w,"u")),T.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="uuid")c.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="nanoid")y.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"nanoid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="cuid")d.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="cuid2")E.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="ulid")g.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="url")try{new URL(st.data)}catch{xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"url",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()}else Zn.kind==="regex"?(Zn.regex.lastIndex=0,Zn.regex.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty())):Zn.kind==="trim"?st.data=st.data.trim():Zn.kind==="includes"?st.data.includes(Zn.value,Zn.position)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:{includes:Zn.value,position:Zn.position},message:Zn.message}),on.dirty()):Zn.kind==="toLowerCase"?st.data=st.data.toLowerCase():Zn.kind==="toUpperCase"?st.data=st.data.toUpperCase():Zn.kind==="startsWith"?st.data.startsWith(Zn.value)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:Zn.value},message:Zn.message}),on.dirty()):Zn.kind==="endsWith"?st.data.endsWith(Zn.value)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:Zn.value},message:Zn.message}),on.dirty()):Zn.kind==="datetime"?j(Zn).test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:Zn.message}),on.dirty()):Zn.kind==="date"?F.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:"date",message:Zn.message}),on.dirty()):Zn.kind==="time"?B(Zn).test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:"time",message:Zn.message}),on.dirty()):Zn.kind==="duration"?S.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"duration",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="ip"?W(st.data,Zn.version)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="jwt"?U(st.data,Zn.alg)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"jwt",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="cidr"?X(st.data,Zn.version)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"cidr",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="base64"?O.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"base64",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="base64url"?P.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"base64url",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):_.util.assertNever(Zn);return{status:on.value,value:st.data}}_regex(st,Ht,on){return this.refinement(xn=>st.test(xn),{validation:Ht,code:s.ZodIssueCode.invalid_string,...v.errorUtil.errToObj(on)})}_addCheck(st){return new V({...this._def,checks:[...this._def.checks,st]})}email(st){return this._addCheck({kind:"email",...v.errorUtil.errToObj(st)})}url(st){return this._addCheck({kind:"url",...v.errorUtil.errToObj(st)})}emoji(st){return this._addCheck({kind:"emoji",...v.errorUtil.errToObj(st)})}uuid(st){return this._addCheck({kind:"uuid",...v.errorUtil.errToObj(st)})}nanoid(st){return this._addCheck({kind:"nanoid",...v.errorUtil.errToObj(st)})}cuid(st){return this._addCheck({kind:"cuid",...v.errorUtil.errToObj(st)})}cuid2(st){return this._addCheck({kind:"cuid2",...v.errorUtil.errToObj(st)})}ulid(st){return this._addCheck({kind:"ulid",...v.errorUtil.errToObj(st)})}base64(st){return this._addCheck({kind:"base64",...v.errorUtil.errToObj(st)})}base64url(st){return this._addCheck({kind:"base64url",...v.errorUtil.errToObj(st)})}jwt(st){return this._addCheck({kind:"jwt",...v.errorUtil.errToObj(st)})}ip(st){return this._addCheck({kind:"ip",...v.errorUtil.errToObj(st)})}cidr(st){return this._addCheck({kind:"cidr",...v.errorUtil.errToObj(st)})}datetime(st){var Ht,on;return typeof st=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:st}):this._addCheck({kind:"datetime",precision:typeof st?.precision>"u"?null:st?.precision,offset:(Ht=st?.offset)!==null&&Ht!==void 0?Ht:!1,local:(on=st?.local)!==null&&on!==void 0?on:!1,...v.errorUtil.errToObj(st?.message)})}date(st){return this._addCheck({kind:"date",message:st})}time(st){return typeof st=="string"?this._addCheck({kind:"time",precision:null,message:st}):this._addCheck({kind:"time",precision:typeof st?.precision>"u"?null:st?.precision,...v.errorUtil.errToObj(st?.message)})}duration(st){return this._addCheck({kind:"duration",...v.errorUtil.errToObj(st)})}regex(st,Ht){return this._addCheck({kind:"regex",regex:st,...v.errorUtil.errToObj(Ht)})}includes(st,Ht){return this._addCheck({kind:"includes",value:st,position:Ht?.position,...v.errorUtil.errToObj(Ht?.message)})}startsWith(st,Ht){return this._addCheck({kind:"startsWith",value:st,...v.errorUtil.errToObj(Ht)})}endsWith(st,Ht){return this._addCheck({kind:"endsWith",value:st,...v.errorUtil.errToObj(Ht)})}min(st,Ht){return this._addCheck({kind:"min",value:st,...v.errorUtil.errToObj(Ht)})}max(st,Ht){return this._addCheck({kind:"max",value:st,...v.errorUtil.errToObj(Ht)})}length(st,Ht){return this._addCheck({kind:"length",value:st,...v.errorUtil.errToObj(Ht)})}nonempty(st){return this.min(1,v.errorUtil.errToObj(st))}trim(){return new V({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(st=>st.kind==="datetime")}get isDate(){return!!this._def.checks.find(st=>st.kind==="date")}get isTime(){return!!this._def.checks.find(st=>st.kind==="time")}get isDuration(){return!!this._def.checks.find(st=>st.kind==="duration")}get isEmail(){return!!this._def.checks.find(st=>st.kind==="email")}get isURL(){return!!this._def.checks.find(st=>st.kind==="url")}get isEmoji(){return!!this._def.checks.find(st=>st.kind==="emoji")}get isUUID(){return!!this._def.checks.find(st=>st.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(st=>st.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(st=>st.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(st=>st.kind==="cuid2")}get isULID(){return!!this._def.checks.find(st=>st.kind==="ulid")}get isIP(){return!!this._def.checks.find(st=>st.kind==="ip")}get isCIDR(){return!!this._def.checks.find(st=>st.kind==="cidr")}get isBase64(){return!!this._def.checks.find(st=>st.kind==="base64")}get isBase64url(){return!!this._def.checks.find(st=>st.kind==="base64url")}get minLength(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st}get maxLength(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st}}t.ZodString=V,V.create=ln=>{var st;return new V({checks:[],typeName:St.ZodString,coerce:(st=ln?.coerce)!==null&&st!==void 0?st:!1,...h(ln)})};function $(ln,st){const Ht=(ln.toString().split(".")[1]||"").length,on=(st.toString().split(".")[1]||"").length,xn=Ht>on?Ht:on,Zn=parseInt(ln.toFixed(xn).replace(".","")),Gi=parseInt(st.toFixed(xn).replace(".",""));return Zn%Gi/Math.pow(10,xn)}class Y extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(st){if(this._def.coerce&&(st.data=Number(st.data)),this._getType(st)!==_.ZodParsedType.number){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.number,received:Zn.parsedType}),m.INVALID}let on;const xn=new m.ParseStatus;for(const Zn of this._def.checks)Zn.kind==="int"?_.util.isInteger(st.data)||(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Zn.message}),xn.dirty()):Zn.kind==="min"?(Zn.inclusive?st.data<Zn.value:st.data<=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,minimum:Zn.value,type:"number",inclusive:Zn.inclusive,exact:!1,message:Zn.message}),xn.dirty()):Zn.kind==="max"?(Zn.inclusive?st.data>Zn.value:st.data>=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,maximum:Zn.value,type:"number",inclusive:Zn.inclusive,exact:!1,message:Zn.message}),xn.dirty()):Zn.kind==="multipleOf"?$(st.data,Zn.value)!==0&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Zn.value,message:Zn.message}),xn.dirty()):Zn.kind==="finite"?Number.isFinite(st.data)||(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.not_finite,message:Zn.message}),xn.dirty()):_.util.assertNever(Zn);return{status:xn.value,value:st.data}}gte(st,Ht){return this.setLimit("min",st,!0,v.errorUtil.toString(Ht))}gt(st,Ht){return this.setLimit("min",st,!1,v.errorUtil.toString(Ht))}lte(st,Ht){return this.setLimit("max",st,!0,v.errorUtil.toString(Ht))}lt(st,Ht){return this.setLimit("max",st,!1,v.errorUtil.toString(Ht))}setLimit(st,Ht,on,xn){return new Y({...this._def,checks:[...this._def.checks,{kind:st,value:Ht,inclusive:on,message:v.errorUtil.toString(xn)}]})}_addCheck(st){return new Y({...this._def,checks:[...this._def.checks,st]})}int(st){return this._addCheck({kind:"int",message:v.errorUtil.toString(st)})}positive(st){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.errorUtil.toString(st)})}negative(st){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.errorUtil.toString(st)})}nonpositive(st){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.errorUtil.toString(st)})}nonnegative(st){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.errorUtil.toString(st)})}multipleOf(st,Ht){return this._addCheck({kind:"multipleOf",value:st,message:v.errorUtil.toString(Ht)})}finite(st){return this._addCheck({kind:"finite",message:v.errorUtil.toString(st)})}safe(st){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.errorUtil.toString(st)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.errorUtil.toString(st)})}get minValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st}get maxValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st}get isInt(){return!!this._def.checks.find(st=>st.kind==="int"||st.kind==="multipleOf"&&_.util.isInteger(st.value))}get isFinite(){let st=null,Ht=null;for(const on of this._def.checks){if(on.kind==="finite"||on.kind==="int"||on.kind==="multipleOf")return!0;on.kind==="min"?(Ht===null||on.value>Ht)&&(Ht=on.value):on.kind==="max"&&(st===null||on.value<st)&&(st=on.value)}return Number.isFinite(Ht)&&Number.isFinite(st)}}t.ZodNumber=Y,Y.create=ln=>new Y({checks:[],typeName:St.ZodNumber,coerce:ln?.coerce||!1,...h(ln)});class G extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(st){if(this._def.coerce)try{st.data=BigInt(st.data)}catch{return this._getInvalidInput(st)}if(this._getType(st)!==_.ZodParsedType.bigint)return this._getInvalidInput(st);let on;const xn=new m.ParseStatus;for(const Zn of this._def.checks)Zn.kind==="min"?(Zn.inclusive?st.data<Zn.value:st.data<=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:Zn.value,inclusive:Zn.inclusive,message:Zn.message}),xn.dirty()):Zn.kind==="max"?(Zn.inclusive?st.data>Zn.value:st.data>=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:Zn.value,inclusive:Zn.inclusive,message:Zn.message}),xn.dirty()):Zn.kind==="multipleOf"?st.data%Zn.value!==BigInt(0)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Zn.value,message:Zn.message}),xn.dirty()):_.util.assertNever(Zn);return{status:xn.value,value:st.data}}_getInvalidInput(st){const Ht=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.bigint,received:Ht.parsedType}),m.INVALID}gte(st,Ht){return this.setLimit("min",st,!0,v.errorUtil.toString(Ht))}gt(st,Ht){return this.setLimit("min",st,!1,v.errorUtil.toString(Ht))}lte(st,Ht){return this.setLimit("max",st,!0,v.errorUtil.toString(Ht))}lt(st,Ht){return this.setLimit("max",st,!1,v.errorUtil.toString(Ht))}setLimit(st,Ht,on,xn){return new G({...this._def,checks:[...this._def.checks,{kind:st,value:Ht,inclusive:on,message:v.errorUtil.toString(xn)}]})}_addCheck(st){return new G({...this._def,checks:[...this._def.checks,st]})}positive(st){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(st)})}negative(st){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(st)})}nonpositive(st){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(st)})}nonnegative(st){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(st)})}multipleOf(st,Ht){return this._addCheck({kind:"multipleOf",value:st,message:v.errorUtil.toString(Ht)})}get minValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st}get maxValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st}}t.ZodBigInt=G,G.create=ln=>{var st;return new G({checks:[],typeName:St.ZodBigInt,coerce:(st=ln?.coerce)!==null&&st!==void 0?st:!1,...h(ln)})};class H extends u{_parse(st){if(this._def.coerce&&(st.data=!!st.data),this._getType(st)!==_.ZodParsedType.boolean){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.boolean,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodBoolean=H,H.create=ln=>new H({typeName:St.ZodBoolean,coerce:ln?.coerce||!1,...h(ln)});class K extends u{_parse(st){if(this._def.coerce&&(st.data=new Date(st.data)),this._getType(st)!==_.ZodParsedType.date){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.date,received:Zn.parsedType}),m.INVALID}if(isNaN(st.data.getTime())){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_date}),m.INVALID}const on=new m.ParseStatus;let xn;for(const Zn of this._def.checks)Zn.kind==="min"?st.data.getTime()<Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_small,message:Zn.message,inclusive:!0,exact:!1,minimum:Zn.value,type:"date"}),on.dirty()):Zn.kind==="max"?st.data.getTime()>Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_big,message:Zn.message,inclusive:!0,exact:!1,maximum:Zn.value,type:"date"}),on.dirty()):_.util.assertNever(Zn);return{status:on.value,value:new Date(st.data.getTime())}}_addCheck(st){return new K({...this._def,checks:[...this._def.checks,st]})}min(st,Ht){return this._addCheck({kind:"min",value:st.getTime(),message:v.errorUtil.toString(Ht)})}max(st,Ht){return this._addCheck({kind:"max",value:st.getTime(),message:v.errorUtil.toString(Ht)})}get minDate(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st!=null?new Date(st):null}get maxDate(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st!=null?new Date(st):null}}t.ZodDate=K,K.create=ln=>new K({checks:[],coerce:ln?.coerce||!1,typeName:St.ZodDate,...h(ln)});class Z extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.symbol){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.symbol,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodSymbol=Z,Z.create=ln=>new Z({typeName:St.ZodSymbol,...h(ln)});class Q extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.undefined){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.undefined,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodUndefined=Q,Q.create=ln=>new Q({typeName:St.ZodUndefined,...h(ln)});class oe extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.null){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.null,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodNull=oe,oe.create=ln=>new oe({typeName:St.ZodNull,...h(ln)});class ne extends u{constructor(){super(...arguments),this._any=!0}_parse(st){return(0,m.OK)(st.data)}}t.ZodAny=ne,ne.create=ln=>new ne({typeName:St.ZodAny,...h(ln)});class he extends u{constructor(){super(...arguments),this._unknown=!0}_parse(st){return(0,m.OK)(st.data)}}t.ZodUnknown=he,he.create=ln=>new he({typeName:St.ZodUnknown,...h(ln)});class _e extends u{_parse(st){const Ht=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.never,received:Ht.parsedType}),m.INVALID}}t.ZodNever=_e,_e.create=ln=>new _e({typeName:St.ZodNever,...h(ln)});class q extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.undefined){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.void,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodVoid=q,q.create=ln=>new q({typeName:St.ZodVoid,...h(ln)});class Ie extends u{_parse(st){const{ctx:Ht,status:on}=this._processInputParams(st),xn=this._def;if(Ht.parsedType!==_.ZodParsedType.array)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.array,received:Ht.parsedType}),m.INVALID;if(xn.exactLength!==null){const Gi=Ht.data.length>xn.exactLength.value,Fi=Ht.data.length<xn.exactLength.value;(Gi||Fi)&&((0,m.addIssueToContext)(Ht,{code:Gi?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:Fi?xn.exactLength.value:void 0,maximum:Gi?xn.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:xn.exactLength.message}),on.dirty())}if(xn.minLength!==null&&Ht.data.length<xn.minLength.value&&((0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.too_small,minimum:xn.minLength.value,type:"array",inclusive:!0,exact:!1,message:xn.minLength.message}),on.dirty()),xn.maxLength!==null&&Ht.data.length>xn.maxLength.value&&((0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.too_big,maximum:xn.maxLength.value,type:"array",inclusive:!0,exact:!1,message:xn.maxLength.message}),on.dirty()),Ht.common.async)return Promise.all([...Ht.data].map((Gi,Fi)=>xn.type._parseAsync(new f(Ht,Gi,Ht.path,Fi)))).then(Gi=>m.ParseStatus.mergeArray(on,Gi));const Zn=[...Ht.data].map((Gi,Fi)=>xn.type._parseSync(new f(Ht,Gi,Ht.path,Fi)));return m.ParseStatus.mergeArray(on,Zn)}get element(){return this._def.type}min(st,Ht){return new Ie({...this._def,minLength:{value:st,message:v.errorUtil.toString(Ht)}})}max(st,Ht){return new Ie({...this._def,maxLength:{value:st,message:v.errorUtil.toString(Ht)}})}length(st,Ht){return new Ie({...this._def,exactLength:{value:st,message:v.errorUtil.toString(Ht)}})}nonempty(st){return this.min(1,st)}}t.ZodArray=Ie,Ie.create=(ln,st)=>new Ie({type:ln,minLength:null,maxLength:null,exactLength:null,typeName:St.ZodArray,...h(st)});function be(ln){if(ln instanceof ie){const st={};for(const Ht in ln.shape){const on=ln.shape[Ht];st[Ht]=Ve.create(be(on))}return new ie({...ln._def,shape:()=>st})}else return ln instanceof Ie?new Ie({...ln._def,type:be(ln.element)}):ln instanceof Ve?Ve.create(be(ln.unwrap())):ln instanceof at?at.create(be(ln.unwrap())):ln instanceof Ce?Ce.create(ln.items.map(st=>be(st))):ln}class ie extends u{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const st=this._def.shape(),Ht=_.util.objectKeys(st);return this._cached={shape:st,keys:Ht}}_parse(st){if(this._getType(st)!==_.ZodParsedType.object){const Mi=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Mi,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:Mi.parsedType}),m.INVALID}const{status:on,ctx:xn}=this._processInputParams(st),{shape:Zn,keys:Gi}=this._getCached(),Fi=[];if(!(this._def.catchall instanceof _e&&this._def.unknownKeys==="strip"))for(const Mi in xn.data)Gi.includes(Mi)||Fi.push(Mi);const oo=[];for(const Mi of Gi){const no=Zn[Mi],uo=xn.data[Mi];oo.push({key:{status:"valid",value:Mi},value:no._parse(new f(xn,uo,xn.path,Mi)),alwaysSet:Mi in xn.data})}if(this._def.catchall instanceof _e){const Mi=this._def.unknownKeys;if(Mi==="passthrough")for(const no of Fi)oo.push({key:{status:"valid",value:no},value:{status:"valid",value:xn.data[no]}});else if(Mi==="strict")Fi.length>0&&((0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.unrecognized_keys,keys:Fi}),on.dirty());else if(Mi!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Mi=this._def.catchall;for(const no of Fi){const uo=xn.data[no];oo.push({key:{status:"valid",value:no},value:Mi._parse(new f(xn,uo,xn.path,no)),alwaysSet:no in xn.data})}}return xn.common.async?Promise.resolve().then(async()=>{const Mi=[];for(const no of oo){const uo=await no.key,Do=await no.value;Mi.push({key:uo,value:Do,alwaysSet:no.alwaysSet})}return Mi}).then(Mi=>m.ParseStatus.mergeObjectSync(on,Mi)):m.ParseStatus.mergeObjectSync(on,oo)}get shape(){return this._def.shape()}strict(st){return v.errorUtil.errToObj,new ie({...this._def,unknownKeys:"strict",...st!==void 0?{errorMap:(Ht,on)=>{var xn,Zn,Gi,Fi;const oo=(Gi=(Zn=(xn=this._def).errorMap)===null||Zn===void 0?void 0:Zn.call(xn,Ht,on).message)!==null&&Gi!==void 0?Gi:on.defaultError;return Ht.code==="unrecognized_keys"?{message:(Fi=v.errorUtil.errToObj(st).message)!==null&&Fi!==void 0?Fi:oo}:{message:oo}}}:{}})}strip(){return new ie({...this._def,unknownKeys:"strip"})}passthrough(){return new ie({...this._def,unknownKeys:"passthrough"})}extend(st){return new ie({...this._def,shape:()=>({...this._def.shape(),...st})})}merge(st){return new ie({unknownKeys:st._def.unknownKeys,catchall:st._def.catchall,shape:()=>({...this._def.shape(),...st._def.shape()}),typeName:St.ZodObject})}setKey(st,Ht){return this.augment({[st]:Ht})}catchall(st){return new ie({...this._def,catchall:st})}pick(st){const Ht={};return _.util.objectKeys(st).forEach(on=>{st[on]&&this.shape[on]&&(Ht[on]=this.shape[on])}),new ie({...this._def,shape:()=>Ht})}omit(st){const Ht={};return _.util.objectKeys(this.shape).forEach(on=>{st[on]||(Ht[on]=this.shape[on])}),new ie({...this._def,shape:()=>Ht})}deepPartial(){return be(this)}partial(st){const Ht={};return _.util.objectKeys(this.shape).forEach(on=>{const xn=this.shape[on];st&&!st[on]?Ht[on]=xn:Ht[on]=xn.optional()}),new ie({...this._def,shape:()=>Ht})}required(st){const Ht={};return _.util.objectKeys(this.shape).forEach(on=>{if(st&&!st[on])Ht[on]=this.shape[on];else{let Zn=this.shape[on];for(;Zn instanceof Ve;)Zn=Zn._def.innerType;Ht[on]=Zn}}),new ie({...this._def,shape:()=>Ht})}keyof(){return ue(_.util.objectKeys(this.shape))}}t.ZodObject=ie,ie.create=(ln,st)=>new ie({shape:()=>ln,unknownKeys:"strip",catchall:_e.create(),typeName:St.ZodObject,...h(st)}),ie.strictCreate=(ln,st)=>new ie({shape:()=>ln,unknownKeys:"strict",catchall:_e.create(),typeName:St.ZodObject,...h(st)}),ie.lazycreate=(ln,st)=>new ie({shape:ln,unknownKeys:"strip",catchall:_e.create(),typeName:St.ZodObject,...h(st)});class fe extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st),on=this._def.options;function xn(Zn){for(const Fi of Zn)if(Fi.result.status==="valid")return Fi.result;for(const Fi of Zn)if(Fi.result.status==="dirty")return Ht.common.issues.push(...Fi.ctx.common.issues),Fi.result;const Gi=Zn.map(Fi=>new s.ZodError(Fi.ctx.common.issues));return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_union,unionErrors:Gi}),m.INVALID}if(Ht.common.async)return Promise.all(on.map(async Zn=>{const Gi={...Ht,common:{...Ht.common,issues:[]},parent:null};return{result:await Zn._parseAsync({data:Ht.data,path:Ht.path,parent:Gi}),ctx:Gi}})).then(xn);{let Zn;const Gi=[];for(const oo of on){const Mi={...Ht,common:{...Ht.common,issues:[]},parent:null},no=oo._parseSync({data:Ht.data,path:Ht.path,parent:Mi});if(no.status==="valid")return no;no.status==="dirty"&&!Zn&&(Zn={result:no,ctx:Mi}),Mi.common.issues.length&&Gi.push(Mi.common.issues)}if(Zn)return Ht.common.issues.push(...Zn.ctx.common.issues),Zn.result;const Fi=Gi.map(oo=>new s.ZodError(oo));return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_union,unionErrors:Fi}),m.INVALID}}get options(){return this._def.options}}t.ZodUnion=fe,fe.create=(ln,st)=>new fe({options:ln,typeName:St.ZodUnion,...h(st)});const Me=ln=>ln instanceof pe?Me(ln.schema):ln instanceof $e?Me(ln.innerType()):ln instanceof re?[ln.value]:ln instanceof Re?ln.options:ln instanceof Ae?_.util.objectValues(ln.enum):ln instanceof qe?Me(ln._def.innerType):ln instanceof Q?[void 0]:ln instanceof oe?[null]:ln instanceof Ve?[void 0,...Me(ln.unwrap())]:ln instanceof at?[null,...Me(ln.unwrap())]:ln instanceof yt||ln instanceof dt?Me(ln.unwrap()):ln instanceof Ot?Me(ln._def.innerType):[];class Le extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st);if(Ht.parsedType!==_.ZodParsedType.object)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:Ht.parsedType}),m.INVALID;const on=this.discriminator,xn=Ht.data[on],Zn=this.optionsMap.get(xn);return Zn?Ht.common.async?Zn._parseAsync({data:Ht.data,path:Ht.path,parent:Ht}):Zn._parseSync({data:Ht.data,path:Ht.path,parent:Ht}):((0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[on]}),m.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(st,Ht,on){const xn=new Map;for(const Zn of Ht){const Gi=Me(Zn.shape[st]);if(!Gi.length)throw new Error(`A discriminator value for key \`${st}\` could not be extracted from all schema options`);for(const Fi of Gi){if(xn.has(Fi))throw new Error(`Discriminator property ${String(st)} has duplicate value ${String(Fi)}`);xn.set(Fi,Zn)}}return new Le({typeName:St.ZodDiscriminatedUnion,discriminator:st,options:Ht,optionsMap:xn,...h(on)})}}t.ZodDiscriminatedUnion=Le;function ve(ln,st){const Ht=(0,_.getParsedType)(ln),on=(0,_.getParsedType)(st);if(ln===st)return{valid:!0,data:ln};if(Ht===_.ZodParsedType.object&&on===_.ZodParsedType.object){const xn=_.util.objectKeys(st),Zn=_.util.objectKeys(ln).filter(Fi=>xn.indexOf(Fi)!==-1),Gi={...ln,...st};for(const Fi of Zn){const oo=ve(ln[Fi],st[Fi]);if(!oo.valid)return{valid:!1};Gi[Fi]=oo.data}return{valid:!0,data:Gi}}else if(Ht===_.ZodParsedType.array&&on===_.ZodParsedType.array){if(ln.length!==st.length)return{valid:!1};const xn=[];for(let Zn=0;Zn<ln.length;Zn++){const Gi=ln[Zn],Fi=st[Zn],oo=ve(Gi,Fi);if(!oo.valid)return{valid:!1};xn.push(oo.data)}return{valid:!0,data:xn}}else return Ht===_.ZodParsedType.date&&on===_.ZodParsedType.date&&+ln==+st?{valid:!0,data:ln}:{valid:!1}}class Se extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st),xn=(Zn,Gi)=>{if((0,m.isAborted)(Zn)||(0,m.isAborted)(Gi))return m.INVALID;const Fi=ve(Zn.value,Gi.value);return Fi.valid?(((0,m.isDirty)(Zn)||(0,m.isDirty)(Gi))&&Ht.dirty(),{status:Ht.value,value:Fi.data}):((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_intersection_types}),m.INVALID)};return on.common.async?Promise.all([this._def.left._parseAsync({data:on.data,path:on.path,parent:on}),this._def.right._parseAsync({data:on.data,path:on.path,parent:on})]).then(([Zn,Gi])=>xn(Zn,Gi)):xn(this._def.left._parseSync({data:on.data,path:on.path,parent:on}),this._def.right._parseSync({data:on.data,path:on.path,parent:on}))}}t.ZodIntersection=Se,Se.create=(ln,st,Ht)=>new Se({left:ln,right:st,typeName:St.ZodIntersection,...h(Ht)});class Ce extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.array)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.array,received:on.parsedType}),m.INVALID;if(on.data.length<this._def.items.length)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m.INVALID;!this._def.rest&&on.data.length>this._def.items.length&&((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ht.dirty());const Zn=[...on.data].map((Gi,Fi)=>{const oo=this._def.items[Fi]||this._def.rest;return oo?oo._parse(new f(on,Gi,on.path,Fi)):null}).filter(Gi=>!!Gi);return on.common.async?Promise.all(Zn).then(Gi=>m.ParseStatus.mergeArray(Ht,Gi)):m.ParseStatus.mergeArray(Ht,Zn)}get items(){return this._def.items}rest(st){return new Ce({...this._def,rest:st})}}t.ZodTuple=Ce,Ce.create=(ln,st)=>{if(!Array.isArray(ln))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ce({items:ln,typeName:St.ZodTuple,rest:null,...h(st)})};class ge extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.object)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:on.parsedType}),m.INVALID;const xn=[],Zn=this._def.keyType,Gi=this._def.valueType;for(const Fi in on.data)xn.push({key:Zn._parse(new f(on,Fi,on.path,Fi)),value:Gi._parse(new f(on,on.data[Fi],on.path,Fi)),alwaysSet:Fi in on.data});return on.common.async?m.ParseStatus.mergeObjectAsync(Ht,xn):m.ParseStatus.mergeObjectSync(Ht,xn)}get element(){return this._def.valueType}static create(st,Ht,on){return Ht instanceof u?new ge({keyType:st,valueType:Ht,typeName:St.ZodRecord,...h(on)}):new ge({keyType:V.create(),valueType:st,typeName:St.ZodRecord,...h(Ht)})}}t.ZodRecord=ge;class xe extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.map)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.map,received:on.parsedType}),m.INVALID;const xn=this._def.keyType,Zn=this._def.valueType,Gi=[...on.data.entries()].map(([Fi,oo],Mi)=>({key:xn._parse(new f(on,Fi,on.path,[Mi,"key"])),value:Zn._parse(new f(on,oo,on.path,[Mi,"value"]))}));if(on.common.async){const Fi=new Map;return Promise.resolve().then(async()=>{for(const oo of Gi){const Mi=await oo.key,no=await oo.value;if(Mi.status==="aborted"||no.status==="aborted")return m.INVALID;(Mi.status==="dirty"||no.status==="dirty")&&Ht.dirty(),Fi.set(Mi.value,no.value)}return{status:Ht.value,value:Fi}})}else{const Fi=new Map;for(const oo of Gi){const Mi=oo.key,no=oo.value;if(Mi.status==="aborted"||no.status==="aborted")return m.INVALID;(Mi.status==="dirty"||no.status==="dirty")&&Ht.dirty(),Fi.set(Mi.value,no.value)}return{status:Ht.value,value:Fi}}}}t.ZodMap=xe,xe.create=(ln,st,Ht)=>new xe({valueType:st,keyType:ln,typeName:St.ZodMap,...h(Ht)});class Te extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.set)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.set,received:on.parsedType}),m.INVALID;const xn=this._def;xn.minSize!==null&&on.data.size<xn.minSize.value&&((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,minimum:xn.minSize.value,type:"set",inclusive:!0,exact:!1,message:xn.minSize.message}),Ht.dirty()),xn.maxSize!==null&&on.data.size>xn.maxSize.value&&((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,maximum:xn.maxSize.value,type:"set",inclusive:!0,exact:!1,message:xn.maxSize.message}),Ht.dirty());const Zn=this._def.valueType;function Gi(oo){const Mi=new Set;for(const no of oo){if(no.status==="aborted")return m.INVALID;no.status==="dirty"&&Ht.dirty(),Mi.add(no.value)}return{status:Ht.value,value:Mi}}const Fi=[...on.data.values()].map((oo,Mi)=>Zn._parse(new f(on,oo,on.path,Mi)));return on.common.async?Promise.all(Fi).then(oo=>Gi(oo)):Gi(Fi)}min(st,Ht){return new Te({...this._def,minSize:{value:st,message:v.errorUtil.toString(Ht)}})}max(st,Ht){return new Te({...this._def,maxSize:{value:st,message:v.errorUtil.toString(Ht)}})}size(st,Ht){return this.min(st,Ht).max(st,Ht)}nonempty(st){return this.min(1,st)}}t.ZodSet=Te,Te.create=(ln,st)=>new Te({valueType:ln,minSize:null,maxSize:null,typeName:St.ZodSet,...h(st)});class Fe extends u{constructor(){super(...arguments),this.validate=this.implement}_parse(st){const{ctx:Ht}=this._processInputParams(st);if(Ht.parsedType!==_.ZodParsedType.function)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.function,received:Ht.parsedType}),m.INVALID;function on(Fi,oo){return(0,m.makeIssue)({data:Fi,path:Ht.path,errorMaps:[Ht.common.contextualErrorMap,Ht.schemaErrorMap,(0,p.getErrorMap)(),p.defaultErrorMap].filter(Mi=>!!Mi),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:oo}})}function xn(Fi,oo){return(0,m.makeIssue)({data:Fi,path:Ht.path,errorMaps:[Ht.common.contextualErrorMap,Ht.schemaErrorMap,(0,p.getErrorMap)(),p.defaultErrorMap].filter(Mi=>!!Mi),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:oo}})}const Zn={errorMap:Ht.common.contextualErrorMap},Gi=Ht.data;if(this._def.returns instanceof Ue){const Fi=this;return(0,m.OK)(async function(...oo){const Mi=new s.ZodError([]),no=await Fi._def.args.parseAsync(oo,Zn).catch(jo=>{throw Mi.addIssue(on(oo,jo)),Mi}),uo=await Reflect.apply(Gi,this,no);return await Fi._def.returns._def.type.parseAsync(uo,Zn).catch(jo=>{throw Mi.addIssue(xn(uo,jo)),Mi})})}else{const Fi=this;return(0,m.OK)(function(...oo){const Mi=Fi._def.args.safeParse(oo,Zn);if(!Mi.success)throw new s.ZodError([on(oo,Mi.error)]);const no=Reflect.apply(Gi,this,Mi.data),uo=Fi._def.returns.safeParse(no,Zn);if(!uo.success)throw new s.ZodError([xn(no,uo.error)]);return uo.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...st){return new Fe({...this._def,args:Ce.create(st).rest(he.create())})}returns(st){return new Fe({...this._def,returns:st})}implement(st){return this.parse(st)}strictImplement(st){return this.parse(st)}static create(st,Ht,on){return new Fe({args:st||Ce.create([]).rest(he.create()),returns:Ht||he.create(),typeName:St.ZodFunction,...h(on)})}}t.ZodFunction=Fe;class pe extends u{get schema(){return this._def.getter()}_parse(st){const{ctx:Ht}=this._processInputParams(st);return this._def.getter()._parse({data:Ht.data,path:Ht.path,parent:Ht})}}t.ZodLazy=pe,pe.create=(ln,st)=>new pe({getter:ln,typeName:St.ZodLazy,...h(st)});class re extends u{_parse(st){if(st.data!==this._def.value){const Ht=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Ht,{received:Ht.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),m.INVALID}return{status:"valid",value:st.data}}get value(){return this._def.value}}t.ZodLiteral=re,re.create=(ln,st)=>new re({value:ln,typeName:St.ZodLiteral,...h(st)});function ue(ln,st){return new Re({values:ln,typeName:St.ZodEnum,...h(st)})}class Re extends u{constructor(){super(...arguments),o.set(this,void 0)}_parse(st){if(typeof st.data!="string"){const Ht=this._getOrReturnCtx(st),on=this._def.values;return(0,m.addIssueToContext)(Ht,{expected:_.util.joinValues(on),received:Ht.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,o,"f")||r(this,o,new Set(this._def.values),"f"),!n(this,o,"f").has(st.data)){const Ht=this._getOrReturnCtx(st),on=this._def.values;return(0,m.addIssueToContext)(Ht,{received:Ht.data,code:s.ZodIssueCode.invalid_enum_value,options:on}),m.INVALID}return(0,m.OK)(st.data)}get options(){return this._def.values}get enum(){const st={};for(const Ht of this._def.values)st[Ht]=Ht;return st}get Values(){const st={};for(const Ht of this._def.values)st[Ht]=Ht;return st}get Enum(){const st={};for(const Ht of this._def.values)st[Ht]=Ht;return st}extract(st,Ht=this._def){return Re.create(st,{...this._def,...Ht})}exclude(st,Ht=this._def){return Re.create(this.options.filter(on=>!st.includes(on)),{...this._def,...Ht})}}t.ZodEnum=Re,o=new WeakMap,Re.create=ue;class Ae extends u{constructor(){super(...arguments),l.set(this,void 0)}_parse(st){const Ht=_.util.getValidEnumValues(this._def.values),on=this._getOrReturnCtx(st);if(on.parsedType!==_.ZodParsedType.string&&on.parsedType!==_.ZodParsedType.number){const xn=_.util.objectValues(Ht);return(0,m.addIssueToContext)(on,{expected:_.util.joinValues(xn),received:on.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,l,"f")||r(this,l,new Set(_.util.getValidEnumValues(this._def.values)),"f"),!n(this,l,"f").has(st.data)){const xn=_.util.objectValues(Ht);return(0,m.addIssueToContext)(on,{received:on.data,code:s.ZodIssueCode.invalid_enum_value,options:xn}),m.INVALID}return(0,m.OK)(st.data)}get enum(){return this._def.values}}t.ZodNativeEnum=Ae,l=new WeakMap,Ae.create=(ln,st)=>new Ae({values:ln,typeName:St.ZodNativeEnum,...h(st)});class Ue extends u{unwrap(){return this._def.type}_parse(st){const{ctx:Ht}=this._processInputParams(st);if(Ht.parsedType!==_.ZodParsedType.promise&&Ht.common.async===!1)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.promise,received:Ht.parsedType}),m.INVALID;const on=Ht.parsedType===_.ZodParsedType.promise?Ht.data:Promise.resolve(Ht.data);return(0,m.OK)(on.then(xn=>this._def.type.parseAsync(xn,{path:Ht.path,errorMap:Ht.common.contextualErrorMap})))}}t.ZodPromise=Ue,Ue.create=(ln,st)=>new Ue({type:ln,typeName:St.ZodPromise,...h(st)});class $e extends u{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===St.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st),xn=this._def.effect||null,Zn={addIssue:Gi=>{(0,m.addIssueToContext)(on,Gi),Gi.fatal?Ht.abort():Ht.dirty()},get path(){return on.path}};if(Zn.addIssue=Zn.addIssue.bind(Zn),xn.type==="preprocess"){const Gi=xn.transform(on.data,Zn);if(on.common.async)return Promise.resolve(Gi).then(async Fi=>{if(Ht.value==="aborted")return m.INVALID;const oo=await this._def.schema._parseAsync({data:Fi,path:on.path,parent:on});return oo.status==="aborted"?m.INVALID:oo.status==="dirty"||Ht.value==="dirty"?(0,m.DIRTY)(oo.value):oo});{if(Ht.value==="aborted")return m.INVALID;const Fi=this._def.schema._parseSync({data:Gi,path:on.path,parent:on});return Fi.status==="aborted"?m.INVALID:Fi.status==="dirty"||Ht.value==="dirty"?(0,m.DIRTY)(Fi.value):Fi}}if(xn.type==="refinement"){const Gi=Fi=>{const oo=xn.refinement(Fi,Zn);if(on.common.async)return Promise.resolve(oo);if(oo instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Fi};if(on.common.async===!1){const Fi=this._def.schema._parseSync({data:on.data,path:on.path,parent:on});return Fi.status==="aborted"?m.INVALID:(Fi.status==="dirty"&&Ht.dirty(),Gi(Fi.value),{status:Ht.value,value:Fi.value})}else return this._def.schema._parseAsync({data:on.data,path:on.path,parent:on}).then(Fi=>Fi.status==="aborted"?m.INVALID:(Fi.status==="dirty"&&Ht.dirty(),Gi(Fi.value).then(()=>({status:Ht.value,value:Fi.value}))))}if(xn.type==="transform")if(on.common.async===!1){const Gi=this._def.schema._parseSync({data:on.data,path:on.path,parent:on});if(!(0,m.isValid)(Gi))return Gi;const Fi=xn.transform(Gi.value,Zn);if(Fi instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Ht.value,value:Fi}}else return this._def.schema._parseAsync({data:on.data,path:on.path,parent:on}).then(Gi=>(0,m.isValid)(Gi)?Promise.resolve(xn.transform(Gi.value,Zn)).then(Fi=>({status:Ht.value,value:Fi})):Gi);_.util.assertNever(xn)}}t.ZodEffects=$e,t.ZodTransformer=$e,$e.create=(ln,st,Ht)=>new $e({schema:ln,typeName:St.ZodEffects,effect:st,...h(Ht)}),$e.createWithPreprocess=(ln,st,Ht)=>new $e({schema:st,effect:{type:"preprocess",transform:ln},typeName:St.ZodEffects,...h(Ht)});class Ve extends u{_parse(st){return this._getType(st)===_.ZodParsedType.undefined?(0,m.OK)(void 0):this._def.innerType._parse(st)}unwrap(){return this._def.innerType}}t.ZodOptional=Ve,Ve.create=(ln,st)=>new Ve({innerType:ln,typeName:St.ZodOptional,...h(st)});class at extends u{_parse(st){return this._getType(st)===_.ZodParsedType.null?(0,m.OK)(null):this._def.innerType._parse(st)}unwrap(){return this._def.innerType}}t.ZodNullable=at,at.create=(ln,st)=>new at({innerType:ln,typeName:St.ZodNullable,...h(st)});class qe extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st);let on=Ht.data;return Ht.parsedType===_.ZodParsedType.undefined&&(on=this._def.defaultValue()),this._def.innerType._parse({data:on,path:Ht.path,parent:Ht})}removeDefault(){return this._def.innerType}}t.ZodDefault=qe,qe.create=(ln,st)=>new qe({innerType:ln,typeName:St.ZodDefault,defaultValue:typeof st.default=="function"?st.default:()=>st.default,...h(st)});class Ot extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st),on={...Ht,common:{...Ht.common,issues:[]}},xn=this._def.innerType._parse({data:on.data,path:on.path,parent:{...on}});return(0,m.isAsync)(xn)?xn.then(Zn=>({status:"valid",value:Zn.status==="valid"?Zn.value:this._def.catchValue({get error(){return new s.ZodError(on.common.issues)},input:on.data})})):{status:"valid",value:xn.status==="valid"?xn.value:this._def.catchValue({get error(){return new s.ZodError(on.common.issues)},input:on.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=Ot,Ot.create=(ln,st)=>new Ot({innerType:ln,typeName:St.ZodCatch,catchValue:typeof st.catch=="function"?st.catch:()=>st.catch,...h(st)});class it extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.nan){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.nan,received:on.parsedType}),m.INVALID}return{status:"valid",value:st.data}}}t.ZodNaN=it,it.create=ln=>new it({typeName:St.ZodNaN,...h(ln)}),t.BRAND=Symbol("zod_brand");class yt extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st),on=Ht.data;return this._def.type._parse({data:on,path:Ht.path,parent:Ht})}unwrap(){return this._def.type}}t.ZodBranded=yt;class tt extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.common.async)return(async()=>{const Zn=await this._def.in._parseAsync({data:on.data,path:on.path,parent:on});return Zn.status==="aborted"?m.INVALID:Zn.status==="dirty"?(Ht.dirty(),(0,m.DIRTY)(Zn.value)):this._def.out._parseAsync({data:Zn.value,path:on.path,parent:on})})();{const xn=this._def.in._parseSync({data:on.data,path:on.path,parent:on});return xn.status==="aborted"?m.INVALID:xn.status==="dirty"?(Ht.dirty(),{status:"dirty",value:xn.value}):this._def.out._parseSync({data:xn.value,path:on.path,parent:on})}}static create(st,Ht){return new tt({in:st,out:Ht,typeName:St.ZodPipeline})}}t.ZodPipeline=tt;class dt extends u{_parse(st){const Ht=this._def.innerType._parse(st),on=xn=>((0,m.isValid)(xn)&&(xn.value=Object.freeze(xn.value)),xn);return(0,m.isAsync)(Ht)?Ht.then(xn=>on(xn)):on(Ht)}unwrap(){return this._def.innerType}}t.ZodReadonly=dt,dt.create=(ln,st)=>new dt({innerType:ln,typeName:St.ZodReadonly,...h(st)});function ut(ln,st={},Ht){return ln?ne.create().superRefine((on,xn)=>{var Zn,Gi;if(!ln(on)){const Fi=typeof st=="function"?st(on):typeof st=="string"?{message:st}:st,oo=(Gi=(Zn=Fi.fatal)!==null&&Zn!==void 0?Zn:Ht)!==null&&Gi!==void 0?Gi:!0,Mi=typeof Fi=="string"?{message:Fi}:Fi;xn.addIssue({code:"custom",...Mi,fatal:oo})}}):ne.create()}t.custom=ut,t.late={object:ie.lazycreate};var St;(function(ln){ln.ZodString="ZodString",ln.ZodNumber="ZodNumber",ln.ZodNaN="ZodNaN",ln.ZodBigInt="ZodBigInt",ln.ZodBoolean="ZodBoolean",ln.ZodDate="ZodDate",ln.ZodSymbol="ZodSymbol",ln.ZodUndefined="ZodUndefined",ln.ZodNull="ZodNull",ln.ZodAny="ZodAny",ln.ZodUnknown="ZodUnknown",ln.ZodNever="ZodNever",ln.ZodVoid="ZodVoid",ln.ZodArray="ZodArray",ln.ZodObject="ZodObject",ln.ZodUnion="ZodUnion",ln.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ln.ZodIntersection="ZodIntersection",ln.ZodTuple="ZodTuple",ln.ZodRecord="ZodRecord",ln.ZodMap="ZodMap",ln.ZodSet="ZodSet",ln.ZodFunction="ZodFunction",ln.ZodLazy="ZodLazy",ln.ZodLiteral="ZodLiteral",ln.ZodEnum="ZodEnum",ln.ZodEffects="ZodEffects",ln.ZodNativeEnum="ZodNativeEnum",ln.ZodOptional="ZodOptional",ln.ZodNullable="ZodNullable",ln.ZodDefault="ZodDefault",ln.ZodCatch="ZodCatch",ln.ZodPromise="ZodPromise",ln.ZodBranded="ZodBranded",ln.ZodPipeline="ZodPipeline",ln.ZodReadonly="ZodReadonly"})(St||(t.ZodFirstPartyTypeKind=St={}));class Vt{constructor(...st){}}const Cn=(ln,st={message:`Input not instance of ${ln.name}`})=>ut(Ht=>Ht instanceof ln,st);t.instanceof=Cn;const Kn=V.create;t.string=Kn;const bi=Y.create;t.number=bi;const Un=it.create;t.nan=Un;const hn=G.create;t.bigint=hn;const Xn=H.create;t.boolean=Xn;const _n=K.create;t.date=_n;const $t=Z.create;t.symbol=$t;const vt=Q.create;t.undefined=vt;const ze=oe.create;t.null=ze;const Je=ne.create;t.any=Je;const Dt=he.create;t.unknown=Dt;const On=_e.create;t.never=On;const ni=q.create;t.void=ni;const Li=Ie.create;t.array=Li;const Wi=ie.create;t.object=Wi;const ao=ie.strictCreate;t.strictObject=ao;const qi=fe.create;t.union=qi;const fo=Le.create;t.discriminatedUnion=fo;const ci=Se.create;t.intersection=ci;const Gn=Ce.create;t.tuple=Gn;const Di=ge.create;t.record=Di;const zi=xe.create;t.map=zi;const to=Te.create;t.set=to;const Ki=Fe.create;t.function=Ki;const yn=pe.create;t.lazy=yn;const si=re.create;t.literal=si;const Ln=Re.create;t.enum=Ln;const lt=Ae.create;t.nativeEnum=lt;const xt=Ue.create;t.promise=xt;const Tt=$e.create;t.effect=Tt,t.transformer=Tt;const At=Ve.create;t.optional=At;const Sn=at.create;t.nullable=Sn;const fn=$e.createWithPreprocess;t.preprocess=fn;const an=tt.create;t.pipeline=an;const Hn=()=>Kn().optional();t.ostring=Hn;const hi=()=>bi().optional();t.onumber=hi;const Ei=()=>Xn().optional();t.oboolean=Ei,t.coerce={string:ln=>V.create({...ln,coerce:!0}),number:ln=>Y.create({...ln,coerce:!0}),boolean:ln=>H.create({...ln,coerce:!0}),bigint:ln=>G.create({...ln,coerce:!0}),date:ln=>K.create({...ln,coerce:!0})},t.NEVER=m.INVALID},79682:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ChromeDevtoolsContribution=void 0;const r=e(85608),o=e(76003),l=e(41869),p=e(65265),v=e(98295),m=e(27654);let _=n=class extends l.Disposable{constructor(){super(...arguments),this.lantencyHandler=f=>{const{command:a}=f.detail;a===p.DevtoolsLantencyCommand.Start?this.interval||this.startRTTInterval():a===p.DevtoolsLantencyCommand.Stop&&this.interval&&(clearInterval(this.interval),this.interval=void 0)}}initialize(){var f;this.appConfig.devtools&&(window.addEventListener(p.EDevtoolsEvent.Latency,this.lantencyHandler),this.addDispose(l.Disposable.create(()=>{window.removeEventListener(p.EDevtoolsEvent.Latency,this.lantencyHandler),this.interval&&(clearInterval(this.interval),this.interval=void 0)})),!((f=window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__)===null||f===void 0)&&f.captureRPC&&(this.interval||this.startRTTInterval()))}startRTTInterval(){this.interval=setInterval(async()=>{const f=Date.now();await this.rttService.measure();const a=Date.now()-f;window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.captureRPC&&(window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.latency=a)},n.INTERVAL)}};t.ChromeDevtoolsContribution=_,_.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],_.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],_.prototype,"rttService",void 0),t.ChromeDevtoolsContribution=_=n=r.__decorate([(0,v.Domain)(l.ClientAppContribution)],_)},72915:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTContribution=void 0;const r=e(85608),o=e(76003),l=e(26542),p=e(92323),v=e(98295),m=e(27654),_={id:"connection.start.rtt",label:"%connection.start.rtt%",category:"%command.category.developerTools%"},s={id:"connection.stop.rtt",label:"%connection.stop.rtt%",category:"%command.category.developerTools%"},f={alignment:l.StatusBarAlignment.LEFT,priority:1/0-1};let a=n=class{registerCommands(u){u.registerCommand(_,{execute:()=>{this.interval||this.startRTTInterval()}}),u.registerCommand(s,{execute:()=>{this.interval&&(clearInterval(this.interval),this.statusBar&&(this.statusBar.dispose(),this.statusBar=void 0))}})}startRTTInterval(){this.interval=setInterval(async()=>{const u=Date.now();await this.rttService.measure();const E={text:`${Date.now()-u}ms`};if(this.statusBar)this.statusBar.update({...E,...f});else{const g=this.statusBarService.addElement("connection-rtt",{...E,...f});this.statusBar=g}},n.INTERVAL)}};t.ConnectionRTTContribution=a,a.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.IStatusBarService),r.__metadata("design:type",Object)],a.prototype,"statusBarService",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],a.prototype,"rttService",void 0),t.ConnectionRTTContribution=a=n=r.__decorate([(0,v.Domain)(p.CommandContribution)],a)},27654:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTBrowserService=t.ConnectionRTTBrowserServiceToken=void 0;const n=e(85608),r=e(76003),o=e(69452);t.ConnectionRTTBrowserServiceToken=Symbol("ConnectionRTTBrowserService");let l=class{async measure(){await this.connectionBackService.$measure()}};t.ConnectionRTTBrowserService=l,n.__decorate([(0,r.Autowired)(o.ConnectionBackServicePath),n.__metadata("design:type",Object)],l.prototype,"connectionBackService",void 0),t.ConnectionRTTBrowserService=l=n.__decorate([(0,r.Injectable)()],l)},17631:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),p=e(69452);let v=class extends l.WithEventBus{onDidDropFile(_){this.dropService.onDidDropFile(_)}};t.FileDropContribution=v,n.__decorate([(0,r.Autowired)(p.IFileDropFrontendServiceToken),n.__metadata("design:type",Object)],v.prototype,"dropService",void 0),n.__decorate([(0,l.OnEvent)(l.FileTreeDropEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[l.FileTreeDropEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"onDidDropFile",null),t.FileDropContribution=v=n.__decorate([(0,r.Injectable)(),(0,o.Domain)(o.ClientAppContribution)],v)},22874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),p=e(43718),v=e(42933),{Path:m}=p.path,_=e(69452);let s=class extends p.WithEventBus{constructor(){super(...arguments),this.pending=new Set}onDidUploadFileStart(a){this.pending.add(a),this.createOrUpdateStatusBar()}onDidUploadFileEnd(a){this.pending.delete(a),this.createOrUpdateStatusBar()}createOrUpdateStatusBar(a){if(this.pending.size===0){this.uploadStatus&&(this.uploadStatus.dispose(),this.uploadStatus=void 0);return}const h="sumi-upload-file-status",u=(0,o.formatLocalize)("workbench.uploadingFiles",this.pending.size,a||"0 MB"),d={text:u,alignment:l.StatusBarAlignment.RIGHT,tooltip:u,iconClass:"kaitian-icon kticon-cloud-server"};this.uploadStatus?this.uploadStatus.update({id:h,...d}):this.uploadStatus=this.statusBarService.addElement(h,d)}onDidDropFile(a){var h;const{payload:{event:u,targetDir:d}}=a;if(!d||!(!((h=u.dataTransfer)===null||h===void 0)&&h.files)||u.dataTransfer.files.length===0)return;const E=u.dataTransfer.items;let g=0;const c=Date.now(),y=b=>{g+=b;const S=Date.now(),w=`${(g/((S-c)/1e3)/1024/1024).toFixed(2)} MB`;this.createOrUpdateStatusBar(w)};for(const b of E){const S=b.webkitGetAsEntry();this.processFilesEntry(d,S,y)}}async processFilesEntry(a,h,u){if(h.isFile)this.processFileEntry(h,a,u);else{const d=p.Uri.file(new m(a).join(h.fullPath).toString()).toString();await this.fs.createFolder(d),this.processDirEntry(h,a,u)}}toBinaryString(a){let h;const u=a.length;let d="";for(h=0;h<u;h+=1)d+=String.fromCharCode(a[h]);return d}async doUploadFile(a,h,u){var d;const E=new m(h).join(a.name).toString();this.onDidUploadFileStart(E.toString()),await this.fs.createFile(p.Uri.file(E.toString()).toString()),await this.dropService.$ensureFileExist(a.name,h);const g=a.stream().getReader();let c=await g.read();for(;!c.done;)await this.dropService.$writeStream(this.toBinaryString(c.value),a.name,h,c.done),u((d=c.value)===null||d===void 0?void 0:d.byteLength),c=await g.read();c.done&&this.onDidUploadFileEnd(E.toString())}processFileEntry(a,h,u){a.file(d=>{const E=new File([d],a.fullPath,{type:a.type});this.doUploadFile(E,h,u)},()=>{})}processDirEntry(a,h,u){a.createReader().readEntries(E=>{E.forEach(async g=>{this.processFilesEntry(h,g,u)})},()=>{})}};t.FileDropService=s,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fs",void 0),n.__decorate([(0,r.Autowired)(_.FileDropServicePath),n.__metadata("design:type",Object)],s.prototype,"dropService",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],s.prototype,"statusBarService",void 0),t.FileDropService=s=n.__decorate([(0,r.Injectable)()],s)},79240:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearchContribution=t.FileSearchQuickCommandHandler=t.matchLineReg=t.quickGoToSymbol=t.quickFileOpen=void 0,t.getValidateInput=y;const n=e(85608),r=n.__importDefault(e(39050)),o=e(76003),l=e(41869),p=e(26542),v=e(43718),m=e(98295),_=e(54414),s=e(17459),f=e(84660),a=n.__importStar(e(20868)),h=e(97821),u=e(80490),d=e(51500),E=e(30981),g=200;t.quickFileOpen={id:"workbench.action.quickOpen",category:"File",label:"Open File..."},t.quickGoToSymbol={id:"workbench.action.gotoSymbol",category:"File",label:"Open File Symbol..."},t.matchLineReg=/^([^:#(]*)[:#(]?L?(\d+)?[:,]?(\d+)?\)?/;function c(T=""){const D=T.match(t.matchLineReg)||[];if(D.length<2)return;const I={line:Number(D[2]||0),start:Number(D[3]||0)};return new a.Range(I.line,I.start,I.line,I.start)}function y(T){return T.replace(t.matchLineReg,"$1")}let b=class extends h.QuickOpenBaseAction{constructor(){super({id:"file-search:splitToRight",tooltip:(0,l.localize)("quickOpen.openOnTheRightSide"),class:(0,l.getIcon)("embed")})}async run(D){await this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,D.getUri(),{preview:!1,split:_.EditorGroupSplitAction.Right,range:c(this.injector.get(A).currentLookFor),focus:!0})}};n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],b.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],b.prototype,"injector",void 0),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b);let S=class{hasActions(){return!0}getActions(){return[this.fileSearchActionLeftRight]}getValidateInput(D){return y(D)}};n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",b)],S.prototype,"fileSearchActionLeftRight",void 0),S=n.__decorate([(0,o.Injectable)()],S);let A=class{constructor(){this.cancelIndicator=new v.CancellationTokenSource,this.default=!0,this.prefix="...",this.description=(0,l.localize)("file-search.command.fileOpen.description"),this.prevEditorState={},this.currentLookFor=""}getModel(){return{onType:async(D,I)=>{this.cancelIndicator.cancel(),this.cancelIndicator=new v.CancellationTokenSource;const R=this.cancelIndicator.token,M=new Set;let O=[];D=D.trim().replace(/\s/g,""),this.currentLookFor=D;const P=y(D),k=this.reporterService.time(v.REPORT_NAME.QUICK_OPEN_MEASURE),F=await this.getRecentlyItems(M,P,R);if(D&&(this.logger.debug("lookFor",D,P),O=await this.getFindOutItems(M,P,R)),R.isCancellationRequested)return;const L=F.concat(O);I(L,L.length?this.fileSearchActionProvider:void 0),k.timeEnd(D.indexOf("@")>-1?"file-symbol":"file",{lookFor:D,stat:{recently:F.length,find:O.length}})}}}getOptions(){return{placeholder:(0,l.localize)("file-search.command.fileOpen.placeholder"),fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},showItemsWithoutHighlight:!0,fuzzyMatchDescription:{enableSeparateSubstringMatching:!0},getPlaceholderItem:D=>new l.QuickOpenItem({label:(0,l.localize)(D.indexOf("@")>-1?"search.fileSymbolResults.notfound":"search.fileResults.notfound"),run:()=>!1})}}onClose(D){D&&this.prevEditorState.uri&&(this.workbenchEditorService.open(this.prevEditorState.uri,{range:this.prevEditorState.range}),this.prevEditorState={}),this.prevSelected=void 0,this.cancelIndicator.cancel()}onToggle(){this.cancelIndicator.cancel()}trySaveEditorState(){var D;if(this.workbenchEditorService.currentResource){let I={startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1};const R=(D=this.workbenchEditorService.currentEditor)===null||D===void 0?void 0:D.getSelections();if(R){const{selectionStartLineNumber:M,selectionStartColumn:O,positionLineNumber:P,positionColumn:k}=R[0];I=new a.Range(M,O,P,k)}this.prevEditorState={uri:this.workbenchEditorService.currentResource.uri,range:I}}}async getFindOutItems(D,I,R){var M;let O;if(I.indexOf("@")>-1){this.trySaveEditorState(),O=[];const[P,k]=I.split("@");let F;if(this.prevSelected)F=this.prevSelected.withoutFragment();else if(P){const L=await this.getQueryFiles(P,D,R);L.length&&(F=L[0].getUri())}else F=(M=this.workbenchEditorService.currentResource)===null||M===void 0?void 0:M.uri;if(F){const L=await this.documentSymbolStore.getDocumentSymbolAsync(F)||[],B=[];this.flattenSymbols({children:L},B),O=B.filter(W=>{const U=(0,E.matchesFuzzy)(k,W.name,!0)||[];return U&&(W.labelHighlights=U),U&&U.length}).map((W,U)=>{var X;return new l.QuickOpenItem({uri:F,label:W.name,iconClass:(0,l.getSymbolIcon)(W.kind),description:(X=W.parent)===null||X===void 0?void 0:X.name,labelHighlights:W.labelHighlights,groupLabel:U===0?(0,l.formatLocalize)("search.fileSymbolResults",B.length):"",showBorder:!1,run:V=>V===l.Mode.PREVIEW?(this.locateSymbol(F,W),!0):V===l.Mode.OPEN?(this.locateSymbol(F,W),!0):!1})})}else return[]}else if(O=await this.getQueryFiles(I,D,R),O[0]){const P=await this.getItems([O[0].getUri().codeUri.fsPath],{groupLabel:(0,l.localize)("search.fileResults"),showBorder:!0});O[0]=P[0]}return O}async getQueryFiles(D,I,R){const O=(await this.workspaceService.roots).map(F=>new l.URI(F.uri).codeUri.fsPath),P=await this.fileSearchService.find(D,{rootUris:O,fuzzyMatch:!0,limit:g,useGitIgnore:!0,noIgnoreParent:!0,excludePatterns:this.getPreferenceSearchExcludes()},R),k=await this.getItems(P.filter(F=>I.has(F)||R.isCancellationRequested?!1:(I.add(F),!0)),{});return k.sort(this.compareItems.bind(this)),k}async flattenSymbols(D,I){D.children.forEach(R=>{I.push(R),R.children&&this.flattenSymbols(R,I)})}async getRecentlyItems(D,I,R){const M=await this.recentFilesManager.getMostRecentlyOpenedFiles(!0)||[];return await this.getItems(M.filter(O=>{const P=new l.URI(O);return D.has(O)||!r.default.test(I,P.displayName)||R.isCancellationRequested?!1:(D.add(O),!0)}),{groupLabel:(0,l.localize)("search.historyMatches")})}async getItems(D,I){const R=[];for(const[M,O]of D.entries()){const P=l.URI.isUriString(O)?new l.URI(O):l.URI.file(O),k=`file-icon ${this.labelService.getIcon(P.withoutFragment())}`;let F="";const L=await this.workspaceService.asRelativePath(P.parent);L&&(this.workspaceService.isMultiRootWorkspaceOpened?F=`${new l.URI(L.root).displayName}${L.path?` \u30FB ${L.path}`:""}`:F=L.path||"");const B=new l.QuickOpenItem({uri:P,label:P.displayName,tooltip:O,iconClass:k,description:F,groupLabel:M===0?I.groupLabel:"",showBorder:D.length>0&&M===0?I.showBorder:!1,run:j=>(j===l.Mode.PREVIEW&&(this.prevSelected=P),j===l.Mode.OPEN?(this.openFile(P),!0):!1)});R.push(B)}return R}openFile(D){const I=D.codeUri.fsPath;let R=c(this.currentLookFor);(!R||!R.startLineNumber&&!R.startColumn)&&(R=c(D.fragment?"#"+D.fragment:I)),this.currentLookFor="",this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,D.withoutFragment(),{preview:!1,range:R,focus:!0})}locateSymbol(D,I){this.workbenchEditorService.open(D,{range:I.range,preview:!0})}compareItems(D,I,R="getLabel"){function M(j){return j.trim().toLowerCase()}const O=M(y(this.currentLookFor));function P(j){const W=r.default.match(O,j);return W===null?0:W.score}let k=D[R](),F=I[R]();typeof k!="string"&&(k=k.path.toString()),typeof F!="string"&&(F=F.path.toString()),k=M(k),F=M(F);const L=P(k),B=P(F);if(L===B){const j=k.indexOf(O),W=F.indexOf(O);return j===W?k.length!==F.length?k.length<F.length?-1:1:F.localeCompare(k)===0?R==="getUri"?0:this.compareItems(D,I,"getUri"):F.localeCompare(k):j-W}return B-L}getPreferenceSearchExcludes(){const D=[],I=this.preferenceService.get("files.exclude"),R=this.preferenceService.get("search.exclude"),M=Object.assign({},I,R);for(const O of Object.keys(M))M[O]&&D.push(O);return D}};t.FileSearchQuickCommandHandler=A,n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(f.FileSearchServicePath),n.__metadata("design:type",Object)],A.prototype,"fileSearchService",void 0),n.__decorate([(0,o.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(s.DocumentSymbolStore),n.__metadata("design:type",s.DocumentSymbolStore)],A.prototype,"documentSymbolStore",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",p.LabelService)],A.prototype,"labelService",void 0),n.__decorate([(0,o.Autowired)(d.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(l.RecentFilesManager),n.__metadata("design:type",l.RecentFilesManager)],A.prototype,"recentFilesManager",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],A.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",S)],A.prototype,"fileSearchActionProvider",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(v.IReporterService),n.__metadata("design:type",Object)],A.prototype,"reporterService",void 0),t.FileSearchQuickCommandHandler=A=n.__decorate([(0,o.Injectable)()],A);let w=class{registerQuickOpenHandlers(D){D.registerHandler(this.fileSearchQuickCommandHandler,{title:(0,l.localize)("quickopen.tab.file"),commandId:t.quickFileOpen.id,order:1})}registerCommands(D){D.registerCommand(t.quickFileOpen,{execute:()=>this.quickOpenService.open("...")}),D.registerCommand(t.quickGoToSymbol,{execute:()=>this.quickOpenService.open("...@")})}registerKeybindings(D){D.registerKeybinding({command:t.quickFileOpen.id,keybinding:"ctrlcmd+p"})}};t.FileSearchContribution=w,n.__decorate([(0,o.Autowired)(A),n.__metadata("design:type",A)],w.prototype,"fileSearchQuickCommandHandler",void 0),n.__decorate([(0,o.Autowired)(h.PrefixQuickOpenService),n.__metadata("design:type",Object)],w.prototype,"quickOpenService",void 0),t.FileSearchContribution=w=n.__decorate([(0,m.Domain)(v.CommandContribution,l.KeybindingContribution,u.QuickOpenContribution)],w)},73827:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientAddonModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(69452),p=e(79682),v=e(72915),m=e(27654),_=e(17631),s=e(22874),f=e(79240),a=e(18256),h=e(7756),u=e(16426);let d=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[p.ChromeDevtoolsContribution,a.LanguageChangeHintContribution,f.FileSearchContribution,h.StatusBarContribution,u.ToolbarCustomizeContribution,_.FileDropContribution,v.ConnectionRTTContribution,{token:l.IFileDropFrontendServiceToken,useClass:s.FileDropService},{token:m.ConnectionRTTBrowserServiceToken,useClass:m.ConnectionRTTBrowserService}],this.backServices=[{servicePath:l.FileDropServicePath},{servicePath:l.ConnectionBackServicePath}]}};t.ClientAddonModule=d,t.ClientAddonModule=d=n.__decorate([(0,r.Injectable)()],d)},18256:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageChangeHintContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(72665);let p=class{onStart(){this.preferenceService.onSpecificPreferenceChange(o.GeneralSettingsId.Language,async m=>{(0,o.setLanguageId)(m.newValue),this.preferenceService.get("general.askReloadOnLanguageChange")&&await this.dialogService.info((0,o.localize)("preference.general.language.change.refresh.info","After changing the language, it should be restarted to take effect. Will it be refreshed immediately?"),[(0,o.localize)("preference.general.language.change.refresh.later","Later"),(0,o.localize)("preference.general.language.change.refresh.now","Now")])===(0,o.localize)("preference.general.language.change.refresh.now","Now")&&this.clientApp.fireOnReload()})}};t.LanguageChangeHintContribution=p,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],p.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.IClientApp),n.__metadata("design:type",Object)],p.prototype,"clientApp",void 0),n.__decorate([(0,r.Autowired)(l.IDialogService),n.__metadata("design:type",Object)],p.prototype,"dialogService",void 0),t.LanguageChangeHintContribution=p=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],p)},7756:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718);let p=class extends l.WithEventBus{onStart(){}handleBrowserConnectionOpen(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--statusBar-background)"),this.logger.log("Browser connection open, change status bar background color")}handleBrowserConnectionClose(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--kt-statusbar-offline-background)"),this.logger.log("Browser connection close, change status bar background color")}};t.StatusBarContribution=p,n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],p.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionOpenEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"handleBrowserConnectionOpen",null),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"handleBrowserConnectionClose",null),t.StatusBarContribution=p=n.__decorate([(0,l.Domain)(o.ClientAppContribution)],p)},16426:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),p=e(62132);let v=class{registerCommands(_){_.registerCommand({id:"toolbar.showCustomizePanel",label:"Show Toolbar Customization"},{execute:()=>{this.viewService.setVisible(!0)}})}registerComponent(_){_.register("addon/toolbar-customize",{id:"addon/toolbar-customize",component:p.ToolbarCustomizeComponent}),this.config.layoutConfig[o.SlotLocation.extra]||(this.config.layoutConfig[o.SlotLocation.extra]={modules:[]}),this.config.layoutConfig[o.SlotLocation.extra].modules.push("addon/toolbar-customize")}registerMenus(_){_.registerMenuItem(l.MenuId.KTToolbarLocationContext,{command:{id:"toolbar.showCustomizePanel",label:(0,o.localize)("toolbar.customize.menu")}})}};t.ToolbarCustomizeContribution=v,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],v.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(p.ToolbarCustomizeViewService),n.__metadata("design:type",p.ToolbarCustomizeViewService)],v.prototype,"viewService",void 0),t.ToolbarCustomizeContribution=v=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ComponentContribution,l.MenuContribution)],v)},62132:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeComponent=t.ToolbarCustomizeViewService=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(97267),p=e(41869),v=n.__importDefault(e(18541));let m=class{bindSetVisibleHandle(f){this._setVisible=f}setVisible(f){this._setVisible(f)}async toggleActionVisibility(f,a,h){const u=this.preferenceService.getValid("toolbar.ignoreActions",{});if(u[f]||(u[f]=[]),!h)u[f].indexOf(a)===-1&&u[f].push(a);else{const E=u[f].indexOf(a);E!==-1&&u[f].splice(E,1)}const d=this.preferenceService.inspect("toolbar.ignoreActions").workspaceValue?p.PreferenceScope.Workspace:p.PreferenceScope.User;await this.preferenceService.set("toolbar.ignoreActions",u,d)}};t.ToolbarCustomizeViewService=m,n.__decorate([(0,o.Autowired)(p.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),t.ToolbarCustomizeViewService=m=n.__decorate([(0,o.Injectable)()],m);const _=()=>{const[s,f]=r.default.useState(!1),a=(0,p.useInjectable)(m),h=(0,p.useInjectable)(p.IToolbarRegistry),u=(0,p.useInjectable)(p.PreferenceService);if(a.bindSetVisibleHandle(f),!s)return null;const d=h.getAllLocations(),E=u.get("toolbar.ignoreActions")||{};let g=u.get("toolbar.buttonDisplay","iconAndText");function c(y){const b=[{id:"_head"},...h.getActionGroups(y)||[],{id:"_tail"}],S=[],A=E[y]||[];return b.forEach((w,T)=>{const D=h.getToolbarActions({location:y,group:w.id});D&&D.actions.length>0&&(S.length>0&&S.push(r.default.createElement("div",{className:v.default["group-split"],key:"split-"+T})),D.actions.forEach((I,R)=>{var M;let O=A.indexOf(I.id)===-1;const P="action-toggle-"+I.id;S.push(r.default.createElement("div",{className:v.default["action-item"],key:R+"_"+I.id},r.default.createElement(l.CheckBox,{onChange:()=>{a.toggleActionVisibility(y,I.id,!O),O=!O},defaultChecked:O,id:P,label:(M=I.description)!==null&&M!==void 0?M:I.id})))}))}),S.length===0?null:r.default.createElement("div",{key:y,className:v.default["toolbar-customize-location"]},S)}return r.default.createElement("div",{className:v.default["toolbar-customize-overlay"]},r.default.createElement("div",{className:v.default["toolbar-customize"]},d.map(y=>c(y)),r.default.createElement("div",{className:v.default["button-display"]},r.default.createElement("div",null,(0,p.localize)("toolbar-customize.buttonDisplay.description")),r.default.createElement(l.Select,{options:[{label:(0,p.localize)("toolbar-customize.buttonDisplay.icon"),value:"icon"},{label:(0,p.localize)("toolbar-customize.buttonDisplay.iconAndText"),value:"iconAndText"}],value:g,onChange:y=>{const b=u.inspect("toolbar.buttonDisplay").workspaceValue?p.PreferenceScope.Workspace:p.PreferenceScope.User;u.set("toolbar.buttonDisplay",y,b),g=y},className:v.default["button-display-select"]})),r.default.createElement("div",{className:v.default["customize-complete"]},r.default.createElement(l.Button,{type:"primary",onClick:()=>f(!1)},(0,p.localize)("toolbar-customize.complete")))))};t.ToolbarCustomizeComponent=_},69452:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IConnectionBackService=t.ConnectionBackServicePath=t.IFileDropFrontendServiceToken=t.IFileDropServiceToken=t.FileDropServicePath=void 0,t.FileDropServicePath="FileDropServicePath",t.IFileDropServiceToken=Symbol("IFileDropService"),t.IFileDropFrontendServiceToken=Symbol("IFileDropFrontendService"),t.ConnectionBackServicePath="ConnectionBackServicePath",t.IConnectionBackService=Symbol("IConnectionBackService")},77659:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(50394);let p=class{get contextKeyService(){return this._contextKeyService}constructor(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.inlineChatIsVisible=l.InlineChatIsVisible.bind(this._contextKeyService),this.inlineCompletionIsTrigger=l.InlineCompletionIsTrigger.bind(this._contextKeyService),this.inlineHintWidgetIsVisible=l.InlineHintWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsVisible=l.InlineInputWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsStreaming=l.InlineInputWidgetIsStreaming.bind(this._contextKeyService),this.inlineDiffPartialEditsIsVisible=l.InlineDiffPartialEditsIsVisible.bind(this._contextKeyService),this.codeEditsIsVisible=l.CodeEditsIsVisible.bind(this._contextKeyService)}};t.AINativeContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.AINativeContextKey=p=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],p)},32016:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeBrowserContribution=t.INLINE_DIFF_MANAGER_WIDGET_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57925),p=e(50394),v=e(1149),m=e(97222),_=e(43718),s=e(82353),f=e(54414),a=e(57517),h=e(51553),u=e(63067),d=e(46507),E=e(97682),g=e(68415),c=e(96640),y=e(19413),b=e(61282),S=e(51081),A=e(59347),w=e(76154),T=e(79559),D=e(57232),I=e(72991),R=e(71863),M=e(7511),O=e(42911),P=e(72801),k=e(87817),F=e(4972),L=e(82983),B=e(73974),j=e(77633),W=e(51221),U=e(2281),X=e(31031),V=e(95608),$=e(38890),Y=e(77886),G=e(89060),H=e(74353),K=e(22169),Z=e(90058);t.INLINE_DIFF_MANAGER_WIDGET_ID="inline-diff-manager-widget";let Q=class{constructor(){this.registerFeature()}async initialize(){const{supportsChatAssistant:ne}=this.aiNativeConfigService.capabilities;ne&&(o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,y.AI_CHAT_VIEW_ID,y.AI_CHAT_CONTAINER_ID),o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,s.DESIGN_MENU_BAR_RIGHT,y.AI_CHAT_LOGO_AVATAR_ID),this.chatProxyService.registerDefaultAgent(),this.chatInternalService.init(),await this.chatManagerService.init())}registerEditorExtensionContribution(ne){const{supportsInlineChat:he,supportsInlineCompletion:_e,supportsProblemFix:q,supportsCodeAction:Ie}=this.aiNativeConfigService.capabilities;ne($.InlineDiffController.ID,new c.SyncDescriptor($.InlineDiffController,[this.injector]),E.EditorContributionInstantiation.Lazy),Ie&&ne(Z.SumiLightBulbWidget.ID,Z.SumiLightBulbWidget,E.EditorContributionInstantiation.Lazy),he&&(ne(W.InlineChatEditorController.ID,new c.SyncDescriptor(W.InlineChatEditorController,[this.injector]),E.EditorContributionInstantiation.BeforeFirstInteraction),this.inlineInputService.getInteractiveInputHandler()&&(ne(Y.InlineHintController.ID,new c.SyncDescriptor(Y.InlineHintController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender),ne(G.InlineInputController.ID,new c.SyncDescriptor(G.InlineInputController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender))),_e&&(ne(M.IntelligentCompletionsController.ID,new c.SyncDescriptor(M.IntelligentCompletionsController,[this.injector]),E.EditorContributionInstantiation.Eager),ne(I.InlineCompletionsController.ID,new c.SyncDescriptor(I.InlineCompletionsController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)),q&&ne(O.ProblemFixController.ID,new c.SyncDescriptor(O.ProblemFixController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)}onReconnect(){const{supportsMCP:ne}=this.aiNativeConfigService.capabilities;ne&&this.initMCPServers()}onDidStart(){(0,_.runWhenIdle)(()=>{const{supportsRenameSuggestions:ne,supportsInlineChat:he,supportsMCP:_e,supportsCustomLLMSettings:q}=this.aiNativeConfigService.capabilities,Ie=this.preferenceService.getValid(o.AINativeSettingSectionsId.ChatVisibleType);Ie==="always"?this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!0):Ie==="never"&&this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!1),ne&&this.renameSingleHandler.load(),he&&this.codeActionSingleHandler.load(),q&&this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.LLMModelSelection,be=>{const ie=this.getModelByName(be.newValue),fe=ie?Object.keys(ie):[],Me=fe.length?fe[0]:"",Le=this.preferenceSchemaProvider.getPreferenceProperty(o.AINativeSettingSectionsId.ModelID);this.preferenceSchemaProvider.setSchema({properties:{[o.AINativeSettingSectionsId.ModelID]:{...Le,default:Me,defaultValue:Me,enum:fe.length?fe:void 0}}},!0),this.preferenceService.set(o.AINativeSettingSectionsId.ModelID,Me,be.scope),this.preferenceSettings.setEnumLabels(o.AINativeSettingSectionsId.ModelID,fe.reduce((ve,Se)=>({...ve,[Se]:Se}),{}))}),_e&&this.initMCPServers()})}initMCPServers(){var ne;const he=this.preferenceService.getValid(o.AINativeSettingSectionsId.MCPServers),_e=he?.find(q=>q.name===y.BUILTIN_MCP_SERVER_NAME);if(this.sumiMCPServerBackendProxy.initBuiltinMCPServer((ne=_e?.enabled)!==null&&ne!==void 0?ne:!0),he&&he.length>0){const q=he.filter(Ie=>Ie.name!==y.BUILTIN_MCP_SERVER_NAME);q.length>0&&this.sumiMCPServerBackendProxy.initExternalMCPServers(q)}}getModelByName(ne){switch(ne){case"deepseek":return y.deepSeekModels;case"anthropic":return y.anthropicModels;case"openai":return y.openAiNativeModels;default:return}}registerFeature(){this.contributions.getContributions().forEach(ne=>{var he,_e,q,Ie,be,ie,fe,Me,Le;(he=ne.registerInlineChatFeature)===null||he===void 0||he.call(ne,this.inlineChatFeatureRegistry),(_e=ne.registerChatFeature)===null||_e===void 0||_e.call(ne,this.chatFeatureRegistry),(q=ne.registerResolveConflictFeature)===null||q===void 0||q.call(ne,this.resolveConflictRegistry),(Ie=ne.registerRenameProvider)===null||Ie===void 0||Ie.call(ne,this.renameCandidatesProviderRegistry),(be=ne.registerChatRender)===null||be===void 0||be.call(ne,this.chatRenderRegistry),(ie=ne.registerTerminalProvider)===null||ie===void 0||ie.call(ne,this.terminalProviderRegistry),(fe=ne.registerIntelligentCompletionFeature)===null||fe===void 0||fe.call(ne,this.intelligentCompletionsRegistry),(Me=ne.registerProblemFixFeature)===null||Me===void 0||Me.call(ne,this.problemFixProviderRegistry),(Le=ne.registerChatAgentPromptProvider)===null||Le===void 0||Le.call(ne)}),this.mcpServerContributions.getContributions().forEach(ne=>{ne.registerMCPServer(this.mcpServerRegistry)})}registerSetting(ne){ne.registerSettingGroup({id:o.AI_NATIVE_SETTING_GROUP_ID,title:_.AI_NATIVE_SETTING_GROUP_TITLE,iconClass:(0,o.getIcon)("magic-wand")}),ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.chat.title"),preferences:[{id:o.AINativeSettingSectionsId.ChatVisibleType,localized:"preference.ai.native.chat.visible.type"}]}),ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.interface.quick.title"),preferences:[{id:o.AINativeSettingSectionsId.InterfaceQuickNavigationEnabled,localized:"preference.ai.native.interface.quick.navigation"}]}),this.aiNativeConfigService.capabilities.supportsInlineCompletion&&(ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.intelligentCompletions.title"),preferences:[{id:o.AINativeSettingSectionsId.IntelligentCompletionsCacheEnabled,localized:"preference.ai.native.intelligentCompletions.cache.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsDebounceTime,localized:"preference.ai.native.intelligentCompletions.debounceTime"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsPromptEngineeringEnabled,localized:"preference.ai.native.intelligentCompletions.promptEngineering.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,localized:"preference.ai.native.intelligentCompletions.alwaysVisible"}]}),ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.codeEdits.title"),preferences:[{id:o.AINativeSettingSectionsId.CodeEditsLintErrors,localized:"preference.ai.native.codeEdits.lintErrors"},{id:o.AINativeSettingSectionsId.CodeEditsLineChange,localized:"preference.ai.native.codeEdits.lineChange"},{id:o.AINativeSettingSectionsId.CodeEditsTyping,localized:"preference.ai.native.codeEdits.typing"},{id:o.AINativeSettingSectionsId.CodeEditsRenderType,localized:"preference.ai.native.codeEdits.renderType"},{id:o.AINativeSettingSectionsId.SystemPrompt,localized:"preference.ai.native.chat.system.prompt"}]})),this.aiNativeConfigService.capabilities.supportsCustomLLMSettings&&ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.llm.apiSettings.title"),preferences:[{id:o.AINativeSettingSectionsId.LLMModelSelection,localized:"preference.ai.native.llm.model.selection"},{id:o.AINativeSettingSectionsId.ModelID,localized:"preference.ai.native.llm.model.id"},{id:o.AINativeSettingSectionsId.DeepseekApiKey,localized:"preference.ai.native.deepseek.apiKey"},{id:o.AINativeSettingSectionsId.AnthropicApiKey,localized:"preference.ai.native.anthropic.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiApiKey,localized:"preference.ai.native.openai.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiBaseURL,localized:"preference.ai.native.openai.baseURL"}]}),this.aiNativeConfigService.capabilities.supportsMCP&&ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.mcp.settings.title"),preferences:[{id:o.AINativeSettingSectionsId.MCPServers,localized:"preference.ai.native.mcp.servers"}]}),this.aiNativeConfigService.capabilities.supportsInlineChat&&ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.inlineChat.title"),preferences:[{id:o.AINativeSettingSectionsId.InlineChatAutoVisible,localized:"preference.ai.native.inlineChat.auto.visible"},{id:o.AINativeSettingSectionsId.InlineChatCodeActionEnabled,localized:"preference.ai.native.inlineChat.codeAction.enabled"},{id:o.AINativeSettingSectionsId.InlineDiffPreviewMode,localized:"preference.ai.native.inlineDiff.preview.mode"}]})}registerEditorFeature(ne){ne.registerEditorFeatureContribution({contribute:he=>{const{monacoEditor:_e}=he;return this.codeActionSingleHandler.mountEditor(he.monacoEditor),_e.onDidScrollChange(()=>{this.ctxMenuRenderer.visible&&this.ctxMenuRenderer.hide(!0)})}})}registerEditorComponent(ne){ne.registerEditorSideWidget({id:t.INLINE_DIFF_MANAGER_WIDGET_ID,component:V.InlineDiffManager,displaysOnResource:he=>!!(this.injector.hasInstance(B.BaseApplyService)&&this.applyService.getUriPendingCodeBlock(he.uri))})}registerCommands(ne){ne.registerCommand(l.AI_INLINE_CHAT_VISIBLE,{execute:he=>{this.aiInlineChatService._onInlineChatVisible.fire(he)}}),ne.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE,{execute:async he=>{var _e;if(!he){this.inlineInputService.hide();return}this.commandService.executeCommand(l.AI_INLINE_CHAT_VISIBLE.id,!1);const q=this.workbenchEditorService.currentCodeEditor;if(!q)return;const Ie=q.monacoEditor.getPosition();if(!Ie)return;const be=q.monacoEditor.getSelection();if(Ie?((_e=q.monacoEditor.getModel())===null||_e===void 0?void 0:_e.getLineLength(Ie.lineNumber))===0:!1){this.inlineInputService.visibleByPosition(Ie);return}if(be&&!be.isEmpty()){this.inlineInputService.visibleBySelection(be);return}this.inlineInputService.visibleByNearestCodeBlock(Ie,q.monacoEditor)}}),ne.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL,{execute:()=>{var he;const _e=this.workbenchEditorService.currentCodeEditor;_e&&((he=G.InlineInputController.get(_e.monacoEditor))===null||he===void 0||he.cancelToken())}}),ne.registerCommand(l.AI_INLINE_COMPLETION_REPORTER,{execute:(he,_e,q,Ie)=>{this.aiCompletionsService.report({sessionId:_e,accept:q,relationId:he,code:Ie})}}),ne.registerCommand(l.AI_CHAT_VISIBLE,{execute:he=>{this.layoutService.toggleSlot(y.AI_CHAT_VIEW_ID,(0,_.isUndefined)(he)?!0:he)}}),ne.registerCommand(l.AI_INLINE_COMPLETION_VISIBLE,{execute:async he=>{he||(this.aiCompletionsService.hideStatusBarItem(),this.aiInlineCompletionsProvider.setVisibleCompletion(!1),this.aiInlineCompletionsProvider.cancelRequest())}}),ne.registerCommand(l.AI_INLINE_DIFF_PARTIAL_EDIT,{execute:he=>{this.inlineStreamDiffService.launchAcceptDiscardPartialEdit(he)}}),ne.afterExecuteCommand(g.HideInlineCompletion.ID,()=>{this.commandService.executeCommand(l.AI_INLINE_COMPLETION_VISIBLE.id,!1)})}registerRenderer(ne){this.designLayoutConfig.supportExternalChatPanel?ne.registerSlotRenderer(y.AI_CHAT_VIEW_ID,F.AIChatTabRendererWithTab):ne.registerSlotRenderer(y.AI_CHAT_VIEW_ID,F.AIChatTabRenderer),this.designLayoutConfig.useMergeRightWithLeftPanel&&(ne.registerSlotRenderer(o.SlotLocation.left,F.AILeftTabRenderer),ne.registerSlotRenderer(o.SlotLocation.right,F.AIRightTabRenderer))}registerComponent(ne){ne.register(y.AI_CHAT_CONTAINER_ID,[],{component:w.AIChatView,title:(0,o.localize)("aiNative.chat.ai.assistant.name"),iconClass:(0,o.getIcon)("magic-wand"),containerId:y.AI_CHAT_CONTAINER_ID}),ne.register(y.AI_MENU_BAR_DEBUG_TOOLBAR,{id:y.AI_MENU_BAR_DEBUG_TOOLBAR,component:k.AIRunToolbar}),ne.register(y.AI_CHAT_LOGO_AVATAR_ID,{id:y.AI_CHAT_LOGO_AVATAR_ID,component:L.AIChatLogoAvatar})}registerKeybindings(ne){this.aiNativeConfigService.capabilities.supportsInlineChat&&(ne.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"ctrlcmd+i",when:"editorTextFocus",args:!0,priority:0},o.KeybindingScope.USER),ne.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"esc",args:!1,when:`editorFocus && ${p.InlineChatIsVisible.raw}`}),this.inlineInputService.getInteractiveInputHandler()&&(ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && (${p.InlineChatIsVisible.raw} || inlineSuggestionVisible)`},o.KeybindingScope.USER),ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:"esc",args:!1,priority:0,when:`editorFocus && ${p.InlineInputWidgetIsVisible.raw}`}),ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL.id,keybinding:"esc",priority:1,when:`editorFocus && ${p.InlineInputWidgetIsStreaming.raw}`}),ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && ${p.InlineHintWidgetIsVisible.raw} && ${p.InlineChatIsVisible.not}`},o.KeybindingScope.USER))),ne.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+y",args:!0,priority:100,when:`editorTextFocus && ${p.InlineDiffPartialEditsIsVisible.raw}`}),ne.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+n",args:!1,priority:100,when:`editorTextFocus && ${p.InlineDiffPartialEditsIsVisible.raw}`})}};t.AINativeBrowserContribution=Q,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],Q.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],Q.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.IBrowserCtxMenu),n.__metadata("design:type",m.IBrowserCtxMenu)],Q.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(j.AINativeCoreContribution),n.__metadata("design:type",Object)],Q.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(j.MCPServerContribution),n.__metadata("design:type",Object)],Q.prototype,"mcpServerContributions",void 0),n.__decorate([(0,r.Autowired)(j.TokenMCPServerRegistry),n.__metadata("design:type",Object)],Q.prototype,"mcpServerRegistry",void 0),n.__decorate([(0,r.Autowired)(_.InlineChatFeatureRegistryToken),n.__metadata("design:type",U.InlineChatFeatureRegistry)],Q.prototype,"inlineChatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ChatFeatureRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"chatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ChatRenderRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"chatRenderRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ResolveConflictRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"resolveConflictRegistry",void 0),n.__decorate([(0,r.Autowired)(_.RenameCandidatesProviderRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"renameCandidatesProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(_.TerminalRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"terminalProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(_.IntelligentCompletionsRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"intelligentCompletionsRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ProblemFixRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"problemFixProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],Q.prototype,"aiNativeConfigService",void 0),n.__decorate([(0,r.Autowired)(v.DesignLayoutConfig),n.__metadata("design:type",v.DesignLayoutConfig)],Q.prototype,"designLayoutConfig",void 0),n.__decorate([(0,r.Autowired)(R.AICompletionsService),n.__metadata("design:type",R.AICompletionsService)],Q.prototype,"aiCompletionsService",void 0),n.__decorate([(0,r.Autowired)(D.AIInlineCompletionsProvider),n.__metadata("design:type",D.AIInlineCompletionsProvider)],Q.prototype,"aiInlineCompletionsProvider",void 0),n.__decorate([(0,r.Autowired)(_.CommandService),n.__metadata("design:type",Object)],Q.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],Q.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],Q.prototype,"preferenceSettings",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],Q.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(u.IMainLayoutService),n.__metadata("design:type",Object)],Q.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(y.ChatProxyServiceToken),n.__metadata("design:type",S.ChatProxyService)],Q.prototype,"chatProxyService",void 0),n.__decorate([(0,r.Autowired)(o.IAIInlineChatService),n.__metadata("design:type",X.InlineChatService)],Q.prototype,"aiInlineChatService",void 0),n.__decorate([(0,r.Autowired)(H.InlineInputService),n.__metadata("design:type",H.InlineInputService)],Q.prototype,"inlineInputService",void 0),n.__decorate([(0,r.Autowired)(K.InlineStreamDiffService),n.__metadata("design:type",K.InlineStreamDiffService)],Q.prototype,"inlineStreamDiffService",void 0),n.__decorate([(0,r.Autowired)(P.RenameSingleHandler),n.__metadata("design:type",P.RenameSingleHandler)],Q.prototype,"renameSingleHandler",void 0),n.__decorate([(0,r.Autowired)(T.CodeActionSingleHandler),n.__metadata("design:type",T.CodeActionSingleHandler)],Q.prototype,"codeActionSingleHandler",void 0),n.__decorate([(0,r.Autowired)(y.SumiMCPServerProxyServicePath),n.__metadata("design:type",Object)],Q.prototype,"sumiMCPServerBackendProxy",void 0),n.__decorate([(0,r.Autowired)(f.WorkbenchEditorService),n.__metadata("design:type",h.WorkbenchEditorServiceImpl)],Q.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(y.IChatManagerService),n.__metadata("design:type",b.ChatManagerService)],Q.prototype,"chatManagerService",void 0),n.__decorate([(0,r.Autowired)(y.IChatInternalService),n.__metadata("design:type",A.ChatInternalService)],Q.prototype,"chatInternalService",void 0),n.__decorate([(0,r.Autowired)(B.BaseApplyService),n.__metadata("design:type",B.BaseApplyService)],Q.prototype,"applyService",void 0),t.AINativeBrowserContribution=Q=n.__decorate([(0,o.Domain)(o.ClientAppContribution,a.BrowserEditorContribution,o.CommandContribution,d.SettingContribution,o.KeybindingContribution,o.ComponentContribution,o.SlotRendererContribution,o.MonacoContribution),n.__metadata("design:paramtypes",[])],Q)},74055:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAgentService=void 0;const n=e(85608),r=n.__importDefault(e(66652)),o=e(76003),l=e(43718),p=e(46044),v=e(73307),m=e(29770);let _=class extends l.Disposable{constructor(){super(),this.agents=new Map,this.initialUserMessageMap=new Map,this.shouldUpdateContext=!1,this._onDidChangeAgents=new l.Emitter,this.onDidChangeAgents=this._onDidChangeAgents.event,this._onDidSendMessage=new l.Emitter,this.onDidSendMessage=this._onDidSendMessage.event,this.addDispose(this._onDidChangeAgents),this.addDispose(this.contextService.onDidContextFilesChangeEvent(f=>{f.version!==this.contextVersion&&(this.contextVersion=f.version,this.shouldUpdateContext=!0)}))}registerAgent(f){if(this.agents.has(f.id))throw new Error(`Already registered an agent with id ${f.id}`);return this.agents.set(f.id,{agent:f,commands:[]}),this._onDidChangeAgents.fire(),(0,l.toDisposable)(()=>{this.agents.delete(f.id)&&this._onDidChangeAgents.fire()})}async updateAgent(f,a){const h=this.agents.get(f);if(!h)throw new Error(`No agent with id ${f} registered`);h.agent.metadata={...h.agent.metadata,...a},h.commands=await h.agent.provideSlashCommands(l.CancellationToken.None),a.isDefault&&(this.defaultAgentId=f);const u=await h.agent.provideChatWelcomeMessage(l.CancellationToken.None);if(u){const{content:d,sampleQuestions:E}=u;this.chatFeatureRegistry.registerWelcome(d,E)}this._onDidChangeAgents.fire()}getAgents(){return Array.from(this.agents.values(),f=>f.agent)}hasAgent(f){return this.agents.has(f)}getDefaultAgentId(){return this.defaultAgentId}getAgent(f){const a=this.agents.get(f);return a?.agent}async invokeAgent(f,a,h,u,d){const E=this.agents.get(f);if(!E)throw new Error(`No agent with id ${f}`);if(!this.initialUserMessageMap.has(a.sessionId)){this.initialUserMessageMap.set(a.sessionId,a.message);const c=a.message;a.message=this.provideContextMessage(c,a.sessionId)}return this.shouldUpdateContext&&(a.message=this.provideContextMessage(a.message,a.sessionId),this.shouldUpdateContext=!1),await E.agent.invoke(a,h,u,d)}provideContextMessage(f,a){const h=this.contextService.serialize(),u=this.promptProvider.provideContextPrompt(h,f);return this.aiReporter.record({msgType:l.AIServiceType.Chat,actionType:l.ActionTypeEnum.ContextEnhance,actionSource:l.ActionSourceEnum.Chat,sessionId:a,message:u}),u}populateChatInput(f,a){this.aiChatService.sendMessage({...a,agentId:f,immediate:!1})}getCommands(){return(0,r.default)(Array.from(this.agents.values(),({agent:f,commands:a})=>a.map(h=>({...h,agentId:f.id}))))}async getFollowups(f,a,h){const u=this.agents.get(f);if(!u)throw new Error(`No agent with id ${f}`);return u.agent.provideFollowups?u.agent.provideFollowups(a,h):[]}async getSampleQuestions(f,a){const h=this.agents.get(f);if(!h)throw new Error(`No agent with id ${f}`);return h.agent.provideSampleQuestions?h.agent.provideSampleQuestions(a):[]}async getAllSampleQuestions(){const f=await Promise.all(Array.from(this.agents.values()).map(async({agent:a})=>{try{return await this.getSampleQuestions(a.id,l.CancellationToken.None)}catch(h){return this.logger.error(h),[]}}));return(0,r.default)(f)}sendMessage(f){this._onDidSendMessage.fire(f)}parseMessage(f,a){var h;const u={agentId:"",command:"",message:f};let d=a;const E=this.getAgents(),g=new RegExp(`^@(${E.map(y=>y.id).join("|")})(?:\\s+|$)`,"i"),c=u.message.match(g);if(c){const y=E.find(b=>b.id.toLowerCase()===c[1].toLowerCase());if(!y)return u;d=y.id,u.agentId=d,u.message=u.message.replace(c[0],"")}if(d){const y=(h=this.agents.get(d))===null||h===void 0?void 0:h.commands;if(y?.length){const b=new RegExp(`^/\\s?(${y.map(A=>A.name).join("|")})(?:\\s+|$)`,"i"),S=u.message.match(b);if(S){const A=y.find(w=>w.name.toLowerCase()===S[1].toLowerCase());if(!A)return u;u.command=A.name,u.message=u.message.replace(S[0],"")}}}return u}};t.ChatAgentService=_,n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(l.IAIReporter),n.__metadata("design:type",Object)],_.prototype,"aiReporter",void 0),n.__decorate([(0,o.Autowired)(p.LLMContextServiceToken),n.__metadata("design:type",Object)],_.prototype,"contextService",void 0),n.__decorate([(0,o.Autowired)(v.ChatAgentPromptProvider),n.__metadata("design:type",Object)],_.prototype,"promptProvider",void 0),n.__decorate([(0,o.Autowired)(l.ChatServiceToken),n.__metadata("design:type",m.ChatService)],_.prototype,"aiChatService",void 0),n.__decorate([(0,o.Autowired)(l.ChatFeatureRegistryToken),n.__metadata("design:type",Object)],_.prototype,"chatFeatureRegistry",void 0),t.ChatAgentService=_=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],_)},84543:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAgentViewService=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(19413),p=e(51081);let v=class{constructor(){this.componentsMap=new Map,this.componentsDeferredMap=new Map}registerChatComponent(_){return this.componentsMap.set(_.id,_),this.componentsDeferredMap.has(_.id)&&(this.componentsDeferredMap.get(_.id).resolve(_),this.componentsDeferredMap.delete(_.id)),{dispose:()=>{this.componentsMap.get(_.id)===_&&(this.componentsMap.delete(_.id),this.componentsDeferredMap.delete(_.id))}}}getChatComponent(_){return this.componentsMap.has(_)?this.componentsMap.get(_):(this.componentsDeferredMap.has(_)||this.componentsDeferredMap.set(_,new o.Deferred),null)}getChatComponentDeferred(_){return this.componentsDeferredMap.get(_)||null}getRenderAgents(){return this.chatAgentService.getAgents().filter(_=>_.id!==p.ChatProxyService.AGENT_ID)}};t.ChatAgentViewService=v,n.__decorate([(0,r.Autowired)(l.IChatAgentService),n.__metadata("design:type",Object)],v.prototype,"chatAgentService",void 0),t.ChatAgentViewService=v=n.__decorate([(0,r.Injectable)()],v)},61282:(x,t,e)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ChatManagerService=void 0;const o=e(85608),l=e(76003),p=e(43718),v=e(19413),m=e(44260),_=e(42033),s=20;let f=class extends p.Disposable{fromJSON(h){return h.map(u=>{const d=new _.ChatModel({sessionId:u.sessionId,history:new m.MsgHistoryManager(u.history)}),E=u.requests.map(g=>new _.ChatRequestModel(g.requestId,d,g.message,new _.ChatResponseModel(g.requestId,d,g.message.agentId,{responseContents:g.response.responseContents,isComplete:!0,responseText:g.response.responseText,errorDetails:g.response.errorDetails,followups:g.response.followups,isCanceled:g.response.isCanceled})));return d.restoreRequests(E),d})}constructor(){super(),n.set(this,this.registerDispose(new p.DisposableMap)),r.set(this,this.registerDispose(new p.DisposableMap)),this.storageInitEmitter=new p.Emitter,this.onStorageInit=this.storageInitEmitter.event}async init(){this._chatStorage=await this.storageProvider(p.STORAGE_NAMESPACE.CHAT);const h=this._chatStorage.get("sessionModels",[]);this.fromJSON(h).forEach(d=>{o.__classPrivateFieldGet(this,n,"f").set(d.sessionId,d),this.listenSession(d)}),await this.storageInitEmitter.fireAndAwait()}getSessions(){return Array.from(o.__classPrivateFieldGet(this,n,"f").values())}startSession(){if(o.__classPrivateFieldGet(this,n,"f").size>=s)throw new Error((0,p.formatLocalize)("aiNative.chat.session.max",s.toString()));const h=new _.ChatModel;return o.__classPrivateFieldGet(this,n,"f").set(h.sessionId,h),this.listenSession(h),h}getSession(h){return o.__classPrivateFieldGet(this,n,"f").get(h)}clearSession(h){var u;if(!o.__classPrivateFieldGet(this,n,"f").get(h))throw new Error(`Unknown session: ${h}`);o.__classPrivateFieldGet(this,n,"f").disposeKey(h),(u=o.__classPrivateFieldGet(this,r,"f").get(h))===null||u===void 0||u.cancel(),o.__classPrivateFieldGet(this,r,"f").disposeKey(h),this.saveSessions()}createRequest(h,u,d,E){const g=this.getSession(h);if(!g)throw new Error(`Unknown session: ${h}`);if(!o.__classPrivateFieldGet(this,r,"f").has(h))return g.addRequest({prompt:u,agentId:d,command:E})}async sendRequest(h,u,d){const E=this.getSession(h);if(!E)throw new Error(`Unknown session: ${h}`);const g=new p.CancellationTokenSource,c=g.token;o.__classPrivateFieldGet(this,r,"f").set(E.sessionId,g);const y=c.onCancellationRequested(()=>{u.response.cancel()}),b=[];for(const S of E.requests)S.response.isComplete&&(b.push({role:1,content:S.message.prompt}),b.push({role:2,content:S.response.responseText}));try{const S=T=>{c.isCancellationRequested||E.acceptResponseProgress(u,T)},A={sessionId:h,requestId:u.requestId,message:u.message.prompt,command:u.message.command,regenerate:d},w=await this.chatAgentService.invokeAgent(u.message.agentId,A,S,b,c);c.isCancellationRequested||(w.errorDetails&&u.response.setErrorDetails(w.errorDetails),this.chatAgentService.getFollowups(u.message.agentId,h,p.CancellationToken.None).then(D=>{u.response.setFollowups(D),u.response.complete()}))}finally{y.dispose(),o.__classPrivateFieldGet(this,r,"f").disposeKey(E.sessionId),this.saveSessions()}}listenSession(h){this.addDispose(h.history.onMessageAdditionalChange(()=>{this.saveSessions()}))}saveSessions(){this._chatStorage.set("sessionModels",this.getSessions())}cancelRequest(h){var u;(u=o.__classPrivateFieldGet(this,r,"f").get(h))===null||u===void 0||u.cancel(),o.__classPrivateFieldGet(this,r,"f").disposeKey(h),this.saveSessions()}};t.ChatManagerService=f,n=new WeakMap,r=new WeakMap,o.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),o.__metadata("design:type",l.Injector)],f.prototype,"injector",void 0),o.__decorate([(0,l.Autowired)(v.IChatAgentService),o.__metadata("design:type",Object)],f.prototype,"chatAgentService",void 0),o.__decorate([(0,l.Autowired)(p.StorageProvider),o.__metadata("design:type",Function)],f.prototype,"storageProvider",void 0),o.__decorate([(0,p.debounce)(1e3),o.__metadata("design:type",Function),o.__metadata("design:paramtypes",[]),o.__metadata("design:returntype",void 0)],f.prototype,"saveSessions",null),t.ChatManagerService=f=o.__decorate([(0,l.Injectable)(),o.__metadata("design:paramtypes",[])],f)},42033:(x,t,e)=>{"use strict";var n,r,o,l,p,v,m,_,s,f,a,h,u,d,E;Object.defineProperty(t,"__esModule",{value:!0}),t.ChatSlashCommandItemModel=t.ChatWelcomeMessageModel=t.ChatModel=t.ChatRequestModel=t.ChatResponseModel=void 0;const g=e(85608),c=e(76003),y=e(43718),b=e(90684),S=e(19413),A=e(44260);class w extends y.Disposable{get responseParts(){return g.__classPrivateFieldGet(this,r,"f")}get responseContents(){return g.__classPrivateFieldGet(this,o,"f")}get isComplete(){return g.__classPrivateFieldGet(this,l,"f")}get isCanceled(){return g.__classPrivateFieldGet(this,p,"f")}get requestId(){return g.__classPrivateFieldGet(this,v,"f")}get responseText(){return g.__classPrivateFieldGet(this,m,"f")}get errorDetails(){return g.__classPrivateFieldGet(this,_,"f")}get followups(){return g.__classPrivateFieldGet(this,s,"f")}get onDidChange(){return g.__classPrivateFieldGet(this,f,"f").event}constructor(O,P,k,F){super(),n.add(this),this.session=P,this.agentId=k,r.set(this,[]),o.set(this,[]),l.set(this,!1),p.set(this,!1),v.set(this,void 0),m.set(this,""),_.set(this,void 0),s.set(this,void 0),f.set(this,this.registerDispose(new y.Emitter)),g.__classPrivateFieldSet(this,v,O,"f"),F&&(g.__classPrivateFieldSet(this,o,F.responseContents,"f"),g.__classPrivateFieldSet(this,m,F.responseText,"f"),g.__classPrivateFieldSet(this,l,F.isComplete,"f"),g.__classPrivateFieldSet(this,p,F.isCanceled,"f"),g.__classPrivateFieldSet(this,_,F.errorDetails,"f"),g.__classPrivateFieldSet(this,s,F.followups,"f"))}updateContent(O,P){var k;const F=g.__classPrivateFieldGet(this,r,"f").length-1;if(O.kind==="content"||O.kind==="markdownContent"){const L=g.__classPrivateFieldGet(this,r,"f")[F];!L||L.kind!=="markdownContent"?O.kind==="content"?g.__classPrivateFieldGet(this,r,"f").push({content:new b.MarkdownString(O.content),kind:"markdownContent"}):g.__classPrivateFieldGet(this,r,"f").push(O):O.kind==="markdownContent"?g.__classPrivateFieldGet(this,r,"f")[F]={content:new b.MarkdownString(L.content.value+O.content.value),kind:"markdownContent"}:g.__classPrivateFieldGet(this,r,"f")[F]={content:new b.MarkdownString(L.content.value+O.content,L.content),kind:"markdownContent"},g.__classPrivateFieldGet(this,n,"m",a).call(this)}else if(O.kind==="asyncContent"){const L=g.__classPrivateFieldGet(this,r,"f").push(O)-1;g.__classPrivateFieldGet(this,n,"m",a).call(this),(k=O.resolvedContent)===null||k===void 0||k.then(B=>{typeof B=="string"?g.__classPrivateFieldGet(this,r,"f")[L]={content:new b.MarkdownString(B),kind:"markdownContent"}:(0,b.isMarkdownString)(B)?g.__classPrivateFieldGet(this,r,"f")[L]={content:B,kind:"markdownContent"}:g.__classPrivateFieldGet(this,r,"f")[L]=B,g.__classPrivateFieldGet(this,n,"m",a).call(this,P)})}else if(O.kind==="treeData"||O.kind==="component")g.__classPrivateFieldGet(this,r,"f").push(O),g.__classPrivateFieldGet(this,n,"m",a).call(this,P);else if(O.kind==="toolCall"){const L=g.__classPrivateFieldGet(this,r,"f").find(B=>B.kind==="toolCall"&&B.content.id===O.content.id);L?L.content=O.content:g.__classPrivateFieldGet(this,r,"f").push(O),g.__classPrivateFieldGet(this,n,"m",a).call(this,P)}}complete(){g.__classPrivateFieldSet(this,l,!0,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}cancel(){g.__classPrivateFieldSet(this,l,!0,"f"),g.__classPrivateFieldSet(this,p,!0,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}reset(){g.__classPrivateFieldSet(this,o,[],"f"),g.__classPrivateFieldSet(this,r,[],"f"),g.__classPrivateFieldSet(this,m,"","f"),g.__classPrivateFieldSet(this,p,!1,"f"),g.__classPrivateFieldSet(this,l,!1,"f"),g.__classPrivateFieldSet(this,_,void 0,"f"),g.__classPrivateFieldSet(this,s,void 0,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}setErrorDetails(O){g.__classPrivateFieldSet(this,_,O,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}setFollowups(O){g.__classPrivateFieldSet(this,s,O,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}toJSON(){return{isCanceled:this.isCanceled,responseContents:this.responseContents,responseText:this.responseText,errorDetails:this.errorDetails,followups:this.followups}}}t.ChatResponseModel=w,r=new WeakMap,o=new WeakMap,l=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,_=new WeakMap,s=new WeakMap,f=new WeakMap,n=new WeakSet,a=function(O){g.__classPrivateFieldSet(this,m,g.__classPrivateFieldGet(this,r,"f").map(k=>k.kind==="asyncContent"?k.content:k.kind==="treeData"||k.kind==="component"?"":k.kind==="toolCall"?k.content.function.name:k.content.value).join(`
|
|
30083
|
+
${JSON.stringify(r,null,2)}`);const l=n[o]();return new Language(INTERNAL,l)})}}class LookaheadIterable{constructor(t,e,n){assertInternal(t),this[0]=e,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(t){return C._ts_lookahead_iterator_reset_state(this[0],t)}reset(t,e){return!!C._ts_lookahead_iterator_reset(this[0],t[0],e)&&(this.language=t,!0)}[Symbol.iterator](){const t=this;return{next:()=>C._ts_lookahead_iterator_next(t[0])?{done:!1,value:t.currentType}:{done:!0,value:""}}}}class Query{constructor(t,e,n,r,o,l,p,v){assertInternal(t),this[0]=e,this.captureNames=n,this.textPredicates=r,this.predicates=o,this.setProperties=l,this.assertedProperties=p,this.refutedProperties=v,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:p=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_matches_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,p);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),_=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=new Array(v);this.exceededMatchLimit=!!_;let f=0,a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const d=getValue(a,"i32");a+=SIZE_OF_INT;const E=new Array(d);if(a=unmarshalCaptures(this,t.tree,a,E),this.textPredicates[u].every(g=>g(E))){s[f]={pattern:u,captures:E};const g=this.setProperties[u];g&&(s[f].setProperties=g);const c=this.assertedProperties[u];c&&(s[f].assertedProperties=c);const y=this.refutedProperties[u];y&&(s[f].refutedProperties=y),f++}}return s.length=f,C._free(m),s}captures(t,{startPosition:e=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:r=0,endIndex:o=0,matchLimit:l=4294967295,maxStartDepth:p=4294967295}={}){if(typeof l!="number")throw new Error("Arguments must be numbers");marshalNode(t),C._ts_query_captures_wasm(this[0],t.tree[0],e.row,e.column,n.row,n.column,r,o,l,p);const v=getValue(TRANSFER_BUFFER,"i32"),m=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),_=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),s=[];this.exceededMatchLimit=!!_;const f=[];let a=m;for(let h=0;h<v;h++){const u=getValue(a,"i32");a+=SIZE_OF_INT;const d=getValue(a,"i32");a+=SIZE_OF_INT;const E=getValue(a,"i32");if(a+=SIZE_OF_INT,f.length=d,a=unmarshalCaptures(this,t.tree,a,f),this.textPredicates[u].every(g=>g(f))){const g=f[E],c=this.setProperties[u];c&&(g.setProperties=c);const y=this.assertedProperties[u];y&&(g.assertedProperties=y);const b=this.refutedProperties[u];b&&(g.refutedProperties=b),s.push(g)}}return C._free(m),s}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){const e=lengthBytesUTF8(t),n=C._malloc(e+1);stringToUTF8(t,n,e+1),C._ts_query_disable_capture(this[0],n,e),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(x,t,e){const n=e-t;let r=x.textCallback(t,null,e);for(t+=r.length;t<e;){const o=x.textCallback(t,null,e);if(!(o&&o.length>0))break;t+=o.length,r+=o}return t>e&&(r=r.slice(0,n)),r}function unmarshalCaptures(x,t,e,n){for(let r=0,o=n.length;r<o;r++){const l=getValue(e,"i32"),p=unmarshalNode(t,e+=SIZE_OF_INT);e+=SIZE_OF_NODE,n[r]={name:x.captureNames[l],node:p}}return e}function assertInternal(x){if(x!==INTERNAL)throw new Error("Illegal constructor")}function isPoint(x){return x&&typeof x.row=="number"&&typeof x.column=="number"}function marshalNode(x){let t=TRANSFER_BUFFER;setValue(t,x.id,"i32"),t+=SIZE_OF_INT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.row,"i32"),t+=SIZE_OF_INT,setValue(t,x.startPosition.column,"i32"),t+=SIZE_OF_INT,setValue(t,x[0],"i32")}function unmarshalNode(x,t=TRANSFER_BUFFER){const e=getValue(t,"i32");if(e===0)return null;const n=getValue(t+=SIZE_OF_INT,"i32"),r=getValue(t+=SIZE_OF_INT,"i32"),o=getValue(t+=SIZE_OF_INT,"i32"),l=getValue(t+=SIZE_OF_INT,"i32"),p=new Node(INTERNAL,x);return p.id=e,p.startIndex=n,p.startPosition={row:r,column:o},p[0]=l,p}function marshalTreeCursor(x,t=TRANSFER_BUFFER){setValue(t+0*SIZE_OF_INT,x[0],"i32"),setValue(t+1*SIZE_OF_INT,x[1],"i32"),setValue(t+2*SIZE_OF_INT,x[2],"i32"),setValue(t+3*SIZE_OF_INT,x[3],"i32")}function unmarshalTreeCursor(x){x[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),x[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),x[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),x[3]=getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(x,t){setValue(x,t.row,"i32"),setValue(x+SIZE_OF_INT,t.column,"i32")}function unmarshalPoint(x){return{row:getValue(x,"i32")>>>0,column:getValue(x+SIZE_OF_INT,"i32")>>>0}}function marshalRange(x,t){marshalPoint(x,t.startPosition),marshalPoint(x+=SIZE_OF_POINT,t.endPosition),setValue(x+=SIZE_OF_POINT,t.startIndex,"i32"),setValue(x+=SIZE_OF_INT,t.endIndex,"i32"),x+=SIZE_OF_INT}function unmarshalRange(x){const t={};return t.startPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.endPosition=unmarshalPoint(x),x+=SIZE_OF_POINT,t.startIndex=getValue(x,"i32")>>>0,x+=SIZE_OF_INT,t.endIndex=getValue(x,"i32")>>>0,t}function marshalEdit(x){let t=TRANSFER_BUFFER;marshalPoint(t,x.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.oldEndPosition),t+=SIZE_OF_POINT,marshalPoint(t,x.newEndPosition),t+=SIZE_OF_POINT,setValue(t,x.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.oldEndIndex,"i32"),t+=SIZE_OF_INT,setValue(t,x.newEndIndex,"i32"),t+=SIZE_OF_INT}for(const x of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,x,{value:ParserImpl.prototype[x],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser}();module.exports=TreeSitter},52730:(x,t,e)=>{"use strict";var n=e(80705),r=e(14834),o=e(28498),l=e(79818),p=e(69336),v=l("Object.prototype.toString"),m=e(51913)(),_=typeof globalThis>"u"?e.g:globalThis,s=r(),f=l("String.prototype.slice"),a=Object.getPrototypeOf,h=l("Array.prototype.indexOf",!0)||function(c,y){for(var b=0;b<c.length;b+=1)if(c[b]===y)return b;return-1},u={__proto__:null};m&&p&&a?n(s,function(g){var c=new _[g];if(Symbol.toStringTag in c){var y=a(c),b=p(y,Symbol.toStringTag);if(!b){var S=a(y);b=p(S,Symbol.toStringTag)}u["$"+g]=o(b.get)}}):n(s,function(g){var c=new _[g],y=c.slice||c.set;y&&(u["$"+g]=o(y))});var d=function(c){var y=!1;return n(u,function(b,S){if(!y)try{"$"+b(c)===S&&(y=f(S,1))}catch{}}),y},E=function(c){var y=!1;return n(u,function(b,S){if(!y)try{b(c),y=f(S,1)}catch{}}),y};x.exports=function(c){if(!c||typeof c!="object")return!1;if(!m){var y=f(v(c),8,-1);return h(s,y)>-1?y:y!=="Object"?!1:E(c)}return p?d(c):null}},97442:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;const n=e(94705);t.ZodIssueCode=n.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const r=l=>JSON.stringify(l,null,2).replace(/"([^"]+)":/g,"$1:");t.quotelessJson=r;class o extends Error{get errors(){return this.issues}constructor(p){super(),this.issues=[],this.addIssue=m=>{this.issues=[...this.issues,m]},this.addIssues=(m=[])=>{this.issues=[...this.issues,...m]};const v=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,v):this.__proto__=v,this.name="ZodError",this.issues=p}format(p){const v=p||function(s){return s.message},m={_errors:[]},_=s=>{for(const f of s.issues)if(f.code==="invalid_union")f.unionErrors.map(_);else if(f.code==="invalid_return_type")_(f.returnTypeError);else if(f.code==="invalid_arguments")_(f.argumentsError);else if(f.path.length===0)m._errors.push(v(f));else{let a=m,h=0;for(;h<f.path.length;){const u=f.path[h];h===f.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(v(f))):a[u]=a[u]||{_errors:[]},a=a[u],h++}}};return _(this),m}static assert(p){if(!(p instanceof o))throw new Error(`Not a ZodError: ${p}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(p=v=>v.message){const v={},m=[];for(const _ of this.issues)_.path.length>0?(v[_.path[0]]=v[_.path[0]]||[],v[_.path[0]].push(p(_))):m.push(p(_));return{formErrors:m,fieldErrors:v}}get formErrors(){return this.flatten()}}t.ZodError=o,o.create=l=>new o(l)},30548:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;const r=n(e(28412));t.defaultErrorMap=r.default;let o=r.default;function l(v){o=v}t.setErrorMap=l;function p(){return o}t.getErrorMap=p},86340:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(o,l,p,v){v===void 0&&(v=p);var m=Object.getOwnPropertyDescriptor(l,p);(!m||("get"in m?!l.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return l[p]}}),Object.defineProperty(o,v,m)}:function(o,l,p,v){v===void 0&&(v=p),o[v]=l[p]}),r=this&&this.__exportStar||function(o,l){for(var p in o)p!=="default"&&!Object.prototype.hasOwnProperty.call(l,p)&&n(l,o,p)};Object.defineProperty(t,"__esModule",{value:!0}),r(e(30548),t),r(e(66258),t),r(e(29201),t),r(e(94705),t),r(e(75226),t),r(e(97442),t)},15759:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0;var e;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(e||(t.errorUtil=e={}))},66258:function(x,t,e){"use strict";var n=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;const r=e(30548),o=n(e(28412)),l=u=>{const{data:d,path:E,errorMaps:g,issueData:c}=u,y=[...E,...c.path||[]],b={...c,path:y};if(c.message!==void 0)return{...c,path:y,message:c.message};let S="";const A=g.filter(w=>!!w).slice().reverse();for(const w of A)S=w(b,{data:d,defaultError:S}).message;return{...c,path:y,message:S}};t.makeIssue=l,t.EMPTY_PATH=[];function p(u,d){const E=(0,r.getErrorMap)(),g=(0,t.makeIssue)({issueData:d,data:u.data,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,E,E===o.default?void 0:o.default].filter(c=>!!c)});u.common.issues.push(g)}t.addIssueToContext=p;class v{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(d,E){const g=[];for(const c of E){if(c.status==="aborted")return t.INVALID;c.status==="dirty"&&d.dirty(),g.push(c.value)}return{status:d.value,value:g}}static async mergeObjectAsync(d,E){const g=[];for(const c of E){const y=await c.key,b=await c.value;g.push({key:y,value:b})}return v.mergeObjectSync(d,g)}static mergeObjectSync(d,E){const g={};for(const c of E){const{key:y,value:b}=c;if(y.status==="aborted"||b.status==="aborted")return t.INVALID;y.status==="dirty"&&d.dirty(),b.status==="dirty"&&d.dirty(),y.value!=="__proto__"&&(typeof b.value<"u"||c.alwaysSet)&&(g[y.value]=b.value)}return{status:d.value,value:g}}}t.ParseStatus=v,t.INVALID=Object.freeze({status:"aborted"});const m=u=>({status:"dirty",value:u});t.DIRTY=m;const _=u=>({status:"valid",value:u});t.OK=_;const s=u=>u.status==="aborted";t.isAborted=s;const f=u=>u.status==="dirty";t.isDirty=f;const a=u=>u.status==="valid";t.isValid=a;const h=u=>typeof Promise<"u"&&u instanceof Promise;t.isAsync=h},29201:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},94705:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0;var e;(function(o){o.assertEqual=m=>m;function l(m){}o.assertIs=l;function p(m){throw new Error}o.assertNever=p,o.arrayToEnum=m=>{const _={};for(const s of m)_[s]=s;return _},o.getValidEnumValues=m=>{const _=o.objectKeys(m).filter(f=>typeof m[m[f]]!="number"),s={};for(const f of _)s[f]=m[f];return o.objectValues(s)},o.objectValues=m=>o.objectKeys(m).map(function(_){return m[_]}),o.objectKeys=typeof Object.keys=="function"?m=>Object.keys(m):m=>{const _=[];for(const s in m)Object.prototype.hasOwnProperty.call(m,s)&&_.push(s);return _},o.find=(m,_)=>{for(const s of m)if(_(s))return s},o.isInteger=typeof Number.isInteger=="function"?m=>Number.isInteger(m):m=>typeof m=="number"&&isFinite(m)&&Math.floor(m)===m;function v(m,_=" | "){return m.map(s=>typeof s=="string"?`'${s}'`:s).join(_)}o.joinValues=v,o.jsonStringifyReplacer=(m,_)=>typeof _=="bigint"?_.toString():_})(e||(t.util=e={}));var n;(function(o){o.mergeShapes=(l,p)=>({...l,...p})})(n||(t.objectUtil=n={})),t.ZodParsedType=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const r=o=>{switch(typeof o){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(o)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(o)?t.ZodParsedType.array:o===null?t.ZodParsedType.null:o.then&&typeof o.then=="function"&&o.catch&&typeof o.catch=="function"?t.ZodParsedType.promise:typeof Map<"u"&&o instanceof Map?t.ZodParsedType.map:typeof Set<"u"&&o instanceof Set?t.ZodParsedType.set:typeof Date<"u"&&o instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}};t.getParsedType=r},75995:function(x,t,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(v,m,_,s){s===void 0&&(s=_);var f=Object.getOwnPropertyDescriptor(m,_);(!f||("get"in f?!m.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return m[_]}}),Object.defineProperty(v,s,f)}:function(v,m,_,s){s===void 0&&(s=_),v[s]=m[_]}),r=this&&this.__setModuleDefault||(Object.create?function(v,m){Object.defineProperty(v,"default",{enumerable:!0,value:m})}:function(v,m){v.default=m}),o=this&&this.__importStar||function(v){if(v&&v.__esModule)return v;var m={};if(v!=null)for(var _ in v)_!=="default"&&Object.prototype.hasOwnProperty.call(v,_)&&n(m,v,_);return r(m,v),m},l=this&&this.__exportStar||function(v,m){for(var _ in v)_!=="default"&&!Object.prototype.hasOwnProperty.call(m,_)&&n(m,v,_)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const p=o(e(86340));t.z=p,l(e(86340),t),t.default=p},28412:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(94705),r=e(97442),o=(l,p)=>{let v;switch(l.code){case r.ZodIssueCode.invalid_type:l.received===n.ZodParsedType.undefined?v="Required":v=`Expected ${l.expected}, received ${l.received}`;break;case r.ZodIssueCode.invalid_literal:v=`Invalid literal value, expected ${JSON.stringify(l.expected,n.util.jsonStringifyReplacer)}`;break;case r.ZodIssueCode.unrecognized_keys:v=`Unrecognized key(s) in object: ${n.util.joinValues(l.keys,", ")}`;break;case r.ZodIssueCode.invalid_union:v="Invalid input";break;case r.ZodIssueCode.invalid_union_discriminator:v=`Invalid discriminator value. Expected ${n.util.joinValues(l.options)}`;break;case r.ZodIssueCode.invalid_enum_value:v=`Invalid enum value. Expected ${n.util.joinValues(l.options)}, received '${l.received}'`;break;case r.ZodIssueCode.invalid_arguments:v="Invalid function arguments";break;case r.ZodIssueCode.invalid_return_type:v="Invalid function return type";break;case r.ZodIssueCode.invalid_date:v="Invalid date";break;case r.ZodIssueCode.invalid_string:typeof l.validation=="object"?"includes"in l.validation?(v=`Invalid input: must include "${l.validation.includes}"`,typeof l.validation.position=="number"&&(v=`${v} at one or more positions greater than or equal to ${l.validation.position}`)):"startsWith"in l.validation?v=`Invalid input: must start with "${l.validation.startsWith}"`:"endsWith"in l.validation?v=`Invalid input: must end with "${l.validation.endsWith}"`:n.util.assertNever(l.validation):l.validation!=="regex"?v=`Invalid ${l.validation}`:v="Invalid";break;case r.ZodIssueCode.too_small:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at least":"more than"} ${l.minimum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at least":"over"} ${l.minimum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${l.minimum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly equal to ":l.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(l.minimum))}`:v="Invalid input";break;case r.ZodIssueCode.too_big:l.type==="array"?v=`Array must contain ${l.exact?"exactly":l.inclusive?"at most":"less than"} ${l.maximum} element(s)`:l.type==="string"?v=`String must contain ${l.exact?"exactly":l.inclusive?"at most":"under"} ${l.maximum} character(s)`:l.type==="number"?v=`Number must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="bigint"?v=`BigInt must be ${l.exact?"exactly":l.inclusive?"less than or equal to":"less than"} ${l.maximum}`:l.type==="date"?v=`Date must be ${l.exact?"exactly":l.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(l.maximum))}`:v="Invalid input";break;case r.ZodIssueCode.custom:v="Invalid input";break;case r.ZodIssueCode.invalid_intersection_types:v="Intersection results could not be merged";break;case r.ZodIssueCode.not_multiple_of:v=`Number must be a multiple of ${l.multipleOf}`;break;case r.ZodIssueCode.not_finite:v="Number must be finite";break;default:v=p.defaultError,n.util.assertNever(l)}return{message:v}};t.default=o},75226:function(x,t,e){"use strict";var n=this&&this.__classPrivateFieldGet||function(ln,st,Ht,on){if(Ht==="a"&&!on)throw new TypeError("Private accessor was defined without a getter");if(typeof st=="function"?ln!==st||!on:!st.has(ln))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ht==="m"?on:Ht==="a"?on.call(ln):on?on.value:st.get(ln)},r=this&&this.__classPrivateFieldSet||function(ln,st,Ht,on,xn){if(on==="m")throw new TypeError("Private method is not writable");if(on==="a"&&!xn)throw new TypeError("Private accessor was defined without a setter");if(typeof st=="function"?ln!==st||!xn:!st.has(ln))throw new TypeError("Cannot write private member to an object whose class did not declare it");return on==="a"?xn.call(ln,Ht):xn?xn.value=Ht:st.set(ln,Ht),Ht},o,l;Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.datetimeRegex=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=t.date=void 0;const p=e(30548),v=e(15759),m=e(66258),_=e(94705),s=e(97442);class f{constructor(st,Ht,on,xn){this._cachedPath=[],this.parent=st,this.data=Ht,this._path=on,this._key=xn}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(ln,st)=>{if((0,m.isValid)(st))return{success:!0,data:st.value};if(!ln.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const Ht=new s.ZodError(ln.common.issues);return this._error=Ht,this._error}}};function h(ln){if(!ln)return{};const{errorMap:st,invalid_type_error:Ht,required_error:on,description:xn}=ln;if(st&&(Ht||on))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return st?{errorMap:st,description:xn}:{errorMap:(Gi,Fi)=>{var oo,Mi;const{message:no}=ln;return Gi.code==="invalid_enum_value"?{message:no??Fi.defaultError}:typeof Fi.data>"u"?{message:(oo=no??on)!==null&&oo!==void 0?oo:Fi.defaultError}:Gi.code!=="invalid_type"?{message:Fi.defaultError}:{message:(Mi=no??Ht)!==null&&Mi!==void 0?Mi:Fi.defaultError}},description:xn}}class u{get description(){return this._def.description}_getType(st){return(0,_.getParsedType)(st.data)}_getOrReturnCtx(st,Ht){return Ht||{common:st.parent.common,data:st.data,parsedType:(0,_.getParsedType)(st.data),schemaErrorMap:this._def.errorMap,path:st.path,parent:st.parent}}_processInputParams(st){return{status:new m.ParseStatus,ctx:{common:st.parent.common,data:st.data,parsedType:(0,_.getParsedType)(st.data),schemaErrorMap:this._def.errorMap,path:st.path,parent:st.parent}}}_parseSync(st){const Ht=this._parse(st);if((0,m.isAsync)(Ht))throw new Error("Synchronous parse encountered promise.");return Ht}_parseAsync(st){const Ht=this._parse(st);return Promise.resolve(Ht)}parse(st,Ht){const on=this.safeParse(st,Ht);if(on.success)return on.data;throw on.error}safeParse(st,Ht){var on;const xn={common:{issues:[],async:(on=Ht?.async)!==null&&on!==void 0?on:!1,contextualErrorMap:Ht?.errorMap},path:Ht?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:st,parsedType:(0,_.getParsedType)(st)},Zn=this._parseSync({data:st,path:xn.path,parent:xn});return a(xn,Zn)}"~validate"(st){var Ht,on;const xn={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:st,parsedType:(0,_.getParsedType)(st)};if(!this["~standard"].async)try{const Zn=this._parseSync({data:st,path:[],parent:xn});return(0,m.isValid)(Zn)?{value:Zn.value}:{issues:xn.common.issues}}catch(Zn){!((on=(Ht=Zn?.message)===null||Ht===void 0?void 0:Ht.toLowerCase())===null||on===void 0)&&on.includes("encountered")&&(this["~standard"].async=!0),xn.common={issues:[],async:!0}}return this._parseAsync({data:st,path:[],parent:xn}).then(Zn=>(0,m.isValid)(Zn)?{value:Zn.value}:{issues:xn.common.issues})}async parseAsync(st,Ht){const on=await this.safeParseAsync(st,Ht);if(on.success)return on.data;throw on.error}async safeParseAsync(st,Ht){const on={common:{issues:[],contextualErrorMap:Ht?.errorMap,async:!0},path:Ht?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:st,parsedType:(0,_.getParsedType)(st)},xn=this._parse({data:st,path:on.path,parent:on}),Zn=await((0,m.isAsync)(xn)?xn:Promise.resolve(xn));return a(on,Zn)}refine(st,Ht){const on=xn=>typeof Ht=="string"||typeof Ht>"u"?{message:Ht}:typeof Ht=="function"?Ht(xn):Ht;return this._refinement((xn,Zn)=>{const Gi=st(xn),Fi=()=>Zn.addIssue({code:s.ZodIssueCode.custom,...on(xn)});return typeof Promise<"u"&&Gi instanceof Promise?Gi.then(oo=>oo?!0:(Fi(),!1)):Gi?!0:(Fi(),!1)})}refinement(st,Ht){return this._refinement((on,xn)=>st(on)?!0:(xn.addIssue(typeof Ht=="function"?Ht(on,xn):Ht),!1))}_refinement(st){return new $e({schema:this,typeName:St.ZodEffects,effect:{type:"refinement",refinement:st}})}superRefine(st){return this._refinement(st)}constructor(st){this.spa=this.safeParseAsync,this._def=st,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:Ht=>this["~validate"](Ht)}}optional(){return Ve.create(this,this._def)}nullable(){return at.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ie.create(this)}promise(){return Ue.create(this,this._def)}or(st){return fe.create([this,st],this._def)}and(st){return Se.create(this,st,this._def)}transform(st){return new $e({...h(this._def),schema:this,typeName:St.ZodEffects,effect:{type:"transform",transform:st}})}default(st){const Ht=typeof st=="function"?st:()=>st;return new qe({...h(this._def),innerType:this,defaultValue:Ht,typeName:St.ZodDefault})}brand(){return new yt({typeName:St.ZodBranded,type:this,...h(this._def)})}catch(st){const Ht=typeof st=="function"?st:()=>st;return new Ot({...h(this._def),innerType:this,catchValue:Ht,typeName:St.ZodCatch})}describe(st){const Ht=this.constructor;return new Ht({...this._def,description:st})}pipe(st){return tt.create(this,st)}readonly(){return dt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=u,t.Schema=u,t.ZodSchema=u;const d=/^c[^\s-]{8,}$/i,E=/^[0-9a-z]+$/,g=/^[0-9A-HJKMNP-TV-Z]{26}$/i,c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y=/^[a-z0-9_-]{21}$/i,b=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,S=/^[-+]?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)?)??$/,A=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,w="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let T;const D=/^(?:(?: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])$/,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])\/(3[0-2]|[12]?[0-9])$/,R=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,M=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,O=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,P=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,k="((\\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])))",F=new RegExp(`^${k}$`);function L(ln){let st="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return ln.precision?st=`${st}\\.\\d{${ln.precision}}`:ln.precision==null&&(st=`${st}(\\.\\d+)?`),st}function B(ln){return new RegExp(`^${L(ln)}$`)}function j(ln){let st=`${k}T${L(ln)}`;const Ht=[];return Ht.push(ln.local?"Z?":"Z"),ln.offset&&Ht.push("([+-]\\d{2}:?\\d{2})"),st=`${st}(${Ht.join("|")})`,new RegExp(`^${st}$`)}t.datetimeRegex=j;function W(ln,st){return!!((st==="v4"||!st)&&D.test(ln)||(st==="v6"||!st)&&R.test(ln))}function U(ln,st){if(!b.test(ln))return!1;try{const[Ht]=ln.split("."),on=Ht.replace(/-/g,"+").replace(/_/g,"/").padEnd(Ht.length+(4-Ht.length%4)%4,"="),xn=JSON.parse(atob(on));return!(typeof xn!="object"||xn===null||!xn.typ||!xn.alg||st&&xn.alg!==st)}catch{return!1}}function X(ln,st){return!!((st==="v4"||!st)&&I.test(ln)||(st==="v6"||!st)&&M.test(ln))}class V extends u{_parse(st){if(this._def.coerce&&(st.data=String(st.data)),this._getType(st)!==_.ZodParsedType.string){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.string,received:Zn.parsedType}),m.INVALID}const on=new m.ParseStatus;let xn;for(const Zn of this._def.checks)if(Zn.kind==="min")st.data.length<Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_small,minimum:Zn.value,type:"string",inclusive:!0,exact:!1,message:Zn.message}),on.dirty());else if(Zn.kind==="max")st.data.length>Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_big,maximum:Zn.value,type:"string",inclusive:!0,exact:!1,message:Zn.message}),on.dirty());else if(Zn.kind==="length"){const Gi=st.data.length>Zn.value,Fi=st.data.length<Zn.value;(Gi||Fi)&&(xn=this._getOrReturnCtx(st,xn),Gi?(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_big,maximum:Zn.value,type:"string",inclusive:!0,exact:!0,message:Zn.message}):Fi&&(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_small,minimum:Zn.value,type:"string",inclusive:!0,exact:!0,message:Zn.message}),on.dirty())}else if(Zn.kind==="email")A.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"email",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="emoji")T||(T=new RegExp(w,"u")),T.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="uuid")c.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="nanoid")y.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"nanoid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="cuid")d.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="cuid2")E.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="ulid")g.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty());else if(Zn.kind==="url")try{new URL(st.data)}catch{xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"url",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()}else Zn.kind==="regex"?(Zn.regex.lastIndex=0,Zn.regex.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty())):Zn.kind==="trim"?st.data=st.data.trim():Zn.kind==="includes"?st.data.includes(Zn.value,Zn.position)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:{includes:Zn.value,position:Zn.position},message:Zn.message}),on.dirty()):Zn.kind==="toLowerCase"?st.data=st.data.toLowerCase():Zn.kind==="toUpperCase"?st.data=st.data.toUpperCase():Zn.kind==="startsWith"?st.data.startsWith(Zn.value)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:Zn.value},message:Zn.message}),on.dirty()):Zn.kind==="endsWith"?st.data.endsWith(Zn.value)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:Zn.value},message:Zn.message}),on.dirty()):Zn.kind==="datetime"?j(Zn).test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:Zn.message}),on.dirty()):Zn.kind==="date"?F.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:"date",message:Zn.message}),on.dirty()):Zn.kind==="time"?B(Zn).test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.invalid_string,validation:"time",message:Zn.message}),on.dirty()):Zn.kind==="duration"?S.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"duration",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="ip"?W(st.data,Zn.version)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="jwt"?U(st.data,Zn.alg)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"jwt",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="cidr"?X(st.data,Zn.version)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"cidr",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="base64"?O.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"base64",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):Zn.kind==="base64url"?P.test(st.data)||(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{validation:"base64url",code:s.ZodIssueCode.invalid_string,message:Zn.message}),on.dirty()):_.util.assertNever(Zn);return{status:on.value,value:st.data}}_regex(st,Ht,on){return this.refinement(xn=>st.test(xn),{validation:Ht,code:s.ZodIssueCode.invalid_string,...v.errorUtil.errToObj(on)})}_addCheck(st){return new V({...this._def,checks:[...this._def.checks,st]})}email(st){return this._addCheck({kind:"email",...v.errorUtil.errToObj(st)})}url(st){return this._addCheck({kind:"url",...v.errorUtil.errToObj(st)})}emoji(st){return this._addCheck({kind:"emoji",...v.errorUtil.errToObj(st)})}uuid(st){return this._addCheck({kind:"uuid",...v.errorUtil.errToObj(st)})}nanoid(st){return this._addCheck({kind:"nanoid",...v.errorUtil.errToObj(st)})}cuid(st){return this._addCheck({kind:"cuid",...v.errorUtil.errToObj(st)})}cuid2(st){return this._addCheck({kind:"cuid2",...v.errorUtil.errToObj(st)})}ulid(st){return this._addCheck({kind:"ulid",...v.errorUtil.errToObj(st)})}base64(st){return this._addCheck({kind:"base64",...v.errorUtil.errToObj(st)})}base64url(st){return this._addCheck({kind:"base64url",...v.errorUtil.errToObj(st)})}jwt(st){return this._addCheck({kind:"jwt",...v.errorUtil.errToObj(st)})}ip(st){return this._addCheck({kind:"ip",...v.errorUtil.errToObj(st)})}cidr(st){return this._addCheck({kind:"cidr",...v.errorUtil.errToObj(st)})}datetime(st){var Ht,on;return typeof st=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:st}):this._addCheck({kind:"datetime",precision:typeof st?.precision>"u"?null:st?.precision,offset:(Ht=st?.offset)!==null&&Ht!==void 0?Ht:!1,local:(on=st?.local)!==null&&on!==void 0?on:!1,...v.errorUtil.errToObj(st?.message)})}date(st){return this._addCheck({kind:"date",message:st})}time(st){return typeof st=="string"?this._addCheck({kind:"time",precision:null,message:st}):this._addCheck({kind:"time",precision:typeof st?.precision>"u"?null:st?.precision,...v.errorUtil.errToObj(st?.message)})}duration(st){return this._addCheck({kind:"duration",...v.errorUtil.errToObj(st)})}regex(st,Ht){return this._addCheck({kind:"regex",regex:st,...v.errorUtil.errToObj(Ht)})}includes(st,Ht){return this._addCheck({kind:"includes",value:st,position:Ht?.position,...v.errorUtil.errToObj(Ht?.message)})}startsWith(st,Ht){return this._addCheck({kind:"startsWith",value:st,...v.errorUtil.errToObj(Ht)})}endsWith(st,Ht){return this._addCheck({kind:"endsWith",value:st,...v.errorUtil.errToObj(Ht)})}min(st,Ht){return this._addCheck({kind:"min",value:st,...v.errorUtil.errToObj(Ht)})}max(st,Ht){return this._addCheck({kind:"max",value:st,...v.errorUtil.errToObj(Ht)})}length(st,Ht){return this._addCheck({kind:"length",value:st,...v.errorUtil.errToObj(Ht)})}nonempty(st){return this.min(1,v.errorUtil.errToObj(st))}trim(){return new V({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(st=>st.kind==="datetime")}get isDate(){return!!this._def.checks.find(st=>st.kind==="date")}get isTime(){return!!this._def.checks.find(st=>st.kind==="time")}get isDuration(){return!!this._def.checks.find(st=>st.kind==="duration")}get isEmail(){return!!this._def.checks.find(st=>st.kind==="email")}get isURL(){return!!this._def.checks.find(st=>st.kind==="url")}get isEmoji(){return!!this._def.checks.find(st=>st.kind==="emoji")}get isUUID(){return!!this._def.checks.find(st=>st.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(st=>st.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(st=>st.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(st=>st.kind==="cuid2")}get isULID(){return!!this._def.checks.find(st=>st.kind==="ulid")}get isIP(){return!!this._def.checks.find(st=>st.kind==="ip")}get isCIDR(){return!!this._def.checks.find(st=>st.kind==="cidr")}get isBase64(){return!!this._def.checks.find(st=>st.kind==="base64")}get isBase64url(){return!!this._def.checks.find(st=>st.kind==="base64url")}get minLength(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st}get maxLength(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st}}t.ZodString=V,V.create=ln=>{var st;return new V({checks:[],typeName:St.ZodString,coerce:(st=ln?.coerce)!==null&&st!==void 0?st:!1,...h(ln)})};function $(ln,st){const Ht=(ln.toString().split(".")[1]||"").length,on=(st.toString().split(".")[1]||"").length,xn=Ht>on?Ht:on,Zn=parseInt(ln.toFixed(xn).replace(".","")),Gi=parseInt(st.toFixed(xn).replace(".",""));return Zn%Gi/Math.pow(10,xn)}class Y extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(st){if(this._def.coerce&&(st.data=Number(st.data)),this._getType(st)!==_.ZodParsedType.number){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.number,received:Zn.parsedType}),m.INVALID}let on;const xn=new m.ParseStatus;for(const Zn of this._def.checks)Zn.kind==="int"?_.util.isInteger(st.data)||(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Zn.message}),xn.dirty()):Zn.kind==="min"?(Zn.inclusive?st.data<Zn.value:st.data<=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,minimum:Zn.value,type:"number",inclusive:Zn.inclusive,exact:!1,message:Zn.message}),xn.dirty()):Zn.kind==="max"?(Zn.inclusive?st.data>Zn.value:st.data>=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,maximum:Zn.value,type:"number",inclusive:Zn.inclusive,exact:!1,message:Zn.message}),xn.dirty()):Zn.kind==="multipleOf"?$(st.data,Zn.value)!==0&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Zn.value,message:Zn.message}),xn.dirty()):Zn.kind==="finite"?Number.isFinite(st.data)||(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.not_finite,message:Zn.message}),xn.dirty()):_.util.assertNever(Zn);return{status:xn.value,value:st.data}}gte(st,Ht){return this.setLimit("min",st,!0,v.errorUtil.toString(Ht))}gt(st,Ht){return this.setLimit("min",st,!1,v.errorUtil.toString(Ht))}lte(st,Ht){return this.setLimit("max",st,!0,v.errorUtil.toString(Ht))}lt(st,Ht){return this.setLimit("max",st,!1,v.errorUtil.toString(Ht))}setLimit(st,Ht,on,xn){return new Y({...this._def,checks:[...this._def.checks,{kind:st,value:Ht,inclusive:on,message:v.errorUtil.toString(xn)}]})}_addCheck(st){return new Y({...this._def,checks:[...this._def.checks,st]})}int(st){return this._addCheck({kind:"int",message:v.errorUtil.toString(st)})}positive(st){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.errorUtil.toString(st)})}negative(st){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.errorUtil.toString(st)})}nonpositive(st){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.errorUtil.toString(st)})}nonnegative(st){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.errorUtil.toString(st)})}multipleOf(st,Ht){return this._addCheck({kind:"multipleOf",value:st,message:v.errorUtil.toString(Ht)})}finite(st){return this._addCheck({kind:"finite",message:v.errorUtil.toString(st)})}safe(st){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.errorUtil.toString(st)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.errorUtil.toString(st)})}get minValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st}get maxValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st}get isInt(){return!!this._def.checks.find(st=>st.kind==="int"||st.kind==="multipleOf"&&_.util.isInteger(st.value))}get isFinite(){let st=null,Ht=null;for(const on of this._def.checks){if(on.kind==="finite"||on.kind==="int"||on.kind==="multipleOf")return!0;on.kind==="min"?(Ht===null||on.value>Ht)&&(Ht=on.value):on.kind==="max"&&(st===null||on.value<st)&&(st=on.value)}return Number.isFinite(Ht)&&Number.isFinite(st)}}t.ZodNumber=Y,Y.create=ln=>new Y({checks:[],typeName:St.ZodNumber,coerce:ln?.coerce||!1,...h(ln)});class G extends u{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(st){if(this._def.coerce)try{st.data=BigInt(st.data)}catch{return this._getInvalidInput(st)}if(this._getType(st)!==_.ZodParsedType.bigint)return this._getInvalidInput(st);let on;const xn=new m.ParseStatus;for(const Zn of this._def.checks)Zn.kind==="min"?(Zn.inclusive?st.data<Zn.value:st.data<=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:Zn.value,inclusive:Zn.inclusive,message:Zn.message}),xn.dirty()):Zn.kind==="max"?(Zn.inclusive?st.data>Zn.value:st.data>=Zn.value)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:Zn.value,inclusive:Zn.inclusive,message:Zn.message}),xn.dirty()):Zn.kind==="multipleOf"?st.data%Zn.value!==BigInt(0)&&(on=this._getOrReturnCtx(st,on),(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.not_multiple_of,multipleOf:Zn.value,message:Zn.message}),xn.dirty()):_.util.assertNever(Zn);return{status:xn.value,value:st.data}}_getInvalidInput(st){const Ht=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.bigint,received:Ht.parsedType}),m.INVALID}gte(st,Ht){return this.setLimit("min",st,!0,v.errorUtil.toString(Ht))}gt(st,Ht){return this.setLimit("min",st,!1,v.errorUtil.toString(Ht))}lte(st,Ht){return this.setLimit("max",st,!0,v.errorUtil.toString(Ht))}lt(st,Ht){return this.setLimit("max",st,!1,v.errorUtil.toString(Ht))}setLimit(st,Ht,on,xn){return new G({...this._def,checks:[...this._def.checks,{kind:st,value:Ht,inclusive:on,message:v.errorUtil.toString(xn)}]})}_addCheck(st){return new G({...this._def,checks:[...this._def.checks,st]})}positive(st){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(st)})}negative(st){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(st)})}nonpositive(st){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(st)})}nonnegative(st){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(st)})}multipleOf(st,Ht){return this._addCheck({kind:"multipleOf",value:st,message:v.errorUtil.toString(Ht)})}get minValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st}get maxValue(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st}}t.ZodBigInt=G,G.create=ln=>{var st;return new G({checks:[],typeName:St.ZodBigInt,coerce:(st=ln?.coerce)!==null&&st!==void 0?st:!1,...h(ln)})};class H extends u{_parse(st){if(this._def.coerce&&(st.data=!!st.data),this._getType(st)!==_.ZodParsedType.boolean){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.boolean,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodBoolean=H,H.create=ln=>new H({typeName:St.ZodBoolean,coerce:ln?.coerce||!1,...h(ln)});class K extends u{_parse(st){if(this._def.coerce&&(st.data=new Date(st.data)),this._getType(st)!==_.ZodParsedType.date){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.date,received:Zn.parsedType}),m.INVALID}if(isNaN(st.data.getTime())){const Zn=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Zn,{code:s.ZodIssueCode.invalid_date}),m.INVALID}const on=new m.ParseStatus;let xn;for(const Zn of this._def.checks)Zn.kind==="min"?st.data.getTime()<Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_small,message:Zn.message,inclusive:!0,exact:!1,minimum:Zn.value,type:"date"}),on.dirty()):Zn.kind==="max"?st.data.getTime()>Zn.value&&(xn=this._getOrReturnCtx(st,xn),(0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.too_big,message:Zn.message,inclusive:!0,exact:!1,maximum:Zn.value,type:"date"}),on.dirty()):_.util.assertNever(Zn);return{status:on.value,value:new Date(st.data.getTime())}}_addCheck(st){return new K({...this._def,checks:[...this._def.checks,st]})}min(st,Ht){return this._addCheck({kind:"min",value:st.getTime(),message:v.errorUtil.toString(Ht)})}max(st,Ht){return this._addCheck({kind:"max",value:st.getTime(),message:v.errorUtil.toString(Ht)})}get minDate(){let st=null;for(const Ht of this._def.checks)Ht.kind==="min"&&(st===null||Ht.value>st)&&(st=Ht.value);return st!=null?new Date(st):null}get maxDate(){let st=null;for(const Ht of this._def.checks)Ht.kind==="max"&&(st===null||Ht.value<st)&&(st=Ht.value);return st!=null?new Date(st):null}}t.ZodDate=K,K.create=ln=>new K({checks:[],coerce:ln?.coerce||!1,typeName:St.ZodDate,...h(ln)});class Z extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.symbol){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.symbol,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodSymbol=Z,Z.create=ln=>new Z({typeName:St.ZodSymbol,...h(ln)});class Q extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.undefined){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.undefined,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodUndefined=Q,Q.create=ln=>new Q({typeName:St.ZodUndefined,...h(ln)});class oe extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.null){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.null,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodNull=oe,oe.create=ln=>new oe({typeName:St.ZodNull,...h(ln)});class ne extends u{constructor(){super(...arguments),this._any=!0}_parse(st){return(0,m.OK)(st.data)}}t.ZodAny=ne,ne.create=ln=>new ne({typeName:St.ZodAny,...h(ln)});class he extends u{constructor(){super(...arguments),this._unknown=!0}_parse(st){return(0,m.OK)(st.data)}}t.ZodUnknown=he,he.create=ln=>new he({typeName:St.ZodUnknown,...h(ln)});class _e extends u{_parse(st){const Ht=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.never,received:Ht.parsedType}),m.INVALID}}t.ZodNever=_e,_e.create=ln=>new _e({typeName:St.ZodNever,...h(ln)});class q extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.undefined){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.void,received:on.parsedType}),m.INVALID}return(0,m.OK)(st.data)}}t.ZodVoid=q,q.create=ln=>new q({typeName:St.ZodVoid,...h(ln)});class Ie extends u{_parse(st){const{ctx:Ht,status:on}=this._processInputParams(st),xn=this._def;if(Ht.parsedType!==_.ZodParsedType.array)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.array,received:Ht.parsedType}),m.INVALID;if(xn.exactLength!==null){const Gi=Ht.data.length>xn.exactLength.value,Fi=Ht.data.length<xn.exactLength.value;(Gi||Fi)&&((0,m.addIssueToContext)(Ht,{code:Gi?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:Fi?xn.exactLength.value:void 0,maximum:Gi?xn.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:xn.exactLength.message}),on.dirty())}if(xn.minLength!==null&&Ht.data.length<xn.minLength.value&&((0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.too_small,minimum:xn.minLength.value,type:"array",inclusive:!0,exact:!1,message:xn.minLength.message}),on.dirty()),xn.maxLength!==null&&Ht.data.length>xn.maxLength.value&&((0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.too_big,maximum:xn.maxLength.value,type:"array",inclusive:!0,exact:!1,message:xn.maxLength.message}),on.dirty()),Ht.common.async)return Promise.all([...Ht.data].map((Gi,Fi)=>xn.type._parseAsync(new f(Ht,Gi,Ht.path,Fi)))).then(Gi=>m.ParseStatus.mergeArray(on,Gi));const Zn=[...Ht.data].map((Gi,Fi)=>xn.type._parseSync(new f(Ht,Gi,Ht.path,Fi)));return m.ParseStatus.mergeArray(on,Zn)}get element(){return this._def.type}min(st,Ht){return new Ie({...this._def,minLength:{value:st,message:v.errorUtil.toString(Ht)}})}max(st,Ht){return new Ie({...this._def,maxLength:{value:st,message:v.errorUtil.toString(Ht)}})}length(st,Ht){return new Ie({...this._def,exactLength:{value:st,message:v.errorUtil.toString(Ht)}})}nonempty(st){return this.min(1,st)}}t.ZodArray=Ie,Ie.create=(ln,st)=>new Ie({type:ln,minLength:null,maxLength:null,exactLength:null,typeName:St.ZodArray,...h(st)});function be(ln){if(ln instanceof ie){const st={};for(const Ht in ln.shape){const on=ln.shape[Ht];st[Ht]=Ve.create(be(on))}return new ie({...ln._def,shape:()=>st})}else return ln instanceof Ie?new Ie({...ln._def,type:be(ln.element)}):ln instanceof Ve?Ve.create(be(ln.unwrap())):ln instanceof at?at.create(be(ln.unwrap())):ln instanceof Ce?Ce.create(ln.items.map(st=>be(st))):ln}class ie extends u{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const st=this._def.shape(),Ht=_.util.objectKeys(st);return this._cached={shape:st,keys:Ht}}_parse(st){if(this._getType(st)!==_.ZodParsedType.object){const Mi=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Mi,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:Mi.parsedType}),m.INVALID}const{status:on,ctx:xn}=this._processInputParams(st),{shape:Zn,keys:Gi}=this._getCached(),Fi=[];if(!(this._def.catchall instanceof _e&&this._def.unknownKeys==="strip"))for(const Mi in xn.data)Gi.includes(Mi)||Fi.push(Mi);const oo=[];for(const Mi of Gi){const no=Zn[Mi],uo=xn.data[Mi];oo.push({key:{status:"valid",value:Mi},value:no._parse(new f(xn,uo,xn.path,Mi)),alwaysSet:Mi in xn.data})}if(this._def.catchall instanceof _e){const Mi=this._def.unknownKeys;if(Mi==="passthrough")for(const no of Fi)oo.push({key:{status:"valid",value:no},value:{status:"valid",value:xn.data[no]}});else if(Mi==="strict")Fi.length>0&&((0,m.addIssueToContext)(xn,{code:s.ZodIssueCode.unrecognized_keys,keys:Fi}),on.dirty());else if(Mi!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Mi=this._def.catchall;for(const no of Fi){const uo=xn.data[no];oo.push({key:{status:"valid",value:no},value:Mi._parse(new f(xn,uo,xn.path,no)),alwaysSet:no in xn.data})}}return xn.common.async?Promise.resolve().then(async()=>{const Mi=[];for(const no of oo){const uo=await no.key,Do=await no.value;Mi.push({key:uo,value:Do,alwaysSet:no.alwaysSet})}return Mi}).then(Mi=>m.ParseStatus.mergeObjectSync(on,Mi)):m.ParseStatus.mergeObjectSync(on,oo)}get shape(){return this._def.shape()}strict(st){return v.errorUtil.errToObj,new ie({...this._def,unknownKeys:"strict",...st!==void 0?{errorMap:(Ht,on)=>{var xn,Zn,Gi,Fi;const oo=(Gi=(Zn=(xn=this._def).errorMap)===null||Zn===void 0?void 0:Zn.call(xn,Ht,on).message)!==null&&Gi!==void 0?Gi:on.defaultError;return Ht.code==="unrecognized_keys"?{message:(Fi=v.errorUtil.errToObj(st).message)!==null&&Fi!==void 0?Fi:oo}:{message:oo}}}:{}})}strip(){return new ie({...this._def,unknownKeys:"strip"})}passthrough(){return new ie({...this._def,unknownKeys:"passthrough"})}extend(st){return new ie({...this._def,shape:()=>({...this._def.shape(),...st})})}merge(st){return new ie({unknownKeys:st._def.unknownKeys,catchall:st._def.catchall,shape:()=>({...this._def.shape(),...st._def.shape()}),typeName:St.ZodObject})}setKey(st,Ht){return this.augment({[st]:Ht})}catchall(st){return new ie({...this._def,catchall:st})}pick(st){const Ht={};return _.util.objectKeys(st).forEach(on=>{st[on]&&this.shape[on]&&(Ht[on]=this.shape[on])}),new ie({...this._def,shape:()=>Ht})}omit(st){const Ht={};return _.util.objectKeys(this.shape).forEach(on=>{st[on]||(Ht[on]=this.shape[on])}),new ie({...this._def,shape:()=>Ht})}deepPartial(){return be(this)}partial(st){const Ht={};return _.util.objectKeys(this.shape).forEach(on=>{const xn=this.shape[on];st&&!st[on]?Ht[on]=xn:Ht[on]=xn.optional()}),new ie({...this._def,shape:()=>Ht})}required(st){const Ht={};return _.util.objectKeys(this.shape).forEach(on=>{if(st&&!st[on])Ht[on]=this.shape[on];else{let Zn=this.shape[on];for(;Zn instanceof Ve;)Zn=Zn._def.innerType;Ht[on]=Zn}}),new ie({...this._def,shape:()=>Ht})}keyof(){return ue(_.util.objectKeys(this.shape))}}t.ZodObject=ie,ie.create=(ln,st)=>new ie({shape:()=>ln,unknownKeys:"strip",catchall:_e.create(),typeName:St.ZodObject,...h(st)}),ie.strictCreate=(ln,st)=>new ie({shape:()=>ln,unknownKeys:"strict",catchall:_e.create(),typeName:St.ZodObject,...h(st)}),ie.lazycreate=(ln,st)=>new ie({shape:ln,unknownKeys:"strip",catchall:_e.create(),typeName:St.ZodObject,...h(st)});class fe extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st),on=this._def.options;function xn(Zn){for(const Fi of Zn)if(Fi.result.status==="valid")return Fi.result;for(const Fi of Zn)if(Fi.result.status==="dirty")return Ht.common.issues.push(...Fi.ctx.common.issues),Fi.result;const Gi=Zn.map(Fi=>new s.ZodError(Fi.ctx.common.issues));return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_union,unionErrors:Gi}),m.INVALID}if(Ht.common.async)return Promise.all(on.map(async Zn=>{const Gi={...Ht,common:{...Ht.common,issues:[]},parent:null};return{result:await Zn._parseAsync({data:Ht.data,path:Ht.path,parent:Gi}),ctx:Gi}})).then(xn);{let Zn;const Gi=[];for(const oo of on){const Mi={...Ht,common:{...Ht.common,issues:[]},parent:null},no=oo._parseSync({data:Ht.data,path:Ht.path,parent:Mi});if(no.status==="valid")return no;no.status==="dirty"&&!Zn&&(Zn={result:no,ctx:Mi}),Mi.common.issues.length&&Gi.push(Mi.common.issues)}if(Zn)return Ht.common.issues.push(...Zn.ctx.common.issues),Zn.result;const Fi=Gi.map(oo=>new s.ZodError(oo));return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_union,unionErrors:Fi}),m.INVALID}}get options(){return this._def.options}}t.ZodUnion=fe,fe.create=(ln,st)=>new fe({options:ln,typeName:St.ZodUnion,...h(st)});const Me=ln=>ln instanceof pe?Me(ln.schema):ln instanceof $e?Me(ln.innerType()):ln instanceof re?[ln.value]:ln instanceof Re?ln.options:ln instanceof Ae?_.util.objectValues(ln.enum):ln instanceof qe?Me(ln._def.innerType):ln instanceof Q?[void 0]:ln instanceof oe?[null]:ln instanceof Ve?[void 0,...Me(ln.unwrap())]:ln instanceof at?[null,...Me(ln.unwrap())]:ln instanceof yt||ln instanceof dt?Me(ln.unwrap()):ln instanceof Ot?Me(ln._def.innerType):[];class Le extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st);if(Ht.parsedType!==_.ZodParsedType.object)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:Ht.parsedType}),m.INVALID;const on=this.discriminator,xn=Ht.data[on],Zn=this.optionsMap.get(xn);return Zn?Ht.common.async?Zn._parseAsync({data:Ht.data,path:Ht.path,parent:Ht}):Zn._parseSync({data:Ht.data,path:Ht.path,parent:Ht}):((0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[on]}),m.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(st,Ht,on){const xn=new Map;for(const Zn of Ht){const Gi=Me(Zn.shape[st]);if(!Gi.length)throw new Error(`A discriminator value for key \`${st}\` could not be extracted from all schema options`);for(const Fi of Gi){if(xn.has(Fi))throw new Error(`Discriminator property ${String(st)} has duplicate value ${String(Fi)}`);xn.set(Fi,Zn)}}return new Le({typeName:St.ZodDiscriminatedUnion,discriminator:st,options:Ht,optionsMap:xn,...h(on)})}}t.ZodDiscriminatedUnion=Le;function ve(ln,st){const Ht=(0,_.getParsedType)(ln),on=(0,_.getParsedType)(st);if(ln===st)return{valid:!0,data:ln};if(Ht===_.ZodParsedType.object&&on===_.ZodParsedType.object){const xn=_.util.objectKeys(st),Zn=_.util.objectKeys(ln).filter(Fi=>xn.indexOf(Fi)!==-1),Gi={...ln,...st};for(const Fi of Zn){const oo=ve(ln[Fi],st[Fi]);if(!oo.valid)return{valid:!1};Gi[Fi]=oo.data}return{valid:!0,data:Gi}}else if(Ht===_.ZodParsedType.array&&on===_.ZodParsedType.array){if(ln.length!==st.length)return{valid:!1};const xn=[];for(let Zn=0;Zn<ln.length;Zn++){const Gi=ln[Zn],Fi=st[Zn],oo=ve(Gi,Fi);if(!oo.valid)return{valid:!1};xn.push(oo.data)}return{valid:!0,data:xn}}else return Ht===_.ZodParsedType.date&&on===_.ZodParsedType.date&&+ln==+st?{valid:!0,data:ln}:{valid:!1}}class Se extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st),xn=(Zn,Gi)=>{if((0,m.isAborted)(Zn)||(0,m.isAborted)(Gi))return m.INVALID;const Fi=ve(Zn.value,Gi.value);return Fi.valid?(((0,m.isDirty)(Zn)||(0,m.isDirty)(Gi))&&Ht.dirty(),{status:Ht.value,value:Fi.data}):((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_intersection_types}),m.INVALID)};return on.common.async?Promise.all([this._def.left._parseAsync({data:on.data,path:on.path,parent:on}),this._def.right._parseAsync({data:on.data,path:on.path,parent:on})]).then(([Zn,Gi])=>xn(Zn,Gi)):xn(this._def.left._parseSync({data:on.data,path:on.path,parent:on}),this._def.right._parseSync({data:on.data,path:on.path,parent:on}))}}t.ZodIntersection=Se,Se.create=(ln,st,Ht)=>new Se({left:ln,right:st,typeName:St.ZodIntersection,...h(Ht)});class Ce extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.array)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.array,received:on.parsedType}),m.INVALID;if(on.data.length<this._def.items.length)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m.INVALID;!this._def.rest&&on.data.length>this._def.items.length&&((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ht.dirty());const Zn=[...on.data].map((Gi,Fi)=>{const oo=this._def.items[Fi]||this._def.rest;return oo?oo._parse(new f(on,Gi,on.path,Fi)):null}).filter(Gi=>!!Gi);return on.common.async?Promise.all(Zn).then(Gi=>m.ParseStatus.mergeArray(Ht,Gi)):m.ParseStatus.mergeArray(Ht,Zn)}get items(){return this._def.items}rest(st){return new Ce({...this._def,rest:st})}}t.ZodTuple=Ce,Ce.create=(ln,st)=>{if(!Array.isArray(ln))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ce({items:ln,typeName:St.ZodTuple,rest:null,...h(st)})};class ge extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.object)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.object,received:on.parsedType}),m.INVALID;const xn=[],Zn=this._def.keyType,Gi=this._def.valueType;for(const Fi in on.data)xn.push({key:Zn._parse(new f(on,Fi,on.path,Fi)),value:Gi._parse(new f(on,on.data[Fi],on.path,Fi)),alwaysSet:Fi in on.data});return on.common.async?m.ParseStatus.mergeObjectAsync(Ht,xn):m.ParseStatus.mergeObjectSync(Ht,xn)}get element(){return this._def.valueType}static create(st,Ht,on){return Ht instanceof u?new ge({keyType:st,valueType:Ht,typeName:St.ZodRecord,...h(on)}):new ge({keyType:V.create(),valueType:st,typeName:St.ZodRecord,...h(Ht)})}}t.ZodRecord=ge;class xe extends u{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.map)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.map,received:on.parsedType}),m.INVALID;const xn=this._def.keyType,Zn=this._def.valueType,Gi=[...on.data.entries()].map(([Fi,oo],Mi)=>({key:xn._parse(new f(on,Fi,on.path,[Mi,"key"])),value:Zn._parse(new f(on,oo,on.path,[Mi,"value"]))}));if(on.common.async){const Fi=new Map;return Promise.resolve().then(async()=>{for(const oo of Gi){const Mi=await oo.key,no=await oo.value;if(Mi.status==="aborted"||no.status==="aborted")return m.INVALID;(Mi.status==="dirty"||no.status==="dirty")&&Ht.dirty(),Fi.set(Mi.value,no.value)}return{status:Ht.value,value:Fi}})}else{const Fi=new Map;for(const oo of Gi){const Mi=oo.key,no=oo.value;if(Mi.status==="aborted"||no.status==="aborted")return m.INVALID;(Mi.status==="dirty"||no.status==="dirty")&&Ht.dirty(),Fi.set(Mi.value,no.value)}return{status:Ht.value,value:Fi}}}}t.ZodMap=xe,xe.create=(ln,st,Ht)=>new xe({valueType:st,keyType:ln,typeName:St.ZodMap,...h(Ht)});class Te extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.parsedType!==_.ZodParsedType.set)return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.set,received:on.parsedType}),m.INVALID;const xn=this._def;xn.minSize!==null&&on.data.size<xn.minSize.value&&((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_small,minimum:xn.minSize.value,type:"set",inclusive:!0,exact:!1,message:xn.minSize.message}),Ht.dirty()),xn.maxSize!==null&&on.data.size>xn.maxSize.value&&((0,m.addIssueToContext)(on,{code:s.ZodIssueCode.too_big,maximum:xn.maxSize.value,type:"set",inclusive:!0,exact:!1,message:xn.maxSize.message}),Ht.dirty());const Zn=this._def.valueType;function Gi(oo){const Mi=new Set;for(const no of oo){if(no.status==="aborted")return m.INVALID;no.status==="dirty"&&Ht.dirty(),Mi.add(no.value)}return{status:Ht.value,value:Mi}}const Fi=[...on.data.values()].map((oo,Mi)=>Zn._parse(new f(on,oo,on.path,Mi)));return on.common.async?Promise.all(Fi).then(oo=>Gi(oo)):Gi(Fi)}min(st,Ht){return new Te({...this._def,minSize:{value:st,message:v.errorUtil.toString(Ht)}})}max(st,Ht){return new Te({...this._def,maxSize:{value:st,message:v.errorUtil.toString(Ht)}})}size(st,Ht){return this.min(st,Ht).max(st,Ht)}nonempty(st){return this.min(1,st)}}t.ZodSet=Te,Te.create=(ln,st)=>new Te({valueType:ln,minSize:null,maxSize:null,typeName:St.ZodSet,...h(st)});class Fe extends u{constructor(){super(...arguments),this.validate=this.implement}_parse(st){const{ctx:Ht}=this._processInputParams(st);if(Ht.parsedType!==_.ZodParsedType.function)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.function,received:Ht.parsedType}),m.INVALID;function on(Fi,oo){return(0,m.makeIssue)({data:Fi,path:Ht.path,errorMaps:[Ht.common.contextualErrorMap,Ht.schemaErrorMap,(0,p.getErrorMap)(),p.defaultErrorMap].filter(Mi=>!!Mi),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:oo}})}function xn(Fi,oo){return(0,m.makeIssue)({data:Fi,path:Ht.path,errorMaps:[Ht.common.contextualErrorMap,Ht.schemaErrorMap,(0,p.getErrorMap)(),p.defaultErrorMap].filter(Mi=>!!Mi),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:oo}})}const Zn={errorMap:Ht.common.contextualErrorMap},Gi=Ht.data;if(this._def.returns instanceof Ue){const Fi=this;return(0,m.OK)(async function(...oo){const Mi=new s.ZodError([]),no=await Fi._def.args.parseAsync(oo,Zn).catch(jo=>{throw Mi.addIssue(on(oo,jo)),Mi}),uo=await Reflect.apply(Gi,this,no);return await Fi._def.returns._def.type.parseAsync(uo,Zn).catch(jo=>{throw Mi.addIssue(xn(uo,jo)),Mi})})}else{const Fi=this;return(0,m.OK)(function(...oo){const Mi=Fi._def.args.safeParse(oo,Zn);if(!Mi.success)throw new s.ZodError([on(oo,Mi.error)]);const no=Reflect.apply(Gi,this,Mi.data),uo=Fi._def.returns.safeParse(no,Zn);if(!uo.success)throw new s.ZodError([xn(no,uo.error)]);return uo.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...st){return new Fe({...this._def,args:Ce.create(st).rest(he.create())})}returns(st){return new Fe({...this._def,returns:st})}implement(st){return this.parse(st)}strictImplement(st){return this.parse(st)}static create(st,Ht,on){return new Fe({args:st||Ce.create([]).rest(he.create()),returns:Ht||he.create(),typeName:St.ZodFunction,...h(on)})}}t.ZodFunction=Fe;class pe extends u{get schema(){return this._def.getter()}_parse(st){const{ctx:Ht}=this._processInputParams(st);return this._def.getter()._parse({data:Ht.data,path:Ht.path,parent:Ht})}}t.ZodLazy=pe,pe.create=(ln,st)=>new pe({getter:ln,typeName:St.ZodLazy,...h(st)});class re extends u{_parse(st){if(st.data!==this._def.value){const Ht=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(Ht,{received:Ht.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),m.INVALID}return{status:"valid",value:st.data}}get value(){return this._def.value}}t.ZodLiteral=re,re.create=(ln,st)=>new re({value:ln,typeName:St.ZodLiteral,...h(st)});function ue(ln,st){return new Re({values:ln,typeName:St.ZodEnum,...h(st)})}class Re extends u{constructor(){super(...arguments),o.set(this,void 0)}_parse(st){if(typeof st.data!="string"){const Ht=this._getOrReturnCtx(st),on=this._def.values;return(0,m.addIssueToContext)(Ht,{expected:_.util.joinValues(on),received:Ht.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,o,"f")||r(this,o,new Set(this._def.values),"f"),!n(this,o,"f").has(st.data)){const Ht=this._getOrReturnCtx(st),on=this._def.values;return(0,m.addIssueToContext)(Ht,{received:Ht.data,code:s.ZodIssueCode.invalid_enum_value,options:on}),m.INVALID}return(0,m.OK)(st.data)}get options(){return this._def.values}get enum(){const st={};for(const Ht of this._def.values)st[Ht]=Ht;return st}get Values(){const st={};for(const Ht of this._def.values)st[Ht]=Ht;return st}get Enum(){const st={};for(const Ht of this._def.values)st[Ht]=Ht;return st}extract(st,Ht=this._def){return Re.create(st,{...this._def,...Ht})}exclude(st,Ht=this._def){return Re.create(this.options.filter(on=>!st.includes(on)),{...this._def,...Ht})}}t.ZodEnum=Re,o=new WeakMap,Re.create=ue;class Ae extends u{constructor(){super(...arguments),l.set(this,void 0)}_parse(st){const Ht=_.util.getValidEnumValues(this._def.values),on=this._getOrReturnCtx(st);if(on.parsedType!==_.ZodParsedType.string&&on.parsedType!==_.ZodParsedType.number){const xn=_.util.objectValues(Ht);return(0,m.addIssueToContext)(on,{expected:_.util.joinValues(xn),received:on.parsedType,code:s.ZodIssueCode.invalid_type}),m.INVALID}if(n(this,l,"f")||r(this,l,new Set(_.util.getValidEnumValues(this._def.values)),"f"),!n(this,l,"f").has(st.data)){const xn=_.util.objectValues(Ht);return(0,m.addIssueToContext)(on,{received:on.data,code:s.ZodIssueCode.invalid_enum_value,options:xn}),m.INVALID}return(0,m.OK)(st.data)}get enum(){return this._def.values}}t.ZodNativeEnum=Ae,l=new WeakMap,Ae.create=(ln,st)=>new Ae({values:ln,typeName:St.ZodNativeEnum,...h(st)});class Ue extends u{unwrap(){return this._def.type}_parse(st){const{ctx:Ht}=this._processInputParams(st);if(Ht.parsedType!==_.ZodParsedType.promise&&Ht.common.async===!1)return(0,m.addIssueToContext)(Ht,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.promise,received:Ht.parsedType}),m.INVALID;const on=Ht.parsedType===_.ZodParsedType.promise?Ht.data:Promise.resolve(Ht.data);return(0,m.OK)(on.then(xn=>this._def.type.parseAsync(xn,{path:Ht.path,errorMap:Ht.common.contextualErrorMap})))}}t.ZodPromise=Ue,Ue.create=(ln,st)=>new Ue({type:ln,typeName:St.ZodPromise,...h(st)});class $e extends u{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===St.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st),xn=this._def.effect||null,Zn={addIssue:Gi=>{(0,m.addIssueToContext)(on,Gi),Gi.fatal?Ht.abort():Ht.dirty()},get path(){return on.path}};if(Zn.addIssue=Zn.addIssue.bind(Zn),xn.type==="preprocess"){const Gi=xn.transform(on.data,Zn);if(on.common.async)return Promise.resolve(Gi).then(async Fi=>{if(Ht.value==="aborted")return m.INVALID;const oo=await this._def.schema._parseAsync({data:Fi,path:on.path,parent:on});return oo.status==="aborted"?m.INVALID:oo.status==="dirty"||Ht.value==="dirty"?(0,m.DIRTY)(oo.value):oo});{if(Ht.value==="aborted")return m.INVALID;const Fi=this._def.schema._parseSync({data:Gi,path:on.path,parent:on});return Fi.status==="aborted"?m.INVALID:Fi.status==="dirty"||Ht.value==="dirty"?(0,m.DIRTY)(Fi.value):Fi}}if(xn.type==="refinement"){const Gi=Fi=>{const oo=xn.refinement(Fi,Zn);if(on.common.async)return Promise.resolve(oo);if(oo instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return Fi};if(on.common.async===!1){const Fi=this._def.schema._parseSync({data:on.data,path:on.path,parent:on});return Fi.status==="aborted"?m.INVALID:(Fi.status==="dirty"&&Ht.dirty(),Gi(Fi.value),{status:Ht.value,value:Fi.value})}else return this._def.schema._parseAsync({data:on.data,path:on.path,parent:on}).then(Fi=>Fi.status==="aborted"?m.INVALID:(Fi.status==="dirty"&&Ht.dirty(),Gi(Fi.value).then(()=>({status:Ht.value,value:Fi.value}))))}if(xn.type==="transform")if(on.common.async===!1){const Gi=this._def.schema._parseSync({data:on.data,path:on.path,parent:on});if(!(0,m.isValid)(Gi))return Gi;const Fi=xn.transform(Gi.value,Zn);if(Fi instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Ht.value,value:Fi}}else return this._def.schema._parseAsync({data:on.data,path:on.path,parent:on}).then(Gi=>(0,m.isValid)(Gi)?Promise.resolve(xn.transform(Gi.value,Zn)).then(Fi=>({status:Ht.value,value:Fi})):Gi);_.util.assertNever(xn)}}t.ZodEffects=$e,t.ZodTransformer=$e,$e.create=(ln,st,Ht)=>new $e({schema:ln,typeName:St.ZodEffects,effect:st,...h(Ht)}),$e.createWithPreprocess=(ln,st,Ht)=>new $e({schema:st,effect:{type:"preprocess",transform:ln},typeName:St.ZodEffects,...h(Ht)});class Ve extends u{_parse(st){return this._getType(st)===_.ZodParsedType.undefined?(0,m.OK)(void 0):this._def.innerType._parse(st)}unwrap(){return this._def.innerType}}t.ZodOptional=Ve,Ve.create=(ln,st)=>new Ve({innerType:ln,typeName:St.ZodOptional,...h(st)});class at extends u{_parse(st){return this._getType(st)===_.ZodParsedType.null?(0,m.OK)(null):this._def.innerType._parse(st)}unwrap(){return this._def.innerType}}t.ZodNullable=at,at.create=(ln,st)=>new at({innerType:ln,typeName:St.ZodNullable,...h(st)});class qe extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st);let on=Ht.data;return Ht.parsedType===_.ZodParsedType.undefined&&(on=this._def.defaultValue()),this._def.innerType._parse({data:on,path:Ht.path,parent:Ht})}removeDefault(){return this._def.innerType}}t.ZodDefault=qe,qe.create=(ln,st)=>new qe({innerType:ln,typeName:St.ZodDefault,defaultValue:typeof st.default=="function"?st.default:()=>st.default,...h(st)});class Ot extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st),on={...Ht,common:{...Ht.common,issues:[]}},xn=this._def.innerType._parse({data:on.data,path:on.path,parent:{...on}});return(0,m.isAsync)(xn)?xn.then(Zn=>({status:"valid",value:Zn.status==="valid"?Zn.value:this._def.catchValue({get error(){return new s.ZodError(on.common.issues)},input:on.data})})):{status:"valid",value:xn.status==="valid"?xn.value:this._def.catchValue({get error(){return new s.ZodError(on.common.issues)},input:on.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=Ot,Ot.create=(ln,st)=>new Ot({innerType:ln,typeName:St.ZodCatch,catchValue:typeof st.catch=="function"?st.catch:()=>st.catch,...h(st)});class it extends u{_parse(st){if(this._getType(st)!==_.ZodParsedType.nan){const on=this._getOrReturnCtx(st);return(0,m.addIssueToContext)(on,{code:s.ZodIssueCode.invalid_type,expected:_.ZodParsedType.nan,received:on.parsedType}),m.INVALID}return{status:"valid",value:st.data}}}t.ZodNaN=it,it.create=ln=>new it({typeName:St.ZodNaN,...h(ln)}),t.BRAND=Symbol("zod_brand");class yt extends u{_parse(st){const{ctx:Ht}=this._processInputParams(st),on=Ht.data;return this._def.type._parse({data:on,path:Ht.path,parent:Ht})}unwrap(){return this._def.type}}t.ZodBranded=yt;class tt extends u{_parse(st){const{status:Ht,ctx:on}=this._processInputParams(st);if(on.common.async)return(async()=>{const Zn=await this._def.in._parseAsync({data:on.data,path:on.path,parent:on});return Zn.status==="aborted"?m.INVALID:Zn.status==="dirty"?(Ht.dirty(),(0,m.DIRTY)(Zn.value)):this._def.out._parseAsync({data:Zn.value,path:on.path,parent:on})})();{const xn=this._def.in._parseSync({data:on.data,path:on.path,parent:on});return xn.status==="aborted"?m.INVALID:xn.status==="dirty"?(Ht.dirty(),{status:"dirty",value:xn.value}):this._def.out._parseSync({data:xn.value,path:on.path,parent:on})}}static create(st,Ht){return new tt({in:st,out:Ht,typeName:St.ZodPipeline})}}t.ZodPipeline=tt;class dt extends u{_parse(st){const Ht=this._def.innerType._parse(st),on=xn=>((0,m.isValid)(xn)&&(xn.value=Object.freeze(xn.value)),xn);return(0,m.isAsync)(Ht)?Ht.then(xn=>on(xn)):on(Ht)}unwrap(){return this._def.innerType}}t.ZodReadonly=dt,dt.create=(ln,st)=>new dt({innerType:ln,typeName:St.ZodReadonly,...h(st)});function ut(ln,st={},Ht){return ln?ne.create().superRefine((on,xn)=>{var Zn,Gi;if(!ln(on)){const Fi=typeof st=="function"?st(on):typeof st=="string"?{message:st}:st,oo=(Gi=(Zn=Fi.fatal)!==null&&Zn!==void 0?Zn:Ht)!==null&&Gi!==void 0?Gi:!0,Mi=typeof Fi=="string"?{message:Fi}:Fi;xn.addIssue({code:"custom",...Mi,fatal:oo})}}):ne.create()}t.custom=ut,t.late={object:ie.lazycreate};var St;(function(ln){ln.ZodString="ZodString",ln.ZodNumber="ZodNumber",ln.ZodNaN="ZodNaN",ln.ZodBigInt="ZodBigInt",ln.ZodBoolean="ZodBoolean",ln.ZodDate="ZodDate",ln.ZodSymbol="ZodSymbol",ln.ZodUndefined="ZodUndefined",ln.ZodNull="ZodNull",ln.ZodAny="ZodAny",ln.ZodUnknown="ZodUnknown",ln.ZodNever="ZodNever",ln.ZodVoid="ZodVoid",ln.ZodArray="ZodArray",ln.ZodObject="ZodObject",ln.ZodUnion="ZodUnion",ln.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ln.ZodIntersection="ZodIntersection",ln.ZodTuple="ZodTuple",ln.ZodRecord="ZodRecord",ln.ZodMap="ZodMap",ln.ZodSet="ZodSet",ln.ZodFunction="ZodFunction",ln.ZodLazy="ZodLazy",ln.ZodLiteral="ZodLiteral",ln.ZodEnum="ZodEnum",ln.ZodEffects="ZodEffects",ln.ZodNativeEnum="ZodNativeEnum",ln.ZodOptional="ZodOptional",ln.ZodNullable="ZodNullable",ln.ZodDefault="ZodDefault",ln.ZodCatch="ZodCatch",ln.ZodPromise="ZodPromise",ln.ZodBranded="ZodBranded",ln.ZodPipeline="ZodPipeline",ln.ZodReadonly="ZodReadonly"})(St||(t.ZodFirstPartyTypeKind=St={}));class Vt{constructor(...st){}}const Cn=(ln,st={message:`Input not instance of ${ln.name}`})=>ut(Ht=>Ht instanceof ln,st);t.instanceof=Cn;const Kn=V.create;t.string=Kn;const bi=Y.create;t.number=bi;const Un=it.create;t.nan=Un;const hn=G.create;t.bigint=hn;const Xn=H.create;t.boolean=Xn;const _n=K.create;t.date=_n;const $t=Z.create;t.symbol=$t;const vt=Q.create;t.undefined=vt;const ze=oe.create;t.null=ze;const Je=ne.create;t.any=Je;const Dt=he.create;t.unknown=Dt;const On=_e.create;t.never=On;const ni=q.create;t.void=ni;const Li=Ie.create;t.array=Li;const Wi=ie.create;t.object=Wi;const ao=ie.strictCreate;t.strictObject=ao;const qi=fe.create;t.union=qi;const fo=Le.create;t.discriminatedUnion=fo;const ci=Se.create;t.intersection=ci;const Gn=Ce.create;t.tuple=Gn;const Di=ge.create;t.record=Di;const zi=xe.create;t.map=zi;const to=Te.create;t.set=to;const Ki=Fe.create;t.function=Ki;const yn=pe.create;t.lazy=yn;const si=re.create;t.literal=si;const Ln=Re.create;t.enum=Ln;const lt=Ae.create;t.nativeEnum=lt;const xt=Ue.create;t.promise=xt;const Tt=$e.create;t.effect=Tt,t.transformer=Tt;const At=Ve.create;t.optional=At;const Sn=at.create;t.nullable=Sn;const fn=$e.createWithPreprocess;t.preprocess=fn;const an=tt.create;t.pipeline=an;const Hn=()=>Kn().optional();t.ostring=Hn;const hi=()=>bi().optional();t.onumber=hi;const Ei=()=>Xn().optional();t.oboolean=Ei,t.coerce={string:ln=>V.create({...ln,coerce:!0}),number:ln=>Y.create({...ln,coerce:!0}),boolean:ln=>H.create({...ln,coerce:!0}),bigint:ln=>G.create({...ln,coerce:!0}),date:ln=>K.create({...ln,coerce:!0})},t.NEVER=m.INVALID},79682:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ChromeDevtoolsContribution=void 0;const r=e(85608),o=e(76003),l=e(41869),p=e(65265),v=e(98295),m=e(27654);let _=n=class extends l.Disposable{constructor(){super(...arguments),this.lantencyHandler=f=>{const{command:a}=f.detail;a===p.DevtoolsLantencyCommand.Start?this.interval||this.startRTTInterval():a===p.DevtoolsLantencyCommand.Stop&&this.interval&&(clearInterval(this.interval),this.interval=void 0)}}initialize(){var f;this.appConfig.devtools&&(window.addEventListener(p.EDevtoolsEvent.Latency,this.lantencyHandler),this.addDispose(l.Disposable.create(()=>{window.removeEventListener(p.EDevtoolsEvent.Latency,this.lantencyHandler),this.interval&&(clearInterval(this.interval),this.interval=void 0)})),!((f=window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__)===null||f===void 0)&&f.captureRPC&&(this.interval||this.startRTTInterval()))}startRTTInterval(){this.interval=setInterval(async()=>{const f=Date.now();await this.rttService.measure();const a=Date.now()-f;window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.captureRPC&&(window.__OPENSUMI_DEVTOOLS_GLOBAL_HOOK__.latency=a)},n.INTERVAL)}};t.ChromeDevtoolsContribution=_,_.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.AppConfig),r.__metadata("design:type",Object)],_.prototype,"appConfig",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],_.prototype,"rttService",void 0),t.ChromeDevtoolsContribution=_=n=r.__decorate([(0,v.Domain)(l.ClientAppContribution)],_)},72915:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTContribution=void 0;const r=e(85608),o=e(76003),l=e(26542),p=e(92323),v=e(98295),m=e(27654),_={id:"connection.start.rtt",label:"%connection.start.rtt%",category:"%command.category.developerTools%"},s={id:"connection.stop.rtt",label:"%connection.stop.rtt%",category:"%command.category.developerTools%"},f={alignment:l.StatusBarAlignment.LEFT,priority:1/0-1};let a=n=class{registerCommands(u){u.registerCommand(_,{execute:()=>{this.interval||this.startRTTInterval()}}),u.registerCommand(s,{execute:()=>{this.interval&&(clearInterval(this.interval),this.statusBar&&(this.statusBar.dispose(),this.statusBar=void 0))}})}startRTTInterval(){this.interval=setInterval(async()=>{const u=Date.now();await this.rttService.measure();const E={text:`${Date.now()-u}ms`};if(this.statusBar)this.statusBar.update({...E,...f});else{const g=this.statusBarService.addElement("connection-rtt",{...E,...f});this.statusBar=g}},n.INTERVAL)}};t.ConnectionRTTContribution=a,a.INTERVAL=1e3,r.__decorate([(0,o.Autowired)(l.IStatusBarService),r.__metadata("design:type",Object)],a.prototype,"statusBarService",void 0),r.__decorate([(0,o.Autowired)(m.ConnectionRTTBrowserServiceToken),r.__metadata("design:type",m.ConnectionRTTBrowserService)],a.prototype,"rttService",void 0),t.ConnectionRTTContribution=a=n=r.__decorate([(0,v.Domain)(p.CommandContribution)],a)},27654:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionRTTBrowserService=t.ConnectionRTTBrowserServiceToken=void 0;const n=e(85608),r=e(76003),o=e(69452);t.ConnectionRTTBrowserServiceToken=Symbol("ConnectionRTTBrowserService");let l=class{async measure(){await this.connectionBackService.$measure()}};t.ConnectionRTTBrowserService=l,n.__decorate([(0,r.Autowired)(o.ConnectionBackServicePath),n.__metadata("design:type",Object)],l.prototype,"connectionBackService",void 0),t.ConnectionRTTBrowserService=l=n.__decorate([(0,r.Injectable)()],l)},17631:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),p=e(69452);let v=class extends l.WithEventBus{onDidDropFile(_){this.dropService.onDidDropFile(_)}};t.FileDropContribution=v,n.__decorate([(0,r.Autowired)(p.IFileDropFrontendServiceToken),n.__metadata("design:type",Object)],v.prototype,"dropService",void 0),n.__decorate([(0,l.OnEvent)(l.FileTreeDropEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[l.FileTreeDropEvent]),n.__metadata("design:returntype",void 0)],v.prototype,"onDidDropFile",null),t.FileDropContribution=v=n.__decorate([(0,r.Injectable)(),(0,o.Domain)(o.ClientAppContribution)],v)},22874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDropService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),p=e(43718),v=e(42933),{Path:m}=p.path,_=e(69452);let s=class extends p.WithEventBus{constructor(){super(...arguments),this.pending=new Set}onDidUploadFileStart(a){this.pending.add(a),this.createOrUpdateStatusBar()}onDidUploadFileEnd(a){this.pending.delete(a),this.createOrUpdateStatusBar()}createOrUpdateStatusBar(a){if(this.pending.size===0){this.uploadStatus&&(this.uploadStatus.dispose(),this.uploadStatus=void 0);return}const h="sumi-upload-file-status",u=(0,o.formatLocalize)("workbench.uploadingFiles",this.pending.size,a||"0 MB"),d={text:u,alignment:l.StatusBarAlignment.RIGHT,tooltip:u,iconClass:"kaitian-icon kticon-cloud-server"};this.uploadStatus?this.uploadStatus.update({id:h,...d}):this.uploadStatus=this.statusBarService.addElement(h,d)}onDidDropFile(a){var h;const{payload:{event:u,targetDir:d}}=a;if(!d||!(!((h=u.dataTransfer)===null||h===void 0)&&h.files)||u.dataTransfer.files.length===0)return;const E=u.dataTransfer.items;let g=0;const c=Date.now(),y=b=>{g+=b;const S=Date.now(),w=`${(g/((S-c)/1e3)/1024/1024).toFixed(2)} MB`;this.createOrUpdateStatusBar(w)};for(const b of E){const S=b.webkitGetAsEntry();this.processFilesEntry(d,S,y)}}async processFilesEntry(a,h,u){if(h.isFile)this.processFileEntry(h,a,u);else{const d=p.Uri.file(new m(a).join(h.fullPath).toString()).toString();await this.fs.createFolder(d),this.processDirEntry(h,a,u)}}toBinaryString(a){let h;const u=a.length;let d="";for(h=0;h<u;h+=1)d+=String.fromCharCode(a[h]);return d}async doUploadFile(a,h,u){var d;const E=new m(h).join(a.name).toString();this.onDidUploadFileStart(E.toString()),await this.fs.createFile(p.Uri.file(E.toString()).toString()),await this.dropService.$ensureFileExist(a.name,h);const g=a.stream().getReader();let c=await g.read();for(;!c.done;)await this.dropService.$writeStream(this.toBinaryString(c.value),a.name,h,c.done),u((d=c.value)===null||d===void 0?void 0:d.byteLength),c=await g.read();c.done&&this.onDidUploadFileEnd(E.toString())}processFileEntry(a,h,u){a.file(d=>{const E=new File([d],a.fullPath,{type:a.type});this.doUploadFile(E,h,u)},()=>{})}processDirEntry(a,h,u){a.createReader().readEntries(E=>{E.forEach(async g=>{this.processFilesEntry(h,g,u)})},()=>{})}};t.FileDropService=s,n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fs",void 0),n.__decorate([(0,r.Autowired)(_.FileDropServicePath),n.__metadata("design:type",Object)],s.prototype,"dropService",void 0),n.__decorate([(0,r.Autowired)(l.IStatusBarService),n.__metadata("design:type",Object)],s.prototype,"statusBarService",void 0),t.FileDropService=s=n.__decorate([(0,r.Injectable)()],s)},79240:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSearchContribution=t.FileSearchQuickCommandHandler=t.matchLineReg=t.quickGoToSymbol=t.quickFileOpen=void 0,t.getValidateInput=y;const n=e(85608),r=n.__importDefault(e(39050)),o=e(76003),l=e(41869),p=e(26542),v=e(43718),m=e(98295),_=e(54414),s=e(17459),f=e(84660),a=n.__importStar(e(20868)),h=e(97821),u=e(80490),d=e(51500),E=e(30981),g=200;t.quickFileOpen={id:"workbench.action.quickOpen",category:"File",label:"Open File..."},t.quickGoToSymbol={id:"workbench.action.gotoSymbol",category:"File",label:"Open File Symbol..."},t.matchLineReg=/^([^:#(]*)[:#(]?L?(\d+)?[:,]?(\d+)?\)?/;function c(T=""){const D=T.match(t.matchLineReg)||[];if(D.length<2)return;const I={line:Number(D[2]||0),start:Number(D[3]||0)};return new a.Range(I.line,I.start,I.line,I.start)}function y(T){return T.replace(t.matchLineReg,"$1")}let b=class extends h.QuickOpenBaseAction{constructor(){super({id:"file-search:splitToRight",tooltip:(0,l.localize)("quickOpen.openOnTheRightSide"),class:(0,l.getIcon)("embed")})}async run(D){await this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,D.getUri(),{preview:!1,split:_.EditorGroupSplitAction.Right,range:c(this.injector.get(A).currentLookFor),focus:!0})}};n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],b.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],b.prototype,"injector",void 0),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b);let S=class{hasActions(){return!0}getActions(){return[this.fileSearchActionLeftRight]}getValidateInput(D){return y(D)}};n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",b)],S.prototype,"fileSearchActionLeftRight",void 0),S=n.__decorate([(0,o.Injectable)()],S);let A=class{constructor(){this.cancelIndicator=new v.CancellationTokenSource,this.default=!0,this.prefix="...",this.description=(0,l.localize)("file-search.command.fileOpen.description"),this.prevEditorState={},this.currentLookFor=""}getModel(){return{onType:async(D,I)=>{this.cancelIndicator.cancel(),this.cancelIndicator=new v.CancellationTokenSource;const R=this.cancelIndicator.token,M=new Set;let O=[];D=D.trim().replace(/\s/g,""),this.currentLookFor=D;const P=y(D),k=this.reporterService.time(v.REPORT_NAME.QUICK_OPEN_MEASURE),F=await this.getRecentlyItems(M,P,R);if(D&&(this.logger.debug("lookFor",D,P),O=await this.getFindOutItems(M,P,R)),R.isCancellationRequested)return;const L=F.concat(O);I(L,L.length?this.fileSearchActionProvider:void 0),k.timeEnd(D.indexOf("@")>-1?"file-symbol":"file",{lookFor:D,stat:{recently:F.length,find:O.length}})}}}getOptions(){return{placeholder:(0,l.localize)("file-search.command.fileOpen.placeholder"),fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},showItemsWithoutHighlight:!0,fuzzyMatchDescription:{enableSeparateSubstringMatching:!0},getPlaceholderItem:D=>new l.QuickOpenItem({label:(0,l.localize)(D.indexOf("@")>-1?"search.fileSymbolResults.notfound":"search.fileResults.notfound"),run:()=>!1})}}onClose(D){D&&this.prevEditorState.uri&&(this.workbenchEditorService.open(this.prevEditorState.uri,{range:this.prevEditorState.range}),this.prevEditorState={}),this.prevSelected=void 0,this.cancelIndicator.cancel()}onToggle(){this.cancelIndicator.cancel()}trySaveEditorState(){var D;if(this.workbenchEditorService.currentResource){let I={startColumn:1,startLineNumber:1,endColumn:1,endLineNumber:1};const R=(D=this.workbenchEditorService.currentEditor)===null||D===void 0?void 0:D.getSelections();if(R){const{selectionStartLineNumber:M,selectionStartColumn:O,positionLineNumber:P,positionColumn:k}=R[0];I=new a.Range(M,O,P,k)}this.prevEditorState={uri:this.workbenchEditorService.currentResource.uri,range:I}}}async getFindOutItems(D,I,R){var M;let O;if(I.indexOf("@")>-1){this.trySaveEditorState(),O=[];const[P,k]=I.split("@");let F;if(this.prevSelected)F=this.prevSelected.withoutFragment();else if(P){const L=await this.getQueryFiles(P,D,R);L.length&&(F=L[0].getUri())}else F=(M=this.workbenchEditorService.currentResource)===null||M===void 0?void 0:M.uri;if(F){const L=await this.documentSymbolStore.getDocumentSymbolAsync(F)||[],B=[];this.flattenSymbols({children:L},B),O=B.filter(W=>{const U=(0,E.matchesFuzzy)(k,W.name,!0)||[];return U&&(W.labelHighlights=U),U&&U.length}).map((W,U)=>{var X;return new l.QuickOpenItem({uri:F,label:W.name,iconClass:(0,l.getSymbolIcon)(W.kind),description:(X=W.parent)===null||X===void 0?void 0:X.name,labelHighlights:W.labelHighlights,groupLabel:U===0?(0,l.formatLocalize)("search.fileSymbolResults",B.length):"",showBorder:!1,run:V=>V===l.Mode.PREVIEW?(this.locateSymbol(F,W),!0):V===l.Mode.OPEN?(this.locateSymbol(F,W),!0):!1})})}else return[]}else if(O=await this.getQueryFiles(I,D,R),O[0]){const P=await this.getItems([O[0].getUri().codeUri.fsPath],{groupLabel:(0,l.localize)("search.fileResults"),showBorder:!0});O[0]=P[0]}return O}async getQueryFiles(D,I,R){const O=(await this.workspaceService.roots).map(F=>new l.URI(F.uri).codeUri.fsPath),P=await this.fileSearchService.find(D,{rootUris:O,fuzzyMatch:!0,limit:g,useGitIgnore:!0,noIgnoreParent:!0,excludePatterns:this.getPreferenceSearchExcludes()},R),k=await this.getItems(P.filter(F=>I.has(F)||R.isCancellationRequested?!1:(I.add(F),!0)),{});return k.sort(this.compareItems.bind(this)),k}async flattenSymbols(D,I){D.children.forEach(R=>{I.push(R),R.children&&this.flattenSymbols(R,I)})}async getRecentlyItems(D,I,R){const M=await this.recentFilesManager.getMostRecentlyOpenedFiles(!0)||[];return await this.getItems(M.filter(O=>{const P=new l.URI(O);return D.has(O)||!r.default.test(I,P.displayName)||R.isCancellationRequested?!1:(D.add(O),!0)}),{groupLabel:(0,l.localize)("search.historyMatches")})}async getItems(D,I){const R=[];for(const[M,O]of D.entries()){const P=l.URI.isUriString(O)?new l.URI(O):l.URI.file(O),k=`file-icon ${this.labelService.getIcon(P.withoutFragment())}`;let F="";const L=await this.workspaceService.asRelativePath(P.parent);L&&(this.workspaceService.isMultiRootWorkspaceOpened?F=`${new l.URI(L.root).displayName}${L.path?` \u30FB ${L.path}`:""}`:F=L.path||"");const B=new l.QuickOpenItem({uri:P,label:P.displayName,tooltip:O,iconClass:k,description:F,groupLabel:M===0?I.groupLabel:"",showBorder:D.length>0&&M===0?I.showBorder:!1,run:j=>(j===l.Mode.PREVIEW&&(this.prevSelected=P),j===l.Mode.OPEN?(this.openFile(P),!0):!1)});R.push(B)}return R}openFile(D){const I=D.codeUri.fsPath;let R=c(this.currentLookFor);(!R||!R.startLineNumber&&!R.startColumn)&&(R=c(D.fragment?"#"+D.fragment:I)),this.currentLookFor="",this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,D.withoutFragment(),{preview:!1,range:R,focus:!0})}locateSymbol(D,I){this.workbenchEditorService.open(D,{range:I.range,preview:!0})}compareItems(D,I,R="getLabel"){function M(j){return j.trim().toLowerCase()}const O=M(y(this.currentLookFor));function P(j){const W=r.default.match(O,j);return W===null?0:W.score}let k=D[R](),F=I[R]();typeof k!="string"&&(k=k.path.toString()),typeof F!="string"&&(F=F.path.toString()),k=M(k),F=M(F);const L=P(k),B=P(F);if(L===B){const j=k.indexOf(O),W=F.indexOf(O);return j===W?k.length!==F.length?k.length<F.length?-1:1:F.localeCompare(k)===0?R==="getUri"?0:this.compareItems(D,I,"getUri"):F.localeCompare(k):j-W}return B-L}getPreferenceSearchExcludes(){const D=[],I=this.preferenceService.get("files.exclude"),R=this.preferenceService.get("search.exclude"),M=Object.assign({},I,R);for(const O of Object.keys(M))M[O]&&D.push(O);return D}};t.FileSearchQuickCommandHandler=A,n.__decorate([(0,o.Autowired)(l.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(f.FileSearchServicePath),n.__metadata("design:type",Object)],A.prototype,"fileSearchService",void 0),n.__decorate([(0,o.Autowired)(_.WorkbenchEditorService),n.__metadata("design:type",_.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(s.DocumentSymbolStore),n.__metadata("design:type",s.DocumentSymbolStore)],A.prototype,"documentSymbolStore",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",p.LabelService)],A.prototype,"labelService",void 0),n.__decorate([(0,o.Autowired)(d.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(l.RecentFilesManager),n.__metadata("design:type",l.RecentFilesManager)],A.prototype,"recentFilesManager",void 0),n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],A.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",S)],A.prototype,"fileSearchActionProvider",void 0),n.__decorate([(0,o.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(v.IReporterService),n.__metadata("design:type",Object)],A.prototype,"reporterService",void 0),t.FileSearchQuickCommandHandler=A=n.__decorate([(0,o.Injectable)()],A);let w=class{registerQuickOpenHandlers(D){D.registerHandler(this.fileSearchQuickCommandHandler,{title:(0,l.localize)("quickopen.tab.file"),commandId:t.quickFileOpen.id,order:1})}registerCommands(D){D.registerCommand(t.quickFileOpen,{execute:()=>this.quickOpenService.open("...")}),D.registerCommand(t.quickGoToSymbol,{execute:()=>this.quickOpenService.open("...@")})}registerKeybindings(D){D.registerKeybinding({command:t.quickFileOpen.id,keybinding:"ctrlcmd+p"})}};t.FileSearchContribution=w,n.__decorate([(0,o.Autowired)(A),n.__metadata("design:type",A)],w.prototype,"fileSearchQuickCommandHandler",void 0),n.__decorate([(0,o.Autowired)(h.PrefixQuickOpenService),n.__metadata("design:type",Object)],w.prototype,"quickOpenService",void 0),t.FileSearchContribution=w=n.__decorate([(0,m.Domain)(v.CommandContribution,l.KeybindingContribution,u.QuickOpenContribution)],w)},73827:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientAddonModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(69452),p=e(79682),v=e(72915),m=e(27654),_=e(17631),s=e(22874),f=e(79240),a=e(18256),h=e(7756),u=e(16426);let d=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[p.ChromeDevtoolsContribution,a.LanguageChangeHintContribution,f.FileSearchContribution,h.StatusBarContribution,u.ToolbarCustomizeContribution,_.FileDropContribution,v.ConnectionRTTContribution,{token:l.IFileDropFrontendServiceToken,useClass:s.FileDropService},{token:m.ConnectionRTTBrowserServiceToken,useClass:m.ConnectionRTTBrowserService}],this.backServices=[{servicePath:l.FileDropServicePath},{servicePath:l.ConnectionBackServicePath}]}};t.ClientAddonModule=d,t.ClientAddonModule=d=n.__decorate([(0,r.Injectable)()],d)},18256:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageChangeHintContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(72665);let p=class{onStart(){this.preferenceService.onSpecificPreferenceChange(o.GeneralSettingsId.Language,async m=>{(0,o.setLanguageId)(m.newValue),this.preferenceService.get("general.askReloadOnLanguageChange")&&await this.dialogService.info((0,o.localize)("preference.general.language.change.refresh.info","After changing the language, it should be restarted to take effect. Will it be refreshed immediately?"),[(0,o.localize)("preference.general.language.change.refresh.later","Later"),(0,o.localize)("preference.general.language.change.refresh.now","Now")])===(0,o.localize)("preference.general.language.change.refresh.now","Now")&&this.clientApp.fireOnReload()})}};t.LanguageChangeHintContribution=p,n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],p.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.IClientApp),n.__metadata("design:type",Object)],p.prototype,"clientApp",void 0),n.__decorate([(0,r.Autowired)(l.IDialogService),n.__metadata("design:type",Object)],p.prototype,"dialogService",void 0),t.LanguageChangeHintContribution=p=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],p)},7756:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718);let p=class extends l.WithEventBus{onStart(){}handleBrowserConnectionOpen(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--statusBar-background)"),this.logger.log("Browser connection open, change status bar background color")}handleBrowserConnectionClose(){this.commandService.executeCommand("statusbar.changeBackgroundColor","var(--kt-statusbar-offline-background)"),this.logger.log("Browser connection close, change status bar background color")}};t.StatusBarContribution=p,n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],p.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],p.prototype,"logger",void 0),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionOpenEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"handleBrowserConnectionOpen",null),n.__decorate([(0,l.OnEvent)(l.BrowserConnectionCloseEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"handleBrowserConnectionClose",null),t.StatusBarContribution=p=n.__decorate([(0,l.Domain)(o.ClientAppContribution)],p)},16426:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),p=e(62132);let v=class{registerCommands(_){_.registerCommand({id:"toolbar.showCustomizePanel",label:"Show Toolbar Customization"},{execute:()=>{this.viewService.setVisible(!0)}})}registerComponent(_){_.register("addon/toolbar-customize",{id:"addon/toolbar-customize",component:p.ToolbarCustomizeComponent}),this.config.layoutConfig[o.SlotLocation.extra]||(this.config.layoutConfig[o.SlotLocation.extra]={modules:[]}),this.config.layoutConfig[o.SlotLocation.extra].modules.push("addon/toolbar-customize")}registerMenus(_){_.registerMenuItem(l.MenuId.KTToolbarLocationContext,{command:{id:"toolbar.showCustomizePanel",label:(0,o.localize)("toolbar.customize.menu")}})}};t.ToolbarCustomizeContribution=v,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],v.prototype,"config",void 0),n.__decorate([(0,r.Autowired)(p.ToolbarCustomizeViewService),n.__metadata("design:type",p.ToolbarCustomizeViewService)],v.prototype,"viewService",void 0),t.ToolbarCustomizeContribution=v=n.__decorate([(0,o.Domain)(o.CommandContribution,o.ComponentContribution,l.MenuContribution)],v)},62132:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolbarCustomizeComponent=t.ToolbarCustomizeViewService=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(97267),p=e(41869),v=n.__importDefault(e(18541));let m=class{bindSetVisibleHandle(f){this._setVisible=f}setVisible(f){this._setVisible(f)}async toggleActionVisibility(f,a,h){const u=this.preferenceService.getValid("toolbar.ignoreActions",{});if(u[f]||(u[f]=[]),!h)u[f].indexOf(a)===-1&&u[f].push(a);else{const E=u[f].indexOf(a);E!==-1&&u[f].splice(E,1)}const d=this.preferenceService.inspect("toolbar.ignoreActions").workspaceValue?p.PreferenceScope.Workspace:p.PreferenceScope.User;await this.preferenceService.set("toolbar.ignoreActions",u,d)}};t.ToolbarCustomizeViewService=m,n.__decorate([(0,o.Autowired)(p.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),t.ToolbarCustomizeViewService=m=n.__decorate([(0,o.Injectable)()],m);const _=()=>{const[s,f]=r.default.useState(!1),a=(0,p.useInjectable)(m),h=(0,p.useInjectable)(p.IToolbarRegistry),u=(0,p.useInjectable)(p.PreferenceService);if(a.bindSetVisibleHandle(f),!s)return null;const d=h.getAllLocations(),E=u.get("toolbar.ignoreActions")||{};let g=u.get("toolbar.buttonDisplay","iconAndText");function c(y){const b=[{id:"_head"},...h.getActionGroups(y)||[],{id:"_tail"}],S=[],A=E[y]||[];return b.forEach((w,T)=>{const D=h.getToolbarActions({location:y,group:w.id});D&&D.actions.length>0&&(S.length>0&&S.push(r.default.createElement("div",{className:v.default["group-split"],key:"split-"+T})),D.actions.forEach((I,R)=>{var M;let O=A.indexOf(I.id)===-1;const P="action-toggle-"+I.id;S.push(r.default.createElement("div",{className:v.default["action-item"],key:R+"_"+I.id},r.default.createElement(l.CheckBox,{onChange:()=>{a.toggleActionVisibility(y,I.id,!O),O=!O},defaultChecked:O,id:P,label:(M=I.description)!==null&&M!==void 0?M:I.id})))}))}),S.length===0?null:r.default.createElement("div",{key:y,className:v.default["toolbar-customize-location"]},S)}return r.default.createElement("div",{className:v.default["toolbar-customize-overlay"]},r.default.createElement("div",{className:v.default["toolbar-customize"]},d.map(y=>c(y)),r.default.createElement("div",{className:v.default["button-display"]},r.default.createElement("div",null,(0,p.localize)("toolbar-customize.buttonDisplay.description")),r.default.createElement(l.Select,{options:[{label:(0,p.localize)("toolbar-customize.buttonDisplay.icon"),value:"icon"},{label:(0,p.localize)("toolbar-customize.buttonDisplay.iconAndText"),value:"iconAndText"}],value:g,onChange:y=>{const b=u.inspect("toolbar.buttonDisplay").workspaceValue?p.PreferenceScope.Workspace:p.PreferenceScope.User;u.set("toolbar.buttonDisplay",y,b),g=y},className:v.default["button-display-select"]})),r.default.createElement("div",{className:v.default["customize-complete"]},r.default.createElement(l.Button,{type:"primary",onClick:()=>f(!1)},(0,p.localize)("toolbar-customize.complete")))))};t.ToolbarCustomizeComponent=_},69452:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IConnectionBackService=t.ConnectionBackServicePath=t.IFileDropFrontendServiceToken=t.IFileDropServiceToken=t.FileDropServicePath=void 0,t.FileDropServicePath="FileDropServicePath",t.IFileDropServiceToken=Symbol("IFileDropService"),t.IFileDropFrontendServiceToken=Symbol("IFileDropFrontendService"),t.ConnectionBackServicePath="ConnectionBackServicePath",t.IConnectionBackService=Symbol("IConnectionBackService")},77659:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(50394);let p=class{get contextKeyService(){return this._contextKeyService}constructor(m){this._contextKeyService=this.globalContextKeyService.createScoped(m),this.inlineChatIsVisible=l.InlineChatIsVisible.bind(this._contextKeyService),this.inlineCompletionIsTrigger=l.InlineCompletionIsTrigger.bind(this._contextKeyService),this.inlineHintWidgetIsVisible=l.InlineHintWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsVisible=l.InlineInputWidgetIsVisible.bind(this._contextKeyService),this.inlineInputWidgetIsStreaming=l.InlineInputWidgetIsStreaming.bind(this._contextKeyService),this.inlineDiffPartialEditsIsVisible=l.InlineDiffPartialEditsIsVisible.bind(this._contextKeyService),this.codeEditsIsVisible=l.CodeEditsIsVisible.bind(this._contextKeyService)}};t.AINativeContextKey=p,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],p.prototype,"globalContextKeyService",void 0),t.AINativeContextKey=p=n.__decorate([(0,r.Injectable)(),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[Object])],p)},32016:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AINativeBrowserContribution=t.INLINE_DIFF_MANAGER_WIDGET_ID=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57925),p=e(50394),v=e(1149),m=e(97222),_=e(43718),s=e(82353),f=e(54414),a=e(57517),h=e(51553),u=e(63067),d=e(46507),E=e(97682),g=e(68415),c=e(96640),y=e(19413),b=e(61282),S=e(51081),A=e(59347),w=e(76154),T=e(79559),D=e(57232),I=e(72991),R=e(71863),M=e(7511),O=e(42911),P=e(72801),k=e(87817),F=e(4972),L=e(82983),B=e(73974),j=e(77633),W=e(51221),U=e(2281),X=e(31031),V=e(95608),$=e(38890),Y=e(77886),G=e(89060),H=e(74353),K=e(22169),Z=e(90058);t.INLINE_DIFF_MANAGER_WIDGET_ID="inline-diff-manager-widget";let Q=class{constructor(){this.registerFeature()}async initialize(){const{supportsChatAssistant:ne}=this.aiNativeConfigService.capabilities;ne&&(o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,y.AI_CHAT_VIEW_ID,y.AI_CHAT_CONTAINER_ID),o.ComponentRegistryImpl.addLayoutModule(this.appConfig.layoutConfig,s.DESIGN_MENU_BAR_RIGHT,y.AI_CHAT_LOGO_AVATAR_ID),this.chatProxyService.registerDefaultAgent(),this.chatInternalService.init(),await this.chatManagerService.init())}registerEditorExtensionContribution(ne){const{supportsInlineChat:he,supportsInlineCompletion:_e,supportsProblemFix:q,supportsCodeAction:Ie}=this.aiNativeConfigService.capabilities;ne($.InlineDiffController.ID,new c.SyncDescriptor($.InlineDiffController,[this.injector]),E.EditorContributionInstantiation.Lazy),Ie&&ne(Z.SumiLightBulbWidget.ID,Z.SumiLightBulbWidget,E.EditorContributionInstantiation.Lazy),he&&(ne(W.InlineChatEditorController.ID,new c.SyncDescriptor(W.InlineChatEditorController,[this.injector]),E.EditorContributionInstantiation.BeforeFirstInteraction),this.inlineInputService.getInteractiveInputHandler()&&(ne(Y.InlineHintController.ID,new c.SyncDescriptor(Y.InlineHintController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender),ne(G.InlineInputController.ID,new c.SyncDescriptor(G.InlineInputController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender))),_e&&(ne(M.IntelligentCompletionsController.ID,new c.SyncDescriptor(M.IntelligentCompletionsController,[this.injector]),E.EditorContributionInstantiation.Eager),ne(I.InlineCompletionsController.ID,new c.SyncDescriptor(I.InlineCompletionsController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)),q&&ne(O.ProblemFixController.ID,new c.SyncDescriptor(O.ProblemFixController,[this.injector]),E.EditorContributionInstantiation.AfterFirstRender)}onReconnect(){const{supportsMCP:ne}=this.aiNativeConfigService.capabilities;ne&&this.initMCPServers()}onDidStart(){(0,_.runWhenIdle)(()=>{const{supportsRenameSuggestions:ne,supportsInlineChat:he,supportsMCP:_e,supportsCustomLLMSettings:q}=this.aiNativeConfigService.capabilities,Ie=this.preferenceService.getValid(o.AINativeSettingSectionsId.ChatVisibleType);Ie==="always"?this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!0):Ie==="never"&&this.commandService.executeCommand(l.AI_CHAT_VISIBLE.id,!1),ne&&this.renameSingleHandler.load(),he&&this.codeActionSingleHandler.load(),q&&this.preferenceService.onSpecificPreferenceChange(o.AINativeSettingSectionsId.LLMModelSelection,be=>{const ie=this.getModelByName(be.newValue),fe=ie?Object.keys(ie):[],Me=fe.length?fe[0]:"",Le=this.preferenceSchemaProvider.getPreferenceProperty(o.AINativeSettingSectionsId.ModelID);this.preferenceSchemaProvider.setSchema({properties:{[o.AINativeSettingSectionsId.ModelID]:{...Le,default:Me,defaultValue:Me,enum:fe.length?fe:void 0}}},!0),this.preferenceService.set(o.AINativeSettingSectionsId.ModelID,Me,be.scope),this.preferenceSettings.setEnumLabels(o.AINativeSettingSectionsId.ModelID,fe.reduce((ve,Se)=>({...ve,[Se]:Se}),{}))}),_e&&this.initMCPServers()})}initMCPServers(){var ne;const he=this.preferenceService.getValid(o.AINativeSettingSectionsId.MCPServers),_e=he?.find(q=>q.name===y.BUILTIN_MCP_SERVER_NAME);if(this.sumiMCPServerBackendProxy.initBuiltinMCPServer((ne=_e?.enabled)!==null&&ne!==void 0?ne:!0),he&&he.length>0){const q=he.filter(Ie=>Ie.name!==y.BUILTIN_MCP_SERVER_NAME);q.length>0&&this.sumiMCPServerBackendProxy.initExternalMCPServers(q)}}getModelByName(ne){switch(ne){case"deepseek":return y.deepSeekModels;case"anthropic":return y.anthropicModels;case"openai":return y.openAiNativeModels;default:return}}registerFeature(){this.contributions.getContributions().forEach(ne=>{var he,_e,q,Ie,be,ie,fe,Me,Le;(he=ne.registerInlineChatFeature)===null||he===void 0||he.call(ne,this.inlineChatFeatureRegistry),(_e=ne.registerChatFeature)===null||_e===void 0||_e.call(ne,this.chatFeatureRegistry),(q=ne.registerResolveConflictFeature)===null||q===void 0||q.call(ne,this.resolveConflictRegistry),(Ie=ne.registerRenameProvider)===null||Ie===void 0||Ie.call(ne,this.renameCandidatesProviderRegistry),(be=ne.registerChatRender)===null||be===void 0||be.call(ne,this.chatRenderRegistry),(ie=ne.registerTerminalProvider)===null||ie===void 0||ie.call(ne,this.terminalProviderRegistry),(fe=ne.registerIntelligentCompletionFeature)===null||fe===void 0||fe.call(ne,this.intelligentCompletionsRegistry),(Me=ne.registerProblemFixFeature)===null||Me===void 0||Me.call(ne,this.problemFixProviderRegistry),(Le=ne.registerChatAgentPromptProvider)===null||Le===void 0||Le.call(ne)}),this.mcpServerContributions.getContributions().forEach(ne=>{ne.registerMCPServer(this.mcpServerRegistry)})}registerSetting(ne){ne.registerSettingGroup({id:o.AI_NATIVE_SETTING_GROUP_ID,title:_.AI_NATIVE_SETTING_GROUP_TITLE,iconClass:(0,o.getIcon)("magic-wand")}),ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.chat.title"),preferences:[{id:o.AINativeSettingSectionsId.ChatVisibleType,localized:"preference.ai.native.chat.visible.type"}]}),ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.interface.quick.title"),preferences:[{id:o.AINativeSettingSectionsId.InterfaceQuickNavigationEnabled,localized:"preference.ai.native.interface.quick.navigation"}]}),this.aiNativeConfigService.capabilities.supportsInlineCompletion&&(ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.intelligentCompletions.title"),preferences:[{id:o.AINativeSettingSectionsId.IntelligentCompletionsCacheEnabled,localized:"preference.ai.native.intelligentCompletions.cache.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsDebounceTime,localized:"preference.ai.native.intelligentCompletions.debounceTime"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsPromptEngineeringEnabled,localized:"preference.ai.native.intelligentCompletions.promptEngineering.enabled"},{id:o.AINativeSettingSectionsId.IntelligentCompletionsAlwaysVisible,localized:"preference.ai.native.intelligentCompletions.alwaysVisible"}]}),ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.codeEdits.title"),preferences:[{id:o.AINativeSettingSectionsId.CodeEditsLintErrors,localized:"preference.ai.native.codeEdits.lintErrors"},{id:o.AINativeSettingSectionsId.CodeEditsLineChange,localized:"preference.ai.native.codeEdits.lineChange"},{id:o.AINativeSettingSectionsId.CodeEditsTyping,localized:"preference.ai.native.codeEdits.typing"},{id:o.AINativeSettingSectionsId.CodeEditsRenderType,localized:"preference.ai.native.codeEdits.renderType"},{id:o.AINativeSettingSectionsId.SystemPrompt,localized:"preference.ai.native.chat.system.prompt"}]})),this.aiNativeConfigService.capabilities.supportsCustomLLMSettings&&ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.llm.apiSettings.title"),preferences:[{id:o.AINativeSettingSectionsId.LLMModelSelection,localized:"preference.ai.native.llm.model.selection"},{id:o.AINativeSettingSectionsId.ModelID,localized:"preference.ai.native.llm.model.id"},{id:o.AINativeSettingSectionsId.DeepseekApiKey,localized:"preference.ai.native.deepseek.apiKey"},{id:o.AINativeSettingSectionsId.AnthropicApiKey,localized:"preference.ai.native.anthropic.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiApiKey,localized:"preference.ai.native.openai.apiKey"},{id:o.AINativeSettingSectionsId.OpenaiBaseURL,localized:"preference.ai.native.openai.baseURL"}]}),this.aiNativeConfigService.capabilities.supportsMCP&&ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.mcp.settings.title"),preferences:[{id:o.AINativeSettingSectionsId.MCPServers,localized:"preference.ai.native.mcp.servers"}]}),this.aiNativeConfigService.capabilities.supportsInlineChat&&ne.registerSettingSection(o.AI_NATIVE_SETTING_GROUP_ID,{title:(0,o.localize)("preference.ai.native.inlineChat.title"),preferences:[{id:o.AINativeSettingSectionsId.InlineChatAutoVisible,localized:"preference.ai.native.inlineChat.auto.visible"},{id:o.AINativeSettingSectionsId.InlineChatCodeActionEnabled,localized:"preference.ai.native.inlineChat.codeAction.enabled"},{id:o.AINativeSettingSectionsId.InlineDiffPreviewMode,localized:"preference.ai.native.inlineDiff.preview.mode"}]})}registerEditorFeature(ne){ne.registerEditorFeatureContribution({contribute:he=>{const{monacoEditor:_e}=he;return this.codeActionSingleHandler.mountEditor(he.monacoEditor),_e.onDidScrollChange(()=>{this.ctxMenuRenderer.visible&&this.ctxMenuRenderer.hide(!0)})}})}registerEditorComponent(ne){ne.registerEditorSideWidget({id:t.INLINE_DIFF_MANAGER_WIDGET_ID,component:V.InlineDiffManager,displaysOnResource:he=>!!this.applyService.getUriPendingCodeBlock(he.uri)})}registerCommands(ne){ne.registerCommand(l.AI_INLINE_CHAT_VISIBLE,{execute:he=>{this.aiInlineChatService._onInlineChatVisible.fire(he)}}),ne.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE,{execute:async he=>{var _e;if(!he){this.inlineInputService.hide();return}this.commandService.executeCommand(l.AI_INLINE_CHAT_VISIBLE.id,!1);const q=this.workbenchEditorService.currentCodeEditor;if(!q)return;const Ie=q.monacoEditor.getPosition();if(!Ie)return;const be=q.monacoEditor.getSelection();if(Ie?((_e=q.monacoEditor.getModel())===null||_e===void 0?void 0:_e.getLineLength(Ie.lineNumber))===0:!1){this.inlineInputService.visibleByPosition(Ie);return}if(be&&!be.isEmpty()){this.inlineInputService.visibleBySelection(be);return}this.inlineInputService.visibleByNearestCodeBlock(Ie,q.monacoEditor)}}),ne.registerCommand(l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL,{execute:()=>{var he;const _e=this.workbenchEditorService.currentCodeEditor;_e&&((he=G.InlineInputController.get(_e.monacoEditor))===null||he===void 0||he.cancelToken())}}),ne.registerCommand(l.AI_INLINE_COMPLETION_REPORTER,{execute:(he,_e,q,Ie)=>{this.aiCompletionsService.report({sessionId:_e,accept:q,relationId:he,code:Ie})}}),ne.registerCommand(l.AI_CHAT_VISIBLE,{execute:he=>{this.layoutService.toggleSlot(y.AI_CHAT_VIEW_ID,(0,_.isUndefined)(he)?!0:he)}}),ne.registerCommand(l.AI_INLINE_COMPLETION_VISIBLE,{execute:async he=>{he||(this.aiCompletionsService.hideStatusBarItem(),this.aiInlineCompletionsProvider.setVisibleCompletion(!1),this.aiInlineCompletionsProvider.cancelRequest())}}),ne.registerCommand(l.AI_INLINE_DIFF_PARTIAL_EDIT,{execute:he=>{this.inlineStreamDiffService.launchAcceptDiscardPartialEdit(he)}}),ne.afterExecuteCommand(g.HideInlineCompletion.ID,()=>{this.commandService.executeCommand(l.AI_INLINE_COMPLETION_VISIBLE.id,!1)})}registerRenderer(ne){this.designLayoutConfig.supportExternalChatPanel?ne.registerSlotRenderer(y.AI_CHAT_VIEW_ID,F.AIChatTabRendererWithTab):ne.registerSlotRenderer(y.AI_CHAT_VIEW_ID,F.AIChatTabRenderer),this.designLayoutConfig.useMergeRightWithLeftPanel&&(ne.registerSlotRenderer(o.SlotLocation.left,F.AILeftTabRenderer),ne.registerSlotRenderer(o.SlotLocation.right,F.AIRightTabRenderer))}registerComponent(ne){ne.register(y.AI_CHAT_CONTAINER_ID,[],{component:w.AIChatView,title:(0,o.localize)("aiNative.chat.ai.assistant.name"),iconClass:(0,o.getIcon)("magic-wand"),containerId:y.AI_CHAT_CONTAINER_ID}),ne.register(y.AI_MENU_BAR_DEBUG_TOOLBAR,{id:y.AI_MENU_BAR_DEBUG_TOOLBAR,component:k.AIRunToolbar}),ne.register(y.AI_CHAT_LOGO_AVATAR_ID,{id:y.AI_CHAT_LOGO_AVATAR_ID,component:L.AIChatLogoAvatar})}registerKeybindings(ne){this.aiNativeConfigService.capabilities.supportsInlineChat&&(ne.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"ctrlcmd+i",when:"editorTextFocus",args:!0,priority:0},o.KeybindingScope.USER),ne.registerKeybinding({command:l.AI_INLINE_CHAT_VISIBLE.id,keybinding:"esc",args:!1,when:`editorFocus && ${p.InlineChatIsVisible.raw}`}),this.inlineInputService.getInteractiveInputHandler()&&(ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && (${p.InlineChatIsVisible.raw} || inlineSuggestionVisible)`},o.KeybindingScope.USER),ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:"esc",args:!1,priority:0,when:`editorFocus && ${p.InlineInputWidgetIsVisible.raw}`}),ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_CANCEL.id,keybinding:"esc",priority:1,when:`editorFocus && ${p.InlineInputWidgetIsStreaming.raw}`}),ne.registerKeybinding({command:l.AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id,keybinding:this.aiNativeConfigService.inlineChat.inputKeybinding,args:!0,priority:0,when:`editorFocus && ${p.InlineHintWidgetIsVisible.raw} && ${p.InlineChatIsVisible.not}`},o.KeybindingScope.USER))),ne.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+y",args:!0,priority:100,when:`editorTextFocus && ${p.InlineDiffPartialEditsIsVisible.raw}`}),ne.registerKeybinding({command:l.AI_INLINE_DIFF_PARTIAL_EDIT.id,keybinding:"ctrl+n",args:!1,priority:100,when:`editorTextFocus && ${p.InlineDiffPartialEditsIsVisible.raw}`})}};t.AINativeBrowserContribution=Q,n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],Q.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],Q.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(m.IBrowserCtxMenu),n.__metadata("design:type",m.IBrowserCtxMenu)],Q.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(j.AINativeCoreContribution),n.__metadata("design:type",Object)],Q.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(j.MCPServerContribution),n.__metadata("design:type",Object)],Q.prototype,"mcpServerContributions",void 0),n.__decorate([(0,r.Autowired)(j.TokenMCPServerRegistry),n.__metadata("design:type",Object)],Q.prototype,"mcpServerRegistry",void 0),n.__decorate([(0,r.Autowired)(_.InlineChatFeatureRegistryToken),n.__metadata("design:type",U.InlineChatFeatureRegistry)],Q.prototype,"inlineChatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ChatFeatureRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"chatFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ChatRenderRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"chatRenderRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ResolveConflictRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"resolveConflictRegistry",void 0),n.__decorate([(0,r.Autowired)(_.RenameCandidatesProviderRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"renameCandidatesProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(_.TerminalRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"terminalProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(_.IntelligentCompletionsRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"intelligentCompletionsRegistry",void 0),n.__decorate([(0,r.Autowired)(_.ProblemFixRegistryToken),n.__metadata("design:type",Object)],Q.prototype,"problemFixProviderRegistry",void 0),n.__decorate([(0,r.Autowired)(o.AINativeConfigService),n.__metadata("design:type",o.AINativeConfigService)],Q.prototype,"aiNativeConfigService",void 0),n.__decorate([(0,r.Autowired)(v.DesignLayoutConfig),n.__metadata("design:type",v.DesignLayoutConfig)],Q.prototype,"designLayoutConfig",void 0),n.__decorate([(0,r.Autowired)(R.AICompletionsService),n.__metadata("design:type",R.AICompletionsService)],Q.prototype,"aiCompletionsService",void 0),n.__decorate([(0,r.Autowired)(D.AIInlineCompletionsProvider),n.__metadata("design:type",D.AIInlineCompletionsProvider)],Q.prototype,"aiInlineCompletionsProvider",void 0),n.__decorate([(0,r.Autowired)(_.CommandService),n.__metadata("design:type",Object)],Q.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceSchemaProvider),n.__metadata("design:type",o.PreferenceSchemaProvider)],Q.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],Q.prototype,"preferenceSettings",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],Q.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(u.IMainLayoutService),n.__metadata("design:type",Object)],Q.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(y.ChatProxyServiceToken),n.__metadata("design:type",S.ChatProxyService)],Q.prototype,"chatProxyService",void 0),n.__decorate([(0,r.Autowired)(o.IAIInlineChatService),n.__metadata("design:type",X.InlineChatService)],Q.prototype,"aiInlineChatService",void 0),n.__decorate([(0,r.Autowired)(H.InlineInputService),n.__metadata("design:type",H.InlineInputService)],Q.prototype,"inlineInputService",void 0),n.__decorate([(0,r.Autowired)(K.InlineStreamDiffService),n.__metadata("design:type",K.InlineStreamDiffService)],Q.prototype,"inlineStreamDiffService",void 0),n.__decorate([(0,r.Autowired)(P.RenameSingleHandler),n.__metadata("design:type",P.RenameSingleHandler)],Q.prototype,"renameSingleHandler",void 0),n.__decorate([(0,r.Autowired)(T.CodeActionSingleHandler),n.__metadata("design:type",T.CodeActionSingleHandler)],Q.prototype,"codeActionSingleHandler",void 0),n.__decorate([(0,r.Autowired)(y.SumiMCPServerProxyServicePath),n.__metadata("design:type",Object)],Q.prototype,"sumiMCPServerBackendProxy",void 0),n.__decorate([(0,r.Autowired)(f.WorkbenchEditorService),n.__metadata("design:type",h.WorkbenchEditorServiceImpl)],Q.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(y.IChatManagerService),n.__metadata("design:type",b.ChatManagerService)],Q.prototype,"chatManagerService",void 0),n.__decorate([(0,r.Autowired)(y.IChatInternalService),n.__metadata("design:type",A.ChatInternalService)],Q.prototype,"chatInternalService",void 0),n.__decorate([(0,r.Autowired)(B.BaseApplyService),n.__metadata("design:type",B.BaseApplyService)],Q.prototype,"applyService",void 0),t.AINativeBrowserContribution=Q=n.__decorate([(0,o.Domain)(o.ClientAppContribution,a.BrowserEditorContribution,o.CommandContribution,d.SettingContribution,o.KeybindingContribution,o.ComponentContribution,o.SlotRendererContribution,o.MonacoContribution),n.__metadata("design:paramtypes",[])],Q)},74055:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAgentService=void 0;const n=e(85608),r=n.__importDefault(e(66652)),o=e(76003),l=e(43718),p=e(46044),v=e(73307),m=e(29770);let _=class extends l.Disposable{constructor(){super(),this.agents=new Map,this.initialUserMessageMap=new Map,this.shouldUpdateContext=!1,this._onDidChangeAgents=new l.Emitter,this.onDidChangeAgents=this._onDidChangeAgents.event,this._onDidSendMessage=new l.Emitter,this.onDidSendMessage=this._onDidSendMessage.event,this.addDispose(this._onDidChangeAgents),this.addDispose(this.contextService.onDidContextFilesChangeEvent(f=>{f.version!==this.contextVersion&&(this.contextVersion=f.version,this.shouldUpdateContext=!0)}))}registerAgent(f){if(this.agents.has(f.id))throw new Error(`Already registered an agent with id ${f.id}`);return this.agents.set(f.id,{agent:f,commands:[]}),this._onDidChangeAgents.fire(),(0,l.toDisposable)(()=>{this.agents.delete(f.id)&&this._onDidChangeAgents.fire()})}async updateAgent(f,a){const h=this.agents.get(f);if(!h)throw new Error(`No agent with id ${f} registered`);h.agent.metadata={...h.agent.metadata,...a},h.commands=await h.agent.provideSlashCommands(l.CancellationToken.None),a.isDefault&&(this.defaultAgentId=f);const u=await h.agent.provideChatWelcomeMessage(l.CancellationToken.None);if(u){const{content:d,sampleQuestions:E}=u;this.chatFeatureRegistry.registerWelcome(d,E)}this._onDidChangeAgents.fire()}getAgents(){return Array.from(this.agents.values(),f=>f.agent)}hasAgent(f){return this.agents.has(f)}getDefaultAgentId(){return this.defaultAgentId}getAgent(f){const a=this.agents.get(f);return a?.agent}async invokeAgent(f,a,h,u,d){const E=this.agents.get(f);if(!E)throw new Error(`No agent with id ${f}`);if(!this.initialUserMessageMap.has(a.sessionId)){this.initialUserMessageMap.set(a.sessionId,a.message);const c=a.message;a.message=this.provideContextMessage(c,a.sessionId)}return this.shouldUpdateContext&&(a.message=this.provideContextMessage(a.message,a.sessionId),this.shouldUpdateContext=!1),await E.agent.invoke(a,h,u,d)}provideContextMessage(f,a){const h=this.contextService.serialize(),u=this.promptProvider.provideContextPrompt(h,f);return this.aiReporter.record({msgType:l.AIServiceType.Chat,actionType:l.ActionTypeEnum.ContextEnhance,actionSource:l.ActionSourceEnum.Chat,sessionId:a,message:u}),u}populateChatInput(f,a){this.aiChatService.sendMessage({...a,agentId:f,immediate:!1})}getCommands(){return(0,r.default)(Array.from(this.agents.values(),({agent:f,commands:a})=>a.map(h=>({...h,agentId:f.id}))))}async getFollowups(f,a,h){const u=this.agents.get(f);if(!u)throw new Error(`No agent with id ${f}`);return u.agent.provideFollowups?u.agent.provideFollowups(a,h):[]}async getSampleQuestions(f,a){const h=this.agents.get(f);if(!h)throw new Error(`No agent with id ${f}`);return h.agent.provideSampleQuestions?h.agent.provideSampleQuestions(a):[]}async getAllSampleQuestions(){const f=await Promise.all(Array.from(this.agents.values()).map(async({agent:a})=>{try{return await this.getSampleQuestions(a.id,l.CancellationToken.None)}catch(h){return this.logger.error(h),[]}}));return(0,r.default)(f)}sendMessage(f){this._onDidSendMessage.fire(f)}parseMessage(f,a){var h;const u={agentId:"",command:"",message:f};let d=a;const E=this.getAgents(),g=new RegExp(`^@(${E.map(y=>y.id).join("|")})(?:\\s+|$)`,"i"),c=u.message.match(g);if(c){const y=E.find(b=>b.id.toLowerCase()===c[1].toLowerCase());if(!y)return u;d=y.id,u.agentId=d,u.message=u.message.replace(c[0],"")}if(d){const y=(h=this.agents.get(d))===null||h===void 0?void 0:h.commands;if(y?.length){const b=new RegExp(`^/\\s?(${y.map(A=>A.name).join("|")})(?:\\s+|$)`,"i"),S=u.message.match(b);if(S){const A=y.find(w=>w.name.toLowerCase()===S[1].toLowerCase());if(!A)return u;u.command=A.name,u.message=u.message.replace(S[0],"")}}}return u}};t.ChatAgentService=_,n.__decorate([(0,o.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,o.Autowired)(l.IAIReporter),n.__metadata("design:type",Object)],_.prototype,"aiReporter",void 0),n.__decorate([(0,o.Autowired)(p.LLMContextServiceToken),n.__metadata("design:type",Object)],_.prototype,"contextService",void 0),n.__decorate([(0,o.Autowired)(v.ChatAgentPromptProvider),n.__metadata("design:type",Object)],_.prototype,"promptProvider",void 0),n.__decorate([(0,o.Autowired)(l.ChatServiceToken),n.__metadata("design:type",m.ChatService)],_.prototype,"aiChatService",void 0),n.__decorate([(0,o.Autowired)(l.ChatFeatureRegistryToken),n.__metadata("design:type",Object)],_.prototype,"chatFeatureRegistry",void 0),t.ChatAgentService=_=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],_)},84543:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAgentViewService=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(19413),p=e(51081);let v=class{constructor(){this.componentsMap=new Map,this.componentsDeferredMap=new Map}registerChatComponent(_){return this.componentsMap.set(_.id,_),this.componentsDeferredMap.has(_.id)&&(this.componentsDeferredMap.get(_.id).resolve(_),this.componentsDeferredMap.delete(_.id)),{dispose:()=>{this.componentsMap.get(_.id)===_&&(this.componentsMap.delete(_.id),this.componentsDeferredMap.delete(_.id))}}}getChatComponent(_){return this.componentsMap.has(_)?this.componentsMap.get(_):(this.componentsDeferredMap.has(_)||this.componentsDeferredMap.set(_,new o.Deferred),null)}getChatComponentDeferred(_){return this.componentsDeferredMap.get(_)||null}getRenderAgents(){return this.chatAgentService.getAgents().filter(_=>_.id!==p.ChatProxyService.AGENT_ID)}};t.ChatAgentViewService=v,n.__decorate([(0,r.Autowired)(l.IChatAgentService),n.__metadata("design:type",Object)],v.prototype,"chatAgentService",void 0),t.ChatAgentViewService=v=n.__decorate([(0,r.Injectable)()],v)},61282:(x,t,e)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ChatManagerService=void 0;const o=e(85608),l=e(76003),p=e(43718),v=e(19413),m=e(44260),_=e(42033),s=20;let f=class extends p.Disposable{fromJSON(h){return h.map(u=>{const d=new _.ChatModel({sessionId:u.sessionId,history:new m.MsgHistoryManager(u.history)}),E=u.requests.map(g=>new _.ChatRequestModel(g.requestId,d,g.message,new _.ChatResponseModel(g.requestId,d,g.message.agentId,{responseContents:g.response.responseContents,isComplete:!0,responseText:g.response.responseText,errorDetails:g.response.errorDetails,followups:g.response.followups,isCanceled:g.response.isCanceled})));return d.restoreRequests(E),d})}constructor(){super(),n.set(this,this.registerDispose(new p.DisposableMap)),r.set(this,this.registerDispose(new p.DisposableMap)),this.storageInitEmitter=new p.Emitter,this.onStorageInit=this.storageInitEmitter.event}async init(){this._chatStorage=await this.storageProvider(p.STORAGE_NAMESPACE.CHAT);const h=this._chatStorage.get("sessionModels",[]);this.fromJSON(h).forEach(d=>{o.__classPrivateFieldGet(this,n,"f").set(d.sessionId,d),this.listenSession(d)}),await this.storageInitEmitter.fireAndAwait()}getSessions(){return Array.from(o.__classPrivateFieldGet(this,n,"f").values())}startSession(){if(o.__classPrivateFieldGet(this,n,"f").size>=s)throw new Error((0,p.formatLocalize)("aiNative.chat.session.max",s.toString()));const h=new _.ChatModel;return o.__classPrivateFieldGet(this,n,"f").set(h.sessionId,h),this.listenSession(h),h}getSession(h){return o.__classPrivateFieldGet(this,n,"f").get(h)}clearSession(h){var u;if(!o.__classPrivateFieldGet(this,n,"f").get(h))throw new Error(`Unknown session: ${h}`);o.__classPrivateFieldGet(this,n,"f").disposeKey(h),(u=o.__classPrivateFieldGet(this,r,"f").get(h))===null||u===void 0||u.cancel(),o.__classPrivateFieldGet(this,r,"f").disposeKey(h),this.saveSessions()}createRequest(h,u,d,E){const g=this.getSession(h);if(!g)throw new Error(`Unknown session: ${h}`);if(!o.__classPrivateFieldGet(this,r,"f").has(h))return g.addRequest({prompt:u,agentId:d,command:E})}async sendRequest(h,u,d){const E=this.getSession(h);if(!E)throw new Error(`Unknown session: ${h}`);const g=new p.CancellationTokenSource,c=g.token;o.__classPrivateFieldGet(this,r,"f").set(E.sessionId,g);const y=c.onCancellationRequested(()=>{u.response.cancel()}),b=[];for(const S of E.requests)S.response.isComplete&&(b.push({role:1,content:S.message.prompt}),b.push({role:2,content:S.response.responseText}));try{const S=T=>{c.isCancellationRequested||E.acceptResponseProgress(u,T)},A={sessionId:h,requestId:u.requestId,message:u.message.prompt,command:u.message.command,regenerate:d},w=await this.chatAgentService.invokeAgent(u.message.agentId,A,S,b,c);c.isCancellationRequested||(w.errorDetails&&u.response.setErrorDetails(w.errorDetails),this.chatAgentService.getFollowups(u.message.agentId,h,p.CancellationToken.None).then(D=>{u.response.setFollowups(D),u.response.complete()}))}finally{y.dispose(),o.__classPrivateFieldGet(this,r,"f").disposeKey(E.sessionId),this.saveSessions()}}listenSession(h){this.addDispose(h.history.onMessageAdditionalChange(()=>{this.saveSessions()}))}saveSessions(){this._chatStorage.set("sessionModels",this.getSessions())}cancelRequest(h){var u;(u=o.__classPrivateFieldGet(this,r,"f").get(h))===null||u===void 0||u.cancel(),o.__classPrivateFieldGet(this,r,"f").disposeKey(h),this.saveSessions()}};t.ChatManagerService=f,n=new WeakMap,r=new WeakMap,o.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),o.__metadata("design:type",l.Injector)],f.prototype,"injector",void 0),o.__decorate([(0,l.Autowired)(v.IChatAgentService),o.__metadata("design:type",Object)],f.prototype,"chatAgentService",void 0),o.__decorate([(0,l.Autowired)(p.StorageProvider),o.__metadata("design:type",Function)],f.prototype,"storageProvider",void 0),o.__decorate([(0,p.debounce)(1e3),o.__metadata("design:type",Function),o.__metadata("design:paramtypes",[]),o.__metadata("design:returntype",void 0)],f.prototype,"saveSessions",null),t.ChatManagerService=f=o.__decorate([(0,l.Injectable)(),o.__metadata("design:paramtypes",[])],f)},42033:(x,t,e)=>{"use strict";var n,r,o,l,p,v,m,_,s,f,a,h,u,d,E;Object.defineProperty(t,"__esModule",{value:!0}),t.ChatSlashCommandItemModel=t.ChatWelcomeMessageModel=t.ChatModel=t.ChatRequestModel=t.ChatResponseModel=void 0;const g=e(85608),c=e(76003),y=e(43718),b=e(90684),S=e(19413),A=e(44260);class w extends y.Disposable{get responseParts(){return g.__classPrivateFieldGet(this,r,"f")}get responseContents(){return g.__classPrivateFieldGet(this,o,"f")}get isComplete(){return g.__classPrivateFieldGet(this,l,"f")}get isCanceled(){return g.__classPrivateFieldGet(this,p,"f")}get requestId(){return g.__classPrivateFieldGet(this,v,"f")}get responseText(){return g.__classPrivateFieldGet(this,m,"f")}get errorDetails(){return g.__classPrivateFieldGet(this,_,"f")}get followups(){return g.__classPrivateFieldGet(this,s,"f")}get onDidChange(){return g.__classPrivateFieldGet(this,f,"f").event}constructor(O,P,k,F){super(),n.add(this),this.session=P,this.agentId=k,r.set(this,[]),o.set(this,[]),l.set(this,!1),p.set(this,!1),v.set(this,void 0),m.set(this,""),_.set(this,void 0),s.set(this,void 0),f.set(this,this.registerDispose(new y.Emitter)),g.__classPrivateFieldSet(this,v,O,"f"),F&&(g.__classPrivateFieldSet(this,o,F.responseContents,"f"),g.__classPrivateFieldSet(this,m,F.responseText,"f"),g.__classPrivateFieldSet(this,l,F.isComplete,"f"),g.__classPrivateFieldSet(this,p,F.isCanceled,"f"),g.__classPrivateFieldSet(this,_,F.errorDetails,"f"),g.__classPrivateFieldSet(this,s,F.followups,"f"))}updateContent(O,P){var k;const F=g.__classPrivateFieldGet(this,r,"f").length-1;if(O.kind==="content"||O.kind==="markdownContent"){const L=g.__classPrivateFieldGet(this,r,"f")[F];!L||L.kind!=="markdownContent"?O.kind==="content"?g.__classPrivateFieldGet(this,r,"f").push({content:new b.MarkdownString(O.content),kind:"markdownContent"}):g.__classPrivateFieldGet(this,r,"f").push(O):O.kind==="markdownContent"?g.__classPrivateFieldGet(this,r,"f")[F]={content:new b.MarkdownString(L.content.value+O.content.value),kind:"markdownContent"}:g.__classPrivateFieldGet(this,r,"f")[F]={content:new b.MarkdownString(L.content.value+O.content,L.content),kind:"markdownContent"},g.__classPrivateFieldGet(this,n,"m",a).call(this)}else if(O.kind==="asyncContent"){const L=g.__classPrivateFieldGet(this,r,"f").push(O)-1;g.__classPrivateFieldGet(this,n,"m",a).call(this),(k=O.resolvedContent)===null||k===void 0||k.then(B=>{typeof B=="string"?g.__classPrivateFieldGet(this,r,"f")[L]={content:new b.MarkdownString(B),kind:"markdownContent"}:(0,b.isMarkdownString)(B)?g.__classPrivateFieldGet(this,r,"f")[L]={content:B,kind:"markdownContent"}:g.__classPrivateFieldGet(this,r,"f")[L]=B,g.__classPrivateFieldGet(this,n,"m",a).call(this,P)})}else if(O.kind==="treeData"||O.kind==="component")g.__classPrivateFieldGet(this,r,"f").push(O),g.__classPrivateFieldGet(this,n,"m",a).call(this,P);else if(O.kind==="toolCall"){const L=g.__classPrivateFieldGet(this,r,"f").find(B=>B.kind==="toolCall"&&B.content.id===O.content.id);L?L.content=O.content:g.__classPrivateFieldGet(this,r,"f").push(O),g.__classPrivateFieldGet(this,n,"m",a).call(this,P)}}complete(){g.__classPrivateFieldSet(this,l,!0,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}cancel(){g.__classPrivateFieldSet(this,l,!0,"f"),g.__classPrivateFieldSet(this,p,!0,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}reset(){g.__classPrivateFieldSet(this,o,[],"f"),g.__classPrivateFieldSet(this,r,[],"f"),g.__classPrivateFieldSet(this,m,"","f"),g.__classPrivateFieldSet(this,p,!1,"f"),g.__classPrivateFieldSet(this,l,!1,"f"),g.__classPrivateFieldSet(this,_,void 0,"f"),g.__classPrivateFieldSet(this,s,void 0,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}setErrorDetails(O){g.__classPrivateFieldSet(this,_,O,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}setFollowups(O){g.__classPrivateFieldSet(this,s,O,"f"),g.__classPrivateFieldGet(this,f,"f").fire()}toJSON(){return{isCanceled:this.isCanceled,responseContents:this.responseContents,responseText:this.responseText,errorDetails:this.errorDetails,followups:this.followups}}}t.ChatResponseModel=w,r=new WeakMap,o=new WeakMap,l=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,_=new WeakMap,s=new WeakMap,f=new WeakMap,n=new WeakSet,a=function(O){g.__classPrivateFieldSet(this,m,g.__classPrivateFieldGet(this,r,"f").map(k=>k.kind==="asyncContent"?k.content:k.kind==="treeData"||k.kind==="component"?"":k.kind==="toolCall"?k.content.function.name:k.content.value).join(`
|
|
30084
30084
|
|
|
30085
30085
|
`),"f");const P=[];for(const k of g.__classPrivateFieldGet(this,r,"f")){const F=P[P.length-1];k.kind==="markdownContent"&&F?.kind==="markdownContent"?P[P.length-1]={content:new b.MarkdownString(F.content.value+k.content.value,{isTrusted:F.content.isTrusted}),kind:"markdownContent"}:P.push(k)}g.__classPrivateFieldSet(this,o,P,"f"),O||g.__classPrivateFieldGet(this,f,"f").fire()};class T{get requestId(){return g.__classPrivateFieldGet(this,h,"f")}constructor(O,P,k,F){this.session=P,this.message=k,this.response=F,h.set(this,void 0),g.__classPrivateFieldSet(this,h,O,"f")}toJSON(){return{requestId:this.requestId,message:this.message,response:this.response}}}t.ChatRequestModel=T,h=new WeakMap;class D extends y.Disposable{constructor(O){var P,k;super(),u.set(this,void 0),d.set(this,new Map),g.__classPrivateFieldSet(this,u,(P=O?.sessionId)!==null&&P!==void 0?P:(0,y.uuid)(),"f"),this.history=(k=O?.history)!==null&&k!==void 0?k:new A.MsgHistoryManager,O?.requests&&g.__classPrivateFieldSet(this,d,new Map(O.requests.map(F=>[F.requestId,F])),"f")}get sessionId(){return g.__classPrivateFieldGet(this,u,"f")}get requests(){return Array.from(g.__classPrivateFieldGet(this,d,"f").values())}restoreRequests(O){g.__classPrivateFieldSet(this,d,new Map(O.map(P=>[P.requestId,P])),"f")}addRequest(O){const P=O,k=`${this.sessionId}_request_${D.requestIdPool++}`,F=new w(k,this,P.agentId),L=new T(k,this,P,F);return g.__classPrivateFieldGet(this,d,"f").set(k,L),L}acceptResponseProgress(O,P,k){if(O.response.isComplete)throw new Error("acceptResponseProgress: Adding progress to a completed response");const{kind:F}=P;["content","markdownContent","asyncContent","treeData","component","toolCall"].includes(F)?O.response.updateContent(P,k):console.error(`Couldn't handle progress: ${JSON.stringify(P)}`)}getRequest(O){return g.__classPrivateFieldGet(this,d,"f").get(O)}dispose(){super.dispose(),g.__classPrivateFieldGet(this,d,"f").forEach(O=>O.response.dispose())}toJSON(){return{sessionId:this.sessionId,history:this.history,requests:this.requests}}}t.ChatModel=D,u=new WeakMap,d=new WeakMap,D.requestIdPool=0;let I=E=class extends y.Disposable{get id(){return this._id}constructor(O,P){super(),this.content=O,this.sampleQuestions=P,this._id="welcome_"+E.nextId++}};t.ChatWelcomeMessageModel=I,I.nextId=0,t.ChatWelcomeMessageModel=I=E=g.__decorate([(0,c.Injectable)({multiple:!0}),g.__metadata("design:paramtypes",[Object,Array])],I);let R=class extends y.Disposable{constructor(O,P,k){super(),this.chatCommand=O,this.command=P,this.agentId=k}get name(){return this.chatCommand.name}get isShortcut(){return!!this.chatCommand.isShortcut}get icon(){return this.chatCommand.icon}get description(){return this.chatCommand.description}get tooltip(){return this.chatCommand.tooltip}get nameWithSlash(){return this.name.startsWith(S.SLASH_SYMBOL)?this.name:`${S.SLASH_SYMBOL} ${this.name}`}};t.ChatSlashCommandItemModel=R,t.ChatSlashCommandItemModel=R=g.__decorate([(0,c.Injectable)({multiple:!0}),g.__metadata("design:paramtypes",[Object,String,String])],R)},51081:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ChatProxyService=void 0;const r=e(85608),o=e(76003),l=e(41869),p=e(43718),v=e(27284),m=e(9447),_=e(72665),s=e(93062),f=e(19413),a=e(34817),h=e(29770),u=e(11735);let d=n=class extends p.Disposable{constructor(){super(...arguments),this.chatDeferred=new p.Deferred}registerDefaultAgent(){this.chatAgentViewService.registerChatComponent({id:"toolCall",component:a.ChatToolRender,initialProps:{}}),this.addDispose(this.chatAgentService.registerAgent({id:n.AGENT_ID,metadata:{systemPrompt:this.preferenceService.get(v.AINativeSettingSectionsId.SystemPrompt,`You are a powerful AI coding assistant working in OpenSumi, a top IDE framework. You collaborate with a USER to solve coding tasks, which may involve creating, modifying, or debugging code, or answering questions. When the USER sends a message, relevant context (e.g., open files, cursor position, edit history, linter errors) may be attached. Use this information as needed.
|
|
30086
30086
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/cli-engine",
|
|
3
|
-
"version": "3.8.1-next-
|
|
3
|
+
"version": "3.8.1-next-1741098925.0",
|
|
4
4
|
"description": "Integration engine runtime for opensumi-cli and opensumi extension",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@koa/cors": "^5.0.0",
|
|
28
28
|
"@opensumi/di": "^1.8.0",
|
|
29
|
-
"@opensumi/ide-core-browser": "3.8.1-next-
|
|
30
|
-
"@opensumi/ide-core-common": "3.8.1-next-
|
|
31
|
-
"@opensumi/ide-core-node": "3.8.1-next-
|
|
32
|
-
"@opensumi/ide-express-file-server": "3.8.1-next-
|
|
33
|
-
"@opensumi/ide-extension": "3.8.1-next-
|
|
34
|
-
"@opensumi/ide-i18n": "3.8.1-next-
|
|
35
|
-
"@opensumi/ide-main-layout": "3.8.1-next-
|
|
36
|
-
"@opensumi/ide-startup": "3.8.1-next-
|
|
29
|
+
"@opensumi/ide-core-browser": "3.8.1-next-1741098925.0",
|
|
30
|
+
"@opensumi/ide-core-common": "3.8.1-next-1741098925.0",
|
|
31
|
+
"@opensumi/ide-core-node": "3.8.1-next-1741098925.0",
|
|
32
|
+
"@opensumi/ide-express-file-server": "3.8.1-next-1741098925.0",
|
|
33
|
+
"@opensumi/ide-extension": "3.8.1-next-1741098925.0",
|
|
34
|
+
"@opensumi/ide-i18n": "3.8.1-next-1741098925.0",
|
|
35
|
+
"@opensumi/ide-main-layout": "3.8.1-next-1741098925.0",
|
|
36
|
+
"@opensumi/ide-startup": "3.8.1-next-1741098925.0",
|
|
37
37
|
"chalk": "^4.1.2",
|
|
38
38
|
"ejs": "^3.1.7",
|
|
39
39
|
"ip": "^1.1.8",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"webpack": "^5.90.0",
|
|
73
73
|
"webpack-cli": "^5.1.4"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "ebb6bbc2ab7c491a0dc740dcc1cabb903fdb737e"
|
|
76
76
|
}
|