@mcp-use/inspector 0.5.2 → 0.5.3-canary.1
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/dist/client/assets/{chunk-VL2OQCWN-Dk6O4Sk7.js → chunk-VL2OQCWN-C55BvblE.js} +1 -1
- package/dist/client/assets/{embeddings-Yd-6LLDc.js → embeddings-Cufjo1XK.js} +1 -1
- package/dist/client/assets/{index-CPMFJVEE.js → index-7-QgfWRH.js} +1 -1
- package/dist/client/assets/{index-_hgOYkid.js → index-BaJoBYz-.js} +1 -1
- package/dist/client/assets/{index-DSj_EDTJ.js → index-CQ-qHv2a.js} +1 -1
- package/dist/client/assets/{index-DEqyh8hr.js → index-C_iq8viy.js} +153 -32
- package/dist/client/assets/{index-BfI09_Re.js → index-CqG9tm2u.js} +1 -1
- package/dist/client/assets/{index-BY2VQcZu.js → index-DDA1_X2D.js} +1 -1
- package/dist/client/assets/{index-DmXcJzte.js → index-DDRuCDIE.js} +1 -1
- package/dist/client/assets/index-DmbL6IXF.css +1 -0
- package/dist/client/assets/{langfuse-C4HKZ3NL-B_IaVRkH.js → langfuse-C4HKZ3NL-t4vaDWLA.js} +3 -3
- package/dist/client/assets/{winston-p6BpkSbE.js → winston-z4mQedaS.js} +1 -1
- package/dist/client/index.html +3 -3
- package/package.json +2 -2
- package/dist/client/assets/index-BOWs0jL8.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as pe}from"./index-DEqyh8hr.js";import{r as Ln}from"./index-DRz5BQNA.js";var Xe,ot;function qn(){return ot||(ot=1,Xe=function(e,t){if(typeof e!="string")throw new TypeError("Expected a string");return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+t+"$2").toLowerCase()}),Xe}var jn=qn();const Bi=pe(jn);var Ne={exports:{}},at;function Dn(){if(at)return Ne.exports;at=1;const e=/[\p{Lu}]/u,t=/[\p{Ll}]/u,r=/^[\p{Lu}](?![\p{Lu}])/gu,n=/([\p{Alpha}\p{N}_]|$)/u,s=/[_.\- ]+/,u=new RegExp("^"+s.source),i=new RegExp(s.source+n.source,"gu"),o=new RegExp("\\d+"+n.source,"gu"),c=(d,m,h)=>{let p=!1,g=!1,v=!1;for(let E=0;E<d.length;E++){const y=d[E];p&&e.test(y)?(d=d.slice(0,E)+"-"+d.slice(E),p=!1,v=g,g=!0,E++):g&&v&&t.test(y)?(d=d.slice(0,E-1)+"-"+d.slice(E-1),v=g,g=!1,p=!0):(p=m(y)===y&&h(y)!==y,v=g,g=h(y)===y&&m(y)!==y)}return d},l=(d,m)=>(r.lastIndex=0,d.replace(r,h=>m(h))),a=(d,m)=>(i.lastIndex=0,o.lastIndex=0,d.replace(i,(h,p)=>m(p)).replace(o,h=>m(h))),f=(d,m)=>{if(!(typeof d=="string"||Array.isArray(d)))throw new TypeError("Expected the input to be `string | string[]`");if(m={pascalCase:!1,preserveConsecutiveUppercase:!1,...m},Array.isArray(d)?d=d.map(v=>v.trim()).filter(v=>v.length).join("-"):d=d.trim(),d.length===0)return"";const h=m.locale===!1?v=>v.toLowerCase():v=>v.toLocaleLowerCase(m.locale),p=m.locale===!1?v=>v.toUpperCase():v=>v.toLocaleUpperCase(m.locale);return d.length===1?m.pascalCase?p(d):h(d):(d!==h(d)&&(d=c(d,h,p)),d=d.replace(u,""),m.preserveConsecutiveUppercase?d=l(d,h):d=h(d),m.pascalCase&&(d=p(d.charAt(0))+d.slice(1)),a(d,p))};return Ne.exports=f,Ne.exports.default=f,Ne.exports}var Un=Dn();const Zi=pe(Un),Mn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Fn(e){return typeof e=="string"&&Mn.test(e)}function Gn(e){if(!Fn(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var H=[];for(var Je=0;Je<256;++Je)H.push((Je+256).toString(16).slice(1));function Rn(e,t=0){return(H[e[t+0]]+H[e[t+1]]+H[e[t+2]]+H[e[t+3]]+"-"+H[e[t+4]]+H[e[t+5]]+"-"+H[e[t+6]]+H[e[t+7]]+"-"+H[e[t+8]]+H[e[t+9]]+"-"+H[e[t+10]]+H[e[t+11]]+H[e[t+12]]+H[e[t+13]]+H[e[t+14]]+H[e[t+15]]).toLowerCase()}var Ae,Vn=new Uint8Array(16);function Bn(){if(!Ae&&(Ae=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ae))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ae(Vn)}function Zn(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Xn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Jn="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Hn(e,t,r){function n(s,u,i,o){var c;if(typeof s=="string"&&(s=Zn(s)),typeof u=="string"&&(u=Gn(u)),((c=u)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+s.length);if(l.set(u),l.set(s,u.length),l=r(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,i){o=o||0;for(var a=0;a<16;++a)i[o+a]=l[a];return i}return Rn(l)}try{n.name=e}catch{}return n.DNS=Xn,n.URL=Jn,n}var Yn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const ut={randomUUID:Yn};function Xi(e,t,r){if(ut.randomUUID&&!e)return ut.randomUUID();e=e||{};var n=e.random||(e.rng||Bn)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Rn(n)}function Kn(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function He(e,t){return e<<t|e>>>32-t}function Wn(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var n=unescape(encodeURIComponent(e));e=[];for(var s=0;s<n.length;++s)e.push(n.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var u=e.length/4+2,i=Math.ceil(u/16),o=new Array(i),c=0;c<i;++c){for(var l=new Uint32Array(16),a=0;a<16;++a)l[a]=e[c*64+a*4]<<24|e[c*64+a*4+1]<<16|e[c*64+a*4+2]<<8|e[c*64+a*4+3];o[c]=l}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),m=0;m<16;++m)d[m]=o[f][m];for(var h=16;h<80;++h)d[h]=He(d[h-3]^d[h-8]^d[h-14]^d[h-16],1);for(var p=r[0],g=r[1],v=r[2],E=r[3],y=r[4],q=0;q<80;++q){var M=Math.floor(q/20),U=He(p,5)+Kn(M,g,v,E)+y+t[M]+d[q]>>>0;y=E,E=v,v=He(g,30)>>>0,g=p,p=U}r[0]=r[0]+p>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+E>>>0,r[4]=r[4]+y>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Ji=Hn("v5",80,Wn),_e={exports:{}},Ye={},Ke,ct;function Qn(){if(ct)return Ke;ct=1;function e(t,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Ke=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var r=new Date().getTime();if(t&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},n),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,r){this._fn=t,r&&(r.timeout&&(this._operationTimeout=r.timeout),r.cb&&(this._operationTimeoutCb=r.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},r=null,n=0,s=0;s<this._errors.length;s++){var u=this._errors[s],i=u.message,o=(t[i]||0)+1;t[i]=o,o>=n&&(r=u,n=o)}return r},Ke}var lt;function es(){return lt||(lt=1,(function(e){var t=Qn();e.operation=function(r){var n=e.timeouts(r);return new t(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in r)n[s]=r[s];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var u=[],i=0;i<n.retries;i++)u.push(this.createTimeout(i,n));return r&&r.forever&&!u.length&&u.push(this.createTimeout(i,n)),u.sort(function(o,c){return o-c}),u},e.createTimeout=function(r,n){var s=n.randomize?Math.random()+1:1,u=Math.round(s*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return u=Math.min(u,n.maxTimeout),u},e.wrap=function(r,n,s){if(n instanceof Array&&(s=n,n=null),!s){s=[];for(var u in r)typeof r[u]=="function"&&s.push(u)}for(var i=0;i<s.length;i++){var o=s[i],c=r[o];r[o]=(function(a){var f=e.operation(n),d=Array.prototype.slice.call(arguments,1),m=d.pop();d.push(function(h){f.retry(h)||(h&&(arguments[0]=f.mainError()),m.apply(this,arguments))}),f.attempt(function(){a.apply(r,d)})}).bind(r,c),r[o].options=n}}})(Ye)),Ye}var We,ft;function rs(){return ft||(ft=1,We=es()),We}var dt;function ts(){if(dt)return _e.exports;dt=1;const e=rs(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class r extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const n=(i,o,c)=>{const l=c.retries-(o-1);return i.attemptNumber=o,i.retriesLeft=l,i},s=i=>t.includes(i),u=(i,o)=>new Promise((c,l)=>{o={onFailedAttempt:()=>{},retries:10,...o};const a=e.operation(o);a.attempt(async f=>{try{c(await i(f))}catch(d){if(!(d instanceof Error)){l(new TypeError(`Non-error was thrown: "${d}". You should only throw errors.`));return}if(d instanceof r)a.stop(),l(d.originalError);else if(d instanceof TypeError&&!s(d.message))a.stop(),l(d);else{n(d,f,o);try{await o.onFailedAttempt(d)}catch(m){l(m);return}a.retry(d)||l(a.mainError())}}})});return _e.exports=u,_e.exports.default=u,_e.exports.AbortError=r,_e.exports}var ns=ts();const Hi=pe(ns);var ke={},Qe={exports:{}},ht;function ss(){return ht||(ht=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,l,a){this.fn=c,this.context=l,this.once=a||!1}function u(c,l,a,f,d){if(typeof a!="function")throw new TypeError("The listener must be a function");var m=new s(a,f||c,d),h=r?r+l:l;return c._events[h]?c._events[h].fn?c._events[h]=[c._events[h],m]:c._events[h].push(m):(c._events[h]=m,c._eventsCount++),c}function i(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],a,f;if(this._eventsCount===0)return l;for(f in a=this._events)t.call(a,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},o.prototype.listeners=function(l){var a=r?r+l:l,f=this._events[a];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,m=f.length,h=new Array(m);d<m;d++)h[d]=f[d].fn;return h},o.prototype.listenerCount=function(l){var a=r?r+l:l,f=this._events[a];return f?f.fn?1:f.length:0},o.prototype.emit=function(l,a,f,d,m,h){var p=r?r+l:l;if(!this._events[p])return!1;var g=this._events[p],v=arguments.length,E,y;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,a),!0;case 3:return g.fn.call(g.context,a,f),!0;case 4:return g.fn.call(g.context,a,f,d),!0;case 5:return g.fn.call(g.context,a,f,d,m),!0;case 6:return g.fn.call(g.context,a,f,d,m,h),!0}for(y=1,E=new Array(v-1);y<v;y++)E[y-1]=arguments[y];g.fn.apply(g.context,E)}else{var q=g.length,M;for(y=0;y<q;y++)switch(g[y].once&&this.removeListener(l,g[y].fn,void 0,!0),v){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,a);break;case 3:g[y].fn.call(g[y].context,a,f);break;case 4:g[y].fn.call(g[y].context,a,f,d);break;default:if(!E)for(M=1,E=new Array(v-1);M<v;M++)E[M-1]=arguments[M];g[y].fn.apply(g[y].context,E)}}return!0},o.prototype.on=function(l,a,f){return u(this,l,a,f,!1)},o.prototype.once=function(l,a,f){return u(this,l,a,f,!0)},o.prototype.removeListener=function(l,a,f,d){var m=r?r+l:l;if(!this._events[m])return this;if(!a)return i(this,m),this;var h=this._events[m];if(h.fn)h.fn===a&&(!d||h.once)&&(!f||h.context===f)&&i(this,m);else{for(var p=0,g=[],v=h.length;p<v;p++)(h[p].fn!==a||d&&!h[p].once||f&&h[p].context!==f)&&g.push(h[p]);g.length?this._events[m]=g.length===1?g[0]:g:i(this,m)}return this},o.prototype.removeAllListeners=function(l){var a;return l?(a=r?r+l:l,this._events[a]&&i(this,a)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(Qe)),Qe.exports}var $e={exports:{}},er,pt;function is(){return pt||(pt=1,er=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))),er}var mt;function os(){if(mt)return $e.exports;mt=1;const e=is();class t extends Error{constructor(s){super(s),this.name="TimeoutError"}}const r=(n,s,u)=>new Promise((i,o)=>{if(typeof s!="number"||s<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(s===1/0){i(n);return}const c=setTimeout(()=>{if(typeof u=="function"){try{i(u())}catch(f){o(f)}return}const l=typeof u=="string"?u:`Promise timed out after ${s} milliseconds`,a=u instanceof Error?u:new t(l);typeof n.cancel=="function"&&n.cancel(),o(a)},s);e(n.then(i,o),()=>{clearTimeout(c)})});return $e.exports=r,$e.exports.default=r,$e.exports.TimeoutError=t,$e.exports}var ze={},Ce={},gt;function as(){if(gt)return Ce;gt=1,Object.defineProperty(Ce,"__esModule",{value:!0});function e(t,r,n){let s=0,u=t.length;for(;u>0;){const i=u/2|0;let o=s+i;n(t[o],r)<=0?(s=++o,u-=i+1):u=i}return s}return Ce.default=e,Ce}var vt;function us(){if(vt)return ze;vt=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=as();class t{constructor(){this._queue=[]}enqueue(n,s){s=Object.assign({priority:0},s);const u={priority:s.priority,run:n};if(this.size&&this._queue[this.size-1].priority>=s.priority){this._queue.push(u);return}const i=e.default(this._queue,u,(o,c)=>c.priority-o.priority);this._queue.splice(i,0,u)}dequeue(){const n=this._queue.shift();return n?.run}filter(n){return this._queue.filter(s=>s.priority===n.priority).map(s=>s.run)}get size(){return this._queue.length}}return ze.default=t,ze}var yt;function cs(){if(yt)return ke;yt=1,Object.defineProperty(ke,"__esModule",{value:!0});const e=ss(),t=os(),r=us(),n=()=>{},s=new t.TimeoutError;class u extends e{constructor(o){var c,l,a,f;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=n,this._resolveIdle=n,o=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:r.default},o),!(typeof o.intervalCap=="number"&&o.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(l=(c=o.intervalCap)===null||c===void 0?void 0:c.toString())!==null&&l!==void 0?l:""}\` (${typeof o.intervalCap})`);if(o.interval===void 0||!(Number.isFinite(o.interval)&&o.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(f=(a=o.interval)===null||a===void 0?void 0:a.toString())!==null&&f!==void 0?f:""}\` (${typeof o.interval})`);this._carryoverConcurrencyCount=o.carryoverConcurrencyCount,this._isIntervalIgnored=o.intervalCap===1/0||o.interval===0,this._intervalCap=o.intervalCap,this._interval=o.interval,this._queue=new o.queueClass,this._queueClass=o.queueClass,this.concurrency=o.concurrency,this._timeout=o.timeout,this._throwOnTimeout=o.throwOnTimeout===!0,this._isPaused=o.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=n,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=n,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const o=Date.now();if(this._intervalId===void 0){const c=this._intervalEnd-o;if(c<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},c)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const o=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const c=this._queue.dequeue();return c?(this.emit("active"),c(),o&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(o){if(!(typeof o=="number"&&o>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${o}\` (${typeof o})`);this._concurrency=o,this._processQueue()}async add(o,c={}){return new Promise((l,a)=>{const f=async()=>{this._pendingCount++,this._intervalCount++;try{const d=this._timeout===void 0&&c.timeout===void 0?o():t.default(Promise.resolve(o()),c.timeout===void 0?this._timeout:c.timeout,()=>{(c.throwOnTimeout===void 0?this._throwOnTimeout:c.throwOnTimeout)&&a(s)});l(await d)}catch(d){a(d)}this._next()};this._queue.enqueue(f,c),this._tryToStartAnother(),this.emit("add")})}async addAll(o,c){return Promise.all(o.map(async l=>this.add(l,c)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(o=>{const c=this._resolveEmpty;this._resolveEmpty=()=>{c(),o()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(o=>{const c=this._resolveIdle;this._resolveIdle=()=>{c(),o()}})}get size(){return this._queue.size}sizeBy(o){return this._queue.filter(o).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(o){this._timeout=o}}return ke.default=u,ke}var ls=cs();const Yi=pe(ls);var Le={exports:{}},rr,_t;function De(){if(_t)return rr;_t=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,s=t-6;return rr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},rr}var tr,$t;function Ue(){if($t)return tr;$t=1;var e={};return tr=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},tr}var Et;function be(){return Et||(Et=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=De(),u=Ue();t=e.exports={};const i=t.re=[],o=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],a=t.t={};let f=0;const d="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",s],[d,n]],h=g=>{for(const[v,E]of m)g=g.split(`${v}*`).join(`${v}{0,${E}}`).split(`${v}+`).join(`${v}{1,${E}}`);return g},p=(g,v,E)=>{const y=h(v),q=f++;u(g,q,v),a[g]=q,c[q]=v,l[q]=y,i[q]=new RegExp(v,E?"g":void 0),o[q]=new RegExp(y,E?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[a.NONNUMERICIDENTIFIER]}|${c[a.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[a.NONNUMERICIDENTIFIER]}|${c[a.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[a.PRERELEASEIDENTIFIER]}(?:\\.${c[a.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[a.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${c[a.BUILDIDENTIFIER]}(?:\\.${c[a.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[a.MAINVERSION]}${c[a.PRERELEASE]}?${c[a.BUILD]}?`),p("FULL",`^${c[a.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[a.MAINVERSIONLOOSE]}${c[a.PRERELEASELOOSE]}?${c[a.BUILD]}?`),p("LOOSE",`^${c[a.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[a.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:${c[a.PRERELEASE]})?${c[a.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:${c[a.PRERELEASELOOSE]})?${c[a.BUILD]}?)?)?`),p("XRANGE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[a.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[a.COERCEPLAIN]+`(?:${c[a.PRERELEASE]})?(?:${c[a.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[a.COERCE],!0),p("COERCERTLFULL",c[a.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[a.LONECARET]}${c[a.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[a.LONECARET]}${c[a.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[a.GTLT]}\\s*(${c[a.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]}|${c[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[a.XRANGEPLAIN]})\\s+-\\s+(${c[a.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[a.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Le,Le.exports)),Le.exports}var nr,wt;function Jr(){if(wt)return nr;wt=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return nr=n=>n?typeof n!="object"?e:n:t,nr}var sr,Rt;function bn(){if(Rt)return sr;Rt=1;const e=/^[0-9]+$/,t=(n,s)=>{if(typeof n=="number"&&typeof s=="number")return n===s?0:n<s?-1:1;const u=e.test(n),i=e.test(s);return u&&i&&(n=+n,s=+s),n===s?0:u&&!i?-1:i&&!u?1:n<s?-1:1};return sr={compareIdentifiers:t,rcompareIdentifiers:(n,s)=>t(s,n)},sr}var ir,bt;function K(){if(bt)return ir;bt=1;const e=Ue(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=De(),{safeRe:n,t:s}=be(),u=Jr(),{compareIdentifiers:i}=bn();class o{constructor(l,a){if(a=u(a),l instanceof o){if(l.loose===!!a.loose&&l.includePrerelease===!!a.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const f=l.trim().match(a.loose?n[s.LOOSE]:n[s.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const m=+d;if(m>=0&&m<r)return m}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),this.major<l.major?-1:this.major>l.major?1:this.minor<l.minor?-1:this.minor>l.minor?1:this.patch<l.patch?-1:this.patch>l.patch?1:0}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let a=0;do{const f=this.prerelease[a],d=l.prerelease[a];if(e("prerelease compare",a,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return i(f,d)}while(++a)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let a=0;do{const f=this.build[a],d=l.build[a];if(e("build compare",a,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return i(f,d)}while(++a)}inc(l,a,f){if(l.startsWith("pre")){if(!a&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(a){const d=`-${a}`.match(this.options.loose?n[s.PRERELEASELOOSE]:n[s.PRERELEASE]);if(!d||d[1]!==a)throw new Error(`invalid identifier: ${a}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",a,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",a,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",a,f),this.inc("pre",a,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",a,f),this.inc("pre",a,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let m=this.prerelease.length;for(;--m>=0;)typeof this.prerelease[m]=="number"&&(this.prerelease[m]++,m=-2);if(m===-1){if(a===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(a){let m=[a,d];f===!1&&(m=[a]),i(this.prerelease[0],a)===0?isNaN(this.prerelease[1])&&(this.prerelease=m):this.prerelease=m}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ir=o,ir}var or,It;function me(){if(It)return or;It=1;const e=K();return or=(r,n,s=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(u){if(!s)return null;throw u}},or}var ar,Ot;function fs(){if(Ot)return ar;Ot=1;const e=me();return ar=(r,n)=>{const s=e(r,n);return s?s.version:null},ar}var ur,Tt;function ds(){if(Tt)return ur;Tt=1;const e=me();return ur=(r,n)=>{const s=e(r.trim().replace(/^[=v]+/,""),n);return s?s.version:null},ur}var cr,xt;function hs(){if(xt)return cr;xt=1;const e=K();return cr=(r,n,s,u,i)=>{typeof s=="string"&&(i=u,u=s,s=void 0);try{return new e(r instanceof e?r.version:r,s).inc(n,u,i).version}catch{return null}},cr}var lr,St;function ps(){if(St)return lr;St=1;const e=me();return lr=(r,n)=>{const s=e(r,null,!0),u=e(n,null,!0),i=s.compare(u);if(i===0)return null;const o=i>0,c=o?s:u,l=o?u:s,a=!!c.prerelease.length;if(!!l.prerelease.length&&!a){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}const d=a?"pre":"";return s.major!==u.major?d+"major":s.minor!==u.minor?d+"minor":s.patch!==u.patch?d+"patch":"prerelease"},lr}var fr,Pt;function ms(){if(Pt)return fr;Pt=1;const e=K();return fr=(r,n)=>new e(r,n).major,fr}var dr,Nt;function gs(){if(Nt)return dr;Nt=1;const e=K();return dr=(r,n)=>new e(r,n).minor,dr}var hr,At;function vs(){if(At)return hr;At=1;const e=K();return hr=(r,n)=>new e(r,n).patch,hr}var pr,kt;function ys(){if(kt)return pr;kt=1;const e=me();return pr=(r,n)=>{const s=e(r,n);return s&&s.prerelease.length?s.prerelease:null},pr}var mr,zt;function ee(){if(zt)return mr;zt=1;const e=K();return mr=(r,n,s)=>new e(r,s).compare(new e(n,s)),mr}var gr,Ct;function _s(){if(Ct)return gr;Ct=1;const e=ee();return gr=(r,n,s)=>e(n,r,s),gr}var vr,Lt;function $s(){if(Lt)return vr;Lt=1;const e=ee();return vr=(r,n)=>e(r,n,!0),vr}var yr,qt;function Hr(){if(qt)return yr;qt=1;const e=K();return yr=(r,n,s)=>{const u=new e(r,s),i=new e(n,s);return u.compare(i)||u.compareBuild(i)},yr}var _r,jt;function Es(){if(jt)return _r;jt=1;const e=Hr();return _r=(r,n)=>r.sort((s,u)=>e(s,u,n)),_r}var $r,Dt;function ws(){if(Dt)return $r;Dt=1;const e=Hr();return $r=(r,n)=>r.sort((s,u)=>e(u,s,n)),$r}var Er,Ut;function Me(){if(Ut)return Er;Ut=1;const e=ee();return Er=(r,n,s)=>e(r,n,s)>0,Er}var wr,Mt;function Yr(){if(Mt)return wr;Mt=1;const e=ee();return wr=(r,n,s)=>e(r,n,s)<0,wr}var Rr,Ft;function In(){if(Ft)return Rr;Ft=1;const e=ee();return Rr=(r,n,s)=>e(r,n,s)===0,Rr}var br,Gt;function On(){if(Gt)return br;Gt=1;const e=ee();return br=(r,n,s)=>e(r,n,s)!==0,br}var Ir,Vt;function Kr(){if(Vt)return Ir;Vt=1;const e=ee();return Ir=(r,n,s)=>e(r,n,s)>=0,Ir}var Or,Bt;function Wr(){if(Bt)return Or;Bt=1;const e=ee();return Or=(r,n,s)=>e(r,n,s)<=0,Or}var Tr,Zt;function Tn(){if(Zt)return Tr;Zt=1;const e=In(),t=On(),r=Me(),n=Kr(),s=Yr(),u=Wr();return Tr=(o,c,l,a)=>{switch(c){case"===":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o===l;case"!==":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o!==l;case"":case"=":case"==":return e(o,l,a);case"!=":return t(o,l,a);case">":return r(o,l,a);case">=":return n(o,l,a);case"<":return s(o,l,a);case"<=":return u(o,l,a);default:throw new TypeError(`Invalid operator: ${c}`)}},Tr}var xr,Xt;function Rs(){if(Xt)return xr;Xt=1;const e=K(),t=me(),{safeRe:r,t:n}=be();return xr=(u,i)=>{if(u instanceof e)return u;if(typeof u=="number"&&(u=String(u)),typeof u!="string")return null;i=i||{};let o=null;if(!i.rtl)o=u.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const m=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let h;for(;(h=m.exec(u))&&(!o||o.index+o[0].length!==u.length);)(!o||h.index+h[0].length!==o.index+o[0].length)&&(o=h),m.lastIndex=h.index+h[1].length+h[2].length;m.lastIndex=-1}if(o===null)return null;const c=o[2],l=o[3]||"0",a=o[4]||"0",f=i.includePrerelease&&o[5]?`-${o[5]}`:"",d=i.includePrerelease&&o[6]?`+${o[6]}`:"";return t(`${c}.${l}.${a}${f}${d}`,i)},xr}var Sr,Jt;function bs(){if(Jt)return Sr;Jt=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const u=this.map.keys().next().value;this.delete(u)}this.map.set(r,n)}return this}}return Sr=e,Sr}var Pr,Ht;function re(){if(Ht)return Pr;Ht=1;const e=/\s+/g;class t{constructor(_,x){if(x=s(x),_ instanceof t)return _.loose===!!x.loose&&_.includePrerelease===!!x.includePrerelease?_:new t(_.raw,x);if(_ instanceof u)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=_.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(S=>!p(S[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&g(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const x=this.set[_];for(let I=0;I<x.length;I++)I>0&&(this.formatted+=" "),this.formatted+=x[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(_){const I=((this.options.includePrerelease&&m)|(this.options.loose&&h))+":"+_,S=n.get(I);if(S)return S;const O=this.options.loose,A=O?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];_=_.replace(A,de(this.options.includePrerelease)),i("hyphen replace",_),_=_.replace(c[l.COMPARATORTRIM],a),i("comparator trim",_),_=_.replace(c[l.TILDETRIM],f),i("tilde trim",_),_=_.replace(c[l.CARETTRIM],d),i("caret trim",_);let j=_.split(" ").map(D=>E(D,this.options)).join(" ").split(/\s+/).map(D=>oe(D,this.options));O&&(j=j.filter(D=>(i("loose invalid filter",D,this.options),!!D.match(c[l.COMPARATORLOOSE])))),i("range list",j);const L=new Map,F=j.map(D=>new u(D,this.options));for(const D of F){if(p(D))return[D];L.set(D.value,D)}L.size>1&&L.has("")&&L.delete("");const J=[...L.values()];return n.set(I,J),J}intersects(_,x){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>v(I,x)&&_.set.some(S=>v(S,x)&&I.every(O=>S.every(A=>O.intersects(A,x)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new o(_,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(he(this.set[x],_,this.options))return!0;return!1}}Pr=t;const r=bs(),n=new r,s=Jr(),u=Fe(),i=Ue(),o=K(),{safeRe:c,t:l,comparatorTrimReplace:a,tildeTrimReplace:f,caretTrimReplace:d}=be(),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:h}=De(),p=w=>w.value==="<0.0.0-0",g=w=>w.value==="",v=(w,_)=>{let x=!0;const I=w.slice();let S=I.pop();for(;x&&I.length;)x=I.every(O=>S.intersects(O,_)),S=I.pop();return x},E=(w,_)=>(w=w.replace(c[l.BUILD],""),i("comp",w,_),w=U(w,_),i("caret",w),w=q(w,_),i("tildes",w),w=C(w,_),i("xrange",w),w=ie(w,_),i("stars",w),w),y=w=>!w||w.toLowerCase()==="x"||w==="*",q=(w,_)=>w.trim().split(/\s+/).map(x=>M(x,_)).join(" "),M=(w,_)=>{const x=_.loose?c[l.TILDELOOSE]:c[l.TILDE];return w.replace(x,(I,S,O,A,j)=>{i("tilde",w,I,S,O,A,j);let L;return y(S)?L="":y(O)?L=`>=${S}.0.0 <${+S+1}.0.0-0`:y(A)?L=`>=${S}.${O}.0 <${S}.${+O+1}.0-0`:j?(i("replaceTilde pr",j),L=`>=${S}.${O}.${A}-${j} <${S}.${+O+1}.0-0`):L=`>=${S}.${O}.${A} <${S}.${+O+1}.0-0`,i("tilde return",L),L})},U=(w,_)=>w.trim().split(/\s+/).map(x=>B(x,_)).join(" "),B=(w,_)=>{i("caret",w,_);const x=_.loose?c[l.CARETLOOSE]:c[l.CARET],I=_.includePrerelease?"-0":"";return w.replace(x,(S,O,A,j,L)=>{i("caret",w,S,O,A,j,L);let F;return y(O)?F="":y(A)?F=`>=${O}.0.0${I} <${+O+1}.0.0-0`:y(j)?O==="0"?F=`>=${O}.${A}.0${I} <${O}.${+A+1}.0-0`:F=`>=${O}.${A}.0${I} <${+O+1}.0.0-0`:L?(i("replaceCaret pr",L),O==="0"?A==="0"?F=`>=${O}.${A}.${j}-${L} <${O}.${A}.${+j+1}-0`:F=`>=${O}.${A}.${j}-${L} <${O}.${+A+1}.0-0`:F=`>=${O}.${A}.${j}-${L} <${+O+1}.0.0-0`):(i("no pr"),O==="0"?A==="0"?F=`>=${O}.${A}.${j}${I} <${O}.${A}.${+j+1}-0`:F=`>=${O}.${A}.${j}${I} <${O}.${+A+1}.0-0`:F=`>=${O}.${A}.${j} <${+O+1}.0.0-0`),i("caret return",F),F})},C=(w,_)=>(i("replaceXRanges",w,_),w.split(/\s+/).map(x=>te(x,_)).join(" ")),te=(w,_)=>{w=w.trim();const x=_.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return w.replace(x,(I,S,O,A,j,L)=>{i("xRange",w,I,S,O,A,j,L);const F=y(O),J=F||y(A),D=J||y(j),ne=D;return S==="="&&ne&&(S=""),L=_.includePrerelease?"-0":"",F?S===">"||S==="<"?I="<0.0.0-0":I="*":S&&ne?(J&&(A=0),j=0,S===">"?(S=">=",J?(O=+O+1,A=0,j=0):(A=+A+1,j=0)):S==="<="&&(S="<",J?O=+O+1:A=+A+1),S==="<"&&(L="-0"),I=`${S+O}.${A}.${j}${L}`):J?I=`>=${O}.0.0${L} <${+O+1}.0.0-0`:D&&(I=`>=${O}.${A}.0${L} <${O}.${+A+1}.0-0`),i("xRange return",I),I})},ie=(w,_)=>(i("replaceStars",w,_),w.trim().replace(c[l.STAR],"")),oe=(w,_)=>(i("replaceGTE0",w,_),w.trim().replace(c[_.includePrerelease?l.GTE0PRE:l.GTE0],"")),de=w=>(_,x,I,S,O,A,j,L,F,J,D,ne)=>(y(I)?x="":y(S)?x=`>=${I}.0.0${w?"-0":""}`:y(O)?x=`>=${I}.${S}.0${w?"-0":""}`:A?x=`>=${x}`:x=`>=${x}${w?"-0":""}`,y(F)?L="":y(J)?L=`<${+F+1}.0.0-0`:y(D)?L=`<${F}.${+J+1}.0-0`:ne?L=`<=${F}.${J}.${D}-${ne}`:w?L=`<${F}.${J}.${+D+1}-0`:L=`<=${L}`,`${x} ${L}`.trim()),he=(w,_,x)=>{for(let I=0;I<w.length;I++)if(!w[I].test(_))return!1;if(_.prerelease.length&&!x.includePrerelease){for(let I=0;I<w.length;I++)if(i(w[I].semver),w[I].semver!==u.ANY&&w[I].semver.prerelease.length>0){const S=w[I].semver;if(S.major===_.major&&S.minor===_.minor&&S.patch===_.patch)return!0}return!1}return!0};return Pr}var Nr,Yt;function Fe(){if(Yt)return Nr;Yt=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(a,f){if(f=r(f),a instanceof t){if(a.loose===!!f.loose)return a;a=a.value}a=a.trim().split(/\s+/).join(" "),i("comparator",a,f),this.options=f,this.loose=!!f.loose,this.parse(a),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(a){const f=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],d=a.match(f);if(!d)throw new TypeError(`Invalid comparator: ${a}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new o(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(a){if(i("Comparator.test",a,this.options.loose),this.semver===e||a===e)return!0;if(typeof a=="string")try{a=new o(a,this.options)}catch{return!1}return u(a,this.operator,this.semver,this.options)}intersects(a,f){if(!(a instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(a.value,f).test(this.value):a.operator===""?a.value===""?!0:new c(this.value,f).test(a.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||a.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||a.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&a.operator.startsWith(">")||this.operator.startsWith("<")&&a.operator.startsWith("<")||this.semver.version===a.semver.version&&this.operator.includes("=")&&a.operator.includes("=")||u(this.semver,"<",a.semver,f)&&this.operator.startsWith(">")&&a.operator.startsWith("<")||u(this.semver,">",a.semver,f)&&this.operator.startsWith("<")&&a.operator.startsWith(">")))}}Nr=t;const r=Jr(),{safeRe:n,t:s}=be(),u=Tn(),i=Ue(),o=K(),c=re();return Nr}var Ar,Kt;function Ge(){if(Kt)return Ar;Kt=1;const e=re();return Ar=(r,n,s)=>{try{n=new e(n,s)}catch{return!1}return n.test(r)},Ar}var kr,Wt;function Is(){if(Wt)return kr;Wt=1;const e=re();return kr=(r,n)=>new e(r,n).set.map(s=>s.map(u=>u.value).join(" ").trim().split(" ")),kr}var zr,Qt;function Os(){if(Qt)return zr;Qt=1;const e=K(),t=re();return zr=(n,s,u)=>{let i=null,o=null,c=null;try{c=new t(s,u)}catch{return null}return n.forEach(l=>{c.test(l)&&(!i||o.compare(l)===-1)&&(i=l,o=new e(i,u))}),i},zr}var Cr,en;function Ts(){if(en)return Cr;en=1;const e=K(),t=re();return Cr=(n,s,u)=>{let i=null,o=null,c=null;try{c=new t(s,u)}catch{return null}return n.forEach(l=>{c.test(l)&&(!i||o.compare(l)===1)&&(i=l,o=new e(i,u))}),i},Cr}var Lr,rn;function xs(){if(rn)return Lr;rn=1;const e=K(),t=re(),r=Me();return Lr=(s,u)=>{s=new t(s,u);let i=new e("0.0.0");if(s.test(i)||(i=new e("0.0.0-0"),s.test(i)))return i;i=null;for(let o=0;o<s.set.length;++o){const c=s.set[o];let l=null;c.forEach(a=>{const f=new e(a.semver.version);switch(a.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!l||r(f,l))&&(l=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),l&&(!i||r(i,l))&&(i=l)}return i&&s.test(i)?i:null},Lr}var qr,tn;function Ss(){if(tn)return qr;tn=1;const e=re();return qr=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},qr}var jr,nn;function Qr(){if(nn)return jr;nn=1;const e=K(),t=Fe(),{ANY:r}=t,n=re(),s=Ge(),u=Me(),i=Yr(),o=Wr(),c=Kr();return jr=(a,f,d,m)=>{a=new e(a,m),f=new n(f,m);let h,p,g,v,E;switch(d){case">":h=u,p=o,g=i,v=">",E=">=";break;case"<":h=i,p=c,g=u,v="<",E="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(a,f,m))return!1;for(let y=0;y<f.set.length;++y){const q=f.set[y];let M=null,U=null;if(q.forEach(B=>{B.semver===r&&(B=new t(">=0.0.0")),M=M||B,U=U||B,h(B.semver,M.semver,m)?M=B:g(B.semver,U.semver,m)&&(U=B)}),M.operator===v||M.operator===E||(!U.operator||U.operator===v)&&p(a,U.semver))return!1;if(U.operator===E&&g(a,U.semver))return!1}return!0},jr}var Dr,sn;function Ps(){if(sn)return Dr;sn=1;const e=Qr();return Dr=(r,n,s)=>e(r,n,">",s),Dr}var Ur,on;function Ns(){if(on)return Ur;on=1;const e=Qr();return Ur=(r,n,s)=>e(r,n,"<",s),Ur}var Mr,an;function As(){if(an)return Mr;an=1;const e=re();return Mr=(r,n,s)=>(r=new e(r,s),n=new e(n,s),r.intersects(n,s)),Mr}var Fr,un;function ks(){if(un)return Fr;un=1;const e=Ge(),t=ee();return Fr=(r,n,s)=>{const u=[];let i=null,o=null;const c=r.sort((d,m)=>t(d,m,s));for(const d of c)e(d,n,s)?(o=d,i||(i=d)):(o&&u.push([i,o]),o=null,i=null);i&&u.push([i,null]);const l=[];for(const[d,m]of u)d===m?l.push(d):!m&&d===c[0]?l.push("*"):m?d===c[0]?l.push(`<=${m}`):l.push(`${d} - ${m}`):l.push(`>=${d}`);const a=l.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return a.length<f.length?a:n},Fr}var Gr,cn;function zs(){if(cn)return Gr;cn=1;const e=re(),t=Fe(),{ANY:r}=t,n=Ge(),s=ee(),u=(f,d,m={})=>{if(f===d)return!0;f=new e(f,m),d=new e(d,m);let h=!1;e:for(const p of f.set){for(const g of d.set){const v=c(p,g,m);if(h=h||v!==null,v)continue e}if(h)return!1}return!0},i=[new t(">=0.0.0-0")],o=[new t(">=0.0.0")],c=(f,d,m)=>{if(f===d)return!0;if(f.length===1&&f[0].semver===r){if(d.length===1&&d[0].semver===r)return!0;m.includePrerelease?f=i:f=o}if(d.length===1&&d[0].semver===r){if(m.includePrerelease)return!0;d=o}const h=new Set;let p,g;for(const C of f)C.operator===">"||C.operator===">="?p=l(p,C,m):C.operator==="<"||C.operator==="<="?g=a(g,C,m):h.add(C.semver);if(h.size>1)return null;let v;if(p&&g){if(v=s(p.semver,g.semver,m),v>0)return null;if(v===0&&(p.operator!==">="||g.operator!=="<="))return null}for(const C of h){if(p&&!n(C,String(p),m)||g&&!n(C,String(g),m))return null;for(const te of d)if(!n(C,String(te),m))return!1;return!0}let E,y,q,M,U=g&&!m.includePrerelease&&g.semver.prerelease.length?g.semver:!1,B=p&&!m.includePrerelease&&p.semver.prerelease.length?p.semver:!1;U&&U.prerelease.length===1&&g.operator==="<"&&U.prerelease[0]===0&&(U=!1);for(const C of d){if(M=M||C.operator===">"||C.operator===">=",q=q||C.operator==="<"||C.operator==="<=",p){if(B&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===B.major&&C.semver.minor===B.minor&&C.semver.patch===B.patch&&(B=!1),C.operator===">"||C.operator===">="){if(E=l(p,C,m),E===C&&E!==p)return!1}else if(p.operator===">="&&!n(p.semver,String(C),m))return!1}if(g){if(U&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===U.major&&C.semver.minor===U.minor&&C.semver.patch===U.patch&&(U=!1),C.operator==="<"||C.operator==="<="){if(y=a(g,C,m),y===C&&y!==g)return!1}else if(g.operator==="<="&&!n(g.semver,String(C),m))return!1}if(!C.operator&&(g||p)&&v!==0)return!1}return!(p&&q&&!g&&v!==0||g&&M&&!p&&v!==0||B||U)},l=(f,d,m)=>{if(!f)return d;const h=s(f.semver,d.semver,m);return h>0?f:h<0||d.operator===">"&&f.operator===">="?d:f},a=(f,d,m)=>{if(!f)return d;const h=s(f.semver,d.semver,m);return h<0?f:h>0||d.operator==="<"&&f.operator==="<="?d:f};return Gr=u,Gr}var Vr,ln;function Cs(){if(ln)return Vr;ln=1;const e=be(),t=De(),r=K(),n=bn(),s=me(),u=fs(),i=ds(),o=hs(),c=ps(),l=ms(),a=gs(),f=vs(),d=ys(),m=ee(),h=_s(),p=$s(),g=Hr(),v=Es(),E=ws(),y=Me(),q=Yr(),M=In(),U=On(),B=Kr(),C=Wr(),te=Tn(),ie=Rs(),oe=Fe(),de=re(),he=Ge(),w=Is(),_=Os(),x=Ts(),I=xs(),S=Ss(),O=Qr(),A=Ps(),j=Ns(),L=As(),F=ks(),J=zs();return Vr={parse:s,valid:u,clean:i,inc:o,diff:c,major:l,minor:a,patch:f,prerelease:d,compare:m,rcompare:h,compareLoose:p,compareBuild:g,sort:v,rsort:E,gt:y,lt:q,eq:M,neq:U,gte:B,lte:C,cmp:te,coerce:ie,Comparator:oe,Range:de,satisfies:he,toComparators:w,maxSatisfying:_,minSatisfying:x,minVersion:I,validRange:S,outside:O,gtr:A,ltr:j,intersects:L,simplifyRange:F,subset:J,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Vr}Cs();var je={exports:{}};je.exports;var fn;function Ls(){return fn||(fn=1,(function(e){const r=(u=0)=>i=>`\x1B[${38+u};5;${i}m`,n=(u=0)=>(i,o,c)=>`\x1B[${38+u};2;${i};${o};${c}m`;function s(){const u=new Map,i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};i.color.gray=i.color.blackBright,i.bgColor.bgGray=i.bgColor.bgBlackBright,i.color.grey=i.color.blackBright,i.bgColor.bgGrey=i.bgColor.bgBlackBright;for(const[o,c]of Object.entries(i)){for(const[l,a]of Object.entries(c))i[l]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},c[l]=i[l],u.set(a[0],a[1]);Object.defineProperty(i,o,{value:c,enumerable:!1})}return Object.defineProperty(i,"codes",{value:u,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi256=r(),i.color.ansi16m=n(),i.bgColor.ansi256=r(10),i.bgColor.ansi16m=n(10),Object.defineProperties(i,{rgbToAnsi256:{value:(o,c,l)=>o===c&&c===l?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(c/255*5)+Math.round(l/255*5),enumerable:!1},hexToRgb:{value:o=>{const c=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(o.toString(16));if(!c)return[0,0,0];let{colorString:l}=c.groups;l.length===3&&(l=l.split("").map(f=>f+f).join(""));const a=Number.parseInt(l,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:o=>i.rgbToAnsi256(...i.hexToRgb(o)),enumerable:!1}}),i}Object.defineProperty(e,"exports",{enumerable:!0,get:s})})(je)),je.exports}var qs=Ls();const Ki=pe(qs);function G(e,t,r){function n(o,c){var l;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(l=o._zod).traits??(l.traits=new Set),o._zod.traits.add(e),t(o,c);for(const a in i.prototype)a in o||Object.defineProperty(o,a,{value:i.prototype[a].bind(o)});o._zod.constr=i,o._zod.def=c}const s=r?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function i(o){var c;const l=r?.Parent?new u:this;n(l,o),(c=l._zod).deferred??(c.deferred=[]);for(const a of l._zod.deferred)a();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:o=>r?.Parent&&o instanceof r.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Re extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const js={};function le(e){return js}function Ds(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function Us(e,t){return typeof t=="bigint"?t.toString():t}function et(e){return e==null}function rt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Z(e,t,r){Object.defineProperty(e,t,{get(){{const n=r();return e[t]=n,n}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ms(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}const xn=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function dn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Br(e){if(dn(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(dn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sn(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function ge(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Wi(e,t){if(!Br(t))throw new Error("Invalid input to extend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Ms(this,"shape",n),n},checks:[]};return Sn(e,r)}function Qi(e,t,r){const n=t._zod.def.shape,s={...n};for(const u in n)s[u]=e?new e({type:"optional",innerType:n[u]}):n[u];return Sn(t,{...t._zod.def,shape:s,checks:[]})}function Ee(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Fs(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function qe(e){return typeof e=="string"?e:e?.message}function fe(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=qe(e.inst?._zod.def?.error?.(e))??qe(t?.error?.(e))??qe(r.customError?.(e))??qe(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function tt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gs(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Pn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Us,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vs=G("$ZodError",Pn),Ve=G("$ZodError",Pn,{Parent:Error});function eo(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function ro(e,t){const r=t||function(u){return u.message},n={_errors:[]},s=u=>{for(const i of u.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>s({issues:o}));else if(i.code==="invalid_key")s({issues:i.issues});else if(i.code==="invalid_element")s({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return s(e),n}function Bs(e){const t=[];for(const r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function to(e){const t=[],r=[...e.issues].sort((n,s)=>n.path.length-s.path.length);for(const n of r)t.push(`✖ ${n.message}`),n.path?.length&&t.push(` → at ${Bs(n.path)}`);return t.join(`
|
|
1
|
+
import{g as pe}from"./index-C_iq8viy.js";import{r as Ln}from"./index-DRz5BQNA.js";var Xe,ot;function qn(){return ot||(ot=1,Xe=function(e,t){if(typeof e!="string")throw new TypeError("Expected a string");return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+t+"$2").toLowerCase()}),Xe}var jn=qn();const Bi=pe(jn);var Ne={exports:{}},at;function Dn(){if(at)return Ne.exports;at=1;const e=/[\p{Lu}]/u,t=/[\p{Ll}]/u,r=/^[\p{Lu}](?![\p{Lu}])/gu,n=/([\p{Alpha}\p{N}_]|$)/u,s=/[_.\- ]+/,u=new RegExp("^"+s.source),i=new RegExp(s.source+n.source,"gu"),o=new RegExp("\\d+"+n.source,"gu"),c=(d,m,h)=>{let p=!1,g=!1,v=!1;for(let E=0;E<d.length;E++){const y=d[E];p&&e.test(y)?(d=d.slice(0,E)+"-"+d.slice(E),p=!1,v=g,g=!0,E++):g&&v&&t.test(y)?(d=d.slice(0,E-1)+"-"+d.slice(E-1),v=g,g=!1,p=!0):(p=m(y)===y&&h(y)!==y,v=g,g=h(y)===y&&m(y)!==y)}return d},l=(d,m)=>(r.lastIndex=0,d.replace(r,h=>m(h))),a=(d,m)=>(i.lastIndex=0,o.lastIndex=0,d.replace(i,(h,p)=>m(p)).replace(o,h=>m(h))),f=(d,m)=>{if(!(typeof d=="string"||Array.isArray(d)))throw new TypeError("Expected the input to be `string | string[]`");if(m={pascalCase:!1,preserveConsecutiveUppercase:!1,...m},Array.isArray(d)?d=d.map(v=>v.trim()).filter(v=>v.length).join("-"):d=d.trim(),d.length===0)return"";const h=m.locale===!1?v=>v.toLowerCase():v=>v.toLocaleLowerCase(m.locale),p=m.locale===!1?v=>v.toUpperCase():v=>v.toLocaleUpperCase(m.locale);return d.length===1?m.pascalCase?p(d):h(d):(d!==h(d)&&(d=c(d,h,p)),d=d.replace(u,""),m.preserveConsecutiveUppercase?d=l(d,h):d=h(d),m.pascalCase&&(d=p(d.charAt(0))+d.slice(1)),a(d,p))};return Ne.exports=f,Ne.exports.default=f,Ne.exports}var Un=Dn();const Zi=pe(Un),Mn=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Fn(e){return typeof e=="string"&&Mn.test(e)}function Gn(e){if(!Fn(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var H=[];for(var Je=0;Je<256;++Je)H.push((Je+256).toString(16).slice(1));function Rn(e,t=0){return(H[e[t+0]]+H[e[t+1]]+H[e[t+2]]+H[e[t+3]]+"-"+H[e[t+4]]+H[e[t+5]]+"-"+H[e[t+6]]+H[e[t+7]]+"-"+H[e[t+8]]+H[e[t+9]]+"-"+H[e[t+10]]+H[e[t+11]]+H[e[t+12]]+H[e[t+13]]+H[e[t+14]]+H[e[t+15]]).toLowerCase()}var Ae,Vn=new Uint8Array(16);function Bn(){if(!Ae&&(Ae=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ae))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ae(Vn)}function Zn(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Xn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Jn="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Hn(e,t,r){function n(s,u,i,o){var c;if(typeof s=="string"&&(s=Zn(s)),typeof u=="string"&&(u=Gn(u)),((c=u)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+s.length);if(l.set(u),l.set(s,u.length),l=r(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,i){o=o||0;for(var a=0;a<16;++a)i[o+a]=l[a];return i}return Rn(l)}try{n.name=e}catch{}return n.DNS=Xn,n.URL=Jn,n}var Yn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const ut={randomUUID:Yn};function Xi(e,t,r){if(ut.randomUUID&&!e)return ut.randomUUID();e=e||{};var n=e.random||(e.rng||Bn)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Rn(n)}function Kn(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function He(e,t){return e<<t|e>>>32-t}function Wn(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var n=unescape(encodeURIComponent(e));e=[];for(var s=0;s<n.length;++s)e.push(n.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var u=e.length/4+2,i=Math.ceil(u/16),o=new Array(i),c=0;c<i;++c){for(var l=new Uint32Array(16),a=0;a<16;++a)l[a]=e[c*64+a*4]<<24|e[c*64+a*4+1]<<16|e[c*64+a*4+2]<<8|e[c*64+a*4+3];o[c]=l}o[i-1][14]=(e.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(e.length-1)*8&4294967295;for(var f=0;f<i;++f){for(var d=new Uint32Array(80),m=0;m<16;++m)d[m]=o[f][m];for(var h=16;h<80;++h)d[h]=He(d[h-3]^d[h-8]^d[h-14]^d[h-16],1);for(var p=r[0],g=r[1],v=r[2],E=r[3],y=r[4],q=0;q<80;++q){var M=Math.floor(q/20),U=He(p,5)+Kn(M,g,v,E)+y+t[M]+d[q]>>>0;y=E,E=v,v=He(g,30)>>>0,g=p,p=U}r[0]=r[0]+p>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+E>>>0,r[4]=r[4]+y>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Ji=Hn("v5",80,Wn),_e={exports:{}},Ye={},Ke,ct;function Qn(){if(ct)return Ke;ct=1;function e(t,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Ke=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var r=new Date().getTime();if(t&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},n),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,r){this._fn=t,r&&(r.timeout&&(this._operationTimeout=r.timeout),r.cb&&(this._operationTimeoutCb=r.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},r=null,n=0,s=0;s<this._errors.length;s++){var u=this._errors[s],i=u.message,o=(t[i]||0)+1;t[i]=o,o>=n&&(r=u,n=o)}return r},Ke}var lt;function es(){return lt||(lt=1,(function(e){var t=Qn();e.operation=function(r){var n=e.timeouts(r);return new t(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in r)n[s]=r[s];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var u=[],i=0;i<n.retries;i++)u.push(this.createTimeout(i,n));return r&&r.forever&&!u.length&&u.push(this.createTimeout(i,n)),u.sort(function(o,c){return o-c}),u},e.createTimeout=function(r,n){var s=n.randomize?Math.random()+1:1,u=Math.round(s*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return u=Math.min(u,n.maxTimeout),u},e.wrap=function(r,n,s){if(n instanceof Array&&(s=n,n=null),!s){s=[];for(var u in r)typeof r[u]=="function"&&s.push(u)}for(var i=0;i<s.length;i++){var o=s[i],c=r[o];r[o]=(function(a){var f=e.operation(n),d=Array.prototype.slice.call(arguments,1),m=d.pop();d.push(function(h){f.retry(h)||(h&&(arguments[0]=f.mainError()),m.apply(this,arguments))}),f.attempt(function(){a.apply(r,d)})}).bind(r,c),r[o].options=n}}})(Ye)),Ye}var We,ft;function rs(){return ft||(ft=1,We=es()),We}var dt;function ts(){if(dt)return _e.exports;dt=1;const e=rs(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class r extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const n=(i,o,c)=>{const l=c.retries-(o-1);return i.attemptNumber=o,i.retriesLeft=l,i},s=i=>t.includes(i),u=(i,o)=>new Promise((c,l)=>{o={onFailedAttempt:()=>{},retries:10,...o};const a=e.operation(o);a.attempt(async f=>{try{c(await i(f))}catch(d){if(!(d instanceof Error)){l(new TypeError(`Non-error was thrown: "${d}". You should only throw errors.`));return}if(d instanceof r)a.stop(),l(d.originalError);else if(d instanceof TypeError&&!s(d.message))a.stop(),l(d);else{n(d,f,o);try{await o.onFailedAttempt(d)}catch(m){l(m);return}a.retry(d)||l(a.mainError())}}})});return _e.exports=u,_e.exports.default=u,_e.exports.AbortError=r,_e.exports}var ns=ts();const Hi=pe(ns);var ke={},Qe={exports:{}},ht;function ss(){return ht||(ht=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,l,a){this.fn=c,this.context=l,this.once=a||!1}function u(c,l,a,f,d){if(typeof a!="function")throw new TypeError("The listener must be a function");var m=new s(a,f||c,d),h=r?r+l:l;return c._events[h]?c._events[h].fn?c._events[h]=[c._events[h],m]:c._events[h].push(m):(c._events[h]=m,c._eventsCount++),c}function i(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],a,f;if(this._eventsCount===0)return l;for(f in a=this._events)t.call(a,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(a)):l},o.prototype.listeners=function(l){var a=r?r+l:l,f=this._events[a];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,m=f.length,h=new Array(m);d<m;d++)h[d]=f[d].fn;return h},o.prototype.listenerCount=function(l){var a=r?r+l:l,f=this._events[a];return f?f.fn?1:f.length:0},o.prototype.emit=function(l,a,f,d,m,h){var p=r?r+l:l;if(!this._events[p])return!1;var g=this._events[p],v=arguments.length,E,y;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,a),!0;case 3:return g.fn.call(g.context,a,f),!0;case 4:return g.fn.call(g.context,a,f,d),!0;case 5:return g.fn.call(g.context,a,f,d,m),!0;case 6:return g.fn.call(g.context,a,f,d,m,h),!0}for(y=1,E=new Array(v-1);y<v;y++)E[y-1]=arguments[y];g.fn.apply(g.context,E)}else{var q=g.length,M;for(y=0;y<q;y++)switch(g[y].once&&this.removeListener(l,g[y].fn,void 0,!0),v){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,a);break;case 3:g[y].fn.call(g[y].context,a,f);break;case 4:g[y].fn.call(g[y].context,a,f,d);break;default:if(!E)for(M=1,E=new Array(v-1);M<v;M++)E[M-1]=arguments[M];g[y].fn.apply(g[y].context,E)}}return!0},o.prototype.on=function(l,a,f){return u(this,l,a,f,!1)},o.prototype.once=function(l,a,f){return u(this,l,a,f,!0)},o.prototype.removeListener=function(l,a,f,d){var m=r?r+l:l;if(!this._events[m])return this;if(!a)return i(this,m),this;var h=this._events[m];if(h.fn)h.fn===a&&(!d||h.once)&&(!f||h.context===f)&&i(this,m);else{for(var p=0,g=[],v=h.length;p<v;p++)(h[p].fn!==a||d&&!h[p].once||f&&h[p].context!==f)&&g.push(h[p]);g.length?this._events[m]=g.length===1?g[0]:g:i(this,m)}return this},o.prototype.removeAllListeners=function(l){var a;return l?(a=r?r+l:l,this._events[a]&&i(this,a)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(Qe)),Qe.exports}var $e={exports:{}},er,pt;function is(){return pt||(pt=1,er=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))),er}var mt;function os(){if(mt)return $e.exports;mt=1;const e=is();class t extends Error{constructor(s){super(s),this.name="TimeoutError"}}const r=(n,s,u)=>new Promise((i,o)=>{if(typeof s!="number"||s<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(s===1/0){i(n);return}const c=setTimeout(()=>{if(typeof u=="function"){try{i(u())}catch(f){o(f)}return}const l=typeof u=="string"?u:`Promise timed out after ${s} milliseconds`,a=u instanceof Error?u:new t(l);typeof n.cancel=="function"&&n.cancel(),o(a)},s);e(n.then(i,o),()=>{clearTimeout(c)})});return $e.exports=r,$e.exports.default=r,$e.exports.TimeoutError=t,$e.exports}var ze={},Ce={},gt;function as(){if(gt)return Ce;gt=1,Object.defineProperty(Ce,"__esModule",{value:!0});function e(t,r,n){let s=0,u=t.length;for(;u>0;){const i=u/2|0;let o=s+i;n(t[o],r)<=0?(s=++o,u-=i+1):u=i}return s}return Ce.default=e,Ce}var vt;function us(){if(vt)return ze;vt=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=as();class t{constructor(){this._queue=[]}enqueue(n,s){s=Object.assign({priority:0},s);const u={priority:s.priority,run:n};if(this.size&&this._queue[this.size-1].priority>=s.priority){this._queue.push(u);return}const i=e.default(this._queue,u,(o,c)=>c.priority-o.priority);this._queue.splice(i,0,u)}dequeue(){const n=this._queue.shift();return n?.run}filter(n){return this._queue.filter(s=>s.priority===n.priority).map(s=>s.run)}get size(){return this._queue.length}}return ze.default=t,ze}var yt;function cs(){if(yt)return ke;yt=1,Object.defineProperty(ke,"__esModule",{value:!0});const e=ss(),t=os(),r=us(),n=()=>{},s=new t.TimeoutError;class u extends e{constructor(o){var c,l,a,f;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=n,this._resolveIdle=n,o=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:r.default},o),!(typeof o.intervalCap=="number"&&o.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(l=(c=o.intervalCap)===null||c===void 0?void 0:c.toString())!==null&&l!==void 0?l:""}\` (${typeof o.intervalCap})`);if(o.interval===void 0||!(Number.isFinite(o.interval)&&o.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(f=(a=o.interval)===null||a===void 0?void 0:a.toString())!==null&&f!==void 0?f:""}\` (${typeof o.interval})`);this._carryoverConcurrencyCount=o.carryoverConcurrencyCount,this._isIntervalIgnored=o.intervalCap===1/0||o.interval===0,this._intervalCap=o.intervalCap,this._interval=o.interval,this._queue=new o.queueClass,this._queueClass=o.queueClass,this.concurrency=o.concurrency,this._timeout=o.timeout,this._throwOnTimeout=o.throwOnTimeout===!0,this._isPaused=o.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=n,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=n,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const o=Date.now();if(this._intervalId===void 0){const c=this._intervalEnd-o;if(c<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},c)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const o=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const c=this._queue.dequeue();return c?(this.emit("active"),c(),o&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(o){if(!(typeof o=="number"&&o>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${o}\` (${typeof o})`);this._concurrency=o,this._processQueue()}async add(o,c={}){return new Promise((l,a)=>{const f=async()=>{this._pendingCount++,this._intervalCount++;try{const d=this._timeout===void 0&&c.timeout===void 0?o():t.default(Promise.resolve(o()),c.timeout===void 0?this._timeout:c.timeout,()=>{(c.throwOnTimeout===void 0?this._throwOnTimeout:c.throwOnTimeout)&&a(s)});l(await d)}catch(d){a(d)}this._next()};this._queue.enqueue(f,c),this._tryToStartAnother(),this.emit("add")})}async addAll(o,c){return Promise.all(o.map(async l=>this.add(l,c)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(o=>{const c=this._resolveEmpty;this._resolveEmpty=()=>{c(),o()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(o=>{const c=this._resolveIdle;this._resolveIdle=()=>{c(),o()}})}get size(){return this._queue.size}sizeBy(o){return this._queue.filter(o).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(o){this._timeout=o}}return ke.default=u,ke}var ls=cs();const Yi=pe(ls);var Le={exports:{}},rr,_t;function De(){if(_t)return rr;_t=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,s=t-6;return rr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},rr}var tr,$t;function Ue(){if($t)return tr;$t=1;var e={};return tr=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},tr}var Et;function be(){return Et||(Et=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=De(),u=Ue();t=e.exports={};const i=t.re=[],o=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],a=t.t={};let f=0;const d="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",s],[d,n]],h=g=>{for(const[v,E]of m)g=g.split(`${v}*`).join(`${v}{0,${E}}`).split(`${v}+`).join(`${v}{1,${E}}`);return g},p=(g,v,E)=>{const y=h(v),q=f++;u(g,q,v),a[g]=q,c[q]=v,l[q]=y,i[q]=new RegExp(v,E?"g":void 0),o[q]=new RegExp(y,E?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})\\.(${c[a.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})\\.(${c[a.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[a.NONNUMERICIDENTIFIER]}|${c[a.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[a.NONNUMERICIDENTIFIER]}|${c[a.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[a.PRERELEASEIDENTIFIER]}(?:\\.${c[a.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[a.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${c[a.BUILDIDENTIFIER]}(?:\\.${c[a.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[a.MAINVERSION]}${c[a.PRERELEASE]}?${c[a.BUILD]}?`),p("FULL",`^${c[a.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[a.MAINVERSIONLOOSE]}${c[a.PRERELEASELOOSE]}?${c[a.BUILD]}?`),p("LOOSE",`^${c[a.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[a.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:\\.(${c[a.XRANGEIDENTIFIER]})(?:${c[a.PRERELEASE]})?${c[a.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[a.XRANGEIDENTIFIERLOOSE]})(?:${c[a.PRERELEASELOOSE]})?${c[a.BUILD]}?)?)?`),p("XRANGE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[a.GTLT]}\\s*${c[a.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[a.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[a.COERCEPLAIN]+`(?:${c[a.PRERELEASE]})?(?:${c[a.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[a.COERCE],!0),p("COERCERTLFULL",c[a.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[a.LONETILDE]}${c[a.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[a.LONECARET]}${c[a.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[a.LONECARET]}${c[a.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[a.GTLT]}\\s*(${c[a.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[a.GTLT]}\\s*(${c[a.LOOSEPLAIN]}|${c[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[a.XRANGEPLAIN]})\\s+-\\s+(${c[a.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[a.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Le,Le.exports)),Le.exports}var nr,wt;function Jr(){if(wt)return nr;wt=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return nr=n=>n?typeof n!="object"?e:n:t,nr}var sr,Rt;function bn(){if(Rt)return sr;Rt=1;const e=/^[0-9]+$/,t=(n,s)=>{if(typeof n=="number"&&typeof s=="number")return n===s?0:n<s?-1:1;const u=e.test(n),i=e.test(s);return u&&i&&(n=+n,s=+s),n===s?0:u&&!i?-1:i&&!u?1:n<s?-1:1};return sr={compareIdentifiers:t,rcompareIdentifiers:(n,s)=>t(s,n)},sr}var ir,bt;function K(){if(bt)return ir;bt=1;const e=Ue(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=De(),{safeRe:n,t:s}=be(),u=Jr(),{compareIdentifiers:i}=bn();class o{constructor(l,a){if(a=u(a),l instanceof o){if(l.loose===!!a.loose&&l.includePrerelease===!!a.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const f=l.trim().match(a.loose?n[s.LOOSE]:n[s.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const m=+d;if(m>=0&&m<r)return m}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),this.major<l.major?-1:this.major>l.major?1:this.minor<l.minor?-1:this.minor>l.minor?1:this.patch<l.patch?-1:this.patch>l.patch?1:0}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let a=0;do{const f=this.prerelease[a],d=l.prerelease[a];if(e("prerelease compare",a,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return i(f,d)}while(++a)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let a=0;do{const f=this.build[a],d=l.build[a];if(e("build compare",a,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return i(f,d)}while(++a)}inc(l,a,f){if(l.startsWith("pre")){if(!a&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(a){const d=`-${a}`.match(this.options.loose?n[s.PRERELEASELOOSE]:n[s.PRERELEASE]);if(!d||d[1]!==a)throw new Error(`invalid identifier: ${a}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",a,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",a,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",a,f),this.inc("pre",a,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",a,f),this.inc("pre",a,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[d];else{let m=this.prerelease.length;for(;--m>=0;)typeof this.prerelease[m]=="number"&&(this.prerelease[m]++,m=-2);if(m===-1){if(a===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(a){let m=[a,d];f===!1&&(m=[a]),i(this.prerelease[0],a)===0?isNaN(this.prerelease[1])&&(this.prerelease=m):this.prerelease=m}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ir=o,ir}var or,It;function me(){if(It)return or;It=1;const e=K();return or=(r,n,s=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(u){if(!s)return null;throw u}},or}var ar,Ot;function fs(){if(Ot)return ar;Ot=1;const e=me();return ar=(r,n)=>{const s=e(r,n);return s?s.version:null},ar}var ur,Tt;function ds(){if(Tt)return ur;Tt=1;const e=me();return ur=(r,n)=>{const s=e(r.trim().replace(/^[=v]+/,""),n);return s?s.version:null},ur}var cr,xt;function hs(){if(xt)return cr;xt=1;const e=K();return cr=(r,n,s,u,i)=>{typeof s=="string"&&(i=u,u=s,s=void 0);try{return new e(r instanceof e?r.version:r,s).inc(n,u,i).version}catch{return null}},cr}var lr,St;function ps(){if(St)return lr;St=1;const e=me();return lr=(r,n)=>{const s=e(r,null,!0),u=e(n,null,!0),i=s.compare(u);if(i===0)return null;const o=i>0,c=o?s:u,l=o?u:s,a=!!c.prerelease.length;if(!!l.prerelease.length&&!a){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}const d=a?"pre":"";return s.major!==u.major?d+"major":s.minor!==u.minor?d+"minor":s.patch!==u.patch?d+"patch":"prerelease"},lr}var fr,Pt;function ms(){if(Pt)return fr;Pt=1;const e=K();return fr=(r,n)=>new e(r,n).major,fr}var dr,Nt;function gs(){if(Nt)return dr;Nt=1;const e=K();return dr=(r,n)=>new e(r,n).minor,dr}var hr,At;function vs(){if(At)return hr;At=1;const e=K();return hr=(r,n)=>new e(r,n).patch,hr}var pr,kt;function ys(){if(kt)return pr;kt=1;const e=me();return pr=(r,n)=>{const s=e(r,n);return s&&s.prerelease.length?s.prerelease:null},pr}var mr,zt;function ee(){if(zt)return mr;zt=1;const e=K();return mr=(r,n,s)=>new e(r,s).compare(new e(n,s)),mr}var gr,Ct;function _s(){if(Ct)return gr;Ct=1;const e=ee();return gr=(r,n,s)=>e(n,r,s),gr}var vr,Lt;function $s(){if(Lt)return vr;Lt=1;const e=ee();return vr=(r,n)=>e(r,n,!0),vr}var yr,qt;function Hr(){if(qt)return yr;qt=1;const e=K();return yr=(r,n,s)=>{const u=new e(r,s),i=new e(n,s);return u.compare(i)||u.compareBuild(i)},yr}var _r,jt;function Es(){if(jt)return _r;jt=1;const e=Hr();return _r=(r,n)=>r.sort((s,u)=>e(s,u,n)),_r}var $r,Dt;function ws(){if(Dt)return $r;Dt=1;const e=Hr();return $r=(r,n)=>r.sort((s,u)=>e(u,s,n)),$r}var Er,Ut;function Me(){if(Ut)return Er;Ut=1;const e=ee();return Er=(r,n,s)=>e(r,n,s)>0,Er}var wr,Mt;function Yr(){if(Mt)return wr;Mt=1;const e=ee();return wr=(r,n,s)=>e(r,n,s)<0,wr}var Rr,Ft;function In(){if(Ft)return Rr;Ft=1;const e=ee();return Rr=(r,n,s)=>e(r,n,s)===0,Rr}var br,Gt;function On(){if(Gt)return br;Gt=1;const e=ee();return br=(r,n,s)=>e(r,n,s)!==0,br}var Ir,Vt;function Kr(){if(Vt)return Ir;Vt=1;const e=ee();return Ir=(r,n,s)=>e(r,n,s)>=0,Ir}var Or,Bt;function Wr(){if(Bt)return Or;Bt=1;const e=ee();return Or=(r,n,s)=>e(r,n,s)<=0,Or}var Tr,Zt;function Tn(){if(Zt)return Tr;Zt=1;const e=In(),t=On(),r=Me(),n=Kr(),s=Yr(),u=Wr();return Tr=(o,c,l,a)=>{switch(c){case"===":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o===l;case"!==":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o!==l;case"":case"=":case"==":return e(o,l,a);case"!=":return t(o,l,a);case">":return r(o,l,a);case">=":return n(o,l,a);case"<":return s(o,l,a);case"<=":return u(o,l,a);default:throw new TypeError(`Invalid operator: ${c}`)}},Tr}var xr,Xt;function Rs(){if(Xt)return xr;Xt=1;const e=K(),t=me(),{safeRe:r,t:n}=be();return xr=(u,i)=>{if(u instanceof e)return u;if(typeof u=="number"&&(u=String(u)),typeof u!="string")return null;i=i||{};let o=null;if(!i.rtl)o=u.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const m=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let h;for(;(h=m.exec(u))&&(!o||o.index+o[0].length!==u.length);)(!o||h.index+h[0].length!==o.index+o[0].length)&&(o=h),m.lastIndex=h.index+h[1].length+h[2].length;m.lastIndex=-1}if(o===null)return null;const c=o[2],l=o[3]||"0",a=o[4]||"0",f=i.includePrerelease&&o[5]?`-${o[5]}`:"",d=i.includePrerelease&&o[6]?`+${o[6]}`:"";return t(`${c}.${l}.${a}${f}${d}`,i)},xr}var Sr,Jt;function bs(){if(Jt)return Sr;Jt=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const u=this.map.keys().next().value;this.delete(u)}this.map.set(r,n)}return this}}return Sr=e,Sr}var Pr,Ht;function re(){if(Ht)return Pr;Ht=1;const e=/\s+/g;class t{constructor(_,x){if(x=s(x),_ instanceof t)return _.loose===!!x.loose&&_.includePrerelease===!!x.includePrerelease?_:new t(_.raw,x);if(_ instanceof u)return this.raw=_.value,this.set=[[_]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=_.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(S=>!p(S[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&g(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let _=0;_<this.set.length;_++){_>0&&(this.formatted+="||");const x=this.set[_];for(let I=0;I<x.length;I++)I>0&&(this.formatted+=" "),this.formatted+=x[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(_){const I=((this.options.includePrerelease&&m)|(this.options.loose&&h))+":"+_,S=n.get(I);if(S)return S;const O=this.options.loose,A=O?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];_=_.replace(A,de(this.options.includePrerelease)),i("hyphen replace",_),_=_.replace(c[l.COMPARATORTRIM],a),i("comparator trim",_),_=_.replace(c[l.TILDETRIM],f),i("tilde trim",_),_=_.replace(c[l.CARETTRIM],d),i("caret trim",_);let j=_.split(" ").map(D=>E(D,this.options)).join(" ").split(/\s+/).map(D=>oe(D,this.options));O&&(j=j.filter(D=>(i("loose invalid filter",D,this.options),!!D.match(c[l.COMPARATORLOOSE])))),i("range list",j);const L=new Map,F=j.map(D=>new u(D,this.options));for(const D of F){if(p(D))return[D];L.set(D.value,D)}L.size>1&&L.has("")&&L.delete("");const J=[...L.values()];return n.set(I,J),J}intersects(_,x){if(!(_ instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>v(I,x)&&_.set.some(S=>v(S,x)&&I.every(O=>S.every(A=>O.intersects(A,x)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new o(_,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(he(this.set[x],_,this.options))return!0;return!1}}Pr=t;const r=bs(),n=new r,s=Jr(),u=Fe(),i=Ue(),o=K(),{safeRe:c,t:l,comparatorTrimReplace:a,tildeTrimReplace:f,caretTrimReplace:d}=be(),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:h}=De(),p=w=>w.value==="<0.0.0-0",g=w=>w.value==="",v=(w,_)=>{let x=!0;const I=w.slice();let S=I.pop();for(;x&&I.length;)x=I.every(O=>S.intersects(O,_)),S=I.pop();return x},E=(w,_)=>(w=w.replace(c[l.BUILD],""),i("comp",w,_),w=U(w,_),i("caret",w),w=q(w,_),i("tildes",w),w=C(w,_),i("xrange",w),w=ie(w,_),i("stars",w),w),y=w=>!w||w.toLowerCase()==="x"||w==="*",q=(w,_)=>w.trim().split(/\s+/).map(x=>M(x,_)).join(" "),M=(w,_)=>{const x=_.loose?c[l.TILDELOOSE]:c[l.TILDE];return w.replace(x,(I,S,O,A,j)=>{i("tilde",w,I,S,O,A,j);let L;return y(S)?L="":y(O)?L=`>=${S}.0.0 <${+S+1}.0.0-0`:y(A)?L=`>=${S}.${O}.0 <${S}.${+O+1}.0-0`:j?(i("replaceTilde pr",j),L=`>=${S}.${O}.${A}-${j} <${S}.${+O+1}.0-0`):L=`>=${S}.${O}.${A} <${S}.${+O+1}.0-0`,i("tilde return",L),L})},U=(w,_)=>w.trim().split(/\s+/).map(x=>B(x,_)).join(" "),B=(w,_)=>{i("caret",w,_);const x=_.loose?c[l.CARETLOOSE]:c[l.CARET],I=_.includePrerelease?"-0":"";return w.replace(x,(S,O,A,j,L)=>{i("caret",w,S,O,A,j,L);let F;return y(O)?F="":y(A)?F=`>=${O}.0.0${I} <${+O+1}.0.0-0`:y(j)?O==="0"?F=`>=${O}.${A}.0${I} <${O}.${+A+1}.0-0`:F=`>=${O}.${A}.0${I} <${+O+1}.0.0-0`:L?(i("replaceCaret pr",L),O==="0"?A==="0"?F=`>=${O}.${A}.${j}-${L} <${O}.${A}.${+j+1}-0`:F=`>=${O}.${A}.${j}-${L} <${O}.${+A+1}.0-0`:F=`>=${O}.${A}.${j}-${L} <${+O+1}.0.0-0`):(i("no pr"),O==="0"?A==="0"?F=`>=${O}.${A}.${j}${I} <${O}.${A}.${+j+1}-0`:F=`>=${O}.${A}.${j}${I} <${O}.${+A+1}.0-0`:F=`>=${O}.${A}.${j} <${+O+1}.0.0-0`),i("caret return",F),F})},C=(w,_)=>(i("replaceXRanges",w,_),w.split(/\s+/).map(x=>te(x,_)).join(" ")),te=(w,_)=>{w=w.trim();const x=_.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return w.replace(x,(I,S,O,A,j,L)=>{i("xRange",w,I,S,O,A,j,L);const F=y(O),J=F||y(A),D=J||y(j),ne=D;return S==="="&&ne&&(S=""),L=_.includePrerelease?"-0":"",F?S===">"||S==="<"?I="<0.0.0-0":I="*":S&&ne?(J&&(A=0),j=0,S===">"?(S=">=",J?(O=+O+1,A=0,j=0):(A=+A+1,j=0)):S==="<="&&(S="<",J?O=+O+1:A=+A+1),S==="<"&&(L="-0"),I=`${S+O}.${A}.${j}${L}`):J?I=`>=${O}.0.0${L} <${+O+1}.0.0-0`:D&&(I=`>=${O}.${A}.0${L} <${O}.${+A+1}.0-0`),i("xRange return",I),I})},ie=(w,_)=>(i("replaceStars",w,_),w.trim().replace(c[l.STAR],"")),oe=(w,_)=>(i("replaceGTE0",w,_),w.trim().replace(c[_.includePrerelease?l.GTE0PRE:l.GTE0],"")),de=w=>(_,x,I,S,O,A,j,L,F,J,D,ne)=>(y(I)?x="":y(S)?x=`>=${I}.0.0${w?"-0":""}`:y(O)?x=`>=${I}.${S}.0${w?"-0":""}`:A?x=`>=${x}`:x=`>=${x}${w?"-0":""}`,y(F)?L="":y(J)?L=`<${+F+1}.0.0-0`:y(D)?L=`<${F}.${+J+1}.0-0`:ne?L=`<=${F}.${J}.${D}-${ne}`:w?L=`<${F}.${J}.${+D+1}-0`:L=`<=${L}`,`${x} ${L}`.trim()),he=(w,_,x)=>{for(let I=0;I<w.length;I++)if(!w[I].test(_))return!1;if(_.prerelease.length&&!x.includePrerelease){for(let I=0;I<w.length;I++)if(i(w[I].semver),w[I].semver!==u.ANY&&w[I].semver.prerelease.length>0){const S=w[I].semver;if(S.major===_.major&&S.minor===_.minor&&S.patch===_.patch)return!0}return!1}return!0};return Pr}var Nr,Yt;function Fe(){if(Yt)return Nr;Yt=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(a,f){if(f=r(f),a instanceof t){if(a.loose===!!f.loose)return a;a=a.value}a=a.trim().split(/\s+/).join(" "),i("comparator",a,f),this.options=f,this.loose=!!f.loose,this.parse(a),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(a){const f=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],d=a.match(f);if(!d)throw new TypeError(`Invalid comparator: ${a}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new o(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(a){if(i("Comparator.test",a,this.options.loose),this.semver===e||a===e)return!0;if(typeof a=="string")try{a=new o(a,this.options)}catch{return!1}return u(a,this.operator,this.semver,this.options)}intersects(a,f){if(!(a instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(a.value,f).test(this.value):a.operator===""?a.value===""?!0:new c(this.value,f).test(a.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||a.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||a.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&a.operator.startsWith(">")||this.operator.startsWith("<")&&a.operator.startsWith("<")||this.semver.version===a.semver.version&&this.operator.includes("=")&&a.operator.includes("=")||u(this.semver,"<",a.semver,f)&&this.operator.startsWith(">")&&a.operator.startsWith("<")||u(this.semver,">",a.semver,f)&&this.operator.startsWith("<")&&a.operator.startsWith(">")))}}Nr=t;const r=Jr(),{safeRe:n,t:s}=be(),u=Tn(),i=Ue(),o=K(),c=re();return Nr}var Ar,Kt;function Ge(){if(Kt)return Ar;Kt=1;const e=re();return Ar=(r,n,s)=>{try{n=new e(n,s)}catch{return!1}return n.test(r)},Ar}var kr,Wt;function Is(){if(Wt)return kr;Wt=1;const e=re();return kr=(r,n)=>new e(r,n).set.map(s=>s.map(u=>u.value).join(" ").trim().split(" ")),kr}var zr,Qt;function Os(){if(Qt)return zr;Qt=1;const e=K(),t=re();return zr=(n,s,u)=>{let i=null,o=null,c=null;try{c=new t(s,u)}catch{return null}return n.forEach(l=>{c.test(l)&&(!i||o.compare(l)===-1)&&(i=l,o=new e(i,u))}),i},zr}var Cr,en;function Ts(){if(en)return Cr;en=1;const e=K(),t=re();return Cr=(n,s,u)=>{let i=null,o=null,c=null;try{c=new t(s,u)}catch{return null}return n.forEach(l=>{c.test(l)&&(!i||o.compare(l)===1)&&(i=l,o=new e(i,u))}),i},Cr}var Lr,rn;function xs(){if(rn)return Lr;rn=1;const e=K(),t=re(),r=Me();return Lr=(s,u)=>{s=new t(s,u);let i=new e("0.0.0");if(s.test(i)||(i=new e("0.0.0-0"),s.test(i)))return i;i=null;for(let o=0;o<s.set.length;++o){const c=s.set[o];let l=null;c.forEach(a=>{const f=new e(a.semver.version);switch(a.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!l||r(f,l))&&(l=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),l&&(!i||r(i,l))&&(i=l)}return i&&s.test(i)?i:null},Lr}var qr,tn;function Ss(){if(tn)return qr;tn=1;const e=re();return qr=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},qr}var jr,nn;function Qr(){if(nn)return jr;nn=1;const e=K(),t=Fe(),{ANY:r}=t,n=re(),s=Ge(),u=Me(),i=Yr(),o=Wr(),c=Kr();return jr=(a,f,d,m)=>{a=new e(a,m),f=new n(f,m);let h,p,g,v,E;switch(d){case">":h=u,p=o,g=i,v=">",E=">=";break;case"<":h=i,p=c,g=u,v="<",E="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(a,f,m))return!1;for(let y=0;y<f.set.length;++y){const q=f.set[y];let M=null,U=null;if(q.forEach(B=>{B.semver===r&&(B=new t(">=0.0.0")),M=M||B,U=U||B,h(B.semver,M.semver,m)?M=B:g(B.semver,U.semver,m)&&(U=B)}),M.operator===v||M.operator===E||(!U.operator||U.operator===v)&&p(a,U.semver))return!1;if(U.operator===E&&g(a,U.semver))return!1}return!0},jr}var Dr,sn;function Ps(){if(sn)return Dr;sn=1;const e=Qr();return Dr=(r,n,s)=>e(r,n,">",s),Dr}var Ur,on;function Ns(){if(on)return Ur;on=1;const e=Qr();return Ur=(r,n,s)=>e(r,n,"<",s),Ur}var Mr,an;function As(){if(an)return Mr;an=1;const e=re();return Mr=(r,n,s)=>(r=new e(r,s),n=new e(n,s),r.intersects(n,s)),Mr}var Fr,un;function ks(){if(un)return Fr;un=1;const e=Ge(),t=ee();return Fr=(r,n,s)=>{const u=[];let i=null,o=null;const c=r.sort((d,m)=>t(d,m,s));for(const d of c)e(d,n,s)?(o=d,i||(i=d)):(o&&u.push([i,o]),o=null,i=null);i&&u.push([i,null]);const l=[];for(const[d,m]of u)d===m?l.push(d):!m&&d===c[0]?l.push("*"):m?d===c[0]?l.push(`<=${m}`):l.push(`${d} - ${m}`):l.push(`>=${d}`);const a=l.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return a.length<f.length?a:n},Fr}var Gr,cn;function zs(){if(cn)return Gr;cn=1;const e=re(),t=Fe(),{ANY:r}=t,n=Ge(),s=ee(),u=(f,d,m={})=>{if(f===d)return!0;f=new e(f,m),d=new e(d,m);let h=!1;e:for(const p of f.set){for(const g of d.set){const v=c(p,g,m);if(h=h||v!==null,v)continue e}if(h)return!1}return!0},i=[new t(">=0.0.0-0")],o=[new t(">=0.0.0")],c=(f,d,m)=>{if(f===d)return!0;if(f.length===1&&f[0].semver===r){if(d.length===1&&d[0].semver===r)return!0;m.includePrerelease?f=i:f=o}if(d.length===1&&d[0].semver===r){if(m.includePrerelease)return!0;d=o}const h=new Set;let p,g;for(const C of f)C.operator===">"||C.operator===">="?p=l(p,C,m):C.operator==="<"||C.operator==="<="?g=a(g,C,m):h.add(C.semver);if(h.size>1)return null;let v;if(p&&g){if(v=s(p.semver,g.semver,m),v>0)return null;if(v===0&&(p.operator!==">="||g.operator!=="<="))return null}for(const C of h){if(p&&!n(C,String(p),m)||g&&!n(C,String(g),m))return null;for(const te of d)if(!n(C,String(te),m))return!1;return!0}let E,y,q,M,U=g&&!m.includePrerelease&&g.semver.prerelease.length?g.semver:!1,B=p&&!m.includePrerelease&&p.semver.prerelease.length?p.semver:!1;U&&U.prerelease.length===1&&g.operator==="<"&&U.prerelease[0]===0&&(U=!1);for(const C of d){if(M=M||C.operator===">"||C.operator===">=",q=q||C.operator==="<"||C.operator==="<=",p){if(B&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===B.major&&C.semver.minor===B.minor&&C.semver.patch===B.patch&&(B=!1),C.operator===">"||C.operator===">="){if(E=l(p,C,m),E===C&&E!==p)return!1}else if(p.operator===">="&&!n(p.semver,String(C),m))return!1}if(g){if(U&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===U.major&&C.semver.minor===U.minor&&C.semver.patch===U.patch&&(U=!1),C.operator==="<"||C.operator==="<="){if(y=a(g,C,m),y===C&&y!==g)return!1}else if(g.operator==="<="&&!n(g.semver,String(C),m))return!1}if(!C.operator&&(g||p)&&v!==0)return!1}return!(p&&q&&!g&&v!==0||g&&M&&!p&&v!==0||B||U)},l=(f,d,m)=>{if(!f)return d;const h=s(f.semver,d.semver,m);return h>0?f:h<0||d.operator===">"&&f.operator===">="?d:f},a=(f,d,m)=>{if(!f)return d;const h=s(f.semver,d.semver,m);return h<0?f:h>0||d.operator==="<"&&f.operator==="<="?d:f};return Gr=u,Gr}var Vr,ln;function Cs(){if(ln)return Vr;ln=1;const e=be(),t=De(),r=K(),n=bn(),s=me(),u=fs(),i=ds(),o=hs(),c=ps(),l=ms(),a=gs(),f=vs(),d=ys(),m=ee(),h=_s(),p=$s(),g=Hr(),v=Es(),E=ws(),y=Me(),q=Yr(),M=In(),U=On(),B=Kr(),C=Wr(),te=Tn(),ie=Rs(),oe=Fe(),de=re(),he=Ge(),w=Is(),_=Os(),x=Ts(),I=xs(),S=Ss(),O=Qr(),A=Ps(),j=Ns(),L=As(),F=ks(),J=zs();return Vr={parse:s,valid:u,clean:i,inc:o,diff:c,major:l,minor:a,patch:f,prerelease:d,compare:m,rcompare:h,compareLoose:p,compareBuild:g,sort:v,rsort:E,gt:y,lt:q,eq:M,neq:U,gte:B,lte:C,cmp:te,coerce:ie,Comparator:oe,Range:de,satisfies:he,toComparators:w,maxSatisfying:_,minSatisfying:x,minVersion:I,validRange:S,outside:O,gtr:A,ltr:j,intersects:L,simplifyRange:F,subset:J,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Vr}Cs();var je={exports:{}};je.exports;var fn;function Ls(){return fn||(fn=1,(function(e){const r=(u=0)=>i=>`\x1B[${38+u};5;${i}m`,n=(u=0)=>(i,o,c)=>`\x1B[${38+u};2;${i};${o};${c}m`;function s(){const u=new Map,i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};i.color.gray=i.color.blackBright,i.bgColor.bgGray=i.bgColor.bgBlackBright,i.color.grey=i.color.blackBright,i.bgColor.bgGrey=i.bgColor.bgBlackBright;for(const[o,c]of Object.entries(i)){for(const[l,a]of Object.entries(c))i[l]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},c[l]=i[l],u.set(a[0],a[1]);Object.defineProperty(i,o,{value:c,enumerable:!1})}return Object.defineProperty(i,"codes",{value:u,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi256=r(),i.color.ansi16m=n(),i.bgColor.ansi256=r(10),i.bgColor.ansi16m=n(10),Object.defineProperties(i,{rgbToAnsi256:{value:(o,c,l)=>o===c&&c===l?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(c/255*5)+Math.round(l/255*5),enumerable:!1},hexToRgb:{value:o=>{const c=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(o.toString(16));if(!c)return[0,0,0];let{colorString:l}=c.groups;l.length===3&&(l=l.split("").map(f=>f+f).join(""));const a=Number.parseInt(l,16);return[a>>16&255,a>>8&255,a&255]},enumerable:!1},hexToAnsi256:{value:o=>i.rgbToAnsi256(...i.hexToRgb(o)),enumerable:!1}}),i}Object.defineProperty(e,"exports",{enumerable:!0,get:s})})(je)),je.exports}var qs=Ls();const Ki=pe(qs);function G(e,t,r){function n(o,c){var l;Object.defineProperty(o,"_zod",{value:o._zod??{},enumerable:!1}),(l=o._zod).traits??(l.traits=new Set),o._zod.traits.add(e),t(o,c);for(const a in i.prototype)a in o||Object.defineProperty(o,a,{value:i.prototype[a].bind(o)});o._zod.constr=i,o._zod.def=c}const s=r?.Parent??Object;class u extends s{}Object.defineProperty(u,"name",{value:e});function i(o){var c;const l=r?.Parent?new u:this;n(l,o),(c=l._zod).deferred??(c.deferred=[]);for(const a of l._zod.deferred)a();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:o=>r?.Parent&&o instanceof r.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Re extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const js={};function le(e){return js}function Ds(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function Us(e,t){return typeof t=="bigint"?t.toString():t}function et(e){return e==null}function rt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Z(e,t,r){Object.defineProperty(e,t,{get(){{const n=r();return e[t]=n,n}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ms(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}const xn=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function dn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Br(e){if(dn(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(dn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Sn(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function ge(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Wi(e,t){if(!Br(t))throw new Error("Invalid input to extend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Ms(this,"shape",n),n},checks:[]};return Sn(e,r)}function Qi(e,t,r){const n=t._zod.def.shape,s={...n};for(const u in n)s[u]=e?new e({type:"optional",innerType:n[u]}):n[u];return Sn(t,{...t._zod.def,shape:s,checks:[]})}function Ee(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Fs(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function qe(e){return typeof e=="string"?e:e?.message}function fe(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=qe(e.inst?._zod.def?.error?.(e))??qe(t?.error?.(e))??qe(r.customError?.(e))??qe(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function tt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gs(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Pn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Us,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vs=G("$ZodError",Pn),Ve=G("$ZodError",Pn,{Parent:Error});function eo(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function ro(e,t){const r=t||function(u){return u.message},n={_errors:[]},s=u=>{for(const i of u.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>s({issues:o}));else if(i.code==="invalid_key")s({issues:i.issues});else if(i.code==="invalid_element")s({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return s(e),n}function Bs(e){const t=[];for(const r of e)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function to(e){const t=[],r=[...e.issues].sort((n,s)=>n.path.length-s.path.length);for(const n of r)t.push(`✖ ${n.message}`),n.path?.length&&t.push(` → at ${Bs(n.path)}`);return t.join(`
|
|
2
2
|
`)}const Zs=e=>(t,r,n,s)=>{const u=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},u);if(i instanceof Promise)throw new Re;if(i.issues.length){const o=new(s?.Err??e)(i.issues.map(c=>fe(c,u,le())));throw xn(o,s?.callee),o}return i.value},no=Zs(Ve),Xs=e=>async(t,r,n,s)=>{const u=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},u);if(i instanceof Promise&&(i=await i),i.issues.length){const o=new(s?.Err??e)(i.issues.map(c=>fe(c,u,le())));throw xn(o,s?.callee),o}return i.value},so=Xs(Ve),Js=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise)throw new Re;return u.issues.length?{success:!1,error:new(e??Vs)(u.issues.map(i=>fe(i,s,le())))}:{success:!0,data:u.value}},Hs=Js(Ve),Ys=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let u=t._zod.run({value:r,issues:[]},s);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(i=>fe(i,s,le())))}:{success:!0,data:u.value}},Ks=Ys(Ve),Ie=G("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ws=G("$ZodCheckMaxLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!et(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const i=tt(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Qs=G("$ZodCheckMinLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!et(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const i=tt(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ei=G("$ZodCheckLengthEquals",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!et(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,u=s.length;if(u===t.length)return;const i=tt(s),o=u>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ri=G("$ZodCheckOverwrite",(e,t)=>{Ie.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),ti={major:4,minor:0,patch:0},Y=G("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ti;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const u of s._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(u,i,o)=>{let c=Ee(u),l;for(const a of i){if(a._zod.def.when){if(!a._zod.def.when(u))continue}else if(c)continue;const f=u.issues.length,d=a._zod.check(u);if(d instanceof Promise&&o?.async===!1)throw new Re;if(l||d instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await d,u.issues.length!==f&&(c||(c=Ee(u,f)))});else{if(u.issues.length===f)continue;c||(c=Ee(u,f))}}return l?l.then(()=>u):u};e._zod.run=(u,i)=>{const o=e._zod.parse(u,i);if(o instanceof Promise){if(i.async===!1)throw new Re;return o.then(c=>s(c,n,i))}return s(o,n,i)}}e["~standard"]={validate:s=>{try{const u=Hs(e,s);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Ks(e,s).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),io=G("$ZodAny",(e,t)=>{Y.init(e,t),e._zod.parse=r=>r}),oo=G("$ZodUnknown",(e,t)=>{Y.init(e,t),e._zod.parse=r=>r}),ao=G("$ZodNever",(e,t)=>{Y.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function hn(e,t,r){e.issues.length&&t.issues.push(...Fs(r,e.issues)),t.value[r]=e.value}const uo=G("$ZodArray",(e,t)=>{Y.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const u=[];for(let i=0;i<s.length;i++){const o=s[i],c=t.element._zod.run({value:o,issues:[]},n);c instanceof Promise?u.push(c.then(l=>hn(l,r,i))):hn(c,r,i)}return u.length?Promise.all(u).then(()=>r):r}});function pn(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(u=>fe(u,n,le())))}),t}const co=G("$ZodUnion",(e,t)=>{Y.init(e,t),Z(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Z(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Z(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Z(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>rt(n.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let s=!1;const u=[];for(const i of t.options){const o=i._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)u.push(o),s=!0;else{if(o.issues.length===0)return o;u.push(o)}}return s?Promise.all(u).then(i=>pn(i,r,e,n)):pn(u,r,e,n)}}),lo=G("$ZodIntersection",(e,t)=>{Y.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,u=t.left._zod.run({value:s,issues:[]},n),i=t.right._zod.run({value:s,issues:[]},n);return u instanceof Promise||i instanceof Promise?Promise.all([u,i]).then(([c,l])=>mn(r,c,l)):mn(r,u,i)}});function Zr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Br(e)&&Br(t)){const r=Object.keys(t),n=Object.keys(e).filter(u=>r.indexOf(u)!==-1),s={...e,...t};for(const u of n){const i=Zr(e[u],t[u]);if(!i.valid)return{valid:!1,mergeErrorPath:[u,...i.mergeErrorPath]};s[u]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],u=t[n],i=Zr(s,u);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function mn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Ee(e))return e;const n=Zr(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const fo=G("$ZodTransform",(e,t)=>{Y.init(e,t),e._zod.parse=(r,n)=>{const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(r.value=i,r));if(s instanceof Promise)throw new Re;return r.value=s,r}}),ho=G("$ZodOptional",(e,t)=>{Y.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Z(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Z(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${rt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,n):r.value===void 0?r:t.innerType._zod.run(r,n)}),po=G("$ZodNullable",(e,t)=>{Y.init(e,t),Z(e._zod,"optin",()=>t.innerType._zod.optin),Z(e._zod,"optout",()=>t.innerType._zod.optout),Z(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${rt(r.source)}|null)$`):void 0}),Z(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),mo=G("$ZodDefault",(e,t)=>{Y.init(e,t),e._zod.optin="optional",Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(u=>gn(u,t)):gn(s,t)}});function gn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const go=G("$ZodPrefault",(e,t)=>{Y.init(e,t),e._zod.optin="optional",Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),vo=G("$ZodNonOptional",(e,t)=>{Y.init(e,t),Z(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(u=>vn(u,e)):vn(s,e)}});function vn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const yo=G("$ZodCatch",(e,t)=>{Y.init(e,t),e._zod.optin="optional",Z(e._zod,"optout",()=>t.innerType._zod.optout),Z(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(u=>(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(i=>fe(i,n,le()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(u=>fe(u,n,le()))},input:r.value}),r.issues=[]),r)}}),_o=G("$ZodPipe",(e,t)=>{Y.init(e,t),Z(e._zod,"values",()=>t.in._zod.values),Z(e._zod,"optin",()=>t.in._zod.optin),Z(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(u=>yn(u,t,n)):yn(s,t,n)}});function yn(e,t,r){return Ee(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const $o=G("$ZodReadonly",(e,t)=>{Y.init(e,t),Z(e._zod,"propValues",()=>t.innerType._zod.propValues),Z(e._zod,"values",()=>t.innerType._zod.values),Z(e._zod,"optin",()=>t.innerType._zod.optin),Z(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(_n):_n(s)}});function _n(e){return e.value=Object.freeze(e.value),e}const Eo=G("$ZodCustom",(e,t)=>{Ie.init(e,t),Y.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(u=>$n(u,r,n,e));$n(s,r,n,e)}});function $n(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Gs(s))}}class Nn{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function ni(){return new Nn}const si=ni();function wo(e){return new e({type:"any"})}function Ro(e){return new e({type:"unknown"})}function bo(e,t){return new e({type:"never",...ge(t)})}function Io(e,t){return new Ws({check:"max_length",...ge(t),maximum:e})}function Oo(e,t){return new Qs({check:"min_length",...ge(t),minimum:e})}function To(e,t){return new ei({check:"length_equals",...ge(t),length:e})}function xo(e){return new ri({check:"overwrite",tx:e})}function So(e,t,r){return new e({type:"array",element:t,...ge(r)})}function Po(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ge(r)})}class En{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??si,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,r={path:[],schemaPath:[]}){var n;const s=t._zod.def,u={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(t);if(i)return i.count++,r.schemaPath.includes(t)&&(i.cycle=r.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(t,o);const c=t._zod.toJSONSchema?.();if(c)o.schema=c;else{const f={...r,schemaPath:[...r.schemaPath,t],path:r.path},d=t._zod.parent;if(d)o.ref=d,this.process(d,f),this.seen.get(d).isParent=!0;else{const m=o.schema;switch(s.type){case"string":{const h=m;h.type="string";const{minimum:p,maximum:g,format:v,patterns:E,contentEncoding:y}=t._zod.bag;if(typeof p=="number"&&(h.minLength=p),typeof g=="number"&&(h.maxLength=g),v&&(h.format=u[v]??v,h.format===""&&delete h.format),y&&(h.contentEncoding=y),E&&E.size>0){const q=[...E];q.length===1?h.pattern=q[0].source:q.length>1&&(o.schema.allOf=[...q.map(M=>({...this.target==="draft-7"?{type:"string"}:{},pattern:M.source}))])}break}case"number":{const h=m,{minimum:p,maximum:g,format:v,multipleOf:E,exclusiveMaximum:y,exclusiveMinimum:q}=t._zod.bag;typeof v=="string"&&v.includes("int")?h.type="integer":h.type="number",typeof q=="number"&&(h.exclusiveMinimum=q),typeof p=="number"&&(h.minimum=p,typeof q=="number"&&(q>=p?delete h.minimum:delete h.exclusiveMinimum)),typeof y=="number"&&(h.exclusiveMaximum=y),typeof g=="number"&&(h.maximum=g,typeof y=="number"&&(y<=g?delete h.maximum:delete h.exclusiveMaximum)),typeof E=="number"&&(h.multipleOf=E);break}case"boolean":{const h=m;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{m.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const h=m,{minimum:p,maximum:g}=t._zod.bag;typeof p=="number"&&(h.minItems=p),typeof g=="number"&&(h.maxItems=g),h.type="array",h.items=this.process(s.element,{...f,path:[...f.path,"items"]});break}case"object":{const h=m;h.type="object",h.properties={};const p=s.shape;for(const E in p)h.properties[E]=this.process(p[E],{...f,path:[...f.path,"properties",E]});const g=new Set(Object.keys(p)),v=new Set([...g].filter(E=>{const y=s.shape[E]._zod;return this.io==="input"?y.optin===void 0:y.optout===void 0}));v.size>0&&(h.required=Array.from(v)),s.catchall?._zod.def.type==="never"?h.additionalProperties=!1:s.catchall?s.catchall&&(h.additionalProperties=this.process(s.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{const h=m;h.anyOf=s.options.map((p,g)=>this.process(p,{...f,path:[...f.path,"anyOf",g]}));break}case"intersection":{const h=m,p=this.process(s.left,{...f,path:[...f.path,"allOf",0]}),g=this.process(s.right,{...f,path:[...f.path,"allOf",1]}),v=y=>"allOf"in y&&Object.keys(y).length===1,E=[...v(p)?p.allOf:[p],...v(g)?g.allOf:[g]];h.allOf=E;break}case"tuple":{const h=m;h.type="array";const p=s.items.map((E,y)=>this.process(E,{...f,path:[...f.path,"prefixItems",y]}));if(this.target==="draft-2020-12"?h.prefixItems=p:h.items=p,s.rest){const E=this.process(s.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?h.items=E:h.additionalItems=E}s.rest&&(h.items=this.process(s.rest,{...f,path:[...f.path,"items"]}));const{minimum:g,maximum:v}=t._zod.bag;typeof g=="number"&&(h.minItems=g),typeof v=="number"&&(h.maxItems=v);break}case"record":{const h=m;h.type="object",h.propertyNames=this.process(s.keyType,{...f,path:[...f.path,"propertyNames"]}),h.additionalProperties=this.process(s.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const h=m,p=Ds(s.entries);p.every(g=>typeof g=="number")&&(h.type="number"),p.every(g=>typeof g=="string")&&(h.type="string"),h.enum=p;break}case"literal":{const h=m,p=[];for(const g of s.values)if(g===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");p.push(Number(g))}else p.push(g);if(p.length!==0)if(p.length===1){const g=p[0];h.type=g===null?"null":typeof g,h.const=g}else p.every(g=>typeof g=="number")&&(h.type="number"),p.every(g=>typeof g=="string")&&(h.type="string"),p.every(g=>typeof g=="boolean")&&(h.type="string"),p.every(g=>g===null)&&(h.type="null"),h.enum=p;break}case"file":{const h=m,p={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:v,mime:E}=t._zod.bag;g!==void 0&&(p.minLength=g),v!==void 0&&(p.maxLength=v),E?E.length===1?(p.contentMediaType=E[0],Object.assign(h,p)):h.anyOf=E.map(y=>({...p,contentMediaType:y})):Object.assign(h,p);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const h=this.process(s.innerType,f);m.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(s.innerType,f),o.ref=s.innerType;break}case"success":{const h=m;h.type="boolean";break}case"default":{this.process(s.innerType,f),o.ref=s.innerType,m.default=JSON.parse(JSON.stringify(s.defaultValue));break}case"prefault":{this.process(s.innerType,f),o.ref=s.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(s.defaultValue)));break}case"catch":{this.process(s.innerType,f),o.ref=s.innerType;let h;try{h=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}m.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const h=m,p=t._zod.pattern;if(!p)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=p.source;break}case"pipe":{const h=this.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;this.process(h,f),o.ref=h;break}case"readonly":{this.process(s.innerType,f),o.ref=s.innerType,m.readOnly=!0;break}case"promise":{this.process(s.innerType,f),o.ref=s.innerType;break}case"optional":{this.process(s.innerType,f),o.ref=s.innerType;break}case"lazy":{const h=t._zod.innerType;this.process(h,f),o.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const l=this.metadataRegistry.get(t);return l&&Object.assign(o.schema,l),this.io==="input"&&X(t)&&(delete o.schema.examples,delete o.schema.default),this.io==="input"&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(t).schema}emit(t,r){const n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},s=this.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const u=a=>{const f=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const p=n.external.registry.get(a[0])?.id,g=n.external.uri??(E=>E);if(p)return{ref:g(p)};const v=a[1].defId??a[1].schema.id??`schema${this.counter++}`;return a[1].defId=v,{defId:v,ref:`${g("__shared")}#/${f}/${v}`}}if(a[1]===s)return{ref:"#"};const m=`#/${f}/`,h=a[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:m+h}},i=a=>{if(a[1].schema.$ref)return;const f=a[1],{ref:d,defId:m}=u(a);f.def={...f.schema},m&&(f.defId=m);const h=f.schema;for(const p in h)delete h[p];h.$ref=d};if(n.cycles==="throw")for(const a of this.seen.entries()){const f=a[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
3
3
|
|
|
4
4
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of this.seen.entries()){const f=a[1];if(t===a[0]){i(a);continue}if(n.external){const m=n.external.registry.get(a[0])?.id;if(t!==a[0]&&m){i(a);continue}}if(this.metadataRegistry.get(a[0])?.id){i(a);continue}if(f.cycle){i(a);continue}if(f.count>1&&n.reused==="ref"){i(a);continue}}const o=(a,f)=>{const d=this.seen.get(a),m=d.def??d.schema,h={...m};if(d.ref===null)return;const p=d.ref;if(d.ref=null,p){o(p,f);const g=this.seen.get(p).schema;g.$ref&&f.target==="draft-7"?(m.allOf=m.allOf??[],m.allOf.push(g)):(Object.assign(m,g),Object.assign(m,h))}d.isParent||this.override({zodSchema:a,jsonSchema:m,path:d.path??[]})};for(const a of[...this.seen.entries()].reverse())o(a[0],{target:this.target});const c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){const a=n.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(a)}Object.assign(c,s.def);const l=n.external?.defs??{};for(const a of this.seen.entries()){const f=a[1];f.def&&f.defId&&(l[f.defId]=f.def)}n.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?c.$defs=l:c.definitions=l);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}}function No(e,t){if(e instanceof Nn){const n=new En(t),s={};for(const o of e._idmap.entries()){const[c,l]=o;n.process(l)}const u={},i={registry:e,uri:t?.uri,defs:s};for(const o of e._idmap.entries()){const[c,l]=o;u[c]=n.emit(l,{...t,external:i})}if(Object.keys(s).length>0){const o=n.target==="draft-2020-12"?"$defs":"definitions";u.__shared={[o]:s}}return{schemas:u}}const r=new En(t);return r.process(e),r.emit(e,t)}function X(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const s=e._zod.def;switch(s.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return X(s.element,r);case"object":{for(const u in s.shape)if(X(s.shape[u],r))return!0;return!1}case"union":{for(const u of s.options)if(X(u,r))return!0;return!1}case"intersection":return X(s.left,r)||X(s.right,r);case"tuple":{for(const u of s.items)if(X(u,r))return!0;return!!(s.rest&&X(s.rest,r))}case"record":return X(s.keyType,r)||X(s.valueType,r);case"map":return X(s.keyType,r)||X(s.valueType,r);case"set":return X(s.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return X(s.innerType,r);case"lazy":return X(s.getter(),r);case"default":return X(s.innerType,r);case"prefault":return X(s.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return X(s.in,r)||X(s.out,r);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${s.type}`)}function we(e,t){const r=typeof e;if(r!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(!we(e[s],t[s]))return!1;return!0}if(r==="object"){if(!e||!t)return e===t;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const i of n)if(!we(e[i],t[i]))return!1;return!0}return e===t}function Q(e){return encodeURI(ii(e))}function ii(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}const oi={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},ai={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},ui={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};let ci=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function ce(e,t=Object.create(null),r=ci,n=""){if(e&&typeof e=="object"&&!Array.isArray(e)){const u=e.$id||e.id;if(u){const i=new URL(u,r.href);i.hash.length>1?t[i.href]=e:(i.hash="",n===""?r=i:ce(e,t,r))}}else if(e!==!0&&e!==!1)return t;const s=r.href+(n?"#"+n:"");if(t[s]!==void 0)throw new Error(`Duplicate schema URI "${s}".`);if(t[s]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:s}),e.$ref&&e.__absolute_ref__===void 0){const u=new URL(e.$ref,r.href);u.hash=u.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:u.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){const u=new URL(e.$recursiveRef,r.href);u.hash=u.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:u.href})}if(e.$anchor){const u=new URL("#"+e.$anchor,r.href);t[u.href]=e}for(let u in e){if(ui[u])continue;const i=`${n}/${Q(u)}`,o=e[u];if(Array.isArray(o)){if(oi[u]){const c=o.length;for(let l=0;l<c;l++)ce(o[l],t,r,`${i}/${l}`)}}else if(ai[u])for(let c in o)ce(o[c],t,r,`${i}/${Q(c)}`);else ce(o,t,r,i)}return t}const li=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,fi=[0,31,28,31,30,31,30,31,31,30,31,30,31],di=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,hi=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,pi=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,mi=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,gi=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,vi=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,yi=/^(?:\/(?:[^~/]|~0|~1)*)*$/,_i=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,$i=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Ei=e=>{if(e[0]==='"')return!1;const[t,r,...n]=e.split("@");return!t||!r||n.length!==0||t.length>64||r.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(r)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:r.split(".").every(s=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(s))},wi=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Ri=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,bi=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function se(e){return e.test.bind(e)}const wn={date:An,time:kn.bind(void 0,!1),"date-time":Ti,duration:bi,uri:Pi,"uri-reference":se(pi),"uri-template":se(mi),url:se(gi),email:Ei,hostname:se(hi),ipv4:se(wi),ipv6:se(Ri),regex:Ai,uuid:se(vi),"json-pointer":se(yi),"json-pointer-uri-fragment":se(_i),"relative-json-pointer":se($i)};function Ii(e){return e%4===0&&(e%100!==0||e%400===0)}function An(e){const t=e.match(li);if(!t)return!1;const r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(n==2&&Ii(r)?29:fi[n])}function kn(e,t){const r=t.match(di);if(!r)return!1;const n=+r[1],s=+r[2],u=+r[3],i=!!r[5];return(n<=23&&s<=59&&u<=59||n==23&&s==59&&u==60)&&(!e||i)}const Oi=/t|\s/i;function Ti(e){const t=e.split(Oi);return t.length==2&&An(t[0])&&kn(!0,t[1])}const xi=/\/|:/,Si=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Pi(e){return xi.test(e)&&Si.test(e)}const Ni=/[^\\]\\Z/;function Ai(e){if(Ni.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}function ki(e){let t=0,r=e.length,n=0,s;for(;n<r;)t++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<r&&(s=e.charCodeAt(n),(s&64512)==56320&&n++);return t}function V(e,t,r="2019-09",n=ce(t),s=!0,u=null,i="#",o="#",c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:i,keyword:"false",keywordLocation:i,error:"False boolean schema."}]};const l=typeof e;let a;switch(l){case"boolean":case"number":case"string":a=l;break;case"object":e===null?a="null":Array.isArray(e)?a="array":a="object";break;default:throw new Error(`Instances of "${l}" type are not supported.`)}const{$ref:f,$recursiveRef:d,$recursiveAnchor:m,type:h,const:p,enum:g,required:v,not:E,anyOf:y,allOf:q,oneOf:M,if:U,then:B,else:C,format:te,properties:ie,patternProperties:oe,additionalProperties:de,unevaluatedProperties:he,minProperties:w,maxProperties:_,propertyNames:x,dependentRequired:I,dependentSchemas:S,dependencies:O,prefixItems:A,items:j,additionalItems:L,unevaluatedItems:F,contains:J,minContains:D,maxContains:ne,minItems:Be,maxItems:Ze,uniqueItems:zn,minimum:ae,maximum:ue,exclusiveMinimum:ve,exclusiveMaximum:ye,multipleOf:Oe,minLength:Te,maxLength:xe,pattern:nt,__absolute_ref__:Se,__absolute_recursive_ref__:Cn}=t,R=[];if(m===!0&&u===null&&(u=t),d==="#"){const P=u===null?n[Cn]:u,T=`${o}/$recursiveRef`,z=V(e,u===null?t:u,r,n,s,P,i,T,c);z.valid||R.push({instanceLocation:i,keyword:"$recursiveRef",keywordLocation:T,error:"A subschema had errors."},...z.errors)}if(f!==void 0){const T=n[Se||f];if(T===void 0){let $=`Unresolved $ref "${f}".`;throw Se&&Se!==f&&($+=` Absolute URI "${Se}".`),$+=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,A as d}from"./index-
|
|
1
|
+
import{_ as e,A as d}from"./index-CQ-qHv2a.js";var l={};e(l,{chunkArray:()=>u});const u=(r,n)=>r.reduce((a,o,s)=>{const c=Math.floor(s/n),t=a[c]||[];return a[c]=t.concat([o]),a},[]);var _={};e(_,{Embeddings:()=>h});var h=class{caller;constructor(r){this.caller=new d(r??{})}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Langfuse as T}from"./index-
|
|
1
|
+
import{Langfuse as T}from"./index-CqG9tm2u.js";import{B as I,a as v,A as g,b as y,H as M,C as S,S as w,F as D,T as b}from"./langfuse-C4HKZ3NL-t4vaDWLA.js";import"./index-C_iq8viy.js";import"./chunk-VL2OQCWN-C55BvblE.js";import"./index-DRz5BQNA.js";import"./__vite-browser-external-DFygW7-s.js";import"./path-C9FudP8b.js";const u="langsmith:hidden";class k extends I{constructor(t){super(),this.name="CallbackHandler",this.rootProvided=!1,this.updateRoot=!1,this.debugEnabled=!1,this.completionStartTimes={},t&&"root"in t?(this.langfuse=t.root.client,this.rootObservationId=t.root.observationId??void 0,this.traceId=t.root.traceId,this.rootProvided=!0,this.updateRoot=t.updateRoot??!1,this.metadata=t.metadata):(this.langfuse=new T({...t,persistence:"memory",sdkIntegration:t?.sdkIntegration??"LANGCHAIN"}),this.sessionId=t?.sessionId,this.userId=t?.userId,this.metadata=t?.metadata,this.tags=t?.tags),this.version=t?.version,this.promptToParentRunMap=new Map,this.traceUpdates=new Map}async flushAsync(){return this.langfuse.flushAsync()}async shutdownAsync(){return this.langfuse.shutdownAsync()}debug(t=!0){this.langfuse.debug(t),this.debugEnabled=t}_log(t){this.debugEnabled&&console.log(t)}async handleNewToken(t,e){return e&&!(e in this.completionStartTimes)&&(this._log(`LLM first streaming token: ${e}`),this.completionStartTimes[e]=new Date),Promise.resolve()}async handleLLMNewToken(t,e,s,i,n,a){return s&&!(s in this.completionStartTimes)&&(this._log(`LLM first streaming token: ${s}`),this.completionStartTimes[s]=new Date),Promise.resolve()}getTraceId(){return this.traceId}getTraceUrl(){return this.traceId?`${this.langfuse.baseUrl}/trace/${this.traceId}`:void 0}getLangchainRunId(){return this.topLevelObservationId}async handleRetrieverError(t,e,s){try{this._log(`Retriever error: ${t} with ID: ${e}`),this.langfuse._updateSpan({id:e,traceId:this.traceId,level:"ERROR",statusMessage:t.toString(),endTime:new Date,version:this.version}),this.updateTrace(e,s,t.toString())}catch(i){this._log(i)}}async handleChainStart(t,e,s,i,n,a,o,h){try{this._log(`Chain start with Id: ${s}`);const d=h??t.id.at(-1)?.toString()??"Langchain Run";this.registerLangfusePrompt(i,a);let r=e;typeof e=="object"&&"input"in e&&Array.isArray(e.input)&&e.input.every(l=>l instanceof v)?r=e.input.map(l=>this.extractChatMessageContent(l)):typeof e=="object"&&"content"in e&&typeof e.content=="string"&&(r=e.content),this.generateTrace(d,s,i,n,a,r),this.langfuse.span({id:s,traceId:this.traceId,parentObservationId:i??this.rootObservationId,name:d,metadata:this.joinTagsAndMetaData(n,a),input:r,version:this.version,level:n&&n.includes(u)?"DEBUG":void 0}),i||this.traceUpdates.set(s,{tags:n,userId:a&&"langfuseUserId"in a&&typeof a.langfuseUserId=="string"?a.langfuseUserId:void 0,sessionId:a&&"langfuseSessionId"in a&&typeof a.langfuseSessionId=="string"?a.langfuseSessionId:void 0})}catch(d){this._log(d)}}registerLangfusePrompt(t,e){e&&"langfusePrompt"in e&&t&&this.promptToParentRunMap.set(t,e.langfusePrompt)}deregisterLangfusePrompt(t){this.promptToParentRunMap.delete(t)}async handleAgentAction(t,e,s){try{this._log(`Agent action with ID: ${e}`),this.langfuse.span({id:e,parentObservationId:s,traceId:this.traceId,endTime:new Date,input:t,version:this.version})}catch(i){this._log(i)}}async handleAgentEnd(t,e,s){try{this._log(`Agent finish with ID: ${e}`),this.langfuse._updateSpan({id:e,traceId:this.traceId,endTime:new Date,output:t,version:this.version}),this.updateTrace(e,s,t)}catch(i){this._log(i)}}async handleChainError(t,e,s){try{this._log(`Chain error: ${t} with ID: ${e}`);const i=this.parseAzureRefusalError(t);this.langfuse._updateSpan({id:e,traceId:this.traceId,level:"ERROR",statusMessage:t.toString()+i,endTime:new Date,version:this.version}),this.updateTrace(e,s,t.toString()+i)}catch(i){this._log(i)}}generateTrace(t,e,s,i,n,a){this.traceId&&!s&&!this.rootProvided&&(this.traceId=void 0,this.topLevelObservationId=void 0);const o={name:t,metadata:this.joinTagsAndMetaData(i,n,this.metadata),userId:this.userId,version:this.version,sessionId:this.sessionId,input:a,tags:this.tags};this.traceId||(this.langfuse.trace({id:e,...o}),this.traceId=e),this.rootProvided&&this.updateRoot&&(this.rootObservationId?this.langfuse._updateSpan({id:this.rootObservationId,traceId:this.traceId,...o}):this.langfuse.trace({id:this.traceId,...o})),this.topLevelObservationId=s?this.topLevelObservationId:e}async handleGenerationStart(t,e,s,i,n,a,o,h){this._log(`Generation start with ID: ${s}`);const d=h??t.id.at(-1)?.toString()??"Langchain Generation";this.generateTrace(d,s,i,a,o,e);const r={},l=n?.invocation_params;for(const[f,c]of Object.entries({temperature:l?.temperature,max_tokens:l?.max_tokens,top_p:l?.top_p,frequency_penalty:l?.frequency_penalty,presence_penalty:l?.presence_penalty,request_timeout:l?.request_timeout}))c!=null&&(r[f]=c);let _;if(n){const f=n.invocation_params.model,c=o&&"ls_model_name"in o?o.ls_model_name:void 0;_=f??c}const m=this.promptToParentRunMap.get(i??"root");m&&i&&this.deregisterLangfusePrompt(i),this.langfuse.generation({id:s,traceId:this.traceId,name:h??t.id.at(-1)?.toString(),metadata:this.joinTagsAndMetaData(a,o),parentObservationId:i??this.rootObservationId,input:e,model:_,modelParameters:r,version:this.version,prompt:m,level:a&&a.includes(u)?"DEBUG":void 0})}async handleChatModelStart(t,e,s,i,n,a,o,h){try{this._log(`Chat model start with ID: ${s}`);const d=e.flatMap(r=>r.map(l=>this.extractChatMessageContent(l)));this.handleGenerationStart(t,d,s,i,n,a,o,h)}catch(d){this._log(d)}}async handleChainEnd(t,e,s){try{this._log(`Chain end with ID: ${e}`);let i=t;typeof t=="object"&&"output"in t&&typeof t.output=="string"&&(i=t.output),this.langfuse._updateSpan({id:e,traceId:this.traceId,output:i,endTime:new Date,version:this.version}),this.updateTrace(e,s,i),this.deregisterLangfusePrompt(e)}catch(i){this._log(i)}}async handleLLMStart(t,e,s,i,n,a,o,h){try{this._log(`LLM start with ID: ${s}`),this.handleGenerationStart(t,e,s,i,n,a,o,h)}catch(d){this._log(d)}}async handleToolStart(t,e,s,i,n,a,o){try{this._log(`Tool start with ID: ${s}`),this.langfuse.span({id:s,parentObservationId:i,traceId:this.traceId,name:o??t.id.at(-1)?.toString(),input:e,metadata:this.joinTagsAndMetaData(n,a),version:this.version,level:n&&n.includes(u)?"DEBUG":void 0})}catch(h){this._log(h)}}async handleRetrieverStart(t,e,s,i,n,a,o){try{this._log(`Retriever start with ID: ${s}`),this.langfuse.span({id:s,parentObservationId:i,traceId:this.traceId,name:o??t.id.at(-1)?.toString(),input:e,metadata:this.joinTagsAndMetaData(n,a),version:this.version,level:n&&n.includes(u)?"DEBUG":void 0})}catch(h){this._log(h)}}async handleRetrieverEnd(t,e,s){try{this._log(`Retriever end with ID: ${e}`),this.langfuse._updateSpan({id:e,traceId:this.traceId,output:t,endTime:new Date,version:this.version}),this.updateTrace(e,s,t)}catch(i){this._log(i)}}async handleToolEnd(t,e,s){try{this._log(`Tool end with ID: ${e}`),this.langfuse._updateSpan({id:e,traceId:this.traceId,output:t,endTime:new Date,version:this.version}),this.updateTrace(e,s,t)}catch(i){this._log(i)}}async handleToolError(t,e,s){try{this._log(`Tool error ${t} with ID: ${e}`),this.langfuse._updateSpan({id:e,traceId:this.traceId,level:"ERROR",statusMessage:t.toString(),endTime:new Date,version:this.version}),this.updateTrace(e,s,t.toString())}catch(i){this._log(i)}}async handleLLMEnd(t,e,s){try{this._log(`LLM end with ID: ${e}`);const i=t.generations[t.generations.length-1][t.generations[t.generations.length-1].length-1],n=this.extractUsageMetadata(i)??t.llmOutput?.tokenUsage,a=this.extractModelNameFromMetadata(i),o={input:n?.input_tokens??("promptTokens"in n?n?.promptTokens:void 0),output:n?.output_tokens??("completionTokens"in n?n?.completionTokens:void 0),total:n?.total_tokens??("totalTokens"in n?n?.totalTokens:void 0)};if(n&&"input_token_details"in n)for(const[d,r]of Object.entries(n.input_token_details??{}))o[`input_${d}`]=r,"input"in o&&typeof r=="number"&&(o.input=Math.max(0,o.input-r));if(n&&"output_token_details"in n)for(const[d,r]of Object.entries(n.output_token_details??{}))o[`output_${d}`]=r,"output"in o&&typeof r=="number"&&(o.output=Math.max(0,o.output-r));const h="message"in i&&i.message instanceof v?this.extractChatMessageContent(i.message):i.text;this.langfuse._updateGeneration({id:e,model:a,traceId:this.traceId,output:h,endTime:new Date,completionStartTime:e in this.completionStartTimes?this.completionStartTimes[e]:void 0,usage:o,usageDetails:o,version:this.version}),e in this.completionStartTimes&&delete this.completionStartTimes[e],this.updateTrace(e,s,h)}catch(i){this._log(i)}}extractUsageMetadata(t){try{return"message"in t&&(t.message instanceof g||t.message instanceof y)?t.message.usage_metadata:void 0}catch(e){this._log(`Error extracting usage metadata: ${e}`);return}}extractModelNameFromMetadata(t){try{return"message"in t&&(t.message instanceof g||t.message instanceof y)?t.message.response_metadata.model_name:void 0}catch{}}extractChatMessageContent(t){let e;return t instanceof M?e={content:t.content,role:"user"}:t instanceof S?e={content:t.content,role:t.role}:t instanceof g?e={content:t.content,role:"assistant"}:t instanceof w?e={content:t.content,role:"system"}:t instanceof D?e={content:t.content,additional_kwargs:t.additional_kwargs,role:t.name}:t instanceof b?e={content:t.content,additional_kwargs:t.additional_kwargs,role:t.name}:t.name?e={role:t.name,content:t.content}:e={content:t.content},t.additional_kwargs.function_call||t.additional_kwargs.tool_calls?{...e,additional_kwargs:t.additional_kwargs}:e}async handleLLMError(t,e,s){try{this._log(`LLM error ${t} with ID: ${e}`);const i=this.parseAzureRefusalError(t);this.langfuse._updateGeneration({id:e,traceId:this.traceId,level:"ERROR",statusMessage:t.toString()+i,endTime:new Date,version:this.version}),this.updateTrace(e,s,t.toString()+i)}catch(i){this._log(i)}}parseAzureRefusalError(t){let e="";if(typeof t=="object"&&"error"in t)try{e=`
|
|
2
2
|
|
|
3
3
|
Error details:
|
|
4
4
|
`+JSON.stringify(t.error,null,2)}catch{}return e}updateTrace(t,e,s){const i=this.traceUpdates.get(t);this.traceUpdates.delete(t),!e&&this.traceId&&this.traceId===t&&this.langfuse.trace({id:this.traceId,output:s,...i}),!e&&this.traceId&&this.rootProvided&&this.updateRoot&&(this.rootObservationId?this.langfuse._updateSpan({id:this.rootObservationId,traceId:this.traceId,output:s}):this.langfuse.trace({id:this.traceId,output:s,...i}))}joinTagsAndMetaData(t,e,s){const i={};return t&&t.length>0&&(i.tags=t),e&&Object.assign(i,e),s&&Object.assign(i,s),this.stripLangfuseKeysFromMetadata(i)}stripLangfuseKeysFromMetadata(t){if(!t)return;const e=["langfusePrompt","langfuseUserId","langfuseSessionId"];return Object.fromEntries(Object.entries(t).filter(([s,i])=>!e.includes(s)))}}const P=async p=>{const{runName:t,item:e,langfuseClient:s,options:i}=p,n={dataset_item_id:e.id,dataset_id:e.datasetId,dataset_run_name:t},a=s.trace();return await e.link(a,t,{description:i?.runDescription,metadata:i?.runMetadata}),{handler:new k({root:a,updateRoot:!0,metadata:n}),trace:a}};export{k as CallbackHandler,T as Langfuse,P as createDatasetItemHandler,k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as js,g as Ds,q as Wa,r as qa,s as Ja,l as Ka,O as Fs,u as za,f as Bs,v as Za,_ as gn,m as Ha,n as zn,i as Oe,h as Us,S as Zn,J as Hn,t as Ze,w as Va,x as Xa,R as Vn,o as Ga,j as Ws,k as qs,b as xe,T as ht,y as Qa,c as _n,z as Xn,F as Ya,D as ei,E as ti,p as Gn,G as Qn,I as ni,C as Xt,K as si,L as nt,M as ri,N as ai,P as ii,Q as Yn,U as oi,V as li,W as ci,X as Gt,Y as ui,Z as di,$ as hi,a0 as Bt,a1 as fi,a2 as yn,a3 as pi,a4 as mi,a5 as gi,a6 as es,a7 as ts,a8 as ns,a9 as _i,aa as yi}from"./index-
|
|
1
|
+
import{d as js,g as Ds,q as Wa,r as qa,s as Ja,l as Ka,O as Fs,u as za,f as Bs,v as Za,_ as gn,m as Ha,n as zn,i as Oe,h as Us,S as Zn,J as Hn,t as Ze,w as Va,x as Xa,R as Vn,o as Ga,j as Ws,k as qs,b as xe,T as ht,y as Qa,c as _n,z as Xn,F as Ya,D as ei,E as ti,p as Gn,G as Qn,I as ni,C as Xt,K as si,L as nt,M as ri,N as ai,P as ii,Q as Yn,U as oi,V as li,W as ci,X as Gt,Y as ui,Z as di,$ as hi,a0 as Bt,a1 as fi,a2 as yn,a3 as pi,a4 as mi,a5 as gi,a6 as es,a7 as ts,a8 as ns,a9 as _i,aa as yi}from"./index-CQ-qHv2a.js";import{Z as A,o as wi,s as bi}from"./index-C_iq8viy.js";import{t as Js,i as vi,q as ki,r as xi}from"./chunk-VL2OQCWN-C55BvblE.js";import"./embeddings-Cufjo1XK.js";import"./index-DRz5BQNA.js";const ke=t=>t();function We(t){return t?!!(/^o\d/.test(t??"")||t.startsWith("gpt-5")&&!t.startsWith("gpt-5-chat")):!1}function Si(t){return t.role!=="system"&&t.role!=="developer"&&t.role!=="assistant"&&t.role!=="user"&&t.role!=="function"&&t.role!=="tool"&&console.warn(`Unknown message role: ${t.role}`),t.role}function qe(t){const e=t._getType();switch(e){case"system":return"system";case"ai":return"assistant";case"human":return"user";case"function":return"function";case"tool":return"tool";case"generic":if(!js.isInstance(t))throw new Error("Invalid generic chat message");return Si(t);default:throw new Error(`Unknown message type: ${e}`)}}function Ai(t){const{azureOpenAIApiDeploymentName:e,azureOpenAIApiInstanceName:n,azureOpenAIApiKey:s,azureOpenAIBasePath:r,baseURL:a,azureADTokenProvider:i,azureOpenAIEndpoint:o}=t;if((s||i)&&r&&e)return`${r}/${e}`;if((s||i)&&o&&e)return`${o}/openai/deployments/${e}`;if(s||i){if(!n)throw new Error("azureOpenAIApiInstanceName is required when using azureOpenAIApiKey");if(!e)throw new Error("azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey");return`https://${n}.openai.azure.com/openai/deployments/${e}`}return a}function Ci(t,e){let n;return Ds(t)?n=Wa(t):n=t,e?.strict!==void 0&&(n.function.strict=e.strict),n}function Oi(t){return t.anyOf!==void 0&&Array.isArray(t.anyOf)}function Ti(t){const e=["namespace functions {",""];for(const n of t)n.description&&e.push(`// ${n.description}`),Object.keys(n.parameters.properties??{}).length>0?(e.push(`type ${n.name} = (_: {`),e.push(Ks(n.parameters,0)),e.push("}) => any;")):e.push(`type ${n.name} = () => any;`),e.push("");return e.push("} // namespace functions"),e.join(`
|
|
2
2
|
`)}function Ks(t,e){const n=[];for(const[s,r]of Object.entries(t.properties??{}))r.description&&e<2&&n.push(`// ${r.description}`),t.required?.includes(s)?n.push(`${s}: ${ft(r,e)},`):n.push(`${s}?: ${ft(r,e)},`);return n.map(s=>" ".repeat(e)+s).join(`
|
|
3
3
|
`)}function ft(t,e){if(Oi(t))return t.anyOf.map(n=>ft(n,e)).join(" | ");switch(t.type){case"string":return t.enum?t.enum.map(n=>`"${n}"`).join(" | "):"string";case"number":return t.enum?t.enum.map(n=>`${n}`).join(" | "):"number";case"integer":return t.enum?t.enum.map(n=>`${n}`).join(" | "):"number";case"boolean":return"boolean";case"null":return"null";case"object":return["{",Ks(t,e+2),"}"].join(`
|
|
4
4
|
`);case"array":return t.items?`${ft(t.items,e)}[]`:"any[]";default:return""}}function zs(t){if(t)return t==="any"||t==="required"?"required":t==="auto"?"auto":t==="none"?"none":typeof t=="string"?{type:"function",function:{name:t}}:t}function wn(t){return"type"in t&&t.type!=="function"}function Ii(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type!=="function"}function pt(t){return typeof t=="object"&&t!==null&&"metadata"in t&&typeof t.metadata=="object"&&t.metadata!==null&&"customTool"in t.metadata&&typeof t.metadata.customTool=="object"&&t.metadata.customTool!==null}function Zs(t){return"type"in t&&t.type==="custom"&&"custom"in t&&typeof t.custom=="object"&&t.custom!==null}function Pi(t){if(t.type==="custom_tool_call")return{...t,type:"tool_call",call_id:t.id,id:t.call_id,name:t.name,isCustomTool:!0,args:{input:t.input}}}function Ri(t){return t.type==="tool_call"&&"isCustomTool"in t&&t.isCustomTool===!0}function $i(t){const e=()=>{if(t.custom.format){if(t.custom.format.type==="grammar")return{type:"grammar",definition:t.custom.format.grammar.definition,syntax:t.custom.format.grammar.syntax};if(t.custom.format.type==="text")return{type:"text"}}};return{type:"custom",name:t.custom.name,description:t.custom.description,format:e()}}function Ei(t){const e=()=>{if(t.format){if(t.format.type==="grammar")return{type:"grammar",grammar:{definition:t.format.definition,syntax:t.format.syntax}};if(t.format.type==="text")return{type:"text"}}};return{type:"custom",custom:{name:t.name,description:t.description,format:e()}}}function Qt(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}const Yt=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){const e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};class k extends Error{}class q extends k{constructor(e,n,s,r){super(`${q.makeMessage(e,n,s)}`),this.status=e,this.headers=r,this.requestID=r?.get("x-request-id"),this.error=n;const a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,n,s){const r=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):s;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,n,s,r){if(!e||!r)return new Ot({message:s,cause:Yt(n)});const a=n?.error;return e===400?new Hs(e,a,s,r):e===401?new Vs(e,a,s,r):e===403?new Xs(e,a,s,r):e===404?new Gs(e,a,s,r):e===409?new Qs(e,a,s,r):e===422?new Ys(e,a,s,r):e===429?new er(e,a,s,r):e>=500?new tr(e,a,s,r):new q(e,a,s,r)}}class X extends q{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class Ot extends q{constructor({message:e,cause:n}){super(void 0,void 0,e||"Connection error.",void 0),n&&(this.cause=n)}}class Tt extends Ot{constructor({message:e}={}){super({message:e??"Request timed out."})}}class Hs extends q{}class Vs extends q{}class Xs extends q{}class Gs extends q{}class Qs extends q{}class Ys extends q{}class er extends q{}class tr extends q{}class nr extends k{constructor(){super("Could not parse response content as the length limit was reached")}}class sr extends k{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}class Te extends Error{constructor(e){super(e)}}function mt(t){return t!==void 0&&"function"in t&&t.function!==void 0}function Mi(t,e){const n={...t};return Object.defineProperties(n,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:e,enumerable:!1}}),n}function bn(t){return t?.$brand==="auto-parseable-response-format"}function Je(t){return t?.$brand==="auto-parseable-tool"}function Ni(t,e){return!e||!rr(e)?{...t,choices:t.choices.map(n=>(ar(n.message.tool_calls),{...n,message:{...n.message,parsed:null,...n.message.tool_calls?{tool_calls:n.message.tool_calls}:void 0}}))}:vn(t,e)}function vn(t,e){const n=t.choices.map(s=>{if(s.finish_reason==="length")throw new nr;if(s.finish_reason==="content_filter")throw new sr;return ar(s.message.tool_calls),{...s,message:{...s.message,...s.message.tool_calls?{tool_calls:s.message.tool_calls?.map(r=>ji(e,r))??void 0}:void 0,parsed:s.message.content&&!s.message.refusal?Li(e,s.message.content):null}}});return{...t,choices:n}}function Li(t,e){return t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(e):JSON.parse(e):null}function ji(t,e){const n=t.tools?.find(s=>mt(s)&&s.function?.name===e.function.name);return{...e,function:{...e.function,parsed_arguments:Je(n)?n.$parseRaw(e.function.arguments):n?.function.strict?JSON.parse(e.function.arguments):null}}}function Di(t,e){if(!t||!("tools"in t)||!t.tools)return!1;const n=t.tools?.find(s=>mt(s)&&s.function?.name===e.function.name);return mt(n)&&(Je(n)||n?.function.strict||!1)}function rr(t){return bn(t.response_format)?!0:t.tools?.some(e=>Je(e)||e.type==="function"&&e.function.strict===!0)??!1}function ar(t){for(const e of t||[])if(e.type!=="function")throw new k(`Currently only \`function\` tool calls are supported; Received \`${e.type}\``)}function Fi(t){for(const e of t??[]){if(e.type!=="function")throw new k(`Currently only \`function\` tool types support auto-parsing; Received \`${e.type}\``);if(e.function.strict!==!0)throw new k(`The \`${e.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}const Bi=Symbol("Let zodToJsonSchema decide on which parser to use"),ss={name:void 0,$refStrategy:"root",effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",nullableStrategy:"from-target",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Ui=t=>typeof t=="string"?{...ss,basePath:["#"],definitions:{},name:t}:{...ss,basePath:["#"],definitions:{},...t},en=t=>"_def"in t?t._def:t;function Wi(t){if(!t)return!0;for(const e in t)return!1;return!0}const qi=t=>{const e=Ui(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seenRefs:new Set,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[en(r),{def:en(r),path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}};function ir(t,e,n,s){s?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}function P(t,e,n,s,r){t[e]=n,ir(t,e,s,r)}function Ji(){return{}}function Ki(t,e){const n={type:"array"};return t.type?._def?.typeName!==A.ZodAny&&(n.items=T(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&P(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&P(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(P(n,"minItems",t.exactLength.value,t.exactLength.message,e),P(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}function zi(t,e){const n={type:"integer",format:"int64"};if(!t.checks)return n;for(const s of t.checks)switch(s.kind){case"min":e.target==="jsonSchema7"?s.inclusive?P(n,"minimum",s.value,s.message,e):P(n,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(n.exclusiveMinimum=!0),P(n,"minimum",s.value,s.message,e));break;case"max":e.target==="jsonSchema7"?s.inclusive?P(n,"maximum",s.value,s.message,e):P(n,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(n.exclusiveMaximum=!0),P(n,"maximum",s.value,s.message,e));break;case"multipleOf":P(n,"multipleOf",s.value,s.message,e);break}return n}function Zi(){return{type:"boolean"}}function Hi(t,e){return T(t.type._def,e)}const Vi=(t,e)=>T(t.innerType._def,e);function or(t,e,n){const s=n??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,a)=>or(t,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Xi(t,e)}}const Xi=(t,e)=>{const n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(const s of t.checks)switch(s.kind){case"min":P(n,"minimum",s.value,s.message,e);break;case"max":P(n,"maximum",s.value,s.message,e);break}return n};function Gi(t,e){return{...T(t.innerType._def,e),default:t.defaultValue()}}function Qi(t,e,n){return e.effectStrategy==="input"?T(t.schema._def,e,n):{}}function Yi(t){return{type:"string",enum:[...t.values]}}const eo=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function to(t,e){const n=[T(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),T(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(a=>!!a);let s=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return n.forEach(a=>{if(eo(a))r.push(...a.allOf),a.unevaluatedProperties===void 0&&(s=void 0);else{let i=a;if("additionalProperties"in a&&a.additionalProperties===!1){const{additionalProperties:o,...c}=a;i=c}else s=void 0;r.push(i)}}),r.length?{allOf:r,...s}:void 0}function no(t,e){const n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}let Ut;const le={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Ut===void 0&&(Ut=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ut),base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/};function lr(t,e){const n={type:"string"};function s(r){return e.patternStrategy==="escape"?so(r):r}if(t.checks)for(const r of t.checks)switch(r.kind){case"min":P(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,e);break;case"max":P(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,e);break;case"email":switch(e.emailStrategy){case"format:email":G(n,"email",r.message,e);break;case"format:idn-email":G(n,"idn-email",r.message,e);break;case"pattern:zod":Q(n,le.email,r.message,e);break}break;case"url":G(n,"uri",r.message,e);break;case"uuid":G(n,"uuid",r.message,e);break;case"regex":Q(n,r.regex,r.message,e);break;case"cuid":Q(n,le.cuid,r.message,e);break;case"cuid2":Q(n,le.cuid2,r.message,e);break;case"startsWith":Q(n,RegExp(`^${s(r.value)}`),r.message,e);break;case"endsWith":Q(n,RegExp(`${s(r.value)}$`),r.message,e);break;case"datetime":G(n,"date-time",r.message,e);break;case"date":G(n,"date",r.message,e);break;case"time":G(n,"time",r.message,e);break;case"duration":G(n,"duration",r.message,e);break;case"length":P(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,e),P(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,e);break;case"includes":{Q(n,RegExp(s(r.value)),r.message,e);break}case"ip":{r.version!=="v6"&&G(n,"ipv4",r.message,e),r.version!=="v4"&&G(n,"ipv6",r.message,e);break}case"emoji":Q(n,le.emoji,r.message,e);break;case"ulid":{Q(n,le.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{G(n,"binary",r.message,e);break}case"contentEncoding:base64":{P(n,"contentEncoding","base64",r.message,e);break}case"pattern:zod":{Q(n,le.base64,r.message,e);break}}break}case"nanoid":Q(n,le.nanoid,r.message,e)}return n}const so=t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),G=(t,e,n,s)=>{t.format||t.anyOf?.some(r=>r.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&s.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&s.errorMessages&&{errorMessage:{format:n}}})):P(t,"format",e,n,s)},Q=(t,e,n,s)=>{t.pattern||t.allOf?.some(r=>r.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&s.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:rs(e,s),...n&&s.errorMessages&&{errorMessage:{pattern:n}}})):P(t,"pattern",rs(e,s),n,s)},rs=(t,e)=>{const n=typeof t=="function"?t():t;if(!e.applyRegexFlags||!n.flags)return n.source;const s={i:n.flags.includes("i"),m:n.flags.includes("m"),s:n.flags.includes("s")},r=s.i?n.source.toLowerCase():n.source;let a="",i=!1,o=!1,c=!1;for(let l=0;l<r.length;l++){if(i){a+=r[l],i=!1;continue}if(s.i){if(o){if(r[l].match(/[a-z]/)){c?(a+=r[l],a+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&r[l+2]?.match(/[a-z]/)?(a+=r[l],c=!0):a+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){a+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(s.m){if(r[l]==="^"){a+=`(^|(?<=[\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as Oi,v as se,P as Pe,p as Ht,a as Ga,b as Nr,g as he,c as kr,d as Ke,_ as Ci,$ as xi,e as Ni,f as ki,h as Rr,i as ca,j as Ri,k as Pi,t as Va,l as Pr,V as Mi,m as Li,n as Ut,o as $i,T as ji}from"./chunk-VL2OQCWN-Dk6O4Sk7.js";import{Z as P,a as Za,o as la,s as ua}from"./index-DEqyh8hr.js";var Di=Object.defineProperty,F=(e,t)=>{for(var n in t)Di(e,n,{get:t[n],enumerable:!0})};function Ue(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"&&"source_type"in e&&(e.source_type==="url"||e.source_type==="base64"||e.source_type==="text"||e.source_type==="id")}function da(e){return Ue(e)&&e.source_type==="url"&&"url"in e&&typeof e.url=="string"}function ha(e){return Ue(e)&&e.source_type==="base64"&&"data"in e&&typeof e.data=="string"}function Fi(e){return Ue(e)&&e.source_type==="text"&&"text"in e&&typeof e.text=="string"}function Mr(e){return Ue(e)&&e.source_type==="id"&&"id"in e&&typeof e.id=="string"}function Lr(e){if(Ue(e)){if(e.source_type==="url")return{type:"image_url",image_url:{url:e.url}};if(e.source_type==="base64"){if(!e.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${e.mime_type};base64,${e.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function Ui(e){const t=e.split(";")[0].split("/");if(t.length!==2)throw new Error(`Invalid mime type: "${e}" - does not match type/subtype format.`);const n=t[0].trim(),a=t[1].trim();if(n===""||a==="")throw new Error(`Invalid mime type: "${e}" - type or subtype is empty.`);const r={};for(const s of e.split(";").slice(1)){const i=s.split("=");if(i.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${e}".`);const o=i[0].trim(),c=i[1].trim();if(o==="")throw new Error(`Invalid parameter syntax in mime type: "${e}".`);r[o]=c}return{type:n,subtype:a,parameters:r}}function $n({dataUrl:e,asTypedArray:t=!1}){const n=e.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/);let a;if(n){a=n[1].toLowerCase();const r=t?Uint8Array.from(atob(n[2]),s=>s.charCodeAt(0)):n[2];return{mime_type:a,data:r}}}function Bi(e,t){if(e.type==="text"){if(!t.fromStandardTextBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardTextBlock\` method.`);return t.fromStandardTextBlock(e)}if(e.type==="image"){if(!t.fromStandardImageBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardImageBlock\` method.`);return t.fromStandardImageBlock(e)}if(e.type==="audio"){if(!t.fromStandardAudioBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardAudioBlock\` method.`);return t.fromStandardAudioBlock(e)}if(e.type==="file"){if(!t.fromStandardFileBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardFileBlock\` method.`);return t.fromStandardFileBlock(e)}throw new Error(`Unable to convert content block type '${e.type}' to provider-specific format: not recognized.`)}function $r(e){return typeof e=="object"&&e!==null&&"type"in e&&"content"in e&&(typeof e.content=="string"||Array.isArray(e.content))}function zi(e,t){return t?.[e]||Oi(e)}function Hi(e,t,n){const a={};for(const r in e)Object.hasOwn(e,r)&&(a[t(r,n)]=e[r]);return a}var Gi={};F(Gi,{Serializable:()=>lt,get_lc_unique_name:()=>pa});function qa(e){return Array.isArray(e)?[...e]:{...e}}function Vi(e,t){const n=qa(e);for(const[a,r]of Object.entries(t)){const[s,...i]=a.split(".").reverse();let o=n;for(const c of i.reverse()){if(o[c]===void 0)break;o[c]=qa(o[c]),o=o[c]}o[s]!==void 0&&(o[s]={lc:1,type:"secret",id:[r]})}return n}function pa(e){const t=Object.getPrototypeOf(e);return typeof e.lc_name=="function"&&(typeof t.lc_name!="function"||e.lc_name()!==t.lc_name())?e.lc_name():e.name}var lt=class jr{lc_serializable=!1;lc_kwargs;static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,pa(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(t,...n){this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(t||{}).filter(([a])=>this.lc_serializable_keys?.includes(a))):this.lc_kwargs=t??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof jr||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();const t={},n={},a=Object.keys(this.lc_kwargs).reduce((r,s)=>(r[s]=s in this?this[s]:this.lc_kwargs[s],r),{});for(let r=Object.getPrototypeOf(this);r;r=Object.getPrototypeOf(r))Object.assign(t,Reflect.get(r,"lc_aliases",this)),Object.assign(n,Reflect.get(r,"lc_secrets",this)),Object.assign(a,Reflect.get(r,"lc_attributes",this));return Object.keys(n).forEach(r=>{let s=this,i=a;const[o,...c]=r.split(".").reverse();for(const l of c.reverse()){if(!(l in s)||s[l]===void 0)return;(!(l in i)||i[l]===void 0)&&(typeof s[l]=="object"&&s[l]!=null?i[l]={}:Array.isArray(s[l])&&(i[l]=[])),s=s[l],i=i[l]}o in s&&s[o]!==void 0&&(i[o]=i[o]||s[o])}),{lc:1,type:"constructor",id:this.lc_id,kwargs:Hi(Object.keys(n).length?Vi(a,n):a,zi,t)}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}};function C(e,t){return k(e)&&e.type===t}function k(e){return typeof e=="object"&&e!==null}function Ie(e){return Array.isArray(e)}function S(e){return typeof e=="string"}function we(e){return typeof e=="number"}function fa(e){return e instanceof Uint8Array}function Ja(e){try{return JSON.parse(e)}catch{return}}const vt=e=>e();function Zi(e){if(e.type==="char_location"&&S(e.document_title)&&we(e.start_char_index)&&we(e.end_char_index)&&S(e.cited_text)){const{document_title:t,start_char_index:n,end_char_index:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"char",title:t??void 0,startIndex:n,endIndex:a,citedText:r}}if(e.type==="page_location"&&S(e.document_title)&&we(e.start_page_number)&&we(e.end_page_number)&&S(e.cited_text)){const{document_title:t,start_page_number:n,end_page_number:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"page",title:t??void 0,startIndex:n,endIndex:a,citedText:r}}if(e.type==="content_block_location"&&S(e.document_title)&&we(e.start_block_index)&&we(e.end_block_index)&&S(e.cited_text)){const{document_title:t,start_block_index:n,end_block_index:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"block",title:t??void 0,startIndex:n,endIndex:a,citedText:r}}if(e.type==="web_search_result_location"&&S(e.url)&&S(e.title)&&S(e.encrypted_index)&&S(e.cited_text)){const{url:t,title:n,encrypted_index:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"url",url:t,title:n,startIndex:Number(a),endIndex:Number(a),citedText:r}}if(e.type==="search_result_location"&&S(e.source)&&S(e.title)&&we(e.start_block_index)&&we(e.end_block_index)&&S(e.cited_text)){const{source:t,title:n,start_block_index:a,end_block_index:r,cited_text:s,...i}=e;return{...i,type:"citation",source:"search",url:t,title:n??void 0,startIndex:a,endIndex:r,citedText:s}}}function Dr(e){if(C(e,"document")&&k(e.source)&&"type"in e.source){if(e.source.type==="base64"&&S(e.source.media_type)&&S(e.source.data))return{type:"file",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&S(e.source.url))return{type:"file",url:e.source.url};if(e.source.type==="file"&&S(e.source.file_id))return{type:"file",fileId:e.source.file_id};if(e.source.type==="text"&&S(e.source.data))return{type:"file",mimeType:String(e.source.media_type??"text/plain"),data:e.source.data}}else if(C(e,"image")&&k(e.source)&&"type"in e.source){if(e.source.type==="base64"&&S(e.source.media_type)&&S(e.source.data))return{type:"image",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&S(e.source.url))return{type:"image",url:e.source.url};if(e.source.type==="file"&&S(e.source.file_id))return{type:"image",fileId:e.source.file_id}}}function qi(e){function*t(){for(const n of e){const a=Dr(n);a?yield a:yield n}}return Array.from(t())}function Wa(e){function*t(){const n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(const a of n){if(C(a,"text")&&S(a.text)){const{text:r,citations:s,...i}=a;if(Ie(s)&&s.length){const o=s.reduce((c,l)=>{const d=Zi(l);return d?[...c,d]:c},[]);yield{...i,type:"text",text:r,annotations:o};continue}else{yield{...i,type:"text",text:r};continue}}else if(C(a,"thinking")&&S(a.thinking)){const{thinking:r,signature:s,...i}=a;yield{...i,type:"reasoning",reasoning:r,signature:s};continue}else if(C(a,"redacted_thinking")){yield{type:"non_standard",value:a};continue}else if(C(a,"tool_use")&&S(a.name)&&S(a.id)){yield{type:"tool_call",id:a.id,name:a.name,args:a.input};continue}else if(C(a,"input_json_delta")){if(Wi(e)&&e.tool_call_chunks?.length){const r=e.tool_call_chunks[0];yield{type:"tool_call_chunk",id:r.id,name:r.name,args:r.args,index:r.index};continue}}else if(C(a,"server_tool_use")&&S(a.name)&&S(a.id)){const{name:r,id:s}=a;if(r==="web_search"){const i=vt(()=>{if(typeof a.input=="string")return a.input;if(k(a.input)&&S(a.input.query))return a.input.query;if(S(a.partial_json)){const o=Ja(a.partial_json);if(o?.query)return o.query}return""});yield{id:s,type:"server_tool_call",name:"web_search",args:{query:i}};continue}else if(a.name==="code_execution"){const i=vt(()=>{if(typeof a.input=="string")return a.input;if(k(a.input)&&S(a.input.code))return a.input.code;if(S(a.partial_json)){const o=Ja(a.partial_json);if(o?.code)return o.code}return""});yield{id:s,type:"server_tool_call",name:"code_execution",args:{code:i}};continue}}else if(C(a,"web_search_tool_result")&&S(a.tool_use_id)&&Ie(a.content)){const{content:r,tool_use_id:s}=a,i=r.reduce((o,c)=>C(c,"web_search_result")?[...o,c.url]:o,[]);yield{type:"server_tool_call_result",name:"web_search",toolCallId:s,status:"success",output:{urls:i}};continue}else if(C(a,"code_execution_tool_result")&&S(a.tool_use_id)&&k(a.content)){yield{type:"server_tool_call_result",name:"code_execution",toolCallId:a.tool_use_id,status:"success",output:a.content};continue}else if(C(a,"mcp_tool_use")){yield{id:a.id,type:"server_tool_call",name:"mcp_tool_use",args:a.input};continue}else if(C(a,"mcp_tool_result")&&S(a.tool_use_id)&&k(a.content)){yield{type:"server_tool_call_result",name:"mcp_tool_use",toolCallId:a.tool_use_id,status:"success",output:a.content};continue}else if(C(a,"container_upload")){yield{type:"server_tool_call",name:"container_upload",args:a.input};continue}else if(C(a,"search_result")){yield{id:a.id,type:"non_standard",value:a};continue}else if(C(a,"tool_result")){yield{id:a.id,type:"non_standard",value:a};continue}else{const r=Dr(a);if(r){yield r;continue}}yield{type:"non_standard",value:a}}}return Array.from(t())}const Ji={translateContent:Wa,translateContentChunk:Wa};function Wi(e){return typeof e?._getType=="function"&&typeof e.concat=="function"&&e._getType()==="ai"}function Ki(e){return da(e)?{type:e.type,mimeType:e.mime_type,url:e.url,metadata:e.metadata}:ha(e)?{type:e.type,mimeType:e.mime_type??"application/octet-stream",data:e.data,metadata:e.metadata}:Mr(e)?{type:e.type,mimeType:e.mime_type,fileId:e.id,metadata:e.metadata}:e}function Yi(e){return e.map(Ki)}function Qi(e){return!!(C(e,"image_url")&&k(e.image_url)||C(e,"input_audio")&&k(e.input_audio)||C(e,"file")&&k(e.file))}function Xi(e){if(C(e,"image_url")&&k(e.image_url)&&S(e.image_url.url)){const t=$n({dataUrl:e.image_url.url});return t?{type:"image",mimeType:t.mime_type,data:t.data}:{type:"image",url:e.image_url.url}}else{if(C(e,"input_audio")&&k(e.input_audio)&&S(e.input_audio.data)&&S(e.input_audio.format))return{type:"audio",data:e.input_audio.data,mimeType:`audio/${e.input_audio.format}`};if(C(e,"file")&&k(e.file)&&S(e.file.data)){const t=$n({dataUrl:e.file.data});if(t)return{type:"file",data:t.data,mimeType:t.mime_type};if(S(e.file.file_id))return{type:"file",fileId:e.file.file_id}}}return e}function eo(e){const t=[];typeof e.content=="string"?t.push({type:"text",text:e.content}):t.push(...ma(e.content));for(const n of e.tool_calls??[])t.push({type:"tool_call",id:n.id,name:n.name,args:n.args});return t}function to(e){const t=[];typeof e.content=="string"?t.push({type:"text",text:e.content}):t.push(...ma(e.content));for(const n of e.tool_calls??[])t.push({type:"tool_call",id:n.id,name:n.name,args:n.args});return t}function ma(e){const t=[];for(const n of e)Qi(n)?t.push(Xi(n)):t.push(n);return t}function no(e){if(e.type==="url_citation"){const{url:t,title:n,start_index:a,end_index:r}=e;return{type:"citation",url:t,title:n,startIndex:a,endIndex:r}}if(e.type==="file_citation"){const{file_id:t,filename:n,index:a}=e;return{type:"citation",title:n,startIndex:a,endIndex:a,fileId:t}}return e}function Fr(e){function*t(){k(e.additional_kwargs?.reasoning)&&Ie(e.additional_kwargs.reasoning.summary)&&(yield{type:"reasoning",reasoning:e.additional_kwargs.reasoning.summary.reduce((r,s)=>k(s)&&S(s.text)?`${r}${s.text}`:r,"")});const n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(const a of n)if(C(a,"text")){const{text:r,annotations:s,...i}=a;Array.isArray(s)?yield{...i,type:"text",text:String(r),annotations:s.map(no)}:yield{...i,type:"text",text:String(r)}}for(const a of e.tool_calls??[])yield{type:"tool_call",id:a.id,name:a.name,args:a.args};if(k(e.additional_kwargs)&&Ie(e.additional_kwargs.tool_outputs))for(const a of e.additional_kwargs.tool_outputs){if(C(a,"web_search_call")){yield{id:a.id,type:"server_tool_call",name:"web_search",args:{query:a.query}};continue}else if(C(a,"file_search_call")){yield{id:a.id,type:"server_tool_call",name:"file_search",args:{query:a.query}};continue}else if(C(a,"computer_call")){yield{type:"non_standard",value:a};continue}else if(C(a,"code_interpreter_call")){if(S(a.code)&&(yield{id:a.id,type:"server_tool_call",name:"code_interpreter",args:{code:a.code}}),Ie(a.outputs)){const r=vt(()=>{if(a.status!=="in_progress"){if(a.status==="completed")return 0;if(a.status==="incomplete")return 127;if(a.status!=="interpreting"&&a.status==="failed")return 1}});for(const s of a.outputs)if(C(s,"logs")){yield{type:"server_tool_call_result",toolCallId:a.id??"",status:"success",output:{type:"code_interpreter_output",returnCode:r??0,stderr:[0,void 0].includes(r)?void 0:String(s.logs),stdout:[0,void 0].includes(r)?String(s.logs):void 0}};continue}}continue}else if(C(a,"mcp_call")){yield{id:a.id,type:"server_tool_call",name:"mcp_call",args:a.input};continue}else if(C(a,"mcp_list_tools")){yield{id:a.id,type:"server_tool_call",name:"mcp_list_tools",args:a.input};continue}else if(C(a,"mcp_approval_request")){yield{type:"non_standard",value:a};continue}else if(C(a,"image_generation_call")){yield{type:"non_standard",value:a};continue}k(a)&&(yield{type:"non_standard",value:a})}}return Array.from(t())}function ao(e){function*t(){yield*Fr(e);for(const n of e.tool_call_chunks??[])yield{type:"tool_call_chunk",id:n.id,name:n.name,args:n.args}}return Array.from(t())}const ro={translateContent:e=>typeof e.content=="string"?eo(e):Fr(e),translateContentChunk:e=>typeof e.content=="string"?to(e):ao(e)};function so(e,t="pretty"){return t==="pretty"?io(e):JSON.stringify(e)}function io(e){const t=[],n=` ${e.type.charAt(0).toUpperCase()+e.type.slice(1)} Message `,a=Math.floor((80-n.length)/2),r="=".repeat(a),s=n.length%2===0?r:`${r}=`;if(t.push(`${r}${n}${s}`),e.type==="ai"){const i=e;if(i.tool_calls&&i.tool_calls.length>0){t.push("Tool Calls:");for(const o of i.tool_calls){t.push(` ${o.name} (${o.id})`),t.push(` Call ID: ${o.id}`),t.push(" Args:");for(const[c,l]of Object.entries(o.args))t.push(` ${c}: ${l}`)}}}if(e.type==="tool"){const i=e;i.name&&t.push(`Name: ${i.name}`)}return typeof e.content=="string"&&e.content.trim()&&(t.length>1&&t.push(""),t.push(e.content)),t.join(`
|
|
1
|
+
import{s as Oi,v as se,P as Pe,p as Ht,a as Ga,b as Nr,g as he,c as kr,d as Ke,_ as Ci,$ as xi,e as Ni,f as ki,h as Rr,i as ca,j as Ri,k as Pi,t as Va,l as Pr,V as Mi,m as Li,n as Ut,o as $i,T as ji}from"./chunk-VL2OQCWN-C55BvblE.js";import{Z as P,a as Za,o as la,s as ua}from"./index-C_iq8viy.js";var Di=Object.defineProperty,F=(e,t)=>{for(var n in t)Di(e,n,{get:t[n],enumerable:!0})};function Ue(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"&&"source_type"in e&&(e.source_type==="url"||e.source_type==="base64"||e.source_type==="text"||e.source_type==="id")}function da(e){return Ue(e)&&e.source_type==="url"&&"url"in e&&typeof e.url=="string"}function ha(e){return Ue(e)&&e.source_type==="base64"&&"data"in e&&typeof e.data=="string"}function Fi(e){return Ue(e)&&e.source_type==="text"&&"text"in e&&typeof e.text=="string"}function Mr(e){return Ue(e)&&e.source_type==="id"&&"id"in e&&typeof e.id=="string"}function Lr(e){if(Ue(e)){if(e.source_type==="url")return{type:"image_url",image_url:{url:e.url}};if(e.source_type==="base64"){if(!e.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${e.mime_type};base64,${e.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function Ui(e){const t=e.split(";")[0].split("/");if(t.length!==2)throw new Error(`Invalid mime type: "${e}" - does not match type/subtype format.`);const n=t[0].trim(),a=t[1].trim();if(n===""||a==="")throw new Error(`Invalid mime type: "${e}" - type or subtype is empty.`);const r={};for(const s of e.split(";").slice(1)){const i=s.split("=");if(i.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${e}".`);const o=i[0].trim(),c=i[1].trim();if(o==="")throw new Error(`Invalid parameter syntax in mime type: "${e}".`);r[o]=c}return{type:n,subtype:a,parameters:r}}function $n({dataUrl:e,asTypedArray:t=!1}){const n=e.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/);let a;if(n){a=n[1].toLowerCase();const r=t?Uint8Array.from(atob(n[2]),s=>s.charCodeAt(0)):n[2];return{mime_type:a,data:r}}}function Bi(e,t){if(e.type==="text"){if(!t.fromStandardTextBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardTextBlock\` method.`);return t.fromStandardTextBlock(e)}if(e.type==="image"){if(!t.fromStandardImageBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardImageBlock\` method.`);return t.fromStandardImageBlock(e)}if(e.type==="audio"){if(!t.fromStandardAudioBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardAudioBlock\` method.`);return t.fromStandardAudioBlock(e)}if(e.type==="file"){if(!t.fromStandardFileBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardFileBlock\` method.`);return t.fromStandardFileBlock(e)}throw new Error(`Unable to convert content block type '${e.type}' to provider-specific format: not recognized.`)}function $r(e){return typeof e=="object"&&e!==null&&"type"in e&&"content"in e&&(typeof e.content=="string"||Array.isArray(e.content))}function zi(e,t){return t?.[e]||Oi(e)}function Hi(e,t,n){const a={};for(const r in e)Object.hasOwn(e,r)&&(a[t(r,n)]=e[r]);return a}var Gi={};F(Gi,{Serializable:()=>lt,get_lc_unique_name:()=>pa});function qa(e){return Array.isArray(e)?[...e]:{...e}}function Vi(e,t){const n=qa(e);for(const[a,r]of Object.entries(t)){const[s,...i]=a.split(".").reverse();let o=n;for(const c of i.reverse()){if(o[c]===void 0)break;o[c]=qa(o[c]),o=o[c]}o[s]!==void 0&&(o[s]={lc:1,type:"secret",id:[r]})}return n}function pa(e){const t=Object.getPrototypeOf(e);return typeof e.lc_name=="function"&&(typeof t.lc_name!="function"||e.lc_name()!==t.lc_name())?e.lc_name():e.name}var lt=class jr{lc_serializable=!1;lc_kwargs;static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,pa(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(t,...n){this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(t||{}).filter(([a])=>this.lc_serializable_keys?.includes(a))):this.lc_kwargs=t??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof jr||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();const t={},n={},a=Object.keys(this.lc_kwargs).reduce((r,s)=>(r[s]=s in this?this[s]:this.lc_kwargs[s],r),{});for(let r=Object.getPrototypeOf(this);r;r=Object.getPrototypeOf(r))Object.assign(t,Reflect.get(r,"lc_aliases",this)),Object.assign(n,Reflect.get(r,"lc_secrets",this)),Object.assign(a,Reflect.get(r,"lc_attributes",this));return Object.keys(n).forEach(r=>{let s=this,i=a;const[o,...c]=r.split(".").reverse();for(const l of c.reverse()){if(!(l in s)||s[l]===void 0)return;(!(l in i)||i[l]===void 0)&&(typeof s[l]=="object"&&s[l]!=null?i[l]={}:Array.isArray(s[l])&&(i[l]=[])),s=s[l],i=i[l]}o in s&&s[o]!==void 0&&(i[o]=i[o]||s[o])}),{lc:1,type:"constructor",id:this.lc_id,kwargs:Hi(Object.keys(n).length?Vi(a,n):a,zi,t)}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}};function C(e,t){return k(e)&&e.type===t}function k(e){return typeof e=="object"&&e!==null}function Ie(e){return Array.isArray(e)}function S(e){return typeof e=="string"}function we(e){return typeof e=="number"}function fa(e){return e instanceof Uint8Array}function Ja(e){try{return JSON.parse(e)}catch{return}}const vt=e=>e();function Zi(e){if(e.type==="char_location"&&S(e.document_title)&&we(e.start_char_index)&&we(e.end_char_index)&&S(e.cited_text)){const{document_title:t,start_char_index:n,end_char_index:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"char",title:t??void 0,startIndex:n,endIndex:a,citedText:r}}if(e.type==="page_location"&&S(e.document_title)&&we(e.start_page_number)&&we(e.end_page_number)&&S(e.cited_text)){const{document_title:t,start_page_number:n,end_page_number:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"page",title:t??void 0,startIndex:n,endIndex:a,citedText:r}}if(e.type==="content_block_location"&&S(e.document_title)&&we(e.start_block_index)&&we(e.end_block_index)&&S(e.cited_text)){const{document_title:t,start_block_index:n,end_block_index:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"block",title:t??void 0,startIndex:n,endIndex:a,citedText:r}}if(e.type==="web_search_result_location"&&S(e.url)&&S(e.title)&&S(e.encrypted_index)&&S(e.cited_text)){const{url:t,title:n,encrypted_index:a,cited_text:r,...s}=e;return{...s,type:"citation",source:"url",url:t,title:n,startIndex:Number(a),endIndex:Number(a),citedText:r}}if(e.type==="search_result_location"&&S(e.source)&&S(e.title)&&we(e.start_block_index)&&we(e.end_block_index)&&S(e.cited_text)){const{source:t,title:n,start_block_index:a,end_block_index:r,cited_text:s,...i}=e;return{...i,type:"citation",source:"search",url:t,title:n??void 0,startIndex:a,endIndex:r,citedText:s}}}function Dr(e){if(C(e,"document")&&k(e.source)&&"type"in e.source){if(e.source.type==="base64"&&S(e.source.media_type)&&S(e.source.data))return{type:"file",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&S(e.source.url))return{type:"file",url:e.source.url};if(e.source.type==="file"&&S(e.source.file_id))return{type:"file",fileId:e.source.file_id};if(e.source.type==="text"&&S(e.source.data))return{type:"file",mimeType:String(e.source.media_type??"text/plain"),data:e.source.data}}else if(C(e,"image")&&k(e.source)&&"type"in e.source){if(e.source.type==="base64"&&S(e.source.media_type)&&S(e.source.data))return{type:"image",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&S(e.source.url))return{type:"image",url:e.source.url};if(e.source.type==="file"&&S(e.source.file_id))return{type:"image",fileId:e.source.file_id}}}function qi(e){function*t(){for(const n of e){const a=Dr(n);a?yield a:yield n}}return Array.from(t())}function Wa(e){function*t(){const n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(const a of n){if(C(a,"text")&&S(a.text)){const{text:r,citations:s,...i}=a;if(Ie(s)&&s.length){const o=s.reduce((c,l)=>{const d=Zi(l);return d?[...c,d]:c},[]);yield{...i,type:"text",text:r,annotations:o};continue}else{yield{...i,type:"text",text:r};continue}}else if(C(a,"thinking")&&S(a.thinking)){const{thinking:r,signature:s,...i}=a;yield{...i,type:"reasoning",reasoning:r,signature:s};continue}else if(C(a,"redacted_thinking")){yield{type:"non_standard",value:a};continue}else if(C(a,"tool_use")&&S(a.name)&&S(a.id)){yield{type:"tool_call",id:a.id,name:a.name,args:a.input};continue}else if(C(a,"input_json_delta")){if(Wi(e)&&e.tool_call_chunks?.length){const r=e.tool_call_chunks[0];yield{type:"tool_call_chunk",id:r.id,name:r.name,args:r.args,index:r.index};continue}}else if(C(a,"server_tool_use")&&S(a.name)&&S(a.id)){const{name:r,id:s}=a;if(r==="web_search"){const i=vt(()=>{if(typeof a.input=="string")return a.input;if(k(a.input)&&S(a.input.query))return a.input.query;if(S(a.partial_json)){const o=Ja(a.partial_json);if(o?.query)return o.query}return""});yield{id:s,type:"server_tool_call",name:"web_search",args:{query:i}};continue}else if(a.name==="code_execution"){const i=vt(()=>{if(typeof a.input=="string")return a.input;if(k(a.input)&&S(a.input.code))return a.input.code;if(S(a.partial_json)){const o=Ja(a.partial_json);if(o?.code)return o.code}return""});yield{id:s,type:"server_tool_call",name:"code_execution",args:{code:i}};continue}}else if(C(a,"web_search_tool_result")&&S(a.tool_use_id)&&Ie(a.content)){const{content:r,tool_use_id:s}=a,i=r.reduce((o,c)=>C(c,"web_search_result")?[...o,c.url]:o,[]);yield{type:"server_tool_call_result",name:"web_search",toolCallId:s,status:"success",output:{urls:i}};continue}else if(C(a,"code_execution_tool_result")&&S(a.tool_use_id)&&k(a.content)){yield{type:"server_tool_call_result",name:"code_execution",toolCallId:a.tool_use_id,status:"success",output:a.content};continue}else if(C(a,"mcp_tool_use")){yield{id:a.id,type:"server_tool_call",name:"mcp_tool_use",args:a.input};continue}else if(C(a,"mcp_tool_result")&&S(a.tool_use_id)&&k(a.content)){yield{type:"server_tool_call_result",name:"mcp_tool_use",toolCallId:a.tool_use_id,status:"success",output:a.content};continue}else if(C(a,"container_upload")){yield{type:"server_tool_call",name:"container_upload",args:a.input};continue}else if(C(a,"search_result")){yield{id:a.id,type:"non_standard",value:a};continue}else if(C(a,"tool_result")){yield{id:a.id,type:"non_standard",value:a};continue}else{const r=Dr(a);if(r){yield r;continue}}yield{type:"non_standard",value:a}}}return Array.from(t())}const Ji={translateContent:Wa,translateContentChunk:Wa};function Wi(e){return typeof e?._getType=="function"&&typeof e.concat=="function"&&e._getType()==="ai"}function Ki(e){return da(e)?{type:e.type,mimeType:e.mime_type,url:e.url,metadata:e.metadata}:ha(e)?{type:e.type,mimeType:e.mime_type??"application/octet-stream",data:e.data,metadata:e.metadata}:Mr(e)?{type:e.type,mimeType:e.mime_type,fileId:e.id,metadata:e.metadata}:e}function Yi(e){return e.map(Ki)}function Qi(e){return!!(C(e,"image_url")&&k(e.image_url)||C(e,"input_audio")&&k(e.input_audio)||C(e,"file")&&k(e.file))}function Xi(e){if(C(e,"image_url")&&k(e.image_url)&&S(e.image_url.url)){const t=$n({dataUrl:e.image_url.url});return t?{type:"image",mimeType:t.mime_type,data:t.data}:{type:"image",url:e.image_url.url}}else{if(C(e,"input_audio")&&k(e.input_audio)&&S(e.input_audio.data)&&S(e.input_audio.format))return{type:"audio",data:e.input_audio.data,mimeType:`audio/${e.input_audio.format}`};if(C(e,"file")&&k(e.file)&&S(e.file.data)){const t=$n({dataUrl:e.file.data});if(t)return{type:"file",data:t.data,mimeType:t.mime_type};if(S(e.file.file_id))return{type:"file",fileId:e.file.file_id}}}return e}function eo(e){const t=[];typeof e.content=="string"?t.push({type:"text",text:e.content}):t.push(...ma(e.content));for(const n of e.tool_calls??[])t.push({type:"tool_call",id:n.id,name:n.name,args:n.args});return t}function to(e){const t=[];typeof e.content=="string"?t.push({type:"text",text:e.content}):t.push(...ma(e.content));for(const n of e.tool_calls??[])t.push({type:"tool_call",id:n.id,name:n.name,args:n.args});return t}function ma(e){const t=[];for(const n of e)Qi(n)?t.push(Xi(n)):t.push(n);return t}function no(e){if(e.type==="url_citation"){const{url:t,title:n,start_index:a,end_index:r}=e;return{type:"citation",url:t,title:n,startIndex:a,endIndex:r}}if(e.type==="file_citation"){const{file_id:t,filename:n,index:a}=e;return{type:"citation",title:n,startIndex:a,endIndex:a,fileId:t}}return e}function Fr(e){function*t(){k(e.additional_kwargs?.reasoning)&&Ie(e.additional_kwargs.reasoning.summary)&&(yield{type:"reasoning",reasoning:e.additional_kwargs.reasoning.summary.reduce((r,s)=>k(s)&&S(s.text)?`${r}${s.text}`:r,"")});const n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(const a of n)if(C(a,"text")){const{text:r,annotations:s,...i}=a;Array.isArray(s)?yield{...i,type:"text",text:String(r),annotations:s.map(no)}:yield{...i,type:"text",text:String(r)}}for(const a of e.tool_calls??[])yield{type:"tool_call",id:a.id,name:a.name,args:a.args};if(k(e.additional_kwargs)&&Ie(e.additional_kwargs.tool_outputs))for(const a of e.additional_kwargs.tool_outputs){if(C(a,"web_search_call")){yield{id:a.id,type:"server_tool_call",name:"web_search",args:{query:a.query}};continue}else if(C(a,"file_search_call")){yield{id:a.id,type:"server_tool_call",name:"file_search",args:{query:a.query}};continue}else if(C(a,"computer_call")){yield{type:"non_standard",value:a};continue}else if(C(a,"code_interpreter_call")){if(S(a.code)&&(yield{id:a.id,type:"server_tool_call",name:"code_interpreter",args:{code:a.code}}),Ie(a.outputs)){const r=vt(()=>{if(a.status!=="in_progress"){if(a.status==="completed")return 0;if(a.status==="incomplete")return 127;if(a.status!=="interpreting"&&a.status==="failed")return 1}});for(const s of a.outputs)if(C(s,"logs")){yield{type:"server_tool_call_result",toolCallId:a.id??"",status:"success",output:{type:"code_interpreter_output",returnCode:r??0,stderr:[0,void 0].includes(r)?void 0:String(s.logs),stdout:[0,void 0].includes(r)?String(s.logs):void 0}};continue}}continue}else if(C(a,"mcp_call")){yield{id:a.id,type:"server_tool_call",name:"mcp_call",args:a.input};continue}else if(C(a,"mcp_list_tools")){yield{id:a.id,type:"server_tool_call",name:"mcp_list_tools",args:a.input};continue}else if(C(a,"mcp_approval_request")){yield{type:"non_standard",value:a};continue}else if(C(a,"image_generation_call")){yield{type:"non_standard",value:a};continue}k(a)&&(yield{type:"non_standard",value:a})}}return Array.from(t())}function ao(e){function*t(){yield*Fr(e);for(const n of e.tool_call_chunks??[])yield{type:"tool_call_chunk",id:n.id,name:n.name,args:n.args}}return Array.from(t())}const ro={translateContent:e=>typeof e.content=="string"?eo(e):Fr(e),translateContentChunk:e=>typeof e.content=="string"?to(e):ao(e)};function so(e,t="pretty"){return t==="pretty"?io(e):JSON.stringify(e)}function io(e){const t=[],n=` ${e.type.charAt(0).toUpperCase()+e.type.slice(1)} Message `,a=Math.floor((80-n.length)/2),r="=".repeat(a),s=n.length%2===0?r:`${r}=`;if(t.push(`${r}${n}${s}`),e.type==="ai"){const i=e;if(i.tool_calls&&i.tool_calls.length>0){t.push("Tool Calls:");for(const o of i.tool_calls){t.push(` ${o.name} (${o.id})`),t.push(` Call ID: ${o.id}`),t.push(" Args:");for(const[c,l]of Object.entries(o.args))t.push(` ${c}: ${l}`)}}}if(e.type==="tool"){const i=e;i.name&&t.push(`Name: ${i.name}`)}return typeof e.content=="string"&&e.content.trim()&&(t.length>1&&t.push(""),t.push(e.content)),t.join(`
|
|
2
2
|
`)}const yn=Symbol.for("langchain.message");function Xe(e,t){return typeof e=="string"?e===""?t:typeof t=="string"?e+t:Array.isArray(t)&&t.some(n=>Ue(n))?[{type:"text",source_type:"text",text:e},...t]:[{type:"text",text:e},...t]:Array.isArray(t)?Ot(e,t)??[...e,...t]:t===""?e:Array.isArray(e)&&e.some(n=>Ue(n))?[...e,{type:"file",source_type:"text",text:t}]:[...e,{type:"text",text:t}]}function Ur(e,t){return e==="error"||t==="error"?"error":"success"}function oo(e,t){function n(a,r){if(typeof a!="object"||a===null||a===void 0)return a;if(r>=t)return Array.isArray(a)?"[Array]":"[Object]";if(Array.isArray(a))return a.map(i=>n(i,r+1));const s={};for(const i of Object.keys(a))s[i]=n(a[i],r+1);return s}return JSON.stringify(n(e,0),null,2)}var Le=class extends lt{lc_namespace=["langchain_core","messages"];lc_serializable=!0;get lc_aliases(){return{additional_kwargs:"additional_kwargs",response_metadata:"response_metadata"}}[yn]=!0;id;name;content;additional_kwargs;response_metadata;_getType(){return this.type}getType(){return this._getType()}constructor(e){const t=typeof e=="string"||Array.isArray(e)?{content:e}:e;t.additional_kwargs||(t.additional_kwargs={}),t.response_metadata||(t.response_metadata={}),super(t),this.name=t.name,t.content===void 0&&t.contentBlocks!==void 0?(this.content=t.contentBlocks,this.response_metadata={output_version:"v1",...t.response_metadata}):t.content!==void 0?(this.content=t.content??[],this.response_metadata=t.response_metadata):(this.content=[],this.response_metadata=t.response_metadata),this.additional_kwargs=t.additional_kwargs,this.id=t.id}get text(){return typeof this.content=="string"?this.content:Array.isArray(this.content)?this.content.map(e=>typeof e=="string"?e:e.type==="text"?e.text:"").join(""):""}get contentBlocks(){const e=typeof this.content=="string"?[{type:"text",text:this.content}]:this.content;return[Yi,ma,qi].reduce((a,r)=>r(a),e)}toDict(){return{type:this.getType(),data:this.toJSON().kwargs}}static lc_name(){return"BaseMessage"}get _printableFields(){return{id:this.id,content:this.content,name:this.name,additional_kwargs:this.additional_kwargs,response_metadata:this.response_metadata}}static isInstance(e){return typeof e=="object"&&e!==null&&yn in e&&e[yn]===!0&&$r(e)}_updateId(e){this.id=e,this.lc_kwargs.id=e}get[Symbol.toStringTag](){return this.constructor.lc_name()}[Symbol.for("nodejs.util.inspect.custom")](e){if(e===null)return this;const t=oo(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${t}`}toFormattedString(e="pretty"){return so(this,e)}};function co(e){return Array.isArray(e)&&e.every(t=>typeof t.index=="number")}function ee(e={},t={}){const n={...e};for(const[a,r]of Object.entries(t))if(n[a]==null)n[a]=r;else{if(r==null)continue;if(typeof n[a]!=typeof r||Array.isArray(n[a])!==Array.isArray(r))throw new Error(`field[${a}] already exists in the message chunk, but with a different type.`);if(typeof n[a]=="string"){if(a==="type")continue;["id","name","output_version","model_provider"].includes(a)?n[a]=r:n[a]+=r}else if(typeof n[a]=="object"&&!Array.isArray(n[a]))n[a]=ee(n[a],r);else if(Array.isArray(n[a]))n[a]=Ot(n[a],r);else{if(n[a]===r)continue;console.warn(`field[${a}] already exists in this message chunk and value has unsupported type.`)}}return n}function Ot(e,t){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)return e||t;{const n=[...e];for(const a of t)if(typeof a=="object"&&a!==null&&"index"in a&&typeof a.index=="number"){const r=n.findIndex(s=>{const i=typeof s=="object",o="index"in s&&s.index===a.index,c="id"in s&&"id"in a&&s?.id===a?.id,l=!("id"in s)||!s?.id||!("id"in a)||!a?.id;return i&&o&&(c||l)});r!==-1&&typeof n[r]=="object"&&n[r]!==null?n[r]=ee(n[r],a):n.push(a)}else{if(typeof a=="object"&&a!==null&&"text"in a&&a.text==="")continue;n.push(a)}return n}}}function Br(e,t){if(!e&&!t)throw new Error("Cannot merge two undefined objects.");if(!e||!t)return e||t;if(typeof e!=typeof t)throw new Error(`Cannot merge objects of different types.
|
|
3
3
|
Left ${typeof e}
|
|
4
4
|
Right ${typeof t}`);if(typeof e=="string"&&typeof t=="string")return e+t;if(Array.isArray(e)&&Array.isArray(t))return Ot(e,t);if(typeof e=="object"&&typeof t=="object")return ee(e,t);if(e===t)return e;throw new Error(`Can not merge objects of different types.
|