@redocly/replay 0.19.0-custom.3 → 0.19.0-custom.4

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.
@@ -219,7 +219,7 @@ ${n.message}`})}}}}),VK=({filePath:u})=>({Info:{leave(e,{report:a,location:t,con
219
219
  ${n.message}`,location:t.child("description")})}}}}),GK=u=>({Info:{leave(e){if(typeof u!="object"||Array.isArray(u)||u===null)throw new Error('"info-override" decorator should be called with an object');const{severity:a,...t}=u;Object.assign(e,t)}}});function HK(u){return Array.isArray(u)&&u.length===0}const I3e="x-internal",qK=({internalFlagProperty:u=I3e})=>{function e(t,r,n){const{parent:i,key:o}=r;let s=!1;if(Array.isArray(t))for(let l=0;l<t.length;l++){if(Ma(t[l])&&r.resolve(t[l]).node?.[u]){if(hu(i.discriminator?.mapping))for(const d in i.discriminator.mapping)n?.[d]===t[l].$ref&&delete i.discriminator.mapping[d];t.splice(l,1),s=!0,l--}t[l]?.[u]&&(t.splice(l,1),s=!0,l--)}else if(hu(t))for(const l of Object.keys(t)){if(Ma(t[l])){const c=r.resolve(t[l]);hu(c.node)&&c.node?.[u]&&(delete t[l],s=!0)}hu(t[l])&&t[l]?.[u]&&(delete t[l],s=!0)}s&&(pd(t)||HK(t))&&delete i[o]}let a={};return{DiscriminatorMapping:{enter:t=>{a=JSON.parse(JSON.stringify(t))}},any:{enter:(t,r)=>{e(t,r,a)}}}};function WK(u,e,a){const{parent:t,key:r}=e;let n=!1;if(Array.isArray(u))for(let i=0;i<u.length;i++){if(Ma(u[i])){const o=e.resolve(u[i]);a(o.node)&&(u.splice(i,1),n=!0,i--)}a(u[i])&&(u.splice(i,1),n=!0,i--)}else if(hu(u))for(const i of Object.keys(u)){if(u=u,Ma(u[i])){const o=e.resolve(u[i]);a(o.node)&&(delete u[i],n=!0)}a(u[i])&&(delete u[i],n=!0)}n&&(pd(u)||HK(u))&&delete t[r]}function JK(u,e,a){return u===void 0||e===void 0?!1:!Array.isArray(e)&&!Array.isArray(u)?u===e:(e=oS(e),u=oS(u),a==="any"?e.some(t=>u.includes(t)):a==="all"?e.every(t=>u.includes(t)):!1)}function oS(u){return Array.isArray(u)?u:[u]}const K3e="any",UK=({property:u,value:e,matchStrategy:a})=>{const t=a||K3e,r=n=>n?.[u]&&!JK(n?.[u],e,t);return{any:{enter:(n,i)=>{WK(n,i,r)}}}},V3e="any",ZK=({property:u,value:e,matchStrategy:a})=>{const t=a||V3e,r=n=>JK(n?.[u],e,t);return{any:{enter:(n,i)=>{WK(n,i,r)}}}},G3e=({operationIds:u})=>({Operation:{enter(e,a){const t=e.operationId;if(!t)return;const r=u[t];if(r){if(r.responses&&e.responses)for(const n of Object.keys(r.responses)){const i=sS(e.responses[n],a.resolve);i&&(i.content=i.content?i.content:{},Object.keys(r.responses[n]).forEach(o=>{const s=r.responses[n][o];i.content[o]={...i.content[o],examples:iS(vd(s,a.config?.configPath))}}),e.responses[n]=i)}if(r.request&&e.requestBody){const n=sS(e.requestBody,a.resolve);if(!n)return;n.content=n.content?n.content:{},Object.keys(r.request).forEach(i=>{const o=r.request[i];n.content[i]={...n.content[i],examples:iS(vd(o,a.config?.configPath))}}),e.requestBody=n}}}}});function sS(u,e){if(!Ma(u))return u;const a=e(u);return a.error?void 0:JSON.parse(JSON.stringify(a.node))}const QK=()=>{const u=new Map;function e(t,r,n){u.set(t.absolutePointer,{usedIn:u.get(t.absolutePointer)?.usedIn??[],componentType:r,name:n})}function a(t,r){const n=r.length;for(const[i,{usedIn:o,name:s,componentType:l}]of u)if(!o.some(d=>!r.some(E=>d.absolutePointer.startsWith(E)&&(d.absolutePointer.length===E.length||d.absolutePointer[E.length]==="/")))&&l&&t.components){r.push(i);const d=t.components[l];delete d[s],u.delete(i),pd(d)&&delete t.components[l]}return r.length>n?a(t,r):r.length}return{ref:{leave(t,{location:r,type:n,resolve:i,key:o}){if(["Schema","Header","Parameter","Response","Example","RequestBody"].includes(n.name)){const s=i(t);if(!s.location)return;const[l,c]=s.location.absolutePointer.split("#",2);if(!c)return;const d=c.split("/").slice(0,4).join("/"),E=`${l}#${d}`,p=u.get(E);p?p.usedIn.push(r):u.set(E,{usedIn:[r],name:o.toString()})}}},Root:{leave(t,r){const n=r.getVisitorData();n.removedCount=a(t,[]),pd(t.components)&&delete t.components}},NamedSchemas:{Schema(t,{location:r,key:n}){t.allOf||e(r,"schemas",n.toString())}},NamedParameters:{Parameter(t,{location:r,key:n}){e(r,"parameters",n.toString())}},NamedResponses:{Response(t,{location:r,key:n}){e(r,"responses",n.toString())}},NamedExamples:{Example(t,{location:r,key:n}){e(r,"examples",n.toString())}},NamedRequestBodies:{RequestBody(t,{location:r,key:n}){e(r,"requestBodies",n.toString())}},NamedHeaders:{Header(t,{location:r,key:n}){e(r,"headers",n.toString())}}}},H3e={"operation-description-override":IK,"tag-description-override":KK,"info-description-override":VK,"info-override":GK,"remove-x-internal":qK,"remove-unused-components":QK,"filter-in":UK,"filter-out":ZK,"media-type-examples-override":G3e},YK=()=>{const u=new Map;function e(t,r,n){u.set(t.absolutePointer,{usedIn:u.get(t.absolutePointer)?.usedIn??[],componentType:r,name:n})}function a(t,r){const n=r.length;for(const[i,{usedIn:o,name:s,componentType:l}]of u)!o.some(d=>!r.some(E=>d.absolutePointer.startsWith(E)&&(d.absolutePointer.length===E.length||d.absolutePointer[E.length]==="/")))&&l&&(r.push(i),delete t[l][s],u.delete(i),pd(t[l])&&delete t[l]);return r.length>n?a(t,r):r.length}return{ref:{leave(t,{location:r,type:n,resolve:i,key:o}){if(["Schema","Parameter","Response","SecurityScheme"].includes(n.name)){const s=i(t);if(!s.location)return;const[l,c]=s.location.absolutePointer.split("#",2);if(!c)return;const d=c.split("/").slice(0,3).join("/"),E=`${l}#${d}`,p=u.get(E);p?p.usedIn.push(r):u.set(E,{usedIn:[r],name:o.toString()})}}},Root:{leave(t,r){const n=r.getVisitorData();n.removedCount=a(t,[])}},NamedSchemas:{Schema(t,{location:r,key:n}){t.allOf||e(r,"definitions",n.toString())}},NamedParameters:{Parameter(t,{location:r,key:n}){e(r,"parameters",n.toString())}},NamedResponses:{Response(t,{location:r,key:n}){e(r,"responses",n.toString())}},NamedSecuritySchemes:{SecurityScheme(t,{location:r,key:n}){e(r,"securityDefinitions",n.toString())}}}},q3e={"operation-description-override":IK,"tag-description-override":KK,"info-description-override":VK,"info-override":GK,"remove-x-internal":qK,"remove-unused-components":YK,"filter-in":UK,"filter-out":ZK},W3e={},J3e={},U3e={},Z3e={},Q3e={recommended:W4e,"recommended-strict":J4e,minimal:Z4e,all:U4e,spec:Q4e},lS={id:"",rules:{oas3:t3e,oas2:l3e,async2:p3e,async3:D3e,arazzo1:N3e,overlay1:_3e},preprocessors:{oas3:r3e,oas2:c3e,async2:m3e,async3:f3e,arazzo1:$3e,overlay1:L3e},decorators:{oas3:H3e,oas2:q3e,async2:W3e,async3:J3e,arazzo1:U3e,overlay1:Z3e},configs:Q3e};function Y3e(u){return!At(u)}function X3e(){return new Promise(u=>{setTimeout(u)})}function W4(u,e){return u+"::"+e}class O1{constructor(e,a,t){this.absoluteRef=e,this.body=a,this.mimeType=t}getAst(e){return this._ast===void 0&&(this._ast=e(this.body,{filename:this.absoluteRef})??void 0,this._ast&&this._ast.kind===0&&this._ast.value===""&&this._ast.startPosition!==1&&(this._ast.startPosition=1,this._ast.endPosition=1)),this._ast}getLines(){return this._lines===void 0&&(this._lines=this.body.split(/\r\n|[\n\r]/g)),this._lines}}class cy extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,cy.prototype)}}function epe(u,e){const a=new O1(e,u);try{return{source:a,parsed:ty(u,{filename:e})}}catch(t){throw new lc(t,a)}}class SD{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,a){return Ha(a)?a:e&&Ha(e)?new URL(a,e).href:Mu.resolve(e?Mu.dirname(e):process.cwd(),a)}async loadExternalRef(e){try{if(Ha(e)){const{body:a,mimeType:t}=await n_(e,this.config.http);return new O1(e,a,t)}else{if((void 0)(e).isDirectory())throw new Error(`Expected a file but received a folder at ${e}.`);const a=await(void 0).readFile(e,"utf-8");return new O1(e,a.replace(/\r\n/g,`
220
220
  `))}}catch(a){throw a.message=a.message.replace(", lstat",""),new cy(a)}}parseDocument(e,a=!1){const t=e.absoluteRef.substr(e.absoluteRef.lastIndexOf("."));if(![".json",".json",".yml",".yaml"].includes(t)&&!e.mimeType?.match(/(json|yaml|openapi)/)&&!a)return{source:e,parsed:e.body};try{return{source:e,parsed:ty(e.body,{filename:e.absoluteRef})}}catch(r){throw new lc(r,e)}}async resolveDocument(e,a,t=!1){const r=this.resolveExternalRef(e,a),n=this.cache.get(r);if(n)return n;const i=this.loadExternalRef(r).then(o=>this.parseDocument(o,t));return this.cache.set(r,i),i}}function cS(u,e){return{prev:u,node:e}}function upe(u,e){for(;u;){if(u.node===e)return!0;u=u.prev}return!1}const Qc={name:"unknown",properties:{}},ape={name:"scalar",properties:{}};async function kd(u){const{rootDocument:e,externalRefResolver:a,rootType:t}=u,r=new Map,n=new Set,i=[];s(e.parsed,e,"#/",t);let o;do o=await Promise.all(i);while(i.length!==o.length);return r;function s(l,c,d,E){const p=c.source.absoluteRef,h=new Map;x(l,E,p+d);function x(D,g,k){if(typeof D!="object"||D===null)return;const C=`${g.name}::${k}`;if(n.has(C))return;n.add(C);const[v,b]=Object.entries(D).find(([F])=>F==="$anchor")||[];if(b&&h.set(`#${b}`,D),Array.isArray(D)){const F=g.items;if(F===void 0&&g!==Qc&&g!==ks)return;const B=typeof F=="function";for(let S=0;S<D.length;S++){let P=B?F(D[S],Vl(k,S)):F;if(P===void 0&&g!==Qc&&g!==ks)continue;const L=P?.directResolveAs?{$ref:D[S]}:D[S];P=P?.directResolveAs||P,x(L,bs(P)?P:Qc,Vl(k,S))}return}for(const F of Object.keys(D)){let B=D[F],S=fo(g.properties,F);S===void 0&&(S=g.additionalProperties),typeof S=="function"&&(S=S(B,F)),S===void 0&&(S=Qc),g.extensionsPrefix&&F.startsWith(g.extensionsPrefix)&&S===Qc&&(S=ks),!bs(S)&&S?.directResolveAs&&(S=S.directResolveAs,B={$ref:B}),S&&S.name===void 0&&S.resolvable!==!1&&(S=ape),!(!bs(S)||typeof B!="object")&&x(B,S,Vl(k,H4(F)))}if(Ma(D)){const F=f(c,D,{prev:null,node:D}).then(B=>{B.resolved&&s(B.node,B.document,B.nodePointer,g)});i.push(F)}if(i_(D)){const F=f(c,{$ref:D.externalValue},{prev:null,node:D}).then(B=>{B.resolved&&s(B.node,B.document,B.nodePointer,g)});i.push(F)}}async function f(D,g,k){if(upe(k.prev,g))throw new Error("Self-referencing circular pointer");if(X0e(g.$ref)){await X3e();const N={resolved:!0,isRemote:!1,node:h.get(g.$ref),document:D,nodePointer:g.$ref},K=W4(D.source.absoluteRef,g.$ref);return r.set(K,N),N}const{uri:C,pointer:v}=Z0e(g.$ref),b=C!==null&&a.resolveExternalRef(D.source.absoluteRef,C)!==D.source.absoluteRef;let F;try{F=b?await a.resolveDocument(D.source.absoluteRef,C):D}catch(N){const K={resolved:!1,isRemote:b,document:void 0,error:N},X=W4(D.source.absoluteRef,g.$ref);return r.set(X,K),K}let B={resolved:!0,document:F,isRemote:b,node:D.parsed,nodePointer:"#/"},S=F.parsed;const P=v;for(const N of P)if(typeof S!="object"){S=void 0;break}else if(S[N]!==void 0)S=S[N],B.nodePointer=Vl(B.nodePointer,H4(N));else if(Ma(S)){if(B=await f(F,S,cS(k,S)),F=B.document||F,typeof B.node!="object"){S=void 0;break}S=B.node[N],B.nodePointer=Vl(B.nodePointer,H4(N))}else{S=void 0;break}B.node=S,B.document=F;const L=W4(D.source.absoluteRef,g.$ref);return B.document&&Ma(S)&&(B=await f(B.document,S,cS(k,S))),r.set(L,B),{...B}}}}const ua=(u,e)=>{if(e)for(const a of Object.keys(e))hu(u[a])&&typeof e[a]=="string"?u[a]={...u[a],severity:e[a]}:u[a]=e[a]};function fa(u,e){if(e)for(const a of Object.keys(e))u.hasOwnProperty(a)&&(hu(u[a])&&typeof e[a]=="string"?u[a]={...u[a],severity:e[a]}:u[a]=e[a])}function tpe(u){if(u.indexOf("/")>-1){const[e,a]=u.split("/");return{pluginId:e,configName:a}}else return{pluginId:"",configName:u}}function Ua(u,e){if(!e)return u;const a={};for(const t of Object.keys(u))a[`${e}/${t}`]=u[t];return a}function XK(u){const e={rules:{},oas2Rules:{},oas3_0Rules:{},oas3_1Rules:{},oas3_2Rules:{},async2Rules:{},async3Rules:{},arazzo1Rules:{},overlay1Rules:{},preprocessors:{},oas2Preprocessors:{},oas3_0Preprocessors:{},oas3_1Preprocessors:{},oas3_2Preprocessors:{},async2Preprocessors:{},async3Preprocessors:{},arazzo1Preprocessors:{},overlay1Preprocessors:{},decorators:{},oas2Decorators:{},oas3_0Decorators:{},oas3_1Decorators:{},oas3_2Decorators:{},async2Decorators:{},async3Decorators:{},arazzo1Decorators:{},overlay1Decorators:{}};for(const a of u){if(hu(a)&&"extends"in a&&a.extends!==void 0)throw new Error(`'extends' is not supported in shared configs yet:
221
221
  ${JSON.stringify(a,null,2)}`);ua(e.rules,a.rules),ua(e.oas2Rules,a.oas2Rules),fa(e.oas2Rules,a.rules),ua(e.oas3_0Rules,a.oas3_0Rules),fa(e.oas3_0Rules,a.rules),ua(e.oas3_1Rules,a.oas3_1Rules),fa(e.oas3_1Rules,a.rules),ua(e.oas3_2Rules,a.oas3_2Rules),fa(e.oas3_2Rules,a.rules),ua(e.async2Rules,a.async2Rules),fa(e.async2Rules,a.rules),ua(e.async3Rules,a.async3Rules),fa(e.async3Rules,a.rules),ua(e.arazzo1Rules,a.arazzo1Rules),fa(e.arazzo1Rules,a.rules),ua(e.overlay1Rules,a.overlay1Rules),fa(e.overlay1Rules,a.rules),ua(e.preprocessors,a.preprocessors),ua(e.oas2Preprocessors,a.oas2Preprocessors),fa(e.oas2Preprocessors,a.preprocessors),ua(e.oas3_0Preprocessors,a.oas3_0Preprocessors),fa(e.oas3_0Preprocessors,a.preprocessors),ua(e.oas3_1Preprocessors,a.oas3_1Preprocessors),fa(e.oas3_1Preprocessors,a.preprocessors),ua(e.oas3_2Preprocessors,a.oas3_2Preprocessors),fa(e.oas3_2Preprocessors,a.preprocessors),ua(e.async2Preprocessors,a.async2Preprocessors),fa(e.async2Preprocessors,a.preprocessors),ua(e.async3Preprocessors,a.async3Preprocessors),fa(e.async3Preprocessors,a.preprocessors),ua(e.arazzo1Preprocessors,a.arazzo1Preprocessors),fa(e.arazzo1Preprocessors,a.preprocessors),ua(e.overlay1Preprocessors,a.overlay1Preprocessors),fa(e.overlay1Preprocessors,a.preprocessors),ua(e.decorators,a.decorators),ua(e.oas2Decorators,a.oas2Decorators),fa(e.oas2Decorators,a.decorators),ua(e.oas3_0Decorators,a.oas3_0Decorators),fa(e.oas3_0Decorators,a.decorators),ua(e.oas3_1Decorators,a.oas3_1Decorators),fa(e.oas3_1Decorators,a.decorators),ua(e.oas3_2Decorators,a.oas3_2Decorators),fa(e.oas3_2Decorators,a.decorators),ua(e.async2Decorators,a.async2Decorators),fa(e.async2Decorators,a.decorators),ua(e.async3Decorators,a.async3Decorators),fa(e.async3Decorators,a.decorators),ua(e.arazzo1Decorators,a.arazzo1Decorators),fa(e.arazzo1Decorators,a.decorators),ua(e.overlay1Decorators,a.overlay1Decorators),fa(e.overlay1Decorators,a.decorators)}return e}function rpe(u){return new Map(JSON.parse(JSON.stringify([...u])))}function dS(u){return u!==void 0&&typeof u=="object"&&"id"in u}function npe(u){return typeof u=="function"}function ES(u,e){return{prev:u,value:e}}function pS(u){return u?.prev??null}function ipe(u){const e={};for(;u.parent;)e[u.parent.type.name]=u.parent.activatedOn?.value.node,u=u.parent;return e}function ope(u){const e={};for(;u.parent;)u.parent.activatedOn?.value.location&&(e[u.parent.type.name]=u.parent.activatedOn?.value.location),u=u.parent;return e}function P1(u){const{document:e,rootType:a,normalizedVisitors:t,resolvedRefMap:r,ctx:n}=u,i={},o=new Set;s(e.parsed,a,new ex(e.source,"#/"),void 0,"");function s(l,c,d,E,p){const h=(B,S=f.source.absoluteRef)=>{if(!Ma(B))return{location:d,node:B};const P=W4(S,B.$ref),L=r.get(P);if(!L)return{location:void 0,node:void 0};const{resolved:N,node:K,document:X,nodePointer:J,error:ue}=L;return{location:N?new ex(X.source,J):ue instanceof lc?new ex(ue.source,""):void 0,node:K,error:ue}},x=d;let f=d;const{node:D,location:g,error:k}=h(l),C=new Set;if(Ma(l)){const B=t.ref.enter;for(const{visit:S,ruleId:P,severity:L,message:N,context:K}of B){C.add(K);const X=b.bind(void 0,P,L,N);S(l,{report:X,resolve:h,rawNode:l,rawLocation:x,location:d,type:c,parent:E,key:p,parentLocations:{},specVersion:n.specVersion,config:n.config,getVisitorData:F.bind(void 0,P)},{node:D,location:g,error:k}),g?.source.absoluteRef&&n.refTypes&&n.refTypes.set(g?.source.absoluteRef,c)}}if(D!==void 0&&g&&c.name!=="scalar"){f=g;const B=i[c.name]?.has?.(D);let S=!1;const L=t.any.enter.concat(t[c.name]?.enter||[]),N=[];for(const{context:J,visit:ue,skip:de,ruleId:ie,severity:xe,message:j}of L){if(o.has(`${f.absolutePointer}${f.pointer}`))break;if(J.isSkippedLevel)J.parent.activatedOn&&!J.parent.activatedOn.value.nextLevelTypeActivated&&!J.seen.has(l)&&(J.seen.add(l),S=!0,N.push(J));else if(J.parent&&J.parent.activatedOn&&J.activatedOn?.value.withParentNode!==J.parent.activatedOn.value.node&&J.parent.activatedOn.value.nextLevelTypeActivated?.value!==c||!J.parent&&!B){N.push(J);const $={node:D,location:g,nextLevelTypeActivated:null,withParentNode:J.parent?.activatedOn?.value.node,skipped:(J.parent?.activatedOn?.value.skipped||de?.(D,p,{location:d,rawLocation:x,resolve:h,rawNode:l}))??!1};J.activatedOn=ES(J.activatedOn,$);let V=J.parent;for(;V;)V.activatedOn.value.nextLevelTypeActivated=ES(V.activatedOn.value.nextLevelTypeActivated,c),V=V.parent;$.skipped||(S=!0,C.add(J),v(ue,D,l,J,ie,xe,j))}}if(S||!B){if(i[c.name]=i[c.name]||new Set,i[c.name].add(D),Array.isArray(D)){const J=c.items;if(J!==void 0){const ue=typeof J=="function";for(let de=0;de<D.length;de++){let ie=ue?J(D[de],g.child([de]).absolutePointer):J,xe=D[de];ie?.directResolveAs&&(ie=ie.directResolveAs,xe={$ref:xe}),bs(ie)&&s(xe,ie,g.child([de]),D,de)}}}else if(typeof D=="object"&&D!==null){const J=Object.keys(c.properties);c.additionalProperties?J.push(...Object.keys(D).filter(ue=>!J.includes(ue))):c.extensionsPrefix&&J.push(...Object.keys(D).filter(ue=>ue.startsWith(c.extensionsPrefix))),Ma(l)&&J.push(...Object.keys(l).filter(ue=>ue!=="$ref"&&!J.includes(ue)));for(const ue of J){let de=D[ue],ie=g;de===void 0&&(de=l[ue],ie=d);let xe=fo(c.properties,ue);if(xe===void 0&&(xe=c.additionalProperties),typeof xe=="function"&&(xe=xe(de,ue)),xe===void 0&&c.extensionsPrefix&&ue.startsWith(c.extensionsPrefix)&&(xe=ks),!bs(xe)&&xe?.directResolveAs&&(xe=xe.directResolveAs,de={$ref:de}),xe&&xe.name===void 0&&xe.resolvable!==!1&&(xe={name:"scalar",properties:{}}),Ma(l[ue])&&xe?.name==="scalar"){s(l[ue],xe,d.child([ue]),l,ue);continue}!bs(xe)||xe.name==="scalar"&&!Ma(de)||s(de,xe,ie.child([ue]),D,ue)}}}const K=t.any.leave,X=(t[c.name]?.leave||[]).concat(K);for(const J of N.reverse())if(J.isSkippedLevel)J.seen.delete(D);else if(J.activatedOn=pS(J.activatedOn),J.parent){let ue=J.parent;for(;ue;)ue.activatedOn.value.nextLevelTypeActivated=pS(ue.activatedOn.value.nextLevelTypeActivated),ue=ue.parent}for(const{context:J,visit:ue,ruleId:de,severity:ie,message:xe}of X)!J.isSkippedLevel&&C.has(J)&&v(ue,D,l,J,de,ie,xe)}if(f=d,Ma(l)){const B=t.ref.leave;for(const{visit:S,ruleId:P,severity:L,context:N,message:K}of B)if(C.has(N)){const X=b.bind(void 0,P,L,K);S(l,{report:X,resolve:h,rawNode:l,rawLocation:x,location:d,type:c,parent:E,key:p,parentLocations:{},specVersion:n.specVersion,config:n.config,getVisitorData:F.bind(void 0,P)},{node:D,location:g,error:k})}}function v(B,S,P,L,N,K,X){const J=b.bind(void 0,N,K,X);B(S,{report:J,resolve:h,rawNode:P,location:f,rawLocation:x,type:c,parent:E,key:p,parentLocations:ope(L),specVersion:n.specVersion,config:n.config,ignoreNextVisitorsOnNode:()=>{o.add(`${f.absolutePointer}${f.pointer}`)},getVisitorData:F.bind(void 0,N)},ipe(L),L)}function b(B,S,P,L){const K=(L.location?Array.isArray(L.location)?L.location:[L.location]:[{...f,reportOnKey:!1}]).map(J=>({...f,reportOnKey:!1,...J})),X=L.forceSeverity||S;X!=="off"&&n.problems.push({ruleId:L.ruleId||B,severity:X,...L,message:P?P.replace("{{message}}",L.message):L.message,suggest:L.suggest||[],location:K})}function F(B){return n.visitorsData[B]=n.visitorsData[B]||{},n.visitorsData[B]}}}const spe={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function j1(u,e){const a={};a.any={enter:[],leave:[]};for(const i of Object.keys(e))a[i]={enter:[],leave:[]};a.ref={enter:[],leave:[]};for(const{ruleId:i,severity:o,message:s,visitor:l}of u)n({ruleId:i,severity:o,message:s},l,null);for(const i of Object.keys(a))a[i].enter.sort((o,s)=>s.depth-o.depth),a[i].leave.sort((o,s)=>o.depth-s.depth);return a;function t(i,o,s,l,c=[]){if(c.includes(o))return;c=[...c,o];const d=new Set;for(const p of Object.values(o.properties)){if(p===s){E(i,c);continue}typeof p=="object"&&p!==null&&p.name&&d.add(p)}o.additionalProperties&&typeof o.additionalProperties!="function"&&(o.additionalProperties===s?E(i,c):o.additionalProperties.name!==void 0&&d.add(o.additionalProperties)),o.items&&typeof o.items!="function"&&(o.items===s?E(i,c):o.items.name!==void 0&&d.add(o.items)),o.extensionsPrefix&&d.add(ks);for(const p of Array.from(d.values()))t(i,p,s,l,c);function E(p,h){for(const x of h.slice(1))a[x.name]=a[x.name]||{enter:[],leave:[]},a[x.name].enter.push({...p,visit:()=>{},depth:0,context:{isSkippedLevel:!0,seen:new Set,parent:l}})}}function r(i,o){if(Array.isArray(o)){const s=o.find(l=>i[l])||void 0;return s&&i[s]}return i[o]}function n(i,o,s,l=0){const c=Object.keys(e);if(l===0)c.push("any"),c.push("ref");else{if(o.any)throw new Error("any() is allowed only on top level");if(o.ref)throw new Error("ref() is allowed only on top level")}for(const d of c){const E=o[d]||r(o,spe[d]),p=a[d];if(!E)continue;let h,x,f;const D=hu(E);if(d==="ref"&&D&&E.skip)throw new Error("ref() visitor does not support skip");typeof E=="function"?h=E:D&&(h=E.enter,x=E.leave,f=E.skip);const g=(h?1:0)+(x?1:0)+(f?1:0),k=D&&Object.keys(E).length>g,C={activatedOn:null,type:e[d],parent:s,isSkippedLevel:!1};if(k&&n(i,E,C,l+1),s&&t(i,s.type,e[d],s),h||D){if(h&&typeof h!="function")throw new Error("DEV: should be function");p.enter.push({...i,visit:h||(()=>{}),skip:f,depth:l,context:C})}if(x){if(typeof x!="function")throw new Error("DEV: should be function");p.leave.push({...i,visit:x,depth:l,context:C})}}}}function eV({node:u,ctx:e,plugins:a}){if(!u.extends)return u;const t=(u.extends||[]).map(r=>{if(!Ha(r)&&!ws.extname(r))return fpe(r,a);const n=e.resolve({$ref:r});return n.location&&n.node!==void 0?n.node:null}).filter(Kt);return XK([...t.map(r=>eV({node:r,ctx:e,plugins:a})),{...u,extends:void 0}])}function Rp(u,e){if(hu(u)&&Array.isArray(u.plugins)){const{plugins:a,rootConfigDir:t}=e.getVisitorData();a.push(...u.plugins.map(r=>aV(r,e.location.source.absoluteRef.replace(/^file:\/\//,""),t)))}}const lpe=j1([{severity:"error",ruleId:aK,visitor:{ref:{},ConfigGovernance:{leave(u,e){Rp(u,e)}},ConfigApisProperties:{leave(u,e){Rp(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){Rp(u,e)}},ConfigRoot:{leave(u,e){Rp(u,e)}}}}],cE);function Np(u,e){if(hu(u)&&u.extends){const{plugins:a}=e.getVisitorData(),t=eV({node:u,ctx:e,plugins:a});Object.assign(u,t),delete u.extends}}const cpe=j1([{severity:"error",ruleId:uK,visitor:{ref:{leave(u,e,a){Ak(u,a,e)}},ConfigGovernance:{leave(u,e){Np(u,e)}},ConfigApisProperties:{leave(u,e){Np(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){Np(u,e)}},ConfigRoot:{leave(u,e){Np(u,e)}}}}],cE);function mS(u,e){switch(e){case"oas3":switch(u){case"Schema":return"schemas";case"Parameter":return"parameters";case"Response":return"responses";case"Example":return"examples";case"RequestBody":return"requestBodies";case"Header":return"headers";case"SecuritySchema":return"securitySchemes";case"Link":return"links";case"Callback":return"callbacks";default:return null}case"oas2":switch(u){case"Schema":return"definitions";case"Parameter":return"parameters";case"Response":return"responses";default:return null}case"async2":switch(u){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"async3":switch(u){case"Schema":return"schemas";case"Parameter":return"parameters";default:return null}case"arazzo1":switch(u){case"Root.workflows_items.parameters_items":case"Root.workflows_items.steps_items.parameters_items":return"parameters";default:return null}case"overlay1":return null}}function dpe(u,e,a,t,r){let n,i;const o={ref:{leave(E,p,h){if(!h.location||h.node===void 0){q4(h,p.report,p.location);return}if(h.location.source===a.source&&h.location.source===p.location.source&&p.type.name!=="scalar"&&!e){E.$ref!==h.location.pointer&&(E.$ref=h.location.pointer);return}if(r&&Ha(E.$ref))return;const x=mS(p.type.name,u);x?e?(l(x,h,p),Ak(E,h,p)):(E.$ref=l(x,h,p),s(E,h,p)):Ak(E,h,p)}},Example:{leave(E,p){if(i_(E)&&E.value===void 0){const h=p.resolve({$ref:E.externalValue});if(!h.location||h.node===void 0){q4(h,p.report,p.location);return}if(r&&Ha(E.externalValue))return;E.value=p.resolve({$ref:E.externalValue}).node,delete E.externalValue}}},Root:{enter(E,p){i=p.location,u==="oas3"?n=E.components=E.components||{}:u==="oas2"?n=E:u==="async2"?n=E.components=E.components||{}:u==="async3"?n=E.components=E.components||{}:u==="arazzo1"&&(n=E.components=E.components||{})}}};u==="oas3"&&(o.DiscriminatorMapping={leave(E,p){for(const h of Object.keys(E)){const x=E[h],f=p.resolve({$ref:x});if(!f.location||f.node===void 0){q4(f,p.report,p.location.child(h));return}const D=mS("Schema",u);E[h]=l(D,f,p)}}});function s(E,p,h){const x=W4(h.location.source.absoluteRef,E.$ref);t.set(x,{document:a,isRemote:!1,node:p.node,nodePointer:E.$ref,resolved:!0})}function l(E,p,h){n[E]=n[E]||{};const x=d(p,E,h);return n[E][x]=p.node,u==="oas3"||u==="async2"||u==="async3"?`#/components/${E}/${x}`:`#/${E}/${x}`}function c(E,p,h){return Ma(E)&&h.resolve(E,i.absolutePointer).location?.absolutePointer===p.location.absolutePointer?!0:Fk(E,p.node)}function d(E,p,h){const[x,f]=[E.location.source.absoluteRef,E.location.pointer],D=n[p];let g="";const k=f.slice(2).split("/").filter(Kt);for(;k.length>0;)if(g=k.pop()+(g?`-${g}`:""),!D||!D[g]||c(D[g],E,h))return g;if(g=Y0e(x)+(g?`_${g}`:""),!D[g]||c(D[g],E,h))return g;const C=g;let v=2;for(;D[g]&&!c(D[g],E,h);)g=`${C}-${v}`,v++;return D[g]||h.report({message:`Two schemas are referenced with the same name but different content. Renamed ${C} to ${g}.`,location:h.location,forceSeverity:"warn"}),g}return o}async function Epe(u){const{document:e,config:a,types:t,externalRefResolver:r,dereference:n=!1,removeUnusedComponents:i=!1,keepUrlRefs:o=!1}=u,s=fD(e.parsed),l=XI(s),c=a.getRulesForSpecVersion(l),d=IF(a.extendTypes(t,s),a),E=mh(c,a,"preprocessors",s),p=mh(c,a,"decorators",s),h={problems:[],specVersion:s,config:a,refTypes:new Map,visitorsData:{}};i&&!p.some(D=>D.ruleId==="remove-unused-components")&&p.push({severity:"error",ruleId:"remove-unused-components",visitor:l==="oas2"?YK():QK()});let x=await kd({rootDocument:e,rootType:d.Root,externalRefResolver:r});E.length>0&&(P1({document:e,rootType:d.Root,normalizedVisitors:j1(E,d),resolvedRefMap:x,ctx:h}),x=await kd({rootDocument:e,rootType:d.Root,externalRefResolver:r}));const f=j1([{severity:"error",ruleId:"bundler",visitor:dpe(l,n,e,x,o)},...p],d);return P1({document:e,rootType:d.Root,normalizedVisitors:f,resolvedRefMap:x,ctx:h}),{bundle:e,problems:h.problems.map(D=>a.addProblemToIgnore(D)),fileDependencies:r.getFiles(),rootType:d.Root,refTypes:h.refTypes,visitorsData:h.visitorsData}}function ppe(u,e,a){const t={plugins:[],rootConfigDir:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[aK]:t}};return P1({document:u,rootType:cE.ConfigRoot,normalizedVisitors:lpe,resolvedRefMap:e,ctx:r}),t.plugins}function mpe(u,e,a){const t={plugins:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[uK]:t}};return P1({document:u,rootType:cE.ConfigRoot,normalizedVisitors:cpe,resolvedRefMap:e,ctx:r}),u.parsed??{}}async function uV(u){const{ref:e,doc:a,externalRefResolver:t=new SD(u.config.resolve),base:r=null}=u;if(!(e||a))throw new Error(`Document or reference is required.
222
- `);const n=a===void 0?await t.resolveDocument(r,e,!0):a;if(n instanceof Error)throw n;return u.collectSpecData?.(n.parsed),Epe({document:n,...u,externalRefResolver:t,types:WF(fD(n.parsed))})}const Fg=new Map;async function xpe({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?V4e:u.parsed;if(t!==void 0&&hu(r)&&(r.extends=t),hu(r)&&r?.extends?.some(Y3e))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new O1(e??"",JSON.stringify(r)),parsed:r},i=await kd({rootDocument:n,rootType:cE.ConfigRoot,externalRefResolver:a??new SD(eK(r?.resolve))});let o=[],s,l="";Za?s=[...(r?.plugins||[]).filter(p=>!At(p)),lS]:(l=Mu.dirname(e??""),o=ppe(n,i,l),s=[...await Dpe(o.map(p=>xS(p)?p.absolutePath:p),l),lS]);const c=mpe(n,rpe(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const h=XK([c,p]);return[E,{...p,...h}]})));const d=o.length?o.map(E=>xS(E)&&E.isModule?E.rawPath:E.absolutePath&&Mu.relative(l,E.absolutePath)).filter(ph):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function hpe(u){for(const e of H4e)(void 0)(Mu.resolve(u,e))}function xS(u){return"isModule"in u}const aV=(u,e,a)=>{if(!At(u))return u;const t=Mu.resolve(Mu.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:u_.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:Mn&&Mn.tagName.toUpperCase()==="SCRIPT"&&Mn.src||new URL("replay-index-CV4-2VWg.js",document.baseURI).href)??__dirname).resolve(u,{paths:[a,(typeof document>"u"?require("url").pathToFileURL(__filename).href:Mn&&Mn.tagName.toUpperCase()==="SCRIPT"&&Mn.src||new URL("replay-index-CV4-2VWg.js",document.baseURI).href)?Mu.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:Mn&&Mn.tagName.toUpperCase()==="SCRIPT"&&Mn.src||new URL("replay-index-CV4-2VWg.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function Dpe(u,e){if(!u)return[];const a=async o=>{if(!At(o))return o;try{const s=Mu.isAbsolute(o)?o:aV(o,Mu.join(e,K4e),e).absolutePath;if(!Fg.has(s)){let l;if(typeof __webpack_require__=="function")l=__non_webpack_require__(s);else{const h=await import((void 0)(s).pathname);l=h.default||h}const c={contentDir:e},d=Array.isArray(l)?l:[l];for(const h of d)h?.id&&dS(h)&&ta.info(`Deprecated plugin format detected: ${h.id}
222
+ `);const n=a===void 0?await t.resolveDocument(r,e,!0):a;if(n instanceof Error)throw n;return u.collectSpecData?.(n.parsed),Epe({document:n,...u,externalRefResolver:t,types:WF(fD(n.parsed))})}const Fg=new Map;async function xpe({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?V4e:u.parsed;if(t!==void 0&&hu(r)&&(r.extends=t),hu(r)&&r?.extends?.some(Y3e))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new O1(e??"",JSON.stringify(r)),parsed:r},i=await kd({rootDocument:n,rootType:cE.ConfigRoot,externalRefResolver:a??new SD(eK(r?.resolve))});let o=[],s,l="";Za?s=[...(r?.plugins||[]).filter(p=>!At(p)),lS]:(l=Mu.dirname(e??""),o=ppe(n,i,l),s=[...await Dpe(o.map(p=>xS(p)?p.absolutePath:p),l),lS]);const c=mpe(n,rpe(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const h=XK([c,p]);return[E,{...p,...h}]})));const d=o.length?o.map(E=>xS(E)&&E.isModule?E.rawPath:E.absolutePath&&Mu.relative(l,E.absolutePath)).filter(ph):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function hpe(u){for(const e of H4e)(void 0)(Mu.resolve(u,e))}function xS(u){return"isModule"in u}const aV=(u,e,a)=>{if(!At(u))return u;const t=Mu.resolve(Mu.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:u_.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:Mn&&Mn.tagName.toUpperCase()==="SCRIPT"&&Mn.src||new URL("replay-index-CWlaVfYY.js",document.baseURI).href)??__dirname).resolve(u,{paths:[a,(typeof document>"u"?require("url").pathToFileURL(__filename).href:Mn&&Mn.tagName.toUpperCase()==="SCRIPT"&&Mn.src||new URL("replay-index-CWlaVfYY.js",document.baseURI).href)?Mu.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:Mn&&Mn.tagName.toUpperCase()==="SCRIPT"&&Mn.src||new URL("replay-index-CWlaVfYY.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function Dpe(u,e){if(!u)return[];const a=async o=>{if(!At(o))return o;try{const s=Mu.isAbsolute(o)?o:aV(o,Mu.join(e,K4e),e).absolutePath;if(!Fg.has(s)){let l;if(typeof __webpack_require__=="function")l=__non_webpack_require__(s);else{const h=await import((void 0)(s).pathname);l=h.default||h}const c={contentDir:e},d=Array.isArray(l)?l:[l];for(const h of d)h?.id&&dS(h)&&ta.info(`Deprecated plugin format detected: ${h.id}
223
223
  `);const E=dS(l)?l:npe(l)?await l(c):await l?.default?.(c),p=Array.isArray(E)?E:[E];E&&Fg.set(s,p.map(h=>({...h,path:o,absolutePath:s})))}return Fg.get(s)}catch(s){throw new Error(`Failed to load plugin "${o}": ${s.message}
224
224
 
225
225
  ${s.stack}`)}},t=new Map,r=hpe(e);r&&u.push(r);const n=new Set;return(await Promise.all(u.map(async o=>{if(At(o)){if(Ha(o))throw new Error(Tu.red("We don't support remote plugins yet."));if(n.has(o))return;n.add(o)}const s=await a(o);if(!s)return;const l=Array.isArray(s)?s:[s];return(await Promise.all(l.map(async c=>{if(!c)return;const d=c.id;if(typeof d!="string")throw new Error(Tu.red(`Plugin must define \`id\` property in ${Tu.blue(o.toString())}.`));const E=c.absolutePath??o.toString(),p=t.get(d);if(p){if(E!==p)throw new Error(Tu.red(`Plugin "id" must be unique. Plugin ${Tu.blue(E)} uses id "${Tu.blue(d)}" already seen in ${Tu.blue(E)}`));return}t.set(d,E);const h={id:d,...c.configs?{configs:c.configs}:{},...c.typeExtension?{typeExtension:c.typeExtension}:{}};if(c.rules){if(!c.rules.oas3&&!c.rules.oas2&&!c.rules.async2&&!c.rules.async3&&!c.rules.arazzo1&&!c.rules.overlay1)throw new Error(`Plugin rules must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo\`, or \`overlay1\` rules "${o}.`);h.rules={},c.rules.oas3&&(h.rules.oas3=Ua(c.rules.oas3,d)),c.rules.oas2&&(h.rules.oas2=Ua(c.rules.oas2,d)),c.rules.async2&&(h.rules.async2=Ua(c.rules.async2,d)),c.rules.async3&&(h.rules.async3=Ua(c.rules.async3,d)),c.rules.arazzo1&&(h.rules.arazzo1=Ua(c.rules.arazzo1,d)),c.rules.overlay1&&(h.rules.overlay1=Ua(c.rules.overlay1,d))}if(c.preprocessors){if(!c.preprocessors.oas3&&!c.preprocessors.oas2&&!c.preprocessors.async2&&!c.preprocessors.async3&&!c.preprocessors.arazzo1&&!c.preprocessors.overlay1)throw new Error(`Plugin \`preprocessors\` must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo1\`, or \`overlay1\` preprocessors "${o}.`);h.preprocessors={},c.preprocessors.oas3&&(h.preprocessors.oas3=Ua(c.preprocessors.oas3,d)),c.preprocessors.oas2&&(h.preprocessors.oas2=Ua(c.preprocessors.oas2,d)),c.preprocessors.async2&&(h.preprocessors.async2=Ua(c.preprocessors.async2,d)),c.preprocessors.async3&&(h.preprocessors.async3=Ua(c.preprocessors.async3,d)),c.preprocessors.arazzo1&&(h.preprocessors.arazzo1=Ua(c.preprocessors.arazzo1,d)),c.preprocessors.overlay1&&(h.preprocessors.overlay1=Ua(c.preprocessors.overlay1,d))}if(c.decorators){if(!c.decorators.oas3&&!c.decorators.oas2&&!c.decorators.async2&&!c.decorators.async3&&!c.decorators.arazzo1&&!c.decorators.overlay1)throw new Error(`Plugin \`decorators\` must have \`oas3\`, \`oas2\`, \`async2\`, \`async3\`, \`arazzo1\`, or \`overlay1\` decorators "${o}.`);h.decorators={},c.decorators.oas3&&(h.decorators.oas3=Ua(c.decorators.oas3,d)),c.decorators.oas2&&(h.decorators.oas2=Ua(c.decorators.oas2,d)),c.decorators.async2&&(h.decorators.async2=Ua(c.decorators.async2,d)),c.decorators.async3&&(h.decorators.async3=Ua(c.decorators.async3,d)),c.decorators.arazzo1&&(h.decorators.arazzo1=Ua(c.decorators.arazzo1,d)),c.decorators.overlay1&&(h.decorators.overlay1=Ua(c.decorators.overlay1,d))}return c.assertions&&(h.assertions=c.assertions),{...c,...h}}))).filter(ph)}))).filter(ph).flat()}function fpe(u,e){const{pluginId:a,configName:t}=tpe(u),r=e.find(i=>i.id===a);if(!r)throw new Error(`Invalid config ${Tu.red(u)}: plugin ${a} is not included.`);const n=r.configs?.[t];if(!n)throw new Error(a?`Invalid config ${Tu.red(u)}: plugin ${a} doesn't export config with name ${t}.`:`Invalid config ${Tu.red(u)}: there is no such built-in config.`);return n}async function tV(u,{configPath:e,externalRefResolver:a}={}){const r=epe(typeof u=="string"?u:"",e??"");typeof u!="string"&&u&&(r.parsed=u);const{resolvedConfig:n,resolvedRefMap:i,plugins:o}=await xpe({rawConfigDocument:gpe(r),configPath:e,externalRefResolver:a});return new gD(n,{configPath:e,document:r,resolvedRefMap:i,plugins:o})}function gpe(u){if(!u.parsed)return u;const{plugins:e,resolve:a,...t}=u.parsed,r={...structuredClone(t),plugins:e?.slice(),...a&&{resolve:{...a}}};return{...u,parsed:r}}var yg={},sr={},Ag={},hS;function zD(){return hS||(hS=1,(function(u){Object.defineProperty(u,"__esModule",{value:!0});var e;(function(s){s[s.SCALAR=0]="SCALAR",s[s.MAPPING=1]="MAPPING",s[s.MAP=2]="MAP",s[s.SEQ=3]="SEQ",s[s.ANCHOR_REF=4]="ANCHOR_REF",s[s.INCLUDE_REF=5]="INCLUDE_REF"})(e=u.Kind||(u.Kind={}));function a(s,l){var c=l?l.endPosition:s.endPosition+1,d={key:s,value:l,startPosition:s.startPosition,endPosition:c,kind:e.MAPPING,parent:null,errors:[]};return d}u.newMapping=a;function t(s,l,c,d){return{errors:[],referencesAnchor:s,value:d,startPosition:l,endPosition:c,kind:e.ANCHOR_REF,parent:null}}u.newAnchorRef=t;function r(s){s===void 0&&(s="");var l={errors:[],startPosition:-1,endPosition:-1,value:""+s,kind:e.SCALAR,parent:null,doubleQuoted:!1,rawValue:""+s};return typeof s!="string"&&(l.valueObject=s),l}u.newScalar=r;function n(){return{errors:[],startPosition:-1,endPosition:-1,items:[],kind:e.SEQ,parent:null}}u.newItems=n;function i(){return n()}u.newSeq=i;function o(s){return{errors:[],startPosition:-1,endPosition:-1,mappings:s||[],kind:e.MAP,parent:null}}u.newMap=o})(Ag)),Ag}var Gn={},DS;function dc(){if(DS)return Gn;DS=1,Object.defineProperty(Gn,"__esModule",{value:!0});function u(i){return typeof i>"u"||i===null}Gn.isNothing=u;function e(i){return typeof i=="object"&&i!==null}Gn.isObject=e;function a(i){return Array.isArray(i)?i:u(i)?[]:[i]}Gn.toArray=a;function t(i,o){var s,l,c,d;if(o)for(d=Object.keys(o),s=0,l=d.length;s<l;s+=1)c=d[s],i[c]=o[c];return i}Gn.extend=t;function r(i,o){var s="",l;for(l=0;l<o;l+=1)s+=i;return s}Gn.repeat=r;function n(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}return Gn.isNegativeZero=n,Gn}var Bg,fS;function xE(){if(fS)return Bg;fS=1;var u=(function(){function e(a,t,r){t===void 0&&(t=null),r===void 0&&(r=!1),this.name="YAMLException",this.reason=a,this.mark=t,this.message=this.toString(!1),this.isWarning=r}return e.isInstance=function(a){if(a!=null&&a.getClassIdentifier&&typeof a.getClassIdentifier=="function")for(var t=0,r=a.getClassIdentifier();t<r.length;t++){var n=r[t];if(n==e.CLASS_IDENTIFIER)return!0}return!1},e.prototype.getClassIdentifier=function(){var a=[];return a.concat(e.CLASS_IDENTIFIER)},e.prototype.toString=function(a){a===void 0&&(a=!1);var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!a&&this.mark&&(t+=" "+this.mark.toString()),t},e.CLASS_IDENTIFIER="yaml-ast-parser.YAMLException",e})();return Bg=u,Bg}var Sg,gS;function vpe(){if(gS)return Sg;gS=1;var u=dc(),e=(function(){function a(t,r,n,i,o){this.name=t,this.buffer=r,this.position=n,this.line=i,this.column=o}return a.prototype.getSnippet=function(t,r){t===void 0&&(t=0),r===void 0&&(r=75);var n,i,o,s,l;if(!this.buffer)return null;for(t=t||4,r=r||75,n="",i=this.position;i>0&&`\0\r
@@ -465,7 +465,7 @@ html body {
465
465
  align-self: flex-end;
466
466
  padding-top: var(--spacing-xxs);
467
467
  gap: var(--spacing-xs);
468
- `;function Sy({input:u,onSave:e,onCancel:a,...t}){const[r,n]=_.useState(!!u.isSecret),i=({name:o,value:s})=>{e({...u,name:o,value:s,isSecret:r})};return m.jsx(lH,{variable:u,onSave:i,onCancel:a,...t,children:m.jsx(Sd,{children:m.jsx(sH,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const lb=()=>({name:"",value:"",isSecret:!1}),ga=u=>e_+"$inputs."+u+_F,Dnu=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${oD}$`)?.[1]);function fnu({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function Li(u){const e=new RegExp(oD,"g"),a=new Set;if(!u)return a;for(const[t,r,n]of u.matchAll(e)){const i=r||n;i&&a.add(i)}return a}function zy(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function ox(u){var e=new Error(u);return e.source="ulid",e}var wy="0123456789ABCDEFGHJKMNPQRSTVWXYZ",U4=wy.length,Pw=Math.pow(2,48)-1,gnu=10,vnu=16;function knu(u){var e=Math.floor(u()*U4);return e===U4&&(e=U4-1),wy.charAt(e)}function bnu(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>Pw)throw ox("cannot encode time greater than "+Pw);if(u<0)throw ox("time must be positive");if(Number.isInteger(u)===!1)throw ox("time must be an integer");for(var a=void 0,t="";e>0;e--)a=u%U4,t=wy.charAt(a)+t,u=(u-a)/U4;return t}function Cnu(u,e){for(var a="";u>0;u--)a=knu(e)+a;return a}function Fnu(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments[1];e||(e=typeof window<"u"?window:null);var a=e&&(e.crypto||e.msCrypto);if(a)return function(){var r=new Uint8Array(1);return a.getRandomValues(r),r[0]/255};try{var t=require("crypto");return function(){return t.randomBytes(1).readUInt8()/255}}catch{}if(u){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw ox("secure crypto unusable, insecure Math.random not allowed")}function ynu(u){return u||(u=Fnu()),function(a){return isNaN(a)&&(a=Date.now()),bnu(a,gnu)+Cnu(vnu,u)}}var Ph=ynu(),Anu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Ds="1.9.0",jw=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Bnu(u){var e=new Set([u]),a=new Set,t=u.match(jw);if(!t)return function(){return!1};var r={major:+t[1],minor:+t[2],patch:+t[3],prerelease:t[4]};if(r.prerelease!=null)return function(s){return s===u};function n(o){return a.add(o),!1}function i(o){return e.add(o),!0}return function(s){if(e.has(s))return!0;if(a.has(s))return!1;var l=s.match(jw);if(!l)return n(s);var c={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return c.prerelease!=null||r.major!==c.major?n(s):r.major===0?r.minor===c.minor&&r.patch<=c.patch?i(s):n(s):r.minor<=c.minor?i(s):n(s)}}var Snu=Bnu(Ds),znu=Ds.split(".")[0],zd=Symbol.for("opentelemetry.js.api."+znu),wd=Anu;function vE(u,e,a,t){var r;t===void 0&&(t=!1);var n=wd[zd]=(r=wd[zd])!==null&&r!==void 0?r:{version:Ds};if(!t&&n[u]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+u);return a.error(i.stack||i.message),!1}if(n.version!==Ds){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+Ds);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+Ds+"."),!0}function Ps(u){var e,a,t=(e=wd[zd])===null||e===void 0?void 0:e.version;if(!(!t||!Snu(t)))return(a=wd[zd])===null||a===void 0?void 0:a[u]}function kE(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+Ds+".");var a=wd[zd];a&&delete a[u]}var wnu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},Onu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},Pnu=(function(){function u(e){this._namespace=e.namespace||"DiagComponentLogger"}return u.prototype.debug=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("verbose",this._namespace,e)},u})();function r4(u,e,a){var t=Ps("diag");if(t)return a.unshift(e),t[u].apply(t,Onu([],wnu(a),!1))}var Ct;(function(u){u[u.NONE=0]="NONE",u[u.ERROR=30]="ERROR",u[u.WARN=50]="WARN",u[u.INFO=60]="INFO",u[u.DEBUG=70]="DEBUG",u[u.VERBOSE=80]="VERBOSE",u[u.ALL=9999]="ALL"})(Ct||(Ct={}));function jnu(u,e){u<Ct.NONE?u=Ct.NONE:u>Ct.ALL&&(u=Ct.ALL),e=e||{};function a(t,r){var n=e[t];return typeof n=="function"&&u>=r?n.bind(e):function(){}}return{error:a("error",Ct.ERROR),warn:a("warn",Ct.WARN),info:a("info",Ct.INFO),debug:a("debug",Ct.DEBUG),verbose:a("verbose",Ct.VERBOSE)}}var Mnu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},Tnu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},Rnu="diag",xn=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=Ps("diag");if(o)return o[r].apply(o,Tnu([],Mnu(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:Ct.INFO}),r===a){var l=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return a.error((i=l.stack)!==null&&i!==void 0?i:l.message),!1}typeof n=="number"&&(n={logLevel:n});var c=Ps("diag"),d=jnu((o=n.logLevel)!==null&&o!==void 0?o:Ct.INFO,r);if(c&&!n.suppressOverrideMessage){var E=(s=new Error().stack)!==null&&s!==void 0?s:"<failed to generate stacktrace>";c.warn("Current logger will be overwritten from "+E),d.warn("Current logger will overwrite one already registered from "+E)}return vE("diag",d,a,!0)};a.setLogger=t,a.disable=function(){kE(Rnu,a)},a.createComponentLogger=function(r){return new Pnu(r)},a.verbose=e("verbose"),a.debug=e("debug"),a.info=e("info"),a.warn=e("warn"),a.error=e("error")}return u.instance=function(){return this._instance||(this._instance=new u),this._instance},u})(),Nnu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},$nu=function(u){var e=typeof Symbol=="function"&&Symbol.iterator,a=e&&u[e],t=0;if(a)return a.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&t>=u.length&&(u=void 0),{value:u&&u[t++],done:!u}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_nu=(function(){function u(e){this._entries=e?new Map(e):new Map}return u.prototype.getEntry=function(e){var a=this._entries.get(e);if(a)return Object.assign({},a)},u.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var a=Nnu(e,2),t=a[0],r=a[1];return[t,r]})},u.prototype.setEntry=function(e,a){var t=new u(this._entries);return t._entries.set(e,a),t},u.prototype.removeEntry=function(e){var a=new u(this._entries);return a._entries.delete(e),a},u.prototype.removeEntries=function(){for(var e,a,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=new u(this._entries);try{for(var i=$nu(t),o=i.next();!o.done;o=i.next()){var s=o.value;n._entries.delete(s)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(e)throw e.error}}return n},u.prototype.clear=function(){return new u},u})(),Lnu=Symbol("BaggageEntryMetadata"),Inu=xn.instance();function Knu(u){return u===void 0&&(u={}),new _nu(new Map(Object.entries(u)))}function Vnu(u){return typeof u!="string"&&(Inu.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:Lnu,toString:function(){return u}}}function Oy(u){return Symbol.for(u)}var Gnu=(function(){function u(e){var a=this;a._currentContext=e?new Map(e):new Map,a.getValue=function(t){return a._currentContext.get(t)},a.setValue=function(t,r){var n=new u(a._currentContext);return n._currentContext.set(t,r),n},a.deleteValue=function(t){var r=new u(a._currentContext);return r._currentContext.delete(t),r}}return u})(),Wl=new Gnu,Ws=(function(){var u=function(e,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},u(e,a)};return function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");u(e,a);function t(){this.constructor=e}e.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}})(),Hnu=(function(){function u(){}return u.prototype.createGauge=function(e,a){return uiu},u.prototype.createHistogram=function(e,a){return aiu},u.prototype.createCounter=function(e,a){return eiu},u.prototype.createUpDownCounter=function(e,a){return tiu},u.prototype.createObservableGauge=function(e,a){return niu},u.prototype.createObservableCounter=function(e,a){return riu},u.prototype.createObservableUpDownCounter=function(e,a){return iiu},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),$D=(function(){function u(){}return u})(),qnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})($D),Wnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})($D),Jnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})($D),Unu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})($D),Py=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),Znu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(Py),Qnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(Py),Ynu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(Py),Xnu=new Hnu,eiu=new qnu,uiu=new Jnu,aiu=new Unu,tiu=new Wnu,riu=new Znu,niu=new Qnu,iiu=new Ynu,oiu={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},siu={set:function(u,e,a){u!=null&&(u[e]=a)}},liu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},ciu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},diu=(function(){function u(){}return u.prototype.active=function(){return Wl},u.prototype.with=function(e,a,t){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];return a.call.apply(a,ciu([t],liu(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),Eiu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},piu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},z6="context",miu=new diu,_D=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return vE(z6,e,xn.instance())},u.prototype.active=function(){return this._getContextManager().active()},u.prototype.with=function(e,a,t){for(var r,n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,piu([e,a,t],Eiu(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return Ps(z6)||miu},u.prototype.disable=function(){this._getContextManager().disable(),kE(z6,xn.instance())},u})(),mi;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(mi||(mi={}));var cH="0000000000000000",dH="00000000000000000000000000000000",EH={traceId:dH,spanId:cH,traceFlags:mi.NONE},Z4=(function(){function u(e){e===void 0&&(e=EH),this._spanContext=e}return u.prototype.spanContext=function(){return this._spanContext},u.prototype.setAttribute=function(e,a){return this},u.prototype.setAttributes=function(e){return this},u.prototype.addEvent=function(e,a){return this},u.prototype.addLink=function(e){return this},u.prototype.addLinks=function(e){return this},u.prototype.setStatus=function(e){return this},u.prototype.updateName=function(e){return this},u.prototype.end=function(e){},u.prototype.isRecording=function(){return!1},u.prototype.recordException=function(e,a){},u})(),jy=Oy("OpenTelemetry Context Key SPAN");function My(u){return u.getValue(jy)||void 0}function xiu(){return My(_D.getInstance().active())}function Ty(u,e){return u.setValue(jy,e)}function hiu(u){return u.deleteValue(jy)}function Diu(u,e){return Ty(u,new Z4(e))}function pH(u){var e;return(e=My(u))===null||e===void 0?void 0:e.spanContext()}var fiu=/^([0-9a-f]{32})$/i,giu=/^[0-9a-f]{16}$/i;function mH(u){return fiu.test(u)&&u!==dH}function viu(u){return giu.test(u)&&u!==cH}function LD(u){return mH(u.traceId)&&viu(u.spanId)}function kiu(u){return new Z4(u)}var w6=_D.getInstance(),xH=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=w6.active());var r=!!a?.root;if(r)return new Z4;var n=t&&pH(t);return biu(n)&&LD(n)?new Z4(n):new Z4},u.prototype.startActiveSpan=function(e,a,t,r){var n,i,o;if(!(arguments.length<2)){arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);var s=i??w6.active(),l=this.startSpan(e,n,s),c=Ty(s,l);return w6.with(c,o,void 0,l)}},u})();function biu(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var Ciu=new xH,Fiu=(function(){function u(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}return u.prototype.startSpan=function(e,a,t){return this._getTracer().startSpan(e,a,t)},u.prototype.startActiveSpan=function(e,a,t,r){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},u.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ciu},u})(),yiu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new xH},u})(),Aiu=new yiu,Mw=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){var r;return(r=this.getDelegateTracer(e,a,t))!==null&&r!==void 0?r:new Fiu(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Aiu},u.prototype.setDelegate=function(e){this._delegate=e},u.prototype.getDelegateTracer=function(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(e,a,t)},u})(),jh;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(jh||(jh={}));var cb;(function(u){u[u.INTERNAL=0]="INTERNAL",u[u.SERVER=1]="SERVER",u[u.CLIENT=2]="CLIENT",u[u.PRODUCER=3]="PRODUCER",u[u.CONSUMER=4]="CONSUMER"})(cb||(cb={}));var mr;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(mr||(mr={}));var ni=_D.getInstance(),_u=xn.instance(),Biu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return Xnu},u})(),Siu=new Biu,O6="metrics",ziu=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return vE(O6,e,xn.instance())},u.prototype.getMeterProvider=function(){return Ps(O6)||Siu},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){kE(O6,xn.instance())},u})(),hH=ziu.getInstance(),wiu=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),Ry=Oy("OpenTelemetry Baggage Key");function DH(u){return u.getValue(Ry)||void 0}function Oiu(){return DH(_D.getInstance().active())}function Piu(u,e){return u.setValue(Ry,e)}function jiu(u){return u.deleteValue(Ry)}var P6="propagation",Miu=new wiu,Tiu=(function(){function u(){this.createBaggage=Knu,this.getBaggage=DH,this.getActiveBaggage=Oiu,this.setBaggage=Piu,this.deleteBaggage=jiu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return vE(P6,e,xn.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=siu),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=oiu),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){kE(P6,xn.instance())},u.prototype._getGlobalPropagator=function(){return Ps(P6)||Miu},u})(),Q4=Tiu.getInstance(),j6="trace",Riu=(function(){function u(){this._proxyTracerProvider=new Mw,this.wrapSpanContext=kiu,this.isSpanContextValid=LD,this.deleteSpan=hiu,this.getSpan=My,this.getActiveSpan=xiu,this.getSpanContext=pH,this.setSpan=Ty,this.setSpanContext=Diu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=vE(j6,this._proxyTracerProvider,xn.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return Ps(j6)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){kE(j6,xn.instance()),this._proxyTracerProvider=new Mw},u})(),rt=Riu.getInstance();const fH=Oy("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Niu(u){return u.setValue(fH,!0)}function Ny(u){return u.getValue(fH)===!0}const $iu="=",db=";",Eb=",",M6="baggage",_iu=180,Liu=4096,Iiu=8192;function Kiu(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?Eb:""}${a}`;return t.length>Iiu?e:t},"")}function Viu(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=db+a.metadata.toString()),t})}function Giu(u){const e=u.split(db);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf($iu);if(t<=0)return;const r=decodeURIComponent(a.substring(0,t).trim()),n=decodeURIComponent(a.substring(t+1).trim());let i;return e.length>0&&(i=Vnu(e.join(db))),{key:r,value:n,metadata:i}}class Hiu{inject(e,a,t){const r=Q4.getBaggage(e);if(!r||Ny(e))return;const n=Viu(r).filter(o=>o.length<=Liu).slice(0,_iu),i=Kiu(n);i.length>0&&t.set(a,M6,i)}extract(e,a,t){const r=t.get(a,M6),n=Array.isArray(r)?r.join(Eb):r;if(!n)return e;const i={};return n.length===0||(n.split(Eb).forEach(s=>{const l=Giu(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:Q4.setBaggage(e,Q4.createBaggage(i))}fields(){return[M6]}}function sx(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!qiu(a)){_u.warn(`Invalid attribute key: ${a}`);continue}if(!gH(t)){_u.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function qiu(u){return typeof u=="string"&&u.length>0}function gH(u){return u==null?!0:Array.isArray(u)?Wiu(u):vH(u)}function Wiu(u){let e;for(const a of u)if(a!=null){if(!e){if(vH(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function vH(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function Jiu(){return u=>{_u.error(Uiu(u))}}function Uiu(u){return typeof u=="string"?u:JSON.stringify(Ziu(u))}function Ziu(u){const e={};let a=u;for(;a!==null;)Object.getOwnPropertyNames(a).forEach(t=>{if(e[t])return;const r=a[t];r&&(e[t]=String(r))}),a=Object.getPrototypeOf(a);return e}let Qiu=Jiu();function R1(u){try{Qiu(u)}catch{}}const E1=performance,Yiu="2.0.1",T6="exception.message",Xiu="exception.stacktrace",R6="exception.type",kH="service.name",eou="service.version",pb="telemetry.sdk.language",uou="webjs",mb="telemetry.sdk.name",xb="telemetry.sdk.version",aou="process.runtime.name",N6={[mb]:"opentelemetry",[aou]:"browser",[pb]:uou,[xb]:Yiu};const tou=9,rou=6,nou=Math.pow(10,rou),Mh=Math.pow(10,tou);function a1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*nou);return[a,t]}function bH(){let u=E1.timeOrigin;if(typeof u!="number"){const e=E1;u=e.timing&&e.timing.fetchStart}return u}function iou(u){const e=a1(bH()),a=a1(typeof u=="number"?u:E1.now());return FH(e,a)}function oou(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=Mh),[a,t]}function sou(u){return u[0]*Mh+u[1]}function CH(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function Tw(u){return CH(u)||typeof u=="number"||u instanceof Date}function FH(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=Mh&&(a[1]-=Mh,a[0]+=1),a}var qr;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(qr||(qr={}));class lou{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(a=>typeof a.fields=="function"?a.fields():[]).reduce((a,t)=>a.concat(t),[])))}inject(e,a,t){for(const r of this._propagators)try{r.inject(e,a,t)}catch(n){_u.warn(`Failed to inject with ${r.constructor.name}. Err: ${n.message}`)}}extract(e,a,t){return this._propagators.reduce((r,n)=>{try{return n.extract(r,a,t)}catch(i){_u.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const hb="[_0-9a-z-*/]",cou=`[a-z]${hb}{0,255}`,dou=`[a-z0-9]${hb}{0,240}@[a-z]${hb}{0,13}`,Eou=new RegExp(`^(?:${cou}|${dou})$`),pou=/^[ -~]{0,255}[!-~]$/,mou=/,|=/;function xou(u){return Eou.test(u)}function hou(u){return pou.test(u)&&!mou.test(u)}const Rw=32,Dou=512,Nw=",",$w="=";class $y{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,a){const t=this._clone();return t._internalState.has(e)&&t._internalState.delete(e),t._internalState.set(e,a),t}unset(e){const a=this._clone();return a._internalState.delete(e),a}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,a)=>(e.push(a+$w+this.get(a)),e),[]).join(Nw)}_parse(e){e.length>Dou||(this._internalState=e.split(Nw).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf($w);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);xou(i)&&hou(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Rw&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Rw))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new $y;return e._internalState=new Map(this._internalState),e}}const $6="traceparent",_6="tracestate",fou="00",gou="(?!ff)[\\da-f]{2}",vou="(?![0]{32})[\\da-f]{32}",kou="(?![0]{16})[\\da-f]{16}",bou="[\\da-f]{2}",Cou=new RegExp(`^\\s?(${gou})-(${vou})-(${kou})-(${bou})(-.*)?\\s?$`);function Fou(u){const e=Cou.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class you{inject(e,a,t){const r=rt.getSpanContext(e);if(!r||Ny(e)||!LD(r))return;const n=`${fou}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||mi.NONE).toString(16)}`;t.set(a,$6,n),r.traceState&&t.set(a,_6,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,$6);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=Fou(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,_6);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new $y(typeof s=="string"?s:void 0)}return rt.setSpanContext(e,i)}fields(){return[$6,_6]}}const Aou="[object Object]",Bou="[object Null]",Sou="[object Undefined]",zou=Function.prototype,yH=zou.toString,wou=yH.call(Object),Oou=Object.getPrototypeOf,AH=Object.prototype,BH=AH.hasOwnProperty,ls=Symbol?Symbol.toStringTag:void 0,SH=AH.toString;function _w(u){if(!Pou(u)||jou(u)!==Aou)return!1;const e=Oou(u);if(e===null)return!0;const a=BH.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&yH.call(a)===wou}function Pou(u){return u!=null&&typeof u=="object"}function jou(u){return u==null?u===void 0?Sou:Bou:ls&&ls in Object(u)?Mou(u):Tou(u)}function Mou(u){const e=BH.call(u,ls),a=u[ls];let t=!1;try{u[ls]=void 0,t=!0}catch{}const r=SH.call(u);return t&&(e?u[ls]=a:delete u[ls]),r}function Tou(u){return SH.call(u)}const Rou=20;function Nou(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=zH(e,u.shift(),0,a);return e}function L6(u){return Th(u)?u.slice():u}function zH(u,e,a=0,t){let r;if(!(a>Rou)){if(a++,lx(u)||lx(e)||wH(e))r=L6(e);else if(Th(u)){if(r=u.slice(),Th(e))for(let n=0,i=e.length;n<i;n++)r.push(L6(e[n]));else if(n4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=L6(e[s])}}}else if(n4(u))if(n4(e)){if(!$ou(u,e))return e;r=Object.assign({},u);const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i],l=e[s];if(lx(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(Lw(u,s,t)||Lw(e,s,t))delete r[s];else{if(n4(c)&&n4(d)){const E=t.get(c)||[],p=t.get(d)||[];E.push({obj:u,key:s}),p.push({obj:e,key:s}),t.set(c,E),t.set(d,p)}r[s]=zH(r[s],l,a,t)}}}}else r=e;return r}}function Lw(u,e,a){const t=a.get(u[e])||[];for(let r=0,n=t.length;r<n;r++){const i=t[r];if(i.key===e&&i.obj===u)return!0}return!1}function Th(u){return Array.isArray(u)}function wH(u){return typeof u=="function"}function n4(u){return!lx(u)&&!Th(u)&&!wH(u)&&typeof u=="object"}function lx(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function $ou(u,e){return!(!_w(u)||!_w(e))}class _ou{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,a)=>{this._resolve=e,this._reject=a})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class Lou{_callback;_that;_isCalled=!1;_deferred=new _ou;constructor(e,a){this._callback=e,this._that=a}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(a=>this._deferred.resolve(a),a=>this._deferred.reject(a))}catch(a){this._deferred.reject(a)}}return this._deferred.promise}}function Iou(){return"unknown_service"}const O4=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class Rh{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new Rh({});return a._rawAttributes=Iw(e),a._asyncAttributesPending=e.filter(([t,r])=>O4(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(O4(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=Iw(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[a,t]=this._rawAttributes[e];this._rawAttributes[e]=[a,O4(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_u.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(O4(t)){_u.debug(`Unsettled resource attribute ${a} skipped`);continue}t!=null&&(e[a]??=t)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return e==null?this:Rh.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function OH(u){return Rh.FromAttributeList(Object.entries(u))}function Kou(){return OH({[kH]:Iou(),[pb]:N6[pb],[mb]:N6[mb],[xb]:N6[xb]})}function Iw(u){return u.map(([e,a])=>O4(a)?[e,a.catch(t=>{_u.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const Vou="exception";class Gou{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:mr.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const a=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=E1.now(),this._performanceOffset=a-(this._performanceStartTime+bH()),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??a),this.resource=e.resource,this.instrumentationScope=e.scope,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,a){if(a==null||this._isSpanEnded())return this;if(e.length===0)return _u.warn(`Invalid attribute key: ${e}`),this;if(!gH(a))return _u.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:t}=this._spanLimits;return t!==void 0&&Object.keys(this.attributes).length>=t&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(a),this)}setAttributes(e){for(const[a,t]of Object.entries(e))this.setAttribute(a,t);return this}addEvent(e,a,t){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(r===0)return _u.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_u.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Tw(a)&&(Tw(t)||(t=a),a=void 0);const n=sx(a);return this.events.push({name:e,attributes:n,time:this._getTime(t),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status={...e},this.status.message!=null&&typeof e.message!="string"&&(_u.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){_u.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=oou(this.startTime,this.endTime),this._duration[0]<0&&(_u.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_u.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=E1.now())return iou(e+this._performanceOffset);if(typeof e=="number")return a1(e);if(e instanceof Date)return a1(e.getTime());if(CH(e))return e;if(this._startTimeProvided)return a1(Date.now());const a=E1.now()-this._performanceStartTime;return FH(this.startTime,a1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[T6]=e:e&&(e.code?t[R6]=e.code.toString():e.name&&(t[R6]=e.name),e.message&&(t[T6]=e.message),e.stack&&(t[Xiu]=e.stack)),t[R6]||t[T6]?this.addEvent(Vou,t,a):_u.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_u.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,a){return e.length<=a?e:e.substring(0,a)}_truncateToSize(e){const a=this._attributeValueLengthLimit;return a<=0?(_u.warn(`Attribute value limit must be positive, got ${a}`),e):typeof e=="string"?this._truncateToLimitUtil(e,a):Array.isArray(e)?e.map(t=>typeof t=="string"?this._truncateToLimitUtil(t,a):t):e}}var N1;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(N1||(N1={}));class Nh{shouldSample(){return{decision:N1.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class p1{shouldSample(){return{decision:N1.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class em{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(R1(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new p1),this._remoteParentSampled=e.remoteParentSampled??new p1,this._remoteParentNotSampled=e.remoteParentNotSampled??new Nh,this._localParentSampled=e.localParentSampled??new p1,this._localParentNotSampled=e.localParentNotSampled??new Nh}shouldSample(e,a,t,r,n,i){const o=rt.getSpanContext(e);return!o||!LD(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&mi.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&mi.SAMPLED?this._localParentSampled.shouldSample(e,a,t,r,n,i):this._localParentNotSampled.shouldSample(e,a,t,r,n,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Kw{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,a){return{decision:mH(a)&&this._accumulate(a)<this._upperBound?N1.RECORD_AND_SAMPLED:N1.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let a=0;for(let t=0;t<e.length/8;t++){const r=t*8,n=parseInt(e.slice(r,r+8),16);a=(a^n)>>>0}return a}}const Vw=1;function PH(){return{sampler:jH(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function jH(){const u="parentbased_always_on";switch(u){case"always_on":return new p1;case"always_off":return new Nh;case"parentbased_always_on":return new em({root:new p1});case"parentbased_always_off":return new em({root:new Nh});case"traceidratio":return new Kw(Gw());case"parentbased_traceidratio":return new em({root:new Kw(Gw())});default:return _u.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new em({root:new p1})}}function Gw(){return _u.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Vw}.`),Vw}const Hou=128,qou=1/0;function Wou(u){const e={sampler:jH()},a=PH(),t=Object.assign({},a,e,u);return t.generalLimits=Object.assign({},a.generalLimits,u.generalLimits||{}),t.spanLimits=Object.assign({},a.spanLimits,u.spanLimits||{}),t}function Jou(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??Hou,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??qou,Object.assign({},u,{spanLimits:e})}class Uou{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,a){this._exporter=e,this._maxExportBatchSize=typeof a?.maxExportBatchSize=="number"?a.maxExportBatchSize:512,this._maxQueueSize=typeof a?.maxQueueSize=="number"?a.maxQueueSize:2048,this._scheduledDelayMillis=typeof a?.scheduledDelayMillis=="number"?a.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof a?.exportTimeoutMillis=="number"?a.exportTimeoutMillis:3e4,this._shutdownOnce=new Lou(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_u.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,a){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&mi.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_u.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(_u.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,a)=>{const t=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,i=r;n<i;n++)t.push(this._flushOneBatch());Promise.all(t).then(()=>{e()}).catch(a)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,a)=>{const t=setTimeout(()=>{a(new Error("Timeout"))},this._exportTimeoutMillis);ni.with(Niu(ni.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const n=()=>this._exporter.export(r,o=>{clearTimeout(t),o.code===qr.SUCCESS?e():a(o.error??new Error("BatchSpanProcessor: span export failed"))});let i=null;for(let o=0,s=r.length;o<s;o++){const l=r[o];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(i??=[],i.push(l.resource.waitForAsyncAttributes()))}i===null?n():Promise.all(i).then(n,o=>{R1(o),a(o)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(a=>{this._isExporting=!1,R1(a)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer,void 0)}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}class Zou extends Uou{_visibilityChangeListener;_pageHideListener;constructor(e,a){super(e,a),this.onInit(a)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(a=>{R1(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{R1(a)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const Qou=8,You=16;class Xou{generateTraceId=Hw(You);generateSpanId=Hw(Qou)}const um=Array(32);function Hw(u){return function(){for(let a=0;a<u*2;a++)um[a]=Math.floor(Math.random()*16)+48,um[a]>=58&&(um[a]+=39);return String.fromCharCode.apply(null,um.slice(0,u*2))}}class esu{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=Wou(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new Xou,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=ni.active()){a.root&&(t=rt.deleteSpan(t));const r=rt.getSpan(t);if(Ny(t))return _u.debug("Instrumentation suppressed, returning Noop Span"),rt.wrapSpanContext(EH);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!rt.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??cb.INTERNAL,d=(a.links??[]).map(g=>({context:g.context,attributes:sx(g.attributes)})),E=sx(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const h=p.decision===jh.RECORD_AND_SAMPLED?mi.SAMPLED:mi.NONE,x={traceId:s,spanId:i,traceFlags:h,traceState:l};if(p.decision===jh.NOT_RECORD)return _u.debug("Recording is off, propagating context in a non-recording span"),rt.wrapSpanContext(x);const f=sx(Object.assign(E,p.attributes));return new Gou({resource:this._resource,scope:this.instrumentationScope,context:t,spanContext:x,name:e,kind:c,links:d,parentSpanContext:o,attributes:f,startTime:a.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,a,t,r){let n,i,o;if(arguments.length<2)return;arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);const s=i??ni.active(),l=this.startSpan(e,n,s),c=rt.setSpan(s,l);return ni.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class usu{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const a of this._spanProcessors)e.push(a.forceFlush());return new Promise(a=>{Promise.all(e).then(()=>{a()}).catch(t=>{R1(t||new Error("MultiSpanProcessor: forceFlush failed")),a()})})}onStart(e,a){for(const t of this._spanProcessors)t.onStart(e,a)}onEnd(e){for(const a of this._spanProcessors)a.onEnd(e)}shutdown(){const e=[];for(const a of this._spanProcessors)e.push(a.shutdown());return new Promise((a,t)=>{Promise.all(e).then(()=>{a()},t)})}}var cs;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(cs||(cs={}));class asu{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=Nou({},PH(),Jou(e));this._resource=a.resource??Kou(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new usu(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new esu({name:e,version:a,schemaUrl:t?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,a=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(r=>{let n;const i=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${e} ms`)),n=cs.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==cs.timeout&&(n=cs.resolved,r(n))}).catch(o=>{clearTimeout(i),n=cs.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==cs.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class tsu{_enabled=!1;_currentContext=Wl;_bindFunction(e=Wl,a){const t=this,r=function(...n){return t.with(e,()=>a.apply(this,n))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:a.length}),r}active(){return this._currentContext}bind(e,a){return e===void 0&&(e=this.active()),typeof a=="function"?this._bindFunction(e,a):a}disable(){return this._currentContext=Wl,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=Wl,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||Wl;try{return a.call(t,...r)}finally{this._currentContext=n}}}function rsu(u){if(u!==null){if(u===void 0){const e=new tsu;e.enable(),ni.setGlobalContextManager(e);return}u.enable(),ni.setGlobalContextManager(u)}}function nsu(u){if(u!==null){if(u===void 0){Q4.setGlobalPropagator(new lou({propagators:[new you,new Hiu]}));return}Q4.setGlobalPropagator(u)}}class isu extends asu{constructor(e={}){super(e)}register(e={}){rt.setGlobalTracerProvider(this),nsu(e.propagator),rsu(e.contextManager)}}class osu{_delegate;constructor(e){this._delegate=e}export(e,a){this._delegate.export(e,a)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class qw extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function ssu(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function lsu(u){if(u!=null)return()=>u}function csu(u,e,a){return{timeoutMillis:ssu(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function dsu(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class Esu{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const a=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(a,a)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function psu(u){return new Esu(u.concurrencyLimit)}function msu(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function xsu(){return{handleResponse(u){u==null||!msu(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||_u.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class hsu{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,a,t,r,n){this._transport=e,this._serializer=a,this._responseHandler=t,this._promiseQueue=r,this._timeout=n,this._diagLogger=_u.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:qr.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:qr.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(t,this._timeout).then(r=>{if(r.status==="success"){if(r.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(r.data))}catch(n){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",n,r.data)}a({code:qr.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:qr.FAILED,error:r.error});return}else r.status==="retryable"?a({code:qr.FAILED,error:new qw("Export failed with retryable status")}):a({code:qr.FAILED,error:new qw("Export failed with unknown error")})},r=>a({code:qr.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Dsu(u,e){return new hsu(u.transport,u.serializer,xsu(),u.promiseHandler,e.timeout)}function MH(u,e,a){return Dsu({transport:a,serializer:e,promiseHandler:psu(u)},{timeout:u.timeoutMillis})}function Ww(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function TH(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Ww(u.charCodeAt(t)),n=Ww(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function RH(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function fsu(u){const e=Number(BigInt.asUintN(32,u)),a=Number(BigInt.asUintN(32,u>>BigInt(32)));return{low:e,high:a}}function gsu(u){const e=RH(u);return fsu(e)}function vsu(u){return RH(u).toString()}const ksu=typeof BigInt<"u"?vsu:sou;function Jw(u){return u}function bsu(u){if(u!==void 0)return TH(u)}const Csu={encodeHrTime:gsu,encodeSpanContext:TH,encodeOptionalSpanContext:bsu};function Fsu(u){return u===void 0?Csu:{encodeHrTime:ksu,encodeSpanContext:Jw,encodeOptionalSpanContext:Jw}}function ysu(u){return{attributes:ID(u.attributes),droppedAttributesCount:0}}function Asu(u){return{name:u.name,version:u.version}}function ID(u){return Object.keys(u).map(e=>NH(e,u[e]))}function NH(u,e){return{key:u,value:$H(e)}}function $H(u){const e=typeof u;return e==="string"?{stringValue:u}:e==="number"?Number.isInteger(u)?{intValue:u}:{doubleValue:u}:e==="boolean"?{boolValue:u}:u instanceof Uint8Array?{bytesValue:u}:Array.isArray(u)?{arrayValue:{values:u.map($H)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>NH(a,t))}}:{}}function Bsu(u,e){const a=u.spanContext(),t=u.status,r=u.parentSpanContext?.spanId?e.encodeSpanContext(u.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(a.traceId),spanId:e.encodeSpanContext(a.spanId),parentSpanId:r,traceState:a.traceState?.serialize(),name:u.name,kind:u.kind==null?0:u.kind+1,startTimeUnixNano:e.encodeHrTime(u.startTime),endTimeUnixNano:e.encodeHrTime(u.endTime),attributes:ID(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>zsu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>Ssu(n,e)),droppedLinksCount:u.droppedLinksCount}}function Ssu(u,e){return{attributes:u.attributes?ID(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function zsu(u,e){return{attributes:u.attributes?ID(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function wsu(u,e){const a=Fsu(e);return{resourceSpans:Psu(u,a)}}function Osu(u){const e=new Map;for(const a of u){let t=e.get(a.resource);t||(t=new Map,e.set(a.resource,t));const r=`${a.instrumentationScope.name}@${a.instrumentationScope.version||""}:${a.instrumentationScope.schemaUrl||""}`;let n=t.get(r);n||(n=[],t.set(r,n)),n.push(a)}return e}function Psu(u,e){const a=Osu(u),t=[],r=a.entries();let n=r.next();for(;!n.done;){const[i,o]=n.value,s=[],l=o.values();let c=l.next();for(;!c.done;){const E=c.value;if(E.length>0){const p=E.map(h=>Bsu(h,e));s.push({scope:Asu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:ysu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const jsu={serializeRequest:u=>{const e=wsu(u,{});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:u=>{if(u.length===0)return{};const e=new TextDecoder;return JSON.parse(e.decode(u))}},Msu=5,Tsu=1e3,Rsu=5e3,Nsu=1.5,Uw=.2;function $su(){return Math.random()*(2*Uw)-Uw}class _su{_transport;constructor(e){this._transport=e}retry(e,a,t){return new Promise((r,n)=>{setTimeout(()=>{this._transport.send(e,a).then(r,n)},t)})}async send(e,a){const t=Date.now()+a;let r=await this._transport.send(e,a),n=Msu,i=Tsu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,Rsu)+$su(),0);i=i*Nsu;const s=r.retryInMillis??o,l=t-Date.now();if(s>l)return r;r=await this.retry(e,l,s)}return r}shutdown(){return this._transport.shutdown()}}function _H(u){return new _su(u.transport)}function Lsu(u){return[429,502,503,504].includes(u)}function Isu(u){if(u==null)return;const e=Number.parseInt(u,10);if(Number.isInteger(e))return e>0?e*1e3:-1;const a=new Date(u).getTime()-Date.now();return a>=0?a:0}class Ksu{_parameters;constructor(e){this._parameters=e}send(e,a){return new Promise(t=>{const r=new XMLHttpRequest;r.timeout=a,r.open("POST",this._parameters.url);const n=this._parameters.headers();Object.entries(n).forEach(([i,o])=>{r.setRequestHeader(i,o)}),r.ontimeout=i=>{t({status:"failure",error:new Error("XHR request timed out")})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_u.debug("XHR success"),t({status:"success"})):r.status&&Lsu(r.status)?t({status:"retryable",retryInMillis:Isu(r.getResponseHeader("Retry-After"))}):r.status!==0&&t({status:"failure",error:new Error("XHR request failed with non-retryable status")})},r.onabort=()=>{t({status:"failure",error:new Error("XHR request aborted")})},r.onerror=()=>{t({status:"failure",error:new Error("XHR request errored")})},r.send(e)})}shutdown(){}}function Vsu(u){return new Ksu(u)}class Gsu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_u.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Hsu(u){return new Gsu(u)}function qsu(u,e){return MH(u,e,_H({transport:Vsu(u)}))}function Wsu(u,e){return MH(u,e,_H({transport:Hsu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function Jsu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):_u.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function Usu(u,e,a){const t={...a()},r={};return()=>(e!=null&&Object.assign(r,e()),u!=null&&Object.assign(r,u()),Object.assign(r,t))}function Zsu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function Qsu(u,e,a){return{...csu(u,e,a),headers:Usu(Jsu(u.headers),e.headers,a.headers),url:Zsu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function Ysu(u,e){return{...dsu(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function Xsu(u,e,a){return Qsu({url:u.url,timeoutMillis:u.timeoutMillis,headers:lsu(u.headers),concurrencyLimit:u.concurrencyLimit},{},Ysu(a,e))}function elu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=Xsu(u,a,t);return r?qsu(n,e):Wsu(n,e)}class ulu extends osu{constructor(e={}){super(elu(e,jsu,"v1/traces",{"Content-Type":"application/json"}))}}class LH{emit(e){}}const alu=new LH;class tlu{getLogger(e,a,t){return new LH}}const IH=new tlu;class rlu{constructor(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):alu}}class Zw{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new rlu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:IH}setDelegate(e){this._delegate=e}getDelegateLogger(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getLogger(e,a,t)}}const nlu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},am=Symbol.for("io.opentelemetry.js.api.logs"),i4=nlu;function ilu(u,e,a){return t=>t===u?e:a}const Qw=1;class _y{constructor(){this._proxyLoggerProvider=new Zw}static getInstance(){return this._instance||(this._instance=new _y),this._instance}setGlobalLoggerProvider(e){return i4[am]?this.getLoggerProvider():(i4[am]=ilu(Qw,e,IH),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=i4[am])===null||e===void 0?void 0:e.call(i4,Qw))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete i4[am],this._proxyLoggerProvider=new Zw}}const KH=_y.getInstance();function olu(u,e,a,t){for(let r=0,n=u.length;r<n;r++){const i=u[r];e&&i.setTracerProvider(e),a&&i.setMeterProvider(a),t&&i.setLoggerProvider&&i.setLoggerProvider(t),i.getConfig().enabled||i.enable()}}function slu(u){u.forEach(e=>e.disable())}function llu(u){const e=u.tracerProvider||rt.getTracerProvider(),a=u.meterProvider||hH.getMeterProvider(),t=u.loggerProvider||KH.getLoggerProvider(),r=u.instrumentations?.flat()??[];return olu(r,e,a,t),()=>{slu(r)}}let zt=console.error.bind(console);function o4(u,e,a){const t=!!u[e]&&Object.prototype.propertyIsEnumerable.call(u,e);Object.defineProperty(u,e,{configurable:!0,enumerable:t,writable:!0,value:a})}const VH=(u,e,a)=>{if(!u||!u[e]){zt("no original function "+String(e)+" to wrap");return}if(!a){zt("no wrapper function"),zt(new Error().stack);return}const t=u[e];if(typeof t!="function"||typeof a!="function"){zt("original object and wrapper must be functions");return}const r=a(t,e);return o4(r,"__original",t),o4(r,"__unwrap",()=>{u[e]===r&&o4(u,e,t)}),o4(r,"__wrapped",!0),o4(u,e,r),r},clu=(u,e,a)=>{if(u)Array.isArray(u)||(u=[u]);else{zt("must provide one or more modules to patch"),zt(new Error().stack);return}if(!(e&&Array.isArray(e))){zt("must provide one or more functions to wrap on modules");return}u.forEach(t=>{e.forEach(r=>{VH(t,r,a)})})},GH=(u,e)=>{if(!u||!u[e]){zt("no function to unwrap."),zt(new Error().stack);return}const a=u[e];if(!a.__unwrap)zt("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{a.__unwrap();return}},dlu=(u,e)=>{if(u)Array.isArray(u)||(u=[u]);else{zt("must provide one or more modules to patch"),zt(new Error().stack);return}if(!(e&&Array.isArray(e))){zt("must provide one or more functions to unwrap on modules");return}u.forEach(a=>{e.forEach(t=>{GH(a,t)})})};class Elu{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,a,t){this.instrumentationName=e,this.instrumentationVersion=a,this.setConfig(t),this._diag=_u.createComponentLogger({namespace:e}),this._tracer=rt.getTracer(e,a),this._meter=hH.getMeter(e,a),this._logger=KH.getLogger(e,a),this._updateMetricInstruments()}_wrap=VH;_unwrap=GH;_massWrap=clu;_massUnwrap=dlu;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,a,t,r){if(e)try{e(t,r)}catch(n){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:a},n)}}}class plu extends Elu{constructor(e,a,t){super(e,a,t),this._config.enabled&&this.enable()}}class mlu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(mr.ERROR,e.message),this.span.recordException(e),this.span.end())}setAttribute(e,a){this.span&&this.span.setAttribute(e,a)}end(){this.span&&(this.span.setStatus(mr.OK),this.span.end())}}class xlu{config=null;tracer=null;tracerProvider=null;initialized=!1;initTracer(e){throw new Error("initTracer must be implemented by the environment-specific client")}init(e){this.config=e,this.initTracer(e)}send(e){try{if(!this.tracer||!this.config)return;const a=e.time?new Date(e.time):new Date;this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,a),startTime:a}).end(a)}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}processAttributes(e,a){const r={"cloudevents.event_id":Ph(),"cloudevents.event_type":e.type,"cloudevents.event_source":e.source,"cloudevents.event_spec_version":e.specversion,"cloudevents.event_data_content_type":e.datacontenttype||"application/json; charset=utf-8","cloudevents.event_time":a.toISOString(),"cloudevents.event_subject":e.subject??"","cloudevents.page.uri":location.href,"cloudevents.event_version":this.config?.version,"cloudevents.event_origin":this.config?.serviceName,"cloudevents.event_source_details.id":e.sourceDetails?.id??"anonymous","cloudevents.event_source_details.object":e.sourceDetails?.object??"anonymous","cloudevents.event_source_details.uri":e.sourceDetails?.uri};if(e.data&&typeof e.data=="object"&&Object.entries(e.data).forEach(([n,i])=>{const o=n.replace(/([A-Z])/g,"_$1").toLowerCase();i!==void 0&&(typeof i=="object"&&i!==null&&!Array.isArray(i)?Object.entries(i).forEach(([s,l])=>{l!==void 0&&(r[`cloudevents.event_data.${o}.${s}`]=l)}):r[`cloudevents.event_data.${o}`]=i)}),"subjects"in e&&Array.isArray(e.subjects)){const n=e.subjects.reduce((i,o)=>{if(!o||typeof o!="object")return i;const s=o.object;if(!s||typeof s!="string")return i;const l=i.notUpdated.find(({object:c})=>c===s);return l?(i.updated=[l,o],i.notUpdated=i.notUpdated.filter(({object:c})=>c!==s)):i.updated.some(({object:c})=>c===s)||i.notUpdated.push(o),i},{updated:[],notUpdated:[]});n.updated.forEach((i,o)=>{const s=o===0?"after.":"before.",l=`${i.object}.`;Object.entries(i).forEach(([c,d])=>{d!==void 0&&(r[`cloudevents.subjects.${s}${l}${c}`]=d)})}),n.notUpdated.forEach(i=>{const o=`${i.object}.`;Object.entries(i).forEach(([s,l])=>{l!==void 0&&(r[`cloudevents.subjects.${o}${s}`]=l)})})}return Object.entries(e).forEach(([n,i])=>{["id","source","type","specversion","time","datacontenttype","data","subject","sourceDetails","analyticsMetadata","context"].includes(n)||i!==void 0&&(i instanceof Object?Object.entries(i).forEach(([o,s])=>{s!==void 0&&(r[`cloudevents.${n}.${o}`]=s)}):r[`cloudevents.${n}`]=i)}),r}startSpan(e,a){try{if(!this.tracer)return;let t;const r=e.time?new Date(e.time):new Date,n=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,r),root:!a},a);return a||(t=rt.setSpan(ni.active(),n)),{end:()=>n.end(),setAttribute:(i,o)=>{n.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>n.setStatus({code:i,message:o}),parentCtx:t}}catch(t){this.config?.isProd||console.error("Event reporting failed:",t)}}startStepSpan(e){try{if(!this.tracer)return;const a=ni.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=rt.setSpan(a,r);return{end:()=>r.end(),setAttribute:(i,o)=>{r.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>r.setStatus({code:i,message:o}),recordException:i=>r.recordException(i),context:n}}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}traceStep(e){const a=this.startStepSpan(e);if(a)return new mlu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class hlu extends xlu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${Ph()}`,t=OH({[kH]:e.serviceName,[eou]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new isu({resource:t,spanProcessors:[new Zou(new ulu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),llu({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class ei extends plu{sendErrorEvent;originalConsoleError;constructor(e,a){super("errors","1.0",e||{}),this.sendErrorEvent=a}static toErrorEvent(e,a){return{type:"error",payload:{handler:a,errorType:ei.getErrorType(e),message:ei.getErrorMessage(e),stack:ei.getErrorStack(e)}}}enable(){window.addEventListener("error",this.onError),window.addEventListener("unhandledrejection",this.onUnhandledRejection),this.wrapConsoleError()}disable(){window.removeEventListener("error",this.onError),window.removeEventListener("unhandledrejection",this.onUnhandledRejection),this.unwrapConsoleError()}init(){}static getErrorMessage(e){return e?(typeof e=="object"&&"message"in e?String(e.message):String(e)).trim():void 0}static getErrorStack(e){if(!e||typeof e!="object"||!("stack"in e)||!e.stack)return;const a=String(e.stack);return a.length>4096?a.substring(0,4096):a}static getErrorType(e){return!e||typeof e!="object"?typeof e:"name"in e?String(e.name):"constructor"in e&&"name"in e.constructor?String(e.constructor.name):"Error"}static combineConsoleErrorArgs(e){const a=e.findIndex(r=>r instanceof Error),t=e.filter((r,n)=>n!==a).map(r=>String(r)).join(" ");if(a===-1)return t;{const r=e[a];return t&&(r.message=`${r.message} ${t}`),r}}onError=e=>{this.sendError(e.error,"window.onerror")};onUnhandledRejection=e=>{this.sendError(e.reason,"window.onunhandledrejection")};wrapConsoleError(){this.originalConsoleError=console.error,console.error=(...e)=>{try{const a=ei.combineConsoleErrorArgs(e);this.sendError(a,"console.error")}catch(a){process.env.NODE_ENV!=="production"&&this.originalConsoleError?.call(console,"Error reporting failed:",a)}this.originalConsoleError?.apply(console,e)}}unwrapConsoleError(){this.originalConsoleError&&(console.error=this.originalConsoleError,this.originalConsoleError=void 0)}sendError(e,a){this.sendErrorEvent(ei.toErrorEvent(e,a))}}class Dlu{config=null;initialized=!1;useCloudEventData;otelClient;tracer;constructor(){this.useCloudEventData=()=>({organization:{id:"",slug:""},project:{id:"",slug:""},productType:"",sourceDetails:{user:"Anonymous",object:"user",uri:""},request:{source:""}}),this.otelClient=new hlu,this.tracer={traceStep:(e,a)=>{const t=this.constructCloudEvent(e,a);return this.otelClient.traceStep(t)}}}updateCloudEventData=e=>{this.config?.disabled||(this.useCloudEventData=e)};send(e,a){try{if(!this.config?.otel.isProd)return;const t=this.constructCloudEvent(e,a);this.sendToOtelService(t)}catch(t){this.config?.otel.isProd||console.error("Event reporting failed:",t)}}init(e){e.disabled||this.initialized||(this.config=e,this.initialized=!0,this.otelClient.init({serviceVersion:e.otel.serviceVersion,version:e.otel.version,isProd:e.otel.isProd,collectorUrl:e.otel.collectorUrl,collectorTraceUrl:e.otel.collectorTraceUrl,serviceName:e.otel.serviceName,tracerName:e.otel.tracerName,instrumentations:[...e.otel.enableErrorInstrumentation===!0?[new ei(void 0,a=>{this.sendErrorMessage(a.payload)})]:[],...e.otel.instrumentations||[]]}))}startSpan(e,a,t){if(this.config?.disabled)return;const r=this.constructCloudEvent(e,a);return this.otelClient.startSpan(r,t)}constructCloudEvent(e,a){const t=this.useCloudEventData();return{id:`evt_${Ph()}`,type:e,source:t.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:a,origin:"ui",sourceDetails:{id:t.sourceDetails.user||`usr_${Ph()}`,object:t.sourceDetails.object||"user",uri:t.sourceDetails.uri||""},organization:t.organization,project:t.project,productType:t.productType}}sendToOtelService(e){this.config?.otel.isProd||console.log("CloudEvent to be sent to OTEL service:",e),this.otelClient.send(e)}forceFlush(){return this.config?.disabled?Promise.resolve():this.otelClient.forceFlush()}shutdown(){return this.config?.disabled?Promise.resolve():this.otelClient.shutdown()}sendError(e,a){this.config?.disabled||this.send(ei.toErrorEvent(e,a).type,ei.toErrorEvent(e,a).payload)}sendTabChangeMessage(e){this.send("tab.change",e)}sendButtonClickMessage(e){this.send("button.click",e)}sendChangeMessage(e){this.send("change",e)}sendContentCopyMessage(e){this.send("content.copy",e)}sendUrlClickMessage(e){this.send("url.click",e)}sendRequestSendMessage(e){this.send("request.send",e)}sendTokenGenerateMessage(e){this.send("token.generate",e)}sendAppLifecycleMessage(e){this.send("app.lifecycle",e)}sendEnvironmentManagementMessage(e){this.send("environment.management",e)}sendServerManagementMessage(e){this.send("server.management",e)}sendInputManagementMessage(e){this.send("input.management",e)}sendNodeManagementMessage(e){this.send("node.management",e)}sendHistoryManagementMessage(e){this.send("history.management",e)}sendCredentialManagementMessage(e){this.send("credential.management",e)}sendPanelToggleMessage(e){this.send("panel.toggle",e)}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(e){this.send("workflow.run.result",e)}sendStorageReadMessage(){this.send("storage.read")}sendStorageLoadUserStateMessage(){this.send("storage.loadUserState")}sendStorageDetectFilesMessage(){this.send("storage.detectFiles")}sendStorageLoadApisMessage(){this.send("storage.loadApis")}sendStorageParseApisMessage(){this.send("storage.parseApis")}sendStorageParseCollectionsMessage(){this.send("storage.parseCollections")}sendErrorMessage(e){this.send("error",e)}}const KD=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],flu="https://cors.redocly.com/";function glu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function Yw(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Xw(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Yw(Object(a),!0).forEach(function(t){glu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):Yw(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function s0(u){return"Minified Redux error #"+u+"; visit https://redux.js.org/Errors?code="+u+" for the full message or use the non-minified dev environment for full errors. "}var eO=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),I6=function(){return Math.random().toString(36).substring(7).split("").join(".")},Eo={INIT:"@@redux/INIT"+I6(),REPLACE:"@@redux/REPLACE"+I6(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+I6()}};function HH(u){if(typeof u!="object"||u===null)return!1;for(var e=u;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(u)===e}function vlu(u){if(u===void 0)return"undefined";if(u===null)return"null";var e=typeof u;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(u))return"array";if(Clu(u))return"date";if(blu(u))return"error";var a=klu(u);switch(a){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return a}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function klu(u){return typeof u.constructor=="function"?u.constructor.name:null}function blu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function Clu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function Ji(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=vlu(u)),e}function VD(u,e,a){var t;if(typeof e=="function"&&typeof a=="function"||typeof a=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?s0(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof a>"u"&&(a=e,e=void 0),typeof a<"u"){if(typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?s0(1):"Expected the enhancer to be a function. Instead, received: '"+Ji(a)+"'");return a(VD)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?s0(2):"Expected the root reducer to be a function. Instead, received: '"+Ji(u)+"'");var r=u,n=e,i=[],o=i,s=!1;function l(){o===i&&(o=i.slice())}function c(){if(s)throw new Error(process.env.NODE_ENV==="production"?s0(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return n}function d(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?s0(4):"Expected the listener to be a function. Instead, received: '"+Ji(x)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?s0(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var f=!0;return l(),o.push(x),function(){if(f){if(s)throw new Error(process.env.NODE_ENV==="production"?s0(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");f=!1,l();var g=o.indexOf(x);o.splice(g,1),i=null}}}function E(x){if(!HH(x))throw new Error(process.env.NODE_ENV==="production"?s0(7):"Actions must be plain objects. Instead, the actual type was: '"+Ji(x)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof x.type>"u")throw new Error(process.env.NODE_ENV==="production"?s0(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(s)throw new Error(process.env.NODE_ENV==="production"?s0(9):"Reducers may not dispatch actions.");try{s=!0,n=r(n,x)}finally{s=!1}for(var f=i=o,D=0;D<f.length;D++){var g=f[D];g()}return x}function p(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?s0(10):"Expected the nextReducer to be a function. Instead, received: '"+Ji(x));r=x,E({type:Eo.REPLACE})}function h(){var x,f=d;return x={subscribe:function(g){if(typeof g!="object"||g===null)throw new Error(process.env.NODE_ENV==="production"?s0(11):"Expected the observer to be an object. Instead, received: '"+Ji(g)+"'");function k(){g.next&&g.next(c())}k();var C=f(k);return{unsubscribe:C}}},x[eO]=function(){return this},x}return E({type:Eo.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[eO]=h,t}var Flu=VD;function Db(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function ylu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===Eo.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(r.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!HH(u))return"The "+n+' has unexpected type of "'+Ji(u)+'". Expected argument to be an object with the following '+('keys: "'+r.join('", "')+'"');var i=Object.keys(u).filter(function(o){return!e.hasOwnProperty(o)&&!t[o]});if(i.forEach(function(o){t[o]=!0}),!(a&&a.type===Eo.REPLACE)&&i.length>0)return"Unexpected "+(i.length>1?"keys":"key")+" "+('"'+i.join('", "')+'" found in '+n+". ")+"Expected to find one of the known reducer keys instead: "+('"'+r.join('", "')+'". Unexpected keys will be ignored.')}function Alu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:Eo.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?s0(12):'The slice reducer for key "'+e+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof a(void 0,{type:Eo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?s0(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Eo.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function Blu(u){for(var e=Object.keys(u),a={},t=0;t<e.length;t++){var r=e[t];process.env.NODE_ENV!=="production"&&typeof u[r]>"u"&&Db('No reducer provided for key "'+r+'"'),typeof u[r]=="function"&&(a[r]=u[r])}var n=Object.keys(a),i;process.env.NODE_ENV!=="production"&&(i={});var o;try{Alu(a)}catch(s){o=s}return function(l,c){if(l===void 0&&(l={}),o)throw o;if(process.env.NODE_ENV!=="production"){var d=ylu(l,a,c,i);d&&Db(d)}for(var E=!1,p={},h=0;h<n.length;h++){var x=n[h],f=a[x],D=l[x],g=f(D,c);if(typeof g>"u"){var k=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?s0(14):"When called with an action of type "+(k?'"'+String(k)+'"':"(unknown type)")+', the slice reducer for key "'+x+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}p[x]=g,E=E||g!==D}return E=E||n.length!==Object.keys(l).length,E?p:l}}function uO(u,e){return function(){return e(u.apply(this,arguments))}}function Slu(u,e){if(typeof u=="function")return uO(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?s0(16):"bindActionCreators expected an object or a function, but instead received: '"+Ji(u)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var a={};for(var t in u){var r=u[t];typeof r=="function"&&(a[t]=uO(r,e))}return a}function qH(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,arguments))}})}function zlu(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error(process.env.NODE_ENV==="production"?s0(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},o=e.map(function(s){return s(i)});return n=qH.apply(void 0,o)(r.dispatch),Xw(Xw({},r),{},{dispatch:n})}}}function aO(){}process.env.NODE_ENV!=="production"&&typeof aO.name=="string"&&aO.name!=="isCrushed"&&Db('You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.');var wlu=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Eo,applyMiddleware:zlu,bindActionCreators:Slu,combineReducers:Blu,compose:qH,createStore:VD,legacy_createStore:Flu});function Olu(u){var e=u.default;if(typeof e=="function"){var a=function(){return e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(u).forEach(function(t){var r=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return u[t]}})}),a}var Plu=Olu(wlu);Plu.compose;var jlu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function Mlu(u,e,a){var t=!1,r=!1,n=VD(function(o,s){if(!r){var l=function(f){return Array.isArray(f)&&f.findIndex(function(D){return typeof D!="string"&&typeof D!="number"})===-1};if(s.type.startsWith("SET")){var c=function(f){try{t=!0,"value"in s?f.set(s.value):f.set(lu)}finally{t=!1}};if(s.path){if(l(s.path)){s.path.length===0&&c(u);for(var d=u,E=!0,p=0,h=s.path;p<h.length;p++){var x=h[p];d[x]?d=d[x]:E=!1}E&&c(d)}}else c(u)}else s.type==="BREAKPOINT"&&a()}return u.promised||u.error?lu:u.get({noproxy:!0})},jlu({name:"".concat(window.location.hostname,": ").concat(e),trace:!0,traceLimit:16,autoPause:!0,shouldHotReload:!1,features:{persist:!0,pause:!0,lock:!1,export:"custom",import:"custom",jump:!1,skip:!1,reorder:!1,dispatch:!0,test:!1}})),i=function(o,s){if(t)s&&s();else try{r=!0,n.dispatch(o)}finally{r=!1}};return i}function Tlu(u){return function(){var e,a,t=!1;return{onInit:function(r,n){if(!(typeof window>"u"||!("__REDUX_DEVTOOLS_EXTENSION__"in window))){if(u?.key===void 0){if(n.identifier===void 0)throw Error("State is missing Identifiable extension or Devtools key option");e=n.identifier(r)}else e=u.key;a=Mlu(r,e,function(){t=!t}),r.promise||a?.({type:"CREATE",state:r.get({noproxy:!0,stealth:!0})})}},onSet:function(r,n){if(a?.({type:"SET [".concat(r.path.join("/"),"]"),state:r.get({noproxy:!0,stealth:!0}),descriptor:n}),t)debugger},onDestroy:function(){a?.({type:"DESTROY"})}}}}var Ru=(u=>(u.Normal="Normal",u.Edit="Edit",u.Draft="Draft",u))(Ru||{});const bE="default",WH=[{name:bE,inputs:[],servers:[],state:Ru.Normal}],JH={activeTabIdx:0,tabs:[]};var Gr=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(Gr||{});function ii(u){const e=new WeakMap;function a(t){if(typeof t!="object"||t===null)return t;if(e.has(t))return e.get(t);const r=Array.isArray(t)?[]:{};e.set(t,r);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=a(t[n]));return r}return a(u)}function fb(u,e){if(u===e)return!0;if(u&&e&&typeof u=="object"&&typeof e=="object"){if(Array.isArray(u)&&Array.isArray(e)){if(u.length!==e.length)return!1;for(let r=0;r<u.length;r++)if(!fb(u[r],e[r]))return!1;return!0}const a=Object.keys(u),t=Object.keys(e);if(a.length!==t.length)return!1;for(let r=0;r<a.length;r++){const n=a[r];if(!Object.prototype.hasOwnProperty.call(e,n)||!fb(u[n],e[n]))return!1}return!0}return u!==u&&e!==e}function tO(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}const ln={FS:"fs",WEB:"web"};function pc(){return!!window?.__TAURI__}class da{static utils=null;static async getUtils(){return da.utils||(da.utils=pc()?await Promise.resolve().then(()=>require("./replay-tauri-path-e76hiICo.js")):await Promise.resolve().then(()=>l0e)),da.utils}static async dirname(e){return(await da.getUtils()).dirname(e)}static async join(...e){return(await da.getUtils()).join(...e)}static async resolve(e){return(await da.getUtils()).resolve(e)}static async isAbsolute(e){return(await da.getUtils()).isAbsolute(e)}static async relative(e,a){return(await da.getUtils()).relative(e,a)}static async extname(e){return(await da.getUtils()).extname(e)}}async function R0(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}var $h;(function(u){u[u.Audio=1]="Audio",u[u.Cache=2]="Cache",u[u.Config=3]="Config",u[u.Data=4]="Data",u[u.LocalData=5]="LocalData",u[u.Document=6]="Document",u[u.Download=7]="Download",u[u.Picture=8]="Picture",u[u.Public=9]="Public",u[u.Video=10]="Video",u[u.Resource=11]="Resource",u[u.Temp=12]="Temp",u[u.AppConfig=13]="AppConfig",u[u.AppData=14]="AppData",u[u.AppLocalData=15]="AppLocalData",u[u.AppCache=16]="AppCache",u[u.AppLog=17]="AppLog",u[u.Desktop=18]="Desktop",u[u.Executable=19]="Executable",u[u.Font=20]="Font",u[u.Home=21]="Home",u[u.Runtime=22]="Runtime",u[u.Template=23]="Template"})($h||($h={}));async function Rlu(){return R0("plugin:path|resolve_directory",{directory:$h.AppData})}async function Nlu(){return R0("plugin:path|resolve_directory",{directory:$h.Desktop})}function UH(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function $lu(...u){return R0("plugin:path|resolve",{paths:u})}async function Y4(...u){return R0("plugin:path|join",{paths:u})}async function _lu(u){return R0("plugin:path|dirname",{path:u})}async function Llu(u){return R0("plugin:path|extname",{path:u})}async function ZH(u,e){return R0("plugin:path|basename",{path:u,ext:e})}async function Ilu(u){return R0("plugin:path|is_absolute",{path:u})}var rO;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(rO||(rO={}));async function nO(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await R0("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function QH(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await R0("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function Klu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await R0("plugin:fs|read_file",{path:u instanceof URL?u.toString():u,options:e});return a instanceof ArrayBuffer?new Uint8Array(a):Uint8Array.from(a)}async function Ly(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await R0("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function Vlu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await R0("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function Glu(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await R0("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function YH(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await R0("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}const oi=window.__TAURI__?.http.fetch??globalThis.fetch;function cx(u){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(u)}function _h(u){return u.endsWith("/")?u.substring(0,u.length-1):u}function Hlu(u){return u.startsWith("/")?u.substring(1):u}function qlu(u){try{const e=new URL(u);return e.search="",e.hash="",e.toString()}catch{return u}}class XH extends SD{constructor(){super()}resolveExternalRef(e,a){return cx(a)?a:e&&cx(e)?new URL(a,e).href:e?ws.resolve(ws.dirname(e),a):a}async loadExternalRef(e){if(cx(e)){const{body:a,mimeType:t}=await n_(e,{...this.config.http,customFetch:oi});return new O1(e,a,t)}else{if(!await YH(e))throw new Error(`File not found at ${e}.`);try{throw await QH(e),new Error(`Expected a file but received a folder at ${e}.`)}catch(r){if(r instanceof Error&&r.message.includes("Expected a file but received a folder"))throw r}const t=await Ly(e);return new O1(e,t.replace(/\r\n/g,`
468
+ `;function Sy({input:u,onSave:e,onCancel:a,...t}){const[r,n]=_.useState(!!u.isSecret),i=({name:o,value:s})=>{e({...u,name:o,value:s,isSecret:r})};return m.jsx(lH,{variable:u,onSave:i,onCancel:a,...t,children:m.jsx(Sd,{children:m.jsx(sH,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const lb=()=>({name:"",value:"",isSecret:!1}),ga=u=>e_+"$inputs."+u+_F,Dnu=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${oD}$`)?.[1]);function fnu({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function Li(u){const e=new RegExp(oD,"g"),a=new Set;if(!u)return a;for(const[t,r,n]of u.matchAll(e)){const i=r||n;i&&a.add(i)}return a}function zy(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function ox(u){var e=new Error(u);return e.source="ulid",e}var wy="0123456789ABCDEFGHJKMNPQRSTVWXYZ",U4=wy.length,Pw=Math.pow(2,48)-1,gnu=10,vnu=16;function knu(u){var e=Math.floor(u()*U4);return e===U4&&(e=U4-1),wy.charAt(e)}function bnu(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>Pw)throw ox("cannot encode time greater than "+Pw);if(u<0)throw ox("time must be positive");if(Number.isInteger(u)===!1)throw ox("time must be an integer");for(var a=void 0,t="";e>0;e--)a=u%U4,t=wy.charAt(a)+t,u=(u-a)/U4;return t}function Cnu(u,e){for(var a="";u>0;u--)a=knu(e)+a;return a}function Fnu(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=arguments[1];e||(e=typeof window<"u"?window:null);var a=e&&(e.crypto||e.msCrypto);if(a)return function(){var r=new Uint8Array(1);return a.getRandomValues(r),r[0]/255};try{var t=require("crypto");return function(){return t.randomBytes(1).readUInt8()/255}}catch{}if(u){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw ox("secure crypto unusable, insecure Math.random not allowed")}function ynu(u){return u||(u=Fnu()),function(a){return isNaN(a)&&(a=Date.now()),bnu(a,gnu)+Cnu(vnu,u)}}var Ph=ynu(),Anu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},Ds="1.9.0",jw=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Bnu(u){var e=new Set([u]),a=new Set,t=u.match(jw);if(!t)return function(){return!1};var r={major:+t[1],minor:+t[2],patch:+t[3],prerelease:t[4]};if(r.prerelease!=null)return function(s){return s===u};function n(o){return a.add(o),!1}function i(o){return e.add(o),!0}return function(s){if(e.has(s))return!0;if(a.has(s))return!1;var l=s.match(jw);if(!l)return n(s);var c={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return c.prerelease!=null||r.major!==c.major?n(s):r.major===0?r.minor===c.minor&&r.patch<=c.patch?i(s):n(s):r.minor<=c.minor?i(s):n(s)}}var Snu=Bnu(Ds),znu=Ds.split(".")[0],zd=Symbol.for("opentelemetry.js.api."+znu),wd=Anu;function vE(u,e,a,t){var r;t===void 0&&(t=!1);var n=wd[zd]=(r=wd[zd])!==null&&r!==void 0?r:{version:Ds};if(!t&&n[u]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+u);return a.error(i.stack||i.message),!1}if(n.version!==Ds){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+Ds);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+Ds+"."),!0}function Ps(u){var e,a,t=(e=wd[zd])===null||e===void 0?void 0:e.version;if(!(!t||!Snu(t)))return(a=wd[zd])===null||a===void 0?void 0:a[u]}function kE(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+Ds+".");var a=wd[zd];a&&delete a[u]}var wnu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},Onu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},Pnu=(function(){function u(e){this._namespace=e.namespace||"DiagComponentLogger"}return u.prototype.debug=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return r4("verbose",this._namespace,e)},u})();function r4(u,e,a){var t=Ps("diag");if(t)return a.unshift(e),t[u].apply(t,Onu([],wnu(a),!1))}var Ct;(function(u){u[u.NONE=0]="NONE",u[u.ERROR=30]="ERROR",u[u.WARN=50]="WARN",u[u.INFO=60]="INFO",u[u.DEBUG=70]="DEBUG",u[u.VERBOSE=80]="VERBOSE",u[u.ALL=9999]="ALL"})(Ct||(Ct={}));function jnu(u,e){u<Ct.NONE?u=Ct.NONE:u>Ct.ALL&&(u=Ct.ALL),e=e||{};function a(t,r){var n=e[t];return typeof n=="function"&&u>=r?n.bind(e):function(){}}return{error:a("error",Ct.ERROR),warn:a("warn",Ct.WARN),info:a("info",Ct.INFO),debug:a("debug",Ct.DEBUG),verbose:a("verbose",Ct.VERBOSE)}}var Mnu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},Tnu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},Rnu="diag",xn=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=Ps("diag");if(o)return o[r].apply(o,Tnu([],Mnu(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:Ct.INFO}),r===a){var l=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return a.error((i=l.stack)!==null&&i!==void 0?i:l.message),!1}typeof n=="number"&&(n={logLevel:n});var c=Ps("diag"),d=jnu((o=n.logLevel)!==null&&o!==void 0?o:Ct.INFO,r);if(c&&!n.suppressOverrideMessage){var E=(s=new Error().stack)!==null&&s!==void 0?s:"<failed to generate stacktrace>";c.warn("Current logger will be overwritten from "+E),d.warn("Current logger will overwrite one already registered from "+E)}return vE("diag",d,a,!0)};a.setLogger=t,a.disable=function(){kE(Rnu,a)},a.createComponentLogger=function(r){return new Pnu(r)},a.verbose=e("verbose"),a.debug=e("debug"),a.info=e("info"),a.warn=e("warn"),a.error=e("error")}return u.instance=function(){return this._instance||(this._instance=new u),this._instance},u})(),Nnu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},$nu=function(u){var e=typeof Symbol=="function"&&Symbol.iterator,a=e&&u[e],t=0;if(a)return a.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&t>=u.length&&(u=void 0),{value:u&&u[t++],done:!u}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_nu=(function(){function u(e){this._entries=e?new Map(e):new Map}return u.prototype.getEntry=function(e){var a=this._entries.get(e);if(a)return Object.assign({},a)},u.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var a=Nnu(e,2),t=a[0],r=a[1];return[t,r]})},u.prototype.setEntry=function(e,a){var t=new u(this._entries);return t._entries.set(e,a),t},u.prototype.removeEntry=function(e){var a=new u(this._entries);return a._entries.delete(e),a},u.prototype.removeEntries=function(){for(var e,a,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=new u(this._entries);try{for(var i=$nu(t),o=i.next();!o.done;o=i.next()){var s=o.value;n._entries.delete(s)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(a=i.return)&&a.call(i)}finally{if(e)throw e.error}}return n},u.prototype.clear=function(){return new u},u})(),Lnu=Symbol("BaggageEntryMetadata"),Inu=xn.instance();function Knu(u){return u===void 0&&(u={}),new _nu(new Map(Object.entries(u)))}function Vnu(u){return typeof u!="string"&&(Inu.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:Lnu,toString:function(){return u}}}function Oy(u){return Symbol.for(u)}var Gnu=(function(){function u(e){var a=this;a._currentContext=e?new Map(e):new Map,a.getValue=function(t){return a._currentContext.get(t)},a.setValue=function(t,r){var n=new u(a._currentContext);return n._currentContext.set(t,r),n},a.deleteValue=function(t){var r=new u(a._currentContext);return r._currentContext.delete(t),r}}return u})(),Wl=new Gnu,Ws=(function(){var u=function(e,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},u(e,a)};return function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");u(e,a);function t(){this.constructor=e}e.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}})(),Hnu=(function(){function u(){}return u.prototype.createGauge=function(e,a){return uiu},u.prototype.createHistogram=function(e,a){return aiu},u.prototype.createCounter=function(e,a){return eiu},u.prototype.createUpDownCounter=function(e,a){return tiu},u.prototype.createObservableGauge=function(e,a){return niu},u.prototype.createObservableCounter=function(e,a){return riu},u.prototype.createObservableUpDownCounter=function(e,a){return iiu},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),$D=(function(){function u(){}return u})(),qnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})($D),Wnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})($D),Jnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})($D),Unu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})($D),Py=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),Znu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(Py),Qnu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(Py),Ynu=(function(u){Ws(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(Py),Xnu=new Hnu,eiu=new qnu,uiu=new Jnu,aiu=new Unu,tiu=new Wnu,riu=new Znu,niu=new Qnu,iiu=new Ynu,oiu={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},siu={set:function(u,e,a){u!=null&&(u[e]=a)}},liu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},ciu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},diu=(function(){function u(){}return u.prototype.active=function(){return Wl},u.prototype.with=function(e,a,t){for(var r=[],n=3;n<arguments.length;n++)r[n-3]=arguments[n];return a.call.apply(a,ciu([t],liu(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),Eiu=function(u,e){var a=typeof Symbol=="function"&&u[Symbol.iterator];if(!a)return u;var t=a.call(u),r,n=[],i;try{for(;(e===void 0||e-- >0)&&!(r=t.next()).done;)n.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(i)throw i.error}}return n},piu=function(u,e,a){if(a||arguments.length===2)for(var t=0,r=e.length,n;t<r;t++)(n||!(t in e))&&(n||(n=Array.prototype.slice.call(e,0,t)),n[t]=e[t]);return u.concat(n||Array.prototype.slice.call(e))},z6="context",miu=new diu,_D=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return vE(z6,e,xn.instance())},u.prototype.active=function(){return this._getContextManager().active()},u.prototype.with=function(e,a,t){for(var r,n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,piu([e,a,t],Eiu(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return Ps(z6)||miu},u.prototype.disable=function(){this._getContextManager().disable(),kE(z6,xn.instance())},u})(),mi;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(mi||(mi={}));var cH="0000000000000000",dH="00000000000000000000000000000000",EH={traceId:dH,spanId:cH,traceFlags:mi.NONE},Z4=(function(){function u(e){e===void 0&&(e=EH),this._spanContext=e}return u.prototype.spanContext=function(){return this._spanContext},u.prototype.setAttribute=function(e,a){return this},u.prototype.setAttributes=function(e){return this},u.prototype.addEvent=function(e,a){return this},u.prototype.addLink=function(e){return this},u.prototype.addLinks=function(e){return this},u.prototype.setStatus=function(e){return this},u.prototype.updateName=function(e){return this},u.prototype.end=function(e){},u.prototype.isRecording=function(){return!1},u.prototype.recordException=function(e,a){},u})(),jy=Oy("OpenTelemetry Context Key SPAN");function My(u){return u.getValue(jy)||void 0}function xiu(){return My(_D.getInstance().active())}function Ty(u,e){return u.setValue(jy,e)}function hiu(u){return u.deleteValue(jy)}function Diu(u,e){return Ty(u,new Z4(e))}function pH(u){var e;return(e=My(u))===null||e===void 0?void 0:e.spanContext()}var fiu=/^([0-9a-f]{32})$/i,giu=/^[0-9a-f]{16}$/i;function mH(u){return fiu.test(u)&&u!==dH}function viu(u){return giu.test(u)&&u!==cH}function LD(u){return mH(u.traceId)&&viu(u.spanId)}function kiu(u){return new Z4(u)}var w6=_D.getInstance(),xH=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=w6.active());var r=!!a?.root;if(r)return new Z4;var n=t&&pH(t);return biu(n)&&LD(n)?new Z4(n):new Z4},u.prototype.startActiveSpan=function(e,a,t,r){var n,i,o;if(!(arguments.length<2)){arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);var s=i??w6.active(),l=this.startSpan(e,n,s),c=Ty(s,l);return w6.with(c,o,void 0,l)}},u})();function biu(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var Ciu=new xH,Fiu=(function(){function u(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}return u.prototype.startSpan=function(e,a,t){return this._getTracer().startSpan(e,a,t)},u.prototype.startActiveSpan=function(e,a,t,r){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},u.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ciu},u})(),yiu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new xH},u})(),Aiu=new yiu,Mw=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){var r;return(r=this.getDelegateTracer(e,a,t))!==null&&r!==void 0?r:new Fiu(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Aiu},u.prototype.setDelegate=function(e){this._delegate=e},u.prototype.getDelegateTracer=function(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(e,a,t)},u})(),jh;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(jh||(jh={}));var cb;(function(u){u[u.INTERNAL=0]="INTERNAL",u[u.SERVER=1]="SERVER",u[u.CLIENT=2]="CLIENT",u[u.PRODUCER=3]="PRODUCER",u[u.CONSUMER=4]="CONSUMER"})(cb||(cb={}));var mr;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(mr||(mr={}));var ni=_D.getInstance(),_u=xn.instance(),Biu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return Xnu},u})(),Siu=new Biu,O6="metrics",ziu=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return vE(O6,e,xn.instance())},u.prototype.getMeterProvider=function(){return Ps(O6)||Siu},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){kE(O6,xn.instance())},u})(),hH=ziu.getInstance(),wiu=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),Ry=Oy("OpenTelemetry Baggage Key");function DH(u){return u.getValue(Ry)||void 0}function Oiu(){return DH(_D.getInstance().active())}function Piu(u,e){return u.setValue(Ry,e)}function jiu(u){return u.deleteValue(Ry)}var P6="propagation",Miu=new wiu,Tiu=(function(){function u(){this.createBaggage=Knu,this.getBaggage=DH,this.getActiveBaggage=Oiu,this.setBaggage=Piu,this.deleteBaggage=jiu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return vE(P6,e,xn.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=siu),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=oiu),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){kE(P6,xn.instance())},u.prototype._getGlobalPropagator=function(){return Ps(P6)||Miu},u})(),Q4=Tiu.getInstance(),j6="trace",Riu=(function(){function u(){this._proxyTracerProvider=new Mw,this.wrapSpanContext=kiu,this.isSpanContextValid=LD,this.deleteSpan=hiu,this.getSpan=My,this.getActiveSpan=xiu,this.getSpanContext=pH,this.setSpan=Ty,this.setSpanContext=Diu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=vE(j6,this._proxyTracerProvider,xn.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return Ps(j6)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){kE(j6,xn.instance()),this._proxyTracerProvider=new Mw},u})(),rt=Riu.getInstance();const fH=Oy("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Niu(u){return u.setValue(fH,!0)}function Ny(u){return u.getValue(fH)===!0}const $iu="=",db=";",Eb=",",M6="baggage",_iu=180,Liu=4096,Iiu=8192;function Kiu(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?Eb:""}${a}`;return t.length>Iiu?e:t},"")}function Viu(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=db+a.metadata.toString()),t})}function Giu(u){const e=u.split(db);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf($iu);if(t<=0)return;const r=decodeURIComponent(a.substring(0,t).trim()),n=decodeURIComponent(a.substring(t+1).trim());let i;return e.length>0&&(i=Vnu(e.join(db))),{key:r,value:n,metadata:i}}class Hiu{inject(e,a,t){const r=Q4.getBaggage(e);if(!r||Ny(e))return;const n=Viu(r).filter(o=>o.length<=Liu).slice(0,_iu),i=Kiu(n);i.length>0&&t.set(a,M6,i)}extract(e,a,t){const r=t.get(a,M6),n=Array.isArray(r)?r.join(Eb):r;if(!n)return e;const i={};return n.length===0||(n.split(Eb).forEach(s=>{const l=Giu(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:Q4.setBaggage(e,Q4.createBaggage(i))}fields(){return[M6]}}function sx(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!qiu(a)){_u.warn(`Invalid attribute key: ${a}`);continue}if(!gH(t)){_u.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function qiu(u){return typeof u=="string"&&u.length>0}function gH(u){return u==null?!0:Array.isArray(u)?Wiu(u):vH(u)}function Wiu(u){let e;for(const a of u)if(a!=null){if(!e){if(vH(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function vH(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function Jiu(){return u=>{_u.error(Uiu(u))}}function Uiu(u){return typeof u=="string"?u:JSON.stringify(Ziu(u))}function Ziu(u){const e={};let a=u;for(;a!==null;)Object.getOwnPropertyNames(a).forEach(t=>{if(e[t])return;const r=a[t];r&&(e[t]=String(r))}),a=Object.getPrototypeOf(a);return e}let Qiu=Jiu();function R1(u){try{Qiu(u)}catch{}}const E1=performance,Yiu="2.0.1",T6="exception.message",Xiu="exception.stacktrace",R6="exception.type",kH="service.name",eou="service.version",pb="telemetry.sdk.language",uou="webjs",mb="telemetry.sdk.name",xb="telemetry.sdk.version",aou="process.runtime.name",N6={[mb]:"opentelemetry",[aou]:"browser",[pb]:uou,[xb]:Yiu};const tou=9,rou=6,nou=Math.pow(10,rou),Mh=Math.pow(10,tou);function a1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*nou);return[a,t]}function bH(){let u=E1.timeOrigin;if(typeof u!="number"){const e=E1;u=e.timing&&e.timing.fetchStart}return u}function iou(u){const e=a1(bH()),a=a1(typeof u=="number"?u:E1.now());return FH(e,a)}function oou(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=Mh),[a,t]}function sou(u){return u[0]*Mh+u[1]}function CH(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function Tw(u){return CH(u)||typeof u=="number"||u instanceof Date}function FH(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=Mh&&(a[1]-=Mh,a[0]+=1),a}var qr;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(qr||(qr={}));class lou{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(a=>typeof a.fields=="function"?a.fields():[]).reduce((a,t)=>a.concat(t),[])))}inject(e,a,t){for(const r of this._propagators)try{r.inject(e,a,t)}catch(n){_u.warn(`Failed to inject with ${r.constructor.name}. Err: ${n.message}`)}}extract(e,a,t){return this._propagators.reduce((r,n)=>{try{return n.extract(r,a,t)}catch(i){_u.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const hb="[_0-9a-z-*/]",cou=`[a-z]${hb}{0,255}`,dou=`[a-z0-9]${hb}{0,240}@[a-z]${hb}{0,13}`,Eou=new RegExp(`^(?:${cou}|${dou})$`),pou=/^[ -~]{0,255}[!-~]$/,mou=/,|=/;function xou(u){return Eou.test(u)}function hou(u){return pou.test(u)&&!mou.test(u)}const Rw=32,Dou=512,Nw=",",$w="=";class $y{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,a){const t=this._clone();return t._internalState.has(e)&&t._internalState.delete(e),t._internalState.set(e,a),t}unset(e){const a=this._clone();return a._internalState.delete(e),a}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,a)=>(e.push(a+$w+this.get(a)),e),[]).join(Nw)}_parse(e){e.length>Dou||(this._internalState=e.split(Nw).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf($w);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);xou(i)&&hou(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Rw&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Rw))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new $y;return e._internalState=new Map(this._internalState),e}}const $6="traceparent",_6="tracestate",fou="00",gou="(?!ff)[\\da-f]{2}",vou="(?![0]{32})[\\da-f]{32}",kou="(?![0]{16})[\\da-f]{16}",bou="[\\da-f]{2}",Cou=new RegExp(`^\\s?(${gou})-(${vou})-(${kou})-(${bou})(-.*)?\\s?$`);function Fou(u){const e=Cou.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class you{inject(e,a,t){const r=rt.getSpanContext(e);if(!r||Ny(e)||!LD(r))return;const n=`${fou}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||mi.NONE).toString(16)}`;t.set(a,$6,n),r.traceState&&t.set(a,_6,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,$6);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=Fou(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,_6);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new $y(typeof s=="string"?s:void 0)}return rt.setSpanContext(e,i)}fields(){return[$6,_6]}}const Aou="[object Object]",Bou="[object Null]",Sou="[object Undefined]",zou=Function.prototype,yH=zou.toString,wou=yH.call(Object),Oou=Object.getPrototypeOf,AH=Object.prototype,BH=AH.hasOwnProperty,ls=Symbol?Symbol.toStringTag:void 0,SH=AH.toString;function _w(u){if(!Pou(u)||jou(u)!==Aou)return!1;const e=Oou(u);if(e===null)return!0;const a=BH.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&yH.call(a)===wou}function Pou(u){return u!=null&&typeof u=="object"}function jou(u){return u==null?u===void 0?Sou:Bou:ls&&ls in Object(u)?Mou(u):Tou(u)}function Mou(u){const e=BH.call(u,ls),a=u[ls];let t=!1;try{u[ls]=void 0,t=!0}catch{}const r=SH.call(u);return t&&(e?u[ls]=a:delete u[ls]),r}function Tou(u){return SH.call(u)}const Rou=20;function Nou(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=zH(e,u.shift(),0,a);return e}function L6(u){return Th(u)?u.slice():u}function zH(u,e,a=0,t){let r;if(!(a>Rou)){if(a++,lx(u)||lx(e)||wH(e))r=L6(e);else if(Th(u)){if(r=u.slice(),Th(e))for(let n=0,i=e.length;n<i;n++)r.push(L6(e[n]));else if(n4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=L6(e[s])}}}else if(n4(u))if(n4(e)){if(!$ou(u,e))return e;r=Object.assign({},u);const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i],l=e[s];if(lx(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(Lw(u,s,t)||Lw(e,s,t))delete r[s];else{if(n4(c)&&n4(d)){const E=t.get(c)||[],p=t.get(d)||[];E.push({obj:u,key:s}),p.push({obj:e,key:s}),t.set(c,E),t.set(d,p)}r[s]=zH(r[s],l,a,t)}}}}else r=e;return r}}function Lw(u,e,a){const t=a.get(u[e])||[];for(let r=0,n=t.length;r<n;r++){const i=t[r];if(i.key===e&&i.obj===u)return!0}return!1}function Th(u){return Array.isArray(u)}function wH(u){return typeof u=="function"}function n4(u){return!lx(u)&&!Th(u)&&!wH(u)&&typeof u=="object"}function lx(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function $ou(u,e){return!(!_w(u)||!_w(e))}class _ou{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,a)=>{this._resolve=e,this._reject=a})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class Lou{_callback;_that;_isCalled=!1;_deferred=new _ou;constructor(e,a){this._callback=e,this._that=a}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(a=>this._deferred.resolve(a),a=>this._deferred.reject(a))}catch(a){this._deferred.reject(a)}}return this._deferred.promise}}function Iou(){return"unknown_service"}const O4=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class Rh{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new Rh({});return a._rawAttributes=Iw(e),a._asyncAttributesPending=e.filter(([t,r])=>O4(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(O4(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=Iw(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[a,t]=this._rawAttributes[e];this._rawAttributes[e]=[a,O4(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_u.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(O4(t)){_u.debug(`Unsettled resource attribute ${a} skipped`);continue}t!=null&&(e[a]??=t)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return e==null?this:Rh.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function OH(u){return Rh.FromAttributeList(Object.entries(u))}function Kou(){return OH({[kH]:Iou(),[pb]:N6[pb],[mb]:N6[mb],[xb]:N6[xb]})}function Iw(u){return u.map(([e,a])=>O4(a)?[e,a.catch(t=>{_u.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const Vou="exception";class Gou{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:mr.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const a=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=E1.now(),this._performanceOffset=a-(this._performanceStartTime+bH()),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??a),this.resource=e.resource,this.instrumentationScope=e.scope,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,a){if(a==null||this._isSpanEnded())return this;if(e.length===0)return _u.warn(`Invalid attribute key: ${e}`),this;if(!gH(a))return _u.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:t}=this._spanLimits;return t!==void 0&&Object.keys(this.attributes).length>=t&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(a),this)}setAttributes(e){for(const[a,t]of Object.entries(e))this.setAttribute(a,t);return this}addEvent(e,a,t){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(r===0)return _u.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_u.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Tw(a)&&(Tw(t)||(t=a),a=void 0);const n=sx(a);return this.events.push({name:e,attributes:n,time:this._getTime(t),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status={...e},this.status.message!=null&&typeof e.message!="string"&&(_u.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){_u.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=oou(this.startTime,this.endTime),this._duration[0]<0&&(_u.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_u.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=E1.now())return iou(e+this._performanceOffset);if(typeof e=="number")return a1(e);if(e instanceof Date)return a1(e.getTime());if(CH(e))return e;if(this._startTimeProvided)return a1(Date.now());const a=E1.now()-this._performanceStartTime;return FH(this.startTime,a1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[T6]=e:e&&(e.code?t[R6]=e.code.toString():e.name&&(t[R6]=e.name),e.message&&(t[T6]=e.message),e.stack&&(t[Xiu]=e.stack)),t[R6]||t[T6]?this.addEvent(Vou,t,a):_u.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_u.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,a){return e.length<=a?e:e.substring(0,a)}_truncateToSize(e){const a=this._attributeValueLengthLimit;return a<=0?(_u.warn(`Attribute value limit must be positive, got ${a}`),e):typeof e=="string"?this._truncateToLimitUtil(e,a):Array.isArray(e)?e.map(t=>typeof t=="string"?this._truncateToLimitUtil(t,a):t):e}}var N1;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(N1||(N1={}));class Nh{shouldSample(){return{decision:N1.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class p1{shouldSample(){return{decision:N1.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class em{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(R1(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new p1),this._remoteParentSampled=e.remoteParentSampled??new p1,this._remoteParentNotSampled=e.remoteParentNotSampled??new Nh,this._localParentSampled=e.localParentSampled??new p1,this._localParentNotSampled=e.localParentNotSampled??new Nh}shouldSample(e,a,t,r,n,i){const o=rt.getSpanContext(e);return!o||!LD(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&mi.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&mi.SAMPLED?this._localParentSampled.shouldSample(e,a,t,r,n,i):this._localParentNotSampled.shouldSample(e,a,t,r,n,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Kw{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,a){return{decision:mH(a)&&this._accumulate(a)<this._upperBound?N1.RECORD_AND_SAMPLED:N1.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let a=0;for(let t=0;t<e.length/8;t++){const r=t*8,n=parseInt(e.slice(r,r+8),16);a=(a^n)>>>0}return a}}const Vw=1;function PH(){return{sampler:jH(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function jH(){const u="parentbased_always_on";switch(u){case"always_on":return new p1;case"always_off":return new Nh;case"parentbased_always_on":return new em({root:new p1});case"parentbased_always_off":return new em({root:new Nh});case"traceidratio":return new Kw(Gw());case"parentbased_traceidratio":return new em({root:new Kw(Gw())});default:return _u.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new em({root:new p1})}}function Gw(){return _u.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Vw}.`),Vw}const Hou=128,qou=1/0;function Wou(u){const e={sampler:jH()},a=PH(),t=Object.assign({},a,e,u);return t.generalLimits=Object.assign({},a.generalLimits,u.generalLimits||{}),t.spanLimits=Object.assign({},a.spanLimits,u.spanLimits||{}),t}function Jou(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??Hou,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??qou,Object.assign({},u,{spanLimits:e})}class Uou{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,a){this._exporter=e,this._maxExportBatchSize=typeof a?.maxExportBatchSize=="number"?a.maxExportBatchSize:512,this._maxQueueSize=typeof a?.maxQueueSize=="number"?a.maxQueueSize:2048,this._scheduledDelayMillis=typeof a?.scheduledDelayMillis=="number"?a.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof a?.exportTimeoutMillis=="number"?a.exportTimeoutMillis:3e4,this._shutdownOnce=new Lou(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_u.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,a){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&mi.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_u.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(_u.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,a)=>{const t=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,i=r;n<i;n++)t.push(this._flushOneBatch());Promise.all(t).then(()=>{e()}).catch(a)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,a)=>{const t=setTimeout(()=>{a(new Error("Timeout"))},this._exportTimeoutMillis);ni.with(Niu(ni.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const n=()=>this._exporter.export(r,o=>{clearTimeout(t),o.code===qr.SUCCESS?e():a(o.error??new Error("BatchSpanProcessor: span export failed"))});let i=null;for(let o=0,s=r.length;o<s;o++){const l=r[o];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(i??=[],i.push(l.resource.waitForAsyncAttributes()))}i===null?n():Promise.all(i).then(n,o=>{R1(o),a(o)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(a=>{this._isExporting=!1,R1(a)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer,void 0)}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}class Zou extends Uou{_visibilityChangeListener;_pageHideListener;constructor(e,a){super(e,a),this.onInit(a)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(a=>{R1(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{R1(a)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const Qou=8,You=16;class Xou{generateTraceId=Hw(You);generateSpanId=Hw(Qou)}const um=Array(32);function Hw(u){return function(){for(let a=0;a<u*2;a++)um[a]=Math.floor(Math.random()*16)+48,um[a]>=58&&(um[a]+=39);return String.fromCharCode.apply(null,um.slice(0,u*2))}}class esu{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=Wou(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new Xou,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=ni.active()){a.root&&(t=rt.deleteSpan(t));const r=rt.getSpan(t);if(Ny(t))return _u.debug("Instrumentation suppressed, returning Noop Span"),rt.wrapSpanContext(EH);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!rt.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??cb.INTERNAL,d=(a.links??[]).map(g=>({context:g.context,attributes:sx(g.attributes)})),E=sx(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const h=p.decision===jh.RECORD_AND_SAMPLED?mi.SAMPLED:mi.NONE,x={traceId:s,spanId:i,traceFlags:h,traceState:l};if(p.decision===jh.NOT_RECORD)return _u.debug("Recording is off, propagating context in a non-recording span"),rt.wrapSpanContext(x);const f=sx(Object.assign(E,p.attributes));return new Gou({resource:this._resource,scope:this.instrumentationScope,context:t,spanContext:x,name:e,kind:c,links:d,parentSpanContext:o,attributes:f,startTime:a.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,a,t,r){let n,i,o;if(arguments.length<2)return;arguments.length===2?o=a:arguments.length===3?(n=a,o=t):(n=a,i=t,o=r);const s=i??ni.active(),l=this.startSpan(e,n,s),c=rt.setSpan(s,l);return ni.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class usu{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const a of this._spanProcessors)e.push(a.forceFlush());return new Promise(a=>{Promise.all(e).then(()=>{a()}).catch(t=>{R1(t||new Error("MultiSpanProcessor: forceFlush failed")),a()})})}onStart(e,a){for(const t of this._spanProcessors)t.onStart(e,a)}onEnd(e){for(const a of this._spanProcessors)a.onEnd(e)}shutdown(){const e=[];for(const a of this._spanProcessors)e.push(a.shutdown());return new Promise((a,t)=>{Promise.all(e).then(()=>{a()},t)})}}var cs;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(cs||(cs={}));class asu{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=Nou({},PH(),Jou(e));this._resource=a.resource??Kou(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new usu(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new esu({name:e,version:a,schemaUrl:t?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,a=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(r=>{let n;const i=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${e} ms`)),n=cs.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==cs.timeout&&(n=cs.resolved,r(n))}).catch(o=>{clearTimeout(i),n=cs.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==cs.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class tsu{_enabled=!1;_currentContext=Wl;_bindFunction(e=Wl,a){const t=this,r=function(...n){return t.with(e,()=>a.apply(this,n))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:a.length}),r}active(){return this._currentContext}bind(e,a){return e===void 0&&(e=this.active()),typeof a=="function"?this._bindFunction(e,a):a}disable(){return this._currentContext=Wl,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=Wl,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||Wl;try{return a.call(t,...r)}finally{this._currentContext=n}}}function rsu(u){if(u!==null){if(u===void 0){const e=new tsu;e.enable(),ni.setGlobalContextManager(e);return}u.enable(),ni.setGlobalContextManager(u)}}function nsu(u){if(u!==null){if(u===void 0){Q4.setGlobalPropagator(new lou({propagators:[new you,new Hiu]}));return}Q4.setGlobalPropagator(u)}}class isu extends asu{constructor(e={}){super(e)}register(e={}){rt.setGlobalTracerProvider(this),nsu(e.propagator),rsu(e.contextManager)}}class osu{_delegate;constructor(e){this._delegate=e}export(e,a){this._delegate.export(e,a)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class qw extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function ssu(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function lsu(u){if(u!=null)return()=>u}function csu(u,e,a){return{timeoutMillis:ssu(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function dsu(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class Esu{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const a=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(a,a)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function psu(u){return new Esu(u.concurrencyLimit)}function msu(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function xsu(){return{handleResponse(u){u==null||!msu(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||_u.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class hsu{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,a,t,r,n){this._transport=e,this._serializer=a,this._responseHandler=t,this._promiseQueue=r,this._timeout=n,this._diagLogger=_u.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:qr.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:qr.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(t,this._timeout).then(r=>{if(r.status==="success"){if(r.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(r.data))}catch(n){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",n,r.data)}a({code:qr.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:qr.FAILED,error:r.error});return}else r.status==="retryable"?a({code:qr.FAILED,error:new qw("Export failed with retryable status")}):a({code:qr.FAILED,error:new qw("Export failed with unknown error")})},r=>a({code:qr.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Dsu(u,e){return new hsu(u.transport,u.serializer,xsu(),u.promiseHandler,e.timeout)}function MH(u,e,a){return Dsu({transport:a,serializer:e,promiseHandler:psu(u)},{timeout:u.timeoutMillis})}function Ww(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function TH(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Ww(u.charCodeAt(t)),n=Ww(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function RH(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function fsu(u){const e=Number(BigInt.asUintN(32,u)),a=Number(BigInt.asUintN(32,u>>BigInt(32)));return{low:e,high:a}}function gsu(u){const e=RH(u);return fsu(e)}function vsu(u){return RH(u).toString()}const ksu=typeof BigInt<"u"?vsu:sou;function Jw(u){return u}function bsu(u){if(u!==void 0)return TH(u)}const Csu={encodeHrTime:gsu,encodeSpanContext:TH,encodeOptionalSpanContext:bsu};function Fsu(u){return u===void 0?Csu:{encodeHrTime:ksu,encodeSpanContext:Jw,encodeOptionalSpanContext:Jw}}function ysu(u){return{attributes:ID(u.attributes),droppedAttributesCount:0}}function Asu(u){return{name:u.name,version:u.version}}function ID(u){return Object.keys(u).map(e=>NH(e,u[e]))}function NH(u,e){return{key:u,value:$H(e)}}function $H(u){const e=typeof u;return e==="string"?{stringValue:u}:e==="number"?Number.isInteger(u)?{intValue:u}:{doubleValue:u}:e==="boolean"?{boolValue:u}:u instanceof Uint8Array?{bytesValue:u}:Array.isArray(u)?{arrayValue:{values:u.map($H)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>NH(a,t))}}:{}}function Bsu(u,e){const a=u.spanContext(),t=u.status,r=u.parentSpanContext?.spanId?e.encodeSpanContext(u.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(a.traceId),spanId:e.encodeSpanContext(a.spanId),parentSpanId:r,traceState:a.traceState?.serialize(),name:u.name,kind:u.kind==null?0:u.kind+1,startTimeUnixNano:e.encodeHrTime(u.startTime),endTimeUnixNano:e.encodeHrTime(u.endTime),attributes:ID(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>zsu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>Ssu(n,e)),droppedLinksCount:u.droppedLinksCount}}function Ssu(u,e){return{attributes:u.attributes?ID(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function zsu(u,e){return{attributes:u.attributes?ID(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function wsu(u,e){const a=Fsu(e);return{resourceSpans:Psu(u,a)}}function Osu(u){const e=new Map;for(const a of u){let t=e.get(a.resource);t||(t=new Map,e.set(a.resource,t));const r=`${a.instrumentationScope.name}@${a.instrumentationScope.version||""}:${a.instrumentationScope.schemaUrl||""}`;let n=t.get(r);n||(n=[],t.set(r,n)),n.push(a)}return e}function Psu(u,e){const a=Osu(u),t=[],r=a.entries();let n=r.next();for(;!n.done;){const[i,o]=n.value,s=[],l=o.values();let c=l.next();for(;!c.done;){const E=c.value;if(E.length>0){const p=E.map(h=>Bsu(h,e));s.push({scope:Asu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:ysu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const jsu={serializeRequest:u=>{const e=wsu(u,{});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:u=>{if(u.length===0)return{};const e=new TextDecoder;return JSON.parse(e.decode(u))}},Msu=5,Tsu=1e3,Rsu=5e3,Nsu=1.5,Uw=.2;function $su(){return Math.random()*(2*Uw)-Uw}class _su{_transport;constructor(e){this._transport=e}retry(e,a,t){return new Promise((r,n)=>{setTimeout(()=>{this._transport.send(e,a).then(r,n)},t)})}async send(e,a){const t=Date.now()+a;let r=await this._transport.send(e,a),n=Msu,i=Tsu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,Rsu)+$su(),0);i=i*Nsu;const s=r.retryInMillis??o,l=t-Date.now();if(s>l)return r;r=await this.retry(e,l,s)}return r}shutdown(){return this._transport.shutdown()}}function _H(u){return new _su(u.transport)}function Lsu(u){return[429,502,503,504].includes(u)}function Isu(u){if(u==null)return;const e=Number.parseInt(u,10);if(Number.isInteger(e))return e>0?e*1e3:-1;const a=new Date(u).getTime()-Date.now();return a>=0?a:0}class Ksu{_parameters;constructor(e){this._parameters=e}send(e,a){return new Promise(t=>{const r=new XMLHttpRequest;r.timeout=a,r.open("POST",this._parameters.url);const n=this._parameters.headers();Object.entries(n).forEach(([i,o])=>{r.setRequestHeader(i,o)}),r.ontimeout=i=>{t({status:"failure",error:new Error("XHR request timed out")})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_u.debug("XHR success"),t({status:"success"})):r.status&&Lsu(r.status)?t({status:"retryable",retryInMillis:Isu(r.getResponseHeader("Retry-After"))}):r.status!==0&&t({status:"failure",error:new Error("XHR request failed with non-retryable status")})},r.onabort=()=>{t({status:"failure",error:new Error("XHR request aborted")})},r.onerror=()=>{t({status:"failure",error:new Error("XHR request errored")})},r.send(e)})}shutdown(){}}function Vsu(u){return new Ksu(u)}class Gsu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_u.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Hsu(u){return new Gsu(u)}function qsu(u,e){return MH(u,e,_H({transport:Vsu(u)}))}function Wsu(u,e){return MH(u,e,_H({transport:Hsu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function Jsu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):_u.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function Usu(u,e,a){const t={...a()},r={};return()=>(e!=null&&Object.assign(r,e()),u!=null&&Object.assign(r,u()),Object.assign(r,t))}function Zsu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function Qsu(u,e,a){return{...csu(u,e,a),headers:Usu(Jsu(u.headers),e.headers,a.headers),url:Zsu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function Ysu(u,e){return{...dsu(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function Xsu(u,e,a){return Qsu({url:u.url,timeoutMillis:u.timeoutMillis,headers:lsu(u.headers),concurrencyLimit:u.concurrencyLimit},{},Ysu(a,e))}function elu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=Xsu(u,a,t);return r?qsu(n,e):Wsu(n,e)}class ulu extends osu{constructor(e={}){super(elu(e,jsu,"v1/traces",{"Content-Type":"application/json"}))}}class LH{emit(e){}}const alu=new LH;class tlu{getLogger(e,a,t){return new LH}}const IH=new tlu;class rlu{constructor(e,a,t,r){this._provider=e,this.name=a,this.version=t,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):alu}}class Zw{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new rlu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:IH}setDelegate(e){this._delegate=e}getDelegateLogger(e,a,t){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getLogger(e,a,t)}}const nlu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},am=Symbol.for("io.opentelemetry.js.api.logs"),i4=nlu;function ilu(u,e,a){return t=>t===u?e:a}const Qw=1;class _y{constructor(){this._proxyLoggerProvider=new Zw}static getInstance(){return this._instance||(this._instance=new _y),this._instance}setGlobalLoggerProvider(e){return i4[am]?this.getLoggerProvider():(i4[am]=ilu(Qw,e,IH),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=i4[am])===null||e===void 0?void 0:e.call(i4,Qw))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete i4[am],this._proxyLoggerProvider=new Zw}}const KH=_y.getInstance();function olu(u,e,a,t){for(let r=0,n=u.length;r<n;r++){const i=u[r];e&&i.setTracerProvider(e),a&&i.setMeterProvider(a),t&&i.setLoggerProvider&&i.setLoggerProvider(t),i.getConfig().enabled||i.enable()}}function slu(u){u.forEach(e=>e.disable())}function llu(u){const e=u.tracerProvider||rt.getTracerProvider(),a=u.meterProvider||hH.getMeterProvider(),t=u.loggerProvider||KH.getLoggerProvider(),r=u.instrumentations?.flat()??[];return olu(r,e,a,t),()=>{slu(r)}}let zt=console.error.bind(console);function o4(u,e,a){const t=!!u[e]&&Object.prototype.propertyIsEnumerable.call(u,e);Object.defineProperty(u,e,{configurable:!0,enumerable:t,writable:!0,value:a})}const VH=(u,e,a)=>{if(!u||!u[e]){zt("no original function "+String(e)+" to wrap");return}if(!a){zt("no wrapper function"),zt(new Error().stack);return}const t=u[e];if(typeof t!="function"||typeof a!="function"){zt("original object and wrapper must be functions");return}const r=a(t,e);return o4(r,"__original",t),o4(r,"__unwrap",()=>{u[e]===r&&o4(u,e,t)}),o4(r,"__wrapped",!0),o4(u,e,r),r},clu=(u,e,a)=>{if(u)Array.isArray(u)||(u=[u]);else{zt("must provide one or more modules to patch"),zt(new Error().stack);return}if(!(e&&Array.isArray(e))){zt("must provide one or more functions to wrap on modules");return}u.forEach(t=>{e.forEach(r=>{VH(t,r,a)})})},GH=(u,e)=>{if(!u||!u[e]){zt("no function to unwrap."),zt(new Error().stack);return}const a=u[e];if(!a.__unwrap)zt("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{a.__unwrap();return}},dlu=(u,e)=>{if(u)Array.isArray(u)||(u=[u]);else{zt("must provide one or more modules to patch"),zt(new Error().stack);return}if(!(e&&Array.isArray(e))){zt("must provide one or more functions to unwrap on modules");return}u.forEach(a=>{e.forEach(t=>{GH(a,t)})})};class Elu{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,a,t){this.instrumentationName=e,this.instrumentationVersion=a,this.setConfig(t),this._diag=_u.createComponentLogger({namespace:e}),this._tracer=rt.getTracer(e,a),this._meter=hH.getMeter(e,a),this._logger=KH.getLogger(e,a),this._updateMetricInstruments()}_wrap=VH;_unwrap=GH;_massWrap=clu;_massUnwrap=dlu;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,a,t,r){if(e)try{e(t,r)}catch(n){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:a},n)}}}class plu extends Elu{constructor(e,a,t){super(e,a,t),this._config.enabled&&this.enable()}}class mlu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(mr.ERROR,e.message),this.span.recordException(e),this.span.end())}setAttribute(e,a){this.span&&this.span.setAttribute(e,a)}end(){this.span&&(this.span.setStatus(mr.OK),this.span.end())}}class xlu{config=null;tracer=null;tracerProvider=null;initialized=!1;initTracer(e){throw new Error("initTracer must be implemented by the environment-specific client")}init(e){this.config=e,this.initTracer(e)}send(e){try{if(!this.tracer||!this.config)return;const a=e.time?new Date(e.time):new Date;this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,a),startTime:a}).end(a)}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}processAttributes(e,a){const r={"cloudevents.event_id":Ph(),"cloudevents.event_type":e.type,"cloudevents.event_source":e.source,"cloudevents.event_spec_version":e.specversion,"cloudevents.event_data_content_type":e.datacontenttype||"application/json; charset=utf-8","cloudevents.event_time":a.toISOString(),"cloudevents.event_subject":e.subject??"","cloudevents.page.uri":location.href,"cloudevents.event_version":this.config?.version,"cloudevents.event_origin":this.config?.serviceName,"cloudevents.event_source_details.id":e.sourceDetails?.id??"anonymous","cloudevents.event_source_details.object":e.sourceDetails?.object??"anonymous","cloudevents.event_source_details.uri":e.sourceDetails?.uri};if(e.data&&typeof e.data=="object"&&Object.entries(e.data).forEach(([n,i])=>{const o=n.replace(/([A-Z])/g,"_$1").toLowerCase();i!==void 0&&(typeof i=="object"&&i!==null&&!Array.isArray(i)?Object.entries(i).forEach(([s,l])=>{l!==void 0&&(r[`cloudevents.event_data.${o}.${s}`]=l)}):r[`cloudevents.event_data.${o}`]=i)}),"subjects"in e&&Array.isArray(e.subjects)){const n=e.subjects.reduce((i,o)=>{if(!o||typeof o!="object")return i;const s=o.object;if(!s||typeof s!="string")return i;const l=i.notUpdated.find(({object:c})=>c===s);return l?(i.updated=[l,o],i.notUpdated=i.notUpdated.filter(({object:c})=>c!==s)):i.updated.some(({object:c})=>c===s)||i.notUpdated.push(o),i},{updated:[],notUpdated:[]});n.updated.forEach((i,o)=>{const s=o===0?"after.":"before.",l=`${i.object}.`;Object.entries(i).forEach(([c,d])=>{d!==void 0&&(r[`cloudevents.subjects.${s}${l}${c}`]=d)})}),n.notUpdated.forEach(i=>{const o=`${i.object}.`;Object.entries(i).forEach(([s,l])=>{l!==void 0&&(r[`cloudevents.subjects.${o}${s}`]=l)})})}return Object.entries(e).forEach(([n,i])=>{["id","source","type","specversion","time","datacontenttype","data","subject","sourceDetails","analyticsMetadata","context"].includes(n)||i!==void 0&&(i instanceof Object?Object.entries(i).forEach(([o,s])=>{s!==void 0&&(r[`cloudevents.${n}.${o}`]=s)}):r[`cloudevents.${n}`]=i)}),r}startSpan(e,a){try{if(!this.tracer)return;let t;const r=e.time?new Date(e.time):new Date,n=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,r),root:!a},a);return a||(t=rt.setSpan(ni.active(),n)),{end:()=>n.end(),setAttribute:(i,o)=>{n.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>n.setStatus({code:i,message:o}),parentCtx:t}}catch(t){this.config?.isProd||console.error("Event reporting failed:",t)}}startStepSpan(e){try{if(!this.tracer)return;const a=ni.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=rt.setSpan(a,r);return{end:()=>r.end(),setAttribute:(i,o)=>{r.setAttribute(`cloudevents.event_data.${this.getKeySnakeValue(i)}`,o)},setStatus:(i,o)=>r.setStatus({code:i,message:o}),recordException:i=>r.recordException(i),context:n}}catch(a){this.config?.isProd||console.error("Event reporting failed:",a)}}traceStep(e){const a=this.startStepSpan(e);if(a)return new mlu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class hlu extends xlu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${Ph()}`,t=OH({[kH]:e.serviceName,[eou]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new isu({resource:t,spanProcessors:[new Zou(new ulu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),llu({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class ei extends plu{sendErrorEvent;originalConsoleError;constructor(e,a){super("errors","1.0",e||{}),this.sendErrorEvent=a}static toErrorEvent(e,a){return{type:"error",payload:{handler:a,errorType:ei.getErrorType(e),message:ei.getErrorMessage(e),stack:ei.getErrorStack(e)}}}enable(){window.addEventListener("error",this.onError),window.addEventListener("unhandledrejection",this.onUnhandledRejection),this.wrapConsoleError()}disable(){window.removeEventListener("error",this.onError),window.removeEventListener("unhandledrejection",this.onUnhandledRejection),this.unwrapConsoleError()}init(){}static getErrorMessage(e){return e?(typeof e=="object"&&"message"in e?String(e.message):String(e)).trim():void 0}static getErrorStack(e){if(!e||typeof e!="object"||!("stack"in e)||!e.stack)return;const a=String(e.stack);return a.length>4096?a.substring(0,4096):a}static getErrorType(e){return!e||typeof e!="object"?typeof e:"name"in e?String(e.name):"constructor"in e&&"name"in e.constructor?String(e.constructor.name):"Error"}static combineConsoleErrorArgs(e){const a=e.findIndex(r=>r instanceof Error),t=e.filter((r,n)=>n!==a).map(r=>String(r)).join(" ");if(a===-1)return t;{const r=e[a];return t&&(r.message=`${r.message} ${t}`),r}}onError=e=>{this.sendError(e.error,"window.onerror")};onUnhandledRejection=e=>{this.sendError(e.reason,"window.onunhandledrejection")};wrapConsoleError(){this.originalConsoleError=console.error,console.error=(...e)=>{try{const a=ei.combineConsoleErrorArgs(e);this.sendError(a,"console.error")}catch(a){process.env.NODE_ENV!=="production"&&this.originalConsoleError?.call(console,"Error reporting failed:",a)}this.originalConsoleError?.apply(console,e)}}unwrapConsoleError(){this.originalConsoleError&&(console.error=this.originalConsoleError,this.originalConsoleError=void 0)}sendError(e,a){this.sendErrorEvent(ei.toErrorEvent(e,a))}}class Dlu{config=null;initialized=!1;useCloudEventData;otelClient;tracer;constructor(){this.useCloudEventData=()=>({organization:{id:"",slug:""},project:{id:"",slug:""},productType:"",sourceDetails:{user:"Anonymous",object:"user",uri:""},request:{source:""}}),this.otelClient=new hlu,this.tracer={traceStep:(e,a)=>{const t=this.constructCloudEvent(e,a);return this.otelClient.traceStep(t)}}}updateCloudEventData=e=>{this.config?.disabled||(this.useCloudEventData=e)};send(e,a){try{if(!this.config?.otel.isProd)return;const t=this.constructCloudEvent(e,a);this.sendToOtelService(t)}catch(t){this.config?.otel.isProd||console.error("Event reporting failed:",t)}}init(e){e.disabled||this.initialized||(this.config=e,this.initialized=!0,this.otelClient.init({serviceVersion:e.otel.serviceVersion,version:e.otel.version,isProd:e.otel.isProd,collectorUrl:e.otel.collectorUrl,collectorTraceUrl:e.otel.collectorTraceUrl,serviceName:e.otel.serviceName,tracerName:e.otel.tracerName,instrumentations:[...e.otel.enableErrorInstrumentation===!0?[new ei(void 0,a=>{this.sendErrorMessage(a.payload)})]:[],...e.otel.instrumentations||[]]}))}startSpan(e,a,t){if(this.config?.disabled)return;const r=this.constructCloudEvent(e,a);return this.otelClient.startSpan(r,t)}constructCloudEvent(e,a){const t=this.useCloudEventData();return{id:`evt_${Ph()}`,type:e,source:t.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:a,origin:"ui",sourceDetails:{id:t.sourceDetails.user||`usr_${Ph()}`,object:t.sourceDetails.object||"user",uri:t.sourceDetails.uri||""},organization:t.organization,project:t.project,productType:t.productType}}sendToOtelService(e){this.config?.otel.isProd||console.log("CloudEvent to be sent to OTEL service:",e),this.otelClient.send(e)}forceFlush(){return this.config?.disabled?Promise.resolve():this.otelClient.forceFlush()}shutdown(){return this.config?.disabled?Promise.resolve():this.otelClient.shutdown()}sendError(e,a){this.config?.disabled||this.send(ei.toErrorEvent(e,a).type,ei.toErrorEvent(e,a).payload)}sendTabChangeMessage(e){this.send("tab.change",e)}sendButtonClickMessage(e){this.send("button.click",e)}sendChangeMessage(e){this.send("change",e)}sendContentCopyMessage(e){this.send("content.copy",e)}sendUrlClickMessage(e){this.send("url.click",e)}sendRequestSendMessage(e){this.send("request.send",e)}sendTokenGenerateMessage(e){this.send("token.generate",e)}sendAppLifecycleMessage(e){this.send("app.lifecycle",e)}sendEnvironmentManagementMessage(e){this.send("environment.management",e)}sendServerManagementMessage(e){this.send("server.management",e)}sendInputManagementMessage(e){this.send("input.management",e)}sendNodeManagementMessage(e){this.send("node.management",e)}sendHistoryManagementMessage(e){this.send("history.management",e)}sendCredentialManagementMessage(e){this.send("credential.management",e)}sendPanelToggleMessage(e){this.send("panel.toggle",e)}sendWorkflowRunClickMessage(e){this.send("workflow.run.click",e)}sendWorkflowRunResultMessage(e){this.send("workflow.run.result",e)}sendStorageReadMessage(){this.send("storage.read")}sendStorageLoadUserStateMessage(){this.send("storage.loadUserState")}sendStorageDetectFilesMessage(){this.send("storage.detectFiles")}sendStorageLoadApisMessage(){this.send("storage.loadApis")}sendStorageParseApisMessage(){this.send("storage.parseApis")}sendStorageParseCollectionsMessage(){this.send("storage.parseCollections")}sendErrorMessage(e){this.send("error",e)}}const KD=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],flu="https://cors.redocly.com/";function glu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function Yw(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Xw(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Yw(Object(a),!0).forEach(function(t){glu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):Yw(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function s0(u){return"Minified Redux error #"+u+"; visit https://redux.js.org/Errors?code="+u+" for the full message or use the non-minified dev environment for full errors. "}var eO=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),I6=function(){return Math.random().toString(36).substring(7).split("").join(".")},Eo={INIT:"@@redux/INIT"+I6(),REPLACE:"@@redux/REPLACE"+I6(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+I6()}};function HH(u){if(typeof u!="object"||u===null)return!1;for(var e=u;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(u)===e}function vlu(u){if(u===void 0)return"undefined";if(u===null)return"null";var e=typeof u;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(u))return"array";if(Clu(u))return"date";if(blu(u))return"error";var a=klu(u);switch(a){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return a}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function klu(u){return typeof u.constructor=="function"?u.constructor.name:null}function blu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function Clu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function Ji(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=vlu(u)),e}function VD(u,e,a){var t;if(typeof e=="function"&&typeof a=="function"||typeof a=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?s0(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof a>"u"&&(a=e,e=void 0),typeof a<"u"){if(typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?s0(1):"Expected the enhancer to be a function. Instead, received: '"+Ji(a)+"'");return a(VD)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?s0(2):"Expected the root reducer to be a function. Instead, received: '"+Ji(u)+"'");var r=u,n=e,i=[],o=i,s=!1;function l(){o===i&&(o=i.slice())}function c(){if(s)throw new Error(process.env.NODE_ENV==="production"?s0(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return n}function d(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?s0(4):"Expected the listener to be a function. Instead, received: '"+Ji(x)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?s0(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var f=!0;return l(),o.push(x),function(){if(f){if(s)throw new Error(process.env.NODE_ENV==="production"?s0(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");f=!1,l();var g=o.indexOf(x);o.splice(g,1),i=null}}}function E(x){if(!HH(x))throw new Error(process.env.NODE_ENV==="production"?s0(7):"Actions must be plain objects. Instead, the actual type was: '"+Ji(x)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof x.type>"u")throw new Error(process.env.NODE_ENV==="production"?s0(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(s)throw new Error(process.env.NODE_ENV==="production"?s0(9):"Reducers may not dispatch actions.");try{s=!0,n=r(n,x)}finally{s=!1}for(var f=i=o,D=0;D<f.length;D++){var g=f[D];g()}return x}function p(x){if(typeof x!="function")throw new Error(process.env.NODE_ENV==="production"?s0(10):"Expected the nextReducer to be a function. Instead, received: '"+Ji(x));r=x,E({type:Eo.REPLACE})}function h(){var x,f=d;return x={subscribe:function(g){if(typeof g!="object"||g===null)throw new Error(process.env.NODE_ENV==="production"?s0(11):"Expected the observer to be an object. Instead, received: '"+Ji(g)+"'");function k(){g.next&&g.next(c())}k();var C=f(k);return{unsubscribe:C}}},x[eO]=function(){return this},x}return E({type:Eo.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[eO]=h,t}var Flu=VD;function Db(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function ylu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===Eo.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(r.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!HH(u))return"The "+n+' has unexpected type of "'+Ji(u)+'". Expected argument to be an object with the following '+('keys: "'+r.join('", "')+'"');var i=Object.keys(u).filter(function(o){return!e.hasOwnProperty(o)&&!t[o]});if(i.forEach(function(o){t[o]=!0}),!(a&&a.type===Eo.REPLACE)&&i.length>0)return"Unexpected "+(i.length>1?"keys":"key")+" "+('"'+i.join('", "')+'" found in '+n+". ")+"Expected to find one of the known reducer keys instead: "+('"'+r.join('", "')+'". Unexpected keys will be ignored.')}function Alu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:Eo.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?s0(12):'The slice reducer for key "'+e+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof a(void 0,{type:Eo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?s0(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Eo.INIT+`' or other actions in "redux/*" `)+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function Blu(u){for(var e=Object.keys(u),a={},t=0;t<e.length;t++){var r=e[t];process.env.NODE_ENV!=="production"&&typeof u[r]>"u"&&Db('No reducer provided for key "'+r+'"'),typeof u[r]=="function"&&(a[r]=u[r])}var n=Object.keys(a),i;process.env.NODE_ENV!=="production"&&(i={});var o;try{Alu(a)}catch(s){o=s}return function(l,c){if(l===void 0&&(l={}),o)throw o;if(process.env.NODE_ENV!=="production"){var d=ylu(l,a,c,i);d&&Db(d)}for(var E=!1,p={},h=0;h<n.length;h++){var x=n[h],f=a[x],D=l[x],g=f(D,c);if(typeof g>"u"){var k=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?s0(14):"When called with an action of type "+(k?'"'+String(k)+'"':"(unknown type)")+', the slice reducer for key "'+x+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.')}p[x]=g,E=E||g!==D}return E=E||n.length!==Object.keys(l).length,E?p:l}}function uO(u,e){return function(){return e(u.apply(this,arguments))}}function Slu(u,e){if(typeof u=="function")return uO(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?s0(16):"bindActionCreators expected an object or a function, but instead received: '"+Ji(u)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var a={};for(var t in u){var r=u[t];typeof r=="function"&&(a[t]=uO(r,e))}return a}function qH(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,arguments))}})}function zlu(){for(var u=arguments.length,e=new Array(u),a=0;a<u;a++)e[a]=arguments[a];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw new Error(process.env.NODE_ENV==="production"?s0(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},o=e.map(function(s){return s(i)});return n=qH.apply(void 0,o)(r.dispatch),Xw(Xw({},r),{},{dispatch:n})}}}function aO(){}process.env.NODE_ENV!=="production"&&typeof aO.name=="string"&&aO.name!=="isCrushed"&&Db('You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.');var wlu=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Eo,applyMiddleware:zlu,bindActionCreators:Slu,combineReducers:Blu,compose:qH,createStore:VD,legacy_createStore:Flu});function Olu(u){var e=u.default;if(typeof e=="function"){var a=function(){return e.apply(this,arguments)};a.prototype=e.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(u).forEach(function(t){var r=Object.getOwnPropertyDescriptor(u,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return u[t]}})}),a}var Plu=Olu(wlu);Plu.compose;var jlu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function Mlu(u,e,a){var t=!1,r=!1,n=VD(function(o,s){if(!r){var l=function(f){return Array.isArray(f)&&f.findIndex(function(D){return typeof D!="string"&&typeof D!="number"})===-1};if(s.type.startsWith("SET")){var c=function(f){try{t=!0,"value"in s?f.set(s.value):f.set(lu)}finally{t=!1}};if(s.path){if(l(s.path)){s.path.length===0&&c(u);for(var d=u,E=!0,p=0,h=s.path;p<h.length;p++){var x=h[p];d[x]?d=d[x]:E=!1}E&&c(d)}}else c(u)}else s.type==="BREAKPOINT"&&a()}return u.promised||u.error?lu:u.get({noproxy:!0})},jlu({name:"".concat(window.location.hostname,": ").concat(e),trace:!0,traceLimit:16,autoPause:!0,shouldHotReload:!1,features:{persist:!0,pause:!0,lock:!1,export:"custom",import:"custom",jump:!1,skip:!1,reorder:!1,dispatch:!0,test:!1}})),i=function(o,s){if(t)s&&s();else try{r=!0,n.dispatch(o)}finally{r=!1}};return i}function Tlu(u){return function(){var e,a,t=!1;return{onInit:function(r,n){if(!(typeof window>"u"||!("__REDUX_DEVTOOLS_EXTENSION__"in window))){if(u?.key===void 0){if(n.identifier===void 0)throw Error("State is missing Identifiable extension or Devtools key option");e=n.identifier(r)}else e=u.key;a=Mlu(r,e,function(){t=!t}),r.promise||a?.({type:"CREATE",state:r.get({noproxy:!0,stealth:!0})})}},onSet:function(r,n){if(a?.({type:"SET [".concat(r.path.join("/"),"]"),state:r.get({noproxy:!0,stealth:!0}),descriptor:n}),t)debugger},onDestroy:function(){a?.({type:"DESTROY"})}}}}var Ru=(u=>(u.Normal="Normal",u.Edit="Edit",u.Draft="Draft",u))(Ru||{});const bE="default",WH=[{name:bE,inputs:[],servers:[],state:Ru.Normal}],JH={activeTabIdx:0,tabs:[]};var Gr=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(Gr||{});function ii(u){const e=new WeakMap;function a(t){if(typeof t!="object"||t===null)return t;if(e.has(t))return e.get(t);const r=Array.isArray(t)?[]:{};e.set(t,r);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=a(t[n]));return r}return a(u)}function fb(u,e){if(u===e)return!0;if(u&&e&&typeof u=="object"&&typeof e=="object"){if(Array.isArray(u)&&Array.isArray(e)){if(u.length!==e.length)return!1;for(let r=0;r<u.length;r++)if(!fb(u[r],e[r]))return!1;return!0}const a=Object.keys(u),t=Object.keys(e);if(a.length!==t.length)return!1;for(let r=0;r<a.length;r++){const n=a[r];if(!Object.prototype.hasOwnProperty.call(e,n)||!fb(u[n],e[n]))return!1}return!0}return u!==u&&e!==e}function tO(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}const ln={FS:"fs",WEB:"web"};function pc(){return!!window?.__TAURI__}class da{static utils=null;static async getUtils(){return da.utils||(da.utils=pc()?await Promise.resolve().then(()=>require("./replay-tauri-path-rkVLu2Jl.js")):await Promise.resolve().then(()=>l0e)),da.utils}static async dirname(e){return(await da.getUtils()).dirname(e)}static async join(...e){return(await da.getUtils()).join(...e)}static async resolve(e){return(await da.getUtils()).resolve(e)}static async isAbsolute(e){return(await da.getUtils()).isAbsolute(e)}static async relative(e,a){return(await da.getUtils()).relative(e,a)}static async extname(e){return(await da.getUtils()).extname(e)}}async function R0(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}var $h;(function(u){u[u.Audio=1]="Audio",u[u.Cache=2]="Cache",u[u.Config=3]="Config",u[u.Data=4]="Data",u[u.LocalData=5]="LocalData",u[u.Document=6]="Document",u[u.Download=7]="Download",u[u.Picture=8]="Picture",u[u.Public=9]="Public",u[u.Video=10]="Video",u[u.Resource=11]="Resource",u[u.Temp=12]="Temp",u[u.AppConfig=13]="AppConfig",u[u.AppData=14]="AppData",u[u.AppLocalData=15]="AppLocalData",u[u.AppCache=16]="AppCache",u[u.AppLog=17]="AppLog",u[u.Desktop=18]="Desktop",u[u.Executable=19]="Executable",u[u.Font=20]="Font",u[u.Home=21]="Home",u[u.Runtime=22]="Runtime",u[u.Template=23]="Template"})($h||($h={}));async function Rlu(){return R0("plugin:path|resolve_directory",{directory:$h.AppData})}async function Nlu(){return R0("plugin:path|resolve_directory",{directory:$h.Desktop})}function UH(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function $lu(...u){return R0("plugin:path|resolve",{paths:u})}async function Y4(...u){return R0("plugin:path|join",{paths:u})}async function _lu(u){return R0("plugin:path|dirname",{path:u})}async function Llu(u){return R0("plugin:path|extname",{path:u})}async function ZH(u,e){return R0("plugin:path|basename",{path:u,ext:e})}async function Ilu(u){return R0("plugin:path|is_absolute",{path:u})}var rO;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(rO||(rO={}));async function nO(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await R0("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function QH(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await R0("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function Klu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await R0("plugin:fs|read_file",{path:u instanceof URL?u.toString():u,options:e});return a instanceof ArrayBuffer?new Uint8Array(a):Uint8Array.from(a)}async function Ly(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await R0("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function Vlu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await R0("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function Glu(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await R0("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function YH(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await R0("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}const oi=window.__TAURI__?.http.fetch??globalThis.fetch;function cx(u){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(u)}function _h(u){return u.endsWith("/")?u.substring(0,u.length-1):u}function Hlu(u){return u.startsWith("/")?u.substring(1):u}function qlu(u){try{const e=new URL(u);return e.search="",e.hash="",e.toString()}catch{return u}}class XH extends SD{constructor(){super()}resolveExternalRef(e,a){return cx(a)?a:e&&cx(e)?new URL(a,e).href:e?ws.resolve(ws.dirname(e),a):a}async loadExternalRef(e){if(cx(e)){const{body:a,mimeType:t}=await n_(e,{...this.config.http,customFetch:oi});return new O1(e,a,t)}else{if(!await YH(e))throw new Error(`File not found at ${e}.`);try{throw await QH(e),new Error(`Expected a file but received a folder at ${e}.`)}catch(r){if(r instanceof Error&&r.message.includes("Expected a file but received a folder"))throw r}const t=await Ly(e);return new O1(e,t.replace(/\r\n/g,`
469
469
  `))}}}async function iO(u,e){const a=new gD({});a.getRulesForSpecVersion=()=>[];const t=await da.dirname(u),r={config:a,base:t,externalRefResolver:new XH,dereference:!0};e?r.doc={source:{absoluteRef:u},parsed:e}:r.ref=u;const{bundle:{parsed:n}}=await uV(r);return n}function Iy(u){return/^https?:\/\//i.test(u)}function Wlu(u,e){let a;if(e.startsWith("//")){const{protocol:t}=new URL(u);a=`${t||"https:"}${e}`}else if(cx(e))a=e;else if(!e.startsWith("/"))a=_h(u)+"/"+e;else{const t=new URL(u);t.pathname=e,a=t.toString()}return _h(a)}function Lh(u,e){let a=u;return e.forEach(({key:t,value:r,active:n})=>{r&&n&&(a=a.replaceAll(`{${t}}`,r))}),a}function Ky(u,e){let a=u;return e.forEach(({name:t,value:r})=>{r&&(a=a.replaceAll(`{${t}}`,r))}),a}function Jlu(u){return u.startsWith("http://")||u.startsWith("https://")}function tm({url:u,serverUrl:e,corsProxyUrl:a}){const t=Jlu(u)||!e?u:`${_h(e)}/${Hlu(u)}`;return a?`${a}${t}`:t}class oO{constructor(e){this.baseDir=e}async ls(e=""){const a=this.makeKey(e);return Object.keys(localStorage).filter(t=>t.startsWith(a)).map(t=>t.replace(a,""))}async get(e){const a=this.makeKey(e);return localStorage.getItem(a)??null}async set(e,a){const t=this.makeKey(e);localStorage.setItem(t,a)}async remove(e){const a=this.makeKey(e);localStorage.removeItem(a)}makeKey(e){return`replay:fs:${this.baseDir}/${e}`}}class Ulu{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,a){}async remove(e){}}const Zlu=new Set(["node_modules"]);class sO{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await nO(e,{recursive:!0})}async ls(e){const a=await this.getFullPath(e);return this.getDirEntryFilesRecursively(a)}async getDirEntryFilesRecursively(e){try{const a=[],t=await QH(e);for(const r of t)if(r.isDirectory){if(Zlu.has(r.name))continue;const n=await Y4(e,r.name),i=await this.getDirEntryFilesRecursively(n);a.push(...i)}else{const n=await Y4(e,r.name),i=await da.relative(this.baseDir,n);a.push(i)}return a}catch(a){return a.includes("forbidden path")||console.error(a),[]}}async get(e){const a=await this.getFullPath(e);try{return await Ly(a)}catch(t){return!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t),null}}async set(e,a){const t=await this.getFullPath(e),r=UH(),n=t.split(r).slice(0,-1).join(r);await nO(n,{recursive:!0}),await Glu(t,a)}async remove(e){const a=await this.getFullPath(e);try{await Vlu(a)}catch(t){!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t)}}async getFullPath(e){return await Y4(this.baseDir,e??"")}}class Qlu{constructor(e){this.projectId=e}async get(){const e=this.getKey();return localStorage.getItem(e)??null}async set(e){const a=this.getKey();localStorage.setItem(a,e)}async remove(){const e=this.getKey();localStorage.removeItem(e)}getKey(){return`replay:secrets:${this.projectId}`}}class eq{constructor(e){this.storage=e}itemIds=[];async parseMany(e,a){const r=(await Promise.all(e.map(async n=>{try{return await this.parse(n,a)}catch(i){return console.error(`Error parsing from ${n.type} ${n.uri}:`,i),null}}))).filter(n=>n!==null);return this.itemIds=r.map(n=>n.id),r}async write(e){e.state===Ru.Draft||e.srcType!==ln.FS||await this.storage.set(e.id,await this.stringify(e))}async remove(e){await this.storage.remove(e)}async updateRoot(e,a){const t=e.actions;if(t){for(const n in t){const i=parseInt(n);switch(t[n]){case"D":await this.remove(this.itemIds[i]);break;case"I":case"U":await this.write(a[i]);break}}return}const r=this.itemIds.filter(n=>!a.some(i=>i.id===n));await Promise.all([...a.map(n=>this.write(n)),...r.map(n=>this.remove(n))])}async update(e,a){const r={path:e.path.slice(1),actions:e.actions};if(r.path.length===0&&await this.updateRoot(r,a),r.path.length>0){const n=r.path[0];r.path.length===1&&r.actions&&r.actions.id==="U"&&await this.remove(this.itemIds[n]),r.path[1]&&r.path[1]==="id"&&await this.remove(this.itemIds[n]),await this.write(a[n])}this.itemIds=a.map(n=>n.id)}}class Ylu extends eq{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:a,srcType:t,...r}=e;return await da.extname(a)===".json"?JSON.stringify(r,null,2):Do.dump(r)}}var y0=(u=>(u.SIMPLE="simple",u.REGEX="regex",u.JSONPATH="jsonpath",u.XPATH="xpath",u))(y0||{});const uq=1024;let Xlu=0,Ht=class{constructor(e,a){this.from=e,this.to=a}};class gu{constructor(e={}){this.id=Xlu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=J0.match(e)),a=>{let t=e(a);return t===void 0?null:[this,t]}}}gu.closedBy=new gu({deserialize:u=>u.split(" ")});gu.openedBy=new gu({deserialize:u=>u.split(" ")});gu.group=new gu({deserialize:u=>u.split(" ")});gu.isolate=new gu({deserialize:u=>{if(u&&u!="rtl"&&u!="ltr"&&u!="auto")throw new RangeError("Invalid value for isolate: "+u);return u||"auto"}});gu.contextHash=new gu({perNode:!0});gu.lookAhead=new gu({perNode:!0});gu.mounted=new gu({perNode:!0});class Od{constructor(e,a,t){this.tree=e,this.overlay=a,this.parser=t}static get(e){return e&&e.props&&e.props[gu.mounted.id]}}const e1u=Object.create(null);class J0{constructor(e,a,t,r=0){this.name=e,this.props=a,this.id=t,this.flags=r}static define(e){let a=e.props&&e.props.length?Object.create(null):e1u,t=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new J0(e.name||"",a,e.id,t);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");a[n[0].id]=n[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let a=this.prop(gu.group);return a?a.indexOf(e)>-1:!1}return this.id==e}static match(e){let a=Object.create(null);for(let t in e)for(let r of t.split(" "))a[r]=e[t];return t=>{for(let r=t.prop(gu.group),n=-1;n<(r?r.length:0);n++){let i=a[n<0?t.name:r[n]];if(i)return i}}}}J0.none=new J0("",Object.create(null),0,8);class Vy{constructor(e){this.types=e;for(let a=0;a<e.length;a++)if(e[a].id!=a)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let a=[];for(let t of this.types){let r=null;for(let n of e){let i=n(t);i&&(r||(r=Object.assign({},t.props)),r[i[0].id]=i[1])}a.push(r?new J0(t.name,r,t.id,t.flags):t)}return new Vy(a)}}const rm=new WeakMap,lO=new WeakMap;var Ea;(function(u){u[u.ExcludeBuffers=1]="ExcludeBuffers",u[u.IncludeAnonymous=2]="IncludeAnonymous",u[u.IgnoreMounts=4]="IgnoreMounts",u[u.IgnoreOverlays=8]="IgnoreOverlays"})(Ea||(Ea={}));let La=class gb{constructor(e,a,t,r,n){if(this.type=e,this.children=a,this.positions=t,this.length=r,this.props=null,n&&n.length){this.props=Object.create(null);for(let[i,o]of n)this.props[typeof i=="number"?i:i.id]=o}}toString(){let e=Od.get(this);if(e&&!e.overlay)return e.tree.toString();let a="";for(let t of this.children){let r=t.toString();r&&(a&&(a+=","),a+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(a.length?"("+a+")":""):a}cursor(e=0){return new Ih(this.topNode,e)}cursorAt(e,a=0,t=0){let r=rm.get(this)||this.topNode,n=new Ih(r);return n.moveTo(e,a),rm.set(this,n._tree),n}get topNode(){return new Qt(this,0,0,null)}resolve(e,a=0){let t=Pd(rm.get(this)||this.topNode,e,a,!1);return rm.set(this,t),t}resolveInner(e,a=0){let t=Pd(lO.get(this)||this.topNode,e,a,!0);return lO.set(this,t),t}resolveStack(e,a=0){return t1u(this,e,a)}iterate(e){let{enter:a,leave:t,from:r=0,to:n=this.length}=e,i=e.mode||0,o=(i&Ea.IncludeAnonymous)>0;for(let s=this.cursor(i|Ea.IncludeAnonymous);;){let l=!1;if(s.from<=n&&s.to>=r&&(!o&&s.type.isAnonymous||a(s)!==!1)){if(s.firstChild())continue;l=!0}for(;l&&t&&(o||!s.type.isAnonymous)&&t(s),!s.nextSibling();){if(!s.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let a in this.props)e.push([+a,this.props[a]]);return e}balance(e={}){return this.children.length<=8?this:qy(J0.none,this.children,this.positions,0,this.children.length,0,this.length,(a,t,r)=>new gb(this.type,a,t,r,this.propValues),e.makeTree||((a,t,r)=>new gb(J0.none,a,t,r)))}static build(e){return r1u(e)}};La.empty=new La(J0.none,[],[],0);class Gy{constructor(e,a){this.buffer=e,this.index=a}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Gy(this.buffer,this.index)}}class vo{constructor(e,a,t){this.buffer=e,this.length=a,this.set=t}get type(){return J0.none}toString(){let e=[];for(let a=0;a<this.buffer.length;)e.push(this.childString(a)),a=this.buffer[a+3];return e.join(",")}childString(e){let a=this.buffer[e],t=this.buffer[e+3],r=this.set.types[a],n=r.name;if(/\W/.test(n)&&!r.isError&&(n=JSON.stringify(n)),e+=4,t==e)return n;let i=[];for(;e<t;)i.push(this.childString(e)),e=this.buffer[e+3];return n+"("+i.join(",")+")"}findChild(e,a,t,r,n){let{buffer:i}=this,o=-1;for(let s=e;s!=a&&!(aq(n,r,i[s+1],i[s+2])&&(o=s,t>0));s=i[s+3]);return o}slice(e,a,t){let r=this.buffer,n=new Uint16Array(a-e),i=0;for(let o=e,s=0;o<a;){n[s++]=r[o++],n[s++]=r[o++]-t;let l=n[s++]=r[o++]-t;n[s++]=r[o++]-e,i=Math.max(i,l)}return new vo(n,i,this.set)}}function aq(u,e,a,t){switch(u){case-2:return a<e;case-1:return t>=e&&a<e;case 0:return a<e&&t>e;case 1:return a<=e&&t>e;case 2:return t>e;case 4:return!0}}function Pd(u,e,a,t){for(var r;u.from==u.to||(a<1?u.from>=e:u.from>e)||(a>-1?u.to<=e:u.to<e);){let i=!t&&u instanceof Qt&&u.index<0?null:u.parent;if(!i)return u;u=i}let n=t?0:Ea.IgnoreOverlays;if(t)for(let i=u,o=i.parent;o;i=o,o=i.parent)i instanceof Qt&&i.index<0&&((r=o.enter(e,a,n))===null||r===void 0?void 0:r.from)!=i.from&&(u=o);for(;;){let i=u.enter(e,a,n);if(!i)return u;u=i}}class tq{cursor(e=0){return new Ih(this,e)}getChild(e,a=null,t=null){let r=cO(this,e,a,t);return r.length?r[0]:null}getChildren(e,a=null,t=null){return cO(this,e,a,t)}resolve(e,a=0){return Pd(this,e,a,!1)}resolveInner(e,a=0){return Pd(this,e,a,!0)}matchContext(e){return vb(this.parent,e)}enterUnfinishedNodesBefore(e){let a=this.childBefore(e),t=this;for(;a;){let r=a.lastChild;if(!r||r.to!=a.to)break;r.type.isError&&r.from==r.to?(t=a,a=r.prevSibling):a=r}return t}get node(){return this}get next(){return this.parent}}let Qt=class dx extends tq{constructor(e,a,t,r){super(),this._tree=e,this.from=a,this.index=t,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,a,t,r,n=0){for(let i=this;;){for(let{children:o,positions:s}=i._tree,l=a>0?o.length:-1;e!=l;e+=a){let c=o[e],d=s[e]+i.from;if(aq(r,t,d,d+c.length)){if(c instanceof vo){if(n&Ea.ExcludeBuffers)continue;let E=c.findChild(0,c.buffer.length,a,t-d,r);if(E>-1)return new en(new u1u(i,c,e,d),null,E)}else if(n&Ea.IncludeAnonymous||!c.type.isAnonymous||Hy(c)){let E;if(!(n&Ea.IgnoreMounts)&&(E=Od.get(c))&&!E.overlay)return new dx(E.tree,d,e,i);let p=new dx(c,d,e,i);return n&Ea.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(a<0?c.children.length-1:0,a,t,r)}}}if(n&Ea.IncludeAnonymous||!i.type.isAnonymous||(i.index>=0?e=i.index+a:e=a<0?-1:i._parent._tree.children.length,i=i._parent,!i))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,a,t=0){let r;if(!(t&Ea.IgnoreOverlays)&&(r=Od.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:i,to:o}of r.overlay)if((a>0?i<=n:i<n)&&(a<0?o>=n:o>n))return new dx(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,a,t)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function cO(u,e,a,t){let r=u.cursor(),n=[];if(!r.firstChild())return n;if(a!=null){for(let i=!1;!i;)if(i=r.type.is(a),!r.nextSibling())return n}for(;;){if(t!=null&&r.type.is(t))return n;if(r.type.is(e)&&n.push(r.node),!r.nextSibling())return t==null?n:[]}}function vb(u,e,a=e.length-1){for(let t=u;a>=0;t=t.parent){if(!t)return!1;if(!t.type.isAnonymous){if(e[a]&&e[a]!=t.name)return!1;a--}}return!0}class u1u{constructor(e,a,t,r){this.parent=e,this.buffer=a,this.index=t,this.start=r}}class en extends tq{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,a,t){super(),this.context=e,this._parent=a,this.index=t,this.type=e.buffer.set.types[e.buffer.buffer[t]]}child(e,a,t){let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],e,a-this.context.start,t);return n<0?null:new en(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,a,t=0){if(t&Ea.ExcludeBuffers)return null;let{buffer:r}=this.context,n=r.findChild(this.index+4,r.buffer[this.index+3],a>0?1:-1,e-this.context.start,a);return n<0?null:new en(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,a=e.buffer[this.index+3];return a<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new en(this.context,this._parent,a):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,a=this._parent?this._parent.index+4:0;return this.index==a?this.externalSibling(-1):new en(this.context,this._parent,e.findChild(a,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],a=[],{buffer:t}=this.context,r=this.index+4,n=t.buffer[this.index+3];if(n>r){let i=t.buffer[this.index+1];e.push(t.slice(r,n,i)),a.push(0)}return new La(this.type,e,a,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function rq(u){if(!u.length)return null;let e=0,a=u[0];for(let n=1;n<u.length;n++){let i=u[n];(i.from>a.from||i.to<a.to)&&(a=i,e=n)}let t=a instanceof Qt&&a.index<0?null:a.parent,r=u.slice();return t?r[e]=t:r.splice(e,1),new a1u(r,a)}class a1u{constructor(e,a){this.heads=e,this.node=a}get next(){return rq(this.heads)}}function t1u(u,e,a){let t=u.resolveInner(e,a),r=null;for(let n=t instanceof Qt?t:t.context.parent;n;n=n.parent)if(n.index<0){let i=n.parent;(r||(r=[t])).push(i.resolve(e,a)),n=i}else{let i=Od.get(n.tree);if(i&&i.overlay&&i.overlay[0].from<=e&&i.overlay[i.overlay.length-1].to>=e){let o=new Qt(i.tree,i.overlay[0].from+n.from,-1,n);(r||(r=[t])).push(Pd(o,e,a,!1))}}return r?rq(r):t}class Ih{get name(){return this.type.name}constructor(e,a=0){if(this.mode=a,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Qt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,a){this.index=e;let{start:t,buffer:r}=this.buffer;return this.type=a||r.set.types[r.buffer[e]],this.from=t+r.buffer[e+1],this.to=t+r.buffer[e+2],!0}yield(e){return e?e instanceof Qt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,a,t){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,a,t,this.mode));let{buffer:r}=this.buffer,n=r.findChild(this.index+4,r.buffer[this.index+3],e,a-this.buffer.start,t);return n<0?!1:(this.stack.push(this.index),this.yieldBuf(n))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,a,t=this.mode){return this.buffer?t&Ea.ExcludeBuffers?!1:this.enterChild(1,e,a):this.yield(this._tree.enter(e,a,t))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ea.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ea.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:a}=this.buffer,t=this.stack.length-1;if(e<0){let r=t<0?0:this.stack[t]+4;if(this.index!=r)return this.yieldBuf(a.findChild(r,this.index,-1,0,4))}else{let r=a.buffer[this.index+3];if(r<(t<0?a.buffer.length:a.buffer[this.stack[t]+3]))return this.yieldBuf(r)}return t<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let a,t,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let n=0;n<this.index;n++)if(r.buffer.buffer[n+3]<this.index)return!1;({index:a,parent:t}=r)}else({index:a,_parent:t}=this._tree);for(;t;{index:a,_parent:t}=t)if(a>-1)for(let n=a+e,i=e<0?-1:t._tree.children.length;n!=i;n+=e){let o=t._tree.children[n];if(this.mode&Ea.IncludeAnonymous||o instanceof vo||!o.type.isAnonymous||Hy(o))return!1}return!0}move(e,a){if(a&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,a=0){for(;(this.from==this.to||(a<1?this.from>=e:this.from>e)||(a>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,a););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,a=null,t=0;if(e&&e.context==this.buffer)e:for(let r=this.index,n=this.stack.length;n>=0;){for(let i=e;i;i=i._parent)if(i.index==r){if(r==this.index)return i;a=i,t=n+1;break e}r=this.stack[--n]}for(let r=t;r<this.stack.length;r++)a=new en(this.buffer,a,this.stack[r]);return this.bufferNode=new en(this.buffer,a,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,a){for(let t=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){t++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&a&&a(this),r=this.type.isAnonymous,!t)return;if(this.nextSibling())break;this.parent(),t--,r=!0}}}matchContext(e){if(!this.buffer)return vb(this.node.parent,e);let{buffer:a}=this.buffer,{types:t}=a.set;for(let r=e.length-1,n=this.stack.length-1;r>=0;n--){if(n<0)return vb(this._tree,e,r);let i=t[a.buffer[this.stack[n]]];if(!i.isAnonymous){if(e[r]&&e[r]!=i.name)return!1;r--}}return!0}}function Hy(u){return u.children.some(e=>e instanceof vo||!e.type.isAnonymous||Hy(e))}function r1u(u){var e;let{buffer:a,nodeSet:t,maxBufferLength:r=uq,reused:n=[],minRepeatType:i=t.types.length}=u,o=Array.isArray(a)?new Gy(a,a.length):a,s=t.types,l=0,c=0;function d(v,b,F,B,S,P){let{id:L,start:N,end:K,size:X}=o,J=c,ue=l;for(;X<0;)if(o.next(),X==-1){let $=n[L];F.push($),B.push(N-v);return}else if(X==-3){l=L;return}else if(X==-4){c=L;return}else throw new RangeError(`Unrecognized record size: ${X}`);let de=s[L],ie,xe,j=N-v;if(K-N<=r&&(xe=f(o.pos-b,S))){let $=new Uint16Array(xe.size-xe.skip),V=o.pos-xe.size,T=$.length;for(;o.pos>V;)T=D(xe.start,$,T);ie=new vo($,K-xe.start,t),j=xe.start-v}else{let $=o.pos-X;o.next();let V=[],T=[],A=L>=i?L:-1,z=0,R=K;for(;o.pos>$;)A>=0&&o.id==A&&o.size>=0?(o.end<=R-r&&(h(V,T,N,z,o.end,R,A,J,ue),z=V.length,R=o.end),o.next()):P>2500?E(N,$,V,T):d(N,$,V,T,A,P+1);if(A>=0&&z>0&&z<V.length&&h(V,T,N,z,N,R,A,J,ue),V.reverse(),T.reverse(),A>-1&&z>0){let U=p(de,ue);ie=qy(de,V,T,0,V.length,0,K-N,U,U)}else ie=x(de,V,T,K-N,J-K,ue)}F.push(ie),B.push(j)}function E(v,b,F,B){let S=[],P=0,L=-1;for(;o.pos>b;){let{id:N,start:K,end:X,size:J}=o;if(J>4)o.next();else{if(L>-1&&K<L)break;L<0&&(L=X-r),S.push(N,K,X),P++,o.next()}}if(P){let N=new Uint16Array(P*4),K=S[S.length-2];for(let X=S.length-3,J=0;X>=0;X-=3)N[J++]=S[X],N[J++]=S[X+1]-K,N[J++]=S[X+2]-K,N[J++]=J;F.push(new vo(N,S[2]-K,t)),B.push(K-v)}}function p(v,b){return(F,B,S)=>{let P=0,L=F.length-1,N,K;if(L>=0&&(N=F[L])instanceof La){if(!L&&N.type==v&&N.length==S)return N;(K=N.prop(gu.lookAhead))&&(P=B[L]+N.length+K)}return x(v,F,B,S,P,b)}}function h(v,b,F,B,S,P,L,N,K){let X=[],J=[];for(;v.length>B;)X.push(v.pop()),J.push(b.pop()+F-S);v.push(x(t.types[L],X,J,P-S,N-P,K)),b.push(S-F)}function x(v,b,F,B,S,P,L){if(P){let N=[gu.contextHash,P];L=L?[N].concat(L):[N]}if(S>25){let N=[gu.lookAhead,S];L=L?[N].concat(L):[N]}return new La(v,b,F,B,L)}function f(v,b){let F=o.fork(),B=0,S=0,P=0,L=F.end-r,N={size:0,start:0,skip:0};e:for(let K=F.pos-v;F.pos>K;){let X=F.size;if(F.id==b&&X>=0){N.size=B,N.start=S,N.skip=P,P+=4,B+=4,F.next();continue}let J=F.pos-X;if(X<0||J<K||F.start<L)break;let ue=F.id>=i?4:0,de=F.start;for(F.next();F.pos>J;){if(F.size<0)if(F.size==-3)ue+=4;else break e;else F.id>=i&&(ue+=4);F.next()}S=de,B+=X,P+=ue}return(b<0||B==v)&&(N.size=B,N.start=S,N.skip=P),N.size>4?N:void 0}function D(v,b,F){let{id:B,start:S,end:P,size:L}=o;if(o.next(),L>=0&&B<i){let N=F;if(L>4){let K=o.pos-(L-4);for(;o.pos>K;)F=D(v,b,F)}b[--F]=N,b[--F]=P-v,b[--F]=S-v,b[--F]=B}else L==-3?l=B:L==-4&&(c=B);return F}let g=[],k=[];for(;o.pos>0;)d(u.start||0,u.bufferStart||0,g,k,-1,0);let C=(e=u.length)!==null&&e!==void 0?e:g.length?k[0]+g[0].length:0;return new La(s[u.topID],g.reverse(),k.reverse(),C)}const dO=new WeakMap;function Ex(u,e){if(!u.isAnonymous||e instanceof vo||e.type!=u)return 1;let a=dO.get(e);if(a==null){a=1;for(let t of e.children){if(t.type!=u||!(t instanceof La)){a=1;break}a+=Ex(u,t)}dO.set(e,a)}return a}function qy(u,e,a,t,r,n,i,o,s){let l=0;for(let h=t;h<r;h++)l+=Ex(u,e[h]);let c=Math.ceil(l*1.5/8),d=[],E=[];function p(h,x,f,D,g){for(let k=f;k<D;){let C=k,v=x[k],b=Ex(u,h[k]);for(k++;k<D;k++){let F=Ex(u,h[k]);if(b+F>=c)break;b+=F}if(k==C+1){if(b>c){let F=h[C];p(F.children,F.positions,0,F.children.length,x[C]+g);continue}d.push(h[C])}else{let F=x[k-1]+h[k-1].length-v;d.push(qy(u,h,x,C,k,v,F,null,s))}E.push(v+g-n)}}return p(e,a,t,r,0),(o||s)(d,E,i)}class nq{constructor(){this.map=new WeakMap}setBuffer(e,a,t){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(a,t)}getBuffer(e,a){let t=this.map.get(e);return t&&t.get(a)}set(e,a){e instanceof en?this.setBuffer(e.context.buffer,e.index,a):e instanceof Qt&&this.map.set(e.tree,a)}get(e){return e instanceof en?this.getBuffer(e.context.buffer,e.index):e instanceof Qt?this.map.get(e.tree):void 0}cursorSet(e,a){e.buffer?this.setBuffer(e.buffer.buffer,e.index,a):this.map.set(e.tree,a)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class si{constructor(e,a,t,r,n=!1,i=!1){this.from=e,this.to=a,this.tree=t,this.offset=r,this.open=(n?1:0)|(i?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,a=[],t=!1){let r=[new si(0,e.length,e,0,!1,t)];for(let n of a)n.to>e.length&&r.push(n);return r}static applyChanges(e,a,t=128){if(!a.length)return e;let r=[],n=1,i=e.length?e[0]:null;for(let o=0,s=0,l=0;;o++){let c=o<a.length?a[o]:null,d=c?c.fromA:1e9;if(d-s>=t)for(;i&&i.from<d;){let E=i;if(s>=E.from||d<=E.to||l){let p=Math.max(E.from,s)-l,h=Math.min(E.to,d)-l;E=p>=h?null:new si(p,h,E.tree,E.offset+l,o>0,!!c)}if(E&&r.push(E),i.to>d)break;i=n<e.length?e[n++]:null}if(!c)break;s=c.toA,l=c.toA-c.toB}return r}}let iq=class{startParse(e,a,t){return typeof e=="string"&&(e=new n1u(e)),t=t?t.length?t.map(r=>new Ht(r.from,r.to)):[new Ht(0,0)]:[new Ht(0,e.length)],this.createParse(e,a||[],t)}parse(e,a,t){let r=this.startParse(e,a,t);for(;;){let n=r.advance();if(n)return n}}};class n1u{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,a){return this.string.slice(e,a)}}function i1u(u){return(e,a,t,r)=>new s1u(e,u,a,t,r)}class EO{constructor(e,a,t,r,n){this.parser=e,this.parse=a,this.overlay=t,this.target=r,this.from=n}}function pO(u){if(!u.length||u.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(u))}class o1u{constructor(e,a,t,r,n,i,o){this.parser=e,this.predicate=a,this.mounts=t,this.index=r,this.start=n,this.target=i,this.prev=o,this.depth=0,this.ranges=[]}}const kb=new gu({perNode:!0});class s1u{constructor(e,a,t,r,n){this.nest=a,this.input=t,this.fragments=r,this.ranges=n,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return this.stoppedAt!=null&&(t=new La(t.type,t.children,t.positions,t.length,t.propValues.concat([[kb,this.stoppedAt]]))),t}let e=this.inner[this.innerDone],a=e.parse.advance();if(a){this.innerDone++;let t=Object.assign(Object.create(null),e.target.props);t[gu.mounted.id]=new Od(a,e.overlay,e.parser),e.target.props=t}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let a=this.innerDone;a<this.inner.length;a++)this.inner[a].from<e&&(e=Math.min(e,this.inner[a].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let a=this.innerDone;a<this.inner.length;a++)this.inner[a].parse.stopAt(e)}startInner(){let e=new d1u(this.fragments),a=null,t=null,r=new Ih(new Qt(this.baseTree,this.ranges[0].from,0,null),Ea.IncludeAnonymous|Ea.IgnoreMounts);e:for(let n,i;;){let o=!0,s;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(a){let l=a.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(l)for(let c of l.mount.overlay){let d=c.from+l.pos,E=c.to+l.pos;d>=r.from&&E<=r.to&&!a.ranges.some(p=>p.from<E&&p.to>d)&&a.ranges.push({from:d,to:E})}}o=!1}else if(t&&(i=l1u(t.ranges,r.from,r.to)))o=i!=2;else if(!r.type.isAnonymous&&(n=this.nest(r,this.input))&&(r.from<r.to||!n.overlay)){r.tree||c1u(r);let l=e.findMounts(r.from,n.parser);if(typeof n.overlay=="function")a=new o1u(n.parser,n.overlay,l,this.inner.length,r.from,r.tree,a);else{let c=hO(this.ranges,n.overlay||(r.from<r.to?[new Ht(r.from,r.to)]:[]));c.length&&pO(c),(c.length||!n.overlay)&&this.inner.push(new EO(n.parser,c.length?n.parser.startParse(this.input,DO(l,c),c):n.parser.startParse(""),n.overlay?n.overlay.map(d=>new Ht(d.from-r.from,d.to-r.from)):null,r.tree,c.length?c[0].from:r.from)),n.overlay?c.length&&(t={ranges:c,depth:0,prev:t}):o=!1}}else if(a&&(s=a.predicate(r))&&(s===!0&&(s=new Ht(r.from,r.to)),s.from<s.to)){let l=a.ranges.length-1;l>=0&&a.ranges[l].to==s.from?a.ranges[l]={from:a.ranges[l].from,to:s.to}:a.ranges.push(s)}if(o&&r.firstChild())a&&a.depth++,t&&t.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(a&&!--a.depth){let l=hO(this.ranges,a.ranges);l.length&&(pO(l),this.inner.splice(a.index,0,new EO(a.parser,a.parser.startParse(this.input,DO(a.mounts,l),l),a.ranges.map(c=>new Ht(c.from-a.start,c.to-a.start)),a.target,l[0].from))),a=a.prev}t&&!--t.depth&&(t=t.prev)}}}}function l1u(u,e,a){for(let t of u){if(t.from>=a)break;if(t.to>e)return t.from<=e&&t.to>=a?2:1}return 0}function mO(u,e,a,t,r,n){if(e<a){let i=u.buffer[e+1];t.push(u.slice(e,a,i)),r.push(i-n)}}function c1u(u){let{node:e}=u,a=[],t=e.context.buffer;do a.push(u.index),u.parent();while(!u.tree);let r=u.tree,n=r.children.indexOf(t),i=r.children[n],o=i.buffer,s=[n];function l(c,d,E,p,h,x){let f=a[x],D=[],g=[];mO(i,c,f,D,g,p);let k=o[f+1],C=o[f+2];s.push(D.length);let v=x?l(f+4,o[f+3],i.set.types[o[f]],k,C-k,x-1):e.toTree();return D.push(v),g.push(k-p),mO(i,o[f+3],d,D,g,p),new La(E,D,g,h)}r.children[n]=l(0,o.length,J0.none,0,i.length,a.length-1);for(let c of s){let d=u.tree.children[c],E=u.tree.positions[c];u.yield(new Qt(d,E+u.from,c,u._tree))}}class xO{constructor(e,a){this.offset=a,this.done=!1,this.cursor=e.cursor(Ea.IncludeAnonymous|Ea.IgnoreMounts)}moveTo(e){let{cursor:a}=this,t=e-this.offset;for(;!this.done&&a.from<t;)a.to>=e&&a.enter(t,1,Ea.IgnoreOverlays|Ea.ExcludeBuffers)||a.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let a=this.cursor.tree;;){if(a==e.tree)return!0;if(a.children.length&&a.positions[0]==0&&a.children[0]instanceof La)a=a.children[0];else break}return!1}}let d1u=class{constructor(e){var a;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=(a=t.tree.prop(kb))!==null&&a!==void 0?a:t.to,this.inner=new xO(t.tree,-t.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let a=this.curFrag=this.fragments[this.fragI];this.curTo=(e=a.tree.prop(kb))!==null&&e!==void 0?e:a.to,this.inner=new xO(a.tree,-a.offset)}}findMounts(e,a){var t;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let n=this.inner.cursor.node;n;n=n.parent){let i=(t=n.tree)===null||t===void 0?void 0:t.prop(gu.mounted);if(i&&i.parser==a)for(let o=this.fragI;o<this.fragments.length;o++){let s=this.fragments[o];if(s.from>=n.to)break;s.tree==this.curFrag.tree&&r.push({frag:s,pos:n.from-s.offset,mount:i})}}}return r}};function hO(u,e){let a=null,t=e;for(let r=1,n=0;r<u.length;r++){let i=u[r-1].to,o=u[r].from;for(;n<t.length;n++){let s=t[n];if(s.from>=o)break;s.to<=i||(a||(t=a=e.slice()),s.from<i?(a[n]=new Ht(s.from,i),s.to>o&&a.splice(n+1,0,new Ht(o,s.to))):s.to>o?a[n--]=new Ht(o,s.to):a.splice(n--,1))}}return t}function E1u(u,e,a,t){let r=0,n=0,i=!1,o=!1,s=-1e9,l=[];for(;;){let c=r==u.length?1e9:i?u[r].to:u[r].from,d=n==e.length?1e9:o?e[n].to:e[n].from;if(i!=o){let E=Math.max(s,a),p=Math.min(c,d,t);E<p&&l.push(new Ht(E,p))}if(s=Math.min(c,d),s==1e9)break;c==s&&(i?(i=!1,r++):i=!0),d==s&&(o?(o=!1,n++):o=!0)}return l}function DO(u,e){let a=[];for(let{pos:t,mount:r,frag:n}of u){let i=t+(r.overlay?r.overlay[0].from:0),o=i+r.tree.length,s=Math.max(n.from,i),l=Math.min(n.to,o);if(r.overlay){let c=r.overlay.map(E=>new Ht(E.from+t,E.to+t)),d=E1u(e,c,s,l);for(let E=0,p=s;;E++){let h=E==d.length,x=h?l:d[E].from;if(x>p&&a.push(new si(p,x,r.tree,-i,n.from>=p||n.openStart,n.to<=x||n.openEnd)),h)break;p=d[E].to}}else a.push(new si(s,l,r.tree,-i,n.from>=i||n.openStart,n.to<=o||n.openEnd))}return a}class Kh{constructor(e,a,t,r,n,i,o,s,l,c=0,d){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=n,this.score=i,this.buffer=o,this.bufferBase=s,this.curContext=l,this.lookAhead=c,this.parent=d}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new Kh(e,[],a,t,t,0,[],0,r?new fO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:n}=this.p,i=this.reducePos<this.pos-25;i&&this.setLookAhead(this.pos);let o=n.dynamicPrecedence(r);if(o&&(this.score+=o),t==0){this.pushState(n.getGoto(this.state,r,!0),this.reducePos),r<n.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(r,this.reducePos);return}let s=this.stack.length-(t-1)*3-(e&262144?6:0),l=s?this.stack[s-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let d=s?this.stack[s-1]:0,E=this.bufferBase+this.buffer.length-d;if(r<n.minRepeatTerm||e&131072){let p=n.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,p,E+4,!0)}if(e&262144)this.state=this.stack[s];else{let p=this.stack[s-3];this.state=n.getGoto(p,r,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,a,t,r=4,n=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let i=this,o=this.buffer.length;if(o==0&&i.parent&&(o=i.bufferBase-i.parent.bufferBase,i=i.parent),o>0&&i.buffer[o-4]==0&&i.buffer[o-1]>-1){if(a==t)return;if(i.buffer[o-2]>=a){i.buffer[o-2]=t;return}}}if(!n||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let o=!1;for(let s=i;s>0&&this.buffer[s-2]>t;s-=4)if(this.buffer[s-1]>=0){o=!0;break}if(o)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let n=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(n,1)||(this.reducePos=r)),this.pushState(n,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}else this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4)}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new Kh(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new p1u(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if((t&65536)==0)return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let n=0,i;n<a.length;n+=2)(i=a[n+1])!=this.state&&this.p.parser.hasAction(i,e)&&r.push(a[n],i);if(this.stack.length<120)for(let n=0;r.length<8&&n<a.length;n+=2){let i=a[n+1];r.some((o,s)=>s&1&&o==i)||r.push(a[n],i)}a=r}let t=[];for(let r=0;r<a.length&&t.length<4;r+=2){let n=a[r+1];if(n==this.state)continue;let i=this.split();i.pushState(n,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(a[r],this.pos),i.reducePos=this.pos,i.score-=200,t.push(i)}return t}forceReduce(){let{parser:e}=this.p,a=e.stateSlot(this.state,5);if((a&65536)==0)return!1;if(!e.validAction(this.state,a)){let t=a>>19,r=a&65535,n=this.stack.length-t*3;if(n<0||e.getGoto(this.stack[n],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,n)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let o=(i>>19)-n;if(o>1){let s=i&65535,l=this.stack.length-o*3;if(l>=0&&e.getGoto(this.stack[l],s,!1)>=0)return o<<19|65536|s}}else{let o=t(i,n+1);if(o!=null)return o}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;a<this.stack.length;a+=3)if(this.stack[a]!=e.stack[a])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,a){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(a)))}reduceContext(e,a){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(a)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let a=new fO(this.curContext.tracker,e);a.hash!=this.curContext.hash&&this.emitContext(),this.curContext=a}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class fO{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class p1u{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class Vh{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new Vh(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Vh(this.stack,this.pos,this.index)}}function P4(u,e=Uint16Array){if(typeof u!="string")return u;let a=null;for(let t=0,r=0;t<u.length;){let n=0;for(;;){let i=u.charCodeAt(t++),o=!1;if(i==126){n=65535;break}i>=92&&i--,i>=34&&i--;let s=i-32;if(s>=46&&(s-=46,o=!0),n+=s,o)break;n*=46}a?a[r++]=n:a=new e(n)}return a}class px{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const gO=new px;class m1u{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=gO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,n=this.pos+e;for(;n<t.from;){if(!r)return null;let i=this.ranges[--r];n-=t.from-i.to,t=i}for(;a<0?n>t.to:n>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];n+=i.from-t.to,t=i}return n}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let a of this.ranges)if(a.to>e)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a<this.chunk.length)t=this.pos+e,r=this.chunk.charCodeAt(a);else{let n=this.resolveOffset(e,1);if(n==null)return-1;if(t=n,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let i=this.rangeIndex,o=this.range;for(;o.to<=t;)o=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=t}acceptTokenTo(e,a){this.token.value=e,this.token.end=a}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:a}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=a,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),a=this.pos+e.length;this.chunk=a>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=gO,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,a){if(e>=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class m1{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;oq(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}m1.prototype.contextual=m1.prototype.fallback=m1.prototype.extend=!1;class Gh{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?P4(e):e}token(e,a){let t=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(oq(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}Gh.prototype.contextual=m1.prototype.fallback=m1.prototype.extend=!1;class h0{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function oq(u,e,a,t,r,n){let i=0,o=1<<t,{dialect:s}=a.p.parser;e:for(;(o&u[i])!=0;){let l=u[i+1];for(let p=i+3;p<l;p+=2)if((u[p+1]&o)>0){let h=u[p];if(s.allows(h)&&(e.token.value==-1||e.token.value==h||x1u(h,e.token.value,r,n))){e.acceptToken(h);break}}let c=e.next,d=0,E=u[i+2];if(e.next<0&&E>d&&u[l+E*3-3]==65535){i=u[l+E*3-1];continue e}for(;d<E;){let p=d+E>>1,h=l+p+(p<<1),x=u[h],f=u[h+1]||65536;if(c<x)E=p;else if(c>=f)d=p+1;else{i=u[h+2],e.advance();continue e}}break}}function vO(u,e,a){for(let t=e,r;(r=u[t])!=65535;t++)if(r==a)return t-e;return-1}function x1u(u,e,a,t){let r=vO(a,t,e);return r<0||vO(a,t,u)<r}const ht=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let K6=null;function kO(u,e,a){let t=u.cursor(Ea.IncludeAnonymous);for(t.moveTo(e);;)if(!(a<0?t.childBefore(e):t.childAfter(e)))for(;;){if((a<0?t.to<e:t.from>e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(u.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:u.length}}class h1u{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?kO(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?kO(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let a=this.trees.length-1;if(a<0)return this.nextFragment(),null;let t=this.trees[a],r=this.index[a];if(r==t.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let n=t.children[r],i=this.start[a]+t.positions[r];if(i>e)return this.nextStart=i,null;if(n instanceof La){if(i==e){if(i<this.safeFrom)return null;let o=i+n.length;if(o<=this.safeTo){let s=n.prop(gu.lookAhead);if(!s||o+s<this.fragment.to)return n}}this.index[a]++,i+n.length>=Math.max(this.safeFrom,e)&&(this.trees.push(n),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+n.length}}}class D1u{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new px)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:n}=r,i=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let l=0;l<n.length;l++){if((1<<l&i)==0)continue;let c=n[l],d=this.tokens[l];if(!(t&&!c.fallback)&&((c.contextual||d.start!=e.pos||d.mask!=i||d.context!=o)&&(this.updateCachedToken(d,c,e),d.mask=i,d.context=o),d.lookAhead>d.end+25&&(s=Math.max(d.lookAhead,s)),d.value!=0)){let E=a;if(d.extended>-1&&(a=this.addActions(e,d.extended,d.end,a)),a=this.addActions(e,d.value,d.end,a),!c.extend&&(t=d,a>E))break}}for(;this.actions.length>a;)this.actions.pop();return s&&e.setLookAhead(s),!t&&e.pos==this.stream.end&&(t=new px,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new px,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:n}=t.p;for(let i=0;i<n.specialized.length;i++)if(n.specialized[i]==e.value){let o=n.specializers[i](this.stream.read(e.start,e.end),t);if(o>=0&&t.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let n=0;n<r;n+=3)if(this.actions[n]==e)return r;return this.actions[r++]=e,this.actions[r++]=a,this.actions[r++]=t,r}addActions(e,a,t,r){let{state:n}=e,{parser:i}=e.p,{data:o}=i;for(let s=0;s<2;s++)for(let l=i.stateSlot(n,s?2:1);;l+=3){if(o[l]==65535)if(o[l+1]==1)l=Yn(o,l+2);else{r==0&&o[l+1]==2&&(r=this.putAction(Yn(o,l+2),a,t,r));break}o[l]==a&&(r=this.putAction(Yn(o,l+1),a,t,r))}return r}}class f1u{constructor(e,a,t,r){this.parser=e,this.input=a,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new m1u(a,r),this.tokens=new D1u(e,this.stream),this.topTerm=e.top[1];let{from:n}=r[0];this.stacks=[Kh.start(this,e.top[0],n)],this.fragments=t.length&&this.stream.end-n>e.bufferLength*4?new h1u(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,n;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;i<e.length;i++){let o=e[i];for(;;){if(this.tokens.mainToken=null,o.pos>a)t.push(o);else{if(this.advanceStack(o,t,e))continue;{r||(r=[],n=[]),r.push(o);let s=this.tokens.getMainToken(o);n.push(s.value,s.end)}}break}}if(!t.length){let i=r&&v1u(r);if(i)return ht&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw ht&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,n,t);if(i)return ht&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((o,s)=>s.score-o.score);t.length>i;)t.pop();t.some(o=>o.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i<t.length-1;i++){let o=t[i];for(let s=i+1;s<t.length;s++){let l=t[s];if(o.sameState(l)||o.buffer.length>500&&l.buffer.length>500)if((o.score-l.score||o.buffer.length-l.buffer.length)>0)t.splice(s--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i<t.length;i++)t[i].pos<this.minStackPos&&(this.minStackPos=t[i].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,a,t){let r=e.pos,{parser:n}=this,i=ht?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let l=e.curContext&&e.curContext.tracker.strict,c=l?e.curContext.hash:0;for(let d=this.fragments.nodeAt(r);d;){let E=this.parser.nodeSet.types[d.type.id]==d.type?n.getGoto(e.state,d.type.id):-1;if(E>-1&&d.length&&(!l||(d.prop(gu.contextHash)||0)==c))return e.useNode(d,E),ht&&console.log(i+this.stackID(e)+` (via reuse of ${n.getName(d.type.id)})`),!0;if(!(d instanceof La)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof La&&d.positions[0]==0)d=p;else break}}let o=n.stateSlot(e.state,4);if(o>0)return e.reduce(o),ht&&console.log(i+this.stackID(e)+` (via always-reduce ${n.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let l=0;l<s.length;){let c=s[l++],d=s[l++],E=s[l++],p=l==s.length||!t,h=p?e:e.split(),x=this.tokens.mainToken;if(h.apply(c,d,x?x.start:h.pos,E),ht&&console.log(i+this.stackID(h)+` (via ${(c&65536)==0?"shift":`reduce of ${n.getName(c&65535)}`} for ${n.getName(d)} @ ${r}${h==e?"":", split"})`),p)return!0;h.pos>r?a.push(h):t.push(h)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return bO(e,a),!0}}runRecovery(e,a,t){let r=null,n=!1;for(let i=0;i<e.length;i++){let o=e[i],s=a[i<<1],l=a[(i<<1)+1],c=ht?this.stackID(o)+" -> ":"";if(o.deadEnd&&(n||(n=!0,o.restart(),ht&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,t))))continue;let d=o.split(),E=c;for(let p=0;d.forceReduce()&&p<10&&(ht&&console.log(E+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,t));p++)ht&&(E=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(s))ht&&console.log(c+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>o.pos?(l==o.pos&&(l++,s=0),o.recoverByDelete(s,l),ht&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),bO(o,t)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),La.build({buffer:Vh.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let a=(K6||(K6=new WeakMap)).get(e);return a||K6.set(e,a=String.fromCodePoint(this.nextStackID++)),a+e}}function bO(u,e){for(let a=0;a<e.length;a++){let t=e[a];if(t.pos==u.pos&&t.sameState(u)){e[a].score<u.score&&(e[a]=u);return}}e.push(u)}class g1u{constructor(e,a,t){this.source=e,this.flags=a,this.disabled=t}allows(e){return!this.disabled||this.disabled[e]==0}}const V6=u=>u;class GD{constructor(e){this.start=e.start,this.shift=e.shift||V6,this.reduce=e.reduce||V6,this.reuse=e.reuse||V6,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class xi extends iq{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let o=0;o<e.repeatNodeCount;o++)a.push("");let t=Object.keys(e.topRules).map(o=>e.topRules[o][1]),r=[];for(let o=0;o<a.length;o++)r.push([]);function n(o,s,l){r[o].push([s,s.deserialize(String(l))])}if(e.nodeProps)for(let o of e.nodeProps){let s=o[0];typeof s=="string"&&(s=gu[s]);for(let l=1;l<o.length;){let c=o[l++];if(c>=0)n(c,s,o[l++]);else{let d=o[l+-c];for(let E=-c;E>0;E--)n(o[l++],s,d);l++}}}this.nodeSet=new Vy(a.map((o,s)=>J0.define({name:s>=this.minRepeatTerm?void 0:o,id:s,props:r[s],top:t.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=uq;let i=P4(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(CO),this.states=P4(e.states,Uint32Array),this.data=P4(e.stateData),this.goto=P4(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new m1(i,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new f1u(this,e,a,t);for(let n of this.wrappers)r=n(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let n=r[a+1];;){let i=r[n++],o=i&1,s=r[n++];if(o&&t)return s;for(let l=n+(i>>1);n<l;n++)if(r[n]==e)return s;if(o)return-1}}hasAction(e,a){let t=this.data;for(let r=0;r<2;r++)for(let n=this.stateSlot(e,r?2:1),i;;n+=3){if((i=t[n])==65535)if(t[n+1]==1)i=t[n=Yn(t,n+2)];else{if(t[n+1]==2)return Yn(t,n+2);break}if(i==a||i==0)return Yn(t,n+1)}return 0}stateSlot(e,a){return this.states[e*6+a]}stateFlag(e,a){return(this.stateSlot(e,0)&a)>0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Yn(this.data,n+2);else break;r=a(Yn(this.data,n+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=Yn(this.data,t+2);else break;if((this.data[t+2]&1)==0){let r=this.data[t+1];a.some((n,i)=>i&1&&n==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(xi.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(n=>n.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let n=e.specializers.find(o=>o.from==t.external);if(!n)return t;let i=Object.assign(Object.assign({},t),{external:n.to});return a.specializers[r]=CO(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let n of e.split(" ")){let i=a.indexOf(n);i>=0&&(t[i]=!0)}let r=null;for(let n=0;n<a.length;n++)if(!t[n])for(let i=this.dialects[a[n]],o;(o=this.data[i++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[o]=1;return new g1u(e,t,r)}static deserialize(e){return new xi(e)}}function Yn(u,e){return u[e]|u[e+1]<<16}function v1u(u){let e=null;for(let a of u){let t=a.p.stoppedAt;(a.pos==a.p.stream.end||t!=null&&a.pos>t)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.score<a.score)&&(e=a)}return e}function CO(u){if(u.external){let e=u.extend?1:0;return(a,t)=>u.external(a,t)<<1|e}return u.get}let k1u=0,Xn=class bb{constructor(e,a,t,r){this.name=e,this.set=a,this.base=t,this.modified=r,this.id=k1u++}toString(){let{name:e}=this;for(let a of this.modified)a.name&&(e=`${a.name}(${e})`);return e}static define(e,a){let t=typeof e=="string"?e:"?";if(e instanceof bb&&(a=e),a?.base)throw new Error("Can not derive from a modified tag");let r=new bb(t,[],null,[]);if(r.set.push(r),a)for(let n of a.set)r.set.push(n);return r}static defineModifier(e){let a=new Hh(e);return t=>t.modified.indexOf(a)>-1?t:Hh.get(t.base||t,t.modified.concat(a).sort((r,n)=>r.id-n.id))}},b1u=0;class Hh{constructor(e){this.name=e,this.instances=[],this.id=b1u++}static get(e,a){if(!a.length)return e;let t=a[0].instances.find(o=>o.base==e&&C1u(a,o.modified));if(t)return t;let r=[],n=new Xn(e.name,r,e,a);for(let o of a)o.instances.push(n);let i=F1u(a);for(let o of e.set)if(!o.modified.length)for(let s of i)r.push(Hh.get(o,s));return n}}function C1u(u,e){return u.length==e.length&&u.every((a,t)=>a==e[t])}function F1u(u){let e=[[]];for(let a=0;a<u.length;a++)for(let t=0,r=e.length;t<r;t++)e.push(e[t].concat(u[a]));return e.sort((a,t)=>t.length-a.length)}function Js(u){let e=Object.create(null);for(let a in u){let t=u[a];Array.isArray(t)||(t=[t]);for(let r of a.split(" "))if(r){let n=[],i=2,o=r;for(let d=0;;){if(o=="..."&&d>0&&d+3==r.length){i=1;break}let E=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!E)throw new RangeError("Invalid path: "+r);if(n.push(E[0]=="*"?"":E[0][0]=='"'?JSON.parse(E[0]):E[0]),d+=E[0].length,d==r.length)break;let p=r[d++];if(d==r.length&&p=="!"){i=0;break}if(p!="/")throw new RangeError("Invalid path: "+r);o=r.slice(d)}let s=n.length-1,l=n[s];if(!l)throw new RangeError("Invalid path: "+r);let c=new qh(t,i,s>0?n.slice(0,s):null);e[l]=c.sort(e[l])}}return sq.add(e)}const sq=new gu;class qh{constructor(e,a,t,r){this.tags=e,this.mode=a,this.context=t,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}qh.empty=new qh([],2,null);function lq(u,e){let a=Object.create(null);for(let n of u)if(!Array.isArray(n.tag))a[n.tag.id]=n.class;else for(let i of n.tag)a[i.id]=n.class;let{scope:t,all:r=null}=e||{};return{style:n=>{let i=r;for(let o of n)for(let s of o.set){let l=a[s.id];if(l){i=i?i+" "+l:l;break}}return i},scope:t}}function y1u(u,e){let a=null;for(let t of u){let r=t.style(e);r&&(a=a?a+" "+r:r)}return a}function A1u(u,e,a,t=0,r=u.length){let n=new B1u(t,Array.isArray(e)?e:[e],a);n.highlightRange(u.cursor(),t,r,"",n.highlighters),n.flush(r)}class B1u{constructor(e,a,t){this.at=e,this.highlighters=a,this.span=t,this.class=""}startSpan(e,a){a!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=a)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,a,t,r,n){let{type:i,from:o,to:s}=e;if(o>=t||s<=a)return;i.isTop&&(n=this.highlighters.filter(p=>!p.scope||p.scope(i)));let l=r,c=S1u(e)||qh.empty,d=y1u(n,c.tags);if(d&&(l&&(l+=" "),l+=d,c.mode==1&&(r+=(r?" ":"")+d)),this.startSpan(Math.max(a,o),l),c.opaque)return;let E=e.tree&&e.tree.prop(gu.mounted);if(E&&E.overlay){let p=e.node.enter(E.overlay[0].from+o,1),h=this.highlighters.filter(f=>!f.scope||f.scope(E.tree.type)),x=e.firstChild();for(let f=0,D=o;;f++){let g=f<E.overlay.length?E.overlay[f]:null,k=g?g.from+o:s,C=Math.max(a,D),v=Math.min(t,k);if(C<v&&x)for(;e.from<v&&(this.highlightRange(e,C,v,r,n),this.startSpan(Math.min(v,e.to),l),!(e.to>=k||!e.nextSibling())););if(!g||k>t)break;D=g.to+o,D>a&&(this.highlightRange(p.cursor(),Math.max(a,g.from+o),Math.min(t,D),"",h),this.startSpan(Math.min(t,D),l))}x&&e.parent()}else if(e.firstChild()){E&&(r="");do if(!(e.to<=a)){if(e.from>=t)break;this.highlightRange(e,a,t,r,n),this.startSpan(Math.min(t,e.to),l)}while(e.nextSibling());e.parent()}}}function S1u(u){let e=u.type.prop(sq);for(;e&&e.context&&!u.matchContext(e.context);)e=e.next;return e||null}const Re=Xn.define,nm=Re(),Ui=Re(),FO=Re(Ui),yO=Re(Ui),Zi=Re(),im=Re(Zi),G6=Re(Zi),Kr=Re(),ts=Re(Kr),Nr=Re(),$r=Re(),Cb=Re(),s4=Re(Cb),om=Re(),q={comment:nm,lineComment:Re(nm),blockComment:Re(nm),docComment:Re(nm),name:Ui,variableName:Re(Ui),typeName:FO,tagName:Re(FO),propertyName:yO,attributeName:Re(yO),className:Re(Ui),labelName:Re(Ui),namespace:Re(Ui),macroName:Re(Ui),literal:Zi,string:im,docString:Re(im),character:Re(im),attributeValue:Re(im),number:G6,integer:Re(G6),float:Re(G6),bool:Re(Zi),regexp:Re(Zi),escape:Re(Zi),color:Re(Zi),url:Re(Zi),keyword:Nr,self:Re(Nr),null:Re(Nr),atom:Re(Nr),unit:Re(Nr),modifier:Re(Nr),operatorKeyword:Re(Nr),controlKeyword:Re(Nr),definitionKeyword:Re(Nr),moduleKeyword:Re(Nr),operator:$r,derefOperator:Re($r),arithmeticOperator:Re($r),logicOperator:Re($r),bitwiseOperator:Re($r),compareOperator:Re($r),updateOperator:Re($r),definitionOperator:Re($r),typeOperator:Re($r),controlOperator:Re($r),punctuation:Cb,separator:Re(Cb),bracket:s4,angleBracket:Re(s4),squareBracket:Re(s4),paren:Re(s4),brace:Re(s4),content:Kr,heading:ts,heading1:Re(ts),heading2:Re(ts),heading3:Re(ts),heading4:Re(ts),heading5:Re(ts),heading6:Re(ts),contentSeparator:Re(Kr),list:Re(Kr),quote:Re(Kr),emphasis:Re(Kr),strong:Re(Kr),link:Re(Kr),monospace:Re(Kr),strikethrough:Re(Kr),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:om,documentMeta:Re(om),annotation:Re(om),processingInstruction:Re(om),definition:Xn.defineModifier("definition"),constant:Xn.defineModifier("constant"),function:Xn.defineModifier("function"),standard:Xn.defineModifier("standard"),local:Xn.defineModifier("local"),special:Xn.defineModifier("special")};for(let u in q){let e=q[u];e instanceof Xn&&(e.name=u)}lq([{tag:q.link,class:"tok-link"},{tag:q.heading,class:"tok-heading"},{tag:q.emphasis,class:"tok-emphasis"},{tag:q.strong,class:"tok-strong"},{tag:q.keyword,class:"tok-keyword"},{tag:q.atom,class:"tok-atom"},{tag:q.bool,class:"tok-bool"},{tag:q.url,class:"tok-url"},{tag:q.labelName,class:"tok-labelName"},{tag:q.inserted,class:"tok-inserted"},{tag:q.deleted,class:"tok-deleted"},{tag:q.literal,class:"tok-literal"},{tag:q.string,class:"tok-string"},{tag:q.number,class:"tok-number"},{tag:[q.regexp,q.escape,q.special(q.string)],class:"tok-string2"},{tag:q.variableName,class:"tok-variableName"},{tag:q.local(q.variableName),class:"tok-variableName tok-local"},{tag:q.definition(q.variableName),class:"tok-variableName tok-definition"},{tag:q.special(q.variableName),class:"tok-variableName2"},{tag:q.definition(q.propertyName),class:"tok-propertyName tok-definition"},{tag:q.typeName,class:"tok-typeName"},{tag:q.namespace,class:"tok-namespace"},{tag:q.className,class:"tok-className"},{tag:q.macroName,class:"tok-macroName"},{tag:q.propertyName,class:"tok-propertyName"},{tag:q.operator,class:"tok-operator"},{tag:q.comment,class:"tok-comment"},{tag:q.meta,class:"tok-meta"},{tag:q.invalid,class:"tok-invalid"},{tag:q.punctuation,class:"tok-punctuation"}]);const z1u=Js({String:q.string,Number:q.number,"True False":q.bool,PropertyName:q.propertyName,Null:q.null,",":q.separator,"[ ]":q.squareBracket,"{ }":q.brace}),w1u=xi.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[z1u],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let Fb=[],cq=[];(()=>{let u="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,a=0;e<u.length;e++)(e%2?cq:Fb).push(a=a+u[e])})();function O1u(u){if(u<768)return!1;for(let e=0,a=Fb.length;;){let t=e+a>>1;if(u<Fb[t])a=t;else if(u>=cq[t])e=t+1;else return!0;if(e==a)return!1}}function AO(u){return u>=127462&&u<=127487}const BO=8205;function P1u(u,e,a=!0,t=!0){return(a?dq:j1u)(u,e,t)}function dq(u,e,a){if(e==u.length)return e;e&&Eq(u.charCodeAt(e))&&pq(u.charCodeAt(e-1))&&e--;let t=H6(u,e);for(e+=SO(t);e<u.length;){let r=H6(u,e);if(t==BO||r==BO||a&&O1u(r))e+=SO(r),t=r;else if(AO(r)){let n=0,i=e-2;for(;i>=0&&AO(H6(u,i));)n++,i-=2;if(n%2==0)break;e+=2}else break}return e}function j1u(u,e,a){for(;e>0;){let t=dq(u,e-2,a);if(t<e)return t;e--}return 0}function H6(u,e){let a=u.charCodeAt(e);if(!pq(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return Eq(t)?(a-55296<<10)+(t-56320)+65536:a}function Eq(u){return u>=56320&&u<57344}function pq(u){return u>=55296&&u<56320}function SO(u){return u<65536?1:2}class Pu{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,a,t){[e,a]=$1(this,e,a);let r=[];return this.decompose(0,e,r,2),t.length&&t.decompose(0,t.length,r,3),this.decompose(a,this.length,r,1),Zr.from(r,this.length-(a-e)+t.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,a=this.length){[e,a]=$1(this,e,a);let t=[];return this.decompose(e,a,t,0),Zr.from(t,a-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let a=this.scanIdentical(e,1),t=this.length-this.scanIdentical(e,-1),r=new X4(this),n=new X4(e);for(let i=a,o=a;;){if(r.next(i),n.next(i),i=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(o+=r.value.length,r.done||o>=t)return!0}}iter(e=1){return new X4(this,e)}iterRange(e,a=this.length){return new mq(this,e,a)}iterLines(e,a){let t;if(e==null)t=this.iter();else{a==null&&(a=this.lines+1);let r=this.line(e).from;t=this.iterRange(r,Math.max(r,a==this.lines+1?this.length:a<=1?0:this.line(a-1).to))}return new xq(t)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Pu.empty:e.length<=32?new ja(e):Zr.from(ja.split(e,[]))}}class ja extends Pu{constructor(e,a=M1u(e)){super(),this.text=e,this.length=a}get lines(){return this.text.length}get children(){return null}lineInner(e,a,t,r){for(let n=0;;n++){let i=this.text[n],o=r+i.length;if((a?t:o)>=e)return new T1u(r,o,t,i);r=o+1,t++}}decompose(e,a,t,r){let n=e<=0&&a>=this.length?this:new ja(zO(this.text,e,a),Math.min(a,this.length)-Math.max(0,e));if(r&1){let i=t.pop(),o=mx(n.text,i.text.slice(),0,n.length);if(o.length<=32)t.push(new ja(o,i.length+n.length));else{let s=o.length>>1;t.push(new ja(o.slice(0,s)),new ja(o.slice(s)))}}else t.push(n)}replace(e,a,t){if(!(t instanceof ja))return super.replace(e,a,t);[e,a]=$1(this,e,a);let r=mx(this.text,mx(t.text,zO(this.text,0,e)),a),n=this.length+t.length-(a-e);return r.length<=32?new ja(r,n):Zr.from(ja.split(r,[]),n)}sliceString(e,a=this.length,t=`
470
470
  `){[e,a]=$1(this,e,a);let r="";for(let n=0,i=0;n<=a&&i<this.text.length;i++){let o=this.text[i],s=n+o.length;n>e&&i&&(r+=t),e<s&&a>n&&(r+=o.slice(Math.max(0,e-n),a-n)),n=s+1}return r}flatten(e){for(let a of this.text)e.push(a)}scanIdentical(){return 0}static split(e,a){let t=[],r=-1;for(let n of e)t.push(n),r+=n.length+1,t.length==32&&(a.push(new ja(t,r)),t=[],r=-1);return r>-1&&a.push(new ja(t,r)),a}}class Zr extends Pu{constructor(e,a){super(),this.children=e,this.length=a,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,a,t,r){for(let n=0;;n++){let i=this.children[n],o=r+i.length,s=t+i.lines-1;if((a?s:o)>=e)return i.lineInner(e,a,t,r);r=o+1,t=s+1}}decompose(e,a,t,r){for(let n=0,i=0;i<=a&&n<this.children.length;n++){let o=this.children[n],s=i+o.length;if(e<=s&&a>=i){let l=r&((i<=e?1:0)|(s>=a?2:0));i>=e&&s<=a&&!l?t.push(o):o.decompose(e-i,a-i,t,l)}i=s+1}}replace(e,a,t){if([e,a]=$1(this,e,a),t.lines<this.lines)for(let r=0,n=0;r<this.children.length;r++){let i=this.children[r],o=n+i.length;if(e>=n&&a<=o){let s=i.replace(e-n,a-n,t),l=this.lines-i.lines+s.lines;if(s.lines<l>>4&&s.lines>l>>6){let c=this.children.slice();return c[r]=s,new Zr(c,this.length-(a-e)+t.length)}return super.replace(n,o,s)}n=o+1}return super.replace(e,a,t)}sliceString(e,a=this.length,t=`
471
471
  `){[e,a]=$1(this,e,a);let r="";for(let n=0,i=0;n<this.children.length&&i<=a;n++){let o=this.children[n],s=i+o.length;i>e&&n&&(r+=t),e<s&&a>i&&(r+=o.sliceString(e-i,a-i,t)),i=s+1}return r}flatten(e){for(let a of this.children)a.flatten(e)}scanIdentical(e,a){if(!(e instanceof Zr))return 0;let t=0,[r,n,i,o]=a>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=a,n+=a){if(r==i||n==o)return t;let s=this.children[r],l=e.children[n];if(s!=l)return t+s.scanIdentical(l,a);t+=s.length+1}}static from(e,a=e.reduce((t,r)=>t+r.length+1,-1)){let t=0;for(let p of e)t+=p.lines;if(t<32){let p=[];for(let h of e)h.flatten(p);return new ja(p,a)}let r=Math.max(32,t>>5),n=r<<1,i=r>>1,o=[],s=0,l=-1,c=[];function d(p){let h;if(p.lines>n&&p instanceof Zr)for(let x of p.children)d(x);else p.lines>i&&(s>i||!s)?(E(),o.push(p)):p instanceof ja&&s&&(h=c[c.length-1])instanceof ja&&p.lines+h.lines<=32?(s+=p.lines,l+=p.length+1,c[c.length-1]=new ja(h.text.concat(p.text),h.length+1+p.length)):(s+p.lines>r&&E(),s+=p.lines,l+=p.length+1,c.push(p))}function E(){s!=0&&(o.push(c.length==1?c[0]:Zr.from(c,l)),l=-1,s=c.length=0)}for(let p of e)d(p);return E(),o.length==1?o[0]:new Zr(o,a)}}Pu.empty=new ja([""],0);function M1u(u){let e=-1;for(let a of u)e+=a.length+1;return e}function mx(u,e,a=0,t=1e9){for(let r=0,n=0,i=!0;n<u.length&&r<=t;n++){let o=u[n],s=r+o.length;s>=a&&(s>t&&(o=o.slice(0,t-r)),r<a&&(o=o.slice(a-r)),i?(e[e.length-1]+=o,i=!1):e.push(o)),r=s+1}return e}function zO(u,e,a){return mx(u,[""],e,a)}class X4{constructor(e,a=1){this.dir=a,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[a>0?1:(e instanceof ja?e.text.length:e.children.length)<<1]}nextInner(e,a){for(this.done=this.lineBreak=!1;;){let t=this.nodes.length-1,r=this.nodes[t],n=this.offsets[t],i=n>>1,o=r instanceof ja?r.text.length:r.children.length;if(i==(a>0?o:0)){if(t==0)return this.done=!0,this.value="",this;a>0&&this.offsets[t-1]++,this.nodes.pop(),this.offsets.pop()}else if((n&1)==(a>0?0:1)){if(this.offsets[t]+=a,e==0)return this.lineBreak=!0,this.value=`
@@ -515,7 +515,7 @@ html body {
515
515
  `),C+="`"+R5u(k)+"`: "+g),l([C])}return null})},u})();function zv(u){if(u){var e=u.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
516
516
 
517
517
  $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function R5u(u){return u.indexOf("`")!==-1?"`` "+u+" ``":u}var N5u=(function(){var u=function(e,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])},u(e,a)};return function(e,a){u(e,a);function t(){this.constructor=e}e.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}})(),Oa,Zd;if(typeof process=="object")Zd=process.platform==="win32";else if(typeof navigator=="object"){var $5u=navigator.userAgent;Zd=$5u.indexOf("Windows")>=0}var _5u=/^\w[\w\d+.-]*$/,L5u=/^\//,I5u=/^\/\//;function K5u(u,e){if(!u.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+u.authority+'", path: "'+u.path+'", query: "'+u.query+'", fragment: "'+u.fragment+'"}');if(u.scheme&&!_5u.test(u.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(u.path){if(u.authority){if(!L5u.test(u.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(I5u.test(u.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function V5u(u,e){return!u&&!e?"file":u}function G5u(u,e){switch(u){case"https":case"http":case"file":e?e[0]!==xr&&(e=xr+e):e=xr;break}return e}var aa="",xr="/",H5u=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,GC=(function(){function u(e,a,t,r,n,i){i===void 0&&(i=!1),typeof e=="object"?(this.scheme=e.scheme||aa,this.authority=e.authority||aa,this.path=e.path||aa,this.query=e.query||aa,this.fragment=e.fragment||aa):(this.scheme=V5u(e,i),this.authority=a||aa,this.path=G5u(this.scheme,t||aa),this.query=r||aa,this.fragment=n||aa,K5u(this,i))}return u.isUri=function(e){return e instanceof u?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="function"&&typeof e.with=="function"&&typeof e.toString=="function":!1},Object.defineProperty(u.prototype,"fsPath",{get:function(){return JU(this)},enumerable:!0,configurable:!0}),u.prototype.with=function(e){if(!e)return this;var a=e.scheme,t=e.authority,r=e.path,n=e.query,i=e.fragment;return a===void 0?a=this.scheme:a===null&&(a=aa),t===void 0?t=this.authority:t===null&&(t=aa),r===void 0?r=this.path:r===null&&(r=aa),n===void 0?n=this.query:n===null&&(n=aa),i===void 0?i=this.fragment:i===null&&(i=aa),a===this.scheme&&t===this.authority&&r===this.path&&n===this.query&&i===this.fragment?this:new Ol(a,t,r,n,i)},u.parse=function(e,a){a===void 0&&(a=!1);var t=H5u.exec(e);return t?new Ol(t[2]||aa,Sm(t[4]||aa),Sm(t[5]||aa),Sm(t[7]||aa),Sm(t[9]||aa),a):new Ol(aa,aa,aa,aa,aa)},u.file=function(e){var a=aa;if(Zd&&(e=e.replace(/\\/g,xr)),e[0]===xr&&e[1]===xr){var t=e.indexOf(xr,2);t===-1?(a=e.substring(2),e=xr):(a=e.substring(2,t),e=e.substring(t)||xr)}return new Ol("file",a,e,aa,aa)},u.from=function(e){return new Ol(e.scheme,e.authority,e.path,e.query,e.fragment)},u.prototype.toString=function(e){return e===void 0&&(e=!1),HC(this,e)},u.prototype.toJSON=function(){return this},u.revive=function(e){if(e){if(e instanceof u)return e;var a=new Ol(e);return a._formatted=e.external,a._fsPath=e._sep===qU?e.fsPath:null,a}else return e},u})(),qU=Zd?1:void 0,Ol=(function(u){N5u(e,u);function e(){var a=u!==null&&u.apply(this,arguments)||this;return a._formatted=null,a._fsPath=null,a}return Object.defineProperty(e.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=JU(this)),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.toString=function(a){return a===void 0&&(a=!1),a?HC(this,!0):(this._formatted||(this._formatted=HC(this,!1)),this._formatted)},e.prototype.toJSON=function(){var a={$mid:1};return this._fsPath&&(a.fsPath=this._fsPath,a._sep=qU),this._formatted&&(a.external=this._formatted),this.path&&(a.path=this.path),this.scheme&&(a.scheme=this.scheme),this.authority&&(a.authority=this.authority),this.query&&(a.query=this.query),this.fragment&&(a.fragment=this.fragment),a},e})(GC),WU=(Oa={},Oa[58]="%3A",Oa[47]="%2F",Oa[63]="%3F",Oa[35]="%23",Oa[91]="%5B",Oa[93]="%5D",Oa[64]="%40",Oa[33]="%21",Oa[36]="%24",Oa[38]="%26",Oa[39]="%27",Oa[40]="%28",Oa[41]="%29",Oa[42]="%2A",Oa[43]="%2B",Oa[44]="%2C",Oa[59]="%3B",Oa[61]="%3D",Oa[32]="%20",Oa);function _M(u,e){for(var a=void 0,t=-1,r=0;r<u.length;r++){var n=u.charCodeAt(r);if(n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||n===45||n===46||n===95||n===126||e&&n===47)t!==-1&&(a+=encodeURIComponent(u.substring(t,r)),t=-1),a!==void 0&&(a+=u.charAt(r));else{a===void 0&&(a=u.substr(0,r));var i=WU[n];i!==void 0?(t!==-1&&(a+=encodeURIComponent(u.substring(t,r)),t=-1),a+=i):t===-1&&(t=r)}}return t!==-1&&(a+=encodeURIComponent(u.substring(t))),a!==void 0?a:u}function q5u(u){for(var e=void 0,a=0;a<u.length;a++){var t=u.charCodeAt(a);t===35||t===63?(e===void 0&&(e=u.substr(0,a)),e+=WU[t]):e!==void 0&&(e+=u[a])}return e!==void 0?e:u}function JU(u,e){var a;return u.authority&&u.path.length>1&&u.scheme==="file"?a="//"+u.authority+u.path:u.path.charCodeAt(0)===47&&(u.path.charCodeAt(1)>=65&&u.path.charCodeAt(1)<=90||u.path.charCodeAt(1)>=97&&u.path.charCodeAt(1)<=122)&&u.path.charCodeAt(2)===58?a=u.path[1].toLowerCase()+u.path.substr(2):a=u.path,Zd&&(a=a.replace(/\//g,"\\")),a}function HC(u,e){var a=e?q5u:_M,t="",r=u.scheme,n=u.authority,i=u.path,o=u.query,s=u.fragment;if(r&&(t+=r,t+=":"),(n||r==="file")&&(t+=xr,t+=xr),n){var l=n.indexOf("@");if(l!==-1){var c=n.substr(0,l);n=n.substr(l+1),l=c.indexOf(":"),l===-1?t+=a(c,!1):(t+=a(c.substr(0,l),!1),t+=":",t+=a(c.substr(l+1),!1)),t+="@"}n=n.toLowerCase(),l=n.indexOf(":"),l===-1?t+=a(n,!1):(t+=a(n.substr(0,l),!1),t+=n.substr(l))}if(i){if(i.length>=3&&i.charCodeAt(0)===47&&i.charCodeAt(2)===58){var d=i.charCodeAt(1);d>=65&&d<=90&&(i="/"+String.fromCharCode(d+32)+":"+i.substr(3))}else if(i.length>=2&&i.charCodeAt(1)===58){var d=i.charCodeAt(0);d>=65&&d<=90&&(i=String.fromCharCode(d+32)+":"+i.substr(2))}t+=a(i,!0)}return o&&(t+="?",t+=a(o,!1)),s&&(t+="#",t+=e?s:_M(s,!1)),t}function UU(u){try{return decodeURIComponent(u)}catch{return u.length>3?u.substr(0,3)+UU(u.substr(3)):u}}var LM=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Sm(u){return u.match(LM)?u.replace(LM,function(e){return UU(e)}):u}var W5u=(function(){function u(e){try{this.patternRegExp=new RegExp(O5u(e)+"$")}catch{this.patternRegExp=null}this.schemas=[]}return u.prototype.addSchema=function(e){this.schemas.push(e)},u.prototype.matchesPattern=function(e){return this.patternRegExp&&this.patternRegExp.test(e)},u.prototype.getSchemas=function(){return this.schemas},u})(),J5u=(function(){function u(e,a,t){this.service=e,this.url=a,this.dependencies={},t&&(this.unresolvedSchema=this.service.promise.resolve(new o1(t)))}return u.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},u.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(a){return e.service.resolveSchemaContent(a,e.url,e.dependencies)})),this.resolvedSchema},u.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},u})(),o1=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u})(),IM=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u.prototype.getSection=function(e){return X0(this.getSectionRecursive(e,this.schema))},u.prototype.getSectionRecursive=function(e,a){if(!a||typeof a=="boolean"||e.length===0)return a;var t=e.shift();if(a.properties&&typeof a.properties[t])return this.getSectionRecursive(e,a.properties[t]);if(a.patternProperties)for(var r=0,n=Object.keys(a.patternProperties);r<n.length;r++){var i=n[r],o=new RegExp(i);if(o.test(t))return this.getSectionRecursive(e,a.patternProperties[i])}else{if(typeof a.additionalProperties=="object")return this.getSectionRecursive(e,a.additionalProperties);if(t.match("[0-9]+")){if(Array.isArray(a.items)){var s=parseInt(t,10);if(!isNaN(s)&&a.items[s])return this.getSectionRecursive(e,a.items[s])}else if(a.items)return this.getSectionRecursive(e,a.items)}}return null},u})(),U5u=(function(){function u(e,a,t){this.contextService=a,this.requestService=e,this.promiseConstructor=t||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return u.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter(function(a){var t=GC.parse(a).scheme;return t!=="schemaservice"&&(!e||e(t))})},Object.defineProperty(u.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),u.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},u.prototype.onResourceChange=function(e){var a=this,t=!1;e=this.normalizeId(e);for(var r=[e],n=Object.keys(this.schemasById).map(function(l){return a.schemasById[l]});r.length;)for(var i=r.pop(),o=0;o<n.length;o++){var s=n[o];s&&(s.url===i||s.dependencies[i])&&(s.url!==i&&r.push(s.url),s.clearSchema(),n[o]=void 0,t=!0)}return t},u.prototype.normalizeId=function(e){try{return GC.parse(e).toString()}catch{return e}},u.prototype.setSchemaContributions=function(e){if(e.schemas){var a=e.schemas;for(var t in a){var r=this.normalizeId(t);this.contributionSchemas[r]=this.addSchemaHandle(r,a[t])}}if(e.schemaAssociations){var n=e.schemaAssociations;for(var i in n){var o=n[i];this.contributionAssociations[i]=o;for(var s=this.getOrAddFilePatternAssociation(i),l=0,c=o;l<c.length;l++){var d=c[l],t=this.normalizeId(d);s.addSchema(t)}}}},u.prototype.addSchemaHandle=function(e,a){var t=new J5u(this,e,a);return this.schemasById[e]=t,t},u.prototype.getOrAddSchemaHandle=function(e,a){return this.schemasById[e]||this.addSchemaHandle(e,a)},u.prototype.getOrAddFilePatternAssociation=function(e){var a=this.filePatternAssociationById[e];return a||(a=new W5u(e),this.filePatternAssociationById[e]=a,this.filePatternAssociations.push(a)),a},u.prototype.registerExternalSchema=function(e,a,t){a===void 0&&(a=null);var r=this.normalizeId(e);if(this.registeredSchemasIds[r]=!0,a)for(var n=0,i=a;n<i.length;n++){var o=i[n];this.getOrAddFilePatternAssociation(o).addSchema(r)}return t?this.addSchemaHandle(r,t):this.getOrAddSchemaHandle(r)},u.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var e in this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var a in this.contributionAssociations)for(var t=this.getOrAddFilePatternAssociation(a),r=0,n=this.contributionAssociations[a];r<n.length;r++){var i=n[r],e=this.normalizeId(i);t.addSchema(e)}},u.prototype.getResolvedSchema=function(e){var a=this.normalizeId(e),t=this.schemasById[a];return t?t.getResolvedSchema():this.promise.resolve(null)},u.prototype.loadSchema=function(e){if(!this.requestService){var a="Unable to load schema from '"+e+"'. No schema request service available";return this.promise.resolve(new o1({},[a]))}return this.requestService(e).then(function(t){if(!t){var r="Unable to load schema from '"+e+"': No content.";return new o1({},[r])}var n={},i=[];n=p5u(t,i);var o=i.length?["Unable to parse content from '"+e+"': Parse error at offset "+i[0].offset]:[];return new o1(n,o)},function(t){var r="Unable to load schema from '"+e+"': "+t.toString();return new o1({},[r])})},u.prototype.resolveSchemaContent=function(e,a,t){var r=this,n=e.errors.slice(0),i=e.schema;if(i.$schema){var o=this.normalizeId(i.$schema);if(o==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new IM({},["Draft-03 schemas are not supported."]));o==="https://json-schema.org/draft/2019-09/schema"&&e.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var s=this.contextService,l=function(p,h){if(!h)return p;var x=p;return h[0]==="/"&&(h=h.substr(1)),h.split("/").some(function(f){return x=x[f],!x}),x},c=function(p,h,x,f){var D=l(h,f);if(D)for(var g in D)D.hasOwnProperty(g)&&!p.hasOwnProperty(g)&&(p[g]=D[g]);else n.push("$ref '"+f+"' in '"+x+"' can not be resolved.")},d=function(p,h,x,f,D){s&&!/^\w+:\/\/.*/.test(h)&&(h=s.resolveRelativePath(h,f)),h=r.normalizeId(h);var g=r.getOrAddSchemaHandle(h);return g.getUnresolvedSchema().then(function(k){if(D[h]=!0,k.errors.length){var C=x?h+"#"+x:h;n.push("Problems loading reference '"+C+"': "+k.errors[0]+".")}return c(p,k.schema,h,x),E(p,k.schema,h,g.dependencies)})},E=function(p,h,x,f){if(!p||typeof p!="object")return Promise.resolve(null);for(var D=[p],g=[],k=[],C=function(){for(var S=[],P=0;P<arguments.length;P++)S[P]=arguments[P];for(var L=0,N=S;L<N.length;L++){var K=N[L];typeof K=="object"&&D.push(K)}},v=function(){for(var S=[],P=0;P<arguments.length;P++)S[P]=arguments[P];for(var L=0,N=S;L<N.length;L++){var K=N[L];if(typeof K=="object")for(var X in K){var J=K[X];typeof J=="object"&&D.push(J)}}},b=function(){for(var S=[],P=0;P<arguments.length;P++)S[P]=arguments[P];for(var L=0,N=S;L<N.length;L++){var K=N[L];if(Array.isArray(K))for(var X=0,J=K;X<J.length;X++){var ue=J[X];typeof ue=="object"&&D.push(ue)}}},F=function(S){for(var P=[];S.$ref;){var L=S.$ref,N=L.split("#",2);if(delete S.$ref,N[0].length>0){k.push(d(S,N[0],N[1],x,f));return}else P.indexOf(L)===-1&&(c(S,h,x,N[1]),P.push(L))}C(S.items,S.additionalProperties,S.not,S.contains,S.propertyNames,S.if,S.then,S.else),v(S.definitions,S.properties,S.patternProperties,S.dependencies),b(S.anyOf,S.allOf,S.oneOf,S.items)};D.length;){var B=D.pop();g.indexOf(B)>=0||(g.push(B),F(B))}return r.promise.all(k)};return E(i,i,a,t).then(function(p){return new IM(i,n)})},u.prototype.getSchemaForResource=function(e,a){if(a&&a.root&&a.root.type==="object"){var t=a.root.properties.filter(function(h){return h.keyNode.value==="$schema"&&h.valueNode&&h.valueNode.type==="string"});if(t.length>0){var r=mo(t[0].valueNode);if(r&&w5u(r,".")&&this.contextService&&(r=this.contextService.resolveRelativePath(r,e)),r){var n=this.normalizeId(r);return this.getOrAddSchemaHandle(n).getResolvedSchema()}}}for(var i=Object.create(null),o=[],s=0,l=this.filePatternAssociations;s<l.length;s++){var c=l[s];if(c.matchesPattern(e))for(var d=0,E=c.getSchemas();d<E.length;d++){var p=E[d];i[p]||(o.push(p),i[p]=!0)}}return o.length>0?this.createCombinedSchema(e,o).getResolvedSchema():this.promise.resolve(null)},u.prototype.createCombinedSchema=function(e,a){if(a.length===1)return this.getOrAddSchemaHandle(a[0]);var t="schemaservice://combinedSchema/"+encodeURIComponent(e),r={allOf:a.map(function(n){return{$ref:n}})};return this.addSchemaHandle(t,r)},u})();var Z5u=(function(){function u(e,a){this.jsonSchemaService=e,this.promise=a,this.validationEnabled=!0}return u.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:mu.Error)},u.prototype.doValidation=function(e,a,t,r){var n=this;if(!this.validationEnabled)return this.promise.resolve([]);var i=[],o={},s=function(d){var E=d.range.start.line+" "+d.range.start.character+" "+d.message;o[E]||(o[E]=!0,i.push(d))},l=function(d){var E=t?KM(t.trailingCommas):mu.Error,p=t?KM(t.comments):n.commentSeverity;if(d){if(d.errors.length&&a.root){var h=a.root,x=h.type==="object"?h.properties[0]:null;if(x&&x.keyNode.value==="$schema"){var f=x.valueNode||x,D=Nu.create(e.positionAt(f.offset),e.positionAt(f.offset+f.length));s(ci.create(D,d.errors[0],mu.Warning,wu.SchemaResolveError))}else{var D=Nu.create(e.positionAt(h.offset),e.positionAt(h.offset+1));s(ci.create(D,d.errors[0],mu.Warning,wu.SchemaResolveError))}}else{var g=a.validate(e,d.schema);g&&g.forEach(s)}ZU(d.schema)&&(p=void 0),QU(d.schema)&&(E=void 0)}for(var k=0,C=a.syntaxErrors;k<C.length;k++){var v=C[k];if(v.code===wu.TrailingComma){if(typeof E!="number")continue;v.severity=E}s(v)}if(typeof p=="number"){var b="Comments are not permitted in JSON.";a.comments.forEach(function(F){s(ci.create(F,b,p,wu.CommentNotPermitted))})}return i};if(r){var c=r.id||"schemaservice://untitled/"+Q5u++;return this.jsonSchemaService.resolveSchemaContent(new o1(r),c,{}).then(function(d){return l(d)})}return this.jsonSchemaService.getSchemaForResource(e.uri,a).then(function(d){return l(d)})},u})(),Q5u=0;function ZU(u){if(u&&typeof u=="object"){if(rn(u.allowComments))return u.allowComments;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=ZU(t);if(rn(r))return r}}}function QU(u){if(u&&typeof u=="object"){if(rn(u.allowTrailingCommas))return u.allowTrailingCommas;if(rn(u.allowsTrailingCommas))return u.allowsTrailingCommas;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=QU(t);if(rn(r))return r}}}function KM(u){switch(u){case"error":return mu.Error;case"warning":return mu.Warning;case"ignore":return}}var VM=48,Y5u=57,X5u=65,zm=97,eDu=102;function Pa(u){return u<VM?0:u<=Y5u?u-VM:(u<zm&&(u+=zm-X5u),u>=zm&&u<=eDu?u-zm+10:0)}function uDu(u){if(u[0]!=="#")return null;switch(u.length){case 4:return{red:Pa(u.charCodeAt(1))*17/255,green:Pa(u.charCodeAt(2))*17/255,blue:Pa(u.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Pa(u.charCodeAt(1))*17/255,green:Pa(u.charCodeAt(2))*17/255,blue:Pa(u.charCodeAt(3))*17/255,alpha:Pa(u.charCodeAt(4))*17/255};case 7:return{red:(Pa(u.charCodeAt(1))*16+Pa(u.charCodeAt(2)))/255,green:(Pa(u.charCodeAt(3))*16+Pa(u.charCodeAt(4)))/255,blue:(Pa(u.charCodeAt(5))*16+Pa(u.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Pa(u.charCodeAt(1))*16+Pa(u.charCodeAt(2)))/255,green:(Pa(u.charCodeAt(3))*16+Pa(u.charCodeAt(4)))/255,blue:(Pa(u.charCodeAt(5))*16+Pa(u.charCodeAt(6)))/255,alpha:(Pa(u.charCodeAt(7))*16+Pa(u.charCodeAt(8)))/255}}return null}var aDu=(function(){function u(e){this.schemaService=e}return u.prototype.findDocumentSymbols=function(e,a,t){var r=this;t===void 0&&(t={resultLimit:Number.MAX_VALUE});var n=a.root;if(!n)return null;var i=t.resultLimit,o=e.uri;if((o==="vscode://defaultsettings/keybindings.json"||VC(o.toLowerCase(),"/user/keybindings.json"))&&n.type==="array"){for(var s=[],l=0,c=n.items;l<c.length;l++){var d=c[l];if(d.type==="object")for(var E=0,p=d.properties;E<p.length;E++){var h=p[E];if(h.keyNode.value==="key"&&h.valueNode){var x=J1.create(e.uri,Ki(e,d));if(s.push({name:mo(h.valueNode),kind:Hr.Function,location:x}),i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o),s}}}return s}var f=function(g,k,C){return i>=0&&(k.type==="array"?k.items.forEach(function(v){return f(g,v,C)}):k.type==="object"&&k.properties.forEach(function(v){if(i>=0){var b=v.valueNode;if(b){i--;var F=J1.create(e.uri,Ki(e,v)),B=C?C+"."+v.keyNode.value:v.keyNode.value;g.push({name:r.getKeyLabel(v),kind:r.getSymbolKind(b.type),location:F,containerName:C}),f(g,b,B)}}})),g},D=f([],n,void 0);return i<0&&(D.pop(),t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o)),D},u.prototype.findDocumentSymbols2=function(e,a,t){var r=this;t===void 0&&(t={resultLimit:Number.MAX_VALUE});var n=a.root;if(!n)return null;var i=t.resultLimit,o=e.uri;if((o==="vscode://defaultsettings/keybindings.json"||VC(o.toLowerCase(),"/user/keybindings.json"))&&n.type==="array"){for(var s=[],l=0,c=n.items;l<c.length;l++){var d=c[l];if(d.type==="object")for(var E=0,p=d.properties;E<p.length;E++){var h=p[E];if(h.keyNode.value==="key"&&h.valueNode){var x=Ki(e,d),f=Ki(e,h.keyNode);if(s.push({name:mo(h.valueNode),kind:Hr.Function,range:x,selectionRange:f}),i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o),s}}}return s}var D=function(k,C){return i>=0&&(C.type==="array"?C.items.forEach(function(v,b){if(v&&i>=0){i--;var F=Ki(e,v),B=F,S=String(b),P=D([],v);k.push({name:S,kind:r.getSymbolKind(v.type),range:F,selectionRange:B,children:P})}}):C.type==="object"&&C.properties.forEach(function(v){var b=v.valueNode;if(b&&i>=0){i--;var F=Ki(e,v),B=Ki(e,v.keyNode),S=D([],b);k.push({name:r.getKeyLabel(v),kind:r.getSymbolKind(b.type),range:F,selectionRange:B,children:S})}})),k},g=D([],n);return i<0&&(g.pop(),t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o)),g},u.prototype.getSymbolKind=function(e){switch(e){case"object":return Hr.Module;case"string":return Hr.String;case"number":return Hr.Number;case"array":return Hr.Array;case"boolean":return Hr.Boolean;default:return Hr.Variable}},u.prototype.getKeyLabel=function(e){var a=e.keyNode.value;return a&&(a=a.replace(/[\n]/g,"↵")),a&&a.trim()?a:'"'+a+'"'},u.prototype.findDocumentColors=function(e,a,t){return this.schemaService.getSchemaForResource(e.uri,a).then(function(r){var n=[];if(r)for(var i=t&&typeof t.resultLimit=="number"?t.resultLimit:Number.MAX_VALUE,o=a.getMatchingSchemas(r.schema),s={},l=0,c=o;l<c.length;l++){var d=c[l];if(!d.inverted&&d.schema&&(d.schema.format==="color"||d.schema.format==="color-hex")&&d.node&&d.node.type==="string"){var E=String(d.node.offset);if(!s[E]){var p=uDu(mo(d.node));if(p){var h=Ki(e,d.node);n.push({color:p,range:h})}if(s[E]=!0,i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(e.uri),n}}}return n})},u.prototype.getColorPresentations=function(e,a,t,r){var n=[],i=Math.round(t.red*255),o=Math.round(t.green*255),s=Math.round(t.blue*255);function l(d){var E=d.toString(16);return E.length!==2?"0"+E:E}var c;return t.alpha===1?c="#"+l(i)+l(o)+l(s):c="#"+l(i)+l(o)+l(s)+l(Math.round(t.alpha*255)),n.push({label:c,textEdit:ki.replace(r,JSON.stringify(c))}),n},u})();function Ki(u,e){return Nu.create(u.positionAt(e.offset),u.positionAt(e.offset+e.length))}var tDu={schemaAssociations:{},schemas:{}};function rDu(u,e){var a=[],t=[],r=[],n=-1,i=k1(u.getText(),!1),o=i.scan();function s(P){a.push(P),t.push(r.length)}for(;o!==17;){switch(o){case 1:case 3:{var l=u.positionAt(i.getTokenOffset()).line,c={startLine:l,endLine:l,kind:o===1?"object":"array"};r.push(c);break}case 2:case 4:{var d=o===2?"object":"array";if(r.length>0&&r[r.length-1].kind===d){var c=r.pop(),E=u.positionAt(i.getTokenOffset()).line;c&&E>c.startLine+1&&n!==c.startLine&&(c.endLine=E-1,s(c),n=c.startLine)}break}case 13:{var l=u.positionAt(i.getTokenOffset()).line,p=u.positionAt(i.getTokenOffset()+i.getTokenLength()).line;i.getTokenError()===1&&l+1<u.lineCount?i.setPosition(u.offsetAt(Vt.create(l+1,0))):l<p&&(s({startLine:l,endLine:p,kind:id.Comment}),n=l);break}case 12:{var h=u.getText().substr(i.getTokenOffset(),i.getTokenLength()),x=h.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(x){var E=u.positionAt(i.getTokenOffset()).line;if(x[1]){var c={startLine:E,endLine:E,kind:id.Region};r.push(c)}else{for(var f=r.length-1;f>=0&&r[f].kind!==id.Region;)f--;if(f>=0){var c=r[f];r.length=f,E>c.startLine&&n!==c.startLine&&(c.endLine=E,s(c),n=c.startLine)}}}break}}o=i.scan()}var D=e&&e.rangeLimit;if(typeof D!="number"||a.length<=D)return a;e&&e.onRangeLimitExceeded&&e.onRangeLimitExceeded(u.uri);for(var g=[],k=0,C=t;k<C.length;k++){var v=C[k];v<30&&(g[v]=(g[v]||0)+1)}for(var b=0,F=0,f=0;f<g.length;f++){var B=g[f];if(B){if(B+b>D){F=f;break}b+=B}}for(var S=[],f=0;f<a.length;f++){var v=t[f];typeof v=="number"&&(v<F||v===F&&b++<D)&&S.push(a[f])}return S}function nDu(u,e,a){function t(o){for(var s=u.offsetAt(o),l=a.getNodeFromOffset(s,!0),c=[];l;){switch(l.type){case"string":case"object":case"array":var d=l.offset+1,E=l.offset+l.length-1;d<E&&s>=d&&s<=E&&c.push(r(d,E)),c.push(r(l.offset,l.offset+l.length));break;case"number":case"boolean":case"null":case"property":c.push(r(l.offset,l.offset+l.length));break}if(l.type==="property"||l.parent&&l.parent.type==="array"){var p=i(l.offset+l.length,5);p!==-1&&c.push(r(l.offset,p))}l=l.parent}for(var h=void 0,x=c.length-1;x>=0;x--)h=k5.create(c[x],h);return h||(h=k5.create(Nu.create(o,o))),h}function r(o,s){return Nu.create(u.positionAt(o),u.positionAt(s))}var n=k1(u.getText(),!0);function i(o,s){n.setPosition(o);var l=n.scan();return l===s?n.getTokenOffset()+n.getTokenLength():-1}return e.map(t)}function YU(u){var e=u.promiseConstructor||Promise,a=new U5u(u.schemaRequestService,u.workspaceContext,e);a.setSchemaContributions(tDu);var t=new M5u(a,u.contributions,e,u.clientCapabilities),r=new T5u(a,u.contributions,e),n=new aDu(a),i=new Z5u(a,e);return{configure:function(o){a.clearExternalSchemas(),o.schemas&&o.schemas.forEach(function(s){a.registerExternalSchema(s.uri,s.fileMatch,s.schema)}),i.configure(o)},resetSchema:function(o){return a.onResourceChange(o)},doValidation:i.doValidation.bind(i),parseJSONDocument:function(o){return z5u(o,{collectComments:!0})},newJSONDocument:function(o,s){return S5u(o,s)},doComplete:t.doComplete.bind(t),findDocumentSymbols:n.findDocumentSymbols.bind(n),findDocumentSymbols2:n.findDocumentSymbols2.bind(n),findColorSymbols:function(o,s){return n.findDocumentColors(o,s).then(function(l){return l.map(function(c){return c.range})})},findDocumentColors:n.findDocumentColors.bind(n),getColorPresentations:n.getColorPresentations.bind(n),doHover:r.doHover.bind(r),getFoldingRanges:rDu,getSelectionRanges:nDu,format:function(o,s,l){var c=void 0;if(s){var d=o.offsetAt(s.start),E=o.offsetAt(s.end)-d;c={offset:d,length:E}}var p={tabSize:l?l.tabSize:4,insertSpaces:l?l.insertSpaces:!0,eol:`
518
- `};return D5u(o.getText(),c,p).map(function(h){return ki.replace(Nu.create(o.positionAt(h.offset),o.positionAt(h.offset+h.length)),h.content)})}}}function Xs(){const{tabsState:u}=Bu(),e=_.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>u.tabs.findIndex(l=>{const c=l.data.get();return _a(c,r)?(!n||c.collectionId===n)&&(!i||c.workflowId===i)&&(!o||c.stepId===o)&&(!s||c.historyId===s):!1}),[u]),a=_.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>{const l=e({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s});return l!==-1?u.tabs[l]:void 0},[e,u]),t=_.useCallback((r,n)=>{if(!(!r.collectionId||!n.collectionId||r.collectionId!==n.collectionId)&&!(!r.workflowId||!n.workflowId)){if(r.workflowId!==n.workflowId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&((_a(o,We.Workflow)||_a(o,We.WorkflowRun))&&o.workflowId===r.workflowId&&i.data.workflowId.set(n.workflowId),_a(o,We.Step)&&o.workflowId===r.workflowId&&i.data.workflowId.set(n.workflowId))});return}if(!(!r.stepId||!n.stepId)&&r.stepId!==n.stepId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&_a(o,We.Step)&&o.workflowId===r.workflowId&&o.stepId===r.stepId&&i.data.stepId.set(n.stepId)});return}}},[u]);return{tabs:u.tabs,activeTabIdx:u.activeTabIdx,getExistingTabIndex:e,getExistingTab:a,handleIdChange:t}}function _a(u,e){return u.type===e}const rf=YU({});let GM=null;function XU(u){GM!==u&&(GM=u,rf.configure({validate:!0,schemas:[{uri:"stub://test",fileMatch:["*"],schema:u}]}))}function eZ(u){const e=b5.create("stub.json","json",0,u),a=rf.parseJSONDocument(e);return{textDoc:e,jsonDoc:a}}const uZ=Ja.define({create(){},update(u){return u}}),aZ=u=>u.field(uZ,!1),iDu=({store:u,isResponse:e,apiOperation:a})=>{const r=pA(u).data.get();let n=a?.body?.mediaTypes?.[z0.JSON]?.schema;if(_a(r,We.Step)&&e){const i=r.response?.status;i&&(n=a?.responses?.[i]?.mediaTypes?.[z0.JSON]?.schema)}return[uZ.init(()=>({schema:ii(n||{}),store:u}))]};function oDu(){return async u=>{const{schema:e}=aZ(u.state)||{};if(!e)return[];XU(e);const a=u.state.doc,{textDoc:t,jsonDoc:r}=eZ(a.toString());return(await rf.doValidation(t,r))?.map(i=>({from:qC(a,i.range.start),to:qC(a,i.range.end),message:i.message,severity:cDu[i.severity||3]}))}}const sDu=fn.highest(xc.of([{key:"Tab",run:u=>vJ(u)}]));function lDu(){return async function(e){const a={from:e.pos,to:e.pos,options:[],filter:!1},{schema:t}=aZ(e.state)||{};if(!t)return a;XU(t);const r=e.state.doc,n=qC.bind(null,r),{textDoc:i,jsonDoc:o}=eZ(r.toString()),s=e.state.doc.lineAt(e.pos),l=s.number-1,c=e.pos-s.from,d=await rf.doComplete(i,{line:l,character:c},o);if(!d)return a;const E=e.state.sliceDoc(s.from,e.pos);if(E.trim().endsWith(",")||dDu(E))return a;a.options=d.items.map(x=>({label:x.label,info:x.documentation,apply:f=>{if(!x.textEdit||!("range"in x.textEdit))return;const D=x.textEdit.range,g=x.textEdit.newText.search(/(\$1|\${1:.*?})/);let k=x.textEdit.newText.replace(/(\$1|\${1:.*?})/,"");const C=g===-1?0:g-k.length;f.dispatch({changes:{from:n(D.start),to:n(D.end),insert:k}});const v=k.length-(D.end.character-D.start.character);f.dispatch({selection:Se.single(n(D.end)+v+C)})}}))||[];const p=e.state.wordAt(e.pos),h=p?.from?e.state.sliceDoc(p?.from,p?.to).toLowerCase():"";return h&&(a.options=a.options.filter(x=>x.label.toLowerCase().replace(/^"/,"").startsWith(h))),a}}const cDu={1:"error",2:"warning",3:"info",4:"hint"};function qC(u,e){return u.line(e.line+1).from+e.character}function dDu(u){try{return JSON.parse(`{${u}}`),!0}catch{return!1}}const tZ=iu.define();function kc(u){const e=u.activeEnvironmentId.get();return u.environments.find(a=>a.name.get()===e)?.get()||u.environments[0].get()}const WC=u=>ba.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const r=kc(a.store)?.inputs,n=[],i=Ke.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),o=s=>Ke.mark({attributes:{style:`color: var(--replay-${s?"undefined":"defined"}-variable-color); background-color: var(--replay-${s?"undefined":"defined"}-variable-bg-color);`}});for(const{from:s,to:l}of e.visibleRanges){const c=e.state.doc.sliceString(s,l),d=OD(c);for(const E of d){const p=s+E.start,h=s+E.end;if(!(p>=h))if(E.prefix==="inputs"){const x=zy(E.match),D=!r?.find(g=>g.name===x)?.value;n.push({from:p,to:h,value:o(D)})}else n.push({from:p,to:h,value:i})}}return Ke.set(n,!0)}},{decorations:e=>e.decorations}),EDu=YU({});function pDu(u){if(!u||typeof u!="object")return!1;const e=u;return typeof e.type=="string"&&typeof e.offset=="number"&&typeof e.length=="number"}function mDu(u){const e=[];if(!u)return e;const a=[u];for(;a.length>0;){const t=a.pop();if(t.type==="property"){t.valueNode&&a.push(t.valueNode);continue}if(t.type==="string"){const r=t.offset,n=t.offset+t.length;n>r&&e.push({from:r,to:n})}if(t.children&&t.children.length)for(const r of t.children)a.push(r)}return e}const xDu=u=>ba.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const t=e.state.doc.toString();let r;try{const d=b5.create("inmemory://model.json","json",0,t),p=EDu.parseJSONDocument(d)?.root;r=pDu(p)?p:void 0}catch{r=void 0}const i=kc(a.store)?.inputs,o=Ke.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),s=d=>Ke.mark({attributes:{style:`color: var(--replay-${d?"undefined":"defined"}-variable-color); background-color: var(--replay-${d?"undefined":"defined"}-variable-bg-color);`}}),l=[];if(!r)return Ke.set([],!0);const c=mDu(r);for(const d of c){if(!e.visibleRanges.some(D=>Math.max(D.from,d.from)<Math.min(D.to,d.to))||!(t[d.from]==='"'&&t[d.to-1]==='"'))continue;const p=d.from+1,h=d.to-1;if(h<=p)continue;const x=e.state.doc.sliceString(p,h),f=OD(x);for(const D of f){const g=p+D.start,k=p+D.end;if(!(g>=k))if(D.prefix==="inputs"){const C=zy(D.match),b=!i?.find(F=>F.name===C)?.value;l.push({from:g,to:k,value:s(b)})}else l.push({from:g,to:k,value:o})}}return Ke.set(l,!0)}},{decorations:e=>e.decorations}),En={[z0.Text]:{name:"Text",extensions:[Me.lineWrapping],stateExtensions:[WC]},[z0.JSON]:{name:"JSON",extensions:[gEu(),Umu(oDu(),{delay:0,needsRefresh:u=>u.transactions.some(e=>e.effects.some(a=>a.is(tZ)))}),YW.data.of({autocomplete:lDu()}),sDu],stateExtensions:[iDu,xDu]},[z0.XML]:{name:"XML",extensions:[Nmu()],stateExtensions:[WC]}},hDu={[z0.Image]:{name:"Image",extensions:[],stateExtensions:[]}},DDu={[z0.HTML]:{name:"HTML",extensions:[pmu()],stateExtensions:[WC]}},ro={...En,...hDu,...DDu},rZ={[z0.FormData]:{name:"form-data",extensions:void 0},[z0["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},nZ={[z0.Binary]:{name:"Binary",extensions:void 0}},_s={...En,...rZ,...nZ},fDu=Object.keys(En),M2=Object.keys(rZ),iZ=Object.keys(nZ);function oZ(u=[],e){const a={};return u.forEach(t=>{const r=String(t[e]);a[r]||(a[r]=[]),a[r].push(t)}),a}const PE={active:!0,key:"",value:""};function no(u,e){return[...u.map(t=>({id:crypto.randomUUID(),key:t.name,value:e.initializeWithInputs?`$inputs.${t.name}`:t.example?String(t.example):"",active:e.initializeWithInputs?!0:!!t.example,in:t.in})),ya(e.in)]}function jE(u,e){const[a]=u.split("?"),t=e.slice(0,-1).filter(r=>r.active).map(r=>`${r.key}=${r.value}`).join("&");return`${a}${t?`?${t}`:""}`}function Jt(){return{id:crypto.randomUUID(),...PE}}function st(){return{id:crypto.randomUUID(),...PE,description:""}}function ya(u){return{...PE,id:crypto.randomUUID(),in:u}}function ys(){return{id:crypto.randomUUID(),...PE,type:"text",files:null}}function T2(){return{id:crypto.randomUUID(),...PE,sendIn:S0.URL}}function wv(u){return u.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function nf(u,e){return u.filter(a=>a.active&&a.value).map(({value:a})=>(e?Zu(a,e):a).trim())}function xo(u,e){const t=e.filter(r=>!!r).flatMap(r=>r).filter(r=>r.key&&r.active);return["path","header"].includes(u)?Array.from(new Map(t.map(r=>[r.key,r])).values()):t}function sZ(u,e){return u.map(({value:a,...t})=>({...t,value:Zu(a,e)}))}function gDu(u,e){if(!u.startsWith("$components.parameters."))return null;const a=u.replace("$components.parameters.","");return a&&e[a]||null}function Aa(u=[],e={}){const a=[];for(const t of u)if(oo(t)){const r=gDu(t.reference,e);r&&a.push({...r,active:t.active,value:t.value||r.value})}else a.push(t);return a}function Qi(u){return Object.entries(u).map(([e,a])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:a}))}function vDu(u){return u.replace(/{/g,"{{").replace(/}/g,"}}")}const HM={documentedOAuth2Types:[],grantType:Ce.ClientCredentials,authRequestExtraParams:[Jt()],tokenRequestExtraParams:[T2()],[Ce.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[st()],accessToken:""},[Ce.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[st()],accessToken:""},[Ce.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[st()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ce.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[st()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ce.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[st()],accessToken:""},[Ce.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[st()]}},kDu={securityType:ke.NoAuth,securitySchemeId:null,[ke.BasicAuth]:{username:"",password:""},[ke.JWT]:{token:""},[ke.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[ke.APIKey]:{location:St.Header,name:"",key:""},[ke.OAuth2]:HM,[ke.OpenIDConnect]:{...HM,openIdConnectUrl:"",userInfoUrl:""}},JC="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",bDu={[y0.SIMPLE]:{condition:"",type:y0.SIMPLE},[y0.REGEX]:{condition:"",type:y0.REGEX,context:""},[y0.JSONPATH]:{condition:"",type:y0.JSONPATH,context:""},[y0.XPATH]:{condition:"",type:y0.XPATH,context:""}};function C5(){return structuredClone({type:Ya.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[ys()],"application/x-www-form-urlencoded":[ys()]},binary:null})}const CDu={method:"GET",url:"",security:[bn()],body:C5(),queryParameters:[Jt()],headers:[Jt()],cookies:[Jt()],pathParameters:[Jt()]};function lZ(){return structuredClone(CDu)}function bn(){return ii(kDu)}function FDu(u){return ii({id:crypto.randomUUID(),...bDu[u]})}function cZ(u,e,a){for(const t of a){const r=qM(u,t),n=qM(e,t);if(typeof r=="object"&&typeof n=="object"){if(!cZ(r,n,a))return!1}else if(r!==n)return!1}return!0}function qM(u,e){const a=e.split("/");let t=u;for(const r of a)if(t&&typeof t=="object"&&r in t)t=t[r];else return;return t}function yDu(u,e){return u.length===e.length&&u.sort().join()===e.sort().join()}function ADu(u,e){return u.every(a=>e.includes(a))}function BDu(u){switch(u){case"query":return St.Query;case"cookie":return St.Cookie;case"header":return St.Header;default:return}}function SDu(u,e,a){const{security:t}=e,r=fnu(u);if(!a)return!1;const n=R2(a),i=n.map(c=>c.securityType),o=t.map(c=>c.securityType);if(!yDu(i,o))return!0;let l=[];return t.forEach(c=>{const d=c.securityType,E=c[ke.OAuth2]?.grantType,p=i.includes(d),h=n.find(g=>g.securityType===d),x=!h||cZ(c,h,wDu(d,E)),f=zDu(c,d,c[ke.OAuth2]?.grantType,r),D=!!(p&&h&&x&&f);l.push(!a.security?.length||D)}),l.includes(!1)}function zDu(u,e,a,t){if(e===ke.OAuth2&&(a===Ce.AuthorizationCode||a===Ce.AuthorizationCodeWithPkce||a===Ce.Implicit)){const r=u[ke.OAuth2][a]?.availableScopes,n=nf(u[ke.OAuth2][a]?.scopes,t);return ADu(n,r)}return!0}function wDu(u,e){return u===ke.APIKey?[`${ke.APIKey}/name`,`${ke.APIKey}/location`]:u===ke.OAuth2?[`${ke.OAuth2}/grantType`,...ODu(e)]:u===ke.OpenIDConnect?[`${ke.OpenIDConnect}/openIdConnectUrl`]:[]}function ODu(u){return u===Ce.ClientCredentials?[`${ke.OAuth2}/${Ce.ClientCredentials}/tokenUrl`]:u===Ce.Password?[`${ke.OAuth2}/${Ce.Password}/tokenUrl`]:u===Ce.Implicit?[`${ke.OAuth2}/${Ce.Implicit}/authorizationUrl`]:u===Ce.AuthorizationCode?[`${ke.OAuth2}/${Ce.AuthorizationCode}/tokenUrl`,`${ke.OAuth2}/${Ce.AuthorizationCode}/authorizationUrl`]:u===Ce.AuthorizationCodeWithPkce?[`${ke.OAuth2}/${Ce.AuthorizationCodeWithPkce}/tokenUrl`,`${ke.OAuth2}/${Ce.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function PDu(u){return u.map(e=>{const a=e.map(t=>t.id).join("_");return e.map(t=>({...t,schemeId:a}))})}function jDu(u){const e=u.security||[],a=e.map(t=>{let r="";const n=[];return t.forEach((i,o)=>{r=o===0?`${i.id}`:`${r}_${i.id}`,n.push(N2(i))}),{id:r,security:n}});return e.length?a:[]}function MDu(u,e){const a=u.security||[];return a?.length?pZ(a).map((t,r)=>N2(t)):[]}function R2(u){const a=(u.security||[])[0];return a?a.map(t=>N2(t)):[bn()]}function N2(u,e){const a={...bn(),securitySchemeId:u.id},t=of(u);a.securityType=t;const r=u.id;if(u.id&&t!==ke.NoAuth&&(a[t].schemeName=u.id),t===ke.BasicAuth&&(a[ke.BasicAuth].username||(a[ke.BasicAuth].username=ga(r+H.SecurityVariablesEnvSuffix.Username)),a[ke.BasicAuth].password||(a[ke.BasicAuth].password=ga(r+H.SecurityVariablesEnvSuffix.Password))),t===ke.DigestAuth&&(a[ke.DigestAuth].username||(a[ke.DigestAuth].username=ga(r+H.SecurityVariablesEnvSuffix.Username)),a[ke.DigestAuth].password||(a[ke.DigestAuth].password=ga(r+H.SecurityVariablesEnvSuffix.Password))),t===ke.JWT&&!a[ke.JWT].token&&(a[ke.JWT].token=ga(r+H.SecurityVariablesEnvSuffix.JWTToken)),t===ke.APIKey&&!a[ke.APIKey].key){a[ke.APIKey].name=u.name||"",a[ke.APIKey].key=ga(r+H.SecurityVariablesEnvSuffix.APIKey);const n=BDu(u.in);n&&(a[ke.APIKey].location=n)}if(t===ke.OAuth2){const n=_2(u),i=ga(r+H.SecurityVariablesEnvSuffix.Token),o=a[ke.OAuth2];o.grantType=n[0],n.forEach(s=>{s===Ce.AuthorizationCode&&!o[Ce.AuthorizationCode].accessToken&&(o[Ce.AuthorizationCode].accessToken=i,o[Ce.AuthorizationCode].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.AuthorizationCode].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Ce.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Ce.AuthorizationCode].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.AuthorizationCode].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Ce.AuthorizationCode].scopes=[...Qi(u.flows?.authorizationCode?.scopes||{})||[],st()]),s===Ce.AuthorizationCodeWithPkce&&!o[Ce.AuthorizationCodeWithPkce].accessToken&&(o[Ce.AuthorizationCodeWithPkce].accessToken=i,o[Ce.AuthorizationCodeWithPkce].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.AuthorizationCodeWithPkce].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Ce.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Ce.AuthorizationCodeWithPkce].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.AuthorizationCodeWithPkce].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Ce.AuthorizationCodeWithPkce].scopes=[...Qi(u.flows?.authorizationCode?.scopes||{}),st()]),s===Ce.ClientCredentials&&!o[Ce.ClientCredentials].accessToken&&(o[Ce.ClientCredentials].accessToken=i,o[Ce.ClientCredentials].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.ClientCredentials].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.ClientCredentials].tokenUrl=u.flows?.clientCredentials?.tokenUrl||"",o[Ce.ClientCredentials].scopes=[...Qi(u.flows?.clientCredentials?.scopes||{}),st()]),s===Ce.ClientCredentialsWithJwtAssertion&&!o[Ce.ClientCredentialsWithJwtAssertion].accessToken&&(o[Ce.ClientCredentialsWithJwtAssertion].accessToken=i,o[Ce.ClientCredentialsWithJwtAssertion].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.ClientCredentialsWithJwtAssertion].clientAssertion=ga(r+H.SecurityVariablesEnvSuffix.ClientAssertion),o[Ce.ClientCredentialsWithJwtAssertion].scopes=[...Qi(u.flows?.clientCredentials?.scopes||{}),st()]),s===Ce.Implicit&&!o[Ce.Implicit].accessToken&&(o[Ce.Implicit].accessToken=i,o[Ce.Implicit].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.Implicit].authorizationUrl=u.flows?.implicit?.authorizationUrl||"",o[Ce.Implicit].availableScopes=Object.keys(u.flows?.implicit?.scopes||{})||[],o[Ce.Implicit].scopes=[...Qi(u.flows?.implicit?.scopes||{}),st()]),s===Ce.Password&&!o[Ce.Password].accessToken&&(o[Ce.Password].accessToken=i,o[Ce.Password].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.Password].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.Password].tokenUrl=u.flows?.password?.tokenUrl||"",o[Ce.Password].scopes=[...Qi(u.flows?.password?.scopes||{}),st()])})}if(t===ke.OpenIDConnect){const n=ga(r+H.SecurityVariablesEnvSuffix.Token),i=a[ke.OpenIDConnect];i[Ce.AuthorizationCode].accessToken||(i[Ce.AuthorizationCode].accessToken=n,i[Ce.AuthorizationCode].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),i[Ce.AuthorizationCode].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),i[Ce.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Ce.AuthorizationCodeWithPkce].accessToken||(i[Ce.AuthorizationCodeWithPkce].accessToken=n,i[Ce.AuthorizationCodeWithPkce].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),i[Ce.AuthorizationCodeWithPkce].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),i[Ce.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Ce.Implicit].accessToken||(i[Ce.Implicit].accessToken=n,i[Ce.Implicit].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId))}return a}function TDu(u,e=!1,a="",t){const r=oZ(u.parameters,"in"),n=dZ(u),i=R2(u),o=no(r.query||[],{in:"query"});return{id:crypto.randomUUID(),name:u.name,operationId:u.operationId,collectionPath:t,apiPath:{path:u.path,method:u.method},apiId:a,isAdditionalOperation:e,request:{pathParameters:no(r.path||[],{in:"path"}),method:u.method.toLocaleUpperCase(),url:jE(vDu(u.path),o),headers:no(r.header||[],{in:"header"}),queryParameters:o,cookies:no(r.cookie||[],{in:"cookie"}),body:n,security:i},response:null}}function $2(u){const e=oZ(u.parameters,"in"),a=dZ(u),t=R2(u);return{parameters:{queryParameters:no(e.query||[],{in:"query"}),headers:no(e.header||[],{in:"header"}),cookies:no(e.cookie||[],{in:"cookie"}),pathParameters:no(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:t}}function dZ(u){const e=u.body?.mediaTypes;if(!e||!Object.keys(e).length)return C5();const a=RDu(e,u),t=a?.name||"",r=!M2.includes(t)&&!iZ.includes(t),n=UC(a),i=r&&n.length?JSON.stringify(n.find(({key:o})=>o===u.body?.activeExampleName)?.value,null,2)||JSON.stringify(n[0].value,null,2):"";return{...C5(),activeExampleName:u.body?.activeExampleName||n[0]?.key||"",...a&&{type:a.name},content:i,formData:{"multipart/form-data":WM(e[z0.FormData]),"application/x-www-form-urlencoded":WM(e[z0["application/x-www-form-urlencoded"]])}}}function EZ(u){return u?{...(Object.keys(u?.body?.mediaTypes||{})||[]).reduce((a,t)=>(a[t]={name:t,extensions:void 0},a),{}),..._s}:_s}function WM(u){if(!u)return[ys()];if(!u.parameters)return[ys()];const e=u.parameters.map(a=>({id:crypto.randomUUID(),key:a.name,value:String(a.example)||"",active:!0,type:a.inputType,files:null}));return e.push(ys()),e}function UC(u){const e=u?.examples;return Object.keys(e||{}).map(a=>{const t=e?.[a];return{name:H.isString(t?.summary)?t?.summary:t?.summary?.raw||a,key:a,value:e?.[a].value}})}function RDu(u,e){const a=EZ(e),t=Object.keys(u).find(r=>!!a[r]);return t?u[t]:null}function NDu(u){return!u?.security?.length||!u?[]:MDu(u)}function pZ(u){const e=new Set;return u.flat().filter(a=>e.has(a.id)?!1:(e.add(a.id),!0))}function of(u){if(u.type==="http"){if(u.scheme==="bearer")return ke.JWT;if(u.scheme==="basic")return ke.BasicAuth;if(u.scheme==="digest")return ke.DigestAuth}else{if(u.type==="apiKey")return ke.APIKey;if(u.type==="oauth2")return ke.OAuth2;if(u.type==="openIdConnect")return ke.OpenIDConnect}return ke.NoAuth}function $Du(u,e){if(u==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===JC)return Ce.ClientCredentialsWithJwtAssertion;if(u==="authorizationCode"&&e&&"x-usePkce"in e&&e["x-usePkce"])return Ce.AuthorizationCodeWithPkce;switch(u){case"implicit":return Ce.Implicit;case"password":return Ce.Password;case"clientCredentials":return Ce.ClientCredentials;case"authorizationCode":return Ce.AuthorizationCode;default:return Ce.AuthorizationCode}}function _Du(u,e){const a=u?.security;if(!a?.length)return[];const n=PDu(a).flat().filter(i=>i.schemeId===e).find(i=>of(i)===ke.OAuth2);return _2(n)}function _2(u){return Object.entries(u?.flows||{}).map(([e,a])=>$Du(e,a)).filter(Boolean)}async function ME(u){try{const e=await Klu(u),a=await ZH(u);return{absolutePath:u,file:new File([e],a)}}catch(e){return console.error("Failed to init replay file",e),null}}async function mZ(u){return(await Promise.allSettled(u.map(a=>ME(a)))).map(a=>a.status==="fulfilled"?a.value:null).filter(a=>a!==null)}async function LDu(u,e,a,t,r,n){const i=await Promise.all(u.sourceDescriptions.map(async s=>({name:s.name,url:s.url,type:s.type,apiId:await IDu({projectPath:t,apiUrl:s.url,collectionId:e})}))),o={inputs:u.components?.inputs||{},parameters:Object.fromEntries(Object.entries(u.components?.parameters||{}).map(([s,l])=>[s,{...l,key:l.name,value:l.value,id:crypto.randomUUID(),active:!0}]))};return{...u,id:e,srcType:a,state:Ru.Normal,sourceDescriptions:i,components:o,workflows:await Promise.all(u.workflows.map(async s=>({...s,state:Ru.Normal,parameters:aT(s.parameters,s["x-replay-disabled-parameters"],u.components?.parameters),outputs:eT(s.outputs),security:QM(s["x-security"]),steps:await Promise.all(s.steps.map(async l=>{const c=aT(l.parameters,l["x-replay-disabled-parameters"],u.components?.parameters),d=l["x-operation"]??null;d&&(d.url=jE(d.url,c.queryParameters.filter(U$)));const E=KDu(l,i,r);let p;if(E&&n){const x=r?.find(f=>f.id===E.apiId);p=n(E.path,E.method,x)}delete l.operationId,delete l["x-operation"];const h=await JDu(l.requestBody,t);return{...l,state:Ru.Normal,parameters:c,outputs:eT(l.outputs),successCriteria:l.successCriteria?.map(x=>({...x,type:x.type??y0.SIMPLE}))||[],requestBody:h,xOperation:d,security:QM(l["x-security"],p),operation:E}}))})))}}async function IDu({projectPath:u,apiUrl:e,collectionId:a}){if(Iy(e))return e;if(await da.isAbsolute(e))return await da.relative(u,e);const t=await da.resolve(await da.join(u,a,"..",e));return await da.relative(u,t)}function KDu(u,e,a){if(u["x-operation"])return null;const{path:t,method:r,apiId:n,isAdditionalOperation:i}=xZ({operationPath:u.operationPath,parsedSourceDescriptions:e}),{operationId:o,apiId:s}=VDu({operationId:u.operationId,parsedSourceDescriptions:e}),l=s||n||e[0]?.apiId||"",c=a?.find(d=>d.id===l);if(o&&c&&!t&&!r){const d=ZDu(o,c);return{apiId:l,path:d?.path??"",method:d?.method??"",operationId:o,isAdditionalOperation:d?.isAdditionalOperation??!1}}return{apiId:l,path:t??"",method:r??"",operationId:o,isAdditionalOperation:i}}function VDu({operationId:u,parsedSourceDescriptions:e}){if(!u)return{operationId:"",apiId:null};const a=u.split(".");if(a.length===1)return{operationId:u,apiId:e[0]?.apiId??""};const[,t,r=""]=a,n=e.find(({name:i})=>i===t);return{operationId:r,apiId:n?.apiId??""}}function JM(u){return"reference"in u&&typeof u.reference=="string"}function xZ({operationPath:u,parsedSourceDescriptions:e}){if(!u)return{apiId:null,path:"",method:"",isAdditionalOperation:!1};try{const a=u.split("#"),t=a.length>1?a[1]:a[0],r=a.length>1?a[0]:"";if(!t)return{path:"",method:"",apiId:null,isAdditionalOperation:!1};let n=null,i=null;const o=/\$sourceDescriptions\.(.+)\.url/,s=r.match(o);if(s&&(n=s[1]),n){const p=e.find(({name:h})=>h===n);p&&(i=p.apiId)}const l=t.split("/"),c=l.pop()||"",d=l[l.length-1]==="additionalOperations";return d&&l.pop(),{path:Cd.unescape(l.pop()||""),method:c.toLowerCase(),apiId:i,isAdditionalOperation:d}}catch{return{path:"",method:"",apiId:null,isAdditionalOperation:!1}}}function GDu(u){switch(u.type){case"apiKey":return ke.APIKey;case"oauth2":return ke.OAuth2;case"openIdConnect":return ke.OpenIDConnect;case"http":return u.scheme==="basic"?ke.BasicAuth:u.scheme==="digest"?ke.DigestAuth:u.scheme==="bearer"?ke.JWT:ke.NoAuth;default:return ke.NoAuth}}function hZ(u,e){const a={clientCredentials:Ce.ClientCredentials,authorizationCode:Ce.AuthorizationCode,implicit:Ce.Implicit,password:Ce.Password,clientCredentialsWithJwtAssertion:Ce.ClientCredentialsWithJwtAssertion,authorizationCodeWithPkce:Ce.AuthorizationCodeWithPkce};return u==="clientCredentials"&&e["x-assertionType"]==="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"?Ce.ClientCredentialsWithJwtAssertion:u==="authorizationCode"&&e["x-usePkce"]?Ce.AuthorizationCodeWithPkce:a[u]??null}function HDu(u){return{query:St.Query,header:St.Header,cookie:St.Cookie}[u.toLowerCase()]||St.Header}function qDu(u){return{body:S0.Body,header:S0.Header,url:S0.URL}[u.toLowerCase()]||S0.URL}function UM(u,e,a){return Object.keys(u).reduce((t,r)=>{const n=hZ(r,u[r]);if(!n)return t;switch(n){case Ce.ClientCredentials:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Ce.AuthorizationCode:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:u[r].availableScopes??[],scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Ce.Implicit:t[n]={...a[n],clientId:e.clientId??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:rs(u[r].availableScopes),scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Ce.Password:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",username:e.username??"",password:e.password??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Ce.ClientCredentialsWithJwtAssertion:t[n]={...a[n],clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Ce.AuthorizationCodeWithPkce:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:rs(u[r].availableScopes),scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),codeVerifier:e.codeVerifier??"",codeChallenge:e.codeChallenge??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break}return t},a)}function ZM(u,e,a){const r={...bn(),securityType:u},n=Object.keys(e.flows||{})[0],i=hZ(n,e.flows?.[n])??Ce.ClientCredentials;switch(u){case ke.BasicAuth:return{...r,[ke.BasicAuth]:{username:a.username,password:a.password,schemeName:e.id}};case ke.JWT:return{...r,[ke.JWT]:{token:a.token,schemeName:e.id}};case ke.DigestAuth:return{...r,[ke.DigestAuth]:{...r[ke.DigestAuth],username:a.username,password:a.password,schemeName:e.id}};case ke.APIKey:return{...r,[ke.APIKey]:{location:HDu(e.in),name:e.name,key:a.apiKey,schemeName:e.id}};case ke.OAuth2:return{...r,[ke.OAuth2]:{...r[ke.OAuth2],...UM(e.flows||{},a||{},r[ke.OAuth2]),authRequestExtraParams:YM(a.authRequestExtraParams),tokenRequestExtraParams:XM(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};case ke.OpenIDConnect:return{...r,[ke.OpenIDConnect]:{...r[ke.OpenIDConnect],...UM(a.flows||{},a||{},r[ke.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:YM(a.authRequestExtraParams),tokenRequestExtraParams:XM(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};default:return r}}function WDu(u,e){return[...u.map(t=>{if("scheme"in t){const n=GDu(t.scheme);return ZM(n,t.scheme,t.values)}const r=e.find(n=>n.id===t.schemeName);if(r){const n=of(r),i=ZM(n,r,t.values);return i.securitySchemeId=r.id,i}return bn()})]}function QM(u=[],e){const a=pZ(e?.security||[]);return u.length?WDu(u,a):[bn()]}function rs(u,e){const a=Qi(u||{}),t=Qi(e||{});return[...a,...t,st()]}function YM(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(Jt())}function XM(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:qDu(e.in)})).concat(T2())}function eT(u){if(!u)return[Jt()];const e=[];for(const a in u)e.push({id:crypto.randomUUID(),key:a,value:u[a],active:!0});return e.push(Jt()),e}const wm={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function uT(u,e){const a="$components.parameters.";if(u.reference.startsWith(a)){const t=u.reference.replace(a,"");return e?.[t]}}function aT(u,e,a){if(!u&&!e)return{pathParameters:[ya("path")],queryParameters:[ya("query")],headers:[ya("header")],cookies:[ya("cookie")]};const t={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(u)for(const r of u)if(JM(r)){const n=uT(r,a),i=wm[n?.in];i&&t[i].push({reference:r.reference,active:!0,value:r.value})}else t[wm[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!0,in:r.in});if(e)for(const r of e)if(JM(r)){const n=uT(r,a),i=wm[n?.in];i&&t[i].push({reference:r.reference,active:!1,value:r.value})}else t[wm[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!1,in:r.in});return t.pathParameters.push(ya("path")),t.queryParameters.push(ya("query")),t.headers.push(ya("header")),t.cookies.push(ya("cookie")),t}async function JDu(u,e){const a=lZ().body;if(!u)return a;switch(u.contentType){case"application/x-www-form-urlencoded":case"multipart/form-data":return{...a,type:u.contentType,formData:await UDu(u,e)};case"application/octet-stream":const t=u.payload?await DZ(u.payload,e):[],r=t.length>0?await ME(t[0]):null;return{...a,type:u.contentType,binary:r};case"application/json":case"application/ld+json":return{...a,type:u.contentType,content:rT(u.payload)};default:{const n=typeof u.payload=="string",i=u.contentType||(n?"text/plain":"application/json");return{...a,type:i,content:n?u.payload:rT(u.payload)}}}}async function tT(u,e,a,t){const r=await DZ(e,t),n=r.length>0||Array.isArray(e),i=n?await mZ(r):void 0;return{id:crypto.randomUUID(),key:u,value:n?"":e,type:n?"file":"text",active:a,files:i}}async function UDu(u,e){const a=lZ().body.formData,t=u.contentType,r=u.payload?await Promise.all(Object.entries(u.payload).map(([o,s])=>tT(o,s,!0,e))):[],n=u["x-replay-disabled-payload"]?await Promise.all(Object.entries(u["x-replay-disabled-payload"]||{}).map(([o,s])=>tT(o,s,!1,e))):[];return{...a,[t]:[...r,...n,ys()]}}function rT(u){return u?JSON.stringify(u,null,2):""}function ZDu(u,e){for(const a of Object.keys(e.paths)){const t=e.paths[a];for(const r of Object.keys(t)){const n=r.toLowerCase();if(["get","put","post","delete","options","head","patch","trace"].includes(n)&&t[n]?.operationId===u)return{method:n,path:a,isAdditionalOperation:!1}}if(t.additionalOperations){for(const[r,n]of Object.entries(t.additionalOperations))if(n?.operationId===u)return{method:r.toLowerCase(),path:a,isAdditionalOperation:!0}}}return null}async function DZ(u,e){return Array.isArray(u)?(await Promise.all(u.map(a=>nT(a,e)))).flat():typeof u=="string"?await nT(u,e):[]}async function nT(u,e){const a=/\$file\(['"](.+?)['"]\)/g,t=Array.from(u.matchAll(a));return Promise.all(t.map(r=>QDu(r[1],e)))}async function QDu(u,e){return await da.isAbsolute(u)?u:await da.resolve(await da.join(e,u))}const U0=u=>!u||typeof u=="boolean"?{type:"object",properties:{}}:u.type?u:{...u,type:"object"},iT=(u,e,a)=>{if(!u.properties)return u;const t=u.properties[e],r=U0(t);return{...u,properties:{...u.properties,[e]:{...r,...a}}}},YDu=(u,e,a)=>{if(!u.properties||e===a||!a.trim())return null;const t={...u.properties};return t[a]?null:(t[a]=t[e],delete t[e],{...u,properties:t})},XDu=(u,e)=>{if(!u.properties)return u;const a={...u.properties};return delete a[e],{...u,properties:a}},efu=(u,e,a={type:"string"})=>{const t=u.properties||{};return{...u,type:"object",properties:{...t,[e]:a}}};function oT(u){const e=Object.assign({},...(u||[]).filter(({key:a,active:t})=>a&&t).map(a=>({[a.key]:a.value})));if(Object.keys(e).length!==0)return e}function sT(u){if(!u)return{};const e={queryParameters:"query",headers:"header",cookies:"cookie",pathParameters:"path"},a=[],t=[];return Object.keys(e).forEach(r=>{const n=r;u[n].forEach(i=>{if(oo(i)){const o={reference:i.reference,value:i.value||void 0};i.active?a.push(o):t.push(o)}else{if(!i.key)return;const o={name:i.key,in:e[n],value:i.value};i.active?a.push(o):t.push(o)}})}),{parameters:a.length>0?a:void 0,"x-replay-disabled-parameters":t.length>0?t:void 0}}function ufu(u){const e=u?.map(a=>({condition:a.condition,context:a.context,type:a.type==y0.SIMPLE?void 0:a.type}));if(e?.length!==0)return e}function afu(u){if(!(!u||u.length===0))return[...u]}async function fZ(u,e){return u.absolutePath?`$file('${await da.relative(e,u.absolutePath)}')`:null}async function tfu(u,e){const{type:a,value:t,files:r}=u;switch(a){case"text":return t;case"file":let n=[];return r&&(n=(await Promise.all(Object.values(r).map(i=>fZ(i,e)))).filter(i=>i!==null)),n.length===0?"":n.length===1?n[0]:n}}async function rfu(u,e){const a=u.type,t=u.formData[a],r={},n={};return await Promise.all(t.map(async i=>{const{key:o,active:s}=i;if(!o)return;const l=await tfu(i,e);s?r[o]=l:n[o]=l})),{payload:Object.keys(r).length>0?r:void 0,"x-replay-disabled-payload":Object.keys(n).length>0?n:void 0}}function nfu(u){if(!u)return u;try{const e=JSON.parse(u);return typeof e=="object"?e:u}catch{return u}}async function ifu(u,e){if(u)switch(u.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:u.type,...await rfu(u,e)};case"application/octet-stream":return{contentType:u.type,payload:u.binary?await fZ(u.binary,e):null};case"application/json":case"application/ld+json":return u.content?{contentType:u.type,payload:nfu(u.content)}:void 0;default:return u.content?{contentType:u.type,payload:u.content}:void 0}}function ofu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:u.username,password:u.password}}}function sfu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"apiKey",name:u.name,in:u.location.toLowerCase()}},values:{apiKey:u.key}}}function lfu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:u.token}}}function cfu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:u.username,password:u.password}}}function dfu(u){const{flows:e,values:a}=kZ(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...a,openIdConnectUrl:u.openIdConnectUrl,userInfoUrl:u.userInfoUrl,authRequestExtraParams:gZ(u.authRequestExtraParams),tokenRequestExtraParams:vZ(u.tokenRequestExtraParams)}}}function Efu(u){const{flows:e,values:a}=kZ(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...a,authRequestExtraParams:gZ(u.authRequestExtraParams),tokenRequestExtraParams:vZ(u.tokenRequestExtraParams)}}}function Pl(u){const e={},a={};return u.forEach(t=>{t.value&&(t.active?e[t.value]=t.description:a[t.value]=t.description)}),{scopes:e,"x-replay-disabled-scopes":Object.keys(a).length>0?a:void 0}}function gZ(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function vZ(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active,in:e.sendIn.toLowerCase()}))}function kZ(u){let e;switch(u.grantType){case Ce.ClientCredentials:return e=u[Ce.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Pl(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken}};case Ce.Implicit:return e=u[Ce.Implicit],{flows:{implicit:{authorizationUrl:e.authorizationUrl,...Pl(e.scopes)}},values:{clientId:e.clientId,accessToken:e.accessToken,callbackUrl:e.callbackUrl}};case Ce.Password:return e=u[Ce.Password],{flows:{password:{tokenUrl:e.tokenUrl,...Pl(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,username:e.username,password:e.password,accessToken:e.accessToken}};case Ce.AuthorizationCode:return e=u[Ce.AuthorizationCode],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Pl(e.scopes)}},values:{accessToken:e.accessToken,clientId:e.clientId,callbackUrl:e.callbackUrl}};case Ce.ClientCredentialsWithJwtAssertion:return e=u[Ce.ClientCredentialsWithJwtAssertion],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Pl(e.scopes),"x-assertionType":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},values:{clientId:e.clientId,clientAssertion:e.clientAssertion,accessToken:e.accessToken}};case Ce.AuthorizationCodeWithPkce:return e=u[Ce.AuthorizationCodeWithPkce],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Pl(e.scopes),"x-usePkce":!0}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken,codeVerifier:e.codeVerifier,codeChallenge:e.codeChallenge,callbackUrl:e.callbackUrl}}}}function lT(u){const e=u.map(a=>{switch(a.securityType){case ke.OpenIDConnect:{const r=a[ke.OpenIDConnect];return dfu(r)}case ke.OAuth2:{const r=a[ke.OAuth2];return Efu(r)}case ke.APIKey:{const r=a[ke.APIKey];return sfu(r)}case ke.BasicAuth:{const r=a[ke.BasicAuth];return ofu(r)}case ke.DigestAuth:{const r=a[ke.DigestAuth];return cfu(r)}case ke.JWT:{const r=a[ke.JWT];return lfu(r)}default:return null}}).filter(a=>a!==null);return{"x-security":e.length?e:void 0}}function pfu(u){const{inputs:e,parameters:a,...t}=u;let r=t;return Object.keys(e).length&&(r.inputs=e),Object.keys(a).length&&(r.parameters=Object.fromEntries(Object.entries(a).map(([n,{id:i,active:o,key:s,...l}])=>[n,{...l,name:s}]))),Object.keys(r).length||(r=void 0),r}async function mfu(u,e){const{id:a,state:t,srcType:r,sourceDescriptions:n,workflows:i,components:o,...s}=u;return{arazzoObject:{...s,sourceDescriptions:n.map(l=>({name:l.name,url:l.url,type:l.type||"openapi"})),components:pfu(o),workflows:await Promise.all(i.map(async({parameters:l,security:c,dependsOn:d,outputs:E,state:p,steps:h,inputs:x,...f})=>({...f,dependsOn:afu(d),outputs:oT(E),inputs:x?U0(x):void 0,...lT(c),...sT(l),steps:await Promise.all(h.map(async({parameters:D,security:g,operation:k,requestBody:C,successCriteria:v,outputs:b,state:F,xOperation:B,...S})=>{const P={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(k){const L=u.sourceDescriptions.find(({apiId:N})=>N===k.apiId)||u.sourceDescriptions[0];if(k.operationId){const N=u.sourceDescriptions.length<=1;P.operationId=N?k.operationId:`$sourceDescriptions.${L.name}.${k.operationId}`}else P.operationPath=k.isAdditionalOperation?`{$sourceDescriptions.${L.name}.url}#/paths/${Cd.escape(k.path)}/additionalOperations/${k.method}`:`{$sourceDescriptions.${L.name}.url}#/paths/${Cd.escape(k.path)}/${k.method}`}else B&&(P["x-operation"]={...B,url:B.url.split("?")[0]});return{...S,...P,...lT(g),...sT(D),requestBody:await ifu(C,e),successCriteria:ufu(v),outputs:oT(b)}}))})))}}}class xfu extends eq{constructor(e,a){super(e),this.convertOperationToReplayValue=a}parse(e,a){return LDu(e.content,e.uri,e.type,this.storage.baseDir,a,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:a}=await mfu(e,this.storage.baseDir);return await da.extname(e.id)===".json"?JSON.stringify(a,null,2):Do.dump(a)}}class hfu{constructor(e,a){this.storage=e,this.localStorageSecretsProvider=a}default=[];async read(){const e=await this.storage.get("replay-environments.yaml"),a=await this.localStorageSecretsProvider.get();let t=null,r=null;if(!e)return this.default;try{t=Do.load(e),r=a?JSON.parse(a):null}catch(o){return console.error("Failed to parse environments file",o),this.default}return t?Object.keys(t).filter(o=>o!=="version").map(o=>({name:o,inputs:Object.entries(t[o].inputs).map(([s,l])=>{if(typeof l=="string")return{name:s,value:l,isSecret:!1};const c=r?.[o]?.[s]??"";return{name:s,value:c,isSecret:!0}}),servers:Object.entries(t[o].servers).map(([s,l])=>({apiId:s,value:l.value,variables:Object.entries(l.variables||{}).map(([c,d])=>({name:c,value:d}))})),state:Ru.Normal})):this.default}async write(e){const a=await this.localStorageSecretsProvider.get(),t=a?JSON.parse(a):{},r=e.reduce((n,i)=>(i.name&&(n[i.name]={inputs:i.inputs.reduce((o,s)=>(s.isSecret&&t?(t[i.name]||(t[i.name]={}),t[i.name][s.name]=s.value,o[s.name]={provider:"local"}):o[s.name]=s.value,o),{}),servers:i.servers.reduce((o,s)=>(o[s.apiId]={value:s.value,variables:Object.fromEntries(s.variables.map(l=>[l.name,l.value]))},o),{})}),n),{});this.localStorageSecretsProvider.set(JSON.stringify(t)),r&&this.storage.set("replay-environments.yaml",Do.dump(r))}}class Dfu{constructor(e,a,t){this.storage=e,this.filePath=a,this.defaultValue=t}async parse(e){return JSON.parse(e)}stringify(e){return JSON.stringify(e)}async read(){const e=await this.storage.get(this.filePath);return e?await this.parse(e):this.defaultValue}async write(e){return this.storage.set(this.filePath,this.stringify(e))}}const ffu=(u,e)=>({data:u,version:e});class ZC extends Dfu{constructor(e,a,t,r){super(e,a,t),this.version=r}migrationMap={};migrate(e){if(!this.migrationMap[e.version])return this.defaultValue;const a=this.migrationMap[e.version](e);return a.version===this.version?a:this.migrate(a)}async parse(e){const a=JSON.parse(e);if(a.version!==this.version){const t=this.migrate(a);return await this.write(t.data),t.data}return a.data}stringify(e){return JSON.stringify(ffu(e,this.version))}}function gfu(u){return{data:{...u.data,tabs:u.data.tabs.map(e=>e.data.type===We.Step?{...e,data:{...e.data,draftStep:{...e.data.step,security:e.data.step.security.securities},step:void 0,hasUnsavedChanges:void 0,showUnsavedChangesModal:void 0}}:e)},version:2}}const cT=2,vfu="tabs.json";class kfu extends ZC{migrationMap={1:gfu};constructor(e){super(e,vfu,ii(JH),cT)}async parse(e){let a=JSON.parse(e);a.version!==cT&&(a=this.migrate(a));const t=await Promise.all(a.data.tabs.map(async r=>{if(r.data.type===We.Step&&r.data.draftStep){const n=r.data.draftStep.requestBody.formData;n["multipart/form-data"]=await dT(n["multipart/form-data"]),n["application/x-www-form-urlencoded"]=await dT(n["application/x-www-form-urlencoded"]),r.data.draftStep.requestBody.binary&&r.data.draftStep.requestBody.binary.absolutePath&&(r.data.draftStep.requestBody.binary=await ME(r.data.draftStep.requestBody.binary.absolutePath))}return r}));return{...a.data,tabs:t}}stringify(e){return super.stringify({...e,tabs:e.tabs.map(a=>a.data.type===We.Step?{...a,data:{...a.data,response:null}}:a.data.type===We.WorkflowRun?{...a,data:{...a.data,result:null}}:a)})}}async function dT(u){return Promise.all(u.map(async e=>{const a={...e};if(e.files){const t=e.files.map(r=>r.absolutePath).filter(r=>r!==null);a.files=await mZ(t)}return a}))}const bfu=1,Cfu=1;class Ffu{constructor(e,a,t){this.project=e,this.convertOperationToReplayValue=a,this.telemetry=t,this.localStorageSecretsProvider=new Qlu(this.project.id),this.systemFilesStorage=this.isTauriApp?new sO(this.project.systemFilesDir):new oO(this.project.systemFilesDir),this.userFilesStorage=this.isTauriApp?new sO(this.project.userFilesDir):new oO(this.project.userFilesDir);const r=new Ulu;this.historyStorage=new ZC(this.systemFilesStorage,"history.json",[],bfu),this.activeEnvironmentIdStorage=new ZC(this.systemFilesStorage,"active_environment_id.json",bE,Cfu),this.tabsStateStorage=new kfu(this.systemFilesStorage),this.environmentsStorage=new hfu(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new xfu(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new Ylu(this.isTauriApp?this.userFilesStorage:r)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;isTauriApp=pc();systemFilesStorage;localStorageSecretsProvider;userFilesStorage;async detectProjectFiles(){const a=(await this.userFilesStorage.ls()).filter(i=>/\.(ya?ml|json)$/.test(i)),t=[],r=[],n=new Set;return await Promise.all(a.map(async i=>{const o=await this.userFilesStorage.get(i);if(o)try{const s=Do.load(o);if(typeof s=="object"&&s!==null)if(typeof s.openapi=="string"){const l=await da.resolve(await da.join(this.userFilesStorage.baseDir,i)),c=await iO(l,s);t.push({uri:i,type:ln.FS,content:c})}else typeof s.arazzo=="string"&&(r.push({uri:i,type:ln.FS,content:s}),s.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=typeof d=="string"&&Iy(d);E&&p&&n.add(d)}))}catch(s){console.error(`Error parsing YAML/JSON file ${i}:`,s)}})),{apiFiles:t,collectionFiles:r,apiUrls:n,filesCount:a.length}}async loadApis(e){const a=[];return await Promise.all(Array.from(e).map(async t=>{try{const r=await iO(t);a.push({uri:t,type:ln.WEB,content:r})}catch(r){console.error(`Error parsing YAML from ${t}:`,r)}})),a}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),a=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[t,r,n,i]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);a?.setAttribute("status","completed"),a?.setAttribute("historyCount",t.length),a?.setAttribute("environmentCount",i.length),a?.setStatus(mr.OK),a?.end();const o=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{apiFiles:s,collectionFiles:l,apiUrls:c,filesCount:d}=await this.detectProjectFiles();o?.setAttribute("status","completed"),o?.setAttribute("filesCount",d),o?.setAttribute("apiFilesCount",s.length),o?.setAttribute("collectionFilesCount",l.length),o?.setAttribute("apiUrlsCount",c.size),o?.setStatus(mr.OK),o?.end();const E=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:c.size},e?.parentCtx),p=await this.loadApis(c);E?.setAttribute("status","completed"),E?.setStatus(mr.OK),E?.end();const h=this.telemetry?.startSpan("storage.parseApis",{},e?.parentCtx),x=await this.apisStorage.parseMany([...s,...p]);h?.setAttribute("status","completed"),h?.setAttribute("apisCount",s.length+p.length),h?.setStatus(mr.OK),h?.end();const f=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:l.length},e?.parentCtx),D=await this.collectionsStorage.parseMany(l,x);return f?.setAttribute("status","completed"),f?.setStatus(mr.OK),f?.end(),e?.setAttribute("status","completed"),e?.setStatus(mr.OK),e?.end(),{project:this.project,history:t,activeEnvironmentId:r,tabsState:n,environments:i,apis:x,collections:D}}async update(e,a){switch(e.path[0]){case"history":this.historyStorage.write(a.history.get());break;case"activeEnvironmentId":this.activeEnvironmentIdStorage.write(a.activeEnvironmentId.get());break;case"tabsState":this.tabsStateStorage.write(a.tabsState.get());break;case"environments":this.environmentsStorage.write(a.environments.get());break;case"apis":this.isTauriApp&&await this.apisStorage.update(e,a.apis.get());break;case"collections":await this.collectionsStorage.update(e,a.collections.get());break}}}function bZ(u=!1){let e,a=!1;return()=>({id:"RootStoragePlugin",onCreate:()=>({init:t=>async(r,n,i)=>{if(a||t.path.length>0)return{isInitialized:!1};if(a=!0,!u){e=new Ffu(r,n,i);const o=await e.read();t.merge(o)}return a=!1,{isInitialized:!0}}}),onSet(t,r,n){a||u||e.update(r,n)}})}function CZ({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:ii(JH),activeEnvironmentId:bE,environments:u||WH,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Gr.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const yfu=H$(CZ(),q$(Tlu({key:"replay-root-store"}),bZ())),L2=_.createContext(yfu),Afu=L2.Provider;function Bu(){const u=_.useContext(L2);return W$(u)}function Bfu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const Sfu=Bfu(),zfu=_.createContext(Sfu);function Cn(){const u=_.useContext(zfu);return W$(u)}function wfu(u,e){const{apps:{apiId:a}}=Bu(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=Cn();t.set(u?.corsProxyUrl??flu),n.set(u?.mockServer),a.set(u?.apiId),i.set(u?.oAuth2RedirectURI),r.set(!!u?.disableCollectionsTab),s.set(u?.storageKey),l.set(!!e),_.useEffect(()=>{o.set(u?.certificates||[])},[u?.certificates])}const sf=_.createContext({});function bc(){return _.useContext(sf)||{}}const Ofu="0.19.0-custom.3",Pfu={version:Ofu};class jfu{client;_isInitialized=!1;constructor(){this.client=new Dlu}get isInitialized(){return this._isInitialized}init(e){if(this.isInitialized)return;const a=!0,t=e?.tracerName||"desktop",r=e?.enableErrorInstrumentation??t==="desktop",n={serviceName:"replay",serviceVersion:Pfu.version,version:"1.0.0",tracerName:t,collectorUrl:e?.collectorUrl||"",isProd:a,enableErrorInstrumentation:r};this.client.init({otel:{...e,...n}}),this._isInitialized=!0}sendEvent(e,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{this.client.send(e,a)}catch(t){console.error("Failed to send telemetry event:",t)}}startSpan(e,a,t){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this.client.startSpan(e,a,t)}catch(r){console.error("Failed to start telemetry span:",r);return}}}const Om=new jfu;function vu(){const{telemetry:u}=bc();return Om.isInitialized||Om.init({tracerName:u?.tracerName,collectorUrl:u?.collectorUrl,enableErrorInstrumentation:u?.enableErrorInstrumentation}),{sendEvent:(e,a)=>{Om.sendEvent(e,a)},startSpan:(e,a,t)=>Om.startSpan(e,a,t)}}const w0=800;function Ls(u){"@babel/helpers - typeof";return Ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ls(u)}function Mfu(u,e){if(Ls(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Ls(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function FZ(u){var e=Mfu(u,"string");return Ls(e)=="symbol"?e:e+""}function N4(u,e,a){return(e=FZ(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function ET(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Ye(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ET(Object(a),!0).forEach(function(t){N4(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):ET(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function Tfu(u){if(Array.isArray(u))return u}function Rfu(u,e){var a=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(a!=null){var t,r,n,i,o=[],s=!0,l=!1;try{if(n=(a=a.call(u)).next,e===0){if(Object(a)!==a)return;s=!1}else for(;!(s=(t=n.call(a)).done)&&(o.push(t.value),o.length!==e);s=!0);}catch(c){l=!0,r=c}finally{try{if(!s&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(l)throw r}}return o}}function QC(u,e){(e==null||e>u.length)&&(e=u.length);for(var a=0,t=Array(e);a<e;a++)t[a]=u[a];return t}function yZ(u,e){if(u){if(typeof u=="string")return QC(u,e);var a={}.toString.call(u).slice(8,-1);return a==="Object"&&u.constructor&&(a=u.constructor.name),a==="Map"||a==="Set"?Array.from(u):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?QC(u,e):void 0}}function Nfu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
518
+ `};return D5u(o.getText(),c,p).map(function(h){return ki.replace(Nu.create(o.positionAt(h.offset),o.positionAt(h.offset+h.length)),h.content)})}}}function Xs(){const{tabsState:u}=Bu(),e=_.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>u.tabs.findIndex(l=>{const c=l.data.get();return _a(c,r)?(!n||c.collectionId===n)&&(!i||c.workflowId===i)&&(!o||c.stepId===o)&&(!s||c.historyId===s):!1}),[u]),a=_.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>{const l=e({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s});return l!==-1?u.tabs[l]:void 0},[e,u]),t=_.useCallback((r,n)=>{if(!(!r.collectionId||!n.collectionId||r.collectionId!==n.collectionId)&&!(!r.workflowId||!n.workflowId)){if(r.workflowId!==n.workflowId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&((_a(o,We.Workflow)||_a(o,We.WorkflowRun))&&o.workflowId===r.workflowId&&i.data.workflowId.set(n.workflowId),_a(o,We.Step)&&o.workflowId===r.workflowId&&i.data.workflowId.set(n.workflowId))});return}if(!(!r.stepId||!n.stepId)&&r.stepId!==n.stepId){u.tabs.forEach(i=>{const o=i.data.get();o.collectionId===r.collectionId&&_a(o,We.Step)&&o.workflowId===r.workflowId&&o.stepId===r.stepId&&i.data.stepId.set(n.stepId)});return}}},[u]);return{tabs:u.tabs,activeTabIdx:u.activeTabIdx,getExistingTabIndex:e,getExistingTab:a,handleIdChange:t}}function _a(u,e){return u.type===e}const rf=YU({});let GM=null;function XU(u){GM!==u&&(GM=u,rf.configure({validate:!0,schemas:[{uri:"stub://test",fileMatch:["*"],schema:u}]}))}function eZ(u){const e=b5.create("stub.json","json",0,u),a=rf.parseJSONDocument(e);return{textDoc:e,jsonDoc:a}}const uZ=Ja.define({create(){},update(u){return u}}),aZ=u=>u.field(uZ,!1),iDu=({store:u,isResponse:e,apiOperation:a})=>{const r=pA(u).data.get();let n=a?.body?.mediaTypes?.[z0.JSON]?.schema;if(_a(r,We.Step)&&e){const i=r.response?.status;i&&(n=a?.responses?.[i]?.mediaTypes?.[z0.JSON]?.schema)}return[uZ.init(()=>({schema:ii(n||{}),store:u}))]};function oDu(){return async u=>{const{schema:e}=aZ(u.state)||{};if(!e)return[];XU(e);const a=u.state.doc,{textDoc:t,jsonDoc:r}=eZ(a.toString());return(await rf.doValidation(t,r))?.map(i=>({from:qC(a,i.range.start),to:qC(a,i.range.end),message:i.message,severity:cDu[i.severity||3]}))}}const sDu=fn.highest(xc.of([{key:"Tab",run:u=>vJ(u)}]));function lDu(){return async function(e){const a={from:e.pos,to:e.pos,options:[],filter:!1},{schema:t}=aZ(e.state)||{};if(!t)return a;XU(t);const r=e.state.doc,n=qC.bind(null,r),{textDoc:i,jsonDoc:o}=eZ(r.toString()),s=e.state.doc.lineAt(e.pos),l=s.number-1,c=e.pos-s.from,d=await rf.doComplete(i,{line:l,character:c},o);if(!d)return a;const E=e.state.sliceDoc(s.from,e.pos);if(E.trim().endsWith(",")||dDu(E))return a;a.options=d.items.map(x=>({label:x.label,info:x.documentation,apply:f=>{if(!x.textEdit||!("range"in x.textEdit))return;const D=x.textEdit.range,g=x.textEdit.newText.search(/(\$1|\${1:.*?})/);let k=x.textEdit.newText.replace(/(\$1|\${1:.*?})/,"");const C=g===-1?0:g-k.length;f.dispatch({changes:{from:n(D.start),to:n(D.end),insert:k}});const v=k.length-(D.end.character-D.start.character);f.dispatch({selection:Se.single(n(D.end)+v+C)})}}))||[];const p=e.state.wordAt(e.pos),h=p?.from?e.state.sliceDoc(p?.from,p?.to).toLowerCase():"";return h&&(a.options=a.options.filter(x=>x.label.toLowerCase().replace(/^"/,"").startsWith(h))),a}}const cDu={1:"error",2:"warning",3:"info",4:"hint"};function qC(u,e){return u.line(e.line+1).from+e.character}function dDu(u){try{return JSON.parse(`{${u}}`),!0}catch{return!1}}const tZ=iu.define();function kc(u){const e=u.activeEnvironmentId.get();return u.environments.find(a=>a.name.get()===e)?.get()||u.environments[0].get()}const WC=u=>ba.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const r=kc(a.store)?.inputs,n=[],i=Ke.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),o=s=>Ke.mark({attributes:{style:`color: var(--replay-${s?"undefined":"defined"}-variable-color); background-color: var(--replay-${s?"undefined":"defined"}-variable-bg-color);`}});for(const{from:s,to:l}of e.visibleRanges){const c=e.state.doc.sliceString(s,l),d=OD(c);for(const E of d){const p=s+E.start,h=s+E.end;if(!(p>=h))if(E.prefix==="inputs"){const x=zy(E.match),D=!r?.find(g=>g.name===x)?.value;n.push({from:p,to:h,value:o(D)})}else n.push({from:p,to:h,value:i})}}return Ke.set(n,!0)}},{decorations:e=>e.decorations}),EDu=YU({});function pDu(u){if(!u||typeof u!="object")return!1;const e=u;return typeof e.type=="string"&&typeof e.offset=="number"&&typeof e.length=="number"}function mDu(u){const e=[];if(!u)return e;const a=[u];for(;a.length>0;){const t=a.pop();if(t.type==="property"){t.valueNode&&a.push(t.valueNode);continue}if(t.type==="string"){const r=t.offset,n=t.offset+t.length;n>r&&e.push({from:r,to:n})}if(t.children&&t.children.length)for(const r of t.children)a.push(r)}return e}const xDu=u=>ba.fromClass(class{decorations;constructor(e){this.decorations=this.buildDecorations(e,u)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view,u))}buildDecorations(e,a){const t=e.state.doc.toString();let r;try{const d=b5.create("inmemory://model.json","json",0,t),p=EDu.parseJSONDocument(d)?.root;r=pDu(p)?p:void 0}catch{r=void 0}const i=kc(a.store)?.inputs,o=Ke.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),s=d=>Ke.mark({attributes:{style:`color: var(--replay-${d?"undefined":"defined"}-variable-color); background-color: var(--replay-${d?"undefined":"defined"}-variable-bg-color);`}}),l=[];if(!r)return Ke.set([],!0);const c=mDu(r);for(const d of c){if(!e.visibleRanges.some(D=>Math.max(D.from,d.from)<Math.min(D.to,d.to))||!(t[d.from]==='"'&&t[d.to-1]==='"'))continue;const p=d.from+1,h=d.to-1;if(h<=p)continue;const x=e.state.doc.sliceString(p,h),f=OD(x);for(const D of f){const g=p+D.start,k=p+D.end;if(!(g>=k))if(D.prefix==="inputs"){const C=zy(D.match),b=!i?.find(F=>F.name===C)?.value;l.push({from:g,to:k,value:s(b)})}else l.push({from:g,to:k,value:o})}}return Ke.set(l,!0)}},{decorations:e=>e.decorations}),En={[z0.Text]:{name:"Text",extensions:[Me.lineWrapping],stateExtensions:[WC]},[z0.JSON]:{name:"JSON",extensions:[gEu(),Umu(oDu(),{delay:0,needsRefresh:u=>u.transactions.some(e=>e.effects.some(a=>a.is(tZ)))}),YW.data.of({autocomplete:lDu()}),sDu],stateExtensions:[iDu,xDu]},[z0.XML]:{name:"XML",extensions:[Nmu()],stateExtensions:[WC]}},hDu={[z0.Image]:{name:"Image",extensions:[],stateExtensions:[]}},DDu={[z0.HTML]:{name:"HTML",extensions:[pmu()],stateExtensions:[WC]}},ro={...En,...hDu,...DDu},rZ={[z0.FormData]:{name:"form-data",extensions:void 0},[z0["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},nZ={[z0.Binary]:{name:"Binary",extensions:void 0}},_s={...En,...rZ,...nZ},fDu=Object.keys(En),M2=Object.keys(rZ),iZ=Object.keys(nZ);function oZ(u=[],e){const a={};return u.forEach(t=>{const r=String(t[e]);a[r]||(a[r]=[]),a[r].push(t)}),a}const PE={active:!0,key:"",value:""};function no(u,e){return[...u.map(t=>({id:crypto.randomUUID(),key:t.name,value:e.initializeWithInputs?`$inputs.${t.name}`:t.example?String(t.example):"",active:e.initializeWithInputs?!0:!!t.example,in:t.in})),ya(e.in)]}function jE(u,e){const[a]=u.split("?"),t=e.slice(0,-1).filter(r=>r.active).map(r=>`${r.key}=${r.value}`).join("&");return`${a}${t?`?${t}`:""}`}function Jt(){return{id:crypto.randomUUID(),...PE}}function st(){return{id:crypto.randomUUID(),...PE,description:""}}function ya(u){return{...PE,id:crypto.randomUUID(),in:u}}function ys(){return{id:crypto.randomUUID(),...PE,type:"text",files:null}}function T2(){return{id:crypto.randomUUID(),...PE,sendIn:S0.URL}}function wv(u){return u.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function nf(u,e){return u.filter(a=>a.active&&a.value).map(({value:a})=>(e?Zu(a,e):a).trim())}function xo(u,e){const t=e.filter(r=>!!r).flatMap(r=>r).filter(r=>r.key&&r.active);return["path","header"].includes(u)?Array.from(new Map(t.map(r=>[r.key,r])).values()):t}function sZ(u,e){return u.map(({value:a,...t})=>({...t,value:Zu(a,e)}))}function gDu(u,e){if(!u.startsWith("$components.parameters."))return null;const a=u.replace("$components.parameters.","");return a&&e[a]||null}function Aa(u=[],e={}){const a=[];for(const t of u)if(oo(t)){const r=gDu(t.reference,e);r&&a.push({...r,active:t.active,value:t.value||r.value})}else a.push(t);return a}function Qi(u){return Object.entries(u).map(([e,a])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:a}))}function vDu(u){return u.replace(/{/g,"{{").replace(/}/g,"}}")}const HM={documentedOAuth2Types:[],grantType:Ce.ClientCredentials,authRequestExtraParams:[Jt()],tokenRequestExtraParams:[T2()],[Ce.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[st()],accessToken:""},[Ce.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[st()],accessToken:""},[Ce.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[st()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ce.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[st()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ce.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[st()],accessToken:""},[Ce.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[st()]}},kDu={securityType:ke.NoAuth,securitySchemeId:null,[ke.BasicAuth]:{username:"",password:""},[ke.JWT]:{token:""},[ke.DigestAuth]:{username:"",password:"",nc:"00000001",realm:"",nonce:"",opaque:"",qop:"",algorithm:"",cnonce:""},[ke.APIKey]:{location:St.Header,name:"",key:""},[ke.OAuth2]:HM,[ke.OpenIDConnect]:{...HM,openIdConnectUrl:"",userInfoUrl:""}},JC="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",bDu={[y0.SIMPLE]:{condition:"",type:y0.SIMPLE},[y0.REGEX]:{condition:"",type:y0.REGEX,context:""},[y0.JSONPATH]:{condition:"",type:y0.JSONPATH,context:""},[y0.XPATH]:{condition:"",type:y0.XPATH,context:""}};function C5(){return structuredClone({type:Ya.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[ys()],"application/x-www-form-urlencoded":[ys()]},binary:null})}const CDu={method:"GET",url:"",security:[bn()],body:C5(),queryParameters:[Jt()],headers:[Jt()],cookies:[Jt()],pathParameters:[Jt()]};function lZ(){return structuredClone(CDu)}function bn(){return ii(kDu)}function FDu(u){return ii({id:crypto.randomUUID(),...bDu[u]})}function cZ(u,e,a){for(const t of a){const r=qM(u,t),n=qM(e,t);if(typeof r=="object"&&typeof n=="object"){if(!cZ(r,n,a))return!1}else if(r!==n)return!1}return!0}function qM(u,e){const a=e.split("/");let t=u;for(const r of a)if(t&&typeof t=="object"&&r in t)t=t[r];else return;return t}function yDu(u,e){return u.length===e.length&&u.sort().join()===e.sort().join()}function ADu(u,e){return u.every(a=>e.includes(a))}function BDu(u){switch(u){case"query":return St.Query;case"cookie":return St.Cookie;case"header":return St.Header;default:return}}function SDu(u,e,a){const{security:t}=e,r=fnu(u);if(!a)return!1;const n=R2(a),i=n.map(c=>c.securityType),o=t.map(c=>c.securityType);if(!yDu(i,o))return!0;let l=[];return t.forEach(c=>{const d=c.securityType,E=c[ke.OAuth2]?.grantType,p=i.includes(d),h=n.find(g=>g.securityType===d),x=!h||cZ(c,h,wDu(d,E)),f=zDu(c,d,c[ke.OAuth2]?.grantType,r),D=!!(p&&h&&x&&f);l.push(!a.security?.length||D)}),l.includes(!1)}function zDu(u,e,a,t){if(e===ke.OAuth2&&(a===Ce.AuthorizationCode||a===Ce.AuthorizationCodeWithPkce||a===Ce.Implicit)){const r=u[ke.OAuth2][a]?.availableScopes,n=nf(u[ke.OAuth2][a]?.scopes,t);return ADu(n,r)}return!0}function wDu(u,e){return u===ke.APIKey?[`${ke.APIKey}/name`,`${ke.APIKey}/location`]:u===ke.OAuth2?[`${ke.OAuth2}/grantType`,...ODu(e)]:u===ke.OpenIDConnect?[`${ke.OpenIDConnect}/openIdConnectUrl`]:[]}function ODu(u){return u===Ce.ClientCredentials?[`${ke.OAuth2}/${Ce.ClientCredentials}/tokenUrl`]:u===Ce.Password?[`${ke.OAuth2}/${Ce.Password}/tokenUrl`]:u===Ce.Implicit?[`${ke.OAuth2}/${Ce.Implicit}/authorizationUrl`]:u===Ce.AuthorizationCode?[`${ke.OAuth2}/${Ce.AuthorizationCode}/tokenUrl`,`${ke.OAuth2}/${Ce.AuthorizationCode}/authorizationUrl`]:u===Ce.AuthorizationCodeWithPkce?[`${ke.OAuth2}/${Ce.AuthorizationCodeWithPkce}/tokenUrl`,`${ke.OAuth2}/${Ce.AuthorizationCodeWithPkce}/authorizationUrl`]:[]}function PDu(u){return u.map(e=>{const a=e.map(t=>t.id).join("_");return e.map(t=>({...t,schemeId:a}))})}function jDu(u){const e=u.security||[],a=e.map(t=>{let r="";const n=[];return t.forEach((i,o)=>{r=o===0?`${i.id}`:`${r}_${i.id}`,n.push(N2(i))}),{id:r,security:n}});return e.length?a:[]}function MDu(u,e){const a=u.security||[];return a?.length?pZ(a).map((t,r)=>N2(t)):[]}function R2(u){const a=(u.security||[])[0];return a?a.map(t=>N2(t)):[bn()]}function N2(u,e){const a={...bn(),securitySchemeId:u.id},t=of(u);a.securityType=t;const r=u.id;if(u.id&&t!==ke.NoAuth&&(a[t].schemeName=u.id),t===ke.BasicAuth&&(a[ke.BasicAuth].username||(a[ke.BasicAuth].username=ga(r+H.SecurityVariablesEnvSuffix.Username)),a[ke.BasicAuth].password||(a[ke.BasicAuth].password=ga(r+H.SecurityVariablesEnvSuffix.Password))),t===ke.DigestAuth&&(a[ke.DigestAuth].username||(a[ke.DigestAuth].username=ga(r+H.SecurityVariablesEnvSuffix.Username)),a[ke.DigestAuth].password||(a[ke.DigestAuth].password=ga(r+H.SecurityVariablesEnvSuffix.Password))),t===ke.JWT&&!a[ke.JWT].token&&(a[ke.JWT].token=ga(r+H.SecurityVariablesEnvSuffix.JWTToken)),t===ke.APIKey&&!a[ke.APIKey].key){a[ke.APIKey].name=u.name||"",a[ke.APIKey].key=ga(r+H.SecurityVariablesEnvSuffix.APIKey);const n=BDu(u.in);n&&(a[ke.APIKey].location=n)}if(t===ke.OAuth2){const n=_2(u),i=ga(r+H.SecurityVariablesEnvSuffix.Token),o=a[ke.OAuth2];o.grantType=n[0],n.forEach(s=>{s===Ce.AuthorizationCode&&!o[Ce.AuthorizationCode].accessToken&&(o[Ce.AuthorizationCode].accessToken=i,o[Ce.AuthorizationCode].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.AuthorizationCode].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Ce.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Ce.AuthorizationCode].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.AuthorizationCode].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Ce.AuthorizationCode].scopes=[...Qi(u.flows?.authorizationCode?.scopes||{})||[],st()]),s===Ce.AuthorizationCodeWithPkce&&!o[Ce.AuthorizationCodeWithPkce].accessToken&&(o[Ce.AuthorizationCodeWithPkce].accessToken=i,o[Ce.AuthorizationCodeWithPkce].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.AuthorizationCodeWithPkce].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Ce.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Ce.AuthorizationCodeWithPkce].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.AuthorizationCodeWithPkce].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Ce.AuthorizationCodeWithPkce].scopes=[...Qi(u.flows?.authorizationCode?.scopes||{}),st()]),s===Ce.ClientCredentials&&!o[Ce.ClientCredentials].accessToken&&(o[Ce.ClientCredentials].accessToken=i,o[Ce.ClientCredentials].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.ClientCredentials].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.ClientCredentials].tokenUrl=u.flows?.clientCredentials?.tokenUrl||"",o[Ce.ClientCredentials].scopes=[...Qi(u.flows?.clientCredentials?.scopes||{}),st()]),s===Ce.ClientCredentialsWithJwtAssertion&&!o[Ce.ClientCredentialsWithJwtAssertion].accessToken&&(o[Ce.ClientCredentialsWithJwtAssertion].accessToken=i,o[Ce.ClientCredentialsWithJwtAssertion].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.ClientCredentialsWithJwtAssertion].clientAssertion=ga(r+H.SecurityVariablesEnvSuffix.ClientAssertion),o[Ce.ClientCredentialsWithJwtAssertion].scopes=[...Qi(u.flows?.clientCredentials?.scopes||{}),st()]),s===Ce.Implicit&&!o[Ce.Implicit].accessToken&&(o[Ce.Implicit].accessToken=i,o[Ce.Implicit].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.Implicit].authorizationUrl=u.flows?.implicit?.authorizationUrl||"",o[Ce.Implicit].availableScopes=Object.keys(u.flows?.implicit?.scopes||{})||[],o[Ce.Implicit].scopes=[...Qi(u.flows?.implicit?.scopes||{}),st()]),s===Ce.Password&&!o[Ce.Password].accessToken&&(o[Ce.Password].accessToken=i,o[Ce.Password].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),o[Ce.Password].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.Password].tokenUrl=u.flows?.password?.tokenUrl||"",o[Ce.Password].scopes=[...Qi(u.flows?.password?.scopes||{}),st()])})}if(t===ke.OpenIDConnect){const n=ga(r+H.SecurityVariablesEnvSuffix.Token),i=a[ke.OpenIDConnect];i[Ce.AuthorizationCode].accessToken||(i[Ce.AuthorizationCode].accessToken=n,i[Ce.AuthorizationCode].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),i[Ce.AuthorizationCode].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),i[Ce.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Ce.AuthorizationCodeWithPkce].accessToken||(i[Ce.AuthorizationCodeWithPkce].accessToken=n,i[Ce.AuthorizationCodeWithPkce].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId),i[Ce.AuthorizationCodeWithPkce].clientSecret=ga(r+H.SecurityVariablesEnvSuffix.ClientSecret),i[Ce.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Ce.Implicit].accessToken||(i[Ce.Implicit].accessToken=n,i[Ce.Implicit].clientId=ga(r+H.SecurityVariablesEnvSuffix.ClientId))}return a}function TDu(u,e=!1,a="",t){const r=oZ(u.parameters,"in"),n=dZ(u),i=R2(u),o=no(r.query||[],{in:"query"});return{id:crypto.randomUUID(),name:u.name,operationId:u.operationId,collectionPath:t,apiPath:{path:u.path,method:u.method},apiId:a,isAdditionalOperation:e,request:{pathParameters:no(r.path||[],{in:"path"}),method:u.method.toLocaleUpperCase(),url:jE(vDu(u.path),o),headers:no(r.header||[],{in:"header"}),queryParameters:o,cookies:no(r.cookie||[],{in:"cookie"}),body:n,security:i},response:null}}function $2(u){const e=oZ(u.parameters,"in"),a=dZ(u),t=R2(u);return{parameters:{queryParameters:no(e.query||[],{in:"query"}),headers:no(e.header||[],{in:"header"}),cookies:no(e.cookie||[],{in:"cookie"}),pathParameters:no(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:t}}function dZ(u){const e=u.body?.mediaTypes;if(!e||!Object.keys(e).length)return C5();const a=RDu(e,u),t=a?.name||"",r=!M2.includes(t)&&!iZ.includes(t),n=UC(a),i=r&&n.length?JSON.stringify(n.find(({key:o})=>o===u.body?.activeExampleName)?.value,null,2)||JSON.stringify(n[0].value,null,2):"";return{...C5(),activeExampleName:u.body?.activeExampleName||n[0]?.key||"",...a&&{type:a.name},content:i,formData:{"multipart/form-data":WM(e[z0.FormData]),"application/x-www-form-urlencoded":WM(e[z0["application/x-www-form-urlencoded"]])}}}function EZ(u){return u?{...(Object.keys(u?.body?.mediaTypes||{})||[]).reduce((a,t)=>(a[t]={name:t,extensions:void 0},a),{}),..._s}:_s}function WM(u){if(!u)return[ys()];if(!u.parameters)return[ys()];const e=u.parameters.map(a=>({id:crypto.randomUUID(),key:a.name,value:String(a.example)||"",active:!0,type:a.inputType,files:null}));return e.push(ys()),e}function UC(u){const e=u?.examples;return Object.keys(e||{}).map(a=>{const t=e?.[a];return{name:H.isString(t?.summary)?t?.summary:t?.summary?.raw||a,key:a,value:e?.[a].value}})}function RDu(u,e){const a=EZ(e),t=Object.keys(u).find(r=>!!a[r]);return t?u[t]:null}function NDu(u){return!u?.security?.length||!u?[]:MDu(u)}function pZ(u){const e=new Set;return u.flat().filter(a=>e.has(a.id)?!1:(e.add(a.id),!0))}function of(u){if(u.type==="http"){if(u.scheme==="bearer")return ke.JWT;if(u.scheme==="basic")return ke.BasicAuth;if(u.scheme==="digest")return ke.DigestAuth}else{if(u.type==="apiKey")return ke.APIKey;if(u.type==="oauth2")return ke.OAuth2;if(u.type==="openIdConnect")return ke.OpenIDConnect}return ke.NoAuth}function $Du(u,e){if(u==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===JC)return Ce.ClientCredentialsWithJwtAssertion;if(u==="authorizationCode"&&e&&"x-usePkce"in e&&e["x-usePkce"])return Ce.AuthorizationCodeWithPkce;switch(u){case"implicit":return Ce.Implicit;case"password":return Ce.Password;case"clientCredentials":return Ce.ClientCredentials;case"authorizationCode":return Ce.AuthorizationCode;default:return Ce.AuthorizationCode}}function _Du(u,e){const a=u?.security;if(!a?.length)return[];const n=PDu(a).flat().filter(i=>i.schemeId===e).find(i=>of(i)===ke.OAuth2);return _2(n)}function _2(u){return Object.entries(u?.flows||{}).map(([e,a])=>$Du(e,a)).filter(Boolean)}async function ME(u){try{const e=await Klu(u),a=await ZH(u);return{absolutePath:u,file:new File([e],a)}}catch(e){return console.error("Failed to init replay file",e),null}}async function mZ(u){return(await Promise.allSettled(u.map(a=>ME(a)))).map(a=>a.status==="fulfilled"?a.value:null).filter(a=>a!==null)}async function LDu(u,e,a,t,r,n){const i=await Promise.all(u.sourceDescriptions.map(async s=>({name:s.name,url:s.url,type:s.type,apiId:await IDu({projectPath:t,apiUrl:s.url,collectionId:e})}))),o={inputs:u.components?.inputs||{},parameters:Object.fromEntries(Object.entries(u.components?.parameters||{}).map(([s,l])=>[s,{...l,key:l.name,value:l.value,id:crypto.randomUUID(),active:!0}]))};return{...u,id:e,srcType:a,state:Ru.Normal,sourceDescriptions:i,components:o,workflows:await Promise.all(u.workflows.map(async s=>({...s,state:Ru.Normal,parameters:aT(s.parameters,s["x-replay-disabled-parameters"],u.components?.parameters),outputs:eT(s.outputs),security:QM(s["x-security"]),steps:await Promise.all(s.steps.map(async l=>{const c=aT(l.parameters,l["x-replay-disabled-parameters"],u.components?.parameters),d=l["x-operation"]??null;d&&(d.url=jE(d.url,c.queryParameters.filter(U$)));const E=KDu(l,i,r);let p;if(E&&n){const x=r?.find(f=>f.id===E.apiId);p=n(E.path,E.method,x)}delete l.operationId,delete l["x-operation"];const h=await JDu(l.requestBody,t);return{...l,state:Ru.Normal,parameters:c,outputs:eT(l.outputs),successCriteria:l.successCriteria?.map(x=>({...x,type:x.type??y0.SIMPLE}))||[],requestBody:h,xOperation:d,security:QM(l["x-security"],p),operation:E}}))})))}}async function IDu({projectPath:u,apiUrl:e,collectionId:a}){if(Iy(e))return e;if(await da.isAbsolute(e))return await da.relative(u,e);const t=await da.resolve(await da.join(u,a,"..",e));return await da.relative(u,t)}function KDu(u,e,a){if(u["x-operation"])return null;const{path:t,method:r,apiId:n,isAdditionalOperation:i}=xZ({operationPath:u.operationPath,parsedSourceDescriptions:e}),{operationId:o,apiId:s}=VDu({operationId:u.operationId,parsedSourceDescriptions:e}),l=s||n||e[0]?.apiId||"",c=a?.find(d=>d.id===l);if(o&&c&&!t&&!r){const d=ZDu(o,c);return{apiId:l,path:d?.path??"",method:d?.method??"",operationId:o,isAdditionalOperation:d?.isAdditionalOperation??!1}}return{apiId:l,path:t??"",method:r??"",operationId:o,isAdditionalOperation:i}}function VDu({operationId:u,parsedSourceDescriptions:e}){if(!u)return{operationId:"",apiId:null};const a=u.split(".");if(a.length===1)return{operationId:u,apiId:e[0]?.apiId??""};const[,t,r=""]=a,n=e.find(({name:i})=>i===t);return{operationId:r,apiId:n?.apiId??""}}function JM(u){return"reference"in u&&typeof u.reference=="string"}function xZ({operationPath:u,parsedSourceDescriptions:e}){if(!u)return{apiId:null,path:"",method:"",isAdditionalOperation:!1};try{const a=u.split("#"),t=a.length>1?a[1]:a[0],r=a.length>1?a[0]:"";if(!t)return{path:"",method:"",apiId:null,isAdditionalOperation:!1};let n=null,i=null;const o=/\$sourceDescriptions\.(.+)\.url/,s=r.match(o);if(s&&(n=s[1]),n){const p=e.find(({name:h})=>h===n);p&&(i=p.apiId)}const l=t.split("/"),c=l.pop()||"",d=l[l.length-1]==="additionalOperations";return d&&l.pop(),{path:Cd.unescape(l.pop()||""),method:c.toLowerCase(),apiId:i,isAdditionalOperation:d}}catch{return{path:"",method:"",apiId:null,isAdditionalOperation:!1}}}function GDu(u){switch(u.type){case"apiKey":return ke.APIKey;case"oauth2":return ke.OAuth2;case"openIdConnect":return ke.OpenIDConnect;case"http":return u.scheme==="basic"?ke.BasicAuth:u.scheme==="digest"?ke.DigestAuth:u.scheme==="bearer"?ke.JWT:ke.NoAuth;default:return ke.NoAuth}}function hZ(u,e){const a={clientCredentials:Ce.ClientCredentials,authorizationCode:Ce.AuthorizationCode,implicit:Ce.Implicit,password:Ce.Password,clientCredentialsWithJwtAssertion:Ce.ClientCredentialsWithJwtAssertion,authorizationCodeWithPkce:Ce.AuthorizationCodeWithPkce};return u==="clientCredentials"&&e["x-assertionType"]==="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"?Ce.ClientCredentialsWithJwtAssertion:u==="authorizationCode"&&e["x-usePkce"]?Ce.AuthorizationCodeWithPkce:a[u]??null}function HDu(u){return{query:St.Query,header:St.Header,cookie:St.Cookie}[u.toLowerCase()]||St.Header}function qDu(u){return{body:S0.Body,header:S0.Header,url:S0.URL}[u.toLowerCase()]||S0.URL}function UM(u,e,a){return Object.keys(u).reduce((t,r)=>{const n=hZ(r,u[r]);if(!n)return t;switch(n){case Ce.ClientCredentials:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Ce.AuthorizationCode:t[n]={...a[n],clientId:e.clientId??"",clientSecret:e.clientSecret??"",tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:u[r].availableScopes??[],scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Ce.Implicit:t[n]={...a[n],clientId:e.clientId??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:rs(u[r].availableScopes),scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),accessToken:e.accessToken??""};break;case Ce.Password:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",username:e.username??"",password:e.password??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Ce.ClientCredentialsWithJwtAssertion:t[n]={...a[n],clientAssertion:e.clientAssertion??"",tokenUrl:u[r].tokenUrl??"",scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break;case Ce.AuthorizationCodeWithPkce:t[n]={...a[n],tokenUrl:u[r].tokenUrl??"",authorizationUrl:u[r].authorizationUrl??"",callbackUrl:e.callbackUrl??"",availableScopes:rs(u[r].availableScopes),scopes:rs(u[r].scopes,u[r]["x-replay-disabled-scopes"]),codeVerifier:e.codeVerifier??"",codeChallenge:e.codeChallenge??"",clientId:e.clientId??"",clientSecret:e.clientSecret??"",accessToken:e.accessToken??""};break}return t},a)}function ZM(u,e,a){const r={...bn(),securityType:u},n=Object.keys(e.flows||{})[0],i=hZ(n,e.flows?.[n])??Ce.ClientCredentials;switch(u){case ke.BasicAuth:return{...r,[ke.BasicAuth]:{username:a.username,password:a.password,schemeName:e.id}};case ke.JWT:return{...r,[ke.JWT]:{token:a.token,schemeName:e.id}};case ke.DigestAuth:return{...r,[ke.DigestAuth]:{...r[ke.DigestAuth],username:a.username,password:a.password,schemeName:e.id}};case ke.APIKey:return{...r,[ke.APIKey]:{location:HDu(e.in),name:e.name,key:a.apiKey,schemeName:e.id}};case ke.OAuth2:return{...r,[ke.OAuth2]:{...r[ke.OAuth2],...UM(e.flows||{},a||{},r[ke.OAuth2]),authRequestExtraParams:YM(a.authRequestExtraParams),tokenRequestExtraParams:XM(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};case ke.OpenIDConnect:return{...r,[ke.OpenIDConnect]:{...r[ke.OpenIDConnect],...UM(a.flows||{},a||{},r[ke.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:YM(a.authRequestExtraParams),tokenRequestExtraParams:XM(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};default:return r}}function WDu(u,e){return[...u.map(t=>{if("scheme"in t){const n=GDu(t.scheme);return ZM(n,t.scheme,t.values)}const r=e.find(n=>n.id===t.schemeName);if(r){const n=of(r),i=ZM(n,r,t.values);return i.securitySchemeId=r.id,i}return bn()})]}function QM(u=[],e){const a=pZ(e?.security||[]);return u.length?WDu(u,a):[bn()]}function rs(u,e){const a=Qi(u||{}),t=Qi(e||{});return[...a,...t,st()]}function YM(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(Jt())}function XM(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:qDu(e.in)})).concat(T2())}function eT(u){if(!u)return[Jt()];const e=[];for(const a in u)e.push({id:crypto.randomUUID(),key:a,value:u[a],active:!0});return e.push(Jt()),e}const wm={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function uT(u,e){const a="$components.parameters.";if(u.reference.startsWith(a)){const t=u.reference.replace(a,"");return e?.[t]}}function aT(u,e,a){if(!u&&!e)return{pathParameters:[ya("path")],queryParameters:[ya("query")],headers:[ya("header")],cookies:[ya("cookie")]};const t={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(u)for(const r of u)if(JM(r)){const n=uT(r,a),i=wm[n?.in];i&&t[i].push({reference:r.reference,active:!0,value:r.value})}else t[wm[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!0,in:r.in});if(e)for(const r of e)if(JM(r)){const n=uT(r,a),i=wm[n?.in];i&&t[i].push({reference:r.reference,active:!1,value:r.value})}else t[wm[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!1,in:r.in});return t.pathParameters.push(ya("path")),t.queryParameters.push(ya("query")),t.headers.push(ya("header")),t.cookies.push(ya("cookie")),t}async function JDu(u,e){const a=lZ().body;if(!u)return a;switch(u.contentType){case"application/x-www-form-urlencoded":case"multipart/form-data":return{...a,type:u.contentType,formData:await UDu(u,e)};case"application/octet-stream":const t=u.payload?await DZ(u.payload,e):[],r=t.length>0?await ME(t[0]):null;return{...a,type:u.contentType,binary:r};case"application/json":case"application/ld+json":return{...a,type:u.contentType,content:rT(u.payload)};default:{const n=typeof u.payload=="string",i=u.contentType||(n?"text/plain":"application/json");return{...a,type:i,content:n?u.payload:rT(u.payload)}}}}async function tT(u,e,a,t){const r=await DZ(e,t),n=r.length>0||Array.isArray(e),i=n?await mZ(r):void 0;return{id:crypto.randomUUID(),key:u,value:n?"":e,type:n?"file":"text",active:a,files:i}}async function UDu(u,e){const a=lZ().body.formData,t=u.contentType,r=u.payload?await Promise.all(Object.entries(u.payload).map(([o,s])=>tT(o,s,!0,e))):[],n=u["x-replay-disabled-payload"]?await Promise.all(Object.entries(u["x-replay-disabled-payload"]||{}).map(([o,s])=>tT(o,s,!1,e))):[];return{...a,[t]:[...r,...n,ys()]}}function rT(u){return u?JSON.stringify(u,null,2):""}function ZDu(u,e){for(const a of Object.keys(e.paths)){const t=e.paths[a];for(const r of Object.keys(t)){const n=r.toLowerCase();if(["get","put","post","delete","options","head","patch","trace"].includes(n)&&t[n]?.operationId===u)return{method:n,path:a,isAdditionalOperation:!1}}if(t.additionalOperations){for(const[r,n]of Object.entries(t.additionalOperations))if(n?.operationId===u)return{method:r.toLowerCase(),path:a,isAdditionalOperation:!0}}}return null}async function DZ(u,e){return Array.isArray(u)?(await Promise.all(u.map(a=>nT(a,e)))).flat():typeof u=="string"?await nT(u,e):[]}async function nT(u,e){const a=/\$file\(['"](.+?)['"]\)/g,t=Array.from(u.matchAll(a));return Promise.all(t.map(r=>QDu(r[1],e)))}async function QDu(u,e){return await da.isAbsolute(u)?u:await da.resolve(await da.join(e,u))}const U0=u=>!u||typeof u=="boolean"?{type:"object",properties:{}}:u.type?u:{...u,type:"object"},iT=(u,e,a)=>{if(!u.properties)return u;const t=u.properties[e],r=U0(t);return{...u,properties:{...u.properties,[e]:{...r,...a}}}},YDu=(u,e,a)=>{if(!u.properties||e===a||!a.trim())return null;const t={...u.properties};return t[a]?null:(t[a]=t[e],delete t[e],{...u,properties:t})},XDu=(u,e)=>{if(!u.properties)return u;const a={...u.properties};return delete a[e],{...u,properties:a}},efu=(u,e,a={type:"string"})=>{const t=u.properties||{};return{...u,type:"object",properties:{...t,[e]:a}}};function oT(u){const e=Object.assign({},...(u||[]).filter(({key:a,active:t})=>a&&t).map(a=>({[a.key]:a.value})));if(Object.keys(e).length!==0)return e}function sT(u){if(!u)return{};const e={queryParameters:"query",headers:"header",cookies:"cookie",pathParameters:"path"},a=[],t=[];return Object.keys(e).forEach(r=>{const n=r;u[n].forEach(i=>{if(oo(i)){const o={reference:i.reference,value:i.value||void 0};i.active?a.push(o):t.push(o)}else{if(!i.key)return;const o={name:i.key,in:e[n],value:i.value};i.active?a.push(o):t.push(o)}})}),{parameters:a.length>0?a:void 0,"x-replay-disabled-parameters":t.length>0?t:void 0}}function ufu(u){const e=u?.map(a=>({condition:a.condition,context:a.context,type:a.type==y0.SIMPLE?void 0:a.type}));if(e?.length!==0)return e}function afu(u){if(!(!u||u.length===0))return[...u]}async function fZ(u,e){return u.absolutePath?`$file('${await da.relative(e,u.absolutePath)}')`:null}async function tfu(u,e){const{type:a,value:t,files:r}=u;switch(a){case"text":return t;case"file":let n=[];return r&&(n=(await Promise.all(Object.values(r).map(i=>fZ(i,e)))).filter(i=>i!==null)),n.length===0?"":n.length===1?n[0]:n}}async function rfu(u,e){const a=u.type,t=u.formData[a],r={},n={};return await Promise.all(t.map(async i=>{const{key:o,active:s}=i;if(!o)return;const l=await tfu(i,e);s?r[o]=l:n[o]=l})),{payload:Object.keys(r).length>0?r:void 0,"x-replay-disabled-payload":Object.keys(n).length>0?n:void 0}}function nfu(u){if(!u)return u;try{const e=JSON.parse(u);return typeof e=="object"?e:u}catch{return u}}async function ifu(u,e){if(u)switch(u.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:u.type,...await rfu(u,e)};case"application/octet-stream":return{contentType:u.type,payload:u.binary?await fZ(u.binary,e):null};case"application/json":case"application/ld+json":return u.content?{contentType:u.type,payload:nfu(u.content)}:void 0;default:return u.content?{contentType:u.type,payload:u.content}:void 0}}function ofu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:u.username,password:u.password}}}function sfu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"apiKey",name:u.name,in:u.location.toLowerCase()}},values:{apiKey:u.key}}}function lfu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:u.token}}}function cfu(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:u.username,password:u.password}}}function dfu(u){const{flows:e,values:a}=kZ(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...a,openIdConnectUrl:u.openIdConnectUrl,userInfoUrl:u.userInfoUrl,authRequestExtraParams:gZ(u.authRequestExtraParams),tokenRequestExtraParams:vZ(u.tokenRequestExtraParams)}}}function Efu(u){const{flows:e,values:a}=kZ(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...a,authRequestExtraParams:gZ(u.authRequestExtraParams),tokenRequestExtraParams:vZ(u.tokenRequestExtraParams)}}}function Pl(u){const e={},a={};return u.forEach(t=>{t.value&&(t.active?e[t.value]=t.description:a[t.value]=t.description)}),{scopes:e,"x-replay-disabled-scopes":Object.keys(a).length>0?a:void 0}}function gZ(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function vZ(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active,in:e.sendIn.toLowerCase()}))}function kZ(u){let e;switch(u.grantType){case Ce.ClientCredentials:return e=u[Ce.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Pl(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken}};case Ce.Implicit:return e=u[Ce.Implicit],{flows:{implicit:{authorizationUrl:e.authorizationUrl,...Pl(e.scopes)}},values:{clientId:e.clientId,accessToken:e.accessToken,callbackUrl:e.callbackUrl}};case Ce.Password:return e=u[Ce.Password],{flows:{password:{tokenUrl:e.tokenUrl,...Pl(e.scopes)}},values:{clientId:e.clientId,clientSecret:e.clientSecret,username:e.username,password:e.password,accessToken:e.accessToken}};case Ce.AuthorizationCode:return e=u[Ce.AuthorizationCode],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Pl(e.scopes)}},values:{accessToken:e.accessToken,clientId:e.clientId,callbackUrl:e.callbackUrl}};case Ce.ClientCredentialsWithJwtAssertion:return e=u[Ce.ClientCredentialsWithJwtAssertion],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...Pl(e.scopes),"x-assertionType":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}},values:{clientId:e.clientId,clientAssertion:e.clientAssertion,accessToken:e.accessToken}};case Ce.AuthorizationCodeWithPkce:return e=u[Ce.AuthorizationCodeWithPkce],{flows:{authorizationCode:{tokenUrl:e.tokenUrl,authorizationUrl:e.authorizationUrl,...Pl(e.scopes),"x-usePkce":!0}},values:{clientId:e.clientId,clientSecret:e.clientSecret,accessToken:e.accessToken,codeVerifier:e.codeVerifier,codeChallenge:e.codeChallenge,callbackUrl:e.callbackUrl}}}}function lT(u){const e=u.map(a=>{switch(a.securityType){case ke.OpenIDConnect:{const r=a[ke.OpenIDConnect];return dfu(r)}case ke.OAuth2:{const r=a[ke.OAuth2];return Efu(r)}case ke.APIKey:{const r=a[ke.APIKey];return sfu(r)}case ke.BasicAuth:{const r=a[ke.BasicAuth];return ofu(r)}case ke.DigestAuth:{const r=a[ke.DigestAuth];return cfu(r)}case ke.JWT:{const r=a[ke.JWT];return lfu(r)}default:return null}}).filter(a=>a!==null);return{"x-security":e.length?e:void 0}}function pfu(u){const{inputs:e,parameters:a,...t}=u;let r=t;return Object.keys(e).length&&(r.inputs=e),Object.keys(a).length&&(r.parameters=Object.fromEntries(Object.entries(a).map(([n,{id:i,active:o,key:s,...l}])=>[n,{...l,name:s}]))),Object.keys(r).length||(r=void 0),r}async function mfu(u,e){const{id:a,state:t,srcType:r,sourceDescriptions:n,workflows:i,components:o,...s}=u;return{arazzoObject:{...s,sourceDescriptions:n.map(l=>({name:l.name,url:l.url,type:l.type||"openapi"})),components:pfu(o),workflows:await Promise.all(i.map(async({parameters:l,security:c,dependsOn:d,outputs:E,state:p,steps:h,inputs:x,...f})=>({...f,dependsOn:afu(d),outputs:oT(E),inputs:x?U0(x):void 0,...lT(c),...sT(l),steps:await Promise.all(h.map(async({parameters:D,security:g,operation:k,requestBody:C,successCriteria:v,outputs:b,state:F,xOperation:B,...S})=>{const P={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(k){const L=u.sourceDescriptions.find(({apiId:N})=>N===k.apiId)||u.sourceDescriptions[0];if(k.operationId){const N=u.sourceDescriptions.length<=1;P.operationId=N?k.operationId:`$sourceDescriptions.${L.name}.${k.operationId}`}else P.operationPath=k.isAdditionalOperation?`{$sourceDescriptions.${L.name}.url}#/paths/${Cd.escape(k.path)}/additionalOperations/${k.method}`:`{$sourceDescriptions.${L.name}.url}#/paths/${Cd.escape(k.path)}/${k.method}`}else B&&(P["x-operation"]={...B,url:B.url.split("?")[0]});return{...S,...P,...lT(g),...sT(D),requestBody:await ifu(C,e),successCriteria:ufu(v),outputs:oT(b)}}))})))}}}class xfu extends eq{constructor(e,a){super(e),this.convertOperationToReplayValue=a}parse(e,a){return LDu(e.content,e.uri,e.type,this.storage.baseDir,a,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:a}=await mfu(e,this.storage.baseDir);return await da.extname(e.id)===".json"?JSON.stringify(a,null,2):Do.dump(a)}}class hfu{constructor(e,a){this.storage=e,this.localStorageSecretsProvider=a}default=[];async read(){const e=await this.storage.get("replay-environments.yaml"),a=await this.localStorageSecretsProvider.get();let t=null,r=null;if(!e)return this.default;try{t=Do.load(e),r=a?JSON.parse(a):null}catch(o){return console.error("Failed to parse environments file",o),this.default}return t?Object.keys(t).filter(o=>o!=="version").map(o=>({name:o,inputs:Object.entries(t[o].inputs).map(([s,l])=>{if(typeof l=="string")return{name:s,value:l,isSecret:!1};const c=r?.[o]?.[s]??"";return{name:s,value:c,isSecret:!0}}),servers:Object.entries(t[o].servers).map(([s,l])=>({apiId:s,value:l.value,variables:Object.entries(l.variables||{}).map(([c,d])=>({name:c,value:d}))})),state:Ru.Normal})):this.default}async write(e){const a=await this.localStorageSecretsProvider.get(),t=a?JSON.parse(a):{},r=e.reduce((n,i)=>(i.name&&(n[i.name]={inputs:i.inputs.reduce((o,s)=>(s.isSecret&&t?(t[i.name]||(t[i.name]={}),t[i.name][s.name]=s.value,o[s.name]={provider:"local"}):o[s.name]=s.value,o),{}),servers:i.servers.reduce((o,s)=>(o[s.apiId]={value:s.value,variables:Object.fromEntries(s.variables.map(l=>[l.name,l.value]))},o),{})}),n),{});this.localStorageSecretsProvider.set(JSON.stringify(t)),r&&this.storage.set("replay-environments.yaml",Do.dump(r))}}class Dfu{constructor(e,a,t){this.storage=e,this.filePath=a,this.defaultValue=t}async parse(e){return JSON.parse(e)}stringify(e){return JSON.stringify(e)}async read(){const e=await this.storage.get(this.filePath);return e?await this.parse(e):this.defaultValue}async write(e){return this.storage.set(this.filePath,this.stringify(e))}}const ffu=(u,e)=>({data:u,version:e});class ZC extends Dfu{constructor(e,a,t,r){super(e,a,t),this.version=r}migrationMap={};migrate(e){if(!this.migrationMap[e.version])return this.defaultValue;const a=this.migrationMap[e.version](e);return a.version===this.version?a:this.migrate(a)}async parse(e){const a=JSON.parse(e);if(a.version!==this.version){const t=this.migrate(a);return await this.write(t.data),t.data}return a.data}stringify(e){return JSON.stringify(ffu(e,this.version))}}function gfu(u){return{data:{...u.data,tabs:u.data.tabs.map(e=>e.data.type===We.Step?{...e,data:{...e.data,draftStep:{...e.data.step,security:e.data.step.security.securities},step:void 0,hasUnsavedChanges:void 0,showUnsavedChangesModal:void 0}}:e)},version:2}}const cT=2,vfu="tabs.json";class kfu extends ZC{migrationMap={1:gfu};constructor(e){super(e,vfu,ii(JH),cT)}async parse(e){let a=JSON.parse(e);a.version!==cT&&(a=this.migrate(a));const t=await Promise.all(a.data.tabs.map(async r=>{if(r.data.type===We.Step&&r.data.draftStep){const n=r.data.draftStep.requestBody.formData;n["multipart/form-data"]=await dT(n["multipart/form-data"]),n["application/x-www-form-urlencoded"]=await dT(n["application/x-www-form-urlencoded"]),r.data.draftStep.requestBody.binary&&r.data.draftStep.requestBody.binary.absolutePath&&(r.data.draftStep.requestBody.binary=await ME(r.data.draftStep.requestBody.binary.absolutePath))}return r}));return{...a.data,tabs:t}}stringify(e){return super.stringify({...e,tabs:e.tabs.map(a=>a.data.type===We.Step?{...a,data:{...a.data,response:null}}:a.data.type===We.WorkflowRun?{...a,data:{...a.data,result:null}}:a)})}}async function dT(u){return Promise.all(u.map(async e=>{const a={...e};if(e.files){const t=e.files.map(r=>r.absolutePath).filter(r=>r!==null);a.files=await mZ(t)}return a}))}const bfu=1,Cfu=1;class Ffu{constructor(e,a,t){this.project=e,this.convertOperationToReplayValue=a,this.telemetry=t,this.localStorageSecretsProvider=new Qlu(this.project.id),this.systemFilesStorage=this.isTauriApp?new sO(this.project.systemFilesDir):new oO(this.project.systemFilesDir),this.userFilesStorage=this.isTauriApp?new sO(this.project.userFilesDir):new oO(this.project.userFilesDir);const r=new Ulu;this.historyStorage=new ZC(this.systemFilesStorage,"history.json",[],bfu),this.activeEnvironmentIdStorage=new ZC(this.systemFilesStorage,"active_environment_id.json",bE,Cfu),this.tabsStateStorage=new kfu(this.systemFilesStorage),this.environmentsStorage=new hfu(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new xfu(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new Ylu(this.isTauriApp?this.userFilesStorage:r)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;isTauriApp=pc();systemFilesStorage;localStorageSecretsProvider;userFilesStorage;async detectProjectFiles(){const a=(await this.userFilesStorage.ls()).filter(i=>/\.(ya?ml|json)$/.test(i)),t=[],r=[],n=new Set;return await Promise.all(a.map(async i=>{const o=await this.userFilesStorage.get(i);if(o)try{const s=Do.load(o);if(typeof s=="object"&&s!==null)if(typeof s.openapi=="string"){const l=await da.resolve(await da.join(this.userFilesStorage.baseDir,i)),c=await iO(l,s);t.push({uri:i,type:ln.FS,content:c})}else typeof s.arazzo=="string"&&(r.push({uri:i,type:ln.FS,content:s}),s.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=typeof d=="string"&&Iy(d);E&&p&&n.add(d)}))}catch(s){console.error(`Error parsing YAML/JSON file ${i}:`,s)}})),{apiFiles:t,collectionFiles:r,apiUrls:n,filesCount:a.length}}async loadApis(e){const a=[];return await Promise.all(Array.from(e).map(async t=>{try{const r=await iO(t);a.push({uri:t,type:ln.WEB,content:r})}catch(r){console.error(`Error parsing YAML from ${t}:`,r)}})),a}async read(){const e=this.telemetry?.startSpan("storage.read",void 0,void 0),a=this.telemetry?.startSpan("storage.loadUserState",{},e?.parentCtx),[t,r,n,i]=await Promise.all([this.historyStorage.read(),this.activeEnvironmentIdStorage.read(),this.tabsStateStorage.read(),this.environmentsStorage.read()]);a?.setAttribute("status","completed"),a?.setAttribute("historyCount",t.length),a?.setAttribute("environmentCount",i.length),a?.setStatus(mr.OK),a?.end();const o=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{apiFiles:s,collectionFiles:l,apiUrls:c,filesCount:d}=await this.detectProjectFiles();o?.setAttribute("status","completed"),o?.setAttribute("filesCount",d),o?.setAttribute("apiFilesCount",s.length),o?.setAttribute("collectionFilesCount",l.length),o?.setAttribute("apiUrlsCount",c.size),o?.setStatus(mr.OK),o?.end();const E=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:c.size},e?.parentCtx),p=await this.loadApis(c);E?.setAttribute("status","completed"),E?.setStatus(mr.OK),E?.end();const h=this.telemetry?.startSpan("storage.parseApis",{},e?.parentCtx),x=await this.apisStorage.parseMany([...s,...p]);h?.setAttribute("status","completed"),h?.setAttribute("apisCount",s.length+p.length),h?.setStatus(mr.OK),h?.end();const f=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:l.length},e?.parentCtx),D=await this.collectionsStorage.parseMany(l,x);return f?.setAttribute("status","completed"),f?.setStatus(mr.OK),f?.end(),e?.setAttribute("status","completed"),e?.setStatus(mr.OK),e?.end(),{project:this.project,history:t,activeEnvironmentId:r,tabsState:n,environments:i,apis:x,collections:D}}async update(e,a){switch(e.path[0]){case"history":this.historyStorage.write(a.history.get());break;case"activeEnvironmentId":this.activeEnvironmentIdStorage.write(a.activeEnvironmentId.get());break;case"tabsState":this.tabsStateStorage.write(a.tabsState.get());break;case"environments":this.environmentsStorage.write(a.environments.get());break;case"apis":this.isTauriApp&&await this.apisStorage.update(e,a.apis.get());break;case"collections":await this.collectionsStorage.update(e,a.collections.get());break}}}function bZ(u=!1){let e,a=!1;return()=>({id:"RootStoragePlugin",onCreate:()=>({init:t=>async(r,n,i)=>{if(a||t.path.length>0)return{isInitialized:!1};if(a=!0,!u){e=new Ffu(r,n,i);const o=await e.read();t.merge(o)}return a=!1,{isInitialized:!0}}}),onSet(t,r,n){a||u||e.update(r,n)}})}function CZ({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:ii(JH),activeEnvironmentId:bE,environments:u||WH,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:Gr.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const yfu=H$(CZ(),q$(Tlu({key:"replay-root-store"}),bZ())),L2=_.createContext(yfu),Afu=L2.Provider;function Bu(){const u=_.useContext(L2);return W$(u)}function Bfu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const Sfu=Bfu(),zfu=_.createContext(Sfu);function Cn(){const u=_.useContext(zfu);return W$(u)}function wfu(u,e){const{apps:{apiId:a}}=Bu(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=Cn();t.set(u?.corsProxyUrl??flu),n.set(u?.mockServer),a.set(u?.apiId),i.set(u?.oAuth2RedirectURI),r.set(!!u?.disableCollectionsTab),s.set(u?.storageKey),l.set(!!e),_.useEffect(()=>{o.set(u?.certificates||[])},[u?.certificates])}const sf=_.createContext({});function bc(){return _.useContext(sf)||{}}const Ofu="0.19.0-custom.4",Pfu={version:Ofu};class jfu{client;_isInitialized=!1;constructor(){this.client=new Dlu}get isInitialized(){return this._isInitialized}init(e){if(this.isInitialized)return;const a=!0,t=e?.tracerName||"desktop",r=e?.enableErrorInstrumentation??t==="desktop",n={serviceName:"replay",serviceVersion:Pfu.version,version:"1.0.0",tracerName:t,collectorUrl:e?.collectorUrl||"",isProd:a,enableErrorInstrumentation:r};this.client.init({otel:{...e,...n}}),this._isInitialized=!0}sendEvent(e,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{this.client.send(e,a)}catch(t){console.error("Failed to send telemetry event:",t)}}startSpan(e,a,t){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this.client.startSpan(e,a,t)}catch(r){console.error("Failed to start telemetry span:",r);return}}}const Om=new jfu;function vu(){const{telemetry:u}=bc();return Om.isInitialized||Om.init({tracerName:u?.tracerName,collectorUrl:u?.collectorUrl,enableErrorInstrumentation:u?.enableErrorInstrumentation}),{sendEvent:(e,a)=>{Om.sendEvent(e,a)},startSpan:(e,a,t)=>Om.startSpan(e,a,t)}}const w0=800;function Ls(u){"@babel/helpers - typeof";return Ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ls(u)}function Mfu(u,e){if(Ls(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Ls(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function FZ(u){var e=Mfu(u,"string");return Ls(e)=="symbol"?e:e+""}function N4(u,e,a){return(e=FZ(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function ET(u,e){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(u);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(u,r).enumerable})),a.push.apply(a,t)}return a}function Ye(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ET(Object(a),!0).forEach(function(t){N4(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):ET(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function Tfu(u){if(Array.isArray(u))return u}function Rfu(u,e){var a=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(a!=null){var t,r,n,i,o=[],s=!0,l=!1;try{if(n=(a=a.call(u)).next,e===0){if(Object(a)!==a)return;s=!1}else for(;!(s=(t=n.call(a)).done)&&(o.push(t.value),o.length!==e);s=!0);}catch(c){l=!0,r=c}finally{try{if(!s&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(l)throw r}}return o}}function QC(u,e){(e==null||e>u.length)&&(e=u.length);for(var a=0,t=Array(e);a<e;a++)t[a]=u[a];return t}function yZ(u,e){if(u){if(typeof u=="string")return QC(u,e);var a={}.toString.call(u).slice(8,-1);return a==="Object"&&u.constructor&&(a=u.constructor.name),a==="Map"||a==="Set"?Array.from(u):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?QC(u,e):void 0}}function Nfu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
519
519
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function di(u,e){return Tfu(u)||Rfu(u,e)||yZ(u,e)||Nfu()}function $fu(u,e){if(u==null)return{};var a={};for(var t in u)if({}.hasOwnProperty.call(u,t)){if(e.indexOf(t)!==-1)continue;a[t]=u[t]}return a}function yi(u,e){if(u==null)return{};var a,t,r=$fu(u,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);for(t=0;t<n.length;t++)a=n[t],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(u,a)&&(r[a]=u[a])}return r}var _fu=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Lfu(u){var e=u.defaultInputValue,a=e===void 0?"":e,t=u.defaultMenuIsOpen,r=t===void 0?!1:t,n=u.defaultValue,i=n===void 0?null:n,o=u.inputValue,s=u.menuIsOpen,l=u.onChange,c=u.onInputChange,d=u.onMenuClose,E=u.onMenuOpen,p=u.value,h=yi(u,_fu),x=_.useState(o!==void 0?o:a),f=di(x,2),D=f[0],g=f[1],k=_.useState(s!==void 0?s:r),C=di(k,2),v=C[0],b=C[1],F=_.useState(p!==void 0?p:i),B=di(F,2),S=B[0],P=B[1],L=_.useCallback(function(ie,xe){typeof l=="function"&&l(ie,xe),P(ie)},[l]),N=_.useCallback(function(ie,xe){var j;typeof c=="function"&&(j=c(ie,xe)),g(j!==void 0?j:ie)},[c]),K=_.useCallback(function(){typeof E=="function"&&E(),b(!0)},[E]),X=_.useCallback(function(){typeof d=="function"&&d(),b(!1)},[d]),J=o!==void 0?o:D,ue=s!==void 0?s:v,de=p!==void 0?p:S;return Ye(Ye({},h),{},{inputValue:J,menuIsOpen:ue,onChange:L,onInputChange:N,onMenuClose:X,onMenuOpen:K,value:de})}function tu(){return tu=Object.assign?Object.assign.bind():function(u){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var t in a)({}).hasOwnProperty.call(a,t)&&(u[t]=a[t])}return u},tu.apply(null,arguments)}function Ifu(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function pT(u,e){for(var a=0;a<e.length;a++){var t=e[a];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,FZ(t.key),t)}}function Kfu(u,e,a){return e&&pT(u.prototype,e),a&&pT(u,a),Object.defineProperty(u,"prototype",{writable:!1}),u}function YC(u,e){return YC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,t){return a.__proto__=t,a},YC(u,e)}function Vfu(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),e&&YC(u,e)}function F5(u){return F5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F5(u)}function AZ(){try{var u=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AZ=function(){return!!u})()}function Gfu(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Hfu(u,e){if(e&&(Ls(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gfu(u)}function qfu(u){var e=AZ();return function(){var a,t=F5(u);if(e){var r=F5(this).constructor;a=Reflect.construct(t,arguments,r)}else a=t.apply(this,arguments);return Hfu(this,a)}}function Wfu(u){if(Array.isArray(u))return QC(u)}function Jfu(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function Ufu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
520
520
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I2(u){return Wfu(u)||Jfu(u)||yZ(u)||Ufu()}function Zfu(u){if(u.sheet)return u.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===u)return document.styleSheets[e]}function Qfu(u){var e=document.createElement("style");return e.setAttribute("data-emotion",u.key),u.nonce!==void 0&&e.setAttribute("nonce",u.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Yfu=(function(){function u(a){var t=this;this._insertTag=function(r){var n;t.tags.length===0?t.insertionPoint?n=t.insertionPoint.nextSibling:t.prepend?n=t.container.firstChild:n=t.before:n=t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(r,n),t.tags.push(r)},this.isSpeedy=a.speedy===void 0?process.env.NODE_ENV==="production":a.speedy,this.tags=[],this.ctr=0,this.nonce=a.nonce,this.key=a.key,this.container=a.container,this.prepend=a.prepend,this.insertionPoint=a.insertionPoint,this.before=null}var e=u.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Qfu(this));var r=this.tags[this.tags.length-1];if(process.env.NODE_ENV!=="production"){var n=t.charCodeAt(0)===64&&t.charCodeAt(1)===105;n&&this._alreadyInsertedOrderInsensitiveRule&&console.error(`You're attempting to insert the following rule:
521
521
  `+t+"\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."),this._alreadyInsertedOrderInsensitiveRule=this._alreadyInsertedOrderInsensitiveRule||!n}if(this.isSpeedy){var i=Zfu(r);try{i.insertRule(t,i.cssRules.length)}catch(o){process.env.NODE_ENV!=="production"&&!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(t)&&console.error('There was a problem inserting the following rule: "'+t+'"',o)}}else r.appendChild(document.createTextNode(t));this.ctr++},e.flush=function(){this.tags.forEach(function(t){return t.parentNode&&t.parentNode.removeChild(t)}),this.tags=[],this.ctr=0,process.env.NODE_ENV!=="production"&&(this._alreadyInsertedOrderInsensitiveRule=!1)},u})(),k0="-ms-",y5="-moz-",Ku="-webkit-",K2="comm",V2="rule",G2="decl",Xfu="@import",BZ="@keyframes",egu=Math.abs,lf=String.fromCharCode,ugu=Object.assign;function agu(u,e){return c0(u,0)^45?(((e<<2^c0(u,0))<<2^c0(u,1))<<2^c0(u,2))<<2^c0(u,3):0}function SZ(u){return u.trim()}function tgu(u,e){return(u=e.exec(u))?u[0]:u}function Ju(u,e,a){return u.replace(e,a)}function XC(u,e){return u.indexOf(e)}function c0(u,e){return u.charCodeAt(e)|0}function Qd(u,e,a){return u.slice(e,a)}function Ur(u){return u.length}function H2(u){return u.length}function Pm(u,e){return e.push(u),u}function rgu(u,e){return u.map(e).join("")}var cf=1,Q1=1,zZ=0,dt=0,Na=0,Cc="";function df(u,e,a,t,r,n,i){return{value:u,root:e,parent:a,type:t,props:r,children:n,line:cf,column:Q1,length:i,return:""}}function D4(u,e){return ugu(df("",null,null,"",null,null,0),u,{length:-u.length},e)}function ngu(){return Na}function igu(){return Na=dt>0?c0(Cc,--dt):0,Q1--,Na===10&&(Q1=1,cf--),Na}function Ot(){return Na=dt<zZ?c0(Cc,dt++):0,Q1++,Na===10&&(Q1=1,cf++),Na}function pn(){return c0(Cc,dt)}function Bx(){return dt}function TE(u,e){return Qd(Cc,u,e)}function Yd(u){switch(u){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function wZ(u){return cf=Q1=1,zZ=Ur(Cc=u),dt=0,[]}function OZ(u){return Cc="",u}function Sx(u){return SZ(TE(dt-1,eF(u===91?u+2:u===40?u+1:u)))}function ogu(u){for(;(Na=pn())&&Na<33;)Ot();return Yd(u)>2||Yd(Na)>3?"":" "}function sgu(u,e){for(;--e&&Ot()&&!(Na<48||Na>102||Na>57&&Na<65||Na>70&&Na<97););return TE(u,Bx()+(e<6&&pn()==32&&Ot()==32))}function eF(u){for(;Ot();)switch(Na){case u:return dt;case 34:case 39:u!==34&&u!==39&&eF(Na);break;case 40:u===41&&eF(u);break;case 92:Ot();break}return dt}function lgu(u,e){for(;Ot()&&u+Na!==57;)if(u+Na===84&&pn()===47)break;return"/*"+TE(e,dt-1)+"*"+lf(u===47?u:Ot())}function cgu(u){for(;!Yd(pn());)Ot();return TE(u,dt)}function dgu(u){return OZ(zx("",null,null,null,[""],u=wZ(u),0,[0],u))}function zx(u,e,a,t,r,n,i,o,s){for(var l=0,c=0,d=i,E=0,p=0,h=0,x=1,f=1,D=1,g=0,k="",C=r,v=n,b=t,F=k;f;)switch(h=g,g=Ot()){case 40:if(h!=108&&c0(F,d-1)==58){XC(F+=Ju(Sx(g),"&","&\f"),"&\f")!=-1&&(D=-1);break}case 34:case 39:case 91:F+=Sx(g);break;case 9:case 10:case 13:case 32:F+=ogu(h);break;case 92:F+=sgu(Bx()-1,7);continue;case 47:switch(pn()){case 42:case 47:Pm(Egu(lgu(Ot(),Bx()),e,a),s);break;default:F+="/"}break;case 123*x:o[l++]=Ur(F)*D;case 125*x:case 59:case 0:switch(g){case 0:case 125:f=0;case 59+c:p>0&&Ur(F)-d&&Pm(p>32?xT(F+";",t,a,d-1):xT(Ju(F," ","")+";",t,a,d-2),s);break;case 59:F+=";";default:if(Pm(b=mT(F,e,a,l,c,r,o,k,C=[],v=[],d),n),g===123)if(c===0)zx(F,e,b,b,C,n,d,o,v);else switch(E===99&&c0(F,3)===110?100:E){case 100:case 109:case 115:zx(u,b,b,t&&Pm(mT(u,b,b,0,0,r,o,k,r,C=[],d),v),r,v,d,o,t?C:v);break;default:zx(F,b,b,b,[""],v,0,o,v)}}l=c=p=0,x=D=1,k=F="",d=i;break;case 58:d=1+Ur(F),p=h;default:if(x<1){if(g==123)--x;else if(g==125&&x++==0&&igu()==125)continue}switch(F+=lf(g),g*x){case 38:D=c>0?1:(F+="\f",-1);break;case 44:o[l++]=(Ur(F)-1)*D,D=1;break;case 64:pn()===45&&(F+=Sx(Ot())),E=pn(),c=d=Ur(k=F+=cgu(Bx())),g++;break;case 45:h===45&&Ur(F)==2&&(x=0)}}return n}function mT(u,e,a,t,r,n,i,o,s,l,c){for(var d=r-1,E=r===0?n:[""],p=H2(E),h=0,x=0,f=0;h<t;++h)for(var D=0,g=Qd(u,d+1,d=egu(x=i[h])),k=u;D<p;++D)(k=SZ(x>0?E[D]+" "+g:Ju(g,/&\f/g,E[D])))&&(s[f++]=k);return df(u,e,a,r===0?V2:o,s,l,c)}function Egu(u,e,a){return df(u,e,a,K2,lf(ngu()),Qd(u,2,-2),0)}function xT(u,e,a,t){return df(u,e,a,G2,Qd(u,0,t),Qd(u,t+1,-1),t)}function b1(u,e){for(var a="",t=H2(u),r=0;r<t;r++)a+=e(u[r],r,u,e)||"";return a}function pgu(u,e,a,t){switch(u.type){case Xfu:case G2:return u.return=u.return||u.value;case K2:return"";case BZ:return u.return=u.value+"{"+b1(u.children,t)+"}";case V2:u.value=u.props.join(",")}return Ur(a=b1(u.children,t))?u.return=u.value+"{"+a+"}":""}function mgu(u){var e=H2(u);return function(a,t,r,n){for(var i="",o=0;o<e;o++)i+=u[o](a,t,r,n)||"";return i}}function xgu(u){return function(e){e.root||(e=e.return)&&u(e)}}function hgu(u){var e=Object.create(null);return function(a){return e[a]===void 0&&(e[a]=u(a)),e[a]}}var Dgu=function(e,a,t){for(var r=0,n=0;r=n,n=pn(),r===38&&n===12&&(a[t]=1),!Yd(n);)Ot();return TE(e,dt)},fgu=function(e,a){var t=-1,r=44;do switch(Yd(r)){case 0:r===38&&pn()===12&&(a[t]=1),e[t]+=Dgu(dt-1,a,t);break;case 2:e[t]+=Sx(r);break;case 4:if(r===44){e[++t]=pn()===58?"&\f":"",a[t]=e[t].length;break}default:e[t]+=lf(r)}while(r=Ot());return e},ggu=function(e,a){return OZ(fgu(wZ(e),a))},hT=new WeakMap,vgu=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var a=e.value,t=e.parent,r=e.column===t.column&&e.line===t.line;t.type!=="rule";)if(t=t.parent,!t)return;if(!(e.props.length===1&&a.charCodeAt(0)!==58&&!hT.get(t))&&!r){hT.set(e,!0);for(var n=[],i=ggu(a,n),o=t.props,s=0,l=0;s<i.length;s++)for(var c=0;c<o.length;c++,l++)e.props[l]=n[s]?i[s].replace(/&\f/g,o[c]):o[c]+" "+i[s]}}},kgu=function(e){if(e.type==="decl"){var a=e.value;a.charCodeAt(0)===108&&a.charCodeAt(2)===98&&(e.return="",e.value="")}},bgu="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",Cgu=function(e){return e.type==="comm"&&e.children.indexOf(bgu)>-1},Fgu=function(e){return function(a,t,r){if(!(a.type!=="rule"||e.compat)){var n=a.value.match(/(:first|:nth|:nth-last)-child/g);if(n){for(var i=a.parent===r[0],o=i?r[0].children:r,s=o.length-1;s>=0;s--){var l=o[s];if(l.line<a.line)break;if(l.column<a.column){if(Cgu(l))return;break}}n.forEach(function(c){console.error('The pseudo class "'+c+'" is potentially unsafe when doing server-side rendering. Try changing it to "'+c.split("-child")[0]+'-of-type".')})}}}},PZ=function(e){return e.type.charCodeAt(1)===105&&e.type.charCodeAt(0)===64},ygu=function(e,a){for(var t=e-1;t>=0;t--)if(!PZ(a[t]))return!0;return!1},DT=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},Agu=function(e,a,t){PZ(e)&&(e.parent?(console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."),DT(e)):ygu(a,t)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),DT(e)))};function jZ(u,e){switch(agu(u,e)){case 5103:return Ku+"print-"+u+u;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ku+u+u;case 5349:case 4246:case 4810:case 6968:case 2756:return Ku+u+y5+u+k0+u+u;case 6828:case 4268:return Ku+u+k0+u+u;case 6165:return Ku+u+k0+"flex-"+u+u;case 5187:return Ku+u+Ju(u,/(\w+).+(:[^]+)/,Ku+"box-$1$2"+k0+"flex-$1$2")+u;case 5443:return Ku+u+k0+"flex-item-"+Ju(u,/flex-|-self/,"")+u;case 4675:return Ku+u+k0+"flex-line-pack"+Ju(u,/align-content|flex-|-self/,"")+u;case 5548:return Ku+u+k0+Ju(u,"shrink","negative")+u;case 5292:return Ku+u+k0+Ju(u,"basis","preferred-size")+u;case 6060:return Ku+"box-"+Ju(u,"-grow","")+Ku+u+k0+Ju(u,"grow","positive")+u;case 4554:return Ku+Ju(u,/([^-])(transform)/g,"$1"+Ku+"$2")+u;case 6187:return Ju(Ju(Ju(u,/(zoom-|grab)/,Ku+"$1"),/(image-set)/,Ku+"$1"),u,"")+u;case 5495:case 3959:return Ju(u,/(image-set\([^]*)/,Ku+"$1$`$1");case 4968:return Ju(Ju(u,/(.+:)(flex-)?(.*)/,Ku+"box-pack:$3"+k0+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ku+u+u;case 4095:case 3583:case 4068:case 2532:return Ju(u,/(.+)-inline(.+)/,Ku+"$1$2")+u;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ur(u)-1-e>6)switch(c0(u,e+1)){case 109:if(c0(u,e+4)!==45)break;case 102:return Ju(u,/(.+:)(.+)-([^]+)/,"$1"+Ku+"$2-$3$1"+y5+(c0(u,e+3)==108?"$3":"$2-$3"))+u;case 115:return~XC(u,"stretch")?jZ(Ju(u,"stretch","fill-available"),e)+u:u}break;case 4949:if(c0(u,e+1)!==115)break;case 6444:switch(c0(u,Ur(u)-3-(~XC(u,"!important")&&10))){case 107:return Ju(u,":",":"+Ku)+u;case 101:return Ju(u,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ku+(c0(u,14)===45?"inline-":"")+"box$3$1"+Ku+"$2$3$1"+k0+"$2box$3")+u}break;case 5936:switch(c0(u,e+11)){case 114:return Ku+u+k0+Ju(u,/[svh]\w+-[tblr]{2}/,"tb")+u;case 108:return Ku+u+k0+Ju(u,/[svh]\w+-[tblr]{2}/,"tb-rl")+u;case 45:return Ku+u+k0+Ju(u,/[svh]\w+-[tblr]{2}/,"lr")+u}return Ku+u+k0+u+u}return u}var Bgu=function(e,a,t,r){if(e.length>-1&&!e.return)switch(e.type){case G2:e.return=jZ(e.value,e.length);break;case BZ:return b1([D4(e,{value:Ju(e.value,"@","@"+Ku)})],r);case V2:if(e.length)return rgu(e.props,function(n){switch(tgu(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return b1([D4(e,{props:[Ju(n,/:(read-\w+)/,":"+y5+"$1")]})],r);case"::placeholder":return b1([D4(e,{props:[Ju(n,/:(plac\w+)/,":"+Ku+"input-$1")]}),D4(e,{props:[Ju(n,/:(plac\w+)/,":"+y5+"$1")]}),D4(e,{props:[Ju(n,/:(plac\w+)/,k0+"input-$1")]})],r)}return""})}},Sgu=[Bgu],zgu=function(e){var a=e.key;if(process.env.NODE_ENV!=="production"&&!a)throw new Error(`You have to configure \`key\` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.
@@ -2046,7 +2046,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
2046
2046
  gap: var(--spacing-xs);
2047
2047
  `,Vx={[y0.SIMPLE]:{label:"Simple",tooltipContent:"Success criteria conditions in the form of basic literals, operators, and loose comparisons"},[y0.REGEX]:{label:"Regex",tooltipContent:"Regex patterns used as success criteria conditions"},[y0.JSONPATH]:{label:"JSONPath",tooltipContent:"JSONPath expressions as success criteria conditions"},[y0.XPATH]:{label:"XPath",tooltipContent:"XPath expressions as success criteria conditions"}},gwu=Object.keys(Vx);function vwu({successCriteria:u}){const{sendEvent:e}=vu(),a=n=>{e("button.click",{source:"workflow",action:"add_success_criteria",success_criteria_type:n}),u.set(i=>[...i||[],{...FDu(n)}])},t=_.useMemo(()=>u.filter(n=>n.get()!==void 0),[u]),r=n=>{e("button.click",{source:"workflow",action:"remove_success_criteria",success_criteria_type:n.get().type,condition:n.get().condition}),n.set(lu)};return m.jsxs(m.Fragment,{children:[m.jsxs(yo,{children:["Success criteria",m.jsx(gr,{content:"List of conditions required to complete the step."})]}),t.map(n=>m.jsx(_.Fragment,{children:m.jsx(mwu,{successCriteria:n,label:Vx[n.get().type].label,tooltipContent:Vx[n.get().type].tooltipContent,additionalActions:m.jsx(Z0,{"data-testid":"remove-success-criteria-button",variant:"text",icon:m.jsx(H.TrashCanIcon,{}),onClick:()=>r(n)})})},n.get().id)),m.jsx(kwu,{renderInput:()=>m.jsx(H.Button,{variant:"outlined",icon:m.jsx(H.AddIcon,{}),iconPosition:"left",size:"small",children:"Add success criteria"}),dataTestId:"workflow-step-success-criteria-select",options:gwu.map(n=>({element:Vx[n].label,label:n,value:n})),onChange:n=>{a(n)},placement:"top",hideCheckmarkIcon:!0})]})}const kwu=M(H.Select)`
2048
2048
  border-radius: var(--border-radius-md);
2049
- `;function bwu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=Xs(),r=u.stepId.get();return m.jsx(m.Fragment,{children:m.jsxs(uee,{children:[m.jsx(yo,{children:"Info"}),m.jsxs($u,{children:[m.jsxs($u.Row,{children:[m.jsx($u.Cell,{children:m.jsxs(As,{children:["Step ID",m.jsx(gr,{content:"This step's unique identifier"})]})}),m.jsx($u.Cell,{$readonly:!0,children:m.jsx(EF,{attribute:u.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:n=>{a&&e&&t({collectionId:a,workflowId:e,stepId:r},{collectionId:a,workflowId:e,stepId:n})}})})]}),m.jsxs($u.Row,{children:[m.jsx($u.Cell,{children:m.jsxs(As,{children:["Description",m.jsx(gr,{content:"The step's purpose in the workflow."})]})}),m.jsx($u.Cell,{children:m.jsx(hA,{state:u.description,placeholder:"Add description"})})]})]}),m.jsxs(A1,{children:[m.jsx(yo,{children:"Operation"}),m.jsx(iwu,{step:u,collectionId:a})]}),m.jsx(A1,{children:m.jsx(eee,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),m.jsx(A1,{children:m.jsx(vwu,{successCriteria:u.successCriteria})})]})})}function Cwu({onParameterChange:u,files:e}){const a=_.useRef(null),t=o=>{o.target.files?.length&&u(Array.from(o.target.files).map(s=>({absolutePath:null,file:s})))},r=async()=>{if(pc())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-sUDZS9YG.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(ME),E=(await Promise.all(c)).filter(p=>p!==null);u(E)}catch(o){console.error("Failed to open file dialog or read file:",o)}else a.current?.click()},n=_.useCallback(()=>{u(null)},[u]),i=_.useMemo(()=>{if(!e)return null;if(e.length===1)return m.jsx(VN,{icon:m.jsx(H.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsx(GN,{children:e[0].file.name})});if(e.length>1)return m.jsx(VN,{icon:m.jsx(H.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsxs(GN,{children:[e.length," files"]})})},[e,n]);return m.jsx(Fwu,{children:m.jsxs(ywu,{children:[m.jsx(Awu,{children:i||m.jsx(Swu,{children:"Add files here"})}),m.jsxs(Bwu,{children:[m.jsx(_ku,{onClick:r,variant:"text","data-testid":"add-button",icon:m.jsx(H.AddIcon,{color:"--text-color-secondary"})}),m.jsx("input",{"data-testid":"file-input",hidden:!0,ref:a,type:"file",multiple:!0,accept:"files/*",onChange:t})]})]})})}const Fwu=M.div`
2049
+ `;function bwu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=Xs(),r=u.stepId.get();return m.jsx(m.Fragment,{children:m.jsxs(uee,{children:[m.jsx(yo,{children:"Info"}),m.jsxs($u,{children:[m.jsxs($u.Row,{children:[m.jsx($u.Cell,{children:m.jsxs(As,{children:["Step ID",m.jsx(gr,{content:"This step's unique identifier"})]})}),m.jsx($u.Cell,{$readonly:!0,children:m.jsx(EF,{attribute:u.stepId,editorTitle:"Change step ID",placeholder:"Add step ID",onSave:n=>{a&&e&&t({collectionId:a,workflowId:e,stepId:r},{collectionId:a,workflowId:e,stepId:n})}})})]}),m.jsxs($u.Row,{children:[m.jsx($u.Cell,{children:m.jsxs(As,{children:["Description",m.jsx(gr,{content:"The step's purpose in the workflow."})]})}),m.jsx($u.Cell,{children:m.jsx(hA,{state:u.description,placeholder:"Add description"})})]})]}),m.jsxs(A1,{children:[m.jsx(yo,{children:"Operation"}),m.jsx(iwu,{step:u,collectionId:a})]}),m.jsx(A1,{children:m.jsx(eee,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),m.jsx(A1,{children:m.jsx(vwu,{successCriteria:u.successCriteria})})]})})}function Cwu({onParameterChange:u,files:e}){const a=_.useRef(null),t=o=>{o.target.files?.length&&u(Array.from(o.target.files).map(s=>({absolutePath:null,file:s})))},r=async()=>{if(pc())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-DpuHs2QK.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(ME),E=(await Promise.all(c)).filter(p=>p!==null);u(E)}catch(o){console.error("Failed to open file dialog or read file:",o)}else a.current?.click()},n=_.useCallback(()=>{u(null)},[u]),i=_.useMemo(()=>{if(!e)return null;if(e.length===1)return m.jsx(VN,{icon:m.jsx(H.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsx(GN,{children:e[0].file.name})});if(e.length>1)return m.jsx(VN,{icon:m.jsx(H.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsxs(GN,{children:[e.length," files"]})})},[e,n]);return m.jsx(Fwu,{children:m.jsxs(ywu,{children:[m.jsx(Awu,{children:i||m.jsx(Swu,{children:"Add files here"})}),m.jsxs(Bwu,{children:[m.jsx(_ku,{onClick:r,variant:"text","data-testid":"add-button",icon:m.jsx(H.AddIcon,{color:"--text-color-secondary"})}),m.jsx("input",{"data-testid":"file-input",hidden:!0,ref:a,type:"file",multiple:!0,accept:"files/*",onChange:t})]})]})})}const Fwu=M.div`
2050
2050
  position: relative;
2051
2051
  display: flex;
2052
2052
  flex-grow: 1;
@@ -2173,7 +2173,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
2173
2173
  `,Kwu=M.div`
2174
2174
  display: flex;
2175
2175
  justify-content: center;
2176
- `;function Vwu({data:u,type:e,editable:a}){const t=la(),r=u[e];function n(o,s){s&&r.merge([ys()])}function i(o){r[o].set(lu)}return m.jsx(wwu,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==z0["application/x-www-form-urlencoded"],editable:a,actions:o=>m.jsx(Z0,{onClick:()=>i(o),variant:"text",icon:m.jsx(H.TrashCanIcon,{})})})}const Gwu=({data:u})=>{const e=u.get(),[a,t]=_.useState(!1),r=_.useRef(null),n=l=>{const c=l.target.files?.[0];if(c){t(!0);const d=new FileReader;d.onload=()=>{t(!1),u.set({absolutePath:null,file:c})},d.readAsDataURL(c)}},i=async l=>{if(l?.preventDefault(),pc())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-sUDZS9YG.js")),d=await c();if(!d)return;const E=await ME(d);u.set(E)}catch(c){console.error("Failed to open file dialog or read file:",c)}else r.current?.click()},o=l=>{l.key==="Enter"&&(l.preventDefault(),i())},s=()=>{u.set(null)};return a?m.jsxs(Hwu,{children:[m.jsx(H.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?m.jsxs(qwu,{children:[m.jsxs(Wwu,{children:[m.jsx(H.DocumentBlankIcon,{size:"16px"}),m.jsx(Jwu,{children:e.file?.name})]}),m.jsx(Z0,{onClick:s,icon:m.jsx(H.TrashCanIcon,{})})]}):m.jsx(aee,{children:!e&&m.jsxs(Uwu,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[m.jsx("input",{type:"file",onChange:n,ref:r}),m.jsx(H.CloudUploadIcon,{}),"Upload file"]})})},aee=M.div`
2176
+ `;function Vwu({data:u,type:e,editable:a}){const t=la(),r=u[e];function n(o,s){s&&r.merge([ys()])}function i(o){r[o].set(lu)}return m.jsx(wwu,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==z0["application/x-www-form-urlencoded"],editable:a,actions:o=>m.jsx(Z0,{onClick:()=>i(o),variant:"text",icon:m.jsx(H.TrashCanIcon,{})})})}const Gwu=({data:u})=>{const e=u.get(),[a,t]=_.useState(!1),r=_.useRef(null),n=l=>{const c=l.target.files?.[0];if(c){t(!0);const d=new FileReader;d.onload=()=>{t(!1),u.set({absolutePath:null,file:c})},d.readAsDataURL(c)}},i=async l=>{if(l?.preventDefault(),pc())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-DpuHs2QK.js")),d=await c();if(!d)return;const E=await ME(d);u.set(E)}catch(c){console.error("Failed to open file dialog or read file:",c)}else r.current?.click()},o=l=>{l.key==="Enter"&&(l.preventDefault(),i())},s=()=>{u.set(null)};return a?m.jsxs(Hwu,{children:[m.jsx(H.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?m.jsxs(qwu,{children:[m.jsxs(Wwu,{children:[m.jsx(H.DocumentBlankIcon,{size:"16px"}),m.jsx(Jwu,{children:e.file?.name})]}),m.jsx(Z0,{onClick:s,icon:m.jsx(H.TrashCanIcon,{})})]}):m.jsx(aee,{children:!e&&m.jsxs(Uwu,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[m.jsx("input",{type:"file",onChange:n,ref:r}),m.jsx(H.CloudUploadIcon,{}),"Upload file"]})})},aee=M.div`
2177
2177
  display: flex;
2178
2178
  align-items: center;
2179
2179
  justify-content: flex-start;
@@ -3112,7 +3112,7 @@ Use the data prop if you want to provide your own handlers.`);if(u.initialData){
3112
3112
  @media (max-width: ${w0}px) {
3113
3113
  padding: var(--spacing-xs) var(--spacing-sm);
3114
3114
  }
3115
- `,vMu={info:u=>{},error:u=>{},warn:u=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(u,e)=>u,output:u=>u},kMu=u=>u instanceof URL?u.toString():u instanceof Request?u.url:u;function bMu({collectionId:u,workflowId:e}){const{project:{userFilesDir:a}}=Bu(),{certificates:t}=Cn(),r=la(),{getCollection:n}=NE(),i=n(u),o=a.get(),{inputs:s,servers:l}=r.get(),c=i?.sourceDescriptions.get()??[];return{execute:async E=>{const p=`${o}/${u}`,h=new XH,x=s.map(g=>JSON.stringify({[g.name]:g.value})),f=CMu(l,c),{run:D}=await Promise.resolve().then(()=>require("./replay-index-Cdq6-JOY.js"));return await D({files:[p],workflow:e?[e]:[],fetch:(g,k)=>{const C=kMu(g),{clientCert:v,clientKey:b}=eY(C,t?t.get({noproxy:!0}):[]);return oi(C,{...k,clientCert:v,clientKey:b})},logger:vMu,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async g=>{if(!await YH(g))throw new Error(`File ${g} doesn't exist or isn't readable.`);try{const C=await Ly(g),v=new TextEncoder().encode(C);return new File([v],await ZH(g))}catch(C){throw new Error(`Failed to read file ${g}: ${C}`)}}},envVariables:{},config:await tV({}),externalRefResolver:h,input:x,server:f,severity:JSON.stringify(E),skipLint:!0})}}}function CMu(u,e){return e.map(a=>{const t=u.find(n=>n.apiId===a.apiId);if(!t)return null;let r=t.value;if(t.variables)for(const n of t.variables){const i=new RegExp(`\\{${n.name}\\}`,"g");r=r.replace(i,n.value)}return`${a.name}=${r}`}).filter(a=>a!==null)}function JA(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function Oee({checks:u}){const e=u.filter(p=>p.severity!=="off"),a=e.filter(p=>p.passed).length,t=e.filter(p=>p.severity==="warn"&&!p.passed).length,r=e.length,n=r-a-t,i=a===r,o=a===0,[s,l]=fe.default.useState(n>0||t>0),c=()=>i?"All checks passed":o?"All checks failed":`Some ${r>1?"checks were":"check was"} not successful`,d=()=>i?m.jsx(H.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):n>0?m.jsx(H.ErrorFilledIcon,{color:"var(--color-error-base)"}):m.jsx(H.WarningFilledIcon,{color:"var(--color-warning-base)"}),E=p=>{p.stopPropagation(),l(!s)};return!e||e.length===0?null:m.jsxs(FMu,{children:[m.jsxs(yMu,{onClick:E,children:[m.jsxs(AMu,{children:[m.jsx(BMu,{children:m.jsx(SMu,{children:d()})}),m.jsxs(zMu,{children:[m.jsx(wMu,{children:c()}),m.jsxs(OMu,{children:[a," successful",t>0&&m.jsxs(m.Fragment,{children:[", ",t," ",t===1?"warning":"warnings"]}),n>0&&m.jsxs(m.Fragment,{children:[", ",n," failed"]})]})]})]}),m.jsx(PMu,{isExpanded:s,children:s?m.jsx(H.ChevronDownIcon,{}):m.jsx(H.ChevronRightIcon,{})})]}),m.jsx(jMu,{isExpanded:s,children:e.map((p,h)=>m.jsxs(MMu,{children:[m.jsx(TMu,{children:p.passed?m.jsx(H.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!p.passed&&["warn"].includes(p.severity)?m.jsx(H.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):m.jsx(H.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),m.jsxs(RMu,{children:[m.jsx(NMu,{children:p.name}),p.message&&m.jsx($Mu,{children:p.message})]})]},h))})]})}const FMu=M.div`
3115
+ `,vMu={info:u=>{},error:u=>{},warn:u=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(u,e)=>u,output:u=>u},kMu=u=>u instanceof URL?u.toString():u instanceof Request?u.url:u;function bMu({collectionId:u,workflowId:e}){const{project:{userFilesDir:a}}=Bu(),{certificates:t}=Cn(),r=la(),{getCollection:n}=NE(),i=n(u),o=a.get(),{inputs:s,servers:l}=r.get(),c=i?.sourceDescriptions.get()??[];return{execute:async E=>{const p=`${o}/${u}`,h=new XH,x=s.map(g=>JSON.stringify({[g.name]:g.value})),f=CMu(l,c),{run:D}=await Promise.resolve().then(()=>require("./replay-index-BWQ1mF-y.js"));return await D({files:[p],workflow:e?[e]:[],fetch:(g,k)=>{const C=kMu(g),{clientCert:v,clientKey:b}=eY(C,t?t.get({noproxy:!0}):[]);return oi(C,{...k,clientCert:v,clientKey:b})},logger:vMu,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async g=>{if(!await YH(g))throw new Error(`File ${g} doesn't exist or isn't readable.`);try{const C=await Ly(g),v=new TextEncoder().encode(C);return new File([v],await ZH(g))}catch(C){throw new Error(`Failed to read file ${g}: ${C}`)}}},envVariables:{},config:await tV({}),externalRefResolver:h,input:x,server:f,severity:JSON.stringify(E),skipLint:!0})}}}function CMu(u,e){return e.map(a=>{const t=u.find(n=>n.apiId===a.apiId);if(!t)return null;let r=t.value;if(t.variables)for(const n of t.variables){const i=new RegExp(`\\{${n.name}\\}`,"g");r=r.replace(i,n.value)}return`${a.name}=${r}`}).filter(a=>a!==null)}function JA(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function Oee({checks:u}){const e=u.filter(p=>p.severity!=="off"),a=e.filter(p=>p.passed).length,t=e.filter(p=>p.severity==="warn"&&!p.passed).length,r=e.length,n=r-a-t,i=a===r,o=a===0,[s,l]=fe.default.useState(n>0||t>0),c=()=>i?"All checks passed":o?"All checks failed":`Some ${r>1?"checks were":"check was"} not successful`,d=()=>i?m.jsx(H.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):n>0?m.jsx(H.ErrorFilledIcon,{color:"var(--color-error-base)"}):m.jsx(H.WarningFilledIcon,{color:"var(--color-warning-base)"}),E=p=>{p.stopPropagation(),l(!s)};return!e||e.length===0?null:m.jsxs(FMu,{children:[m.jsxs(yMu,{onClick:E,children:[m.jsxs(AMu,{children:[m.jsx(BMu,{children:m.jsx(SMu,{children:d()})}),m.jsxs(zMu,{children:[m.jsx(wMu,{children:c()}),m.jsxs(OMu,{children:[a," successful",t>0&&m.jsxs(m.Fragment,{children:[", ",t," ",t===1?"warning":"warnings"]}),n>0&&m.jsxs(m.Fragment,{children:[", ",n," failed"]})]})]})]}),m.jsx(PMu,{isExpanded:s,children:s?m.jsx(H.ChevronDownIcon,{}):m.jsx(H.ChevronRightIcon,{})})]}),m.jsx(jMu,{isExpanded:s,children:e.map((p,h)=>m.jsxs(MMu,{children:[m.jsx(TMu,{children:p.passed?m.jsx(H.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!p.passed&&["warn"].includes(p.severity)?m.jsx(H.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):m.jsx(H.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),m.jsxs(RMu,{children:[m.jsx(NMu,{children:p.name}),p.message&&m.jsx($Mu,{children:p.message})]})]},h))})]})}const FMu=M.div`
3116
3116
  margin-bottom: 0;
3117
3117
  margin-top: var(--spacing-xxs);
3118
3118
  `,yMu=M.div`