@sap-ux/fiori-mcp-server 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -1484,7 +1484,7 @@ cfg: { // Application Insights Configuration\r
1484
1484
  ${Rui.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};SU.RestError=YI;YI.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";YI.PARSE_ERROR="PARSE_ERROR";function Lui(e){return e instanceof YI?!0:(0,Dui.isError)(e)&&e.name==="RestError"}});var zFe=y(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.tracingPolicyName=void 0;WI.tracingPolicy=qui;var kui=enr(),$ui=F_(),Mui=OFe(),Lne=pS(),AU=Lg(),Fui=Rne(),jui=gne();WI.tracingPolicyName="tracingPolicy";function qui(e={}){let t=(0,Mui.getUserAgentValue)(e.userAgentPrefix),r=new jui.Sanitizer({additionalAllowedQueryParameters:e.additionalAllowedQueryParameters}),n=Vui();return{name:WI.tracingPolicyName,async sendRequest(i,a){var o,s;if(!n||!(!((o=i.tracingOptions)===null||o===void 0)&&o.tracingContext))return a(i);let c=await t,u={"http.url":r.sanitizeUrl(i.url),"http.method":i.method,"http.user_agent":c,requestId:i.requestId};c&&(u["http.user_agent"]=c);let{span:l,tracingContext:p}=(s=Uui(n,i,u))!==null&&s!==void 0?s:{};if(!l||!p)return a(i);try{let f=await n.withContext(p,a,i);return zui(l,f),f}catch(f){throw Bui(l,f),f}}}}function Vui(){try{return(0,kui.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:$ui.SDK_VERSION})}catch(e){Lne.logger.warning(`Error when creating the TracingClient: ${(0,AU.getErrorMessage)(e)}`);return}}function Uui(e,t,r){try{let{span:n,updatedOptions:i}=e.startSpan(`HTTP ${t.method}`,{tracingOptions:t.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let a=e.createRequestHeaders(i.tracingOptions.tracingContext);for(let[o,s]of Object.entries(a))t.headers.set(o,s);return{span:n,tracingContext:i.tracingOptions.tracingContext}}catch(n){Lne.logger.warning(`Skipping creating a tracing span due to an error: ${(0,AU.getErrorMessage)(n)}`);return}}function Bui(e,t){try{e.setStatus({status:"error",error:(0,AU.isError)(t)?t:void 0}),(0,Fui.isRestError)(t)&&t.statusCode&&e.setAttribute("http.status_code",t.statusCode),e.end()}catch(r){Lne.logger.warning(`Skipping tracing span processing due to an error: ${(0,AU.getErrorMessage)(r)}`)}}function zui(e,t){try{e.setAttribute("http.status_code",t.status);let r=t.headers.get("x-ms-request-id");r&&e.setAttribute("serviceRequestId",r),e.setStatus({status:"success"}),e.end()}catch(r){Lne.logger.warning(`Skipping tracing span processing due to an error: ${(0,AU.getErrorMessage)(r)}`)}}});var inr=y(HFe=>{"use strict";Object.defineProperty(HFe,"__esModule",{value:!0});HFe.createPipelineFromOptions=rli;var Hui=EFe(),Gui=HMe(),Kui=_Fe(),Yui=SFe(),rnr=PFe(),Wui=DFe(),Xui=RFe(),Jui=$Fe(),nnr=Lg(),Zui=MFe(),Qui=FFe(),eli=jFe(),tli=zFe();function rli(e){var t;let r=(0,Gui.createEmptyPipeline)();return nnr.isNodeLike&&(e.tlsOptions&&r.addPolicy((0,eli.tlsPolicy)(e.tlsOptions)),r.addPolicy((0,Zui.proxyPolicy)(e.proxyOptions)),r.addPolicy((0,Wui.decompressResponsePolicy)())),r.addPolicy((0,Jui.formDataPolicy)(),{beforePolicies:[rnr.multipartPolicyName]}),r.addPolicy((0,Yui.userAgentPolicy)(e.userAgentOptions)),r.addPolicy((0,Qui.setClientRequestIdPolicy)((t=e.telemetryOptions)===null||t===void 0?void 0:t.clientRequestIdHeaderName)),r.addPolicy((0,rnr.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,Xui.defaultRetryPolicy)(e.retryOptions),{phase:"Retry"}),r.addPolicy((0,tli.tracingPolicy)(Object.assign(Object.assign({},e.userAgentOptions),e.loggingOptions)),{afterPhase:"Retry"}),nnr.isNodeLike&&r.addPolicy((0,Kui.redirectPolicy)(e.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,Hui.logPolicy)(e.loggingOptions),{afterPhase:"Sign"}),r}});var lnr=y($ne=>{"use strict";Object.defineProperty($ne,"__esModule",{value:!0});$ne.getBodyLength=unr;$ne.createNodeHttpClient=uli;var WFe=(uS(),ln(cS)),GFe=WFe.__importStar(require("node:http")),KFe=WFe.__importStar(require("node:https")),anr=WFe.__importStar(require("node:zlib")),nli=require("node:stream"),onr=EU(),ili=OU(),PU=Rne(),CU=pS(),ali={};function wU(e){return e&&typeof e.pipe=="function"}function snr(e){return new Promise(t=>{e.on("close",t),e.on("end",t),e.on("error",t)})}function cnr(e){return e&&typeof e.byteLength=="number"}var kne=class extends nli.Transform{_transform(t,r,n){this.push(t),this.loadedBytes+=t.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(i){n(i)}}constructor(t){super(),this.loadedBytes=0,this.progressCallback=t}},YFe=class{constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(t){var r,n,i;let a=new AbortController,o;if(t.abortSignal){if(t.abortSignal.aborted)throw new onr.AbortError("The operation was aborted.");o=p=>{p.type==="abort"&&a.abort()},t.abortSignal.addEventListener("abort",o)}t.timeout>0&&setTimeout(()=>{a.abort()},t.timeout);let s=t.headers.get("Accept-Encoding"),c=s?.includes("gzip")||s?.includes("deflate"),u=typeof t.body=="function"?t.body():t.body;if(u&&!t.headers.has("Content-Length")){let p=unr(u);p!==null&&t.headers.set("Content-Length",p)}let l;try{if(u&&t.onUploadProgress){let v=t.onUploadProgress,_=new kne(v);_.on("error",O=>{CU.logger.error("Error in upload progress",O)}),wU(u)?u.pipe(_):_.end(u),u=_}let p=await this.makeRequest(t,a,u),f=oli(p),h={status:(r=p.statusCode)!==null&&r!==void 0?r:0,headers:f,request:t};if(t.method==="HEAD")return p.resume(),h;l=c?sli(p,f):p;let m=t.onDownloadProgress;if(m){let v=new kne(m);v.on("error",_=>{CU.logger.error("Error in download progress",_)}),l.pipe(v),l=v}return!((n=t.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((i=t.streamResponseStatusCodes)===null||i===void 0)&&i.has(h.status)?h.readableStreamBody=l:h.bodyAsText=await cli(l),h}finally{if(t.abortSignal&&o){let p=Promise.resolve();wU(u)&&(p=snr(u));let f=Promise.resolve();wU(l)&&(f=snr(l)),Promise.all([p,f]).then(()=>{var d;o&&((d=t.abortSignal)===null||d===void 0||d.removeEventListener("abort",o))}).catch(d=>{CU.logger.warning("Error when cleaning up abortListener on httpRequest",d)})}}}makeRequest(t,r,n){var i;let a=new URL(t.url),o=a.protocol!=="https:";if(o&&!t.allowInsecureConnection)throw new Error(`Cannot connect to ${t.url} while allowInsecureConnection is false.`);let c={agent:(i=t.agent)!==null&&i!==void 0?i:this.getOrCreateAgent(t,o),hostname:a.hostname,path:`${a.pathname}${a.search}`,port:a.port,method:t.method,headers:t.headers.toJSON({preserveCase:!0})};return new Promise((u,l)=>{let p=o?GFe.request(c,u):KFe.request(c,u);p.once("error",f=>{var d;l(new PU.RestError(f.message,{code:(d=f.code)!==null&&d!==void 0?d:PU.RestError.REQUEST_SEND_ERROR,request:t}))}),r.signal.addEventListener("abort",()=>{let f=new onr.AbortError("The operation was aborted.");p.destroy(f),l(f)}),n&&wU(n)?n.pipe(p):n?typeof n=="string"||Buffer.isBuffer(n)?p.end(n):cnr(n)?p.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(CU.logger.error("Unrecognized body type",n),l(new PU.RestError("Unrecognized body type"))):p.end()})}getOrCreateAgent(t,r){var n;let i=t.disableKeepAlive;if(r)return i?GFe.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new GFe.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(i&&!t.tlsSettings)return KFe.globalAgent;let a=(n=t.tlsSettings)!==null&&n!==void 0?n:ali,o=this.cachedHttpsAgents.get(a);return o&&o.options.keepAlive===!i||(CU.logger.info("No cached TLS Agent exist, creating a new Agent"),o=new KFe.Agent(Object.assign({keepAlive:!i},a)),this.cachedHttpsAgents.set(a,o)),o}}};function oli(e){let t=(0,ili.createHttpHeaders)();for(let r of Object.keys(e.headers)){let n=e.headers[r];Array.isArray(n)?n.length>0&&t.set(r,n[0]):n&&t.set(r,n)}return t}function sli(e,t){let r=t.get("Content-Encoding");if(r==="gzip"){let n=anr.createGunzip();return e.pipe(n),n}else if(r==="deflate"){let n=anr.createInflate();return e.pipe(n),n}return e}function cli(e){return new Promise((t,r)=>{let n=[];e.on("data",i=>{Buffer.isBuffer(i)?n.push(i):n.push(Buffer.from(i))}),e.on("end",()=>{t(Buffer.concat(n).toString("utf8"))}),e.on("error",i=>{i&&i?.name==="AbortError"?r(i):r(new PU.RestError(`Error reading response as text: ${i.message}`,{code:PU.RestError.PARSE_ERROR}))})})}function unr(e){return e?Buffer.isBuffer(e)?e.length:wU(e)?null:cnr(e)?e.byteLength:typeof e=="string"?Buffer.from(e).length:null:0}function uli(){return new YFe}});var pnr=y(XFe=>{"use strict";Object.defineProperty(XFe,"__esModule",{value:!0});XFe.createDefaultHttpClient=pli;var lli=lnr();function pli(){return(0,lli.createNodeHttpClient)()}});var fnr=y(ZFe=>{"use strict";Object.defineProperty(ZFe,"__esModule",{value:!0});ZFe.createPipelineRequest=hli;var fli=OU(),dli=Lg(),JFe=class{constructor(t){var r,n,i,a,o,s,c;this.url=t.url,this.body=t.body,this.headers=(r=t.headers)!==null&&r!==void 0?r:(0,fli.createHttpHeaders)(),this.method=(n=t.method)!==null&&n!==void 0?n:"GET",this.timeout=(i=t.timeout)!==null&&i!==void 0?i:0,this.multipartBody=t.multipartBody,this.formData=t.formData,this.disableKeepAlive=(a=t.disableKeepAlive)!==null&&a!==void 0?a:!1,this.proxySettings=t.proxySettings,this.streamResponseStatusCodes=t.streamResponseStatusCodes,this.withCredentials=(o=t.withCredentials)!==null&&o!==void 0?o:!1,this.abortSignal=t.abortSignal,this.tracingOptions=t.tracingOptions,this.onUploadProgress=t.onUploadProgress,this.onDownloadProgress=t.onDownloadProgress,this.requestId=t.requestId||(0,dli.randomUUID)(),this.allowInsecureConnection=(s=t.allowInsecureConnection)!==null&&s!==void 0?s:!1,this.enableBrowserStreams=(c=t.enableBrowserStreams)!==null&&c!==void 0?c:!1}};function hli(e){return new JFe(e)}});var dnr=y(DU=>{"use strict";Object.defineProperty(DU,"__esModule",{value:!0});DU.exponentialRetryPolicyName=void 0;DU.exponentialRetryPolicy=vli;var mli=Sne(),gli=VI(),yli=F_();DU.exponentialRetryPolicyName="exponentialRetryPolicy";function vli(e={}){var t;return(0,gli.retryPolicy)([(0,mli.exponentialRetryStrategy)(Object.assign(Object.assign({},e),{ignoreSystemErrors:!0}))],{maxRetries:(t=e.maxRetries)!==null&&t!==void 0?t:yli.DEFAULT_RETRY_POLICY_COUNT})}});var hnr=y(XI=>{"use strict";Object.defineProperty(XI,"__esModule",{value:!0});XI.systemErrorRetryPolicyName=void 0;XI.systemErrorRetryPolicy=xli;var bli=Sne(),Eli=VI(),_li=F_();XI.systemErrorRetryPolicyName="systemErrorRetryPolicy";function xli(e={}){var t;return{name:XI.systemErrorRetryPolicyName,sendRequest:(0,Eli.retryPolicy)([(0,bli.exponentialRetryStrategy)(Object.assign(Object.assign({},e),{ignoreHttpStatusCodes:!0}))],{maxRetries:(t=e.maxRetries)!==null&&t!==void 0?t:_li.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}});var mnr=y(JI=>{"use strict";Object.defineProperty(JI,"__esModule",{value:!0});JI.throttlingRetryPolicyName=void 0;JI.throttlingRetryPolicy=Ali;var Tli=One(),Oli=VI(),Sli=F_();JI.throttlingRetryPolicyName="throttlingRetryPolicy";function Ali(e={}){var t;return{name:JI.throttlingRetryPolicyName,sendRequest:(0,Oli.retryPolicy)([(0,Tli.throttlingRetryStrategy)()],{maxRetries:(t=e.maxRetries)!==null&&t!==void 0?t:Sli.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}});var QFe=y(ZI=>{"use strict";Object.defineProperty(ZI,"__esModule",{value:!0});ZI.DEFAULT_CYCLER_OPTIONS=void 0;ZI.createTokenCycler=Pli;var Cli=xne();ZI.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function wli(e,t,r){async function n(){if(Date.now()<r)try{return await e()}catch{return null}else{let a=await e();if(a===null)throw new Error("Failed to refresh access token.");return a}}let i=await n();for(;i===null;)await(0,Cli.delay)(t),i=await n();return i}function Pli(e,t){let r=null,n=null,i,a=Object.assign(Object.assign({},ZI.DEFAULT_CYCLER_OPTIONS),t),o={get isRefreshing(){return r!==null},get shouldRefresh(){var c;return!o.isRefreshing&&((c=n?.expiresOnTimestamp)!==null&&c!==void 0?c:0)-a.refreshWindowInMs<Date.now()},get mustRefresh(){return n===null||n.expiresOnTimestamp-a.forcedRefreshWindowInMs<Date.now()}};function s(c,u){var l;return o.isRefreshing||(r=wli(()=>e.getToken(c,u),a.retryIntervalInMs,(l=n?.expiresOnTimestamp)!==null&&l!==void 0?l:Date.now()).then(f=>(r=null,n=f,i=u.tenantId,n)).catch(f=>{throw r=null,n=null,i=void 0,f})),r}return async(c,u)=>{let l=!!u.claims,p=i!==u.tenantId;return l&&(n=null),p||l||o.mustRefresh?s(c,u):(o.shouldRefresh&&s(c,u),n)}}});var gnr=y(QI=>{"use strict";Object.defineProperty(QI,"__esModule",{value:!0});QI.bearerTokenAuthenticationPolicyName=void 0;QI.bearerTokenAuthenticationPolicy=Lli;var Dli=QFe(),Nli=pS();QI.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function Ili(e){let{scopes:t,getAccessToken:r,request:n}=e,i={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},a=await r(t,i);a&&e.request.headers.set("Authorization",`Bearer ${a.token}`)}function Rli(e){let t=e.headers.get("WWW-Authenticate");if(e.status===401&&t)return t}function Lli(e){var t;let{credential:r,scopes:n,challengeCallbacks:i}=e,a=e.logger||Nli.logger,o=Object.assign({authorizeRequest:(t=i?.authorizeRequest)!==null&&t!==void 0?t:Ili,authorizeRequestOnChallenge:i?.authorizeRequestOnChallenge},i),s=r?(0,Dli.createTokenCycler)(r):()=>Promise.resolve(null);return{name:QI.bearerTokenAuthenticationPolicyName,async sendRequest(c,u){if(!c.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await o.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:c,getAccessToken:s,logger:a});let l,p;try{l=await u(c)}catch(f){p=f,l=f.response}if(o.authorizeRequestOnChallenge&&l?.status===401&&Rli(l)&&await o.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:c,response:l,getAccessToken:s,logger:a}))return u(c);if(p)throw p;return l}}}});var ynr=y(eR=>{"use strict";Object.defineProperty(eR,"__esModule",{value:!0});eR.ndJsonPolicyName=void 0;eR.ndJsonPolicy=kli;eR.ndJsonPolicyName="ndJsonPolicy";function kli(){return{name:eR.ndJsonPolicyName,async sendRequest(e,t){if(typeof e.body=="string"&&e.body.startsWith("[")){let r=JSON.parse(e.body);Array.isArray(r)&&(e.body=r.map(n=>JSON.stringify(n)+`
1485
1485
  `).join(""))}return t(e)}}}});var bnr=y(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});hS.auxiliaryAuthenticationHeaderPolicyName=void 0;hS.auxiliaryAuthenticationHeaderPolicy=jli;var $li=QFe(),Mli=pS();hS.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var vnr="x-ms-authorization-auxiliary";async function Fli(e){var t,r;let{scopes:n,getAccessToken:i,request:a}=e,o={abortSignal:a.abortSignal,tracingOptions:a.tracingOptions};return(r=(t=await i(n,o))===null||t===void 0?void 0:t.token)!==null&&r!==void 0?r:""}function jli(e){let{credentials:t,scopes:r}=e,n=e.logger||Mli.logger,i=new WeakMap;return{name:hS.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(a,o){if(!a.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!t||t.length===0)return n.info(`${hS.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),o(a);let s=[];for(let u of t){let l=i.get(u);l||(l=(0,$li.createTokenCycler)(u),i.set(u,l)),s.push(Fli({scopes:Array.isArray(r)?r:[r],request:a,getAccessToken:l,logger:n}))}let c=(await Promise.all(s)).filter(u=>!!u);return c.length===0?(n.warning(`None of the auxiliary tokens are valid. ${vnr} header will not be set.`),o(a)):(a.headers.set(vnr,c.map(u=>`Bearer ${u}`).join(", ")),o(a))}}}});var Mnr=y(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.createFileFromStream=Me.createFile=Me.auxiliaryAuthenticationHeaderPolicyName=Me.auxiliaryAuthenticationHeaderPolicy=Me.ndJsonPolicyName=Me.ndJsonPolicy=Me.bearerTokenAuthenticationPolicyName=Me.bearerTokenAuthenticationPolicy=Me.formDataPolicyName=Me.formDataPolicy=Me.tlsPolicyName=Me.tlsPolicy=Me.userAgentPolicyName=Me.userAgentPolicy=Me.defaultRetryPolicy=Me.tracingPolicyName=Me.tracingPolicy=Me.retryPolicy=Me.throttlingRetryPolicyName=Me.throttlingRetryPolicy=Me.systemErrorRetryPolicyName=Me.systemErrorRetryPolicy=Me.redirectPolicyName=Me.redirectPolicy=Me.getDefaultProxySettings=Me.proxyPolicyName=Me.proxyPolicy=Me.multipartPolicyName=Me.multipartPolicy=Me.logPolicyName=Me.logPolicy=Me.setClientRequestIdPolicyName=Me.setClientRequestIdPolicy=Me.exponentialRetryPolicyName=Me.exponentialRetryPolicy=Me.decompressResponsePolicyName=Me.decompressResponsePolicy=Me.isRestError=Me.RestError=Me.createPipelineRequest=Me.createHttpHeaders=Me.createDefaultHttpClient=Me.createPipelineFromOptions=Me.createEmptyPipeline=void 0;var qli=HMe();Object.defineProperty(Me,"createEmptyPipeline",{enumerable:!0,get:function(){return qli.createEmptyPipeline}});var Vli=inr();Object.defineProperty(Me,"createPipelineFromOptions",{enumerable:!0,get:function(){return Vli.createPipelineFromOptions}});var Uli=pnr();Object.defineProperty(Me,"createDefaultHttpClient",{enumerable:!0,get:function(){return Uli.createDefaultHttpClient}});var Bli=OU();Object.defineProperty(Me,"createHttpHeaders",{enumerable:!0,get:function(){return Bli.createHttpHeaders}});var zli=fnr();Object.defineProperty(Me,"createPipelineRequest",{enumerable:!0,get:function(){return zli.createPipelineRequest}});var Enr=Rne();Object.defineProperty(Me,"RestError",{enumerable:!0,get:function(){return Enr.RestError}});Object.defineProperty(Me,"isRestError",{enumerable:!0,get:function(){return Enr.isRestError}});var _nr=DFe();Object.defineProperty(Me,"decompressResponsePolicy",{enumerable:!0,get:function(){return _nr.decompressResponsePolicy}});Object.defineProperty(Me,"decompressResponsePolicyName",{enumerable:!0,get:function(){return _nr.decompressResponsePolicyName}});var xnr=dnr();Object.defineProperty(Me,"exponentialRetryPolicy",{enumerable:!0,get:function(){return xnr.exponentialRetryPolicy}});Object.defineProperty(Me,"exponentialRetryPolicyName",{enumerable:!0,get:function(){return xnr.exponentialRetryPolicyName}});var Tnr=FFe();Object.defineProperty(Me,"setClientRequestIdPolicy",{enumerable:!0,get:function(){return Tnr.setClientRequestIdPolicy}});Object.defineProperty(Me,"setClientRequestIdPolicyName",{enumerable:!0,get:function(){return Tnr.setClientRequestIdPolicyName}});var Onr=EFe();Object.defineProperty(Me,"logPolicy",{enumerable:!0,get:function(){return Onr.logPolicy}});Object.defineProperty(Me,"logPolicyName",{enumerable:!0,get:function(){return Onr.logPolicyName}});var Snr=PFe();Object.defineProperty(Me,"multipartPolicy",{enumerable:!0,get:function(){return Snr.multipartPolicy}});Object.defineProperty(Me,"multipartPolicyName",{enumerable:!0,get:function(){return Snr.multipartPolicyName}});var eje=MFe();Object.defineProperty(Me,"proxyPolicy",{enumerable:!0,get:function(){return eje.proxyPolicy}});Object.defineProperty(Me,"proxyPolicyName",{enumerable:!0,get:function(){return eje.proxyPolicyName}});Object.defineProperty(Me,"getDefaultProxySettings",{enumerable:!0,get:function(){return eje.getDefaultProxySettings}});var Anr=_Fe();Object.defineProperty(Me,"redirectPolicy",{enumerable:!0,get:function(){return Anr.redirectPolicy}});Object.defineProperty(Me,"redirectPolicyName",{enumerable:!0,get:function(){return Anr.redirectPolicyName}});var Cnr=hnr();Object.defineProperty(Me,"systemErrorRetryPolicy",{enumerable:!0,get:function(){return Cnr.systemErrorRetryPolicy}});Object.defineProperty(Me,"systemErrorRetryPolicyName",{enumerable:!0,get:function(){return Cnr.systemErrorRetryPolicyName}});var wnr=mnr();Object.defineProperty(Me,"throttlingRetryPolicy",{enumerable:!0,get:function(){return wnr.throttlingRetryPolicy}});Object.defineProperty(Me,"throttlingRetryPolicyName",{enumerable:!0,get:function(){return wnr.throttlingRetryPolicyName}});var Hli=VI();Object.defineProperty(Me,"retryPolicy",{enumerable:!0,get:function(){return Hli.retryPolicy}});var Pnr=zFe();Object.defineProperty(Me,"tracingPolicy",{enumerable:!0,get:function(){return Pnr.tracingPolicy}});Object.defineProperty(Me,"tracingPolicyName",{enumerable:!0,get:function(){return Pnr.tracingPolicyName}});var Gli=RFe();Object.defineProperty(Me,"defaultRetryPolicy",{enumerable:!0,get:function(){return Gli.defaultRetryPolicy}});var Dnr=SFe();Object.defineProperty(Me,"userAgentPolicy",{enumerable:!0,get:function(){return Dnr.userAgentPolicy}});Object.defineProperty(Me,"userAgentPolicyName",{enumerable:!0,get:function(){return Dnr.userAgentPolicyName}});var Nnr=jFe();Object.defineProperty(Me,"tlsPolicy",{enumerable:!0,get:function(){return Nnr.tlsPolicy}});Object.defineProperty(Me,"tlsPolicyName",{enumerable:!0,get:function(){return Nnr.tlsPolicyName}});var Inr=$Fe();Object.defineProperty(Me,"formDataPolicy",{enumerable:!0,get:function(){return Inr.formDataPolicy}});Object.defineProperty(Me,"formDataPolicyName",{enumerable:!0,get:function(){return Inr.formDataPolicyName}});var Rnr=gnr();Object.defineProperty(Me,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:function(){return Rnr.bearerTokenAuthenticationPolicy}});Object.defineProperty(Me,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:function(){return Rnr.bearerTokenAuthenticationPolicyName}});var Lnr=ynr();Object.defineProperty(Me,"ndJsonPolicy",{enumerable:!0,get:function(){return Lnr.ndJsonPolicy}});Object.defineProperty(Me,"ndJsonPolicyName",{enumerable:!0,get:function(){return Lnr.ndJsonPolicyName}});var knr=bnr();Object.defineProperty(Me,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:function(){return knr.auxiliaryAuthenticationHeaderPolicy}});Object.defineProperty(Me,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:function(){return knr.auxiliaryAuthenticationHeaderPolicyName}});var $nr=AFe();Object.defineProperty(Me,"createFile",{enumerable:!0,get:function(){return $nr.createFile}});Object.defineProperty(Me,"createFileFromStream",{enumerable:!0,get:function(){return $nr.createFileFromStream}})});var jnr=y((IU,Fnr)=>{"use strict";var Kli=IU&&IU.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Yli=IU&&IU.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Wli=hi(),Xli="https://monitor.azure.com//.default",NU;try{NU=Mnr()}catch{Wli.warn("Cannot load @azure/core-auth package. This package is required for AAD token authentication. It's likely that your node.js version is not supported by the JS Azure SDK.")}function Jli(e){return null}var Zli=function(){function e(t,r){if(NU){var n=r?[r]:[Xli];this._azureTokenPolicy=NU.bearerTokenAuthenticationPolicy({credential:t,scopes:n})}}return e.prototype.addAuthorizationHeader=function(t){return Kli(this,void 0,void 0,function(){var r,n;return Yli(this,function(i){switch(i.label){case 0:return NU?(r="authorization",n=NU.createPipelineRequest({url:"https://"}),[4,this._azureTokenPolicy.sendRequest(n,Jli)]):[3,2];case 1:i.sent(),t.headers[r]=n.headers.get(r),i.label=2;case 2:return[2]}})})},e}();Fnr.exports=Zli});var Vnr=y((Gla,qnr)=>{"use strict";var Qli=hi(),epi=Hs(),tpi=function(){function e(t,r,n,i){this._buffer=[],this._lastSend=0,this._isDisabled=t,this._getBatchSize=r,this._getBatchIntervalMs=n,this._sender=i}return e.prototype.setUseDiskRetryCaching=function(t,r,n){this._sender.setDiskRetryMode(t,r,n)},e.prototype.send=function(t){var r=this;if(!this._isDisabled()){if(!t){Qli.warn("Cannot send null/undefined telemetry");return}if(this._buffer.push(t),this._buffer.length>=this._getBatchSize()){this.triggerSend(!1);return}!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null,r.triggerSend(!1)},this._getBatchIntervalMs()))}},e.prototype.triggerSend=function(t,r){var n=this._buffer.length<1;n||(t||epi.isNodeExit?(this._sender.saveOnCrash(this._buffer),typeof r=="function"&&r("data saved on crash")):this._sender.send(this._buffer,r)),this._lastSend=+new Date,this._buffer=[],clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&typeof r=="function"&&r("no data to send")},e}();qnr.exports=tpi});var Unr=y(tje=>{"use strict";Object.defineProperty(tje,"__esModule",{value:!0});tje.azureRoleEnvironmentTelemetryProcessor=rpi;function rpi(e,t){}});var Hnr=y(Mne=>{"use strict";Object.defineProperty(Mne,"__esModule",{value:!0});Mne.samplingTelemetryProcessor=npi;Mne.getSamplingHashCode=znr;var Bnr=Bc();function npi(e,t){var r=e.sampleRate,n=!1;return r==null||r>=100||e.data&&Bnr.TelemetryType.Metric===Bnr.baseTypeToTelemetryType(e.data.baseType)?!0:(t.correlationContext&&t.correlationContext.operation?n=znr(t.correlationContext.operation.id)<r:n=Math.random()*100<r,n)}function znr(e){var t=-2147483648,r=2147483647,n=5381;if(!e)return 0;for(;e.length<8;)e=e+e;for(var i=0;i<e.length;i++)n=((n<<5)+n|0)+e.charCodeAt(i)|0;return n=n<=t?r:Math.abs(n),n/r*100}});var Gnr=y(_b=>{"use strict";var ipi=_b&&_b.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),api=_b&&_b.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),opi=_b&&_b.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&ipi(t,e,r);return api(t,e),t};Object.defineProperty(_b,"__esModule",{value:!0});_b.performanceMetricsTelemetryProcessor=spi;var rje=Vre(),nje=opi(Bc());function spi(e,t){switch(t&&t.addDocument(e),e.data.baseType){case nje.TelemetryTypeString.Exception:rje.countException();break;case nje.TelemetryTypeString.Request:var r=e.data.baseData;rje.countRequest(r.duration,r.success);break;case nje.TelemetryTypeString.Dependency:var n=e.data.baseData;rje.countDependency(n.duration,n.success);break}return!0}});var Knr=y(Sh=>{"use strict";var kg=Sh&&Sh.__assign||function(){return kg=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},kg.apply(this,arguments)},cpi=Sh&&Sh.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),upi=Sh&&Sh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lpi=Sh&&Sh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&cpi(t,e,r);return upi(t,e),t};Object.defineProperty(Sh,"__esModule",{value:!0});Sh.preAggregatedMetricsTelemetryProcessor=fpi;var ppi=Bc(),RU=_Me(),Fne=lpi(Bc());function fpi(e,t){if(RU.isEnabled())switch(e.data.baseType){case Fne.TelemetryTypeString.Exception:var r=e.data.baseData;r.properties=kg(kg({},r.properties),{"_MS.ProcessedByMetricExtractors":"(Name:'Exceptions', Ver:'1.1')"});var n={cloudRoleInstance:e.tags[t.keys.cloudRoleInstance],cloudRoleName:e.tags[t.keys.cloudRole]};RU.countException(n);break;case Fne.TelemetryTypeString.Trace:var i=e.data.baseData;i.properties=kg(kg({},i.properties),{"_MS.ProcessedByMetricExtractors":"(Name:'Traces', Ver:'1.1')"});var a={cloudRoleInstance:e.tags[t.keys.cloudRoleInstance],cloudRoleName:e.tags[t.keys.cloudRole],traceSeverityLevel:ppi.SeverityLevel[i.severity]};RU.countTrace(a);break;case Fne.TelemetryTypeString.Request:var o=e.data.baseData;o.properties=kg(kg({},o.properties),{"_MS.ProcessedByMetricExtractors":"(Name:'Requests', Ver:'1.1')"});var s={cloudRoleInstance:e.tags[t.keys.cloudRoleInstance],cloudRoleName:e.tags[t.keys.cloudRole],operationSynthetic:e.tags[t.keys.operationSyntheticSource],requestSuccess:o.success,requestResultCode:o.responseCode};RU.countRequest(o.duration,s);break;case Fne.TelemetryTypeString.Dependency:var c=e.data.baseData;c.properties=kg(kg({},c.properties),{"_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')"});var u={cloudRoleInstance:e.tags[t.keys.cloudRoleInstance],cloudRoleName:e.tags[t.keys.cloudRole],operationSynthetic:e.tags[t.keys.operationSyntheticSource],dependencySuccess:c.success,dependencyType:c.type,dependencyTarget:c.target,dependencyResultCode:c.resultCode};RU.countDependency(c.duration,u);break}return!0}});var Ynr=y($g=>{"use strict";var dpi=$g&&$g.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),jne=$g&&$g.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&dpi(t,e,r)};Object.defineProperty($g,"__esModule",{value:!0});jne(Unr(),$g);jne(Hnr(),$g);jne(Gnr(),$g);jne(Knr(),$g)});var ije=y((Zla,Jnr)=>{"use strict";var Kt=Bc(),$l=Hs(),Wnr=P_(),hpi=hi(),mpi=function(){function e(){}return e.createEnvelope=function(t,r,n,i,a){var o=null;switch(r){case Kt.TelemetryType.Trace:o=e.createTraceData(t);break;case Kt.TelemetryType.Dependency:o=e.createDependencyData(t);break;case Kt.TelemetryType.Event:o=e.createEventData(t);break;case Kt.TelemetryType.Exception:o=e.createExceptionData(t);break;case Kt.TelemetryType.Request:o=e.createRequestData(t);break;case Kt.TelemetryType.Metric:o=e.createMetricData(t);break;case Kt.TelemetryType.Availability:o=e.createAvailabilityData(t);break;case Kt.TelemetryType.PageView:o=e.createPageViewData(t);break}if(o&&o.baseData&&Kt.domainSupportsProperties(o.baseData)){if(n)if(!o.baseData.properties)o.baseData.properties=n;else for(var s in n)o.baseData.properties[s]||(o.baseData.properties[s]=n[s]);e.addAzureFunctionsCorrelationProperties(o.baseData.properties),o.baseData.properties&&(o.baseData.properties=$l.validateStringMap(o.baseData.properties))}var c=a&&a.instrumentationKey||"",u=new Kt.Envelope;return u.data=o,u.iKey=c,u.name="Microsoft.ApplicationInsights."+c.replace(/-/g,"")+"."+o.baseType.substr(0,o.baseType.length-4),u.tags=this.getTags(i,t.tagOverrides),u.time=new Date().toISOString(),u.ver=1,u.sampleRate=a?a.samplingPercentage:100,r===Kt.TelemetryType.Metric&&(u.sampleRate=100),u},e.addAzureFunctionsCorrelationProperties=function(t){var r=Wnr.CorrelationContextManager.getCurrentContext();if(r&&r.customProperties&&r.customProperties.getProperty instanceof Function){t=t||{};var n=r.customProperties.getProperty("InvocationId");n&&(t.InvocationId=n),n=r.customProperties.getProperty("ProcessId"),n&&(t.ProcessId=n),n=r.customProperties.getProperty("LogLevel"),n&&(t.LogLevel=n),n=r.customProperties.getProperty("Category"),n&&(t.Category=n),n=r.customProperties.getProperty("HostInstanceId"),n&&(t.HostInstanceId=n),n=r.customProperties.getProperty("AzFuncLiveLogsSessionId"),n&&(t.AzFuncLiveLogsSessionId=n)}},e.truncateProperties=function(t){if(t.properties)try{for(var r={},n=Object.keys(t.properties),i=Object.values(t.properties),a=0;a<n.length;a++)n[a].length<=150&&($l.isDate(i[a])||(i[a]==null&&(i[a]=""),typeof i[a]=="object"&&(i[a]=$l.stringify(i[a])),r[n[a]]=String(i[a]).substring(0,8192)),r[n[a]]=i[a]);return r}catch(o){hpi.warn("Failed to properly truncate telemetry properties: ",o)}},e.createTraceData=function(t){var r,n=new Kt.MessageData;n.message=(r=t.message)===null||r===void 0?void 0:r.substring(0,32768),n.properties=this.truncateProperties(t),isNaN(t.severity)?n.severityLevel=Kt.SeverityLevel.Information:n.severityLevel=t.severity;var i=new Kt.Data;return i.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.Trace),i.baseData=n,i},e.createDependencyData=function(t){var r,n,i,a=new Kt.RemoteDependencyData;a.name=(r=t.name)===null||r===void 0?void 0:r.substring(0,1024),a.data=(n=t.data)===null||n===void 0?void 0:n.substring(0,8192),a.target=(i=t.target)===null||i===void 0?void 0:i.substring(0,1024),a.duration=$l.msToTimeSpan(t.duration),a.success=t.success,a.type=t.dependencyTypeName,a.properties=this.truncateProperties(t),a.resultCode=t.resultCode?t.resultCode.toString():"0",t.id?a.id=t.id:a.id=$l.w3cTraceId();var o=new Kt.Data;return o.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.Dependency),o.baseData=a,o},e.createEventData=function(t){var r,n=new Kt.EventData;n.name=(r=t.name)===null||r===void 0?void 0:r.substring(0,512),n.properties=this.truncateProperties(t),n.measurements=t.measurements;var i=new Kt.Data;return i.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.Event),i.baseData=n,i},e.createExceptionData=function(t){var r,n,i=new Kt.ExceptionData;i.properties=this.truncateProperties(t),isNaN(t.severity)?i.severityLevel=Kt.SeverityLevel.Error:i.severityLevel=t.severity,i.measurements=t.measurements,i.exceptions=[];var a=t.exception.stack,o=new Kt.ExceptionDetails;o.message=(r=t.exception.message)===null||r===void 0?void 0:r.substring(0,32768),o.typeName=(n=t.exception.name)===null||n===void 0?void 0:n.substring(0,1024),o.parsedStack=this.parseStack(a),o.hasFullStack=$l.isArray(o.parsedStack)&&o.parsedStack.length>0,i.exceptions.push(o);var s=new Kt.Data;return s.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.Exception),s.baseData=i,s},e.createRequestData=function(t){var r,n,i,a,o=new Kt.RequestData;t.id?o.id=t.id:o.id=$l.w3cTraceId(),o.name=(r=t.name)===null||r===void 0?void 0:r.substring(0,1024),o.url=(n=t.url)===null||n===void 0?void 0:n.substring(0,2048),o.source=(i=t.source)===null||i===void 0?void 0:i.substring(0,1024),o.duration=$l.msToTimeSpan(t.duration),o.responseCode=(a=t.resultCode?t.resultCode.toString():"0")===null||a===void 0?void 0:a.substring(0,1024),o.success=t.success,o.properties=this.truncateProperties(t),o.measurements=t.measurements;var s=new Kt.Data;return s.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.Request),s.baseData=o,s},e.createMetricData=function(t){var r,n=new Kt.MetricData;n.metrics=[];var i=new Kt.DataPoint;i.count=isNaN(t.count)?1:t.count,i.kind=Kt.DataPointType.Aggregation,i.max=isNaN(t.max)?t.value:t.max,i.min=isNaN(t.min)?t.value:t.min,i.name=(r=t.name)===null||r===void 0?void 0:r.substring(0,1024),i.stdDev=isNaN(t.stdDev)?0:t.stdDev,i.value=t.value,i.ns=t.namespace,n.metrics.push(i),n.properties=this.truncateProperties(t);var a=new Kt.Data;return a.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.Metric),a.baseData=n,a},e.createAvailabilityData=function(t){var r,n,i=new Kt.AvailabilityData;t.id?i.id=t.id:i.id=$l.w3cTraceId(),i.name=(r=t.name)===null||r===void 0?void 0:r.substring(0,1024),i.duration=$l.msToTimeSpan(t.duration),i.success=t.success,i.runLocation=t.runLocation,i.message=(n=t.message)===null||n===void 0?void 0:n.substring(0,8192),i.measurements=t.measurements,i.properties=this.truncateProperties(t);var a=new Kt.Data;return a.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.Availability),a.baseData=i,a},e.createPageViewData=function(t){var r,n,i=new Kt.PageViewData;i.name=(r=t.name)===null||r===void 0?void 0:r.substring(0,1024),i.duration=$l.msToTimeSpan(t.duration),i.url=(n=t.url)===null||n===void 0?void 0:n.substring(0,2048),i.measurements=t.measurements,i.properties=this.truncateProperties(t);var a=new Kt.Data;return a.baseType=Kt.telemetryTypeToBaseType(Kt.TelemetryType.PageView),a.baseData=i,a},e.getTags=function(t,r){var n=Wnr.CorrelationContextManager.getCurrentContext(),i={};if(t&&t.tags)for(var a in t.tags)i[a]=t.tags[a];if(r)for(var a in r)i[a]=r[a];return n&&(i[t.keys.operationId]=i[t.keys.operationId]||n.operation.id,i[t.keys.operationName]=i[t.keys.operationName]||n.operation.name,i[t.keys.operationParentId]=i[t.keys.operationParentId]||n.operation.parentId),i},e.parseStack=function(t){var r=void 0;if(typeof t=="string"){var n=t.split(`
1486
1486
  `);r=[];for(var i=0,a=0,o=0;o<=n.length;o++){var s=n[o];if(Xnr.regex.test(s)){var c=new Xnr(n[o],i++);a+=c.sizeInBytes,r.push(c)}}var u=32*1024;if(a>u)for(var l=0,p=r.length-1,f=0,d=l,h=p;l<p;){var m=r[l].sizeInBytes,v=r[p].sizeInBytes;if(f+=m+v,f>u){var _=h-d+1;r.splice(d,_);break}d=l,h=p,l++,p--}}return r},e}(),Xnr=function(){function e(t,r){this.sizeInBytes=0,this.level=r,this.method="<no_method>",this.assembly=$l.trim(t);var n=t.match(e.regex);n&&n.length>=5&&(this.method=$l.trim(n[2])||this.method,this.fileName=$l.trim(n[4])||"<no_filename>",this.line=parseInt(n[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=e.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return e.regex=/^(\s+at)?(.*?)(\@|\s\(|\s)([^\(\n]+):(\d+):(\d+)(\)?)$/,e.baseSize=58,e}();Jnr.exports=mpi});var Znr=y(j_=>{"use strict";var gpi=j_&&j_.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},ypi=j_&&j_.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(j_,"__esModule",{value:!0});j_.FileAccessControl=void 0;var vpi=require("fs"),bpi=require("os"),tR=require("child_process"),Epi=hi(),_pi=function(){function e(){}return e.checkFileProtection=function(){if(!e.OS_PROVIDES_FILE_PROTECTION&&!e.OS_FILE_PROTECTION_CHECKED)if(e.OS_FILE_PROTECTION_CHECKED=!0,e.USE_ICACLS){try{e.OS_PROVIDES_FILE_PROTECTION=vpi.existsSync(e.ICACLS_PATH)}catch{}e.OS_PROVIDES_FILE_PROTECTION||Epi.warn(e.TAG,"Could not find ICACLS in expected location! This is necessary to use disk retry mode on Windows.")}else e.OS_PROVIDES_FILE_PROTECTION=!0},e.applyACLRules=function(t){return gpi(this,void 0,void 0,function(){var r,n;return ypi(this,function(i){switch(i.label){case 0:if(!e.USE_ICACLS)return[3,7];if(e.ACLED_DIRECTORIES[t]!==void 0)return[3,6];e.ACLED_DIRECTORIES[t]=!1,i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this._getACLIdentity()];case 2:return r=i.sent(),[4,this._runICACLS(this._getACLArguments(t,r))];case 3:return i.sent(),e.ACLED_DIRECTORIES[t]=!0,[3,5];case 4:throw n=i.sent(),e.ACLED_DIRECTORIES[t]=!1,n;case 5:return[3,7];case 6:if(!e.ACLED_DIRECTORIES[t])throw new Error("Setting ACL restrictions did not succeed (cached result)");i.label=7;case 7:return[2]}})})},e.applyACLRulesSync=function(t){if(e.USE_ICACLS){if(e.ACLED_DIRECTORIES[t]===void 0){this._runICACLSSync(this._getACLArguments(t,this._getACLIdentitySync())),e.ACLED_DIRECTORIES[t]=!0;return}else if(!e.ACLED_DIRECTORIES[t])throw new Error("Setting ACL restrictions did not succeed (cached result)")}},e._runICACLS=function(t){return new Promise(function(r,n){var i=tR.spawn(e.ICACLS_PATH,t,{windowsHide:!0});i.on("error",function(a){return n(a)}),i.on("close",function(a,o){a===0?r():n(new Error("Setting ACL restrictions did not succeed (ICACLS returned code ".concat(a,")")))})})},e._runICACLSSync=function(t){if(tR.spawnSync){var r=tR.spawnSync(e.ICACLS_PATH,t,{windowsHide:!0});if(r.error)throw r.error;if(r.status!==0)throw new Error("Setting ACL restrictions did not succeed (ICACLS returned code ".concat(r.status,")"))}else throw new Error("Could not synchronously call ICACLS under current version of Node.js")},e._getACLIdentity=function(){return new Promise(function(t,r){e.ACL_IDENTITY&&t(e.ACL_IDENTITY);var n=tR.spawn(e.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:!0,stdio:["ignore","pipe","pipe"]}),i="";n.stdout.on("data",function(a){return i+=a}),n.on("error",function(a){return r(a)}),n.on("close",function(a,o){e.ACL_IDENTITY=i&&i.trim(),a===0?t(e.ACL_IDENTITY):r(new Error("Getting ACL identity did not succeed (PS returned code ".concat(a,")")))})})},e._getACLIdentitySync=function(){if(e.ACL_IDENTITY)return e.ACL_IDENTITY;if(tR.spawnSync){var t=tR.spawnSync(e.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:!0,stdio:["ignore","pipe","pipe"]});if(t.error)throw t.error;if(t.status!==0)throw new Error("Getting ACL identity did not succeed (PS returned code ".concat(t.status,")"));return e.ACL_IDENTITY=t.stdout&&t.stdout.toString().trim(),e.ACL_IDENTITY}else throw new Error("Could not synchronously get ACL identity under current version of Node.js")},e._getACLArguments=function(t,r){return[t,"/grant","*S-1-5-32-544:(OI)(CI)F","/grant","".concat(r,":(OI)(CI)F"),"/inheritance:r"]},e.TAG="FileAccessControl",e.ICACLS_PATH="".concat(process.env.systemdrive,"/windows/system32/icacls.exe"),e.POWERSHELL_PATH="".concat(process.env.systemdrive,"/windows/system32/windowspowershell/v1.0/powershell.exe"),e.ACLED_DIRECTORIES={},e.ACL_IDENTITY=null,e.OS_FILE_PROTECTION_CHECKED=!1,e.OS_PROVIDES_FILE_PROTECTION=!1,e.USE_ICACLS=bpi.type()==="Windows_NT",e}();j_.FileAccessControl=_pi});var sje=y((kU,Qnr)=>{"use strict";var qne=kU&&kU.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},Vne=kU&&kU.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},aje=require("fs"),xpi=require("os"),mS=require("path"),Tpi=require("zlib"),q_=Gi(),Opi=NI(),xb=zLe(),Ml=Hs(),Spi=require("url"),oje=hi(),LU=Znr(),Api=439,Cpi=402,wpi=[200,206,402,408,429,439,500],Ppi="Invalid instrumentation key",Dpi=function(){function e(t,r,n,i,a,o,s){this._redirectedHost=null,this._config=t,this._onSuccess=n,this._onError=i,this._statsbeat=a,this._enableDiskRetryMode=!1,this._resendInterval=e.WAIT_BETWEEN_RESEND,this._maxBytesOnDisk=e.MAX_BYTES_ON_DISK,this._numConsecutiveFailures=0,this._numConsecutiveRedirects=0,this._resendTimer=null,this._getAuthorizationHandler=r,this._fileCleanupTimer=null,this._tempDir=mS.join(xpi.tmpdir(),e.TEMPDIR_PREFIX+this._config.instrumentationKey),this._isStatsbeatSender=o||!1,this._shutdownStatsbeat=s,this._failedToIngestCounter=0,this._statsbeatHasReachedIngestionAtLeastOnce=!1}return e.prototype.setDiskRetryMode=function(t,r,n){var i=this;t&&LU.FileAccessControl.checkFileProtection(),this._enableDiskRetryMode=LU.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&t,typeof r=="number"&&r>=0&&(this._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),t&&!LU.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,this._logWarn("Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")),this._enableDiskRetryMode?(this._statsbeat&&this._statsbeat.addFeature(q_.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){i._fileCleanupTask()},e.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(q_.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},e.prototype.send=function(t,r){return qne(this,void 0,void 0,function(){var n,i,a,o,s,c,u,l,p=this;return Vne(this,function(f){switch(f.label){case 0:if(!(t&&t.length>0))return[3,5];if(n=this._redirectedHost||this._config.endpointUrl,i=new Spi.URL(n).hostname,a={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}},o=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!o)return[3,4];this._statsbeat&&this._statsbeat.addFeature(q_.StatsbeatFeature.AAD_HANDLING),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,o.addAuthorizationHeader(a)];case 2:return f.sent(),[3,4];case 3:return s=f.sent(),c="Failed to get AAD bearer token for the Application.",this._enableDiskRetryMode&&(c+="This batch of telemetry items will be retried. ",this._storeToDisk(t)),c+="Error:"+s.toString(),this._logWarn(c),typeof r=="function"&&r(c),[2];case 4:if(u="",t.forEach(function(d){var h=Ml.stringify(d);typeof h=="string"&&(u+=h+`
1487
- `)}),u.length>0&&(u=u.substring(0,u.length-1)),u.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];l=Buffer.from?Buffer.from(u):new Buffer(u),Tpi.gzip(l,function(d,h){var m=h;d?(p._logWarn(Ml.dumpObj(d)),m=l,a.headers["Content-Length"]=l.length.toString()):(a.headers["Content-Encoding"]="gzip",a.headers["Content-Length"]=h.length.toString()),p._logInfo(Ml.dumpObj(a)),a[Opi.disableCollectionRequestOption]=!0;var v=+new Date,_=function(T){T.setEncoding("utf-8");var S="";T.on("data",function(A){S+=A}),T.on("end",function(){var A,P=+new Date,k=P-v;if(p._numConsecutiveFailures=0,S.includes(Ppi)&&T.statusCode===400&&(oje.warn("Instrumentation key was invalid, please check the iKey"),(A=p._shutdownStatsbeat)===null||A===void 0||A.call(p)),p._isStatsbeatSender&&!p._statsbeatHasReachedIngestionAtLeastOnce&&(wpi.includes(T.statusCode)?p._statsbeatHasReachedIngestionAtLeastOnce=!0:p._statsbeatFailedToIngest()),p._statsbeat&&(T.statusCode==Cpi||T.statusCode==Api?p._statsbeat.countThrottle(q_.StatsbeatNetworkCategory.Breeze,i,T.statusCode):p._statsbeat.countRequest(q_.StatsbeatNetworkCategory.Breeze,i,k,T.statusCode===200,T.statusCode)),p._enableDiskRetryMode){if(T.statusCode===200)p._resendTimer||(p._resendTimer=setTimeout(function(){p._resendTimer=null,p._sendFirstFileOnDisk()},p._resendInterval),p._resendTimer.unref());else if(p._isRetriable(T.statusCode))try{p._statsbeat&&p._statsbeat.countRetry(q_.StatsbeatNetworkCategory.Breeze,i,T.statusCode);var D=JSON.parse(S),F=[];D.errors&&(D.errors.forEach(function(H){(H.statusCode==429||H.statusCode==500||H.statusCode==503)&&F.push(t[H.index])}),F.length>0&&p._storeToDisk(F))}catch{p._storeToDisk(t)}}if(T.statusCode===307||T.statusCode===308)if(p._numConsecutiveRedirects++,p._numConsecutiveRedirects<10){var K=T.headers.location?T.headers.location.toString():null;K&&(p._redirectedHost=K,p.send(t,r))}else{var $={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};p._statsbeat&&p._statsbeat.countException(q_.StatsbeatNetworkCategory.Breeze,i,$),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else p._numConsecutiveRedirects=0,typeof r=="function"&&r(S),p._logInfo(S),typeof p._onSuccess=="function"&&p._onSuccess(S)})},O=Ml.makeRequest(p._config,n,a,_);O.setTimeout(e.HTTP_TIMEOUT,function(){p._requestTimedOut=!0,O.abort()}),O.on("error",function(T){if(p._isStatsbeatSender&&!p._statsbeatHasReachedIngestionAtLeastOnce&&p._statsbeatFailedToIngest(),p._numConsecutiveFailures++,p._statsbeat&&p._statsbeat.countException(q_.StatsbeatNetworkCategory.Breeze,i,T),!p._enableDiskRetryMode||p._numConsecutiveFailures>0&&p._numConsecutiveFailures%e.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var S="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";p._enableDiskRetryMode&&(S="Ingestion endpoint could not be reached ".concat(p._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),p._logWarn(S,Ml.dumpObj(T))}else{var S="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";p._logInfo(S,Ml.dumpObj(T))}p._onErrorHelper(T),typeof r=="function"&&(T?(p._requestTimedOut&&(T.name="telemetry timeout",T.message="telemetry request timed out"),r(Ml.dumpObj(T))):r("Error sending telemetry")),p._enableDiskRetryMode&&p._storeToDisk(t)}),O.write(m),O.end()}),f.label=5;case 5:return[2]}})})},e.prototype.saveOnCrash=function(t){this._enableDiskRetryMode&&this._storeToDiskSync(Ml.stringify(t))},e.prototype._isRetriable=function(t){return t===206||t===401||t===403||t===408||t===429||t===500||t===502||t===503||t===504},e.prototype._logInfo=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._isStatsbeatSender||oje.info(e.TAG,t,r)},e.prototype._logWarn=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._isStatsbeatSender||oje.warn(e.TAG,t,r)},e.prototype._statsbeatFailedToIngest=function(){this._shutdownStatsbeat&&(this._failedToIngestCounter++,this._failedToIngestCounter>=3&&this._shutdownStatsbeat())},e.prototype._storeToDisk=function(t){return qne(this,void 0,void 0,function(){var r,n,i,a,o,s,c;return Vne(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,xb.confirmDirExists(this._tempDir)];case 1:return u.sent(),[3,3];case 2:return r=u.sent(),this._logWarn("Failed to create folder to put telemetry: "+Ml.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return u.trys.push([3,5,,6]),[4,LU.FileAccessControl.applyACLRules(this._tempDir)];case 4:return u.sent(),[3,6];case 5:return n=u.sent(),this._logWarn("Failed to apply file access control to folder: "+Ml.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return u.trys.push([6,8,,9]),[4,xb.getShallowDirectorySize(this._tempDir)];case 7:return i=u.sent(),i>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+i),[2]):[3,9];case 8:return a=u.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+Ml.dumpObj(a)),this._onErrorHelper(a),[2];case 9:return u.trys.push([9,11,,12]),o="".concat(new Date().getTime(),".ai.json"),s=mS.join(this._tempDir,o),this._logInfo("saving data to disk at: "+s),[4,xb.writeFileAsync(s,Ml.stringify(t),{mode:384})];case 10:return u.sent(),[3,12];case 11:return c=u.sent(),this._logWarn("Failed to persist telemetry to disk: "+Ml.dumpObj(c)),this._onErrorHelper(c),[2];case 12:return[2]}})})},e.prototype._storeToDiskSync=function(t){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),aje.existsSync(this._tempDir)||aje.mkdirSync(this._tempDir),LU.FileAccessControl.applyACLRulesSync(this._tempDir);var r=xb.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),i=mS.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+i),aje.writeFileSync(i,t,{mode:384})}catch(a){this._logWarn("Error while saving data to disk: "+Ml.dumpObj(a)),this._onErrorHelper(a)}},e.prototype._sendFirstFileOnDisk=function(){return qne(this,void 0,void 0,function(){var t,r,n,i,a,o;return Vne(this,function(s){switch(s.label){case 0:return s.trys.push([0,6,,7]),[4,xb.readdirAsync(this._tempDir)];case 1:return t=s.sent(),t=t.filter(function(c){return mS.basename(c).indexOf(".ai.json")>-1}),t.length>0?(r=t[0],n=mS.join(this._tempDir,r),[4,xb.readFileAsync(n)]):[3,5];case 2:return i=s.sent(),[4,xb.unlinkAsync(n)];case 3:return s.sent(),a=JSON.parse(i.toString()),[4,this.send(a)];case 4:s.sent(),s.label=5;case 5:return[3,7];case 6:return o=s.sent(),this._onErrorHelper(o),[3,7];case 7:return[2]}})})},e.prototype._onErrorHelper=function(t){typeof this._onError=="function"&&this._onError(t)},e.prototype._fileCleanupTask=function(){return qne(this,void 0,void 0,function(){var t,r,n,i,a,o,s=this;return Vne(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),[4,xb.readdirAsync(this._tempDir)];case 1:if(t=c.sent(),t=t.filter(function(u){return mS.basename(u).indexOf(".ai.json")>-1}),!(t.length>0))return[3,5];r=0,c.label=2;case 2:return r<t.length?(n=new Date(parseInt(t[r].split(".ai.json")[0])),i=new Date(+new Date-e.FILE_RETEMPTION_PERIOD)>n,i?(a=mS.join(this._tempDir,t[r]),[4,xb.unlinkAsync(a).catch(function(u){s._onErrorHelper(u)})]):[3,4]):[3,5];case 3:c.sent(),c.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return o=c.sent(),o.code!="ENOENT"&&this._onErrorHelper(o),[3,7];case 7:return[2]}})})},e.TAG="Sender",e.WAIT_BETWEEN_RESEND=60*1e3,e.MAX_BYTES_ON_DISK=50*1024*1024,e.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,e.CLEANUP_TIMEOUT=60*60*1e3,e.FILE_RETEMPTION_PERIOD=7*24*60*60*1e3,e.TEMPDIR_PREFIX="appInsights-node",e.HTTP_TIMEOUT=2e4,e}();Qnr.exports=Dpi});var tir=y(Une=>{"use strict";Object.defineProperty(Une,"__esModule",{value:!0});Une.AzureVirtualMachine=void 0;var eir=hi(),Npi=Hs(),Ipi=NI(),Rpi="http://169.254.169.254/metadata/instance/compute",Lpi="api-version=2017-12-01",kpi="format=json",$pi="UNREACH",Mpi=function(){function e(){}return e.getAzureComputeMetadata=function(t,r){var n,i=this,a={},o="".concat(Rpi,"?").concat(Lpi,"&").concat(kpi),s=(n={method:"GET"},n[Ipi.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),c=Npi.makeRequest(t,o,s,function(u){if(u.statusCode===200){a.isVM=!0;var l="";u.on("data",function(p){l+=p}),u.on("end",function(){try{var p=JSON.parse(l);a.id=p.vmId||"",a.subscriptionId=p.subscriptionId||"",a.osType=p.osType||""}catch(f){eir.info(e.TAG,f)}r(a)})}else r(a)},!1,!1);c&&(setTimeout(function(){i._requestTimedOut=!0,c.abort()},e.HTTP_TIMEOUT),c.on("error",function(u){i._requestTimedOut&&u&&(u.name="telemetry timeout",u.message="telemetry request timed out"),u&&u.message&&u.message.indexOf($pi)>-1?a.isVM=!1:eir.info(e.TAG,u),r(a)}),c.end())},e.HTTP_TIMEOUT=2500,e.TAG="AzureVirtualMachine",e}();Une.AzureVirtualMachine=Mpi});var rir=y(Bne=>{"use strict";Object.defineProperty(Bne,"__esModule",{value:!0});Bne.NetworkStatsbeat=void 0;var Fpi=function(){function e(t,r){this.endpoint=t,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return e}();Bne.NetworkStatsbeat=Fpi});var sir=y((gS,oir)=>{"use strict";var Mg=gS&&gS.__assign||function(){return Mg=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Mg.apply(this,arguments)},cje=gS&&gS.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},uje=gS&&gS.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},jpi=require("os"),qpi=ije(),nir=hi(),Vpi=sje(),Yi=Gi(),Upi=Bc(),Bpi=tir(),zpi=UMe(),iir=OI(),Hpi=rir(),air=Hs(),Gpi="node",Kpi=function(){function e(t,r){this._attach=Yi.StatsbeatAttach.sdk,this._feature=Yi.StatsbeatFeature.NONE,this._instrumentation=Yi.StatsbeatInstrumentation.NONE,this._isInitialized=!1,this._statbeatMetrics=[],this._networkStatsbeatCollection=[],this._config=t,this._context=r||new iir,this._longHandleTimeout=null;var n=this._getConnectionString(t);this._statsbeatConfig=new zpi(n),this._statsbeatConfig.samplingPercentage=100,this._sender=new Vpi(this._statsbeatConfig,null,null,null,null,!0,this._shutdownStatsbeat.bind(this))}return e.prototype.enable=function(t){var r=this;this._isEnabled=t,this._isEnabled&&!this._isInitialized&&(this._getCustomProperties(),this._isInitialized=!0),t?(this._handle||(this._handle=setInterval(function(){r.trackShortIntervalStatsbeats()},e.STATS_COLLECTION_SHORT_INTERVAL),this._handle.unref()),this._longHandle||(this._longHandleTimeout=setTimeout(function(){r.isEnabled()&&r.trackLongIntervalStatsbeats()},e.STATS_COLLECTION_INITIAL_DELAY),this._longHandleTimeout.unref(),this._longHandle=setInterval(function(){r.trackLongIntervalStatsbeats()},e.STATS_COLLECTION_LONG_INTERVAL),this._longHandle.unref())):(this._handle&&(clearInterval(this._handle),this._handle=null),this._longHandle&&(clearInterval(this._longHandle),this._longHandle=null),this._longHandleTimeout&&(clearTimeout(this._longHandleTimeout),this._longHandleTimeout=null))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.isEnabled=function(){return this._isEnabled},e.prototype.setCodelessAttach=function(){this._attach=Yi.StatsbeatAttach.codeless},e.prototype.addFeature=function(t){this._feature|=t},e.prototype.removeFeature=function(t){this._feature&=~t},e.prototype.addInstrumentation=function(t){this._instrumentation|=t},e.prototype.removeInstrumentation=function(t){this._instrumentation&=~t},e.prototype.countRequest=function(t,r,n,i,a){if(this.isEnabled()){var o=this._getNetworkStatsbeatCounter(t,r);if(o.totalRequestCount++,o.intervalRequestExecutionTime+=n,i===!1){if(!a)return;var s=o.totalFailedRequestCount.find(function(c){return a===c.statusCode});s?s.count++:o.totalFailedRequestCount.push({statusCode:a,count:1})}else o.totalSuccesfulRequestCount++}},e.prototype.countException=function(t,r,n){if(this.isEnabled()){var i=this._getNetworkStatsbeatCounter(t,r),a=i.exceptionCount.find(function(o){return n.name===o.exceptionType});a?a.count++:i.exceptionCount.push({exceptionType:n.name,count:1})}},e.prototype.countThrottle=function(t,r,n){if(this.isEnabled()){var i=this._getNetworkStatsbeatCounter(t,r),a=i.throttleCount.find(function(o){return n===o.statusCode});a?a.count++:i.throttleCount.push({statusCode:n,count:1})}},e.prototype.countRetry=function(t,r,n){if(this.isEnabled()){var i=this._getNetworkStatsbeatCounter(t,r),a=i.retryCount.find(function(o){return n===o.statusCode});a?a.count++:i.retryCount.push({statusCode:n,count:1})}},e.prototype.trackShortIntervalStatsbeats=function(){return cje(this,void 0,void 0,function(){var t,r;return uje(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this._getResourceProvider()];case 1:return n.sent(),t={os:this._os,rp:this._resourceProvider,cikey:this._cikey,runtimeVersion:this._runtimeVersion,language:this._language,version:this._sdkVersion,attach:this._attach},this._trackRequestDuration(t),this._trackRequestsCount(t),[4,this._sendStatsbeats()];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),nir.info(e.TAG,"Failed to send Statsbeat metrics: "+air.dumpObj(r)),[3,4];case 4:return[2]}})})},e.prototype.trackLongIntervalStatsbeats=function(){return cje(this,void 0,void 0,function(){var t,r,n,i,a;return uje(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._getResourceProvider()];case 1:return o.sent(),t={os:this._os,rp:this._resourceProvider,cikey:this._cikey,runtimeVersion:this._runtimeVersion,language:this._language,version:this._sdkVersion,attach:this._attach},r=Object.assign({rpId:this._resourceIdentifier},t),this._statbeatMetrics.push({name:Yi.StatsbeatCounter.ATTACH,value:1,properties:r}),this._instrumentation!=Yi.StatsbeatInstrumentation.NONE&&(n=Object.assign({feature:this._instrumentation,type:Yi.StatsbeatFeatureType.Instrumentation},t),this._statbeatMetrics.push({name:Yi.StatsbeatCounter.FEATURE,value:1,properties:n})),this._feature!=Yi.StatsbeatFeature.NONE&&(i=Object.assign({feature:this._feature,type:Yi.StatsbeatFeatureType.Feature},t),this._statbeatMetrics.push({name:Yi.StatsbeatCounter.FEATURE,value:1,properties:i})),[4,this._sendStatsbeats()];case 2:return o.sent(),[3,4];case 3:return a=o.sent(),nir.info(e.TAG,"Failed to send Statsbeat metrics: "+air.dumpObj(a)),[3,4];case 4:return[2]}})})},e.prototype._getNetworkStatsbeatCounter=function(t,r){for(var n=this._getShortHost(r),i=0;i<this._networkStatsbeatCollection.length;i++)if(t===this._networkStatsbeatCollection[i].endpoint&&n===this._networkStatsbeatCollection[i].host)return this._networkStatsbeatCollection[i];var a=new Hpi.NetworkStatsbeat(t,n);return this._networkStatsbeatCollection.push(a),a},e.prototype._trackRequestDuration=function(t){for(var r=0;r<this._networkStatsbeatCollection.length;r++){var n=this._networkStatsbeatCollection[r];n.time=+new Date;var i=n.totalRequestCount-n.lastRequestCount||0,a=n.intervalRequestExecutionTime-n.lastIntervalRequestExecutionTime,o=a>0&&a/i||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,i>0){var s=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},t);this._statbeatMetrics.push({name:Yi.StatsbeatCounter.REQUEST_DURATION,value:o,properties:s})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},e.prototype._getShortHost=function(t){var r=t;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),i=n.exec(t);i!=null&&i.length>1&&(r=i[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},e.prototype._trackRequestsCount=function(t){for(var r=this,n=function(s){a=i._networkStatsbeatCollection[s];var c=Object.assign({endpoint:a.endpoint,host:a.host},t);a.totalSuccesfulRequestCount>0&&(i._statbeatMetrics.push({name:Yi.StatsbeatCounter.REQUEST_SUCCESS,value:a.totalSuccesfulRequestCount,properties:c}),a.totalSuccesfulRequestCount=0),a.totalFailedRequestCount.length>0&&(a.totalFailedRequestCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{statusCode:u.statusCode})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.REQUEST_FAILURE,value:u.count,properties:c})}),a.totalFailedRequestCount=[]),a.retryCount.length>0&&(a.retryCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{statusCode:u.statusCode})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.RETRY_COUNT,value:u.count,properties:c})}),a.retryCount=[]),a.throttleCount.length>0&&(a.throttleCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{statusCode:u.statusCode})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.THROTTLE_COUNT,value:u.count,properties:c})}),a.throttleCount=[]),a.exceptionCount.length>0&&(a.exceptionCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{exceptionType:u.exceptionType})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.EXCEPTION_COUNT,value:u.count,properties:c})}),a.exceptionCount=[])},i=this,a,o=0;o<this._networkStatsbeatCollection.length;o++)n(o)},e.prototype._sendStatsbeats=function(){return cje(this,void 0,void 0,function(){var t,r,n,i;return uje(this,function(a){switch(a.label){case 0:if(!(this._statbeatMetrics.length>0))return[3,2];for(t=[],r=0;r<this._statbeatMetrics.length;r++)n={name:this._statbeatMetrics[r].name,value:this._statbeatMetrics[r].value,properties:this._statbeatMetrics[r].properties},i=qpi.createEnvelope(n,Upi.TelemetryType.Metric,null,this._context,this._statsbeatConfig),i.name=Yi.StatsbeatTelemetryName,t.push(i);return this._statbeatMetrics=[],[4,this._sender.send(t)];case 1:a.sent(),a.label=2;case 2:return[2]}})})},e.prototype._getCustomProperties=function(){this._language=Gpi,this._cikey=this._config.instrumentationKey,this._sdkVersion=iir.sdkVersion,this._os=jpi.type(),this._runtimeVersion=process.version},e.prototype._getResourceProvider=function(){var t=this;return new Promise(function(r,n){var i=!1;t._resourceProvider=Yi.StatsbeatResourceProvider.unknown,t._resourceIdentifier=Yi.StatsbeatResourceProvider.unknown,process.env.AKS_ARM_NAMESPACE_ID?(t._resourceProvider=Yi.StatsbeatResourceProvider.aks,t._resourceIdentifier=process.env.AKS_ARM_NAMESPACE_ID):process.env.WEBSITE_SITE_NAME?(t._resourceProvider=Yi.StatsbeatResourceProvider.appsvc,t._resourceIdentifier=process.env.WEBSITE_SITE_NAME,process.env.WEBSITE_HOME_STAMPNAME&&(t._resourceIdentifier+="/"+process.env.WEBSITE_HOME_STAMPNAME)):process.env.FUNCTIONS_WORKER_RUNTIME?(t._resourceProvider=Yi.StatsbeatResourceProvider.functions,process.env.WEBSITE_HOSTNAME&&(t._resourceIdentifier=process.env.WEBSITE_HOSTNAME)):t._config&&(t._isVM===void 0||t._isVM==!0?(i=!0,Bpi.AzureVirtualMachine.getAzureComputeMetadata(t._config,function(a){t._isVM=a.isVM,t._isVM&&(t._resourceProvider=Yi.StatsbeatResourceProvider.vm,t._resourceIdentifier=a.id+"/"+a.subscriptionId,a.osType&&(t._os=a.osType)),r()})):t._resourceProvider=Yi.StatsbeatResourceProvider.unknown),i||r()})},e.prototype._shutdownStatsbeat=function(){this.enable(!1)},e.prototype._getConnectionString=function(t){for(var r=t.endpointUrl,n=["westeurope","northeurope","francecentral","francesouth","germanywestcentral","norwayeast","norwaywest","swedencentral","switzerlandnorth","switzerlandwest","uksouth","ukwest"],i=0;i<n.length;i++)if(r.indexOf(n[i])>-1)return e.EU_CONNECTION_STRING;return e.NON_EU_CONNECTION_STRING},e.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",e.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",e.STATS_COLLECTION_SHORT_INTERVAL=9e5,e.STATS_COLLECTION_LONG_INTERVAL=864e5,e.STATS_COLLECTION_INITIAL_DELAY=15e3,e.TAG="Statsbeat",e}();oir.exports=Kpi});var lir=y((rpa,uir)=>{"use strict";var Ypi=require("url"),Wpi=UMe(),Xpi=jnr(),Jpi=OI(),Tb=Bc(),Zpi=Vnr(),lje=Ynr(),cir=P_(),Qpi=sir(),efi=sje(),pje=Hs(),zne=hi(),tfi=ije(),rfi=function(){function e(t){this._telemetryProcessors=[];var r=new Wpi(t);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new Jpi,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new Qpi(this.config,this.context),this._statsbeat.enable(!0));var n=new efi(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new Zpi(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return e.prototype.trackAvailability=function(t){this.track(t,Tb.TelemetryType.Availability)},e.prototype.trackPageView=function(t){this.track(t,Tb.TelemetryType.PageView)},e.prototype.trackTrace=function(t){this.track(t,Tb.TelemetryType.Trace)},e.prototype.trackMetric=function(t){this.track(t,Tb.TelemetryType.Metric)},e.prototype.trackException=function(t){t&&t.exception&&!pje.isError(t.exception)&&(t.exception=new Error(t.exception.toString())),this.track(t,Tb.TelemetryType.Exception)},e.prototype.trackEvent=function(t){this.track(t,Tb.TelemetryType.Event)},e.prototype.trackRequest=function(t){this.track(t,Tb.TelemetryType.Request)},e.prototype.trackDependency=function(t){if(t&&!t.target&&t.data)try{t.target=new Ypi.URL(t.data).host}catch(r){t.target=null,zne.warn(e.TAG,"The URL object is failed to create.",r)}this.track(t,Tb.TelemetryType.Dependency)},e.prototype.flush=function(t){this.channel.triggerSend(t?!!t.isAppCrashing:!1,t?t.callback:void 0)},e.prototype.track=function(t,r){if(t&&Tb.telemetryTypeToBaseType(r)){var n=tfi.createEnvelope(t,r,this.commonProperties,this.context,this.config);t.time&&(n.time=t.time.toISOString());var i=this.runTelemetryProcessors(n,t.contextObjects);i=i&&lje.samplingTelemetryProcessor(n,{correlationContext:cir.CorrelationContextManager.getCurrentContext()}),lje.preAggregatedMetricsTelemetryProcessor(n,this.context),i&&(lje.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else zne.warn(e.TAG,"track() requires telemetry object and telemetryType to be specified.")},e.prototype.setAutoPopulateAzureProperties=function(t){},e.prototype.getAuthorizationHandler=function(t){return t&&t.aadTokenCredential?(this.authorizationHandler||(zne.info(e.TAG,"Adding authorization handler"),this.authorizationHandler=new Xpi(t.aadTokenCredential,t.aadAudience)),this.authorizationHandler):null},e.prototype.addTelemetryProcessor=function(t){this._telemetryProcessors.push(t)},e.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},e.prototype.runTelemetryProcessors=function(t,r){var n=!0,i=this._telemetryProcessors.length;if(i===0)return n;r=r||{},r.correlationContext=cir.CorrelationContextManager.getCurrentContext();for(var a=0;a<i;++a)try{var o=this._telemetryProcessors[a];if(o&&o.apply(null,[t,r])===!1){n=!1;break}}catch(s){n=!0,zne.warn(e.TAG,"One of telemetry processors failed, telemetry item will be sent.",s,t)}return n&&(t&&t.tags&&(t.tags=pje.validateStringMap(t.tags)),t&&t.data&&t.data.baseData&&t.data.baseData.properties&&(t.data.baseData.properties=pje.validateStringMap(t.data.baseData.properties))),n},e.prototype.getStatsbeat=function(){return this._statsbeat},e.TAG="TelemetryClient",e}();uir.exports=rfi});var dir=y((fje,fir)=>{"use strict";var nfi=fje&&fje.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ifi=lir(),pir=kMe(),afi=NI(),Hne=hi(),ofi=function(e){nfi(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?pir.trackRequestSync(this,r):Hne.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},t.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&Hne.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?pir.trackRequest(this,r):Hne.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},t.prototype.trackNodeHttpDependency=function(r){r&&r.request?afi.trackRequest(this,r):Hne.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},t}(ifi);fir.exports=ofi});var mir=y(hir=>{"use strict";Object.defineProperty(hir,"__esModule",{value:!0})});var vje=y(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.Configuration=pe.liveMetricsClient=pe.defaultClient=pe.DistributedTracingModes=void 0;pe.setup=mfi;pe.start=vir;pe.getCorrelationContext=yfi;pe.startOperation=vfi;pe.wrapWithCorrelationContext=bfi;pe.dispose=Efi;var hje=P_(),sfi=uer(),cfi=per(),mje=Vre(),ufi=_Me(),lfi=_er(),pfi=Ier(),ffi=NI(),dfi=kMe(),gir=H1(),$U=hi(),yir=ftr(),gje=htr(),hfi=ytr();pe.TelemetryClient=dir();pe.Contracts=Bc();pe.azureFunctionsTypes=mir();var dje;(function(e){e[e.AI=0]="AI",e[e.AI_AND_W3C=1]="AI_AND_W3C"})(dje||(pe.DistributedTracingModes=dje={}));var MU,FU,jU,qU,VU,rR,nR,yS,UU,BU,Mp=!1,Gne;function mfi(e){return pe.defaultClient?$U.info("The default client is already setup"):(pe.defaultClient=new pe.TelemetryClient(e),MU=new sfi(pe.defaultClient),FU=new cfi(pe.defaultClient),jU=new mje(pe.defaultClient),qU=new ufi(pe.defaultClient),VU=new lfi(pe.defaultClient),rR=new pfi(pe.defaultClient),yS=new dfi(pe.defaultClient),UU=new ffi(pe.defaultClient),nR||(nR=new gje.AutoCollectNativePerformance(pe.defaultClient)),BU=new hfi.AzureFunctionsHook(pe.defaultClient)),yje}function gfi(){pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectExternalLoggers==null&&(pe.defaultClient.config.enableAutoCollectExternalLoggers=!0),pe.defaultClient.config.enableAutoCollectConsole==null&&(pe.defaultClient.config.enableAutoCollectConsole=!1),pe.defaultClient.config.enableAutoCollectExceptions==null&&(pe.defaultClient.config.enableAutoCollectExceptions=!0),pe.defaultClient.config.enableAutoCollectPerformance==null&&(pe.defaultClient.config.enableAutoCollectPerformance=!0),pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),pe.defaultClient.config.enableAutoCollectHeartbeat==null&&(pe.defaultClient.config.enableAutoCollectHeartbeat=!0),pe.defaultClient.config.enableAutoCollectRequests==null&&(pe.defaultClient.config.enableAutoCollectRequests=!0),pe.defaultClient.config.enableAutoCollectDependencies==null&&(pe.defaultClient.config.enableAutoCollectDependencies=!0),pe.defaultClient.config.enableUseDiskRetryCaching==null&&(pe.defaultClient.config.enableUseDiskRetryCaching=!0),pe.defaultClient.config.enableAutoDependencyCorrelation==null&&(pe.defaultClient.config.enableAutoDependencyCorrelation=!0),pe.defaultClient.config.enableSendLiveMetrics==null&&(pe.defaultClient.config.enableSendLiveMetrics=!1),pe.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(pe.defaultClient.config.enableAutoCollectExtendedMetrics=!0),pe.defaultClient.config.enableWebInstrumentation==null&&(pe.defaultClient.config.enableWebInstrumentation=!1),pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}function vir(){if(pe.defaultClient){Mp=!0,gfi(),MU.enable(pe.defaultClient.config.enableAutoCollectExternalLoggers,pe.defaultClient.config.enableAutoCollectConsole),FU.enable(pe.defaultClient.config.enableAutoCollectExceptions),jU.enable(pe.defaultClient.config.enableAutoCollectPerformance),qU.enable(pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics),VU.enable(pe.defaultClient.config.enableAutoCollectHeartbeat),yS.useAutoCorrelation(pe.defaultClient.config.enableAutoDependencyCorrelation,pe.defaultClient.config.enableUseAsyncHooks),yS.enable(pe.defaultClient.config.enableAutoCollectRequests),UU.enable(pe.defaultClient.config.enableAutoCollectDependencies),rR.enable(pe.defaultClient.config.enableWebInstrumentation,pe.defaultClient.config.webInstrumentationConnectionString),pe.defaultClient.config.enableSendLiveMetrics&&(pe.liveMetricsClient||(pe.liveMetricsClient=new yir(pe.defaultClient.config,pe.defaultClient.context,pe.defaultClient.getAuthorizationHandler,pe.defaultClient),Gne=new mje(pe.liveMetricsClient,1e3,!0),pe.liveMetricsClient.addCollector(Gne),pe.defaultClient.quickPulseClient=pe.liveMetricsClient),pe.liveMetricsClient.enable(pe.defaultClient.config.enableSendLiveMetrics)),BU.enable(pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var e=gje.AutoCollectNativePerformance.parseEnabled(pe.defaultClient.config.enableAutoCollectExtendedMetrics,pe.defaultClient.config);nR.enable(pe.defaultClient.config.enableAutoCollectExtendedMetrics,e.disabledMetrics),pe.defaultClient&&pe.defaultClient.channel&&pe.defaultClient.channel.setUseDiskRetryCaching(pe.defaultClient.config.enableUseDiskRetryCaching,pe.defaultClient.config.enableResendInterval,pe.defaultClient.config.enableMaxBytesOnDisk)}else $U.warn("Start cannot be called before setup");return yje}function yfi(){return hje.CorrelationContextManager.getCurrentContext()}function vfi(e,t){return hje.CorrelationContextManager.startOperation(e,t)}function bfi(e,t){return hje.CorrelationContextManager.wrapCallback(e,t)}var yje=function(){function e(){}return e.setDistributedTracingMode=function(t){return gir.w3cEnabled=t===dje.AI_AND_W3C,e},e.setAutoCollectConsole=function(t,r){return r===void 0&&(r=!1),pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectExternalLoggers=t,pe.defaultClient.config.enableAutoCollectConsole=r,Mp&&MU.enable(t,r)),e},e.setAutoCollectExceptions=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectExceptions=t,Mp&&FU.enable(t)),e},e.setAutoCollectPerformance=function(t,r){if(r===void 0&&(r=!0),pe.defaultClient){pe.defaultClient.config.enableAutoCollectPerformance=t;var n=gje.AutoCollectNativePerformance.parseEnabled(r,pe.defaultClient.config);pe.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,Mp&&(jU.enable(t),nR.enable(pe.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return e},e.setAutoCollectPreAggregatedMetrics=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics=t,Mp&&qU.enable(t)),e},e.setAutoCollectHeartbeat=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectHeartbeat=t,Mp&&VU.enable(t)),e},e.enableAutoWebSnippetInjection=function(t,r){return pe.defaultClient&&(pe.defaultClient.config.enableWebInstrumentation=t,pe.defaultClient.config.webInstrumentationConnectionString=r,Mp&&rR.enable(pe.defaultClient.config.enableAutoWebSnippetInjection,pe.defaultClient.config.webSnippetConnectionString)),e},e.enableWebInstrumentation=function(t,r){return pe.defaultClient&&(pe.defaultClient.config.enableWebInstrumentation=t,pe.defaultClient.config.webInstrumentationConnectionString=r,Mp&&rR.enable(pe.defaultClient.config.enableWebInstrumentation,pe.defaultClient.config.webInstrumentationConnectionString)),e},e.setAutoCollectRequests=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectRequests=t,Mp&&yS.enable(t)),e},e.setAutoCollectDependencies=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectDependencies=t,Mp&&UU.enable(t)),e},e.setAutoDependencyCorrelation=function(t,r){return pe.defaultClient&&(pe.defaultClient.config.enableAutoDependencyCorrelation=t,pe.defaultClient.config.enableUseAsyncHooks=r,Mp&&yS.useAutoCorrelation(t,r)),e},e.setUseDiskRetryCaching=function(t,r,n){return pe.defaultClient&&(pe.defaultClient.config.enableUseDiskRetryCaching=t,pe.defaultClient.config.enableResendInterval=r,pe.defaultClient.config.enableMaxBytesOnDisk=n,pe.defaultClient.channel&&pe.defaultClient.channel.setUseDiskRetryCaching(pe.defaultClient.config.enableUseDiskRetryCaching,pe.defaultClient.config.enableResendInterval,pe.defaultClient.config.enableMaxBytesOnDisk)),e},e.setInternalLogging=function(t,r){return t===void 0&&(t=!1),r===void 0&&(r=!0),$U.enableDebug=t,$U.disableWarnings=!r,e},e.setAutoCollectIncomingRequestAzureFunctions=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=t,Mp&&BU.enable(t)),e},e.setSendLiveMetrics=function(t){return t===void 0&&(t=!1),pe.defaultClient?(!pe.liveMetricsClient&&t?(pe.liveMetricsClient=new yir(pe.defaultClient.config,pe.defaultClient.context,pe.defaultClient.getAuthorizationHandler,pe.defaultClient),Gne=new mje(pe.liveMetricsClient,1e3,!0),pe.liveMetricsClient.addCollector(Gne),pe.defaultClient.quickPulseClient=pe.liveMetricsClient):pe.liveMetricsClient&&pe.liveMetricsClient.enable(t),pe.defaultClient.config.enableSendLiveMetrics=t,e):($U.warn("Live metrics client cannot be setup without the default client"),e)},e.start=vir,e}();pe.Configuration=yje;function Efi(){gir.w3cEnabled=!0,pe.defaultClient=null,Mp=!1,MU&&MU.dispose(),FU&&FU.dispose(),jU&&jU.dispose(),qU&&qU.dispose(),VU&&VU.dispose(),rR&&rR.dispose(),nR&&nR.dispose(),yS&&yS.dispose(),UU&&UU.dispose(),pe.liveMetricsClient&&(pe.liveMetricsClient.enable(!1),pe.liveMetricsClient=void 0),BU&&BU.dispose()}});var Yne=y(Kne=>{"use strict";Object.defineProperty(Kne,"__esModule",{value:!0});Kne.EventHeader=void 0;var bje=class{extensionName;eventName;constructor(t,r){this.extensionName=t,this.eventName=r}getExtensionName(){return this.extensionName}getEventName(){return this.eventName}toString(){return`${this.extensionName}/${this.eventName}`}};Kne.EventHeader=bje});var Xne=y(Wne=>{"use strict";Object.defineProperty(Wne,"__esModule",{value:!0});Wne.SampleRate=void 0;var bir;(function(e){e[e.OnePercent=0]="OnePercent",e[e.TenPercent=1]="TenPercent",e[e.NoSampling=2]="NoSampling"})(bir||(Wne.SampleRate=bir={}))});var _je=y(Eje=>{"use strict";Object.defineProperty(Eje,"__esModule",{value:!0});Eje.configAzureTelemetryClient=_fi;function _fi(e){e.channel.setUseDiskRetryCaching(!0),e.addTelemetryProcessor(t=>(t.tags["ai.location.ip"]="0.0.0.0",t.tags["ai.cloud.roleInstance"]="masked",t.tags["ai.cloud.role"]="masked",t.tags["ai.device.type"]="masked",!0))}});var Eir=y((cpa,xfi)=>{xfi.exports={name:"@sap-ux/telemetry",version:"0.6.47",description:"Library for sending usage telemetry data",repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/telemetry"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Atelemetry"},license:"Apache-2.0",private:!1,main:"dist/index.js",scripts:{build:"tsc --build",watch:"tsc --watch",clean:"rimraf --glob dist coverage *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint","lint:fix":"eslint --fix",test:"jest --ci --forceExit --detectOpenHandles --colors","test-u":"jest --ci --forceExit --detectOpenHandles --colors -u",link:"pnpm link --global",unlink:"pnpm unlink --global",example:"ts-node example/index.ts"},dependencies:{"@sap-ux/store":"workspace:*","@sap-ux/project-access":"workspace:*","@sap-ux/btp-utils":"workspace:*","@sap-ux/ui5-config":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/nodejs-utils":"workspace:*",applicationinsights:"2.9.8",axios:"1.12.2","performance-now":"2.1.0",yaml:"2.3.3"},devDependencies:{"jest-extended":"6.0.0",memfs:"3.4.13",unionfs:"4.4.0",dotenv:"16.3.1"},files:["dist","LICENSE","!dist/*.map","!dist/**/*.map"],engines:{node:">=20.x"}}});var zU=y(iR=>{"use strict";var Tfi=iR&&iR.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(iR,"__esModule",{value:!0});iR.TelemetrySettings=void 0;var _ir=Tfi(Eir());iR.TelemetrySettings={azureInstrumentationKey:"",telemetryEnabled:!0,telemetryLibName:_ir.default.name,telemetryLibVersion:_ir.default.version,consumerModuleName:"",consumerModuleVersion:""}});var Tje=y(jg=>{"use strict";var Ofi=jg&&jg.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Sfi=jg&&jg.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Afi=jg&&jg.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Ofi(r,t,n[i]);return Sfi(r,t),r}}();Object.defineProperty(jg,"__esModule",{value:!0});jg.ApplicationInsightClient=void 0;var Cfi=qLe(),wfi=Afi(vje()),Pfi=Yne(),Fg=Xne(),Dfi=_je(),xir=zU(),xje=class extends Cfi.Client{clients;constructor(t,r,n){super(),this.clients=new Map,this.applicationKey=t,this.extensionVersion=n,this.extensionName=r;let i=this.createTelemetryClient(Fg.SampleRate.OnePercent),a=this.createTelemetryClient(Fg.SampleRate.TenPercent),o=this.createTelemetryClient(Fg.SampleRate.NoSampling);this.clients.set(Fg.SampleRate.OnePercent,i),this.clients.set(Fg.SampleRate.TenPercent,a),this.clients.set(Fg.SampleRate.NoSampling,o)}reportBlocking(t,r,n,i,a=!1){if(!a||xir.TelemetrySettings.telemetryEnabled){let{client:o,event:s}=this.prepareClientAndEvent(t,r,n,i);return this.trackEventBlocking(o,s)}return Promise.resolve()}async report(t,r,n,i,a,o){if(o!==void 0&&!o||!xir.TelemetrySettings.telemetryEnabled)return;let{client:s,event:c}=this.prepareClientAndEvent(t,r,n,i);this.trackEvent(s,c)}prepareClientAndEvent(t,r,n,i=Fg.SampleRate.NoSampling){let a=this.clients.get(i),s={name:new Pfi.EventHeader(this.extensionName,t).toString(),properties:r,measurements:n};return{client:a,event:s}}async trackEventBlocking(t,r){if(process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true")return new Promise((n,i)=>{try{t.trackEvent(r),t.flush({callback:()=>n()})}catch(a){i(a)}})}trackEvent(t,r){return process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"?(t.trackEvent(r),!0):!1}createTelemetryClient(t){let r;switch(t){case Fg.SampleRate.OnePercent:r=1;break;case Fg.SampleRate.TenPercent:r=10;break;case Fg.SampleRate.NoSampling:default:r=100;break}let n=new wfi.TelemetryClient(this.applicationKey);return n.config.samplingPercentage=r,(0,Dfi.configAzureTelemetryClient)(n),n}};jg.ApplicationInsightClient=xje});var Tir=y(Jne=>{"use strict";Object.defineProperty(Jne,"__esModule",{value:!0});Jne.localDatetimeToUTC=void 0;var Nfi=()=>{let e=new Date().getTime();return new Date(e).toISOString()};Jne.localDatetimeToUTC=Nfi});var Air=y(Zne=>{"use strict";Object.defineProperty(Zne,"__esModule",{value:!0});Zne.ToolsSuiteTelemetryClient=void 0;var Ifi=Tje(),Oir=Qne(),Sir=Tir(),Oje=class extends Ifi.ApplicationInsightClient{constructor(t,r,n){super(t,r,n)}async report(t,r,n,i,a,o){let s=await(0,Oir.processToolsSuiteTelemetry)(a),c={v:this.extensionVersion,datetime:(0,Sir.localDatetimeToUTC)()},u={...r,...s,...c};await super.report(t,u,n,i,a,o)}async reportEvent(t,r,n,i){let{finalProperties:a,finalMeasurements:o}=await this.collectToolsSuiteTelemetry(t,n);return super.report(t.eventName,a,o,r,n,i)}async reportEventBlocking(t,r,n,i){let{finalProperties:a,finalMeasurements:o}=await this.collectToolsSuiteTelemetry(t,n);return super.reportBlocking(t.eventName,a,o,r,i)}async collectToolsSuiteTelemetry(t,r){let n=await(0,Oir.processToolsSuiteTelemetry)(r),i={v:this.extensionVersion,datetime:(0,Sir.localDatetimeToUTC)()},a={...t.properties,...n,...i},o={...t.measurements};return{finalProperties:a,finalMeasurements:o}}};Zne.ToolsSuiteTelemetryClient=Oje});var Rn=y(Xs=>{"use strict";var Sje=Symbol.for("yaml.alias"),Cir=Symbol.for("yaml.document"),eie=Symbol.for("yaml.map"),wir=Symbol.for("yaml.pair"),Aje=Symbol.for("yaml.scalar"),tie=Symbol.for("yaml.seq"),Ob=Symbol.for("yaml.node.type"),Rfi=e=>!!e&&typeof e=="object"&&e[Ob]===Sje,Lfi=e=>!!e&&typeof e=="object"&&e[Ob]===Cir,kfi=e=>!!e&&typeof e=="object"&&e[Ob]===eie,$fi=e=>!!e&&typeof e=="object"&&e[Ob]===wir,Pir=e=>!!e&&typeof e=="object"&&e[Ob]===Aje,Mfi=e=>!!e&&typeof e=="object"&&e[Ob]===tie;function Dir(e){if(e&&typeof e=="object")switch(e[Ob]){case eie:case tie:return!0}return!1}function Ffi(e){if(e&&typeof e=="object")switch(e[Ob]){case Sje:case eie:case Aje:case tie:return!0}return!1}var jfi=e=>(Pir(e)||Dir(e))&&!!e.anchor;Xs.ALIAS=Sje;Xs.DOC=Cir;Xs.MAP=eie;Xs.NODE_TYPE=Ob;Xs.PAIR=wir;Xs.SCALAR=Aje;Xs.SEQ=tie;Xs.hasAnchor=jfi;Xs.isAlias=Rfi;Xs.isCollection=Dir;Xs.isDocument=Lfi;Xs.isMap=kfi;Xs.isNode=Ffi;Xs.isPair=$fi;Xs.isScalar=Pir;Xs.isSeq=Mfi});var HU=y(Cje=>{"use strict";var zo=Rn(),Fl=Symbol("break visit"),Nir=Symbol("skip children"),qg=Symbol("remove node");function rie(e,t){let r=Iir(t);zo.isDocument(e)?aR(null,e.contents,r,Object.freeze([e]))===qg&&(e.contents=null):aR(null,e,r,Object.freeze([]))}rie.BREAK=Fl;rie.SKIP=Nir;rie.REMOVE=qg;function aR(e,t,r,n){let i=Rir(e,t,r,n);if(zo.isNode(i)||zo.isPair(i))return Lir(e,n,i),aR(e,i,r,n);if(typeof i!="symbol"){if(zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let a=0;a<t.items.length;++a){let o=aR(a,t.items[a],r,n);if(typeof o=="number")a=o-1;else{if(o===Fl)return Fl;o===qg&&(t.items.splice(a,1),a-=1)}}}else if(zo.isPair(t)){n=Object.freeze(n.concat(t));let a=aR("key",t.key,r,n);if(a===Fl)return Fl;a===qg&&(t.key=null);let o=aR("value",t.value,r,n);if(o===Fl)return Fl;o===qg&&(t.value=null)}}return i}async function nie(e,t){let r=Iir(t);zo.isDocument(e)?await oR(null,e.contents,r,Object.freeze([e]))===qg&&(e.contents=null):await oR(null,e,r,Object.freeze([]))}nie.BREAK=Fl;nie.SKIP=Nir;nie.REMOVE=qg;async function oR(e,t,r,n){let i=await Rir(e,t,r,n);if(zo.isNode(i)||zo.isPair(i))return Lir(e,n,i),oR(e,i,r,n);if(typeof i!="symbol"){if(zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let a=0;a<t.items.length;++a){let o=await oR(a,t.items[a],r,n);if(typeof o=="number")a=o-1;else{if(o===Fl)return Fl;o===qg&&(t.items.splice(a,1),a-=1)}}}else if(zo.isPair(t)){n=Object.freeze(n.concat(t));let a=await oR("key",t.key,r,n);if(a===Fl)return Fl;a===qg&&(t.key=null);let o=await oR("value",t.value,r,n);if(o===Fl)return Fl;o===qg&&(t.value=null)}}return i}function Iir(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Rir(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(zo.isMap(t))return r.Map?.(e,t,n);if(zo.isSeq(t))return r.Seq?.(e,t,n);if(zo.isPair(t))return r.Pair?.(e,t,n);if(zo.isScalar(t))return r.Scalar?.(e,t,n);if(zo.isAlias(t))return r.Alias?.(e,t,n)}function Lir(e,t,r){let n=t[t.length-1];if(zo.isCollection(n))n.items[e]=r;else if(zo.isPair(n))e==="key"?n.key=r:n.value=r;else if(zo.isDocument(n))n.contents=r;else{let i=zo.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Cje.visit=rie;Cje.visitAsync=nie});var wje=y($ir=>{"use strict";var kir=Rn(),qfi=HU(),Vfi={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ufi=e=>e.replace(/[!,[\]{}]/g,t=>Vfi[t]),GU=class e{constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,r)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[a,o]=n;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[a]=n;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return r(6,`Unsupported YAML version ${a}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=t.match(/^(.*!)([^!]*)$/);i||r(`The ${t} tag has no suffix`);let a=this.tags[n];if(a)try{return a+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+Ufi(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(t&&n.length>0&&kir.isNode(t.contents)){let a={};qfi.visit(t.contents,(o,s)=>{kir.isNode(s)&&s.tag&&(a[s.tag]=!0)}),i=Object.keys(a)}else i=[];for(let[a,o]of n)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(s=>s.startsWith(o)))&&r.push(`%TAG ${a} ${o}`);return r.join(`
1487
+ `)}),u.length>0&&(u=u.substring(0,u.length-1)),u.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];l=Buffer.from?Buffer.from(u):new Buffer(u),Tpi.gzip(l,function(d,h){var m=h;d?(p._logWarn(Ml.dumpObj(d)),m=l,a.headers["Content-Length"]=l.length.toString()):(a.headers["Content-Encoding"]="gzip",a.headers["Content-Length"]=h.length.toString()),p._logInfo(Ml.dumpObj(a)),a[Opi.disableCollectionRequestOption]=!0;var v=+new Date,_=function(T){T.setEncoding("utf-8");var S="";T.on("data",function(A){S+=A}),T.on("end",function(){var A,P=+new Date,k=P-v;if(p._numConsecutiveFailures=0,S.includes(Ppi)&&T.statusCode===400&&(oje.warn("Instrumentation key was invalid, please check the iKey"),(A=p._shutdownStatsbeat)===null||A===void 0||A.call(p)),p._isStatsbeatSender&&!p._statsbeatHasReachedIngestionAtLeastOnce&&(wpi.includes(T.statusCode)?p._statsbeatHasReachedIngestionAtLeastOnce=!0:p._statsbeatFailedToIngest()),p._statsbeat&&(T.statusCode==Cpi||T.statusCode==Api?p._statsbeat.countThrottle(q_.StatsbeatNetworkCategory.Breeze,i,T.statusCode):p._statsbeat.countRequest(q_.StatsbeatNetworkCategory.Breeze,i,k,T.statusCode===200,T.statusCode)),p._enableDiskRetryMode){if(T.statusCode===200)p._resendTimer||(p._resendTimer=setTimeout(function(){p._resendTimer=null,p._sendFirstFileOnDisk()},p._resendInterval),p._resendTimer.unref());else if(p._isRetriable(T.statusCode))try{p._statsbeat&&p._statsbeat.countRetry(q_.StatsbeatNetworkCategory.Breeze,i,T.statusCode);var D=JSON.parse(S),F=[];D.errors&&(D.errors.forEach(function(H){(H.statusCode==429||H.statusCode==500||H.statusCode==503)&&F.push(t[H.index])}),F.length>0&&p._storeToDisk(F))}catch{p._storeToDisk(t)}}if(T.statusCode===307||T.statusCode===308)if(p._numConsecutiveRedirects++,p._numConsecutiveRedirects<10){var K=T.headers.location?T.headers.location.toString():null;K&&(p._redirectedHost=K,p.send(t,r))}else{var $={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};p._statsbeat&&p._statsbeat.countException(q_.StatsbeatNetworkCategory.Breeze,i,$),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else p._numConsecutiveRedirects=0,typeof r=="function"&&r(S),p._logInfo(S),typeof p._onSuccess=="function"&&p._onSuccess(S)})},O=Ml.makeRequest(p._config,n,a,_);O.setTimeout(e.HTTP_TIMEOUT,function(){p._requestTimedOut=!0,O.abort()}),O.on("error",function(T){if(p._isStatsbeatSender&&!p._statsbeatHasReachedIngestionAtLeastOnce&&p._statsbeatFailedToIngest(),p._numConsecutiveFailures++,p._statsbeat&&p._statsbeat.countException(q_.StatsbeatNetworkCategory.Breeze,i,T),!p._enableDiskRetryMode||p._numConsecutiveFailures>0&&p._numConsecutiveFailures%e.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var S="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";p._enableDiskRetryMode&&(S="Ingestion endpoint could not be reached ".concat(p._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),p._logWarn(S,Ml.dumpObj(T))}else{var S="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";p._logInfo(S,Ml.dumpObj(T))}p._onErrorHelper(T),typeof r=="function"&&(T?(p._requestTimedOut&&(T.name="telemetry timeout",T.message="telemetry request timed out"),r(Ml.dumpObj(T))):r("Error sending telemetry")),p._enableDiskRetryMode&&p._storeToDisk(t)}),O.write(m),O.end()}),f.label=5;case 5:return[2]}})})},e.prototype.saveOnCrash=function(t){this._enableDiskRetryMode&&this._storeToDiskSync(Ml.stringify(t))},e.prototype._isRetriable=function(t){return t===206||t===401||t===403||t===408||t===429||t===500||t===502||t===503||t===504},e.prototype._logInfo=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._isStatsbeatSender||oje.info(e.TAG,t,r)},e.prototype._logWarn=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._isStatsbeatSender||oje.warn(e.TAG,t,r)},e.prototype._statsbeatFailedToIngest=function(){this._shutdownStatsbeat&&(this._failedToIngestCounter++,this._failedToIngestCounter>=3&&this._shutdownStatsbeat())},e.prototype._storeToDisk=function(t){return qne(this,void 0,void 0,function(){var r,n,i,a,o,s,c;return Vne(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,xb.confirmDirExists(this._tempDir)];case 1:return u.sent(),[3,3];case 2:return r=u.sent(),this._logWarn("Failed to create folder to put telemetry: "+Ml.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return u.trys.push([3,5,,6]),[4,LU.FileAccessControl.applyACLRules(this._tempDir)];case 4:return u.sent(),[3,6];case 5:return n=u.sent(),this._logWarn("Failed to apply file access control to folder: "+Ml.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return u.trys.push([6,8,,9]),[4,xb.getShallowDirectorySize(this._tempDir)];case 7:return i=u.sent(),i>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+i),[2]):[3,9];case 8:return a=u.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+Ml.dumpObj(a)),this._onErrorHelper(a),[2];case 9:return u.trys.push([9,11,,12]),o="".concat(new Date().getTime(),".ai.json"),s=mS.join(this._tempDir,o),this._logInfo("saving data to disk at: "+s),[4,xb.writeFileAsync(s,Ml.stringify(t),{mode:384})];case 10:return u.sent(),[3,12];case 11:return c=u.sent(),this._logWarn("Failed to persist telemetry to disk: "+Ml.dumpObj(c)),this._onErrorHelper(c),[2];case 12:return[2]}})})},e.prototype._storeToDiskSync=function(t){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),aje.existsSync(this._tempDir)||aje.mkdirSync(this._tempDir),LU.FileAccessControl.applyACLRulesSync(this._tempDir);var r=xb.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),i=mS.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+i),aje.writeFileSync(i,t,{mode:384})}catch(a){this._logWarn("Error while saving data to disk: "+Ml.dumpObj(a)),this._onErrorHelper(a)}},e.prototype._sendFirstFileOnDisk=function(){return qne(this,void 0,void 0,function(){var t,r,n,i,a,o;return Vne(this,function(s){switch(s.label){case 0:return s.trys.push([0,6,,7]),[4,xb.readdirAsync(this._tempDir)];case 1:return t=s.sent(),t=t.filter(function(c){return mS.basename(c).indexOf(".ai.json")>-1}),t.length>0?(r=t[0],n=mS.join(this._tempDir,r),[4,xb.readFileAsync(n)]):[3,5];case 2:return i=s.sent(),[4,xb.unlinkAsync(n)];case 3:return s.sent(),a=JSON.parse(i.toString()),[4,this.send(a)];case 4:s.sent(),s.label=5;case 5:return[3,7];case 6:return o=s.sent(),this._onErrorHelper(o),[3,7];case 7:return[2]}})})},e.prototype._onErrorHelper=function(t){typeof this._onError=="function"&&this._onError(t)},e.prototype._fileCleanupTask=function(){return qne(this,void 0,void 0,function(){var t,r,n,i,a,o,s=this;return Vne(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),[4,xb.readdirAsync(this._tempDir)];case 1:if(t=c.sent(),t=t.filter(function(u){return mS.basename(u).indexOf(".ai.json")>-1}),!(t.length>0))return[3,5];r=0,c.label=2;case 2:return r<t.length?(n=new Date(parseInt(t[r].split(".ai.json")[0])),i=new Date(+new Date-e.FILE_RETEMPTION_PERIOD)>n,i?(a=mS.join(this._tempDir,t[r]),[4,xb.unlinkAsync(a).catch(function(u){s._onErrorHelper(u)})]):[3,4]):[3,5];case 3:c.sent(),c.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return o=c.sent(),o.code!="ENOENT"&&this._onErrorHelper(o),[3,7];case 7:return[2]}})})},e.TAG="Sender",e.WAIT_BETWEEN_RESEND=60*1e3,e.MAX_BYTES_ON_DISK=50*1024*1024,e.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,e.CLEANUP_TIMEOUT=60*60*1e3,e.FILE_RETEMPTION_PERIOD=7*24*60*60*1e3,e.TEMPDIR_PREFIX="appInsights-node",e.HTTP_TIMEOUT=2e4,e}();Qnr.exports=Dpi});var tir=y(Une=>{"use strict";Object.defineProperty(Une,"__esModule",{value:!0});Une.AzureVirtualMachine=void 0;var eir=hi(),Npi=Hs(),Ipi=NI(),Rpi="http://169.254.169.254/metadata/instance/compute",Lpi="api-version=2017-12-01",kpi="format=json",$pi="UNREACH",Mpi=function(){function e(){}return e.getAzureComputeMetadata=function(t,r){var n,i=this,a={},o="".concat(Rpi,"?").concat(Lpi,"&").concat(kpi),s=(n={method:"GET"},n[Ipi.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),c=Npi.makeRequest(t,o,s,function(u){if(u.statusCode===200){a.isVM=!0;var l="";u.on("data",function(p){l+=p}),u.on("end",function(){try{var p=JSON.parse(l);a.id=p.vmId||"",a.subscriptionId=p.subscriptionId||"",a.osType=p.osType||""}catch(f){eir.info(e.TAG,f)}r(a)})}else r(a)},!1,!1);c&&(setTimeout(function(){i._requestTimedOut=!0,c.abort()},e.HTTP_TIMEOUT),c.on("error",function(u){i._requestTimedOut&&u&&(u.name="telemetry timeout",u.message="telemetry request timed out"),u&&u.message&&u.message.indexOf($pi)>-1?a.isVM=!1:eir.info(e.TAG,u),r(a)}),c.end())},e.HTTP_TIMEOUT=2500,e.TAG="AzureVirtualMachine",e}();Une.AzureVirtualMachine=Mpi});var rir=y(Bne=>{"use strict";Object.defineProperty(Bne,"__esModule",{value:!0});Bne.NetworkStatsbeat=void 0;var Fpi=function(){function e(t,r){this.endpoint=t,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return e}();Bne.NetworkStatsbeat=Fpi});var sir=y((gS,oir)=>{"use strict";var Mg=gS&&gS.__assign||function(){return Mg=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Mg.apply(this,arguments)},cje=gS&&gS.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(e,t||[])).next())})},uje=gS&&gS.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},jpi=require("os"),qpi=ije(),nir=hi(),Vpi=sje(),Yi=Gi(),Upi=Bc(),Bpi=tir(),zpi=UMe(),iir=OI(),Hpi=rir(),air=Hs(),Gpi="node",Kpi=function(){function e(t,r){this._attach=Yi.StatsbeatAttach.sdk,this._feature=Yi.StatsbeatFeature.NONE,this._instrumentation=Yi.StatsbeatInstrumentation.NONE,this._isInitialized=!1,this._statbeatMetrics=[],this._networkStatsbeatCollection=[],this._config=t,this._context=r||new iir,this._longHandleTimeout=null;var n=this._getConnectionString(t);this._statsbeatConfig=new zpi(n),this._statsbeatConfig.samplingPercentage=100,this._sender=new Vpi(this._statsbeatConfig,null,null,null,null,!0,this._shutdownStatsbeat.bind(this))}return e.prototype.enable=function(t){var r=this;this._isEnabled=t,this._isEnabled&&!this._isInitialized&&(this._getCustomProperties(),this._isInitialized=!0),t?(this._handle||(this._handle=setInterval(function(){r.trackShortIntervalStatsbeats()},e.STATS_COLLECTION_SHORT_INTERVAL),this._handle.unref()),this._longHandle||(this._longHandleTimeout=setTimeout(function(){r.isEnabled()&&r.trackLongIntervalStatsbeats()},e.STATS_COLLECTION_INITIAL_DELAY),this._longHandleTimeout.unref(),this._longHandle=setInterval(function(){r.trackLongIntervalStatsbeats()},e.STATS_COLLECTION_LONG_INTERVAL),this._longHandle.unref())):(this._handle&&(clearInterval(this._handle),this._handle=null),this._longHandle&&(clearInterval(this._longHandle),this._longHandle=null),this._longHandleTimeout&&(clearTimeout(this._longHandleTimeout),this._longHandleTimeout=null))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.isEnabled=function(){return this._isEnabled},e.prototype.setCodelessAttach=function(){this._attach=Yi.StatsbeatAttach.codeless},e.prototype.addFeature=function(t){this._feature|=t},e.prototype.removeFeature=function(t){this._feature&=~t},e.prototype.addInstrumentation=function(t){this._instrumentation|=t},e.prototype.removeInstrumentation=function(t){this._instrumentation&=~t},e.prototype.countRequest=function(t,r,n,i,a){if(this.isEnabled()){var o=this._getNetworkStatsbeatCounter(t,r);if(o.totalRequestCount++,o.intervalRequestExecutionTime+=n,i===!1){if(!a)return;var s=o.totalFailedRequestCount.find(function(c){return a===c.statusCode});s?s.count++:o.totalFailedRequestCount.push({statusCode:a,count:1})}else o.totalSuccesfulRequestCount++}},e.prototype.countException=function(t,r,n){if(this.isEnabled()){var i=this._getNetworkStatsbeatCounter(t,r),a=i.exceptionCount.find(function(o){return n.name===o.exceptionType});a?a.count++:i.exceptionCount.push({exceptionType:n.name,count:1})}},e.prototype.countThrottle=function(t,r,n){if(this.isEnabled()){var i=this._getNetworkStatsbeatCounter(t,r),a=i.throttleCount.find(function(o){return n===o.statusCode});a?a.count++:i.throttleCount.push({statusCode:n,count:1})}},e.prototype.countRetry=function(t,r,n){if(this.isEnabled()){var i=this._getNetworkStatsbeatCounter(t,r),a=i.retryCount.find(function(o){return n===o.statusCode});a?a.count++:i.retryCount.push({statusCode:n,count:1})}},e.prototype.trackShortIntervalStatsbeats=function(){return cje(this,void 0,void 0,function(){var t,r;return uje(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,this._getResourceProvider()];case 1:return n.sent(),t={os:this._os,rp:this._resourceProvider,cikey:this._cikey,runtimeVersion:this._runtimeVersion,language:this._language,version:this._sdkVersion,attach:this._attach},this._trackRequestDuration(t),this._trackRequestsCount(t),[4,this._sendStatsbeats()];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),nir.info(e.TAG,"Failed to send Statsbeat metrics: "+air.dumpObj(r)),[3,4];case 4:return[2]}})})},e.prototype.trackLongIntervalStatsbeats=function(){return cje(this,void 0,void 0,function(){var t,r,n,i,a;return uje(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._getResourceProvider()];case 1:return o.sent(),t={os:this._os,rp:this._resourceProvider,cikey:this._cikey,runtimeVersion:this._runtimeVersion,language:this._language,version:this._sdkVersion,attach:this._attach},r=Object.assign({rpId:this._resourceIdentifier},t),this._statbeatMetrics.push({name:Yi.StatsbeatCounter.ATTACH,value:1,properties:r}),this._instrumentation!=Yi.StatsbeatInstrumentation.NONE&&(n=Object.assign({feature:this._instrumentation,type:Yi.StatsbeatFeatureType.Instrumentation},t),this._statbeatMetrics.push({name:Yi.StatsbeatCounter.FEATURE,value:1,properties:n})),this._feature!=Yi.StatsbeatFeature.NONE&&(i=Object.assign({feature:this._feature,type:Yi.StatsbeatFeatureType.Feature},t),this._statbeatMetrics.push({name:Yi.StatsbeatCounter.FEATURE,value:1,properties:i})),[4,this._sendStatsbeats()];case 2:return o.sent(),[3,4];case 3:return a=o.sent(),nir.info(e.TAG,"Failed to send Statsbeat metrics: "+air.dumpObj(a)),[3,4];case 4:return[2]}})})},e.prototype._getNetworkStatsbeatCounter=function(t,r){for(var n=this._getShortHost(r),i=0;i<this._networkStatsbeatCollection.length;i++)if(t===this._networkStatsbeatCollection[i].endpoint&&n===this._networkStatsbeatCollection[i].host)return this._networkStatsbeatCollection[i];var a=new Hpi.NetworkStatsbeat(t,n);return this._networkStatsbeatCollection.push(a),a},e.prototype._trackRequestDuration=function(t){for(var r=0;r<this._networkStatsbeatCollection.length;r++){var n=this._networkStatsbeatCollection[r];n.time=+new Date;var i=n.totalRequestCount-n.lastRequestCount||0,a=n.intervalRequestExecutionTime-n.lastIntervalRequestExecutionTime,o=a>0&&a/i||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,i>0){var s=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},t);this._statbeatMetrics.push({name:Yi.StatsbeatCounter.REQUEST_DURATION,value:o,properties:s})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},e.prototype._getShortHost=function(t){var r=t;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),i=n.exec(t);i!=null&&i.length>1&&(r=i[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},e.prototype._trackRequestsCount=function(t){for(var r=this,n=function(s){a=i._networkStatsbeatCollection[s];var c=Object.assign({endpoint:a.endpoint,host:a.host},t);a.totalSuccesfulRequestCount>0&&(i._statbeatMetrics.push({name:Yi.StatsbeatCounter.REQUEST_SUCCESS,value:a.totalSuccesfulRequestCount,properties:c}),a.totalSuccesfulRequestCount=0),a.totalFailedRequestCount.length>0&&(a.totalFailedRequestCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{statusCode:u.statusCode})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.REQUEST_FAILURE,value:u.count,properties:c})}),a.totalFailedRequestCount=[]),a.retryCount.length>0&&(a.retryCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{statusCode:u.statusCode})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.RETRY_COUNT,value:u.count,properties:c})}),a.retryCount=[]),a.throttleCount.length>0&&(a.throttleCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{statusCode:u.statusCode})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.THROTTLE_COUNT,value:u.count,properties:c})}),a.throttleCount=[]),a.exceptionCount.length>0&&(a.exceptionCount.forEach(function(u){c=Object.assign(Mg(Mg({},c),{exceptionType:u.exceptionType})),r._statbeatMetrics.push({name:Yi.StatsbeatCounter.EXCEPTION_COUNT,value:u.count,properties:c})}),a.exceptionCount=[])},i=this,a,o=0;o<this._networkStatsbeatCollection.length;o++)n(o)},e.prototype._sendStatsbeats=function(){return cje(this,void 0,void 0,function(){var t,r,n,i;return uje(this,function(a){switch(a.label){case 0:if(!(this._statbeatMetrics.length>0))return[3,2];for(t=[],r=0;r<this._statbeatMetrics.length;r++)n={name:this._statbeatMetrics[r].name,value:this._statbeatMetrics[r].value,properties:this._statbeatMetrics[r].properties},i=qpi.createEnvelope(n,Upi.TelemetryType.Metric,null,this._context,this._statsbeatConfig),i.name=Yi.StatsbeatTelemetryName,t.push(i);return this._statbeatMetrics=[],[4,this._sender.send(t)];case 1:a.sent(),a.label=2;case 2:return[2]}})})},e.prototype._getCustomProperties=function(){this._language=Gpi,this._cikey=this._config.instrumentationKey,this._sdkVersion=iir.sdkVersion,this._os=jpi.type(),this._runtimeVersion=process.version},e.prototype._getResourceProvider=function(){var t=this;return new Promise(function(r,n){var i=!1;t._resourceProvider=Yi.StatsbeatResourceProvider.unknown,t._resourceIdentifier=Yi.StatsbeatResourceProvider.unknown,process.env.AKS_ARM_NAMESPACE_ID?(t._resourceProvider=Yi.StatsbeatResourceProvider.aks,t._resourceIdentifier=process.env.AKS_ARM_NAMESPACE_ID):process.env.WEBSITE_SITE_NAME?(t._resourceProvider=Yi.StatsbeatResourceProvider.appsvc,t._resourceIdentifier=process.env.WEBSITE_SITE_NAME,process.env.WEBSITE_HOME_STAMPNAME&&(t._resourceIdentifier+="/"+process.env.WEBSITE_HOME_STAMPNAME)):process.env.FUNCTIONS_WORKER_RUNTIME?(t._resourceProvider=Yi.StatsbeatResourceProvider.functions,process.env.WEBSITE_HOSTNAME&&(t._resourceIdentifier=process.env.WEBSITE_HOSTNAME)):t._config&&(t._isVM===void 0||t._isVM==!0?(i=!0,Bpi.AzureVirtualMachine.getAzureComputeMetadata(t._config,function(a){t._isVM=a.isVM,t._isVM&&(t._resourceProvider=Yi.StatsbeatResourceProvider.vm,t._resourceIdentifier=a.id+"/"+a.subscriptionId,a.osType&&(t._os=a.osType)),r()})):t._resourceProvider=Yi.StatsbeatResourceProvider.unknown),i||r()})},e.prototype._shutdownStatsbeat=function(){this.enable(!1)},e.prototype._getConnectionString=function(t){for(var r=t.endpointUrl,n=["westeurope","northeurope","francecentral","francesouth","germanywestcentral","norwayeast","norwaywest","swedencentral","switzerlandnorth","switzerlandwest","uksouth","ukwest"],i=0;i<n.length;i++)if(r.indexOf(n[i])>-1)return e.EU_CONNECTION_STRING;return e.NON_EU_CONNECTION_STRING},e.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",e.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",e.STATS_COLLECTION_SHORT_INTERVAL=9e5,e.STATS_COLLECTION_LONG_INTERVAL=864e5,e.STATS_COLLECTION_INITIAL_DELAY=15e3,e.TAG="Statsbeat",e}();oir.exports=Kpi});var lir=y((rpa,uir)=>{"use strict";var Ypi=require("url"),Wpi=UMe(),Xpi=jnr(),Jpi=OI(),Tb=Bc(),Zpi=Vnr(),lje=Ynr(),cir=P_(),Qpi=sir(),efi=sje(),pje=Hs(),zne=hi(),tfi=ije(),rfi=function(){function e(t){this._telemetryProcessors=[];var r=new Wpi(t);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new Jpi,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new Qpi(this.config,this.context),this._statsbeat.enable(!0));var n=new efi(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new Zpi(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return e.prototype.trackAvailability=function(t){this.track(t,Tb.TelemetryType.Availability)},e.prototype.trackPageView=function(t){this.track(t,Tb.TelemetryType.PageView)},e.prototype.trackTrace=function(t){this.track(t,Tb.TelemetryType.Trace)},e.prototype.trackMetric=function(t){this.track(t,Tb.TelemetryType.Metric)},e.prototype.trackException=function(t){t&&t.exception&&!pje.isError(t.exception)&&(t.exception=new Error(t.exception.toString())),this.track(t,Tb.TelemetryType.Exception)},e.prototype.trackEvent=function(t){this.track(t,Tb.TelemetryType.Event)},e.prototype.trackRequest=function(t){this.track(t,Tb.TelemetryType.Request)},e.prototype.trackDependency=function(t){if(t&&!t.target&&t.data)try{t.target=new Ypi.URL(t.data).host}catch(r){t.target=null,zne.warn(e.TAG,"The URL object is failed to create.",r)}this.track(t,Tb.TelemetryType.Dependency)},e.prototype.flush=function(t){this.channel.triggerSend(t?!!t.isAppCrashing:!1,t?t.callback:void 0)},e.prototype.track=function(t,r){if(t&&Tb.telemetryTypeToBaseType(r)){var n=tfi.createEnvelope(t,r,this.commonProperties,this.context,this.config);t.time&&(n.time=t.time.toISOString());var i=this.runTelemetryProcessors(n,t.contextObjects);i=i&&lje.samplingTelemetryProcessor(n,{correlationContext:cir.CorrelationContextManager.getCurrentContext()}),lje.preAggregatedMetricsTelemetryProcessor(n,this.context),i&&(lje.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else zne.warn(e.TAG,"track() requires telemetry object and telemetryType to be specified.")},e.prototype.setAutoPopulateAzureProperties=function(t){},e.prototype.getAuthorizationHandler=function(t){return t&&t.aadTokenCredential?(this.authorizationHandler||(zne.info(e.TAG,"Adding authorization handler"),this.authorizationHandler=new Xpi(t.aadTokenCredential,t.aadAudience)),this.authorizationHandler):null},e.prototype.addTelemetryProcessor=function(t){this._telemetryProcessors.push(t)},e.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},e.prototype.runTelemetryProcessors=function(t,r){var n=!0,i=this._telemetryProcessors.length;if(i===0)return n;r=r||{},r.correlationContext=cir.CorrelationContextManager.getCurrentContext();for(var a=0;a<i;++a)try{var o=this._telemetryProcessors[a];if(o&&o.apply(null,[t,r])===!1){n=!1;break}}catch(s){n=!0,zne.warn(e.TAG,"One of telemetry processors failed, telemetry item will be sent.",s,t)}return n&&(t&&t.tags&&(t.tags=pje.validateStringMap(t.tags)),t&&t.data&&t.data.baseData&&t.data.baseData.properties&&(t.data.baseData.properties=pje.validateStringMap(t.data.baseData.properties))),n},e.prototype.getStatsbeat=function(){return this._statsbeat},e.TAG="TelemetryClient",e}();uir.exports=rfi});var dir=y((fje,fir)=>{"use strict";var nfi=fje&&fje.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ifi=lir(),pir=kMe(),afi=NI(),Hne=hi(),ofi=function(e){nfi(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?pir.trackRequestSync(this,r):Hne.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},t.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&Hne.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?pir.trackRequest(this,r):Hne.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},t.prototype.trackNodeHttpDependency=function(r){r&&r.request?afi.trackRequest(this,r):Hne.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},t}(ifi);fir.exports=ofi});var mir=y(hir=>{"use strict";Object.defineProperty(hir,"__esModule",{value:!0})});var vje=y(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.Configuration=pe.liveMetricsClient=pe.defaultClient=pe.DistributedTracingModes=void 0;pe.setup=mfi;pe.start=vir;pe.getCorrelationContext=yfi;pe.startOperation=vfi;pe.wrapWithCorrelationContext=bfi;pe.dispose=Efi;var hje=P_(),sfi=uer(),cfi=per(),mje=Vre(),ufi=_Me(),lfi=_er(),pfi=Ier(),ffi=NI(),dfi=kMe(),gir=H1(),$U=hi(),yir=ftr(),gje=htr(),hfi=ytr();pe.TelemetryClient=dir();pe.Contracts=Bc();pe.azureFunctionsTypes=mir();var dje;(function(e){e[e.AI=0]="AI",e[e.AI_AND_W3C=1]="AI_AND_W3C"})(dje||(pe.DistributedTracingModes=dje={}));var MU,FU,jU,qU,VU,rR,nR,yS,UU,BU,Mp=!1,Gne;function mfi(e){return pe.defaultClient?$U.info("The default client is already setup"):(pe.defaultClient=new pe.TelemetryClient(e),MU=new sfi(pe.defaultClient),FU=new cfi(pe.defaultClient),jU=new mje(pe.defaultClient),qU=new ufi(pe.defaultClient),VU=new lfi(pe.defaultClient),rR=new pfi(pe.defaultClient),yS=new dfi(pe.defaultClient),UU=new ffi(pe.defaultClient),nR||(nR=new gje.AutoCollectNativePerformance(pe.defaultClient)),BU=new hfi.AzureFunctionsHook(pe.defaultClient)),yje}function gfi(){pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectExternalLoggers==null&&(pe.defaultClient.config.enableAutoCollectExternalLoggers=!0),pe.defaultClient.config.enableAutoCollectConsole==null&&(pe.defaultClient.config.enableAutoCollectConsole=!1),pe.defaultClient.config.enableAutoCollectExceptions==null&&(pe.defaultClient.config.enableAutoCollectExceptions=!0),pe.defaultClient.config.enableAutoCollectPerformance==null&&(pe.defaultClient.config.enableAutoCollectPerformance=!0),pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),pe.defaultClient.config.enableAutoCollectHeartbeat==null&&(pe.defaultClient.config.enableAutoCollectHeartbeat=!0),pe.defaultClient.config.enableAutoCollectRequests==null&&(pe.defaultClient.config.enableAutoCollectRequests=!0),pe.defaultClient.config.enableAutoCollectDependencies==null&&(pe.defaultClient.config.enableAutoCollectDependencies=!0),pe.defaultClient.config.enableUseDiskRetryCaching==null&&(pe.defaultClient.config.enableUseDiskRetryCaching=!0),pe.defaultClient.config.enableAutoDependencyCorrelation==null&&(pe.defaultClient.config.enableAutoDependencyCorrelation=!0),pe.defaultClient.config.enableSendLiveMetrics==null&&(pe.defaultClient.config.enableSendLiveMetrics=!1),pe.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(pe.defaultClient.config.enableAutoCollectExtendedMetrics=!0),pe.defaultClient.config.enableWebInstrumentation==null&&(pe.defaultClient.config.enableWebInstrumentation=!1),pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}function vir(){if(pe.defaultClient){Mp=!0,gfi(),MU.enable(pe.defaultClient.config.enableAutoCollectExternalLoggers,pe.defaultClient.config.enableAutoCollectConsole),FU.enable(pe.defaultClient.config.enableAutoCollectExceptions),jU.enable(pe.defaultClient.config.enableAutoCollectPerformance),qU.enable(pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics),VU.enable(pe.defaultClient.config.enableAutoCollectHeartbeat),yS.useAutoCorrelation(pe.defaultClient.config.enableAutoDependencyCorrelation,pe.defaultClient.config.enableUseAsyncHooks),yS.enable(pe.defaultClient.config.enableAutoCollectRequests),UU.enable(pe.defaultClient.config.enableAutoCollectDependencies),rR.enable(pe.defaultClient.config.enableWebInstrumentation,pe.defaultClient.config.webInstrumentationConnectionString),pe.defaultClient.config.enableSendLiveMetrics&&(pe.liveMetricsClient||(pe.liveMetricsClient=new yir(pe.defaultClient.config,pe.defaultClient.context,pe.defaultClient.getAuthorizationHandler,pe.defaultClient),Gne=new mje(pe.liveMetricsClient,1e3,!0),pe.liveMetricsClient.addCollector(Gne),pe.defaultClient.quickPulseClient=pe.liveMetricsClient),pe.liveMetricsClient.enable(pe.defaultClient.config.enableSendLiveMetrics)),BU.enable(pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var e=gje.AutoCollectNativePerformance.parseEnabled(pe.defaultClient.config.enableAutoCollectExtendedMetrics,pe.defaultClient.config);nR.enable(pe.defaultClient.config.enableAutoCollectExtendedMetrics,e.disabledMetrics),pe.defaultClient&&pe.defaultClient.channel&&pe.defaultClient.channel.setUseDiskRetryCaching(pe.defaultClient.config.enableUseDiskRetryCaching,pe.defaultClient.config.enableResendInterval,pe.defaultClient.config.enableMaxBytesOnDisk)}else $U.warn("Start cannot be called before setup");return yje}function yfi(){return hje.CorrelationContextManager.getCurrentContext()}function vfi(e,t){return hje.CorrelationContextManager.startOperation(e,t)}function bfi(e,t){return hje.CorrelationContextManager.wrapCallback(e,t)}var yje=function(){function e(){}return e.setDistributedTracingMode=function(t){return gir.w3cEnabled=t===dje.AI_AND_W3C,e},e.setAutoCollectConsole=function(t,r){return r===void 0&&(r=!1),pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectExternalLoggers=t,pe.defaultClient.config.enableAutoCollectConsole=r,Mp&&MU.enable(t,r)),e},e.setAutoCollectExceptions=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectExceptions=t,Mp&&FU.enable(t)),e},e.setAutoCollectPerformance=function(t,r){if(r===void 0&&(r=!0),pe.defaultClient){pe.defaultClient.config.enableAutoCollectPerformance=t;var n=gje.AutoCollectNativePerformance.parseEnabled(r,pe.defaultClient.config);pe.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,Mp&&(jU.enable(t),nR.enable(pe.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return e},e.setAutoCollectPreAggregatedMetrics=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectPreAggregatedMetrics=t,Mp&&qU.enable(t)),e},e.setAutoCollectHeartbeat=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectHeartbeat=t,Mp&&VU.enable(t)),e},e.enableAutoWebSnippetInjection=function(t,r){return pe.defaultClient&&(pe.defaultClient.config.enableWebInstrumentation=t,pe.defaultClient.config.webInstrumentationConnectionString=r,Mp&&rR.enable(pe.defaultClient.config.enableAutoWebSnippetInjection,pe.defaultClient.config.webSnippetConnectionString)),e},e.enableWebInstrumentation=function(t,r){return pe.defaultClient&&(pe.defaultClient.config.enableWebInstrumentation=t,pe.defaultClient.config.webInstrumentationConnectionString=r,Mp&&rR.enable(pe.defaultClient.config.enableWebInstrumentation,pe.defaultClient.config.webInstrumentationConnectionString)),e},e.setAutoCollectRequests=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectRequests=t,Mp&&yS.enable(t)),e},e.setAutoCollectDependencies=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectDependencies=t,Mp&&UU.enable(t)),e},e.setAutoDependencyCorrelation=function(t,r){return pe.defaultClient&&(pe.defaultClient.config.enableAutoDependencyCorrelation=t,pe.defaultClient.config.enableUseAsyncHooks=r,Mp&&yS.useAutoCorrelation(t,r)),e},e.setUseDiskRetryCaching=function(t,r,n){return pe.defaultClient&&(pe.defaultClient.config.enableUseDiskRetryCaching=t,pe.defaultClient.config.enableResendInterval=r,pe.defaultClient.config.enableMaxBytesOnDisk=n,pe.defaultClient.channel&&pe.defaultClient.channel.setUseDiskRetryCaching(pe.defaultClient.config.enableUseDiskRetryCaching,pe.defaultClient.config.enableResendInterval,pe.defaultClient.config.enableMaxBytesOnDisk)),e},e.setInternalLogging=function(t,r){return t===void 0&&(t=!1),r===void 0&&(r=!0),$U.enableDebug=t,$U.disableWarnings=!r,e},e.setAutoCollectIncomingRequestAzureFunctions=function(t){return pe.defaultClient&&(pe.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=t,Mp&&BU.enable(t)),e},e.setSendLiveMetrics=function(t){return t===void 0&&(t=!1),pe.defaultClient?(!pe.liveMetricsClient&&t?(pe.liveMetricsClient=new yir(pe.defaultClient.config,pe.defaultClient.context,pe.defaultClient.getAuthorizationHandler,pe.defaultClient),Gne=new mje(pe.liveMetricsClient,1e3,!0),pe.liveMetricsClient.addCollector(Gne),pe.defaultClient.quickPulseClient=pe.liveMetricsClient):pe.liveMetricsClient&&pe.liveMetricsClient.enable(t),pe.defaultClient.config.enableSendLiveMetrics=t,e):($U.warn("Live metrics client cannot be setup without the default client"),e)},e.start=vir,e}();pe.Configuration=yje;function Efi(){gir.w3cEnabled=!0,pe.defaultClient=null,Mp=!1,MU&&MU.dispose(),FU&&FU.dispose(),jU&&jU.dispose(),qU&&qU.dispose(),VU&&VU.dispose(),rR&&rR.dispose(),nR&&nR.dispose(),yS&&yS.dispose(),UU&&UU.dispose(),pe.liveMetricsClient&&(pe.liveMetricsClient.enable(!1),pe.liveMetricsClient=void 0),BU&&BU.dispose()}});var Yne=y(Kne=>{"use strict";Object.defineProperty(Kne,"__esModule",{value:!0});Kne.EventHeader=void 0;var bje=class{extensionName;eventName;constructor(t,r){this.extensionName=t,this.eventName=r}getExtensionName(){return this.extensionName}getEventName(){return this.eventName}toString(){return`${this.extensionName}/${this.eventName}`}};Kne.EventHeader=bje});var Xne=y(Wne=>{"use strict";Object.defineProperty(Wne,"__esModule",{value:!0});Wne.SampleRate=void 0;var bir;(function(e){e[e.OnePercent=0]="OnePercent",e[e.TenPercent=1]="TenPercent",e[e.NoSampling=2]="NoSampling"})(bir||(Wne.SampleRate=bir={}))});var _je=y(Eje=>{"use strict";Object.defineProperty(Eje,"__esModule",{value:!0});Eje.configAzureTelemetryClient=_fi;function _fi(e){e.channel.setUseDiskRetryCaching(!0),e.addTelemetryProcessor(t=>(t.tags["ai.location.ip"]="0.0.0.0",t.tags["ai.cloud.roleInstance"]="masked",t.tags["ai.cloud.role"]="masked",t.tags["ai.device.type"]="masked",!0))}});var Eir=y((cpa,xfi)=>{xfi.exports={name:"@sap-ux/telemetry",version:"0.6.48",description:"Library for sending usage telemetry data",repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/telemetry"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Atelemetry"},license:"Apache-2.0",private:!1,main:"dist/index.js",scripts:{build:"tsc --build",watch:"tsc --watch",clean:"rimraf --glob dist coverage *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint","lint:fix":"eslint --fix",test:"jest --ci --forceExit --detectOpenHandles --colors","test-u":"jest --ci --forceExit --detectOpenHandles --colors -u",link:"pnpm link --global",unlink:"pnpm unlink --global",example:"ts-node example/index.ts"},dependencies:{"@sap-ux/store":"workspace:*","@sap-ux/project-access":"workspace:*","@sap-ux/btp-utils":"workspace:*","@sap-ux/ui5-config":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/nodejs-utils":"workspace:*",applicationinsights:"2.9.8",axios:"1.12.2","performance-now":"2.1.0",yaml:"2.3.3"},devDependencies:{"jest-extended":"6.0.0",memfs:"3.4.13",unionfs:"4.4.0",dotenv:"16.3.1"},files:["dist","LICENSE","!dist/*.map","!dist/**/*.map"],engines:{node:">=20.x"}}});var zU=y(iR=>{"use strict";var Tfi=iR&&iR.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(iR,"__esModule",{value:!0});iR.TelemetrySettings=void 0;var _ir=Tfi(Eir());iR.TelemetrySettings={azureInstrumentationKey:"",telemetryEnabled:!0,telemetryLibName:_ir.default.name,telemetryLibVersion:_ir.default.version,consumerModuleName:"",consumerModuleVersion:""}});var Tje=y(jg=>{"use strict";var Ofi=jg&&jg.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Sfi=jg&&jg.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Afi=jg&&jg.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Ofi(r,t,n[i]);return Sfi(r,t),r}}();Object.defineProperty(jg,"__esModule",{value:!0});jg.ApplicationInsightClient=void 0;var Cfi=qLe(),wfi=Afi(vje()),Pfi=Yne(),Fg=Xne(),Dfi=_je(),xir=zU(),xje=class extends Cfi.Client{clients;constructor(t,r,n){super(),this.clients=new Map,this.applicationKey=t,this.extensionVersion=n,this.extensionName=r;let i=this.createTelemetryClient(Fg.SampleRate.OnePercent),a=this.createTelemetryClient(Fg.SampleRate.TenPercent),o=this.createTelemetryClient(Fg.SampleRate.NoSampling);this.clients.set(Fg.SampleRate.OnePercent,i),this.clients.set(Fg.SampleRate.TenPercent,a),this.clients.set(Fg.SampleRate.NoSampling,o)}reportBlocking(t,r,n,i,a=!1){if(!a||xir.TelemetrySettings.telemetryEnabled){let{client:o,event:s}=this.prepareClientAndEvent(t,r,n,i);return this.trackEventBlocking(o,s)}return Promise.resolve()}async report(t,r,n,i,a,o){if(o!==void 0&&!o||!xir.TelemetrySettings.telemetryEnabled)return;let{client:s,event:c}=this.prepareClientAndEvent(t,r,n,i);this.trackEvent(s,c)}prepareClientAndEvent(t,r,n,i=Fg.SampleRate.NoSampling){let a=this.clients.get(i),s={name:new Pfi.EventHeader(this.extensionName,t).toString(),properties:r,measurements:n};return{client:a,event:s}}async trackEventBlocking(t,r){if(process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true")return new Promise((n,i)=>{try{t.trackEvent(r),t.flush({callback:()=>n()})}catch(a){i(a)}})}trackEvent(t,r){return process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"?(t.trackEvent(r),!0):!1}createTelemetryClient(t){let r;switch(t){case Fg.SampleRate.OnePercent:r=1;break;case Fg.SampleRate.TenPercent:r=10;break;case Fg.SampleRate.NoSampling:default:r=100;break}let n=new wfi.TelemetryClient(this.applicationKey);return n.config.samplingPercentage=r,(0,Dfi.configAzureTelemetryClient)(n),n}};jg.ApplicationInsightClient=xje});var Tir=y(Jne=>{"use strict";Object.defineProperty(Jne,"__esModule",{value:!0});Jne.localDatetimeToUTC=void 0;var Nfi=()=>{let e=new Date().getTime();return new Date(e).toISOString()};Jne.localDatetimeToUTC=Nfi});var Air=y(Zne=>{"use strict";Object.defineProperty(Zne,"__esModule",{value:!0});Zne.ToolsSuiteTelemetryClient=void 0;var Ifi=Tje(),Oir=Qne(),Sir=Tir(),Oje=class extends Ifi.ApplicationInsightClient{constructor(t,r,n){super(t,r,n)}async report(t,r,n,i,a,o){let s=await(0,Oir.processToolsSuiteTelemetry)(a),c={v:this.extensionVersion,datetime:(0,Sir.localDatetimeToUTC)()},u={...r,...s,...c};await super.report(t,u,n,i,a,o)}async reportEvent(t,r,n,i){let{finalProperties:a,finalMeasurements:o}=await this.collectToolsSuiteTelemetry(t,n);return super.report(t.eventName,a,o,r,n,i)}async reportEventBlocking(t,r,n,i){let{finalProperties:a,finalMeasurements:o}=await this.collectToolsSuiteTelemetry(t,n);return super.reportBlocking(t.eventName,a,o,r,i)}async collectToolsSuiteTelemetry(t,r){let n=await(0,Oir.processToolsSuiteTelemetry)(r),i={v:this.extensionVersion,datetime:(0,Sir.localDatetimeToUTC)()},a={...t.properties,...n,...i},o={...t.measurements};return{finalProperties:a,finalMeasurements:o}}};Zne.ToolsSuiteTelemetryClient=Oje});var Rn=y(Xs=>{"use strict";var Sje=Symbol.for("yaml.alias"),Cir=Symbol.for("yaml.document"),eie=Symbol.for("yaml.map"),wir=Symbol.for("yaml.pair"),Aje=Symbol.for("yaml.scalar"),tie=Symbol.for("yaml.seq"),Ob=Symbol.for("yaml.node.type"),Rfi=e=>!!e&&typeof e=="object"&&e[Ob]===Sje,Lfi=e=>!!e&&typeof e=="object"&&e[Ob]===Cir,kfi=e=>!!e&&typeof e=="object"&&e[Ob]===eie,$fi=e=>!!e&&typeof e=="object"&&e[Ob]===wir,Pir=e=>!!e&&typeof e=="object"&&e[Ob]===Aje,Mfi=e=>!!e&&typeof e=="object"&&e[Ob]===tie;function Dir(e){if(e&&typeof e=="object")switch(e[Ob]){case eie:case tie:return!0}return!1}function Ffi(e){if(e&&typeof e=="object")switch(e[Ob]){case Sje:case eie:case Aje:case tie:return!0}return!1}var jfi=e=>(Pir(e)||Dir(e))&&!!e.anchor;Xs.ALIAS=Sje;Xs.DOC=Cir;Xs.MAP=eie;Xs.NODE_TYPE=Ob;Xs.PAIR=wir;Xs.SCALAR=Aje;Xs.SEQ=tie;Xs.hasAnchor=jfi;Xs.isAlias=Rfi;Xs.isCollection=Dir;Xs.isDocument=Lfi;Xs.isMap=kfi;Xs.isNode=Ffi;Xs.isPair=$fi;Xs.isScalar=Pir;Xs.isSeq=Mfi});var HU=y(Cje=>{"use strict";var zo=Rn(),Fl=Symbol("break visit"),Nir=Symbol("skip children"),qg=Symbol("remove node");function rie(e,t){let r=Iir(t);zo.isDocument(e)?aR(null,e.contents,r,Object.freeze([e]))===qg&&(e.contents=null):aR(null,e,r,Object.freeze([]))}rie.BREAK=Fl;rie.SKIP=Nir;rie.REMOVE=qg;function aR(e,t,r,n){let i=Rir(e,t,r,n);if(zo.isNode(i)||zo.isPair(i))return Lir(e,n,i),aR(e,i,r,n);if(typeof i!="symbol"){if(zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let a=0;a<t.items.length;++a){let o=aR(a,t.items[a],r,n);if(typeof o=="number")a=o-1;else{if(o===Fl)return Fl;o===qg&&(t.items.splice(a,1),a-=1)}}}else if(zo.isPair(t)){n=Object.freeze(n.concat(t));let a=aR("key",t.key,r,n);if(a===Fl)return Fl;a===qg&&(t.key=null);let o=aR("value",t.value,r,n);if(o===Fl)return Fl;o===qg&&(t.value=null)}}return i}async function nie(e,t){let r=Iir(t);zo.isDocument(e)?await oR(null,e.contents,r,Object.freeze([e]))===qg&&(e.contents=null):await oR(null,e,r,Object.freeze([]))}nie.BREAK=Fl;nie.SKIP=Nir;nie.REMOVE=qg;async function oR(e,t,r,n){let i=await Rir(e,t,r,n);if(zo.isNode(i)||zo.isPair(i))return Lir(e,n,i),oR(e,i,r,n);if(typeof i!="symbol"){if(zo.isCollection(t)){n=Object.freeze(n.concat(t));for(let a=0;a<t.items.length;++a){let o=await oR(a,t.items[a],r,n);if(typeof o=="number")a=o-1;else{if(o===Fl)return Fl;o===qg&&(t.items.splice(a,1),a-=1)}}}else if(zo.isPair(t)){n=Object.freeze(n.concat(t));let a=await oR("key",t.key,r,n);if(a===Fl)return Fl;a===qg&&(t.key=null);let o=await oR("value",t.value,r,n);if(o===Fl)return Fl;o===qg&&(t.value=null)}}return i}function Iir(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Rir(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(zo.isMap(t))return r.Map?.(e,t,n);if(zo.isSeq(t))return r.Seq?.(e,t,n);if(zo.isPair(t))return r.Pair?.(e,t,n);if(zo.isScalar(t))return r.Scalar?.(e,t,n);if(zo.isAlias(t))return r.Alias?.(e,t,n)}function Lir(e,t,r){let n=t[t.length-1];if(zo.isCollection(n))n.items[e]=r;else if(zo.isPair(n))e==="key"?n.key=r:n.value=r;else if(zo.isDocument(n))n.contents=r;else{let i=zo.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Cje.visit=rie;Cje.visitAsync=nie});var wje=y($ir=>{"use strict";var kir=Rn(),qfi=HU(),Vfi={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ufi=e=>e.replace(/[!,[\]{}]/g,t=>Vfi[t]),GU=class e{constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,r)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let n=t.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[a,o]=n;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[a]=n;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return r(6,`Unsupported YAML version ${a}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=t.match(/^(.*!)([^!]*)$/);i||r(`The ${t} tag has no suffix`);let a=this.tags[n];if(a)try{return a+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+Ufi(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(t&&n.length>0&&kir.isNode(t.contents)){let a={};qfi.visit(t.contents,(o,s)=>{kir.isNode(s)&&s.tag&&(a[s.tag]=!0)}),i=Object.keys(a)}else i=[];for(let[a,o]of n)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(s=>s.startsWith(o)))&&r.push(`%TAG ${a} ${o}`);return r.join(`
1488
1488
  `)}};GU.defaultYaml={explicit:!1,version:"1.2"};GU.defaultTags={"!!":"tag:yaml.org,2002:"};$ir.Directives=GU});var iie=y(KU=>{"use strict";var Mir=Rn(),Bfi=HU();function zfi(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(r)}return!0}function Fir(e){let t=new Set;return Bfi.visit(e,{Value(r,n){n.anchor&&t.add(n.anchor)}}),t}function jir(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function Hfi(e,t){let r=[],n=new Map,i=null;return{onAnchor:a=>{r.push(a),i||(i=Fir(e));let o=jir(t,i);return i.add(o),o},setAnchors:()=>{for(let a of r){let o=n.get(a);if(typeof o=="object"&&o.anchor&&(Mir.isScalar(o.node)||Mir.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:n}}KU.anchorIsValid=zfi;KU.anchorNames=Fir;KU.createNodeAnchors=Hfi;KU.findNewAnchor=jir});var Pje=y(qir=>{"use strict";function YU(e,t,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,a=n.length;i<a;++i){let o=n[i],s=YU(e,n,String(i),o);s===void 0?delete n[i]:s!==o&&(n[i]=s)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let a=n.get(i),o=YU(e,n,i,a);o===void 0?n.delete(i):o!==a&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let a=YU(e,n,i,i);a===void 0?n.delete(i):a!==i&&(n.delete(i),n.add(a))}else for(let[i,a]of Object.entries(n)){let o=YU(e,n,i,a);o===void 0?delete n[i]:o!==a&&(n[i]=o)}return e.call(t,r,n)}qir.applyReviver=YU});var V_=y(Uir=>{"use strict";var Gfi=Rn();function Vir(e,t,r){if(Array.isArray(e))return e.map((n,i)=>Vir(n,String(i),r));if(e&&typeof e.toJSON=="function"){if(!r||!Gfi.hasAnchor(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=a=>{n.res=a,delete r.onCreate};let i=e.toJSON(t,r);return r.onCreate&&r.onCreate(i),i}return typeof e=="bigint"&&!r?.keep?Number(e):e}Uir.toJS=Vir});var aie=y(zir=>{"use strict";var Kfi=Pje(),Bir=Rn(),Yfi=V_(),Dje=class{constructor(t){Object.defineProperty(this,Bir.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:a}={}){if(!Bir.isDocument(t))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:t,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},s=Yfi.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:u}of o.anchors.values())i(u,c);return typeof a=="function"?Kfi.applyReviver(a,{"":s},"",s):s}};zir.NodeBase=Dje});var WU=y(Gir=>{"use strict";var Wfi=iie(),Hir=HU(),oie=Rn(),Xfi=aie(),Jfi=V_(),Nje=class extends Xfi.NodeBase{constructor(t){super(oie.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let r;return Hir.visit(t,{Node:(n,i)=>{if(i===this)return Hir.visit.BREAK;i.anchor===this.source&&(r=i)}}),r}toJSON(t,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:a}=r,o=this.resolve(i);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=n.get(o);if(s||(Jfi.toJS(o,null,r),s=n.get(o)),!s||s.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=sie(i,o,n)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(t,r,n){let i=`*${this.source}`;if(t){if(Wfi.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}};function sie(e,t,r){if(oie.isAlias(t)){let n=t.resolve(e),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(oie.isCollection(t)){let n=0;for(let i of t.items){let a=sie(e,i,r);a>n&&(n=a)}return n}else if(oie.isPair(t)){let n=sie(e,t.key,r),i=sie(e,t.value,r);return Math.max(n,i)}return 1}Gir.Alias=Nje});var Co=y(Ije=>{"use strict";var Zfi=Rn(),Qfi=aie(),edi=V_(),tdi=e=>!e||typeof e!="function"&&typeof e!="object",U_=class extends Qfi.NodeBase{constructor(t){super(Zfi.SCALAR),this.value=t}toJSON(t,r){return r?.keep?this.value:edi.toJS(this.value,t,r)}toString(){return String(this.value)}};U_.BLOCK_FOLDED="BLOCK_FOLDED";U_.BLOCK_LITERAL="BLOCK_LITERAL";U_.PLAIN="PLAIN";U_.QUOTE_DOUBLE="QUOTE_DOUBLE";U_.QUOTE_SINGLE="QUOTE_SINGLE";Ije.Scalar=U_;Ije.isScalarValue=tdi});var XU=y(Yir=>{"use strict";var rdi=WU(),vS=Rn(),Kir=Co(),ndi="tag:yaml.org,2002:";function idi(e,t,r){if(t){let n=r.filter(a=>a.tag===t),i=n.find(a=>!a.format)??n[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return r.find(n=>n.identify?.(e)&&!n.format)}function adi(e,t,r){if(vS.isDocument(e)&&(e=e.contents),vS.isNode(e))return e;if(vS.isPair(e)){let p=r.schema[vS.MAP].createNode?.(r.schema,null,r);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=r,c;if(n&&e&&typeof e=="object"){if(c=s.get(e),c)return c.anchor||(c.anchor=i(e)),new rdi.Alias(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith("!!")&&(t=ndi+t.slice(2));let u=idi(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let p=new Kir.Scalar(e);return c&&(c.node=p),p}u=e instanceof Map?o[vS.MAP]:Symbol.iterator in Object(e)?o[vS.SEQ]:o[vS.MAP]}a&&(a(u),delete r.onTagObj);let l=u?.createNode?u.createNode(r.schema,e,r):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(r.schema,e,r):new Kir.Scalar(e);return t?l.tag=t:u.default||(l.tag=u.tag),c&&(c.node=l),l}Yir.createNode=adi});var JU=y(uie=>{"use strict";var odi=XU(),Vg=Rn(),sdi=aie();function Rje(e,t,r){let n=r;for(let i=t.length-1;i>=0;--i){let a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=n,n=o}else n=new Map([[a,n]])}return odi.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var Wir=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,cie=class extends sdi.NodeBase{constructor(t,r){super(t),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(t){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(r.schema=t),r.items=r.items.map(n=>Vg.isNode(n)||Vg.isPair(n)?n.clone(t):n),this.range&&(r.range=this.range.slice()),r}addIn(t,r){if(Wir(t))this.add(r);else{let[n,...i]=t,a=this.get(n,!0);if(Vg.isCollection(a))a.addIn(i,r);else if(a===void 0&&this.schema)this.set(n,Rje(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(t){let[r,...n]=t;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Vg.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){let[n,...i]=t,a=this.get(n,!0);return i.length===0?!r&&Vg.isScalar(a)?a.value:a:Vg.isCollection(a)?a.getIn(i,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!Vg.isPair(r))return!1;let n=r.value;return n==null||t&&Vg.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){let[r,...n]=t;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Vg.isCollection(i)?i.hasIn(n):!1}setIn(t,r){let[n,...i]=t;if(i.length===0)this.set(n,r);else{let a=this.get(n,!0);if(Vg.isCollection(a))a.setIn(i,r);else if(a===void 0&&this.schema)this.set(n,Rje(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};cie.maxFlowStringSingleLineLength=60;uie.Collection=cie;uie.collectionFromPath=Rje;uie.isEmptyPath=Wir});var ZU=y(lie=>{"use strict";var cdi=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Lje(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var udi=(e,t,r)=>e.endsWith(`
1489
1489
  `)?Lje(r,t):r.includes(`
1490
1490
  `)?`
@@ -1650,7 +1650,7 @@ ${n.message}`:h,_=[v,t,e].filter(Boolean).join(`
1650
1650
 
1651
1651
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let l of this.seen.entries()){let p=l[1];if(t===l[0]){o(l);continue}if(n.external){let d=n.external.registry.get(l[0])?.id;if(t!==l[0]&&d){o(l);continue}}if(this.metadataRegistry.get(l[0])?.id){o(l);continue}if(p.cycle){o(l);continue}if(p.count>1&&n.reused==="ref"){o(l);continue}}let s=(l,p)=>{let f=this.seen.get(l),d=f.def??f.schema,h={...d};if(f.ref===null)return;let m=f.ref;if(f.ref=null,m){s(m,p);let v=this.seen.get(m).schema;v.$ref&&(p.target==="draft-7"||p.target==="draft-4"||p.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):(Object.assign(d,v),Object.assign(d,h))}f.isParent||this.override({zodSchema:l,jsonSchema:d,path:f.path??[]})};for(let l of[...this.seen.entries()].reverse())s(l[0],{target:this.target});let 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#":this.target==="draft-4"?c.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),n.external?.uri){let l=n.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(l)}Object.assign(c,i.def);let u=n.external?.defs??{};for(let l of this.seen.entries()){let p=l[1];p.def&&p.defId&&(u[p.defId]=p.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}};function Rx(e,t){if(e instanceof BA){let n=new bk(t),i={};for(let s of e._idmap.entries()){let[c,u]=s;n.process(u)}let a={},o={registry:e,uri:t?.uri,defs:i};for(let s of e._idmap.entries()){let[c,u]=s;a[c]=n.emit(u,{...t,external:o})}if(Object.keys(i).length>0){let s=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:i}}return{schemas:a}}let r=new bk(t);return r.process(e),r.emit(e,t)}function Jc(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Jc(n.element,r);if(n.type==="set")return Jc(n.valueType,r);if(n.type==="lazy")return Jc(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Jc(n.innerType,r);if(n.type==="intersection")return Jc(n.left,r)||Jc(n.right,r);if(n.type==="record"||n.type==="map")return Jc(n.keyType,r)||Jc(n.valueType,r);if(n.type==="pipe")return Jc(n.in,r)||Jc(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Jc(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Jc(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Jc(i,r))return!0;return!!(n.rest&&Jc(n.rest,r))}return!1}var kGe={};function iC(e){return!!e._zod}function o0(e,t){return iC(e)?Cx(e,t):e.safeParse(t)}function W6(e){var t,r;if(!e)return;let n;if(iC(e)?n=(r=(t=e._zod)===null||t===void 0?void 0:t.def)===null||r===void 0?void 0:r.shape:n=e.shape,!!n){if(typeof n=="function")try{return n()}catch{return}return n}}function FGe(e){var t;if(iC(e)){let o=(t=e._zod)===null||t===void 0?void 0:t.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=e.value;if(i!==void 0)return i}var Lx={};Ni(Lx,{$brand:()=>LL,$input:()=>a6,$output:()=>i6,NEVER:()=>w3,TimePrecision:()=>u6,ZodAny:()=>HGe,ZodArray:()=>WGe,ZodBase64:()=>Hle,ZodBase64URL:()=>Gle,ZodBigInt:()=>Sk,ZodBigIntFormat:()=>Wle,ZodBoolean:()=>Ok,ZodCIDRv4:()=>Ble,ZodCIDRv6:()=>zle,ZodCUID:()=>$le,ZodCUID2:()=>Mle,ZodCatch:()=>fKe,ZodCodec:()=>npe,ZodCustom:()=>u5,ZodCustomStringFormat:()=>xk,ZodDate:()=>o5,ZodDefault:()=>oKe,ZodDiscriminatedUnion:()=>XGe,ZodE164:()=>Kle,ZodEmail:()=>Ile,ZodEmoji:()=>Lle,ZodEnum:()=>Ek,ZodError:()=>yle,ZodFile:()=>nKe,ZodFirstPartyTypeKind:()=>ape,ZodFunction:()=>_Ke,ZodGUID:()=>t5,ZodIPv4:()=>Vle,ZodIPv6:()=>Ule,ZodISODate:()=>J6,ZodISODateTime:()=>X6,ZodISODuration:()=>Q6,ZodISOTime:()=>Z6,ZodIntersection:()=>JGe,ZodIssueCode:()=>Cwr,ZodJWT:()=>Yle,ZodKSUID:()=>qle,ZodLazy:()=>vKe,ZodLiteral:()=>rKe,ZodMAC:()=>VGe,ZodMap:()=>eKe,ZodNaN:()=>hKe,ZodNanoID:()=>kle,ZodNever:()=>KGe,ZodNonOptional:()=>tpe,ZodNull:()=>zGe,ZodNullable:()=>aKe,ZodNumber:()=>Tk,ZodNumberFormat:()=>aC,ZodObject:()=>s5,ZodOptional:()=>epe,ZodPipe:()=>rpe,ZodPrefault:()=>cKe,ZodPromise:()=>EKe,ZodReadonly:()=>mKe,ZodRealError:()=>Vu,ZodRecord:()=>Zle,ZodSet:()=>tKe,ZodString:()=>_k,ZodStringFormat:()=>ui,ZodSuccess:()=>pKe,ZodSymbol:()=>UGe,ZodTemplateLiteral:()=>yKe,ZodTransform:()=>iKe,ZodTuple:()=>ZGe,ZodType:()=>Ar,ZodULID:()=>Fle,ZodURL:()=>i5,ZodUUID:()=>hy,ZodUndefined:()=>BGe,ZodUnion:()=>Jle,ZodUnknown:()=>GGe,ZodVoid:()=>YGe,ZodXID:()=>jle,_ZodString:()=>Nle,_default:()=>sKe,_function:()=>Ewr,any:()=>a5,array:()=>Bt,base64:()=>UCr,base64url:()=>BCr,bigint:()=>ewr,boolean:()=>Ji,catch:()=>dKe,check:()=>_wr,cidrv4:()=>qCr,cidrv6:()=>VCr,clone:()=>Ts,codec:()=>ywr,coerce:()=>ope,config:()=>ga,core:()=>rp,cuid:()=>ICr,cuid2:()=>RCr,custom:()=>ipe,date:()=>owr,decode:()=>Tle,decodeAsync:()=>Sle,describe:()=>xwr,discriminatedUnion:()=>c5,e164:()=>zCr,email:()=>TCr,emoji:()=>DCr,encode:()=>xle,encodeAsync:()=>Ole,endsWith:()=>ZA,enum:()=>$n,file:()=>dwr,flattenError:()=>DA,float32:()=>XCr,float64:()=>JCr,formatError:()=>NA,function:()=>Ewr,getErrorMap:()=>Pwr,globalRegistry:()=>rc,gt:()=>Bh,gte:()=>nc,guid:()=>OCr,hash:()=>WCr,hex:()=>YCr,hostname:()=>KCr,httpUrl:()=>PCr,includes:()=>XA,instanceof:()=>Owr,int:()=>Dle,int32:()=>ZCr,int64:()=>twr,intersection:()=>Ck,ipv4:()=>MCr,ipv6:()=>jCr,iso:()=>e5,json:()=>Awr,jwt:()=>HCr,keyof:()=>swr,ksuid:()=>$Cr,lazy:()=>bKe,length:()=>Nx,literal:()=>dt,locales:()=>UA,looseObject:()=>np,lowercase:()=>YA,lt:()=>Uh,lte:()=>qu,mac:()=>FCr,map:()=>lwr,maxLength:()=>Dx,maxSize:()=>Px,meta:()=>Twr,mime:()=>QA,minLength:()=>dy,minSize:()=>a0,multipleOf:()=>i0,nan:()=>gwr,nanoid:()=>NCr,nativeEnum:()=>fwr,negative:()=>F6,never:()=>Xle,nonnegative:()=>q6,nonoptional:()=>lKe,nonpositive:()=>j6,normalize:()=>eC,null:()=>Ak,nullable:()=>r5,nullish:()=>hwr,number:()=>kn,object:()=>Ae,optional:()=>pt,overwrite:()=>Pd,parse:()=>vle,parseAsync:()=>ble,partialRecord:()=>uwr,pipe:()=>n5,positive:()=>M6,prefault:()=>uKe,preprocess:()=>l5,prettifyError:()=>I3,promise:()=>bwr,property:()=>V6,readonly:()=>gKe,record:()=>vi,refine:()=>xKe,regex:()=>KA,regexes:()=>ju,registry:()=>JL,safeDecode:()=>Cle,safeDecodeAsync:()=>Ple,safeEncode:()=>Ale,safeEncodeAsync:()=>wle,safeParse:()=>Ele,safeParseAsync:()=>_le,set:()=>pwr,setErrorMap:()=>wwr,size:()=>GA,slugify:()=>vk,startsWith:()=>JA,strictObject:()=>cwr,string:()=>re,stringFormat:()=>GCr,stringbool:()=>Swr,success:()=>mwr,superRefine:()=>TKe,symbol:()=>nwr,templateLiteral:()=>vwr,toJSONSchema:()=>Rx,toLowerCase:()=>rC,toUpperCase:()=>nC,transform:()=>Qle,treeifyError:()=>N3,trim:()=>tC,tuple:()=>QGe,uint32:()=>QCr,uint64:()=>rwr,ulid:()=>LCr,undefined:()=>iwr,union:()=>pn,unknown:()=>li,uppercase:()=>WA,url:()=>Rle,util:()=>Le,uuid:()=>SCr,uuidv4:()=>ACr,uuidv6:()=>CCr,uuidv7:()=>wCr,void:()=>awr,xid:()=>kCr});var e5={};Ni(e5,{ZodISODate:()=>J6,ZodISODateTime:()=>X6,ZodISODuration:()=>Q6,ZodISOTime:()=>Z6,date:()=>hle,datetime:()=>dle,duration:()=>gle,time:()=>mle});var X6=ne("ZodISODateTime",(e,t)=>{o8.init(e,t),ui.init(e,t)});function dle(e){return l6(X6,e)}var J6=ne("ZodISODate",(e,t)=>{s8.init(e,t),ui.init(e,t)});function hle(e){return p6(J6,e)}var Z6=ne("ZodISOTime",(e,t)=>{c8.init(e,t),ui.init(e,t)});function mle(e){return f6(Z6,e)}var Q6=ne("ZodISODuration",(e,t)=>{u8.init(e,t),ui.init(e,t)});function gle(e){return d6(Q6,e)}var qGe=(e,t)=>{VL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>NA(e,r)},flatten:{value:r=>DA(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,CA,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,CA,2)}},isEmpty:{get(){return e.issues.length===0}}})},yle=ne("ZodError",qGe),Vu=ne("ZodError",qGe,{Parent:Error});var vle=IA(Vu),ble=LA(Vu),Ele=$A(Vu),_le=MA(Vu),xle=R3(Vu),Tle=L3(Vu),Ole=k3(Vu),Sle=$3(Vu),Ale=M3(Vu),Cle=F3(Vu),wle=j3(Vu),Ple=q3(Vu);var Ar=ne("ZodType",(e,t)=>(Wt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Le.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>Ts(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>vle(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ele(e,r,n),e.parseAsync=async(r,n)=>ble(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>_le(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>xle(e,r,n),e.decode=(r,n)=>Tle(e,r,n),e.encodeAsync=async(r,n)=>Ole(e,r,n),e.decodeAsync=async(r,n)=>Sle(e,r,n),e.safeEncode=(r,n)=>Ale(e,r,n),e.safeDecode=(r,n)=>Cle(e,r,n),e.safeEncodeAsync=async(r,n)=>wle(e,r,n),e.safeDecodeAsync=async(r,n)=>Ple(e,r,n),e.refine=(r,n)=>e.check(xKe(r,n)),e.superRefine=r=>e.check(TKe(r)),e.overwrite=r=>e.check(Pd(r)),e.optional=()=>pt(e),e.nullable=()=>r5(e),e.nullish=()=>pt(r5(e)),e.nonoptional=r=>lKe(e,r),e.array=()=>Bt(e),e.or=r=>pn([e,r]),e.and=r=>Ck(e,r),e.transform=r=>n5(e,Qle(r)),e.default=r=>sKe(e,r),e.prefault=r=>uKe(e,r),e.catch=r=>dKe(e,r),e.pipe=r=>n5(e,r),e.readonly=()=>gKe(e),e.describe=r=>{let n=e.clone();return rc.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return rc.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return rc.get(e);let n=e.clone();return rc.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Nle=ne("_ZodString",(e,t)=>{n0.init(e,t),Ar.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(KA(...n)),e.includes=(...n)=>e.check(XA(...n)),e.startsWith=(...n)=>e.check(JA(...n)),e.endsWith=(...n)=>e.check(ZA(...n)),e.min=(...n)=>e.check(dy(...n)),e.max=(...n)=>e.check(Dx(...n)),e.length=(...n)=>e.check(Nx(...n)),e.nonempty=(...n)=>e.check(dy(1,...n)),e.lowercase=n=>e.check(YA(n)),e.uppercase=n=>e.check(WA(n)),e.trim=()=>e.check(tC()),e.normalize=(...n)=>e.check(eC(...n)),e.toLowerCase=()=>e.check(rC()),e.toUpperCase=()=>e.check(nC()),e.slugify=()=>e.check(vk())}),_k=ne("ZodString",(e,t)=>{n0.init(e,t),Nle.init(e,t),e.email=r=>e.check(ZL(Ile,r)),e.url=r=>e.check(HA(i5,r)),e.jwt=r=>e.check(yk(Yle,r)),e.emoji=r=>e.check(nk(Lle,r)),e.guid=r=>e.check(zA(t5,r)),e.uuid=r=>e.check(QL(hy,r)),e.uuidv4=r=>e.check(ek(hy,r)),e.uuidv6=r=>e.check(tk(hy,r)),e.uuidv7=r=>e.check(rk(hy,r)),e.nanoid=r=>e.check(ik(kle,r)),e.guid=r=>e.check(zA(t5,r)),e.cuid=r=>e.check(ak($le,r)),e.cuid2=r=>e.check(ok(Mle,r)),e.ulid=r=>e.check(sk(Fle,r)),e.base64=r=>e.check(hk(Hle,r)),e.base64url=r=>e.check(mk(Gle,r)),e.xid=r=>e.check(ck(jle,r)),e.ksuid=r=>e.check(uk(qle,r)),e.ipv4=r=>e.check(lk(Vle,r)),e.ipv6=r=>e.check(pk(Ule,r)),e.cidrv4=r=>e.check(fk(Ble,r)),e.cidrv6=r=>e.check(dk(zle,r)),e.e164=r=>e.check(gk(Kle,r)),e.datetime=r=>e.check(dle(r)),e.date=r=>e.check(hle(r)),e.time=r=>e.check(mle(r)),e.duration=r=>e.check(gle(r))});function re(e){return o6(_k,e)}var ui=ne("ZodStringFormat",(e,t)=>{Kn.init(e,t),Nle.init(e,t)}),Ile=ne("ZodEmail",(e,t)=>{J3.init(e,t),ui.init(e,t)});function TCr(e){return ZL(Ile,e)}var t5=ne("ZodGUID",(e,t)=>{W3.init(e,t),ui.init(e,t)});function OCr(e){return zA(t5,e)}var hy=ne("ZodUUID",(e,t)=>{X3.init(e,t),ui.init(e,t)});function SCr(e){return QL(hy,e)}function ACr(e){return ek(hy,e)}function CCr(e){return tk(hy,e)}function wCr(e){return rk(hy,e)}var i5=ne("ZodURL",(e,t)=>{Z3.init(e,t),ui.init(e,t)});function Rle(e){return HA(i5,e)}function PCr(e){return HA(i5,{protocol:/^https?$/,hostname:ju.domain,...Le.normalizeParams(e)})}var Lle=ne("ZodEmoji",(e,t)=>{Q3.init(e,t),ui.init(e,t)});function DCr(e){return nk(Lle,e)}var kle=ne("ZodNanoID",(e,t)=>{e8.init(e,t),ui.init(e,t)});function NCr(e){return ik(kle,e)}var $le=ne("ZodCUID",(e,t)=>{t8.init(e,t),ui.init(e,t)});function ICr(e){return ak($le,e)}var Mle=ne("ZodCUID2",(e,t)=>{r8.init(e,t),ui.init(e,t)});function RCr(e){return ok(Mle,e)}var Fle=ne("ZodULID",(e,t)=>{n8.init(e,t),ui.init(e,t)});function LCr(e){return sk(Fle,e)}var jle=ne("ZodXID",(e,t)=>{i8.init(e,t),ui.init(e,t)});function kCr(e){return ck(jle,e)}var qle=ne("ZodKSUID",(e,t)=>{a8.init(e,t),ui.init(e,t)});function $Cr(e){return uk(qle,e)}var Vle=ne("ZodIPv4",(e,t)=>{l8.init(e,t),ui.init(e,t)});function MCr(e){return lk(Vle,e)}var VGe=ne("ZodMAC",(e,t)=>{f8.init(e,t),ui.init(e,t)});function FCr(e){return c6(VGe,e)}var Ule=ne("ZodIPv6",(e,t)=>{p8.init(e,t),ui.init(e,t)});function jCr(e){return pk(Ule,e)}var Ble=ne("ZodCIDRv4",(e,t)=>{d8.init(e,t),ui.init(e,t)});function qCr(e){return fk(Ble,e)}var zle=ne("ZodCIDRv6",(e,t)=>{h8.init(e,t),ui.init(e,t)});function VCr(e){return dk(zle,e)}var Hle=ne("ZodBase64",(e,t)=>{m8.init(e,t),ui.init(e,t)});function UCr(e){return hk(Hle,e)}var Gle=ne("ZodBase64URL",(e,t)=>{g8.init(e,t),ui.init(e,t)});function BCr(e){return mk(Gle,e)}var Kle=ne("ZodE164",(e,t)=>{y8.init(e,t),ui.init(e,t)});function zCr(e){return gk(Kle,e)}var Yle=ne("ZodJWT",(e,t)=>{v8.init(e,t),ui.init(e,t)});function HCr(e){return yk(Yle,e)}var xk=ne("ZodCustomStringFormat",(e,t)=>{b8.init(e,t),ui.init(e,t)});function GCr(e,t,r={}){return Ix(xk,e,t,r)}function KCr(e){return Ix(xk,"hostname",ju.hostname,e)}function YCr(e){return Ix(xk,"hex",ju.hex,e)}function WCr(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,i=ju[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Ix(xk,n,i,t)}var Tk=ne("ZodNumber",(e,t)=>{HL.init(e,t),Ar.init(e,t),e.gt=(n,i)=>e.check(Bh(n,i)),e.gte=(n,i)=>e.check(nc(n,i)),e.min=(n,i)=>e.check(nc(n,i)),e.lt=(n,i)=>e.check(Uh(n,i)),e.lte=(n,i)=>e.check(qu(n,i)),e.max=(n,i)=>e.check(qu(n,i)),e.int=n=>e.check(Dle(n)),e.safe=n=>e.check(Dle(n)),e.positive=n=>e.check(Bh(0,n)),e.nonnegative=n=>e.check(nc(0,n)),e.negative=n=>e.check(Uh(0,n)),e.nonpositive=n=>e.check(qu(0,n)),e.multipleOf=(n,i)=>e.check(i0(n,i)),e.step=(n,i)=>e.check(i0(n,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function kn(e){return h6(Tk,e)}var aC=ne("ZodNumberFormat",(e,t)=>{E8.init(e,t),Tk.init(e,t)});function Dle(e){return g6(aC,e)}function XCr(e){return y6(aC,e)}function JCr(e){return v6(aC,e)}function ZCr(e){return b6(aC,e)}function QCr(e){return E6(aC,e)}var Ok=ne("ZodBoolean",(e,t)=>{qA.init(e,t),Ar.init(e,t)});function Ji(e){return _6(Ok,e)}var Sk=ne("ZodBigInt",(e,t)=>{GL.init(e,t),Ar.init(e,t),e.gte=(n,i)=>e.check(nc(n,i)),e.min=(n,i)=>e.check(nc(n,i)),e.gt=(n,i)=>e.check(Bh(n,i)),e.gte=(n,i)=>e.check(nc(n,i)),e.min=(n,i)=>e.check(nc(n,i)),e.lt=(n,i)=>e.check(Uh(n,i)),e.lte=(n,i)=>e.check(qu(n,i)),e.max=(n,i)=>e.check(qu(n,i)),e.positive=n=>e.check(Bh(BigInt(0),n)),e.negative=n=>e.check(Uh(BigInt(0),n)),e.nonpositive=n=>e.check(qu(BigInt(0),n)),e.nonnegative=n=>e.check(nc(BigInt(0),n)),e.multipleOf=(n,i)=>e.check(i0(n,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function ewr(e){return T6(Sk,e)}var Wle=ne("ZodBigIntFormat",(e,t)=>{_8.init(e,t),Sk.init(e,t)});function twr(e){return S6(Wle,e)}function rwr(e){return A6(Wle,e)}var UGe=ne("ZodSymbol",(e,t)=>{x8.init(e,t),Ar.init(e,t)});function nwr(e){return C6(UGe,e)}var BGe=ne("ZodUndefined",(e,t)=>{T8.init(e,t),Ar.init(e,t)});function iwr(e){return w6(BGe,e)}var zGe=ne("ZodNull",(e,t)=>{O8.init(e,t),Ar.init(e,t)});function Ak(e){return P6(zGe,e)}var HGe=ne("ZodAny",(e,t)=>{S8.init(e,t),Ar.init(e,t)});function a5(){return D6(HGe)}var GGe=ne("ZodUnknown",(e,t)=>{A8.init(e,t),Ar.init(e,t)});function li(){return N6(GGe)}var KGe=ne("ZodNever",(e,t)=>{C8.init(e,t),Ar.init(e,t)});function Xle(e){return I6(KGe,e)}var YGe=ne("ZodVoid",(e,t)=>{w8.init(e,t),Ar.init(e,t)});function awr(e){return R6(YGe,e)}var o5=ne("ZodDate",(e,t)=>{P8.init(e,t),Ar.init(e,t),e.min=(n,i)=>e.check(nc(n,i)),e.max=(n,i)=>e.check(qu(n,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function owr(e){return L6(o5,e)}var WGe=ne("ZodArray",(e,t)=>{D8.init(e,t),Ar.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(dy(r,n)),e.nonempty=r=>e.check(dy(1,r)),e.max=(r,n)=>e.check(Dx(r,n)),e.length=(r,n)=>e.check(Nx(r,n)),e.unwrap=()=>e.element});function Bt(e,t){return fle(WGe,e,t)}function swr(e){let t=e._zod.def.shape;return $n(Object.keys(t))}var s5=ne("ZodObject",(e,t)=>{ple.init(e,t),Ar.init(e,t),Le.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>$n(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:li()}),e.loose=()=>e.clone({...e._zod.def,catchall:li()}),e.strict=()=>e.clone({...e._zod.def,catchall:Xle()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Le.extend(e,r),e.safeExtend=r=>Le.safeExtend(e,r),e.merge=r=>Le.merge(e,r),e.pick=r=>Le.pick(e,r),e.omit=r=>Le.omit(e,r),e.partial=(...r)=>Le.partial(epe,e,r[0]),e.required=(...r)=>Le.required(tpe,e,r[0])});function Ae(e,t){let r={type:"object",shape:e??{},...Le.normalizeParams(t)};return new s5(r)}function cwr(e,t){return new s5({type:"object",shape:e,catchall:Xle(),...Le.normalizeParams(t)})}function np(e,t){return new s5({type:"object",shape:e,catchall:li(),...Le.normalizeParams(t)})}var Jle=ne("ZodUnion",(e,t)=>{KL.init(e,t),Ar.init(e,t),e.options=t.options});function pn(e,t){return new Jle({type:"union",options:e,...Le.normalizeParams(t)})}var XGe=ne("ZodDiscriminatedUnion",(e,t)=>{Jle.init(e,t),N8.init(e,t)});function c5(e,t,r){return new XGe({type:"union",options:t,discriminator:e,...Le.normalizeParams(r)})}var JGe=ne("ZodIntersection",(e,t)=>{I8.init(e,t),Ar.init(e,t)});function Ck(e,t){return new JGe({type:"intersection",left:e,right:t})}var ZGe=ne("ZodTuple",(e,t)=>{YL.init(e,t),Ar.init(e,t),e.rest=r=>e.clone({...e._zod.def,rest:r})});function QGe(e,t,r){let n=t instanceof Wt,i=n?r:t,a=n?t:null;return new ZGe({type:"tuple",items:e,rest:a,...Le.normalizeParams(i)})}var Zle=ne("ZodRecord",(e,t)=>{R8.init(e,t),Ar.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function vi(e,t,r){return new Zle({type:"record",keyType:e,valueType:t,...Le.normalizeParams(r)})}function uwr(e,t,r){let n=Ts(e);return n._zod.values=void 0,new Zle({type:"record",keyType:n,valueType:t,...Le.normalizeParams(r)})}var eKe=ne("ZodMap",(e,t)=>{L8.init(e,t),Ar.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function lwr(e,t,r){return new eKe({type:"map",keyType:e,valueType:t,...Le.normalizeParams(r)})}var tKe=ne("ZodSet",(e,t)=>{k8.init(e,t),Ar.init(e,t),e.min=(...r)=>e.check(a0(...r)),e.nonempty=r=>e.check(a0(1,r)),e.max=(...r)=>e.check(Px(...r)),e.size=(...r)=>e.check(GA(...r))});function pwr(e,t){return new tKe({type:"set",valueType:e,...Le.normalizeParams(t)})}var Ek=ne("ZodEnum",(e,t)=>{$8.init(e,t),Ar.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Ek({...t,checks:[],...Le.normalizeParams(i),entries:a})},e.exclude=(n,i)=>{let a={...t.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Ek({...t,checks:[],...Le.normalizeParams(i),entries:a})}});function $n(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ek({type:"enum",entries:r,...Le.normalizeParams(t)})}function fwr(e,t){return new Ek({type:"enum",entries:e,...Le.normalizeParams(t)})}var rKe=ne("ZodLiteral",(e,t)=>{M8.init(e,t),Ar.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function dt(e,t){return new rKe({type:"literal",values:Array.isArray(e)?e:[e],...Le.normalizeParams(t)})}var nKe=ne("ZodFile",(e,t)=>{F8.init(e,t),Ar.init(e,t),e.min=(r,n)=>e.check(a0(r,n)),e.max=(r,n)=>e.check(Px(r,n)),e.mime=(r,n)=>e.check(QA(Array.isArray(r)?r:[r],n))});function dwr(e){return U6(nKe,e)}var iKe=ne("ZodTransform",(e,t)=>{j8.init(e,t),Ar.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Jb(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(Le.issue(a,r.value,t));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),r.issues.push(Le.issue(o))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});function Qle(e){return new iKe({type:"transform",transform:e})}var epe=ne("ZodOptional",(e,t)=>{q8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pt(e){return new epe({type:"optional",innerType:e})}var aKe=ne("ZodNullable",(e,t)=>{V8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType});function r5(e){return new aKe({type:"nullable",innerType:e})}function hwr(e){return pt(r5(e))}var oKe=ne("ZodDefault",(e,t)=>{U8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function sKe(e,t){return new oKe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Le.shallowClone(t)}})}var cKe=ne("ZodPrefault",(e,t)=>{B8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType});function uKe(e,t){return new cKe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Le.shallowClone(t)}})}var tpe=ne("ZodNonOptional",(e,t)=>{z8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lKe(e,t){return new tpe({type:"nonoptional",innerType:e,...Le.normalizeParams(t)})}var pKe=ne("ZodSuccess",(e,t)=>{H8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType});function mwr(e){return new pKe({type:"success",innerType:e})}var fKe=ne("ZodCatch",(e,t)=>{G8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dKe(e,t){return new fKe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var hKe=ne("ZodNaN",(e,t)=>{K8.init(e,t),Ar.init(e,t)});function gwr(e){return $6(hKe,e)}var rpe=ne("ZodPipe",(e,t)=>{Y8.init(e,t),Ar.init(e,t),e.in=t.in,e.out=t.out});function n5(e,t){return new rpe({type:"pipe",in:e,out:t})}var npe=ne("ZodCodec",(e,t)=>{rpe.init(e,t),VA.init(e,t)});function ywr(e,t,r){return new npe({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var mKe=ne("ZodReadonly",(e,t)=>{W8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType});function gKe(e){return new mKe({type:"readonly",innerType:e})}var yKe=ne("ZodTemplateLiteral",(e,t)=>{X8.init(e,t),Ar.init(e,t)});function vwr(e,t){return new yKe({type:"template_literal",parts:e,...Le.normalizeParams(t)})}var vKe=ne("ZodLazy",(e,t)=>{Q8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.getter()});function bKe(e){return new vKe({type:"lazy",getter:e})}var EKe=ne("ZodPromise",(e,t)=>{Z8.init(e,t),Ar.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bwr(e){return new EKe({type:"promise",innerType:e})}var _Ke=ne("ZodFunction",(e,t)=>{J8.init(e,t),Ar.init(e,t)});function Ewr(e){return new _Ke({type:"function",input:Array.isArray(e?.input)?QGe(e?.input):e?.input??Bt(li()),output:e?.output??li()})}var u5=ne("ZodCustom",(e,t)=>{e6.init(e,t),Ar.init(e,t)});function _wr(e){let t=new ri({check:"custom"});return t._zod.check=e,t}function ipe(e,t){return B6(u5,e??(()=>!0),t)}function xKe(e,t={}){return z6(u5,e,t)}function TKe(e){return H6(e)}var xwr=G6,Twr=K6;function Owr(e,t={error:`Input not instance of ${e.name}`}){let r=new u5({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...Le.normalizeParams(t)});return r._zod.bag.Class=e,r}var Swr=(...e)=>Y6({Codec:npe,Boolean:Ok,String:_k},...e);function Awr(e){let t=bKe(()=>pn([re(e),kn(),Ji(),Ak(),Bt(t),vi(re(),t)]));return t}function l5(e,t){return n5(Qle(e),t)}var Cwr={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function wwr(e){ga({customError:e})}function Pwr(){return ga().customError}var ape;ape||(ape={});var ope={};Ni(ope,{bigint:()=>Rwr,boolean:()=>Iwr,date:()=>Lwr,number:()=>Nwr,string:()=>Dwr});function Dwr(e){return s6(_k,e)}function Nwr(e){return m6(Tk,e)}function Iwr(e){return x6(Ok,e)}function Rwr(e){return O6(Sk,e)}function Lwr(e){return k6(o5,e)}ga(t6());var cpe="2025-11-25";var OKe=[cpe,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Hh="io.modelcontextprotocol/related-task",f5="2.0",zh=ipe(e=>e!==null&&(typeof e=="object"||typeof e=="function")),SKe=pn([re(),kn().int()]),AKe=re(),$wr=np({ttl:pn([kn(),Ak()]).optional(),pollInterval:kn().optional()}),upe=np({taskId:re()}),Mwr=np({progressToken:SKe.optional(),[Hh]:upe.optional()}),Uu=np({task:$wr.optional(),_meta:Mwr.optional()}),Os=Ae({method:re(),params:Uu.optional()}),kx=np({_meta:Ae({[Hh]:pt(upe)}).passthrough().optional()}),nf=Ae({method:re(),params:kx.optional()}),ic=np({_meta:np({[Hh]:upe.optional()}).optional()}),d5=pn([re(),kn().int()]),CKe=Ae({jsonrpc:dt(f5),id:d5,...Os.shape}).strict(),lpe=e=>CKe.safeParse(e).success,wKe=Ae({jsonrpc:dt(f5),...nf.shape}).strict(),PKe=e=>wKe.safeParse(e).success,DKe=Ae({jsonrpc:dt(f5),id:d5,result:ic}).strict(),wk=e=>DKe.safeParse(e).success,an;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(an||(an={}));var NKe=Ae({jsonrpc:dt(f5),id:d5,error:Ae({code:kn().int(),message:re(),data:pt(li())})}).strict(),IKe=e=>NKe.safeParse(e).success,RKe=pn([CKe,wKe,DKe,NKe]),h5=ic.strict(),Fwr=kx.extend({requestId:d5,reason:re().optional()}),m5=nf.extend({method:dt("notifications/cancelled"),params:Fwr}),jwr=Ae({src:re(),mimeType:re().optional(),sizes:Bt(re()).optional()}),Pk=Ae({icons:Bt(jwr).optional()}),oC=Ae({name:re(),title:re().optional()}),LKe=oC.extend({...oC.shape,...Pk.shape,version:re(),websiteUrl:re().optional()}),qwr=Ck(Ae({applyDefaults:Ji().optional()}),vi(re(),li())),Vwr=l5(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ck(Ae({form:qwr.optional(),url:zh.optional()}),vi(re(),li()).optional())),Uwr=Ae({list:pt(Ae({}).passthrough()),cancel:pt(Ae({}).passthrough()),requests:pt(Ae({sampling:pt(Ae({createMessage:pt(Ae({}).passthrough())}).passthrough()),elicitation:pt(Ae({create:pt(Ae({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),Bwr=Ae({list:pt(Ae({}).passthrough()),cancel:pt(Ae({}).passthrough()),requests:pt(Ae({tools:pt(Ae({call:pt(Ae({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),zwr=Ae({experimental:vi(re(),zh).optional(),sampling:Ae({context:zh.optional(),tools:zh.optional()}).optional(),elicitation:Vwr.optional(),roots:Ae({listChanged:Ji().optional()}).optional(),tasks:pt(Uwr)}),Hwr=Uu.extend({protocolVersion:re(),capabilities:zwr,clientInfo:LKe}),ppe=Os.extend({method:dt("initialize"),params:Hwr});var Gwr=Ae({experimental:vi(re(),zh).optional(),logging:zh.optional(),completions:zh.optional(),prompts:pt(Ae({listChanged:pt(Ji())})),resources:Ae({subscribe:Ji().optional(),listChanged:Ji().optional()}).optional(),tools:Ae({listChanged:Ji().optional()}).optional(),tasks:pt(Bwr)}).passthrough(),Kwr=ic.extend({protocolVersion:re(),capabilities:Gwr,serverInfo:LKe,instructions:re().optional()}),fpe=nf.extend({method:dt("notifications/initialized")});var g5=Os.extend({method:dt("ping")}),Ywr=Ae({progress:kn(),total:pt(kn()),message:pt(re())}),Wwr=Ae({...kx.shape,...Ywr.shape,progressToken:SKe}),y5=nf.extend({method:dt("notifications/progress"),params:Wwr}),Xwr=Uu.extend({cursor:AKe.optional()}),Dk=Os.extend({params:Xwr.optional()}),Nk=ic.extend({nextCursor:pt(AKe)}),Ik=Ae({taskId:re(),status:$n(["working","input_required","completed","failed","cancelled"]),ttl:pn([kn(),Ak()]),createdAt:re(),lastUpdatedAt:re(),pollInterval:pt(kn()),statusMessage:pt(re())}),sC=ic.extend({task:Ik}),Jwr=kx.merge(Ik),Rk=nf.extend({method:dt("notifications/tasks/status"),params:Jwr}),v5=Os.extend({method:dt("tasks/get"),params:Uu.extend({taskId:re()})}),b5=ic.merge(Ik),E5=Os.extend({method:dt("tasks/result"),params:Uu.extend({taskId:re()})}),_5=Dk.extend({method:dt("tasks/list")}),x5=Nk.extend({tasks:Bt(Ik)}),kKe=Os.extend({method:dt("tasks/cancel"),params:Uu.extend({taskId:re()})}),$Ke=ic.merge(Ik),MKe=Ae({uri:re(),mimeType:pt(re()),_meta:vi(re(),li()).optional()}),FKe=MKe.extend({text:re()}),dpe=re().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),jKe=MKe.extend({blob:dpe}),qKe=Ae({...oC.shape,...Pk.shape,uri:re(),description:pt(re()),mimeType:pt(re()),_meta:pt(np({}))}),Zwr=Ae({...oC.shape,...Pk.shape,uriTemplate:re(),description:pt(re()),mimeType:pt(re()),_meta:pt(np({}))}),Qwr=Dk.extend({method:dt("resources/list")}),ePr=Nk.extend({resources:Bt(qKe)}),tPr=Dk.extend({method:dt("resources/templates/list")}),rPr=Nk.extend({resourceTemplates:Bt(Zwr)}),hpe=Uu.extend({uri:re()}),nPr=hpe,iPr=Os.extend({method:dt("resources/read"),params:nPr}),aPr=ic.extend({contents:Bt(pn([FKe,jKe]))}),oPr=nf.extend({method:dt("notifications/resources/list_changed")}),sPr=hpe,cPr=Os.extend({method:dt("resources/subscribe"),params:sPr}),uPr=hpe,lPr=Os.extend({method:dt("resources/unsubscribe"),params:uPr}),pPr=kx.extend({uri:re()}),fPr=nf.extend({method:dt("notifications/resources/updated"),params:pPr}),dPr=Ae({name:re(),description:pt(re()),required:pt(Ji())}),hPr=Ae({...oC.shape,...Pk.shape,description:pt(re()),arguments:pt(Bt(dPr)),_meta:pt(np({}))}),mPr=Dk.extend({method:dt("prompts/list")}),gPr=Nk.extend({prompts:Bt(hPr)}),yPr=Uu.extend({name:re(),arguments:vi(re(),re()).optional()}),vPr=Os.extend({method:dt("prompts/get"),params:yPr}),mpe=Ae({type:dt("text"),text:re(),_meta:vi(re(),li()).optional()}),gpe=Ae({type:dt("image"),data:dpe,mimeType:re(),_meta:vi(re(),li()).optional()}),ype=Ae({type:dt("audio"),data:dpe,mimeType:re(),_meta:vi(re(),li()).optional()}),bPr=Ae({type:dt("tool_use"),name:re(),id:re(),input:Ae({}).passthrough(),_meta:pt(Ae({}).passthrough())}).passthrough(),EPr=Ae({type:dt("resource"),resource:pn([FKe,jKe]),_meta:vi(re(),li()).optional()}),_Pr=qKe.extend({type:dt("resource_link")}),vpe=pn([mpe,gpe,ype,_Pr,EPr]),xPr=Ae({role:$n(["user","assistant"]),content:vpe}),TPr=ic.extend({description:pt(re()),messages:Bt(xPr)}),OPr=nf.extend({method:dt("notifications/prompts/list_changed")}),SPr=Ae({title:re().optional(),readOnlyHint:Ji().optional(),destructiveHint:Ji().optional(),idempotentHint:Ji().optional(),openWorldHint:Ji().optional()}),APr=Ae({taskSupport:$n(["required","optional","forbidden"]).optional()}),VKe=Ae({...oC.shape,...Pk.shape,description:re().optional(),inputSchema:Ae({type:dt("object"),properties:vi(re(),zh).optional(),required:Bt(re()).optional()}).catchall(li()),outputSchema:Ae({type:dt("object"),properties:vi(re(),zh).optional(),required:Bt(re()).optional()}).catchall(li()).optional(),annotations:pt(SPr),execution:pt(APr),_meta:vi(re(),li()).optional()}),bpe=Dk.extend({method:dt("tools/list")}),CPr=Nk.extend({tools:Bt(VKe)}),T5=ic.extend({content:Bt(vpe).default([]),structuredContent:vi(re(),li()).optional(),isError:pt(Ji())}),sSi=T5.or(ic.extend({toolResult:li()})),wPr=Uu.extend({name:re(),arguments:pt(vi(re(),li()))}),Lk=Os.extend({method:dt("tools/call"),params:wPr}),PPr=nf.extend({method:dt("notifications/tools/list_changed")}),kk=$n(["debug","info","notice","warning","error","critical","alert","emergency"]),DPr=Uu.extend({level:kk}),Epe=Os.extend({method:dt("logging/setLevel"),params:DPr}),NPr=kx.extend({level:kk,logger:re().optional(),data:li()}),IPr=nf.extend({method:dt("notifications/message"),params:NPr}),RPr=Ae({name:re().optional()}),LPr=Ae({hints:pt(Bt(RPr)),costPriority:pt(kn().min(0).max(1)),speedPriority:pt(kn().min(0).max(1)),intelligencePriority:pt(kn().min(0).max(1))}),kPr=Ae({mode:pt($n(["auto","required","none"]))}),$Pr=Ae({type:dt("tool_result"),toolUseId:re().describe("The unique identifier for the corresponding tool call."),content:Bt(vpe).default([]),structuredContent:Ae({}).passthrough().optional(),isError:pt(Ji()),_meta:pt(Ae({}).passthrough())}).passthrough(),MPr=c5("type",[mpe,gpe,ype]),p5=c5("type",[mpe,gpe,ype,bPr,$Pr]),FPr=Ae({role:$n(["user","assistant"]),content:pn([p5,Bt(p5)]),_meta:pt(Ae({}).passthrough())}).passthrough(),jPr=Uu.extend({messages:Bt(FPr),modelPreferences:LPr.optional(),systemPrompt:re().optional(),includeContext:$n(["none","thisServer","allServers"]).optional(),temperature:kn().optional(),maxTokens:kn().int(),stopSequences:Bt(re()).optional(),metadata:zh.optional(),tools:pt(Bt(VKe)),toolChoice:pt(kPr)}),qPr=Os.extend({method:dt("sampling/createMessage"),params:jPr}),_pe=ic.extend({model:re(),stopReason:pt($n(["endTurn","stopSequence","maxTokens"]).or(re())),role:$n(["user","assistant"]),content:MPr}),xpe=ic.extend({model:re(),stopReason:pt($n(["endTurn","stopSequence","maxTokens","toolUse"]).or(re())),role:$n(["user","assistant"]),content:pn([p5,Bt(p5)])}),VPr=Ae({type:dt("boolean"),title:re().optional(),description:re().optional(),default:Ji().optional()}),UPr=Ae({type:dt("string"),title:re().optional(),description:re().optional(),minLength:kn().optional(),maxLength:kn().optional(),format:$n(["email","uri","date","date-time"]).optional(),default:re().optional()}),BPr=Ae({type:$n(["number","integer"]),title:re().optional(),description:re().optional(),minimum:kn().optional(),maximum:kn().optional(),default:kn().optional()}),zPr=Ae({type:dt("string"),title:re().optional(),description:re().optional(),enum:Bt(re()),default:re().optional()}),HPr=Ae({type:dt("string"),title:re().optional(),description:re().optional(),oneOf:Bt(Ae({const:re(),title:re()})),default:re().optional()}),GPr=Ae({type:dt("string"),title:re().optional(),description:re().optional(),enum:Bt(re()),enumNames:Bt(re()).optional(),default:re().optional()}),KPr=pn([zPr,HPr]),YPr=Ae({type:dt("array"),title:re().optional(),description:re().optional(),minItems:kn().optional(),maxItems:kn().optional(),items:Ae({type:dt("string"),enum:Bt(re())}),default:Bt(re()).optional()}),WPr=Ae({type:dt("array"),title:re().optional(),description:re().optional(),minItems:kn().optional(),maxItems:kn().optional(),items:Ae({anyOf:Bt(Ae({const:re(),title:re()}))}),default:Bt(re()).optional()}),XPr=pn([YPr,WPr]),JPr=pn([GPr,KPr,XPr]),ZPr=pn([JPr,VPr,UPr,BPr]),QPr=Uu.extend({mode:dt("form").optional(),message:re(),requestedSchema:Ae({type:dt("object"),properties:vi(re(),ZPr),required:Bt(re()).optional()})}),eDr=Uu.extend({mode:dt("url"),message:re(),elicitationId:re(),url:re().url()}),tDr=pn([QPr,eDr]),rDr=Os.extend({method:dt("elicitation/create"),params:tDr}),nDr=kx.extend({elicitationId:re()}),iDr=nf.extend({method:dt("notifications/elicitation/complete"),params:nDr}),O5=ic.extend({action:$n(["accept","decline","cancel"]),content:l5(e=>e===null?void 0:e,vi(re(),pn([re(),kn(),Ji(),Bt(re())])).optional())}),aDr=Ae({type:dt("ref/resource"),uri:re()});var oDr=Ae({type:dt("ref/prompt"),name:re()}),sDr=Uu.extend({ref:pn([oDr,aDr]),argument:Ae({name:re(),value:re()}),context:Ae({arguments:vi(re(),re()).optional()}).optional()}),cDr=Os.extend({method:dt("completion/complete"),params:sDr});var uDr=ic.extend({completion:np({values:Bt(re()).max(100),total:pt(kn().int()),hasMore:pt(Ji())})}),lDr=Ae({uri:re().startsWith("file://"),name:re().optional(),_meta:vi(re(),li()).optional()}),pDr=Os.extend({method:dt("roots/list")}),Tpe=ic.extend({roots:Bt(lDr)}),fDr=nf.extend({method:dt("notifications/roots/list_changed")}),cSi=pn([g5,ppe,cDr,Epe,vPr,mPr,Qwr,tPr,iPr,cPr,lPr,Lk,bpe,v5,E5,_5]),uSi=pn([m5,y5,fpe,fDr,Rk]),lSi=pn([h5,_pe,xpe,O5,Tpe,b5,x5,sC]),pSi=pn([g5,qPr,rDr,pDr,v5,E5,_5]),fSi=pn([m5,y5,IPr,fPr,oPr,PPr,OPr,Rk,iDr]),dSi=pn([h5,Kwr,uDr,TPr,gPr,ePr,rPr,aPr,T5,CPr,b5,x5,sC]),Cr=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===an.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new spe(i.elicitations,r)}return new e(t,r,n)}},spe=class extends Cr{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(an.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){var t,r;return(r=(t=this.data)===null||t===void 0?void 0:t.elicitations)!==null&&r!==void 0?r:[]}};function s0(e){return e==="completed"||e==="failed"||e==="cancelled"}var dDr=Symbol("Let zodToJsonSchema decide on which parser to use");var KSi=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ope(e){let t=W6(e),r=t?.method;if(!r)throw new Error("Schema is missing a method literal");let n=FGe(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function Spe(e,t){let r=o0(e,t);if(!r.success)throw r.error;return r.data}var bDr=6e4,S5=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(m5,r=>{this._oncancel(r)}),this.setNotificationHandler(y5,r=>{this._onprogress(r)}),this.setRequestHandler(g5,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(v5,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Cr(an.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(E5,async(r,n)=>{let i=async()=>{var a;let o=r.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,l=u.id,p=this._requestResolvers.get(l);if(p)if(this._requestResolvers.delete(l),c.type==="response")p(u);else{let f=u,d=new Cr(f.error.code,f.error.message,f.error.data);p(d)}else{let f=c.type==="response"?"Response":"Error";this._onerror(new Error(`${f} handler missing for request ${l}`))}continue}await((a=this._transport)===null||a===void 0?void 0:a.send(c.message,{relatedRequestId:n.requestId}))}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new Cr(an.InvalidParams,`Task not found: ${o}`);if(!s0(s.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(s0(s.status)){let c=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[Hh]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(_5,async(r,n)=>{var i;try{let{tasks:a,nextCursor:o}=await this._taskStore.listTasks((i=r.params)===null||i===void 0?void 0:i.cursor,n.sessionId);return{tasks:a,nextCursor:o,_meta:{}}}catch(a){throw new Cr(an.InvalidParams,`Failed to list tasks: ${a instanceof Error?a.message:String(a)}`)}}),this.setRequestHandler(kKe,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new Cr(an.InvalidParams,`Task not found: ${r.params.taskId}`);if(s0(i.status))throw new Cr(an.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new Cr(an.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof Cr?i:new Cr(an.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(t){let r=this._requestHandlerAbortControllers.get(t.params.requestId);r?.abort(t.params.reason)}_setupTimeout(t,r,n,i,a=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),Cr.fromError(an.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var r,n,i;this._transport=t;let a=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{a?.(),this._onclose()};let o=(n=this.transport)===null||n===void 0?void 0:n.onerror;this._transport.onerror=c=>{o?.(c),this._onerror(c)};let s=(i=this._transport)===null||i===void 0?void 0:i.onmessage;this._transport.onmessage=(c,u)=>{s?.(c,u),wk(c)||IKe(c)?this._onresponse(c):lpe(c)?this._onrequest(c,u):PKe(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var t;let r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let n=Cr.fromError(an.ConnectionClosed,"Connection closed");this._transport=void 0,(t=this.onclose)===null||t===void 0||t.call(this);for(let i of r.values())i(n)}_onerror(t){var r;(r=this.onerror)===null||r===void 0||r.call(this,t)}_onnotification(t){var r;let n=(r=this._notificationHandlers.get(t.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(t,r){var n,i,a,o,s,c;let u=(n=this._requestHandlers.get(t.method))!==null&&n!==void 0?n:this.fallbackRequestHandler,l=this._transport,p=(o=(a=(i=t.params)===null||i===void 0?void 0:i._meta)===null||a===void 0?void 0:a[Hh])===null||o===void 0?void 0:o.taskId;if(u===void 0){let v={jsonrpc:"2.0",id:t.id,error:{code:an.MethodNotFound,message:"Method not found"}};p&&this._taskMessageQueue?this._enqueueTaskMessage(p,{type:"error",message:v,timestamp:Date.now()},l?.sessionId).catch(_=>this._onerror(new Error(`Failed to enqueue error response: ${_}`))):l?.send(v).catch(_=>this._onerror(new Error(`Failed to send an error response: ${_}`)));return}let f=new AbortController;this._requestHandlerAbortControllers.set(t.id,f);let d=(s=t.params)===null||s===void 0?void 0:s.task,h=this._taskStore?this.requestTaskStore(t,l?.sessionId):void 0,m={signal:f.signal,sessionId:l?.sessionId,_meta:(c=t.params)===null||c===void 0?void 0:c._meta,sendNotification:async v=>{let _={relatedRequestId:t.id};p&&(_.relatedTask={taskId:p}),await this.notification(v,_)},sendRequest:async(v,_,O)=>{var T,S;let A={...O,relatedRequestId:t.id};p&&!A.relatedTask&&(A.relatedTask={taskId:p});let P=(S=(T=A.relatedTask)===null||T===void 0?void 0:T.taskId)!==null&&S!==void 0?S:p;return P&&h&&await h.updateTaskStatus(P,"input_required"),await this.request(v,_,A)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:p,taskStore:h,taskRequestedTtl:d?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{d&&this.assertTaskHandlerCapability(t.method)}).then(()=>u(t,m)).then(async v=>{if(f.signal.aborted)return;let _={result:v,jsonrpc:"2.0",id:t.id};p&&this._taskMessageQueue?await this._enqueueTaskMessage(p,{type:"response",message:_,timestamp:Date.now()},l?.sessionId):await l?.send(_)},async v=>{var _;if(f.signal.aborted)return;let O={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(v.code)?v.code:an.InternalError,message:(_=v.message)!==null&&_!==void 0?_:"Internal error",...v.data!==void 0&&{data:v.data}}};p&&this._taskMessageQueue?await this._enqueueTaskMessage(p,{type:"error",message:O,timestamp:Date.now()},l?.sessionId):await l?.send(O)}).catch(v=>this._onerror(new Error(`Failed to send response: ${v}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(c);return}a(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),wk(t))n(t);else{let o=new Cr(t.error.code,t.error.message,t.error.data);n(o)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(wk(t)&&t.result&&typeof t.result=="object"){let o=t.result;if(o.task&&typeof o.task=="object"){let s=o.task;typeof s.taskId=="string"&&(a=!0,this._taskProgressTokens.set(s.taskId,r))}}if(a||this._progressHandlers.delete(r),wk(t))i(t);else{let o=Cr.fromError(t.error.code,t.error.message,t.error.data);i(o)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)===null||t===void 0?void 0:t.close())}async*requestStream(t,r,n){var i,a,o,s;let{task:c}=n??{};if(!c){try{yield{type:"result",result:await this.request(t,r,n)}}catch(l){yield{type:"error",error:l instanceof Cr?l:new Cr(an.InternalError,String(l))}}return}let u;try{let l=await this.request(t,sC,n);if(l.task)u=l.task.taskId,yield{type:"taskCreated",task:l.task};else throw new Cr(an.InternalError,"Task creation did not return a task");for(;;){let p=await this.getTask({taskId:u},n);if(yield{type:"taskStatus",task:p},s0(p.status)){p.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:u},r,n)}:p.status==="failed"?yield{type:"error",error:new Cr(an.InternalError,`Task ${u} failed`)}:p.status==="cancelled"&&(yield{type:"error",error:new Cr(an.InternalError,`Task ${u} was cancelled`)});return}if(p.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:u},r,n)};return}let f=(o=(i=p.pollInterval)!==null&&i!==void 0?i:(a=this._options)===null||a===void 0?void 0:a.defaultTaskPollInterval)!==null&&o!==void 0?o:1e3;await new Promise(d=>setTimeout(d,f)),(s=n?.signal)===null||s===void 0||s.throwIfAborted()}}catch(l){yield{type:"error",error:l instanceof Cr?l:new Cr(an.InternalError,String(l))}}}request(t,r,n){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,task:s,relatedTask:c}=n??{};return new Promise((u,l)=>{var p,f,d,h,m,v,_;let O=F=>{l(F)};if(!this._transport){O(new Error("Not connected"));return}if(((p=this._options)===null||p===void 0?void 0:p.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(F){O(F);return}(f=n?.signal)===null||f===void 0||f.throwIfAborted();let T=this._requestMessageId++,S={...t,jsonrpc:"2.0",id:T};n?.onprogress&&(this._progressHandlers.set(T,n.onprogress),S.params={...t.params,_meta:{...((d=t.params)===null||d===void 0?void 0:d._meta)||{},progressToken:T}}),s&&(S.params={...S.params,task:s}),c&&(S.params={...S.params,_meta:{...((h=S.params)===null||h===void 0?void 0:h._meta)||{},[Hh]:c}});let A=F=>{var K;this._responseHandlers.delete(T),this._progressHandlers.delete(T),this._cleanupTimeout(T),(K=this._transport)===null||K===void 0||K.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:T,reason:String(F)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(H=>this._onerror(new Error(`Failed to send cancellation: ${H}`)));let $=F instanceof Cr?F:new Cr(an.RequestTimeout,String(F));l($)};this._responseHandlers.set(T,F=>{var K;if(!(!((K=n?.signal)===null||K===void 0)&&K.aborted)){if(F instanceof Error)return l(F);try{let $=o0(r,F.result);$.success?u($.data):l($.error)}catch($){l($)}}}),(m=n?.signal)===null||m===void 0||m.addEventListener("abort",()=>{var F;A((F=n?.signal)===null||F===void 0?void 0:F.reason)});let P=(v=n?.timeout)!==null&&v!==void 0?v:bDr,k=()=>A(Cr.fromError(an.RequestTimeout,"Request timed out",{timeout:P}));this._setupTimeout(T,P,n?.maxTotalTimeout,k,(_=n?.resetTimeoutOnProgress)!==null&&_!==void 0?_:!1);let D=c?.taskId;if(D){let F=K=>{let $=this._responseHandlers.get(T);$?$(K):this._onerror(new Error(`Response handler missing for side-channeled request ${T}`))};this._requestResolvers.set(T,F),this._enqueueTaskMessage(D,{type:"request",message:S,timestamp:Date.now()}).catch(K=>{this._cleanupTimeout(T),l(K)})}else this._transport.send(S,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(F=>{this._cleanupTimeout(T),l(F)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},b5,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},x5,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},$Ke,r)}async notification(t,r){var n,i,a,o,s;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let c=(n=r?.relatedTask)===null||n===void 0?void 0:n.taskId;if(c){let f={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((i=t.params)===null||i===void 0?void 0:i._meta)||{},[Hh]:r.relatedTask}}};await this._enqueueTaskMessage(c,{type:"notification",message:f,timestamp:Date.now()});return}if(((o=(a=this._options)===null||a===void 0?void 0:a.debouncedNotificationMethods)!==null&&o!==void 0?o:[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var f,d;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let h={...t,jsonrpc:"2.0"};r?.relatedTask&&(h={...h,params:{...h.params,_meta:{...((f=h.params)===null||f===void 0?void 0:f._meta)||{},[Hh]:r.relatedTask}}}),(d=this._transport)===null||d===void 0||d.send(h,r).catch(m=>this._onerror(m))});return}let p={...t,jsonrpc:"2.0"};r?.relatedTask&&(p={...p,params:{...p.params,_meta:{...((s=p.params)===null||s===void 0?void 0:s._meta)||{},[Hh]:r.relatedTask}}}),await this._transport.send(p,r)}setRequestHandler(t,r){let n=Ope(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let o=Spe(t,i);return Promise.resolve(r(o,a))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=Ope(t);this._notificationHandlers.set(n,i=>{let a=Spe(t,i);return Promise.resolve(r(a))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){var i;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let a=(i=this._options)===null||i===void 0?void 0:i.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,a)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let i of n)if(i.type==="request"&&lpe(i.message)){let a=i.message.id,o=this._requestResolvers.get(a);o?(o(new Cr(an.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){var n,i,a;let o=(i=(n=this._options)===null||n===void 0?void 0:n.defaultTaskPollInterval)!==null&&i!==void 0?i:1e3;try{let s=await((a=this._taskStore)===null||a===void 0?void 0:a.getTask(t));s?.pollInterval&&(o=s.pollInterval)}catch{}return new Promise((s,c)=>{if(r.aborted){c(new Cr(an.InvalidRequest,"Request cancelled"));return}let u=setTimeout(s,o);r.addEventListener("abort",()=>{clearTimeout(u),c(new Cr(an.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!t)throw new Error("No request provided");return await n.createTask(i,t.id,{method:t.method,params:t.params},r)},getTask:async i=>{let a=await n.getTask(i,r);if(!a)throw new Cr(an.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(i,a,o)=>{await n.storeTaskResult(i,a,o,r);let s=await n.getTask(i,r);if(s){let c=Rk.parse({method:"notifications/tasks/status",params:s});await this.notification(c),s0(s.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,a,o)=>{let s=await n.getTask(i,r);if(!s)throw new Cr(an.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(s0(s.status))throw new Cr(an.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,a,o,r);let c=await n.getTask(i,r);if(c){let u=Rk.parse({method:"notifications/tasks/status",params:c});await this.notification(u),s0(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function UKe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function BKe(e,t){let r={...e};for(let n in t){let i=n,a=t[i];if(a===void 0)continue;let o=r[i];UKe(o)&&UKe(a)?r[i]={...o,...a}:r[i]=a}return r}var kWe=Ct(oz(),1),$We=Ct(LWe(),1);function s2r(){let e=new kWe.Ajv({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,$We.default)(e),e}var cz=class{constructor(t){this._ajv=t??s2r()}getValidator(t){var r;let n="$id"in t&&typeof t.$id=="string"?(r=this._ajv.getSchema(t.$id))!==null&&r!==void 0?r:this._ajv.compile(t):this._ajv.compile(t);return i=>n(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var uz=class{constructor(t){this._server=t}requestStream(t,r,n){return this._server.requestStream(t,r,n)}async getTask(t,r){return this._server.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._server.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._server.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._server.cancelTask({taskId:t},r)}};function MWe(e,t,r){var n;if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!(!((n=e.tools)===null||n===void 0)&&n.call))throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function FWe(e,t,r){var n,i;if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!(!((n=e.sampling)===null||n===void 0)&&n.createMessage))throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!(!((i=e.elicitation)===null||i===void 0)&&i.create))throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}var lz=class extends S5{constructor(t,r){var n,i;super(r),this._serverInfo=t,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(kk.options.map((a,o)=>[a,o])),this.isMessageIgnored=(a,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(a)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=(n=r?.capabilities)!==null&&n!==void 0?n:{},this._instructions=r?.instructions,this._jsonSchemaValidator=(i=r?.jsonSchemaValidator)!==null&&i!==void 0?i:new cz,this.setRequestHandler(ppe,a=>this._oninitialize(a)),this.setNotificationHandler(fpe,()=>{var a;return(a=this.oninitialized)===null||a===void 0?void 0:a.call(this)}),this._capabilities.logging&&this.setRequestHandler(Epe,async(a,o)=>{var s;let c=o.sessionId||((s=o.requestInfo)===null||s===void 0?void 0:s.headers["mcp-session-id"])||void 0,{level:u}=a.params,l=kk.safeParse(u);return l.success&&this._loggingLevels.set(c,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new uz(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=BKe(this._capabilities,t)}setRequestHandler(t,r){var n,i,a;let o=W6(t),s=o?.method;if(!s)throw new Error("Schema is missing a method literal");let c;if(iC(s)){let l=s,p=(n=l._zod)===null||n===void 0?void 0:n.def;c=(i=p?.value)!==null&&i!==void 0?i:l.value}else{let l=s,p=l._def;c=(a=p?.value)!==null&&a!==void 0?a:l.value}if(typeof c!="string")throw new Error("Schema method literal must be a string");if(c==="tools/call"){let l=async(p,f)=>{let d=o0(Lk,p);if(!d.success){let _=d.error instanceof Error?d.error.message:String(d.error);throw new Cr(an.InvalidParams,`Invalid tools/call request: ${_}`)}let{params:h}=d.data,m=await Promise.resolve(r(p,f));if(h.task){let _=o0(sC,m);if(!_.success){let O=_.error instanceof Error?_.error.message:String(_.error);throw new Cr(an.InvalidParams,`Invalid task creation result: ${O}`)}return _.data}let v=o0(T5,m);if(!v.success){let _=v.error instanceof Error?v.error.message:String(v.error);throw new Cr(an.InvalidParams,`Invalid tools/call result: ${_}`)}return v.data};return super.setRequestHandler(t,l)}return super.setRequestHandler(t,r)}assertCapabilityForMethod(t){var r,n,i;switch(t){case"sampling/createMessage":if(!(!((r=this._clientCapabilities)===null||r===void 0)&&r.sampling))throw new Error(`Client does not support sampling (required for ${t})`);break;case"elicitation/create":if(!(!((n=this._clientCapabilities)===null||n===void 0)&&n.elicitation))throw new Error(`Client does not support elicitation (required for ${t})`);break;case"roots/list":if(!(!((i=this._clientCapabilities)===null||i===void 0)&&i.roots))throw new Error(`Client does not support listing roots (required for ${t})`);break;case"ping":break}}assertNotificationCapability(t){var r,n;switch(t){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${t})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${t})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${t})`);break;case"notifications/elicitation/complete":if(!(!((n=(r=this._clientCapabilities)===null||r===void 0?void 0:r.elicitation)===null||n===void 0)&&n.url))throw new Error(`Client does not support URL elicitation (required for ${t})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${t})`);break;case"ping":case"initialize":break}}assertTaskCapability(t){var r,n;FWe((n=(r=this._clientCapabilities)===null||r===void 0?void 0:r.tasks)===null||n===void 0?void 0:n.requests,t,"Client")}assertTaskHandlerCapability(t){var r;this._capabilities&&MWe((r=this._capabilities.tasks)===null||r===void 0?void 0:r.requests,t,"Server")}async _oninitialize(t){let r=t.params.protocolVersion;return this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo,{protocolVersion:OKe.includes(r)?r:cpe,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},h5)}async createMessage(t,r){var n,i;if((t.tools||t.toolChoice)&&!(!((i=(n=this._clientCapabilities)===null||n===void 0?void 0:n.sampling)===null||i===void 0)&&i.tools))throw new Error("Client does not support sampling tools capability.");if(t.messages.length>0){let a=t.messages[t.messages.length-1],o=Array.isArray(a.content)?a.content:[a.content],s=o.some(p=>p.type==="tool_result"),c=t.messages.length>1?t.messages[t.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some(p=>p.type==="tool_use");if(s){if(o.some(p=>p.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let p=new Set(u.filter(d=>d.type==="tool_use").map(d=>d.id)),f=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(p.size!==f.size||![...p].every(d=>f.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return t.tools?this.request({method:"sampling/createMessage",params:t},xpe,r):this.request({method:"sampling/createMessage",params:t},_pe,r)}async elicitInput(t,r){var n,i,a,o,s;switch((n=t.mode)!==null&&n!==void 0?n:"form"){case"url":{if(!(!((a=(i=this._clientCapabilities)===null||i===void 0?void 0:i.elicitation)===null||a===void 0)&&a.url))throw new Error("Client does not support url elicitation.");let u=t;return this.request({method:"elicitation/create",params:u},O5,r)}case"form":{if(!(!((s=(o=this._clientCapabilities)===null||o===void 0?void 0:o.elicitation)===null||s===void 0)&&s.form))throw new Error("Client does not support form elicitation.");let u=t.mode==="form"?t:{...t,mode:"form"},l=await this.request({method:"elicitation/create",params:u},O5,r);if(l.action==="accept"&&l.content&&u.requestedSchema)try{let f=this._jsonSchemaValidator.getValidator(u.requestedSchema)(l.content);if(!f.valid)throw new Cr(an.InvalidParams,`Elicitation response content does not match requested schema: ${f.errorMessage}`)}catch(p){throw p instanceof Cr?p:new Cr(an.InternalError,`Error validating elicitation response: ${p instanceof Error?p.message:String(p)}`)}return l}}}createElicitationCompletionNotifier(t,r){var n,i;if(!(!((i=(n=this._clientCapabilities)===null||n===void 0?void 0:n.elicitation)===null||i===void 0)&&i.url))throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},r)}async listRoots(t,r){return this.request({method:"roots/list",params:t},Tpe,r)}async sendLoggingMessage(t,r){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,r))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var gde=Ct(require("node:process"),1);var pz=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
1652
1652
  `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),u2r(r)}clear(){this._buffer=void 0}};function u2r(e){return RKe.parse(JSON.parse(e))}function jWe(e){return JSON.stringify(e)+`
1653
- `}var fz=class{constructor(t=gde.default.stdin,r=gde.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new pz,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{var i;(i=this.onerror)===null||i===void 0||i.call(this,n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var t,r;;)try{let n=this._readBuffer.readMessage();if(n===null)break;(t=this.onmessage)===null||t===void 0||t.call(this,n)}catch(n){(r=this.onerror)===null||r===void 0||r.call(this,n)}}async close(){var t;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(t=this.onclose)===null||t===void 0||t.call(this)}send(t){return new Promise(r=>{let n=jWe(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var VWe="0.5.1";var f2={name:"@sap-ux/fiori-mcp-server",description:"SAP Fiori - Model Context Protocol (MCP) server",version:VWe,keywords:["SAP Fiori tools","SAP Fiori elements","SAP Fiori freestyle","MCP","AI"],repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/fiori-mcp-server"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Afiori-mcp-server"},license:"Apache-2.0",main:"dist/index.js",scripts:{"build-esbuild-base":"esbuild --bundle --platform=node --target=node20 --outdir=dist --external:vscode --external:@lancedb/lancedb --external:@xenova/transformers --external:@sap-ux/fiori-docs-embeddings --external:@sap-ux/store --main-fields=module,main src/index.ts","build-dev":"pnpm run build-esbuild-base --sourcemap=inline","build-compile":"tsc --noEmit","build-bundle":"pnpm run build-esbuild-base --minify",build:"npm-run-all build-compile build-bundle",watch:"tsc --watch",bundle:"npm-run-all build tgz:package tgz:rename","tgz:package":"pnpm pack","tgz:rename":"node -e \"const fs=require('fs'), p=require('./package.json'), d=new Date().toISOString().split('T')[0], oldName=p.name.startsWith('@') ? `${p.name.replace('@', '').replace('/', '-')}-${p.version}.tgz` : `${p.name}-${p.version}.tgz`; fs.renameSync(oldName, `${oldName.replace('.tgz','')}-${d}.tgz`)\"",clean:"rimraf --glob dist test/test-output *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint","lint:fix":"eslint --fix",test:"jest --ci --forceExit --detectOpenHandles --colors",inspector:"npx @modelcontextprotocol/inspector node dist/index.js",start:'npx -y supergateway --port 9881 --sessionTimeout 300000 --stdio "node ./dist/index.js"',"view:integration":"promptfoo view -y","test:integration:once":"promptfoo eval --config test/integration/scenarios/promptfooconfig.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:dev":"promptfoo eval --config test/integration/scenarios/test-dev.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:multiple":"npm run test:promptfoo -- --repeat 5"},files:["LICENSE","dist","!dist/**/*.map"],bin:{"fiori-mcp":"./dist/index.js"},devDependencies:{"npm-run-all2":"8.0.4",esbuild:"0.25.6","@modelcontextprotocol/sdk":"1.24.1","@sap-ux/axios-extension":"workspace:*","@sap/ux-specification":"1.139.2","@sap-ux/project-access":"workspace:*","@sap-ux/fiori-annotation-api":"workspace:*","@sap-ux/annotation-converter":"0.10.8","@sap-ux/edmx-parser":"0.9.6","@sap-ux/fiori-docs-embeddings":"workspace:*","@sap-ux/i18n":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/odata-annotation-core-types":"workspace:*","@sap-ux/odata-entity-model":"workspace:*","@sap-ux/text-document-utils":"workspace:*","@types/diff":"5.0.9","@types/json-schema":"7.0.5","@types/mem-fs":"1.1.2","@types/mem-fs-editor":"7.0.1","@sap-ux/btp-utils":"workspace:*","@sap-ux/feature-toggle":"workspace:*","@sap-ux/nodejs-utils":"workspace:*","@sap-ux/telemetry":"workspace:*",i18next:"25.3.0","os-name":"4.0.1",zod:"4.1.13","@sap-ai-sdk/foundation-models":"2.3.0","@sap-ai-sdk/langchain":"2.3.0",promptfoo:"0.119.14","@langchain/mcp-adapters":"1.0.2","@langchain/core":"1.1.1"},dependencies:{"@sap-ux/fiori-docs-embeddings":"workspace:*","@sap-ux/store":"workspace:*","@xenova/transformers":"2.17.2","@lancedb/lancedb":"0.22.0","mem-fs":"2.1.0","mem-fs-editor":"9.4.0"},engines:{node:">=20.x"}};var zWe=Ae({name:re().describe("Name of the Fiori application. Usually derived from the `sap.app/id` field in the application's manifest.json."),appPath:re().describe("Absolute path to the Fiori application's root directory."),projectPath:re().describe("Absolute path to the root directory of the project containing this Fiori application. For EDMXBackend (standalone) projects, this is the same as `appPath`. For CAP projects, this points to the CAP project root, which may contain multiple Fiori applications."),projectType:$n(["EDMXBackend","CAPJava","CAPNodejs"]).describe("Type of project the application belongs to."),odataVersion:re().describe("OData protocol version used by the application's main service.")}),Kx=pn([re(),Bt(pn([re(),kn()]))]),HWe=Ae({functionalityId:Kx.describe("Identifier to pass as the `functionalityId` parameter when calling `get_functionality_details` or `execute_functionality`"),description:re()}),UWe=$n(["object","array","string","number","boolean","null","integer","any"]),BWe=Ae({type:pn([UWe,Bt(UWe)]).optional(),description:re().optional(),properties:a5().optional()}).catchall(a5()),GWe=BWe.extend({properties:vi(re(),pn([BWe,Ji()])).optional()});var KWe=Ae({searchPath:Bt(re()).describe("Path to search for Fiori applications (defaults to current directory). If VSCode - list of VS Code workspace folder paths(`workspace.workspaceFolders`)")}),YWe=Ae({appPath:re().describe("Path to the root folder of the Fiori application (where package.json and ui5.yaml reside) if one exists or to the current directory. Path should be an absolute path.")}),WWe=Ae({appPath:re().describe("Path to the Fiori application if one exists or to the current directory. Path should be an absolute path."),functionalityId:Kx.describe("The ID of the functionality to get details for")}),XWe=Ae({functionalityId:Kx.describe("The ID of the functionality to execute"),parameters:vi(re(),li()).describe("Parameters for the functionality execution"),appPath:re().describe("Path to the Fiori application if one exists or to the current directory. Path should be an absolute path.")}).describe('Input object for executing a functionality. Only three top-level properties are allowed: "functionalityId", "parameters", and "appPath". All other dynamic or functionality-specific inputs must be included inside the "parameters" object. Do not place any additional fields at the root level.'),NDi=Ae({query:re().min(2).describe("The search query for fiori elements, annotations, sapui5, fiori tools documentation")});var RDi=re().describe("Search results as formatted text"),JWe=Ae({applications:Bt(zWe)}),ZWe=Ae({applicationPath:re(),functionalities:Bt(HWe)}),QWe=Ae({functionalityId:Kx.describe("Identifier to pass as the `functionalityId` parameter when calling `get_functionality_details` or `execute_functionality`"),name:re(),description:re(),technicalDescription:re().optional(),parameters:GWe,prerequisites:Bt(re()).optional(),impact:re().optional(),examples:Bt(re()).optional(),pageName:re().optional()}),eXe=Ae({functionalityId:Kx,status:re(),message:re(),parameters:li(),appPath:re(),changes:Bt(re()),timestamp:re()});var Qme=Ct(require("node:fs/promises")),hf=Ct(require("node:path"));var df=Ct(N0());function o9r(){let e=globalThis.LOG_LEVEL,t=process.env.LOG_LEVEL,r=process.argv.find(i=>i.startsWith("--log-level="))?.split("=")[1],n=e||t||r;if(n)switch(n.toUpperCase()){case"ERROR":return df.LogLevel.Error;case"WARN":return df.LogLevel.Warn;case"INFO":return df.LogLevel.Info;case"DEBUG":return df.LogLevel.Debug;case"VERBOSE":return df.LogLevel.Verbose;case"SILLY":return df.LogLevel.Silly;default:break}return df.LogLevel.Error}var s9r=o9r(),$t=new df.ToolsLogger({logLevel:s9r,transports:[new df.ConsoleTransport],logPrefix:"fiori-mcp"});async function wat(){try{let r;try{r=require("@sap-ux/fiori-docs-embeddings")}catch{try{r=await import("@sap-ux/fiori-docs-embeddings")}catch{r=null}}if(!r||typeof r.getDataPath!="function")throw new Error("Package not found or invalid");let n=r.getDataPath();return await Qme.default.access(n),$t.log("\u2713 Using @sap-ux/fiori-docs-embeddings package"),{dataPath:n,embeddingsPath:hf.default.join(n,"embeddings"),searchPath:hf.default.join(n,"search"),docsPath:hf.default.join(n,"docs"),isExternalPackage:!0,isAvailable:!0}}catch{$t.warn("Could not load @sap-ux/fiori-docs-embeddings package, trying local data...")}let e=hf.default.join(__dirname,"../../data");try{return await Qme.default.access(e),$t.log("\u2713 Using local data directory"),{dataPath:e,embeddingsPath:hf.default.join(e,"embeddings"),searchPath:hf.default.join(e,"search"),docsPath:hf.default.join(e,"docs"),isExternalPackage:!1,isAvailable:!0}}catch{$t.warn("Local data directory not available either")}let t=hf.default.join(__dirname,"../../data");return $t.warn("\u26A0\uFE0F No embeddings data available - running in limited mode"),{dataPath:t,embeddingsPath:hf.default.join(t,"embeddings"),searchPath:hf.default.join(t,"search"),docsPath:hf.default.join(t,"docs"),isExternalPackage:!1,isAvailable:!1}}var vc=Ct(bm()),nF=require("node:path");async function uu(e){try{e=(0,nF.join)(e);try{let t=await(0,vc.createApplicationAccess)(e);return{root:t.project.root,appId:t.getAppId(),applicationAccess:t}}catch(t){$t.warn(`Application was not found by given path. Error: ${t}`);let r=await(0,vc.findProjectRoot)(e),n=await(0,vc.getProject)(r);if(n)return{root:n.root,appId:""}}}catch(t){$t.warn(`Project was not found by given path. Error: ${t}`);return}}var b7=e=>{let t;switch(e){case vc.DirName.View:{t=(0,nF.join)(vc.DirName.Ext,vc.DirName.View);break}case vc.DirName.Fragment:{t=(0,nF.join)(vc.DirName.Ext,vc.DirName.Fragment);break}case vc.DirName.Controller:{t=(0,nF.join)(vc.DirName.Ext,vc.DirName.Controller);break}default:t=e}return t},Em=(e,t,r=new Set)=>{if(!e||typeof e!="object")return{};if(e.$ref?.startsWith("#/definitions/")){let i=e.$ref,a=i.replace("#/definitions/",""),o=t.definitions?.[a]??null;if(r.has(i))return{...o};if(r.add(i),o){let s={...e};return delete s.$ref,Em({...o,...s},t,r)}}let n={...e};return n.properties&&(n.properties=Object.fromEntries(Object.entries(n.properties).map(([i,a])=>[i,Em(a,t,r)]))),n.items&&(Array.isArray(n.items)?n.items=n.items.map(i=>Em(i,t,r)):n.items=Em(n.items,t,r)),n.allOf&&(n.allOf=n.allOf.map(i=>Em(i,t,r))),n.anyOf&&(n.anyOf=n.anyOf.map(i=>Em(i,t,r))),n.oneOf&&(n.oneOf=n.oneOf.map(i=>Em(i,t,r))),typeof n.additionalProperties=="object"&&(n.additionalProperties=Em(n.additionalProperties,t,r)),n},xxt=(e,t)=>({type:"object",properties:{[e]:t}}),xa=e=>{let t=Rx(e);return delete t.$schema,t},_m=(e,t)=>{try{return e.parse(t)}catch(r){throw r instanceof yle?new Error(`Missing required fields in parameters. ${JSON.stringify(r.issues,null,4)}`):new Error("Unknown error. Recheck input parameters.")}};var YIt=require("node:util"),WIt=require("node:child_process"),XIt=Ct(WAe());async function AW(e="1.18.5"){let t="@sap/generator-fiori";if((await(0,XIt.findInstalledPackages)(t,{minVersion:e}))?.length<1)throw new Error(`Fiori generator not found. Please install the Fiori generator >=${e} with 'npm install -g ${t}' and retry this call`)}var CW=(0,YIt.promisify)(WIt.exec);var JIt=require("@lancedb/lancedb");var XAe=Ct(require("fs/promises")),JAe=Ct(require("node:path")),wW=class{connection=null;tables=[];tableIndex=null;metadata=null;dataPath;constructor(t){this.dataPath=t||""}async initialize(){try{$t.log("Loading vector database from pre-built embeddings...");let t=await wat();if(!t.isAvailable)throw new Error("No embeddings data available");this.dataPath=t.embeddingsPath,$t.log(`Using embeddings path: ${this.dataPath} (external: ${t.isExternalPackage})`);let r=JAe.default.join(this.dataPath,"metadata.json"),n=await XAe.default.readFile(r,"utf-8");this.metadata=JSON.parse(n),$t.log("\u2713 Embedding metadata loaded:"),$t.log(` Model: ${this?.metadata?.model}`),$t.log(` Dimensions: ${this?.metadata?.dimensions}`),$t.log(` Total vectors: ${this?.metadata?.totalVectors}`),$t.log(` Created: ${this?.metadata?.createdAt}`),this.connection=await(0,JIt.connect)(this.dataPath);let i=JAe.default.join(this.dataPath,"table_index.json");try{let a=await XAe.default.readFile(i,"utf-8");this.tableIndex=JSON.parse(a),this.tables=[];for(let o of this.tableIndex?.tables||[]){let s=await this.connection.openTable(o);this.tables.push(s)}$t.log(`\u2713 Loaded ${this.tables.length} split tables`)}catch{$t.log("No table index found, trying single table...");try{let a=await this.connection.openTable("documents");this.tables=[a],this.tableIndex={tables:["documents"],totalTables:1,maxVectorsPerTable:-1,totalVectors:this.metadata?.totalVectors||0}}catch(a){throw new Error(`No tables found: ${a}`)}}$t.log("\u2713 Vector database loaded and ready")}catch(t){throw new Error(`Failed to load vector database: ${t}`)}}async semanticSearch(t,r=10,n){if(this.tables.length===0)throw new Error("Vector database not initialized");try{let i=[];for(let o of this.tables){let s=o.vectorSearch(t).limit(r*2);n&&(s=s.where(`category = "${n}"`));let c=await s.toArray();i.push(...c)}return i.sort((o,s)=>(o._distance||0)-(s._distance||0)),i.slice(0,r).map(o=>({document:{id:o.document_id,vector:o.vector,content:o.content,title:o.title,category:o.category,path:o.path,chunk_index:o.chunk_index,metadata:{tags:this.parseJsonField(o.tags_json)||[],headers:this.parseJsonField(o.headers_json)||[],lastModified:new Date(o.lastModified),wordCount:o.wordCount,excerpt:o.excerpt}},score:1-(o._distance||0),distance:o._distance||0}))}catch(i){throw $t.error(`Semantic search failed: ${i}`),new Error(`Semantic search failed: ${i}`)}}async findSimilarToText(t,r=5){return $t.warn("findSimilarToText requires embedding generation - not available in simplified mode"),[]}async findSimilarToDocument(t,r=5){if(this.tables.length===0)throw new Error("Vector database not initialized");try{let n=null;for(let s of this.tables){let c=await s.search("").where(`document_id = "${t}" AND chunk_index = 0`).limit(1).toArray();if(c.length>0){n=c[0].vector;break}}if(!n)return[];let i=[];for(let s of this.tables){let c=await s.vectorSearch(n).where(`document_id != "${t}"`).limit(r*2).toArray();i.push(...c)}let a=new Map;for(let s of i){let c=s.document_id,u=1-(s._distance||0);(!a.has(c)||a.get(c).score<u)&&a.set(c,{...s,score:u,distance:s._distance||0})}return Array.from(a.values()).sort((s,c)=>c.score-s.score).slice(0,r).map(s=>({document:{id:s.document_id,vector:s.vector,content:s.content,title:s.title,category:s.category,path:s.path,chunk_index:s.chunk_index,metadata:{tags:this.parseJsonField(s.tags_json)||[],headers:this.parseJsonField(s.headers_json)||[],lastModified:new Date(s.lastModified),wordCount:s.wordCount,excerpt:s.excerpt}},score:s.score,distance:s.distance}))}catch(n){return $t.error(`Find similar documents failed: ${n}`),[]}}async getDocumentsByCategory(t,r){if(this.tables.length===0)throw new Error("Vector database not initialized");try{let n=[];for(let a of this.tables){let o=a.search("").where(`category = "${t}" AND chunk_index = 0`);r&&(o=o.limit(Math.ceil(r/this.tables.length)+10));let s=await o.toArray();n.push(...s)}return(r?n.slice(0,r):n).map(a=>({document:{id:a.document_id,vector:a.vector,content:a.content,title:a.title,category:a.category,path:a.path,chunk_index:a.chunk_index,metadata:{tags:this.parseJsonField(a.tags_json)||[],headers:this.parseJsonField(a.headers_json)||[],lastModified:new Date(a.lastModified),wordCount:a.wordCount,excerpt:a.excerpt}},score:1,distance:0}))}catch(n){return $t.error(`Get documents by category failed: ${n}`),[]}}getMetadata(){return this.metadata}parseJsonField(t){try{return t?JSON.parse(t):[]}catch{return[]}}isInitialized(){return this.tables.length>0&&this.metadata!==null}async close(){this.connection&&(this.connection=null,this.tables=[],$t.log("Vector database connection closed"))}};var PW=class{pipeline=null;initialized=!1;async initialize(){if(!this.initialized)try{let{pipeline:t}=await import("@xenova/transformers");this.pipeline=await t("feature-extraction","Xenova/all-MiniLM-L6-v2",{quantized:!1}),this.initialized=!0}catch(t){throw new Error(`Failed to initialize text embedding service: ${t}. Make sure @xenova/transformers is available.`)}}async generateEmbedding(t){if(!this.initialized||!this.pipeline)throw new Error("Text embedding service not initialized. Call initialize() first.");try{let r=t.replace(/\n+/g," ").replace(/\s+/g," ").trim().substring(0,8192);if(!r)throw new Error("Empty text provided for embedding");let n=await this.pipeline(r,{pooling:"mean",normalize:!0});return Array.from(n.data)}catch(r){throw new Error(`Failed to generate embedding: ${r}`)}}isInitialized(){return this.initialized}};async function ZAe(e,t=!1){let{query:r,maxResults:n}=e;try{let i=new wW,a=new PW;await i.initialize(),await a.initialize();let o=await a.generateEmbedding(r),s=await i.semanticSearch(o,n??10);if(t){let c="";for(let[u,l]of s.entries())c+=`Result ${u+1}:
1653
+ `}var fz=class{constructor(t=gde.default.stdin,r=gde.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new pz,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{var i;(i=this.onerror)===null||i===void 0||i.call(this,n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var t,r;;)try{let n=this._readBuffer.readMessage();if(n===null)break;(t=this.onmessage)===null||t===void 0||t.call(this,n)}catch(n){(r=this.onerror)===null||r===void 0||r.call(this,n)}}async close(){var t;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(t=this.onclose)===null||t===void 0||t.call(this)}send(t){return new Promise(r=>{let n=jWe(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var VWe="0.6.0";var f2={name:"@sap-ux/fiori-mcp-server",description:"SAP Fiori - Model Context Protocol (MCP) server",version:VWe,keywords:["SAP Fiori tools","SAP Fiori elements","SAP Fiori freestyle","MCP","AI"],repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/fiori-mcp-server"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Afiori-mcp-server"},license:"Apache-2.0",main:"dist/index.js",scripts:{"build-esbuild-base":"esbuild --bundle --platform=node --target=node20 --outdir=dist --external:vscode --external:@lancedb/lancedb --external:@xenova/transformers --external:@sap-ux/fiori-docs-embeddings --external:@sap-ux/store --main-fields=module,main src/index.ts","build-dev":"pnpm run build-esbuild-base --sourcemap=inline","build-compile":"tsc --noEmit","build-bundle":"pnpm run build-esbuild-base --minify",build:"npm-run-all build-compile build-bundle",watch:"tsc --watch",bundle:"npm-run-all build tgz:package tgz:rename","tgz:package":"pnpm pack","tgz:rename":"node -e \"const fs=require('fs'), p=require('./package.json'), d=new Date().toISOString().split('T')[0], oldName=p.name.startsWith('@') ? `${p.name.replace('@', '').replace('/', '-')}-${p.version}.tgz` : `${p.name}-${p.version}.tgz`; fs.renameSync(oldName, `${oldName.replace('.tgz','')}-${d}.tgz`)\"",clean:"rimraf --glob dist test/test-output *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint","lint:fix":"eslint --fix",test:"jest --ci --forceExit --detectOpenHandles --colors",inspector:"npx @modelcontextprotocol/inspector node dist/index.js",start:'npx -y supergateway --port 9881 --sessionTimeout 300000 --stdio "node ./dist/index.js"',"view:integration":"promptfoo view -y","test:integration:once":"promptfoo eval --config test/integration/scenarios/promptfooconfig.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:dev":"promptfoo eval --config test/integration/scenarios/test-dev.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:multiple":"npm run test:promptfoo -- --repeat 5"},files:["LICENSE","dist","!dist/**/*.map"],bin:{"fiori-mcp":"./dist/index.js"},devDependencies:{"npm-run-all2":"8.0.4",esbuild:"0.25.6","@modelcontextprotocol/sdk":"1.24.1","@sap-ux/axios-extension":"workspace:*","@sap/ux-specification":"1.139.2","@sap-ux/project-access":"workspace:*","@sap-ux/fiori-annotation-api":"workspace:*","@sap-ux/annotation-converter":"0.10.9","@sap-ux/edmx-parser":"0.9.6","@sap-ux/fiori-docs-embeddings":"workspace:*","@sap-ux/i18n":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/odata-annotation-core-types":"workspace:*","@sap-ux/odata-entity-model":"workspace:*","@sap-ux/text-document-utils":"workspace:*","@types/diff":"5.0.9","@types/json-schema":"7.0.5","@types/mem-fs":"1.1.2","@types/mem-fs-editor":"7.0.1","@sap-ux/btp-utils":"workspace:*","@sap-ux/feature-toggle":"workspace:*","@sap-ux/nodejs-utils":"workspace:*","@sap-ux/telemetry":"workspace:*",i18next:"25.3.0","os-name":"4.0.1",zod:"4.1.13","@sap-ai-sdk/foundation-models":"2.3.0","@sap-ai-sdk/langchain":"2.3.0",promptfoo:"0.119.14","@langchain/mcp-adapters":"1.0.2","@langchain/core":"1.1.1"},dependencies:{"@sap-ux/fiori-docs-embeddings":"workspace:*","@sap-ux/store":"workspace:*","@xenova/transformers":"2.17.2","@lancedb/lancedb":"0.22.0","mem-fs":"2.1.0","mem-fs-editor":"9.4.0"},engines:{node:">=20.x"}};var zWe=Ae({name:re().describe("Name of the Fiori application. Usually derived from the `sap.app/id` field in the application's manifest.json."),appPath:re().describe("Absolute path to the Fiori application's root directory."),projectPath:re().describe("Absolute path to the root directory of the project containing this Fiori application. For EDMXBackend (standalone) projects, this is the same as `appPath`. For CAP projects, this points to the CAP project root, which may contain multiple Fiori applications."),projectType:$n(["EDMXBackend","CAPJava","CAPNodejs"]).describe("Type of project the application belongs to."),odataVersion:re().describe("OData protocol version used by the application's main service.")}),Kx=pn([re(),Bt(pn([re(),kn()]))]),HWe=Ae({functionalityId:Kx.describe("Identifier to pass as the `functionalityId` parameter when calling `get_functionality_details` or `execute_functionality`"),description:re()}),UWe=$n(["object","array","string","number","boolean","null","integer","any"]),BWe=Ae({type:pn([UWe,Bt(UWe)]).optional(),description:re().optional(),properties:a5().optional()}).catchall(a5()),GWe=BWe.extend({properties:vi(re(),pn([BWe,Ji()])).optional()});var KWe=Ae({searchPath:Bt(re()).describe("Path to search for Fiori applications (defaults to current directory). If VSCode - list of VS Code workspace folder paths(`workspace.workspaceFolders`)")}),YWe=Ae({appPath:re().describe("Path to the root folder of the Fiori application (where package.json and ui5.yaml reside) if one exists or to the current directory. Path should be an absolute path.")}),WWe=Ae({appPath:re().describe("Path to the Fiori application if one exists or to the current directory. Path should be an absolute path."),functionalityId:Kx.describe("The ID of the functionality to get details for")}),XWe=Ae({functionalityId:Kx.describe("The ID of the functionality to execute"),parameters:vi(re(),li()).describe("Parameters for the functionality execution"),appPath:re().describe("Path to the Fiori application if one exists or to the current directory. Path should be an absolute path.")}).describe('Input object for executing a functionality. Only three top-level properties are allowed: "functionalityId", "parameters", and "appPath". All other dynamic or functionality-specific inputs must be included inside the "parameters" object. Do not place any additional fields at the root level.'),NDi=Ae({query:re().min(2).describe("The search query for fiori elements, annotations, sapui5, fiori tools documentation")});var RDi=re().describe("Search results as formatted text"),JWe=Ae({applications:Bt(zWe)}),ZWe=Ae({applicationPath:re(),functionalities:Bt(HWe)}),QWe=Ae({functionalityId:Kx.describe("Identifier to pass as the `functionalityId` parameter when calling `get_functionality_details` or `execute_functionality`"),name:re(),description:re(),technicalDescription:re().optional(),parameters:GWe,prerequisites:Bt(re()).optional(),impact:re().optional(),examples:Bt(re()).optional(),pageName:re().optional()}),eXe=Ae({functionalityId:Kx,status:re(),message:re(),parameters:li(),appPath:re(),changes:Bt(re()),timestamp:re()});var Qme=Ct(require("node:fs/promises")),hf=Ct(require("node:path"));var df=Ct(N0());function o9r(){let e=globalThis.LOG_LEVEL,t=process.env.LOG_LEVEL,r=process.argv.find(i=>i.startsWith("--log-level="))?.split("=")[1],n=e||t||r;if(n)switch(n.toUpperCase()){case"ERROR":return df.LogLevel.Error;case"WARN":return df.LogLevel.Warn;case"INFO":return df.LogLevel.Info;case"DEBUG":return df.LogLevel.Debug;case"VERBOSE":return df.LogLevel.Verbose;case"SILLY":return df.LogLevel.Silly;default:break}return df.LogLevel.Error}var s9r=o9r(),$t=new df.ToolsLogger({logLevel:s9r,transports:[new df.ConsoleTransport],logPrefix:"fiori-mcp"});async function wat(){try{let r;try{r=require("@sap-ux/fiori-docs-embeddings")}catch{try{r=await import("@sap-ux/fiori-docs-embeddings")}catch{r=null}}if(!r||typeof r.getDataPath!="function")throw new Error("Package not found or invalid");let n=r.getDataPath();return await Qme.default.access(n),$t.log("\u2713 Using @sap-ux/fiori-docs-embeddings package"),{dataPath:n,embeddingsPath:hf.default.join(n,"embeddings"),searchPath:hf.default.join(n,"search"),docsPath:hf.default.join(n,"docs"),isExternalPackage:!0,isAvailable:!0}}catch{$t.warn("Could not load @sap-ux/fiori-docs-embeddings package, trying local data...")}let e=hf.default.join(__dirname,"../../data");try{return await Qme.default.access(e),$t.log("\u2713 Using local data directory"),{dataPath:e,embeddingsPath:hf.default.join(e,"embeddings"),searchPath:hf.default.join(e,"search"),docsPath:hf.default.join(e,"docs"),isExternalPackage:!1,isAvailable:!0}}catch{$t.warn("Local data directory not available either")}let t=hf.default.join(__dirname,"../../data");return $t.warn("\u26A0\uFE0F No embeddings data available - running in limited mode"),{dataPath:t,embeddingsPath:hf.default.join(t,"embeddings"),searchPath:hf.default.join(t,"search"),docsPath:hf.default.join(t,"docs"),isExternalPackage:!1,isAvailable:!1}}var vc=Ct(bm()),nF=require("node:path");async function uu(e){try{e=(0,nF.join)(e);try{let t=await(0,vc.createApplicationAccess)(e);return{root:t.project.root,appId:t.getAppId(),applicationAccess:t}}catch(t){$t.warn(`Application was not found by given path. Error: ${t}`);let r=await(0,vc.findProjectRoot)(e),n=await(0,vc.getProject)(r);if(n)return{root:n.root,appId:""}}}catch(t){$t.warn(`Project was not found by given path. Error: ${t}`);return}}var b7=e=>{let t;switch(e){case vc.DirName.View:{t=(0,nF.join)(vc.DirName.Ext,vc.DirName.View);break}case vc.DirName.Fragment:{t=(0,nF.join)(vc.DirName.Ext,vc.DirName.Fragment);break}case vc.DirName.Controller:{t=(0,nF.join)(vc.DirName.Ext,vc.DirName.Controller);break}default:t=e}return t},Em=(e,t,r=new Set)=>{if(!e||typeof e!="object")return{};if(e.$ref?.startsWith("#/definitions/")){let i=e.$ref,a=i.replace("#/definitions/",""),o=t.definitions?.[a]??null;if(r.has(i))return{...o};if(r.add(i),o){let s={...e};return delete s.$ref,Em({...o,...s},t,r)}}let n={...e};return n.properties&&(n.properties=Object.fromEntries(Object.entries(n.properties).map(([i,a])=>[i,Em(a,t,r)]))),n.items&&(Array.isArray(n.items)?n.items=n.items.map(i=>Em(i,t,r)):n.items=Em(n.items,t,r)),n.allOf&&(n.allOf=n.allOf.map(i=>Em(i,t,r))),n.anyOf&&(n.anyOf=n.anyOf.map(i=>Em(i,t,r))),n.oneOf&&(n.oneOf=n.oneOf.map(i=>Em(i,t,r))),typeof n.additionalProperties=="object"&&(n.additionalProperties=Em(n.additionalProperties,t,r)),n},xxt=(e,t)=>({type:"object",properties:{[e]:t}}),xa=e=>{let t=Rx(e);return delete t.$schema,t},_m=(e,t)=>{try{return e.parse(t)}catch(r){throw r instanceof yle?new Error(`Missing required fields in parameters. ${JSON.stringify(r.issues,null,4)}`):new Error("Unknown error. Recheck input parameters.")}};var YIt=require("node:util"),WIt=require("node:child_process"),XIt=Ct(WAe());async function AW(e="1.18.5"){let t="@sap/generator-fiori";if((await(0,XIt.findInstalledPackages)(t,{minVersion:e}))?.length<1)throw new Error(`Fiori generator not found. Please install the Fiori generator >=${e} with 'npm install -g ${t}' and retry this call`)}var CW=(0,YIt.promisify)(WIt.exec);var JIt=require("@lancedb/lancedb");var XAe=Ct(require("fs/promises")),JAe=Ct(require("node:path")),wW=class{connection=null;tables=[];tableIndex=null;metadata=null;dataPath;constructor(t){this.dataPath=t||""}async initialize(){try{$t.log("Loading vector database from pre-built embeddings...");let t=await wat();if(!t.isAvailable)throw new Error("No embeddings data available");this.dataPath=t.embeddingsPath,$t.log(`Using embeddings path: ${this.dataPath} (external: ${t.isExternalPackage})`);let r=JAe.default.join(this.dataPath,"metadata.json"),n=await XAe.default.readFile(r,"utf-8");this.metadata=JSON.parse(n),$t.log("\u2713 Embedding metadata loaded:"),$t.log(` Model: ${this?.metadata?.model}`),$t.log(` Dimensions: ${this?.metadata?.dimensions}`),$t.log(` Total vectors: ${this?.metadata?.totalVectors}`),$t.log(` Created: ${this?.metadata?.createdAt}`),this.connection=await(0,JIt.connect)(this.dataPath);let i=JAe.default.join(this.dataPath,"table_index.json");try{let a=await XAe.default.readFile(i,"utf-8");this.tableIndex=JSON.parse(a),this.tables=[];for(let o of this.tableIndex?.tables||[]){let s=await this.connection.openTable(o);this.tables.push(s)}$t.log(`\u2713 Loaded ${this.tables.length} split tables`)}catch{$t.log("No table index found, trying single table...");try{let a=await this.connection.openTable("documents");this.tables=[a],this.tableIndex={tables:["documents"],totalTables:1,maxVectorsPerTable:-1,totalVectors:this.metadata?.totalVectors||0}}catch(a){throw new Error(`No tables found: ${a}`)}}$t.log("\u2713 Vector database loaded and ready")}catch(t){throw new Error(`Failed to load vector database: ${t}`)}}async semanticSearch(t,r=10,n){if(this.tables.length===0)throw new Error("Vector database not initialized");try{let i=[];for(let o of this.tables){let s=o.vectorSearch(t).limit(r*2);n&&(s=s.where(`category = "${n}"`));let c=await s.toArray();i.push(...c)}return i.sort((o,s)=>(o._distance||0)-(s._distance||0)),i.slice(0,r).map(o=>({document:{id:o.document_id,vector:o.vector,content:o.content,title:o.title,category:o.category,path:o.path,chunk_index:o.chunk_index,metadata:{tags:this.parseJsonField(o.tags_json)||[],headers:this.parseJsonField(o.headers_json)||[],lastModified:new Date(o.lastModified),wordCount:o.wordCount,excerpt:o.excerpt}},score:1-(o._distance||0),distance:o._distance||0}))}catch(i){throw $t.error(`Semantic search failed: ${i}`),new Error(`Semantic search failed: ${i}`)}}async findSimilarToText(t,r=5){return $t.warn("findSimilarToText requires embedding generation - not available in simplified mode"),[]}async findSimilarToDocument(t,r=5){if(this.tables.length===0)throw new Error("Vector database not initialized");try{let n=null;for(let s of this.tables){let c=await s.search("").where(`document_id = "${t}" AND chunk_index = 0`).limit(1).toArray();if(c.length>0){n=c[0].vector;break}}if(!n)return[];let i=[];for(let s of this.tables){let c=await s.vectorSearch(n).where(`document_id != "${t}"`).limit(r*2).toArray();i.push(...c)}let a=new Map;for(let s of i){let c=s.document_id,u=1-(s._distance||0);(!a.has(c)||a.get(c).score<u)&&a.set(c,{...s,score:u,distance:s._distance||0})}return Array.from(a.values()).sort((s,c)=>c.score-s.score).slice(0,r).map(s=>({document:{id:s.document_id,vector:s.vector,content:s.content,title:s.title,category:s.category,path:s.path,chunk_index:s.chunk_index,metadata:{tags:this.parseJsonField(s.tags_json)||[],headers:this.parseJsonField(s.headers_json)||[],lastModified:new Date(s.lastModified),wordCount:s.wordCount,excerpt:s.excerpt}},score:s.score,distance:s.distance}))}catch(n){return $t.error(`Find similar documents failed: ${n}`),[]}}async getDocumentsByCategory(t,r){if(this.tables.length===0)throw new Error("Vector database not initialized");try{let n=[];for(let a of this.tables){let o=a.search("").where(`category = "${t}" AND chunk_index = 0`);r&&(o=o.limit(Math.ceil(r/this.tables.length)+10));let s=await o.toArray();n.push(...s)}return(r?n.slice(0,r):n).map(a=>({document:{id:a.document_id,vector:a.vector,content:a.content,title:a.title,category:a.category,path:a.path,chunk_index:a.chunk_index,metadata:{tags:this.parseJsonField(a.tags_json)||[],headers:this.parseJsonField(a.headers_json)||[],lastModified:new Date(a.lastModified),wordCount:a.wordCount,excerpt:a.excerpt}},score:1,distance:0}))}catch(n){return $t.error(`Get documents by category failed: ${n}`),[]}}getMetadata(){return this.metadata}parseJsonField(t){try{return t?JSON.parse(t):[]}catch{return[]}}isInitialized(){return this.tables.length>0&&this.metadata!==null}async close(){this.connection&&(this.connection=null,this.tables=[],$t.log("Vector database connection closed"))}};var PW=class{pipeline=null;initialized=!1;async initialize(){if(!this.initialized)try{let{pipeline:t}=await import("@xenova/transformers");this.pipeline=await t("feature-extraction","Xenova/all-MiniLM-L6-v2",{quantized:!1}),this.initialized=!0}catch(t){throw new Error(`Failed to initialize text embedding service: ${t}. Make sure @xenova/transformers is available.`)}}async generateEmbedding(t){if(!this.initialized||!this.pipeline)throw new Error("Text embedding service not initialized. Call initialize() first.");try{let r=t.replace(/\n+/g," ").replace(/\s+/g," ").trim().substring(0,8192);if(!r)throw new Error("Empty text provided for embedding");let n=await this.pipeline(r,{pooling:"mean",normalize:!0});return Array.from(n.data)}catch(r){throw new Error(`Failed to generate embedding: ${r}`)}}isInitialized(){return this.initialized}};async function ZAe(e,t=!1){let{query:r,maxResults:n}=e;try{let i=new wW,a=new PW;await i.initialize(),await a.initialize();let o=await a.generateEmbedding(r),s=await i.semanticSearch(o,n??10);if(t){let c="";for(let[u,l]of s.entries())c+=`Result ${u+1}:
1654
1654
 
1655
1655
  `,c+=`${l.document.content}
1656
1656
  `,c+=`---
@@ -1686,7 +1686,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1686
1686
  Then retrieves the metadata of a specific SAP service using the matched SAP system and servicePath provided by the user.
1687
1687
  (if the user provided a full URL - pass the whole URL as sapSystemQuery parameter and just the path as servicePath).
1688
1688
  Finally, it stores the fetched metadata in the appPath folder as metadata.xml,
1689
- and returns service details: host, servicePath, client and metadataFilePath.`,parameters:{type:"object",required:["servicePath"],properties:{sapSystemQuery:{type:"string",description:"The name, host or a URL of the SAP system to fetch service metadata from."},servicePath:{type:"string",description:"The path to the SAP service to fetch metadata for."}}}};var q9t=Ct(require("node:path")),V9t=Ct(require("node:fs"));var rte=Ct(Gzt()),L9t=require("@sap-ux/store/dist/services/backend-system"),k9t=Ct(N0()),$9t=Ct(R9t());async function Z7n(){let e=new k9t.ToolsLogger({logPrefix:"fiori-mcp-server"});return new L9t.SystemService(e).getAll({includeSensitiveData:!0})}function M9t(e){let t="",r="",n="";if(e.startsWith("http"))try{let i=new URL(e);t=i.origin,r=i.searchParams.get("sap-client")??"",n=i.pathname}catch{}return{origin:t,client:r,path:n}}function Q7n(e,t){let{origin:r,client:n}=M9t(t);if(!r)return[];let i=e.filter(a=>a.url.startsWith(r)&&(!n||a.client===n));return i.length||(i=e.filter(a=>a.url.startsWith(r))),i.length||(i=[{name:r,url:r,client:n}]),i}async function F9t(e){let t=await Z7n(),r=t.filter(i=>i.name===e),n=e.toLocaleLowerCase();if(r?.length!==1&&(r=t.filter(i=>i.name.toLocaleLowerCase()===n)),r?.length!==1&&(r=t.filter(i=>i.name.toLocaleLowerCase().startsWith(n))),r?.length!==1&&(r=t.filter(i=>i.name.toLocaleLowerCase().includes(n))),r?.length!==1&&(r=Q7n(t,e)),!r||!Array.isArray(r))throw new Error(`No matching system found for: ${e}`);if(r.length>1){let i=r.map(a=>a.name).join(", ");throw new Error(`Multiple systems found matching: ${e}. Please be more specific. Matched systems: ${i}`)}return r[0]}async function eYn(e,t){let r={baseURL:e.url,params:{"sap-client":e.client}};e.username&&e.password&&(r.auth={username:e.username,password:e.password});let n=new rte.AbapServiceProvider(r),i=[];try{i=await n.catalog(rte.ODataVersion.v4).listServices()}catch{}let a=i.filter(o=>o.path===t);if(a.length>1)throw new Error(`Multiple ODATA V4 Services found matching path: ${t}`);return a.length===1?n.service(a[0].path):(t.startsWith("http")&&(t=M9t(t).path),n.service(t))}function tYn(e){let t;try{t=(0,$9t.parse)(e)}catch{}if(!t)throw new Error("Failed to parse service metadata. The service may not be a valid OData V4 service.")}async function j9t(e,t){let n=await(await eYn(e,t)).metadata();return tYn(n),n}async function U9t(e){let t=String(e.parameters?.sapSystemQuery??"").trim(),r=String(e.parameters?.servicePath??"").trim();if(!r)throw new Error("Missing required parameter: servicePath");let n=await F9t(t||r),i=await j9t(n,r),a=q9t.default.join(e.appPath,"metadata.xml");return V9t.default.writeFileSync(a,i,"utf-8"),{functionalityId:vN.functionalityId,status:"Success",message:"Fetched systems successfully.",changes:[],parameters:{host:n.url,client:n.client,servicePath:r,metadataFilePath:a},appPath:e.appPath,timestamp:new Date().toISOString()}}var nte={id:vN.functionalityId,details:vN,handlers:{getFunctionalityDetails:()=>Promise.resolve(vN),executeFunctionality:U9t}};var B9t=[Uq,LQ,wQ,FIe,kQ.details,nte.details],ite=new Map([[r_,kIe],[Gv,$Ie],[m1,VIe],[OQ,h8t],[kQ.id,kQ.handlers],[nte.id,nte.handlers]]);async function kLe(e){let{appPath:t}=e,r=[];try{for(let a of B9t)r.push({functionalityId:a.functionalityId,description:a.description});let n=await uu(t),i=n?.applicationAccess?.project.apps??{};if(n?.applicationAccess&&Object.keys(i).length){let{applicationAccess:a}=n,s=await new Ya(a).getApplicationModel();if(s){r=r.concat(await rYn(a,s));let c=Object.keys(s?.pages??{});for(let u of c)r=r.concat(await nYn(a,s,u))}}}catch(n){return`Error while trying to list functionalities: ${n.message}`}return{applicationPath:t,functionalities:r}}async function rYn(e,t){let i=(await new vv(e,t).getPageTree()).children.find(a=>a.path[a.path.length-1]==="settings");return i?(i.properties=i.properties.filter(a=>!["minVersion","lazy","dependencies"].includes(a.name)),$Le(i)):[]}async function nYn(e,t,r){let i=await new vv(e,t,r).getPageTree();return $Le(i,void 0,r)}function $Le(e,t=[],r){let n=[];if(e.properties)for(let i of e.properties){let a=H9t(i,r);if(n.push(a),i.properties){let o=z9t(i.properties);n.push(...o)}}if(e.children)for(let i of e.children){let a=$Le(i,[...t,...e.path.map(String)],r);n.push(...a)}return n}function z9t(e,t){let r=[];for(let n of e){let i=H9t(n,t);if(r.push(i),n.properties){let a=z9t(n.properties);r.push(...a)}}return r}function H9t(e,t){let r=[];return t&&r.push(t),r.push(...e.schemaPath),{functionalityId:r,description:e.description||e.displayName||e.name||"No description available"}}async function mV(e){let{appPath:t,functionalityId:r}=e;if(!t)throw new Error("appPath parameter is required");if(!r)throw new Error("functionalityId parameter is required");let n=typeof r=="string"?ite.get(r):void 0;if(n)return n.getFunctionalityDetails(e);let{pageName:i,propertyPath:a}=MLe(r),o=await aYn(t,i),s=o?iYn(r,o,a):void 0;if(!s)throw new Error("functionalityId was not resolved");return i&&(s.pageName=i),s}function iYn(e,t,r){let{property:n,node:i}=zW([t],r)??{},a=t?.schema??{},o,s="";return n?(o=n.schema,s=n.name):i&&(o=i.schema,s=i.path.at(-1)?.toString()),o&&s!==void 0?{functionalityId:e,name:"Change property",description:"Change a property. To reset, remove, or restore it to its default value, set the value to null. If the property's description does not specify how to disable the related feature, setting it to null is typically the appropriate way to disable or clear it.",parameters:xxt(s,Em(o,a))}:void 0}async function aYn(e,t){let r=await uu(e);if(r?.applicationAccess){let i=await new Ya(r?.applicationAccess).getApplicationModel();if(i)return new vv(r.applicationAccess,i,t).getPageTree()}}function MLe(e){let t;try{t=typeof e=="string"?JSON.parse(e):[...e]}catch(n){throw new Error(`Invalid format of functionalityId parameter, error: ${n}`)}let r;return t[0]!=="settings"&&(r=t.shift()?.toString()),{pageName:r,propertyPath:t}}async function FLe(e){let{functionalityId:t,parameters:r,appPath:n}=e;if(!t)throw new Error("functionalityId parameter is required");if(!n)throw new Error("appPath parameter is required");let i=typeof t=="string"?ite.get(t):void 0;if(i)return i.executeFunctionality(e);let a=await mV({appPath:n,functionalityId:t}),s=("required"in a.parameters&&Array.isArray(a.parameters.required)?a.parameters.required:[]).filter(l=>!(l in r));if(s.length>0)throw new Error(`Missing required parameters: ${s.join(", ")}`);let c=await oYn(a,t,r,n,a.pageName),u;return c.length?u={functionalityId:t,status:"success",message:`Successfully executed '${a.name}'`,parameters:r,appPath:n,changes:c,timestamp:new Date().toISOString()}:u={functionalityId:t,status:"skipped",message:`Execution of '${a.name}' did not trigger any change in files`,parameters:r,appPath:n,changes:c,timestamp:new Date().toISOString()},u}async function oYn(e,t,r,n,i){let a=[],o=await sYn(n,i);if(!o)return[];let{propertyPath:s}=MLe(t),c=uYn(e,s[s.length-1]),u=await o.changeProperty(s,cYn(s,r,c));return(u?.manifestChangeIndicator!=="NoChange"||!u?.flexChanges?.length)&&a.push("Modified webapp/manifest.json"),u?.flexChanges&&a.push(...u.flexChanges.map(l=>`Modified ${l}`)),a}async function sYn(e,t){let r=await uu(e);if(r?.applicationAccess)return new vv(r.applicationAccess,void 0,t)}function cYn(e,t,r){let n=e[e.length-1];if(r?.type==="object"){let a=t;return n in t&&(a=t[n]),(a===null||typeof a=="object"&&!Array.isArray(a)&&Object.keys(a).length===0)&&(a=void 0),a}let i;return n in t?i=t[n]:"value"in t&&(i=t.value),i===null&&(i=void 0),i}function uYn(e,t){let{parameters:r}=e;if(t&&"properties"in r&&r.properties?.[t])return r.properties[t]}var G9t=[{name:"search_docs",title:"Search in Fiori Documentation",description:"Searches code snippets of Fiori Elements, Annotations, SAPUI5, Fiori tools documentation for the given query. You MUST use this tool if you're unsure about Fiori APIs. Optionally returns only code blocks.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query"},maxResults:{type:"number",description:"Maximum number of results to return",default:25}},required:["query"]}},{name:"list_fiori_apps",description:`Scans a specified directory to find existing SAP Fiori applications that can be modified.
1689
+ and returns service details: host, servicePath, client and metadataFilePath.`,parameters:{type:"object",required:["servicePath"],properties:{sapSystemQuery:{type:"string",description:"The name, host or a URL of the SAP system to fetch service metadata from."},servicePath:{type:"string",description:"The path to the SAP service to fetch metadata for."}}}};var q9t=Ct(require("node:path")),V9t=Ct(require("node:fs"));var rte=Ct(Gzt()),L9t=require("@sap-ux/store"),k9t=Ct(N0()),$9t=Ct(R9t());async function Z7n(){let e=new k9t.ToolsLogger({logPrefix:"fiori-mcp-server"});return(await(0,L9t.getService)({logger:e,entityName:"system"})).getAll({includeSensitiveData:!0})}function M9t(e){let t="",r="",n="";if(e.startsWith("http"))try{let i=new URL(e);t=i.origin,r=i.searchParams.get("sap-client")??"",n=i.pathname}catch{}return{origin:t,client:r,path:n}}function Q7n(e,t){let{origin:r,client:n}=M9t(t);if(!r)return[];let i=e.filter(a=>a.url.startsWith(r)&&(!n||a.client===n));return i.length||(i=e.filter(a=>a.url.startsWith(r))),i.length||(i=[{name:r,url:r,client:n}]),i}async function F9t(e){let t=await Z7n(),r=t.filter(i=>i.name===e),n=e.toLocaleLowerCase();if(r?.length!==1&&(r=t.filter(i=>i.name.toLocaleLowerCase()===n)),r?.length!==1&&(r=t.filter(i=>i.name.toLocaleLowerCase().startsWith(n))),r?.length!==1&&(r=t.filter(i=>i.name.toLocaleLowerCase().includes(n))),r?.length!==1&&(r=Q7n(t,e)),!r||!Array.isArray(r))throw new Error(`No matching system found for: ${e}`);if(r.length>1){let i=r.map(a=>a.name).join(", ");throw new Error(`Multiple systems found matching: ${e}. Please be more specific. Matched systems: ${i}`)}return r[0]}async function eYn(e,t){let r={baseURL:e.url,params:{"sap-client":e.client}};e.username&&e.password&&(r.auth={username:e.username,password:e.password});let n=new rte.AbapServiceProvider(r),i=[];try{i=await n.catalog(rte.ODataVersion.v4).listServices()}catch{}let a=i.filter(o=>o.path===t);if(a.length>1)throw new Error(`Multiple ODATA V4 Services found matching path: ${t}`);return a.length===1?n.service(a[0].path):(t.startsWith("http")&&(t=M9t(t).path),n.service(t))}function tYn(e){let t;try{t=(0,$9t.parse)(e)}catch{}if(!t)throw new Error("Failed to parse service metadata. The service may not be a valid OData V4 service.")}async function j9t(e,t){let n=await(await eYn(e,t)).metadata();return tYn(n),n}async function U9t(e){let t=String(e.parameters?.sapSystemQuery??"").trim(),r=String(e.parameters?.servicePath??"").trim();if(!r)throw new Error("Missing required parameter: servicePath");let n=await F9t(t||r),i=await j9t(n,r),a=q9t.default.join(e.appPath,"metadata.xml");return V9t.default.writeFileSync(a,i,"utf-8"),{functionalityId:vN.functionalityId,status:"Success",message:"Fetched systems successfully.",changes:[],parameters:{host:n.url,client:n.client,servicePath:r,metadataFilePath:a},appPath:e.appPath,timestamp:new Date().toISOString()}}var nte={id:vN.functionalityId,details:vN,handlers:{getFunctionalityDetails:()=>Promise.resolve(vN),executeFunctionality:U9t}};var B9t=[Uq,LQ,wQ,FIe,kQ.details,nte.details],ite=new Map([[r_,kIe],[Gv,$Ie],[m1,VIe],[OQ,h8t],[kQ.id,kQ.handlers],[nte.id,nte.handlers]]);async function kLe(e){let{appPath:t}=e,r=[];try{for(let a of B9t)r.push({functionalityId:a.functionalityId,description:a.description});let n=await uu(t),i=n?.applicationAccess?.project.apps??{};if(n?.applicationAccess&&Object.keys(i).length){let{applicationAccess:a}=n,s=await new Ya(a).getApplicationModel();if(s){r=r.concat(await rYn(a,s));let c=Object.keys(s?.pages??{});for(let u of c)r=r.concat(await nYn(a,s,u))}}}catch(n){return`Error while trying to list functionalities: ${n.message}`}return{applicationPath:t,functionalities:r}}async function rYn(e,t){let i=(await new vv(e,t).getPageTree()).children.find(a=>a.path[a.path.length-1]==="settings");return i?(i.properties=i.properties.filter(a=>!["minVersion","lazy","dependencies"].includes(a.name)),$Le(i)):[]}async function nYn(e,t,r){let i=await new vv(e,t,r).getPageTree();return $Le(i,void 0,r)}function $Le(e,t=[],r){let n=[];if(e.properties)for(let i of e.properties){let a=H9t(i,r);if(n.push(a),i.properties){let o=z9t(i.properties);n.push(...o)}}if(e.children)for(let i of e.children){let a=$Le(i,[...t,...e.path.map(String)],r);n.push(...a)}return n}function z9t(e,t){let r=[];for(let n of e){let i=H9t(n,t);if(r.push(i),n.properties){let a=z9t(n.properties);r.push(...a)}}return r}function H9t(e,t){let r=[];return t&&r.push(t),r.push(...e.schemaPath),{functionalityId:r,description:e.description||e.displayName||e.name||"No description available"}}async function mV(e){let{appPath:t,functionalityId:r}=e;if(!t)throw new Error("appPath parameter is required");if(!r)throw new Error("functionalityId parameter is required");let n=typeof r=="string"?ite.get(r):void 0;if(n)return n.getFunctionalityDetails(e);let{pageName:i,propertyPath:a}=MLe(r),o=await aYn(t,i),s=o?iYn(r,o,a):void 0;if(!s)throw new Error("functionalityId was not resolved");return i&&(s.pageName=i),s}function iYn(e,t,r){let{property:n,node:i}=zW([t],r)??{},a=t?.schema??{},o,s="";return n?(o=n.schema,s=n.name):i&&(o=i.schema,s=i.path.at(-1)?.toString()),o&&s!==void 0?{functionalityId:e,name:"Change property",description:"Change a property. To reset, remove, or restore it to its default value, set the value to null. If the property's description does not specify how to disable the related feature, setting it to null is typically the appropriate way to disable or clear it.",parameters:xxt(s,Em(o,a))}:void 0}async function aYn(e,t){let r=await uu(e);if(r?.applicationAccess){let i=await new Ya(r?.applicationAccess).getApplicationModel();if(i)return new vv(r.applicationAccess,i,t).getPageTree()}}function MLe(e){let t;try{t=typeof e=="string"?JSON.parse(e):[...e]}catch(n){throw new Error(`Invalid format of functionalityId parameter, error: ${n}`)}let r;return t[0]!=="settings"&&(r=t.shift()?.toString()),{pageName:r,propertyPath:t}}async function FLe(e){let{functionalityId:t,parameters:r,appPath:n}=e;if(!t)throw new Error("functionalityId parameter is required");if(!n)throw new Error("appPath parameter is required");let i=typeof t=="string"?ite.get(t):void 0;if(i)return i.executeFunctionality(e);let a=await mV({appPath:n,functionalityId:t}),s=("required"in a.parameters&&Array.isArray(a.parameters.required)?a.parameters.required:[]).filter(l=>!(l in r));if(s.length>0)throw new Error(`Missing required parameters: ${s.join(", ")}`);let c=await oYn(a,t,r,n,a.pageName),u;return c.length?u={functionalityId:t,status:"success",message:`Successfully executed '${a.name}'`,parameters:r,appPath:n,changes:c,timestamp:new Date().toISOString()}:u={functionalityId:t,status:"skipped",message:`Execution of '${a.name}' did not trigger any change in files`,parameters:r,appPath:n,changes:c,timestamp:new Date().toISOString()},u}async function oYn(e,t,r,n,i){let a=[],o=await sYn(n,i);if(!o)return[];let{propertyPath:s}=MLe(t),c=uYn(e,s[s.length-1]),u=await o.changeProperty(s,cYn(s,r,c));return(u?.manifestChangeIndicator!=="NoChange"||!u?.flexChanges?.length)&&a.push("Modified webapp/manifest.json"),u?.flexChanges&&a.push(...u.flexChanges.map(l=>`Modified ${l}`)),a}async function sYn(e,t){let r=await uu(e);if(r?.applicationAccess)return new vv(r.applicationAccess,void 0,t)}function cYn(e,t,r){let n=e[e.length-1];if(r?.type==="object"){let a=t;return n in t&&(a=t[n]),(a===null||typeof a=="object"&&!Array.isArray(a)&&Object.keys(a).length===0)&&(a=void 0),a}let i;return n in t?i=t[n]:"value"in t&&(i=t.value),i===null&&(i=void 0),i}function uYn(e,t){let{parameters:r}=e;if(t&&"properties"in r&&r.properties?.[t])return r.properties[t]}var G9t=[{name:"search_docs",title:"Search in Fiori Documentation",description:"Searches code snippets of Fiori Elements, Annotations, SAPUI5, Fiori tools documentation for the given query. You MUST use this tool if you're unsure about Fiori APIs. Optionally returns only code blocks.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query"},maxResults:{type:"number",description:"Maximum number of results to return",default:25}},required:["query"]}},{name:"list_fiori_apps",description:`Scans a specified directory to find existing SAP Fiori applications that can be modified.
1690
1690
  This is an optional, preliminary tool.
1691
1691
  **Use this first ONLY if the target application's name or path is not already known.**
1692
1692
  The output can be used to ask the user for clarification before starting the main 3-step workflow.`,inputSchema:xa(KWe),outputSchema:xa(JWe)},{name:"list_functionality",description:`**(Step 1 of 3)**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fiori-mcp-server",
3
3
  "description": "SAP Fiori - Model Context Protocol (MCP) server",
4
- "version": "0.5.1",
4
+ "version": "0.6.0",
5
5
  "keywords": [
6
6
  "SAP Fiori tools",
7
7
  "SAP Fiori elements",
@@ -32,7 +32,7 @@
32
32
  "esbuild": "0.25.6",
33
33
  "@modelcontextprotocol/sdk": "1.24.1",
34
34
  "@sap/ux-specification": "1.139.2",
35
- "@sap-ux/annotation-converter": "0.10.8",
35
+ "@sap-ux/annotation-converter": "0.10.9",
36
36
  "@sap-ux/edmx-parser": "0.9.6",
37
37
  "@types/diff": "5.0.9",
38
38
  "@types/json-schema": "7.0.5",
@@ -46,19 +46,19 @@
46
46
  "promptfoo": "0.119.14",
47
47
  "@langchain/mcp-adapters": "1.0.2",
48
48
  "@langchain/core": "1.1.1",
49
- "@sap-ux/axios-extension": "1.24.6",
50
49
  "@sap-ux/project-access": "1.32.16",
51
- "@sap-ux/fiori-annotation-api": "0.7.23",
50
+ "@sap-ux/fiori-annotation-api": "0.8.0",
51
+ "@sap-ux/axios-extension": "1.25.0",
52
52
  "@sap-ux/fiori-docs-embeddings": "0.4.6",
53
53
  "@sap-ux/i18n": "0.3.6",
54
54
  "@sap-ux/logger": "0.7.2",
55
- "@sap-ux/odata-annotation-core-types": "0.5.2",
56
55
  "@sap-ux/odata-entity-model": "0.3.3",
56
+ "@sap-ux/odata-annotation-core-types": "0.5.2",
57
57
  "@sap-ux/text-document-utils": "0.3.3",
58
58
  "@sap-ux/btp-utils": "1.1.6",
59
59
  "@sap-ux/feature-toggle": "0.3.5",
60
60
  "@sap-ux/nodejs-utils": "0.2.10",
61
- "@sap-ux/telemetry": "0.6.47"
61
+ "@sap-ux/telemetry": "0.6.48"
62
62
  },
63
63
  "dependencies": {
64
64
  "@xenova/transformers": "2.17.2",
@@ -66,7 +66,7 @@
66
66
  "mem-fs": "2.1.0",
67
67
  "mem-fs-editor": "9.4.0",
68
68
  "@sap-ux/fiori-docs-embeddings": "0.4.6",
69
- "@sap-ux/store": "1.3.5"
69
+ "@sap-ux/store": "1.4.0"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=20.x"