@redocly/replay 0.19.0 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -173,7 +173,7 @@ ${n.message}`})}}}}),iQ=({filePath:u})=>({Info:{leave(e,{report:a,location:t,con
173
173
  ${n.message}`,location:t.child("description")})}}}}),oQ=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 sQ(u){return Array.isArray(u)&&u.length===0}const D5e="x-internal",lQ=({internalFlagProperty:u=D5e})=>{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(Ga(t[l])&&r.resolve(t[l]).node?.[u]){if(ku(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(ku(t))for(const l of Object.keys(t)){if(Ga(t[l])){const c=r.resolve(t[l]);ku(c.node)&&c.node?.[u]&&(delete t[l],s=!0)}ku(t[l])&&t[l]?.[u]&&(delete t[l],s=!0)}s&&(lE(t)||sQ(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 cQ(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(Ga(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(ku(u))for(const i of Object.keys(u)){if(u=u,Ga(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&&(lE(u)||sQ(u))&&delete t[r]}function dQ(u,e,a){return u===void 0||e===void 0?!1:!Array.isArray(e)&&!Array.isArray(u)?u===e:(e=Kz(e),u=Kz(u),a==="any"?e.some(t=>u.includes(t)):a==="all"?e.every(t=>u.includes(t)):!1)}function Kz(u){return Array.isArray(u)?u:[u]}const f5e="any",EQ=({property:u,value:e,matchStrategy:a})=>{const t=a||f5e,r=n=>n?.[u]&&!dQ(n?.[u],e,t);return{any:{enter:(n,i)=>{cQ(n,i,r)}}}},g5e="any",pQ=({property:u,value:e,matchStrategy:a})=>{const t=a||g5e,r=n=>dQ(n?.[u],e,t);return{any:{enter:(n,i)=>{cQ(n,i,r)}}}},v5e=({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=Vz(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:Iz(hE(s,a.config?.configPath))}}),e.responses[n]=i)}if(r.request&&e.requestBody){const n=Vz(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:Iz(hE(o,a.config?.configPath))}}),e.requestBody=n}}}}});function Vz(u,e){if(!Ga(u))return u;const a=e(u);return a.error?void 0:JSON.parse(JSON.stringify(a.node))}const mQ=()=>{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),lE(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,[]),lE(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())}}}},k5e={"operation-description-override":rQ,"tag-description-override":nQ,"info-description-override":iQ,"info-override":oQ,"remove-x-internal":lQ,"remove-unused-components":mQ,"filter-in":EQ,"filter-out":pQ,"media-type-examples-override":v5e},xQ=()=>{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),lE(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())}}}},b5e={"operation-description-override":rQ,"tag-description-override":nQ,"info-description-override":iQ,"info-override":oQ,"remove-x-internal":lQ,"remove-unused-components":xQ,"filter-in":EQ,"filter-out":pQ},y5e={},C5e={},F5e={},A5e={},B5e={recommended:kme,"recommended-strict":bme,minimal:Cme,all:yme,spec:Fme},Gz={id:"",rules:{oas3:jhe,oas2:Nhe,async2:Vhe,async3:qhe,arazzo1:p5e,overlay1:x5e},preprocessors:{oas3:Mhe,oas2:Lhe,async2:Ghe,async3:Whe,arazzo1:m5e,overlay1:h5e},decorators:{oas3:k5e,oas2:b5e,async2:y5e,async3:C5e,arazzo1:F5e,overlay1:A5e},configs:B5e};function O5e(u){return!Gr(u)}function S5e(){return new Promise(u=>{setTimeout(u)})}function Rd(u,e){return u+"::"+e}class kc{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 fA extends Error{constructor(e){super(e.message),this.originalError=e,Object.setPrototypeOf(this,fA.prototype)}}function z5e(u,e){const a=new kc(e,u);try{return{source:a,parsed:dA(u,{filename:e})}}catch(t){throw new a4(t,a)}}class ng{constructor(e={http:{headers:[]}}){this.config=e,this.cache=new Map}getFiles(){return new Set(Array.from(this.cache.keys()))}resolveExternalRef(e,a){return tt(a)?a:e&&tt(e)?new URL(a,e).href:Lu.resolve(e?Lu.dirname(e):process.cwd(),a)}async loadExternalRef(e){try{if(tt(e)){const{body:a,mimeType:t}=await FK(e,this.config.http);return new kc(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 kc(e,a.replace(/\r\n/g,`
174
174
  `))}}catch(a){throw a.message=a.message.replace(", lstat",""),new fA(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:dA(e.body,{filename:e.absoluteRef})}}catch(r){throw new a4(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 Hz(u,e){return{prev:u,node:e}}function w5e(u,e){for(;u;){if(u.node===e)return!0;u=u.prev}return!1}const _4={name:"unknown",properties:{}},P5e={name:"scalar",properties:{}};async function DE(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,v){if(typeof D!="object"||D===null)return;const y=`${g.name}::${v}`;if(n.has(y))return;n.add(y);const[k,b]=Object.entries(D).find(([C])=>C==="$anchor")||[];if(b&&h.set(`#${b}`,D),Array.isArray(D)){const C=g.items;if(C===void 0&&g!==_4&&g!==sl)return;const B=typeof C=="function";for(let O=0;O<D.length;O++){let T=B?C(D[O],P1(v,O)):C;if(T===void 0&&g!==_4&&g!==sl)continue;const M=T?.directResolveAs?{$ref:D[O]}:D[O];T=T?.directResolveAs||T,x(M,ll(T)?T:_4,P1(v,O))}return}for(const C of Object.keys(D)){let B=D[C],O=us(g.properties,C);O===void 0&&(O=g.additionalProperties),typeof O=="function"&&(O=O(B,C)),O===void 0&&(O=_4),g.extensionsPrefix&&C.startsWith(g.extensionsPrefix)&&O===_4&&(O=sl),!ll(O)&&O?.directResolveAs&&(O=O.directResolveAs,B={$ref:B}),O&&O.name===void 0&&O.resolvable!==!1&&(O=P5e),!(!ll(O)||typeof B!="object")&&x(B,O,P1(v,Md(C)))}if(Ga(D)){const C=f(c,D,{prev:null,node:D}).then(B=>{B.resolved&&s(B.node,B.document,B.nodePointer,g)});i.push(C)}if(AK(D)){const C=f(c,{$ref:D.externalValue},{prev:null,node:D}).then(B=>{B.resolved&&s(B.node,B.document,B.nodePointer,g)});i.push(C)}}async function f(D,g,v){if(w5e(v.prev,g))throw new Error("Self-referencing circular pointer");if(goe(g.$ref)){await S5e();const R={resolved:!0,isRemote:!1,node:h.get(g.$ref),document:D,nodePointer:g.$ref},K=Rd(D.source.absoluteRef,g.$ref);return r.set(K,R),R}const{uri:y,pointer:k}=hoe(g.$ref),b=y!==null&&a.resolveExternalRef(D.source.absoluteRef,y)!==D.source.absoluteRef;let C;try{C=b?await a.resolveDocument(D.source.absoluteRef,y):D}catch(R){const K={resolved:!1,isRemote:b,document:void 0,error:R},q=Rd(D.source.absoluteRef,g.$ref);return r.set(q,K),K}let B={resolved:!0,document:C,isRemote:b,node:D.parsed,nodePointer:"#/"},O=C.parsed;const T=k;for(const R of T)if(typeof O!="object"){O=void 0;break}else if(O[R]!==void 0)O=O[R],B.nodePointer=P1(B.nodePointer,Md(R));else if(Ga(O)){if(B=await f(C,O,Hz(v,O)),C=B.document||C,typeof B.node!="object"){O=void 0;break}O=B.node[R],B.nodePointer=P1(B.nodePointer,Md(R))}else{O=void 0;break}B.node=O,B.document=C;const M=Rd(D.source.absoluteRef,g.$ref);return B.document&&Ga(O)&&(B=await f(B.document,O,Hz(v,O))),r.set(M,B),{...B}}}}const Ea=(u,e)=>{if(e)for(const a of Object.keys(e))ku(u[a])&&typeof e[a]=="string"?u[a]={...u[a],severity:e[a]}:u[a]=e[a]};function Ba(u,e){if(e)for(const a of Object.keys(e))u.hasOwnProperty(a)&&(ku(u[a])&&typeof e[a]=="string"?u[a]={...u[a],severity:e[a]}:u[a]=e[a])}function j5e(u){if(u.indexOf("/")>-1){const[e,a]=u.split("/");return{pluginId:e,configName:a}}else return{pluginId:"",configName:u}}function st(u,e){if(!e)return u;const a={};for(const t of Object.keys(u))a[`${e}/${t}`]=u[t];return a}function hQ(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(ku(a)&&"extends"in a&&a.extends!==void 0)throw new Error(`'extends' is not supported in shared configs yet:
175
175
  ${JSON.stringify(a,null,2)}`);Ea(e.rules,a.rules),Ea(e.oas2Rules,a.oas2Rules),Ba(e.oas2Rules,a.rules),Ea(e.oas3_0Rules,a.oas3_0Rules),Ba(e.oas3_0Rules,a.rules),Ea(e.oas3_1Rules,a.oas3_1Rules),Ba(e.oas3_1Rules,a.rules),Ea(e.oas3_2Rules,a.oas3_2Rules),Ba(e.oas3_2Rules,a.rules),Ea(e.async2Rules,a.async2Rules),Ba(e.async2Rules,a.rules),Ea(e.async3Rules,a.async3Rules),Ba(e.async3Rules,a.rules),Ea(e.arazzo1Rules,a.arazzo1Rules),Ba(e.arazzo1Rules,a.rules),Ea(e.overlay1Rules,a.overlay1Rules),Ba(e.overlay1Rules,a.rules),Ea(e.preprocessors,a.preprocessors),Ea(e.oas2Preprocessors,a.oas2Preprocessors),Ba(e.oas2Preprocessors,a.preprocessors),Ea(e.oas3_0Preprocessors,a.oas3_0Preprocessors),Ba(e.oas3_0Preprocessors,a.preprocessors),Ea(e.oas3_1Preprocessors,a.oas3_1Preprocessors),Ba(e.oas3_1Preprocessors,a.preprocessors),Ea(e.oas3_2Preprocessors,a.oas3_2Preprocessors),Ba(e.oas3_2Preprocessors,a.preprocessors),Ea(e.async2Preprocessors,a.async2Preprocessors),Ba(e.async2Preprocessors,a.preprocessors),Ea(e.async3Preprocessors,a.async3Preprocessors),Ba(e.async3Preprocessors,a.preprocessors),Ea(e.arazzo1Preprocessors,a.arazzo1Preprocessors),Ba(e.arazzo1Preprocessors,a.preprocessors),Ea(e.overlay1Preprocessors,a.overlay1Preprocessors),Ba(e.overlay1Preprocessors,a.preprocessors),Ea(e.decorators,a.decorators),Ea(e.oas2Decorators,a.oas2Decorators),Ba(e.oas2Decorators,a.decorators),Ea(e.oas3_0Decorators,a.oas3_0Decorators),Ba(e.oas3_0Decorators,a.decorators),Ea(e.oas3_1Decorators,a.oas3_1Decorators),Ba(e.oas3_1Decorators,a.decorators),Ea(e.oas3_2Decorators,a.oas3_2Decorators),Ba(e.oas3_2Decorators,a.decorators),Ea(e.async2Decorators,a.async2Decorators),Ba(e.async2Decorators,a.decorators),Ea(e.async3Decorators,a.async3Decorators),Ba(e.async3Decorators,a.decorators),Ea(e.arazzo1Decorators,a.arazzo1Decorators),Ba(e.arazzo1Decorators,a.decorators),Ea(e.overlay1Decorators,a.overlay1Decorators),Ba(e.overlay1Decorators,a.decorators)}return e}function M5e(u){return new Map(JSON.parse(JSON.stringify([...u])))}function Qz(u){return u!==void 0&&typeof u=="object"&&"id"in u}function T5e(u){return typeof u=="function"}function qz(u,e){return{prev:u,value:e}}function Wz(u){return u?.prev??null}function R5e(u){const e={};for(;u.parent;)e[u.parent.type.name]=u.parent.activatedOn?.value.node,u=u.parent;return e}function $5e(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 bc(u){const{document:e,rootType:a,normalizedVisitors:t,resolvedRefMap:r,ctx:n}=u,i={},o=new Set;s(e.parsed,a,new Eh(e.source,"#/"),void 0,"");function s(l,c,d,E,p){const h=(B,O=f.source.absoluteRef)=>{if(!Ga(B))return{location:d,node:B};const T=Rd(O,B.$ref),M=r.get(T);if(!M)return{location:void 0,node:void 0};const{resolved:R,node:K,document:q,nodePointer:W,error:Y}=M;return{location:R?new Eh(q.source,W):Y instanceof a4?new Eh(Y.source,""):void 0,node:K,error:Y}},x=d;let f=d;const{node:D,location:g,error:v}=h(l),y=new Set;if(Ga(l)){const B=t.ref.enter;for(const{visit:O,ruleId:T,severity:M,message:R,context:K}of B){y.add(K);const q=b.bind(void 0,T,M,R);O(l,{report:q,resolve:h,rawNode:l,rawLocation:x,location:d,type:c,parent:E,key:p,parentLocations:{},specVersion:n.specVersion,config:n.config,getVisitorData:C.bind(void 0,T)},{node:D,location:g,error:v}),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 O=!1;const M=t.any.enter.concat(t[c.name]?.enter||[]),R=[];for(const{context:W,visit:Y,skip:ie,ruleId:te,severity:me,message:I}of M){if(o.has(`${f.absolutePointer}${f.pointer}`))break;if(W.isSkippedLevel)W.parent.activatedOn&&!W.parent.activatedOn.value.nextLevelTypeActivated&&!W.seen.has(l)&&(W.seen.add(l),O=!0,R.push(W));else if(W.parent&&W.parent.activatedOn&&W.activatedOn?.value.withParentNode!==W.parent.activatedOn.value.node&&W.parent.activatedOn.value.nextLevelTypeActivated?.value!==c||!W.parent&&!B){R.push(W);const $={node:D,location:g,nextLevelTypeActivated:null,withParentNode:W.parent?.activatedOn?.value.node,skipped:(W.parent?.activatedOn?.value.skipped||ie?.(D,p,{location:d,rawLocation:x,resolve:h,rawNode:l}))??!1};W.activatedOn=qz(W.activatedOn,$);let G=W.parent;for(;G;)G.activatedOn.value.nextLevelTypeActivated=qz(G.activatedOn.value.nextLevelTypeActivated,c),G=G.parent;$.skipped||(O=!0,y.add(W),k(Y,D,l,W,te,me,I))}}if(O||!B){if(i[c.name]=i[c.name]||new Set,i[c.name].add(D),Array.isArray(D)){const W=c.items;if(W!==void 0){const Y=typeof W=="function";for(let ie=0;ie<D.length;ie++){let te=Y?W(D[ie],g.child([ie]).absolutePointer):W,me=D[ie];te?.directResolveAs&&(te=te.directResolveAs,me={$ref:me}),ll(te)&&s(me,te,g.child([ie]),D,ie)}}}else if(typeof D=="object"&&D!==null){const W=Object.keys(c.properties);c.additionalProperties?W.push(...Object.keys(D).filter(Y=>!W.includes(Y))):c.extensionsPrefix&&W.push(...Object.keys(D).filter(Y=>Y.startsWith(c.extensionsPrefix))),Ga(l)&&W.push(...Object.keys(l).filter(Y=>Y!=="$ref"&&!W.includes(Y)));for(const Y of W){let ie=D[Y],te=g;ie===void 0&&(ie=l[Y],te=d);let me=us(c.properties,Y);if(me===void 0&&(me=c.additionalProperties),typeof me=="function"&&(me=me(ie,Y)),me===void 0&&c.extensionsPrefix&&Y.startsWith(c.extensionsPrefix)&&(me=sl),!ll(me)&&me?.directResolveAs&&(me=me.directResolveAs,ie={$ref:ie}),me&&me.name===void 0&&me.resolvable!==!1&&(me={name:"scalar",properties:{}}),Ga(l[Y])&&me?.name==="scalar"){s(l[Y],me,d.child([Y]),l,Y);continue}!ll(me)||me.name==="scalar"&&!Ga(ie)||s(ie,me,te.child([Y]),D,Y)}}}const K=t.any.leave,q=(t[c.name]?.leave||[]).concat(K);for(const W of R.reverse())if(W.isSkippedLevel)W.seen.delete(D);else if(W.activatedOn=Wz(W.activatedOn),W.parent){let Y=W.parent;for(;Y;)Y.activatedOn.value.nextLevelTypeActivated=Wz(Y.activatedOn.value.nextLevelTypeActivated),Y=Y.parent}for(const{context:W,visit:Y,ruleId:ie,severity:te,message:me}of q)!W.isSkippedLevel&&y.has(W)&&k(Y,D,l,W,ie,te,me)}if(f=d,Ga(l)){const B=t.ref.leave;for(const{visit:O,ruleId:T,severity:M,context:R,message:K}of B)if(y.has(R)){const q=b.bind(void 0,T,M,K);O(l,{report:q,resolve:h,rawNode:l,rawLocation:x,location:d,type:c,parent:E,key:p,parentLocations:{},specVersion:n.specVersion,config:n.config,getVisitorData:C.bind(void 0,T)},{node:D,location:g,error:v})}}function k(B,O,T,M,R,K,q){const W=b.bind(void 0,R,K,q);B(O,{report:W,resolve:h,rawNode:T,location:f,rawLocation:x,type:c,parent:E,key:p,parentLocations:$5e(M),specVersion:n.specVersion,config:n.config,ignoreNextVisitorsOnNode:()=>{o.add(`${f.absolutePointer}${f.pointer}`)},getVisitorData:C.bind(void 0,R)},R5e(M),M)}function b(B,O,T,M){const K=(M.location?Array.isArray(M.location)?M.location:[M.location]:[{...f,reportOnKey:!1}]).map(W=>({...f,reportOnKey:!1,...W})),q=M.forceSeverity||O;q!=="off"&&n.problems.push({ruleId:M.ruleId||B,severity:q,...M,message:T?T.replace("{{message}}",M.message):M.message,suggest:M.suggest||[],location:K})}function C(B){return n.visitorsData[B]=n.visitorsData[B]||{},n.visitorsData[B]}}}const _5e={Root:"DefinitionRoot",ServerVariablesMap:"ServerVariableMap",Paths:["PathMap","PathsMap"],CallbacksMap:"CallbackMap",MediaTypesMap:"MediaTypeMap",ExamplesMap:"ExampleMap",EncodingMap:"EncodingsMap",HeadersMap:"HeaderMap",LinksMap:"LinkMap",OAuth2Flows:"SecuritySchemeFlows",Responses:"ResponsesMap"};function yc(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(sl);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,_5e[d]),p=a[d];if(!E)continue;let h,x,f;const D=ku(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),v=D&&Object.keys(E).length>g,y={activatedOn:null,type:e[d],parent:s,isSkippedLevel:!1};if(v&&n(i,E,y,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:y})}if(x){if(typeof x!="function")throw new Error("DEV: should be function");p.leave.push({...i,visit:x,depth:l,context:y})}}}}function DQ({node:u,ctx:e,plugins:a}){if(!u.extends)return u;const t=(u.extends||[]).map(r=>{if(!tt(r)&&!fl.extname(r))return W5e(r,a);const n=e.resolve({$ref:r});return n.location&&n.node!==void 0?n.node:null}).filter(l0);return hQ([...t.map(r=>DQ({node:r,ctx:e,plugins:a})),{...u,extends:void 0}])}function Gm(u,e){if(ku(u)&&Array.isArray(u.plugins)){const{plugins:a,rootConfigDir:t}=e.getVisitorData();a.push(...u.plugins.map(r=>gQ(r,e.location.source.absoluteRef.replace(/^file:\/\//,""),t)))}}const N5e=yc([{severity:"error",ruleId:gH,visitor:{ref:{},ConfigGovernance:{leave(u,e){Gm(u,e)}},ConfigApisProperties:{leave(u,e){Gm(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){Gm(u,e)}},ConfigRoot:{leave(u,e){Gm(u,e)}}}}],p3);function Hm(u,e){if(ku(u)&&u.extends){const{plugins:a}=e.getVisitorData(),t=DQ({node:u,ctx:e,plugins:a});Object.assign(u,t),delete u.extends}}const L5e=yc([{severity:"error",ruleId:fH,visitor:{ref:{leave(u,e,a){Fy(u,a,e)}},ConfigGovernance:{leave(u,e){Hm(u,e)}},ConfigApisProperties:{leave(u,e){Hm(u,e)}},"rootRedoclyConfigSchema.scorecard.levels_items":{leave(u,e){Hm(u,e)}},ConfigRoot:{leave(u,e){Hm(u,e)}}}}],p3);function Jz(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 I5e(u,e,a,t,r){let n,i;const o={ref:{leave(E,p,h){if(!h.location||h.node===void 0){Td(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&&tt(E.$ref))return;const x=Jz(p.type.name,u);x?e?(l(x,h,p),Fy(E,h,p)):(E.$ref=l(x,h,p),s(E,h,p)):Fy(E,h,p)}},Example:{leave(E,p){if(AK(E)&&E.value===void 0){const h=p.resolve({$ref:E.externalValue});if(!h.location||h.node===void 0){Td(h,p.report,p.location);return}if(r&&tt(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){Td(f,p.report,p.location.child(h));return}const D=Jz("Schema",u);E[h]=l(D,f,p)}}});function s(E,p,h){const x=Rd(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 Ga(E)&&h.resolve(E,i.absolutePointer).location?.absolutePointer===p.location.absolutePointer?!0:yy(E,p.node)}function d(E,p,h){const[x,f]=[E.location.source.absoluteRef,E.location.pointer],D=n[p];let g="";const v=f.slice(2).split("/").filter(l0);for(;v.length>0;)if(g=v.pop()+(g?`-${g}`:""),!D||!D[g]||c(D[g],E,h))return g;if(g=foe(x)+(g?`_${g}`:""),!D[g]||c(D[g],E,h))return g;const y=g;let k=2;for(;D[g]&&!c(D[g],E,h);)g=`${y}-${k}`,k++;return D[g]||h.report({message:`Two schemas are referenced with the same name but different content. Renamed ${y} to ${g}.`,location:h.location,forceSeverity:"warn"}),g}return o}async function K5e(u){const{document:e,config:a,types:t,externalRefResolver:r,dereference:n=!1,removeUnusedComponents:i=!1,keepUrlRefs:o=!1}=u,s=Jf(e.parsed),l=hH(s),c=a.getRulesForSpecVersion(l),d=W2(a.extendTypes(t,s),a),E=$5(c,a,"preprocessors",s),p=$5(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"?xQ():mQ()});let x=await DE({rootDocument:e,rootType:d.Root,externalRefResolver:r});E.length>0&&(bc({document:e,rootType:d.Root,normalizedVisitors:yc(E,d),resolvedRefMap:x,ctx:h}),x=await DE({rootDocument:e,rootType:d.Root,externalRefResolver:r}));const f=yc([{severity:"error",ruleId:"bundler",visitor:I5e(l,n,e,x,o)},...p],d);return bc({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 V5e(u,e,a){const t={plugins:[],rootConfigDir:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[gH]:t}};return bc({document:u,rootType:p3.ConfigRoot,normalizedVisitors:N5e,resolvedRefMap:e,ctx:r}),t.plugins}function G5e(u,e,a){const t={plugins:a},r={problems:[],specVersion:"oas3_0",refTypes:new Map,visitorsData:{[fH]:t}};return bc({document:u,rootType:p3.ConfigRoot,normalizedVisitors:L5e,resolvedRefMap:e,ctx:r}),u.parsed??{}}async function fQ(u){const{ref:e,doc:a,externalRefResolver:t=new ng(u.config.resolve),base:r=null}=u;if(!(e||a))throw new Error(`Document or reference is required.
176
- `);const n=a===void 0?await t.resolveDocument(r,e,!0):a;if(n instanceof Error)throw n;return u.collectSpecData?.(n.parsed),K5e({document:n,...u,externalRefResolver:t,types:eA(Jf(n.parsed))})}const dv=new Map;async function H5e({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?Dme:u.parsed;if(t!==void 0&&ku(r)&&(r.extends=t),ku(r)&&r?.extends?.some(O5e))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new kc(e??"",JSON.stringify(r)),parsed:r},i=await DE({rootDocument:n,rootType:p3.ConfigRoot,externalRefResolver:a??new ng(DH(r?.resolve))});let o=[],s,l="";lt?s=[...(r?.plugins||[]).filter(p=>!Gr(p)),Gz]:(l=Lu.dirname(e??""),o=V5e(n,i,l),s=[...await q5e(o.map(p=>Uz(p)?p.absolutePath:p),l),Gz]);const c=G5e(n,M5e(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const h=hQ([c,p]);return[E,{...p,...h}]})));const d=o.length?o.map(E=>Uz(E)&&E.isModule?E.rawPath:E.absolutePath&&Lu.relative(l,E.absolutePath)).filter(R5):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function Q5e(u){for(const e of gme)(void 0)(Lu.resolve(u,e))}function Uz(u){return"isModule"in u}const gQ=(u,e,a)=>{if(!Gr(u))return u;const t=Lu.resolve(Lu.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:kK.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:ii&&ii.tagName.toUpperCase()==="SCRIPT"&&ii.src||new URL("replay-index-gs4LE2ro.js",document.baseURI).href)??__dirname).resolve(u,{paths:[a,(typeof document>"u"?require("url").pathToFileURL(__filename).href:ii&&ii.tagName.toUpperCase()==="SCRIPT"&&ii.src||new URL("replay-index-gs4LE2ro.js",document.baseURI).href)?Lu.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:ii&&ii.tagName.toUpperCase()==="SCRIPT"&&ii.src||new URL("replay-index-gs4LE2ro.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function q5e(u,e){if(!u)return[];const a=async o=>{if(!Gr(o))return o;try{const s=Lu.isAbsolute(o)?o:gQ(o,Lu.join(e,hme),e).absolutePath;if(!dv.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&&Qz(h)&&ma.info(`Deprecated plugin format detected: ${h.id}
176
+ `);const n=a===void 0?await t.resolveDocument(r,e,!0):a;if(n instanceof Error)throw n;return u.collectSpecData?.(n.parsed),K5e({document:n,...u,externalRefResolver:t,types:eA(Jf(n.parsed))})}const dv=new Map;async function H5e({rawConfigDocument:u,configPath:e,externalRefResolver:a,customExtends:t}){const r=u===void 0?Dme:u.parsed;if(t!==void 0&&ku(r)&&(r.extends=t),ku(r)&&r?.extends?.some(O5e))throw new Error("Configuration format not detected in extends: values must be strings.");const n=u??{source:new kc(e??"",JSON.stringify(r)),parsed:r},i=await DE({rootDocument:n,rootType:p3.ConfigRoot,externalRefResolver:a??new ng(DH(r?.resolve))});let o=[],s,l="";lt?s=[...(r?.plugins||[]).filter(p=>!Gr(p)),Gz]:(l=Lu.dirname(e??""),o=V5e(n,i,l),s=[...await q5e(o.map(p=>Uz(p)?p.absolutePath:p),l),Gz]);const c=G5e(n,M5e(i),s);c.apis&&(c.apis=Object.fromEntries(Object.entries(c.apis).map(([E,p])=>{const h=hQ([c,p]);return[E,{...p,...h}]})));const d=o.length?o.map(E=>Uz(E)&&E.isModule?E.rawPath:E.absolutePath&&Lu.relative(l,E.absolutePath)).filter(R5):void 0;return{resolvedConfig:{...c,plugins:d},resolvedRefMap:i,plugins:s}}function Q5e(u){for(const e of gme)(void 0)(Lu.resolve(u,e))}function Uz(u){return"isModule"in u}const gQ=(u,e,a)=>{if(!Gr(u))return u;const t=Lu.resolve(Lu.dirname(e),u);return(void 0)(t)?{absolutePath:t,rawPath:u,isModule:!1}:{absolutePath:kK.createRequire((typeof document>"u"?require("url").pathToFileURL(__filename).href:ii&&ii.tagName.toUpperCase()==="SCRIPT"&&ii.src||new URL("replay-index-WwrC-6Gc.js",document.baseURI).href)??__dirname).resolve(u,{paths:[a,(typeof document>"u"?require("url").pathToFileURL(__filename).href:ii&&ii.tagName.toUpperCase()==="SCRIPT"&&ii.src||new URL("replay-index-WwrC-6Gc.js",document.baseURI).href)?Lu.dirname((void 0)(typeof document>"u"?require("url").pathToFileURL(__filename).href:ii&&ii.tagName.toUpperCase()==="SCRIPT"&&ii.src||new URL("replay-index-WwrC-6Gc.js",document.baseURI).href)):__dirname]}),isModule:!0,rawPath:u}};async function q5e(u,e){if(!u)return[];const a=async o=>{if(!Gr(o))return o;try{const s=Lu.isAbsolute(o)?o:gQ(o,Lu.join(e,hme),e).absolutePath;if(!dv.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&&Qz(h)&&ma.info(`Deprecated plugin format detected: ${h.id}
177
177
  `);const E=Qz(l)?l:T5e(l)?await l(c):await l?.default?.(c),p=Array.isArray(E)?E:[E];E&&dv.set(s,p.map(h=>({...h,path:o,absolutePath:s})))}return dv.get(s)}catch(s){throw new Error(`Failed to load plugin "${o}": ${s.message}
178
178
 
179
179
  ${s.stack}`)}},t=new Map,r=Q5e(e);r&&u.push(r);const n=new Set;return(await Promise.all(u.map(async o=>{if(Gr(o)){if(tt(o))throw new Error(Iu.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(Iu.red(`Plugin must define \`id\` property in ${Iu.blue(o.toString())}.`));const E=c.absolutePath??o.toString(),p=t.get(d);if(p){if(E!==p)throw new Error(Iu.red(`Plugin "id" must be unique. Plugin ${Iu.blue(E)} uses id "${Iu.blue(d)}" already seen in ${Iu.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=st(c.rules.oas3,d)),c.rules.oas2&&(h.rules.oas2=st(c.rules.oas2,d)),c.rules.async2&&(h.rules.async2=st(c.rules.async2,d)),c.rules.async3&&(h.rules.async3=st(c.rules.async3,d)),c.rules.arazzo1&&(h.rules.arazzo1=st(c.rules.arazzo1,d)),c.rules.overlay1&&(h.rules.overlay1=st(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=st(c.preprocessors.oas3,d)),c.preprocessors.oas2&&(h.preprocessors.oas2=st(c.preprocessors.oas2,d)),c.preprocessors.async2&&(h.preprocessors.async2=st(c.preprocessors.async2,d)),c.preprocessors.async3&&(h.preprocessors.async3=st(c.preprocessors.async3,d)),c.preprocessors.arazzo1&&(h.preprocessors.arazzo1=st(c.preprocessors.arazzo1,d)),c.preprocessors.overlay1&&(h.preprocessors.overlay1=st(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=st(c.decorators.oas3,d)),c.decorators.oas2&&(h.decorators.oas2=st(c.decorators.oas2,d)),c.decorators.async2&&(h.decorators.async2=st(c.decorators.async2,d)),c.decorators.async3&&(h.decorators.async3=st(c.decorators.async3,d)),c.decorators.arazzo1&&(h.decorators.arazzo1=st(c.decorators.arazzo1,d)),c.decorators.overlay1&&(h.decorators.overlay1=st(c.decorators.overlay1,d))}return c.assertions&&(h.assertions=c.assertions),{...c,...h}}))).filter(R5)}))).filter(R5).flat()}function W5e(u,e){const{pluginId:a,configName:t}=j5e(u),r=e.find(i=>i.id===a);if(!r)throw new Error(`Invalid config ${Iu.red(u)}: plugin ${a} is not included.`);const n=r.configs?.[t];if(!n)throw new Error(a?`Invalid config ${Iu.red(u)}: plugin ${a} doesn't export config with name ${t}.`:`Invalid config ${Iu.red(u)}: there is no such built-in config.`);return n}async function vQ(u,{configPath:e,externalRefResolver:a}={}){const r=z5e(typeof u=="string"?u:"",e??"");typeof u!="string"&&u&&(r.parsed=u);const{resolvedConfig:n,resolvedRefMap:i,plugins:o}=await H5e({rawConfigDocument:J5e(r),configPath:e,externalRefResolver:a});return new Uf(n,{configPath:e,document:r,resolvedRefMap:i,plugins:o})}function J5e(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 Ev={},P0={},pv={},Zz;function ig(){return Zz||(Zz=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})(pv)),pv}var Di={},Xz;function r4(){if(Xz)return Di;Xz=1,Object.defineProperty(Di,"__esModule",{value:!0});function u(i){return typeof i>"u"||i===null}Di.isNothing=u;function e(i){return typeof i=="object"&&i!==null}Di.isObject=e;function a(i){return Array.isArray(i)?i:u(i)?[]:[i]}Di.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}Di.extend=t;function r(i,o){var s="",l;for(l=0;l<o;l+=1)s+=i;return s}Di.repeat=r;function n(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}return Di.isNegativeZero=n,Di}var mv,Yz;function f3(){if(Yz)return mv;Yz=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 mv=u,mv}var xv,ew;function U5e(){if(ew)return xv;ew=1;var u=r4(),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
@@ -394,7 +394,7 @@ html body {
394
394
  align-self: flex-end;
395
395
  padding-top: var(--spacing-xxs);
396
396
  gap: var(--spacing-xs);
397
- `;function RA({input:u,onSave:e,onCancel:a,...t}){const[r,n]=P.useState(!!u.isSecret),i=({name:o,value:s})=>{e({...u,name:o,value:s,isSecret:r})};return m.jsx(AW,{variable:u,onSave:i,onCancel:a,...t,children:m.jsx(CE,{children:m.jsx(FW,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const sC=()=>({name:"",value:"",isSecret:!1}),Oa=u=>vK+"$inputs."+u+Q2,BW=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${$f}$`)?.[1]);function qlu({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function bo(u){const e=new RegExp($f,"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 xg(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function gh(u){const e=new Error(u);return e.source="ulid",e}const $A="0123456789ABCDEFGHJKMNPQRSTVWXYZ",_d=$A.length,pj=Math.pow(2,48)-1,Wlu=10,Jlu=16;function Ulu(u){let e=Math.floor(u()*_d);return e===_d&&(e=_d-1),$A.charAt(e)}function Zlu(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>pj)throw gh("cannot encode time greater than "+pj);if(u<0)throw gh("time must be positive");if(Number.isInteger(Number(u))===!1)throw gh("time must be an integer");let a,t="";for(;e>0;e--)a=u%_d,t=$A.charAt(a)+t,u=(u-a)/_d;return t}function Xlu(u,e){let a="";for(;u>0;u--)a=Ulu(e)+a;return a}function Ylu(u=!1,e){e||(e=typeof window<"u"?window:null);const a=e&&(e.crypto||e.msCrypto);if(a)return()=>{const t=new Uint8Array(1);return a.getRandomValues(t),t[0]/255};try{const t=require("crypto");return()=>t.randomBytes(1).readUInt8()/255}catch{}if(u){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw gh("secure crypto unusable, insecure Math.random not allowed")}function e1u(u){return u||(u=Ylu()),function(a){return isNaN(a)&&(a=Date.now()),Zlu(a,Wlu)+Xlu(Jlu,u)}}const uD=e1u();var u1u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},tl="1.9.0",mj=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function a1u(u){var e=new Set([u]),a=new Set,t=u.match(mj);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(mj);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 t1u=a1u(tl),r1u=tl.split(".")[0],FE=Symbol.for("opentelemetry.js.api."+r1u),AE=u1u;function y3(u,e,a,t){var r;t===void 0&&(t=!1);var n=AE[FE]=(r=AE[FE])!==null&&r!==void 0?r:{version:tl};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!==tl){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+tl);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+tl+"."),!0}function vl(u){var e,a,t=(e=AE[FE])===null||e===void 0?void 0:e.version;if(!(!t||!t1u(t)))return(a=AE[FE])===null||a===void 0?void 0:a[u]}function C3(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+tl+".");var a=AE[FE];a&&delete a[u]}var n1u=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},i1u=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))},o1u=(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 H4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("verbose",this._namespace,e)},u})();function H4(u,e,a){var t=vl("diag");if(t)return a.unshift(e),t[u].apply(t,i1u([],n1u(a),!1))}var Lr;(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"})(Lr||(Lr={}));function s1u(u,e){u<Lr.NONE?u=Lr.NONE:u>Lr.ALL&&(u=Lr.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",Lr.ERROR),warn:a("warn",Lr.WARN),info:a("info",Lr.INFO),debug:a("debug",Lr.DEBUG),verbose:a("verbose",Lr.VERBOSE)}}var l1u=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},c1u=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))},d1u="diag",Ln=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=vl("diag");if(o)return o[r].apply(o,c1u([],l1u(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:Lr.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=vl("diag"),d=s1u((o=n.logLevel)!==null&&o!==void 0?o:Lr.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 y3("diag",d,a,!0)};a.setLogger=t,a.disable=function(){C3(d1u,a)},a.createComponentLogger=function(r){return new o1u(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})(),E1u=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},p1u=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.")},m1u=(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=E1u(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=p1u(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})(),x1u=Symbol("BaggageEntryMetadata"),h1u=Ln.instance();function D1u(u){return u===void 0&&(u={}),new m1u(new Map(Object.entries(u)))}function f1u(u){return typeof u!="string"&&(h1u.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:x1u,toString:function(){return u}}}function _A(u){return Symbol.for(u)}var g1u=(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})(),R1=new g1u,Tl=(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)}})(),v1u=(function(){function u(){}return u.prototype.createGauge=function(e,a){return z1u},u.prototype.createHistogram=function(e,a){return w1u},u.prototype.createCounter=function(e,a){return S1u},u.prototype.createUpDownCounter=function(e,a){return P1u},u.prototype.createObservableGauge=function(e,a){return M1u},u.prototype.createObservableCounter=function(e,a){return j1u},u.prototype.createObservableUpDownCounter=function(e,a){return T1u},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),hg=(function(){function u(){}return u})(),k1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(hg),b1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(hg),y1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(hg),C1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(hg),NA=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),F1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(NA),A1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(NA),B1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(NA),O1u=new v1u,S1u=new k1u,z1u=new y1u,w1u=new C1u,P1u=new b1u,j1u=new F1u,M1u=new A1u,T1u=new B1u,R1u={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},$1u={set:function(u,e,a){u!=null&&(u[e]=a)}},_1u=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},N1u=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))},L1u=(function(){function u(){}return u.prototype.active=function(){return R1},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,N1u([t],_1u(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),I1u=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},K1u=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))},hk="context",V1u=new L1u,Dg=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return y3(hk,e,Ln.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,K1u([e,a,t],I1u(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return vl(hk)||V1u},u.prototype.disable=function(){this._getContextManager().disable(),C3(hk,Ln.instance())},u})(),Ui;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(Ui||(Ui={}));var OW="0000000000000000",SW="00000000000000000000000000000000",zW={traceId:SW,spanId:OW,traceFlags:Ui.NONE},Nd=(function(){function u(e){e===void 0&&(e=zW),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})(),LA=_A("OpenTelemetry Context Key SPAN");function IA(u){return u.getValue(LA)||void 0}function G1u(){return IA(Dg.getInstance().active())}function KA(u,e){return u.setValue(LA,e)}function H1u(u){return u.deleteValue(LA)}function Q1u(u,e){return KA(u,new Nd(e))}function wW(u){var e;return(e=IA(u))===null||e===void 0?void 0:e.spanContext()}var q1u=/^([0-9a-f]{32})$/i,W1u=/^[0-9a-f]{16}$/i;function PW(u){return q1u.test(u)&&u!==SW}function J1u(u){return W1u.test(u)&&u!==OW}function fg(u){return PW(u.traceId)&&J1u(u.spanId)}function U1u(u){return new Nd(u)}var Dk=Dg.getInstance(),jW=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=Dk.active());var r=!!a?.root;if(r)return new Nd;var n=t&&wW(t);return Z1u(n)&&fg(n)?new Nd(n):new Nd},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??Dk.active(),l=this.startSpan(e,n,s),c=KA(s,l);return Dk.with(c,o,void 0,l)}},u})();function Z1u(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var X1u=new jW,Y1u=(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):X1u},u})(),ecu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new jW},u})(),ucu=new ecu,xj=(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 Y1u(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:ucu},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})(),aD;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(aD||(aD={}));var lC;(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"})(lC||(lC={}));exports.SpanStatusCode=void 0;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(exports.SpanStatusCode||(exports.SpanStatusCode={}));var Li=Dg.getInstance(),Hu=Ln.instance(),acu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return O1u},u})(),tcu=new acu,fk="metrics",rcu=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return y3(fk,e,Ln.instance())},u.prototype.getMeterProvider=function(){return vl(fk)||tcu},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){C3(fk,Ln.instance())},u})(),MW=rcu.getInstance(),ncu=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),VA=_A("OpenTelemetry Baggage Key");function TW(u){return u.getValue(VA)||void 0}function icu(){return TW(Dg.getInstance().active())}function ocu(u,e){return u.setValue(VA,e)}function scu(u){return u.deleteValue(VA)}var gk="propagation",lcu=new ncu,ccu=(function(){function u(){this.createBaggage=D1u,this.getBaggage=TW,this.getActiveBaggage=icu,this.setBaggage=ocu,this.deleteBaggage=scu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return y3(gk,e,Ln.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=$1u),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=R1u),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){C3(gk,Ln.instance())},u.prototype._getGlobalPropagator=function(){return vl(gk)||lcu},u})(),Ld=ccu.getInstance(),vk="trace",dcu=(function(){function u(){this._proxyTracerProvider=new xj,this.wrapSpanContext=U1u,this.isSpanContextValid=fg,this.deleteSpan=H1u,this.getSpan=IA,this.getActiveSpan=G1u,this.getSpanContext=wW,this.setSpan=KA,this.setSpanContext=Q1u}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=y3(vk,this._proxyTracerProvider,Ln.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return vl(vk)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){C3(vk,Ln.instance()),this._proxyTracerProvider=new xj},u})(),gr=dcu.getInstance();const RW=_A("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ecu(u){return u.setValue(RW,!0)}function GA(u){return u.getValue(RW)===!0}const pcu="=",cC=";",dC=",",kk="baggage",mcu=180,xcu=4096,hcu=8192;function Dcu(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?dC:""}${a}`;return t.length>hcu?e:t},"")}function fcu(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=cC+a.metadata.toString()),t})}function gcu(u){const e=u.split(cC);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf(pcu);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=f1u(e.join(cC))),{key:r,value:n,metadata:i}}class vcu{inject(e,a,t){const r=Ld.getBaggage(e);if(!r||GA(e))return;const n=fcu(r).filter(o=>o.length<=xcu).slice(0,mcu),i=Dcu(n);i.length>0&&t.set(a,kk,i)}extract(e,a,t){const r=t.get(a,kk),n=Array.isArray(r)?r.join(dC):r;if(!n)return e;const i={};return n.length===0||(n.split(dC).forEach(s=>{const l=gcu(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:Ld.setBaggage(e,Ld.createBaggage(i))}fields(){return[kk]}}function vh(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!kcu(a)){Hu.warn(`Invalid attribute key: ${a}`);continue}if(!$W(t)){Hu.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function kcu(u){return typeof u=="string"&&u.length>0}function $W(u){return u==null?!0:Array.isArray(u)?bcu(u):_W(u)}function bcu(u){let e;for(const a of u)if(a!=null){if(!e){if(_W(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function _W(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function ycu(){return u=>{Hu.error(Ccu(u))}}function Ccu(u){return typeof u=="string"?u:JSON.stringify(Fcu(u))}function Fcu(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 Acu=ycu();function Ac(u){try{Acu(u)}catch{}}const uc=performance,Bcu="2.0.1",bk="exception.message",Ocu="exception.stacktrace",yk="exception.type",NW="service.name",Scu="service.version",EC="telemetry.sdk.language",zcu="webjs",pC="telemetry.sdk.name",mC="telemetry.sdk.version",wcu="process.runtime.name",Ck={[pC]:"opentelemetry",[wcu]:"browser",[EC]:zcu,[mC]:Bcu};const Pcu=9,jcu=6,Mcu=Math.pow(10,jcu),tD=Math.pow(10,Pcu);function H1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*Mcu);return[a,t]}function LW(){let u=uc.timeOrigin;if(typeof u!="number"){const e=uc;u=e.timing&&e.timing.fetchStart}return u}function Tcu(u){const e=H1(LW()),a=H1(typeof u=="number"?u:uc.now());return KW(e,a)}function Rcu(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=tD),[a,t]}function $cu(u){return u[0]*tD+u[1]}function IW(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function hj(u){return IW(u)||typeof u=="number"||u instanceof Date}function KW(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=tD&&(a[1]-=tD,a[0]+=1),a}var vn;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(vn||(vn={}));class _cu{_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){Hu.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){Hu.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const xC="[_0-9a-z-*/]",Ncu=`[a-z]${xC}{0,255}`,Lcu=`[a-z0-9]${xC}{0,240}@[a-z]${xC}{0,13}`,Icu=new RegExp(`^(?:${Ncu}|${Lcu})$`),Kcu=/^[ -~]{0,255}[!-~]$/,Vcu=/,|=/;function Gcu(u){return Icu.test(u)}function Hcu(u){return Kcu.test(u)&&!Vcu.test(u)}const Dj=32,Qcu=512,fj=",",gj="=";class HA{_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+gj+this.get(a)),e),[]).join(fj)}_parse(e){e.length>Qcu||(this._internalState=e.split(fj).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf(gj);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);Gcu(i)&&Hcu(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Dj&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Dj))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new HA;return e._internalState=new Map(this._internalState),e}}const Fk="traceparent",Ak="tracestate",qcu="00",Wcu="(?!ff)[\\da-f]{2}",Jcu="(?![0]{32})[\\da-f]{32}",Ucu="(?![0]{16})[\\da-f]{16}",Zcu="[\\da-f]{2}",Xcu=new RegExp(`^\\s?(${Wcu})-(${Jcu})-(${Ucu})-(${Zcu})(-.*)?\\s?$`);function Ycu(u){const e=Xcu.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class e4u{inject(e,a,t){const r=gr.getSpanContext(e);if(!r||GA(e)||!fg(r))return;const n=`${qcu}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Ui.NONE).toString(16)}`;t.set(a,Fk,n),r.traceState&&t.set(a,Ak,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,Fk);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=Ycu(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,Ak);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new HA(typeof s=="string"?s:void 0)}return gr.setSpanContext(e,i)}fields(){return[Fk,Ak]}}const u4u="[object Object]",a4u="[object Null]",t4u="[object Undefined]",r4u=Function.prototype,VW=r4u.toString,n4u=VW.call(Object),i4u=Object.getPrototypeOf,GW=Object.prototype,HW=GW.hasOwnProperty,Js=Symbol?Symbol.toStringTag:void 0,QW=GW.toString;function vj(u){if(!o4u(u)||s4u(u)!==u4u)return!1;const e=i4u(u);if(e===null)return!0;const a=HW.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&VW.call(a)===n4u}function o4u(u){return u!=null&&typeof u=="object"}function s4u(u){return u==null?u===void 0?t4u:a4u:Js&&Js in Object(u)?l4u(u):c4u(u)}function l4u(u){const e=HW.call(u,Js),a=u[Js];let t=!1;try{u[Js]=void 0,t=!0}catch{}const r=QW.call(u);return t&&(e?u[Js]=a:delete u[Js]),r}function c4u(u){return QW.call(u)}const d4u=20;function E4u(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=qW(e,u.shift(),0,a);return e}function Bk(u){return rD(u)?u.slice():u}function qW(u,e,a=0,t){let r;if(!(a>d4u)){if(a++,kh(u)||kh(e)||WW(e))r=Bk(e);else if(rD(u)){if(r=u.slice(),rD(e))for(let n=0,i=e.length;n<i;n++)r.push(Bk(e[n]));else if(Q4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=Bk(e[s])}}}else if(Q4(u))if(Q4(e)){if(!p4u(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(kh(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(kj(u,s,t)||kj(e,s,t))delete r[s];else{if(Q4(c)&&Q4(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]=qW(r[s],l,a,t)}}}}else r=e;return r}}function kj(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 rD(u){return Array.isArray(u)}function WW(u){return typeof u=="function"}function Q4(u){return!kh(u)&&!rD(u)&&!WW(u)&&typeof u=="object"}function kh(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function p4u(u,e){return!(!vj(u)||!vj(e))}class m4u{_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 x4u{_callback;_that;_isCalled=!1;_deferred=new m4u;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 h4u(){return"unknown_service"}const gd=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class nD{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new nD({});return a._rawAttributes=bj(e),a._asyncAttributesPending=e.filter(([t,r])=>gd(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(gd(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=bj(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,gd(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Hu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(gd(t)){Hu.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:nD.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function JW(u){return nD.FromAttributeList(Object.entries(u))}function D4u(){return JW({[NW]:h4u(),[EC]:Ck[EC],[pC]:Ck[pC],[mC]:Ck[mC]})}function bj(u){return u.map(([e,a])=>gd(a)?[e,a.catch(t=>{Hu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const f4u="exception";class g4u{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:exports.SpanStatusCode.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=uc.now(),this._performanceOffset=a-(this._performanceStartTime+LW()),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 Hu.warn(`Invalid attribute key: ${e}`),this;if(!$W(a))return Hu.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 Hu.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Hu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),hj(a)&&(hj(t)||(t=a),a=void 0);const n=vh(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"&&(Hu.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()){Hu.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=Rcu(this.startTime,this.endTime),this._duration[0]<0&&(Hu.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&&Hu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=uc.now())return Tcu(e+this._performanceOffset);if(typeof e=="number")return H1(e);if(e instanceof Date)return H1(e.getTime());if(IW(e))return e;if(this._startTimeProvided)return H1(Date.now());const a=uc.now()-this._performanceStartTime;return KW(this.startTime,H1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[bk]=e:e&&(e.code?t[yk]=e.code.toString():e.name&&(t[yk]=e.name),e.message&&(t[bk]=e.message),e.stack&&(t[Ocu]=e.stack)),t[yk]||t[bk]?this.addEvent(f4u,t,a):Hu.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}}`);Hu.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?(Hu.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 Bc;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Bc||(Bc={}));class iD{shouldSample(){return{decision:Bc.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class ac{shouldSample(){return{decision:Bc.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class sx{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Ac(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ac),this._remoteParentSampled=e.remoteParentSampled??new ac,this._remoteParentNotSampled=e.remoteParentNotSampled??new iD,this._localParentSampled=e.localParentSampled??new ac,this._localParentNotSampled=e.localParentNotSampled??new iD}shouldSample(e,a,t,r,n,i){const o=gr.getSpanContext(e);return!o||!fg(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&Ui.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&Ui.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 yj{_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:PW(a)&&this._accumulate(a)<this._upperBound?Bc.RECORD_AND_SAMPLED:Bc.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 Cj=1;function UW(){return{sampler:ZW(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function ZW(){const u="parentbased_always_on";switch(u){case"always_on":return new ac;case"always_off":return new iD;case"parentbased_always_on":return new sx({root:new ac});case"parentbased_always_off":return new sx({root:new iD});case"traceidratio":return new yj(Fj());case"parentbased_traceidratio":return new sx({root:new yj(Fj())});default:return Hu.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new sx({root:new ac})}}function Fj(){return Hu.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Cj}.`),Cj}const v4u=128,k4u=1/0;function b4u(u){const e={sampler:ZW()},a=UW(),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 y4u(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??v4u,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??k4u,Object.assign({},u,{spanLimits:e})}class C4u{_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 x4u(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Hu.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&Ui.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&&Hu.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Hu.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);Li.with(Ecu(Li.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===vn.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=>{Ac(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,Ac(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 F4u extends C4u{_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=>{Ac(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{Ac(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 A4u=8,B4u=16;class O4u{generateTraceId=Aj(B4u);generateSpanId=Aj(A4u)}const lx=Array(32);function Aj(u){return function(){for(let a=0;a<u*2;a++)lx[a]=Math.floor(Math.random()*16)+48,lx[a]>=58&&(lx[a]+=39);return String.fromCharCode.apply(null,lx.slice(0,u*2))}}class S4u{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=b4u(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new O4u,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=Li.active()){a.root&&(t=gr.deleteSpan(t));const r=gr.getSpan(t);if(GA(t))return Hu.debug("Instrumentation suppressed, returning Noop Span"),gr.wrapSpanContext(zW);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!gr.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??lC.INTERNAL,d=(a.links??[]).map(g=>({context:g.context,attributes:vh(g.attributes)})),E=vh(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const h=p.decision===aD.RECORD_AND_SAMPLED?Ui.SAMPLED:Ui.NONE,x={traceId:s,spanId:i,traceFlags:h,traceState:l};if(p.decision===aD.NOT_RECORD)return Hu.debug("Recording is off, propagating context in a non-recording span"),gr.wrapSpanContext(x);const f=vh(Object.assign(E,p.attributes));return new g4u({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??Li.active(),l=this.startSpan(e,n,s),c=gr.setSpan(s,l);return Li.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class z4u{_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=>{Ac(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 Us;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(Us||(Us={}));class w4u{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=E4u({},UW(),y4u(e));this._resource=a.resource??D4u(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new z4u(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new S4u({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=Us.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==Us.timeout&&(n=Us.resolved,r(n))}).catch(o=>{clearTimeout(i),n=Us.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==Us.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class P4u{_enabled=!1;_currentContext=R1;_bindFunction(e=R1,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=R1,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=R1,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||R1;try{return a.call(t,...r)}finally{this._currentContext=n}}}function j4u(u){if(u!==null){if(u===void 0){const e=new P4u;e.enable(),Li.setGlobalContextManager(e);return}u.enable(),Li.setGlobalContextManager(u)}}function M4u(u){if(u!==null){if(u===void 0){Ld.setGlobalPropagator(new _cu({propagators:[new e4u,new vcu]}));return}Ld.setGlobalPropagator(u)}}class T4u extends w4u{constructor(e={}){super(e)}register(e={}){gr.setGlobalTracerProvider(this),M4u(e.propagator),j4u(e.contextManager)}}class R4u{_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 Bj extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function $4u(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function _4u(u){if(u!=null)return()=>u}function N4u(u,e,a){return{timeoutMillis:$4u(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function L4u(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class I4u{_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 K4u(u){return new I4u(u.concurrencyLimit)}function V4u(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function G4u(){return{handleResponse(u){u==null||!V4u(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||Hu.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class H4u{_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=Hu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:vn.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:vn.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:vn.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:vn.FAILED,error:r.error});return}else r.status==="retryable"?a({code:vn.FAILED,error:new Bj("Export failed with retryable status")}):a({code:vn.FAILED,error:new Bj("Export failed with unknown error")})},r=>a({code:vn.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Q4u(u,e){return new H4u(u.transport,u.serializer,G4u(),u.promiseHandler,e.timeout)}function XW(u,e,a){return Q4u({transport:a,serializer:e,promiseHandler:K4u(u)},{timeout:u.timeoutMillis})}function Oj(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function YW(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Oj(u.charCodeAt(t)),n=Oj(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function eJ(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function q4u(u){const e=Number(BigInt.asUintN(32,u)),a=Number(BigInt.asUintN(32,u>>BigInt(32)));return{low:e,high:a}}function W4u(u){const e=eJ(u);return q4u(e)}function J4u(u){return eJ(u).toString()}const U4u=typeof BigInt<"u"?J4u:$cu;function Sj(u){return u}function Z4u(u){if(u!==void 0)return YW(u)}const X4u={encodeHrTime:W4u,encodeSpanContext:YW,encodeOptionalSpanContext:Z4u};function Y4u(u){return u===void 0?X4u:{encodeHrTime:U4u,encodeSpanContext:Sj,encodeOptionalSpanContext:Sj}}function edu(u){return{attributes:gg(u.attributes),droppedAttributesCount:0}}function udu(u){return{name:u.name,version:u.version}}function gg(u){return Object.keys(u).map(e=>uJ(e,u[e]))}function uJ(u,e){return{key:u,value:aJ(e)}}function aJ(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(aJ)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>uJ(a,t))}}:{}}function adu(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:gg(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>rdu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>tdu(n,e)),droppedLinksCount:u.droppedLinksCount}}function tdu(u,e){return{attributes:u.attributes?gg(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function rdu(u,e){return{attributes:u.attributes?gg(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function ndu(u,e){const a=Y4u(e);return{resourceSpans:odu(u,a)}}function idu(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 odu(u,e){const a=idu(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=>adu(h,e));s.push({scope:udu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:edu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const sdu={serializeRequest:u=>{const e=ndu(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))}},ldu=5,cdu=1e3,ddu=5e3,Edu=1.5,zj=.2;function pdu(){return Math.random()*(2*zj)-zj}class mdu{_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=ldu,i=cdu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,ddu)+pdu(),0);i=i*Edu;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 tJ(u){return new mdu(u.transport)}function xdu(u){return[429,502,503,504].includes(u)}function hdu(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 Ddu{_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?(Hu.debug("XHR success"),t({status:"success"})):r.status&&xdu(r.status)?t({status:"retryable",retryInMillis:hdu(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 fdu(u){return new Ddu(u)}class gdu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Hu.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function vdu(u){return new gdu(u)}function kdu(u,e){return XW(u,e,tJ({transport:fdu(u)}))}function bdu(u,e){return XW(u,e,tJ({transport:vdu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function ydu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):Hu.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function Cdu(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 Fdu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function Adu(u,e,a){return{...N4u(u,e,a),headers:Cdu(ydu(u.headers),e.headers,a.headers),url:Fdu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function Bdu(u,e){return{...L4u(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function Odu(u,e,a){return Adu({url:u.url,timeoutMillis:u.timeoutMillis,headers:_4u(u.headers),concurrencyLimit:u.concurrencyLimit},{},Bdu(a,e))}function Sdu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=Odu(u,a,t);return r?kdu(n,e):bdu(n,e)}class zdu extends R4u{constructor(e={}){super(Sdu(e,sdu,"v1/traces",{"Content-Type":"application/json"}))}}class rJ{emit(e){}}const wdu=new rJ;class Pdu{getLogger(e,a,t){return new rJ}}const nJ=new Pdu;class jdu{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):wdu}}class wj{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new jdu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:nJ}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 Mdu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},cx=Symbol.for("io.opentelemetry.js.api.logs"),q4=Mdu;function Tdu(u,e,a){return t=>t===u?e:a}const Pj=1;class QA{constructor(){this._proxyLoggerProvider=new wj}static getInstance(){return this._instance||(this._instance=new QA),this._instance}setGlobalLoggerProvider(e){return q4[cx]?this.getLoggerProvider():(q4[cx]=Tdu(Pj,e,nJ),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=q4[cx])===null||e===void 0?void 0:e.call(q4,Pj))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete q4[cx],this._proxyLoggerProvider=new wj}}const iJ=QA.getInstance();function Rdu(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 $du(u){u.forEach(e=>e.disable())}function _du(u){const e=u.tracerProvider||gr.getTracerProvider(),a=u.meterProvider||MW.getMeterProvider(),t=u.loggerProvider||iJ.getLoggerProvider(),r=u.instrumentations?.flat()??[];return Rdu(r,e,a,t),()=>{$du(r)}}let Wr=console.error.bind(console);function W4(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 oJ=(u,e,a)=>{if(!u||!u[e]){Wr("no original function "+String(e)+" to wrap");return}if(!a){Wr("no wrapper function"),Wr(new Error().stack);return}const t=u[e];if(typeof t!="function"||typeof a!="function"){Wr("original object and wrapper must be functions");return}const r=a(t,e);return W4(r,"__original",t),W4(r,"__unwrap",()=>{u[e]===r&&W4(u,e,t)}),W4(r,"__wrapped",!0),W4(u,e,r),r},Ndu=(u,e,a)=>{if(u)Array.isArray(u)||(u=[u]);else{Wr("must provide one or more modules to patch"),Wr(new Error().stack);return}if(!(e&&Array.isArray(e))){Wr("must provide one or more functions to wrap on modules");return}u.forEach(t=>{e.forEach(r=>{oJ(t,r,a)})})},sJ=(u,e)=>{if(!u||!u[e]){Wr("no function to unwrap."),Wr(new Error().stack);return}const a=u[e];if(!a.__unwrap)Wr("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{a.__unwrap();return}},Ldu=(u,e)=>{if(u)Array.isArray(u)||(u=[u]);else{Wr("must provide one or more modules to patch"),Wr(new Error().stack);return}if(!(e&&Array.isArray(e))){Wr("must provide one or more functions to unwrap on modules");return}u.forEach(a=>{e.forEach(t=>{sJ(a,t)})})};class Idu{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,a,t){this.instrumentationName=e,this.instrumentationVersion=a,this.setConfig(t),this._diag=Hu.createComponentLogger({namespace:e}),this._tracer=gr.getTracer(e,a),this._meter=MW.getMeter(e,a),this._logger=iJ.getLogger(e,a),this._updateMetricInstruments()}_wrap=oJ;_unwrap=sJ;_massWrap=Ndu;_massUnwrap=Ldu;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 Kdu extends Idu{constructor(e,a,t){super(e,a,t),this._config.enabled&&this.enable()}}class Vdu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(exports.SpanStatusCode.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(exports.SpanStatusCode.OK),this.span.end())}}class Gdu{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":uD(),"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=gr.setSpan(Li.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=Li.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=gr.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 Vdu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class Hdu extends Gdu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${uD()}`,t=JW({[NW]:e.serviceName,[Scu]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new T4u({resource:t,spanProcessors:[new F4u(new zdu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),_du({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class Ti extends Kdu{sendErrorEvent;originalConsoleError;constructor(e,a){super("errors","1.0",e||{}),this.sendErrorEvent=a}static toErrorEvent(e,a){return{type:"error",payload:{handler:a,errorType:Ti.getErrorType(e),message:Ti.getErrorMessage(e),stack:Ti.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=Ti.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(Ti.toErrorEvent(e,a))}}class Qdu{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 Hdu,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 Ti(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_${uD()}`,type:e,source:t.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:a,origin:t.origin||"ui",sourceDetails:{id:t.sourceDetails.user||`usr_${uD()}`,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(Ti.toErrorEvent(e,a).type,Ti.toErrorEvent(e,a).payload)}sendTabChangeMessage(){this.send("tab.change")}sendButtonClickMessage(){this.send("button.click")}sendChangeMessage(){this.send("change")}sendContentCopyMessage(){this.send("content.copy")}sendRequestSendMessage(){this.send("request.send")}sendTokenGenerateMessage(){this.send("token.generate")}sendAppLifecycleMessage(){this.send("app.lifecycle")}sendEnvironmentManagementMessage(){this.send("environment.management")}sendServerManagementMessage(){this.send("server.management")}sendInputManagementMessage(){this.send("input.management")}sendNodeManagementMessage(){this.send("node.management")}sendHistoryManagementMessage(){this.send("history.management")}sendCredentialManagementMessage(){this.send("credential.management")}sendPanelToggleMessage(){this.send("panel.toggle")}sendWorkflowRunClickMessage(){this.send("workflow.run.click")}sendWorkflowRunResultMessage(){this.send("workflow.run.result")}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")}sendUpdaterCheckMessage(){this.send("updater.check")}sendUpdaterDownloadMessage(){this.send("updater.download")}sendUpdaterInstallMessage(){this.send("updater.install")}sendUpdaterProcessMessage(){this.send("updater.process")}sendErrorMessage(e){this.send("error",e)}sendCodeEditorSearchMessage(e){this.send("code_editor.search",e)}}const vg=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],qdu="https://cors.redocly.com/";function Wdu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function jj(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 Mj(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?jj(Object(a),!0).forEach(function(t){Wdu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):jj(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function yt(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 Tj=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Ok=function(){return Math.random().toString(36).substring(7).split("").join(".")},Uo={INIT:"@@redux/INIT"+Ok(),REPLACE:"@@redux/REPLACE"+Ok(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ok()}};function lJ(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 Jdu(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(Xdu(u))return"date";if(Zdu(u))return"error";var a=Udu(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 Udu(u){return typeof u.constructor=="function"?u.constructor.name:null}function Zdu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function Xdu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function zo(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=Jdu(u)),e}function kg(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"?yt(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"?yt(1):"Expected the enhancer to be a function. Instead, received: '"+zo(a)+"'");return a(kg)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?yt(2):"Expected the root reducer to be a function. Instead, received: '"+zo(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"?yt(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"?yt(4):"Expected the listener to be a function. Instead, received: '"+zo(x)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?yt(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"?yt(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(!lJ(x))throw new Error(process.env.NODE_ENV==="production"?yt(7):"Actions must be plain objects. Instead, the actual type was: '"+zo(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"?yt(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"?yt(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"?yt(10):"Expected the nextReducer to be a function. Instead, received: '"+zo(x));r=x,E({type:Uo.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"?yt(11):"Expected the observer to be an object. Instead, received: '"+zo(g)+"'");function v(){g.next&&g.next(c())}v();var y=f(v);return{unsubscribe:y}}},x[Tj]=function(){return this},x}return E({type:Uo.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[Tj]=h,t}var Ydu=kg;function hC(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function eEu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===Uo.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(!lJ(u))return"The "+n+' has unexpected type of "'+zo(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===Uo.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 uEu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:Uo.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?yt(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:Uo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?yt(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Uo.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 aEu(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"&&hC('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{uEu(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=eEu(l,a,c,i);d&&hC(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 v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?yt(14):"When called with an action of type "+(v?'"'+String(v)+'"':"(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 Rj(u,e){return function(){return e(u.apply(this,arguments))}}function tEu(u,e){if(typeof u=="function")return Rj(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?yt(16):"bindActionCreators expected an object or a function, but instead received: '"+zo(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]=Rj(r,e))}return a}function cJ(){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 rEu(){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"?yt(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=cJ.apply(void 0,o)(r.dispatch),Mj(Mj({},r),{},{dispatch:n})}}}function $j(){}process.env.NODE_ENV!=="production"&&typeof $j.name=="string"&&$j.name!=="isCrushed"&&hC('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 nEu=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Uo,applyMiddleware:rEu,bindActionCreators:tEu,combineReducers:aEu,compose:cJ,createStore:kg,legacy_createStore:Ydu});function iEu(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 oEu=iEu(nEu);oEu.compose;var sEu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function lEu(u,e,a){var t=!1,r=!1,n=kg(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(Eu)}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?Eu:u.get({noproxy:!0})},sEu({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 cEu(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=lEu(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 Ku=(u=>(u.Normal="Normal",u.Edit="Edit",u.Draft="Draft",u))(Ku||{});const F3="default",dJ=[{name:F3,inputs:[],servers:[],state:Ku.Normal}],EJ={activeTabIdx:0,tabs:[]};var fn=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(fn||{});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 DC(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(!DC(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)||!DC(u[n],e[n]))return!1}return!0}return u!==u&&e!==e}function _j(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}function Rl(){return!!window?.__TAURI__}async function Pt(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}async function Nj(u,e,a){const t=[],r=[];for(const n of u){const i=Promise.resolve().then(()=>a(n,u));if(t.push(i),e<=u.length){const o=i.then(()=>r.splice(r.indexOf(o),1));r.push(o),r.length>=e&&await Promise.race(r)}}return Promise.all(t)}const or={FS:"fs",WEB:"web"};var oD;(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"})(oD||(oD={}));async function dEu(){return Pt("plugin:path|resolve_directory",{directory:oD.AppData})}async function EEu(){return Pt("plugin:path|resolve_directory",{directory:oD.Desktop})}function pJ(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function pEu(...u){return Pt("plugin:path|resolve",{paths:u})}async function Id(...u){return Pt("plugin:path|join",{paths:u})}async function mEu(u){return Pt("plugin:path|dirname",{path:u})}async function xEu(u){return Pt("plugin:path|extname",{path:u})}async function mJ(u,e){return Pt("plugin:path|basename",{path:u,ext:e})}async function hEu(u){return Pt("plugin:path|is_absolute",{path:u})}var Lj;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(Lj||(Lj={}));async function Ij(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Pt("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function xJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Pt("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function DEu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await Pt("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 qA(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Pt("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function fEu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Pt("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function gEu(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Pt("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function hJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Pt("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}class ca{static utils=null;static async getUtils(){return ca.utils||(ca.utils=Rl()?await Promise.resolve().then(()=>require("./replay-tauri-path-Bfy56bHq.js")):await Promise.resolve().then(()=>Sie)),ca.utils}static async dirname(e){return(await ca.getUtils()).dirname(e)}static async join(...e){return(await ca.getUtils()).join(...e)}static async resolve(e){return(await ca.getUtils()).resolve(e)}static async isAbsolute(e){return(await ca.getUtils()).isAbsolute(e)}static async relative(e,a){return(await ca.getUtils()).relative(e,a)}static async extname(e){return(await ca.getUtils()).extname(e)}}const vEu=new Set(["node_modules"]);class Kj{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await Ij(e,{recursive:!0})}async ls(e){const a=await this.getFullPath(e);return this.getDirEntryFilesRecursively(a)}async getDirEntryFilesRecursively(e){try{const a=[],t=await xJ(e);for(const r of t)if(r.isDirectory){if(vEu.has(r.name))continue;const n=await Id(e,r.name),i=await this.getDirEntryFilesRecursively(n);a.push(...i)}else{const n=await Id(e,r.name),i=await ca.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 qA(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=pJ(),n=t.split(r).slice(0,-1).join(r);await Ij(n,{recursive:!0}),await gEu(t,a)}async remove(e){const a=await this.getFullPath(e);try{await fEu(a)}catch(t){!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t)}}async getFullPath(e){return await Id(this.baseDir,e??"")}}class kEu{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,a){}async remove(e){}}class bEu{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 DJ{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await ca.resolve(await ca.join(this.storage.baseDir,"/",e))}async parseMany(e,a){return(await Promise.all(e.map(async r=>{try{return await this.parse(r,a)}catch(n){return console.error(`Error parsing from ${r.type} ${r.uri}:`,n),null}}))).filter(r=>r!==null)}setItemIds(e){this.itemIds=e}async write(e){e.state===Ku.Draft||e.srcType!==or.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 yEu extends DJ{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:a,srcType:t,...r}=e;return await ca.extname(a)===".json"?JSON.stringify(r,null,2):Ji.dump(r)}}var It=(u=>(u.SIMPLE="simple",u.REGEX="regex",u.JSONPATH="jsonpath",u.XPATH="xpath",u))(It||{});const fJ=1024;let CEu=0,p0=class{constructor(e,a){this.from=e,this.to=a}};class xu{constructor(e={}){this.id=CEu++,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=qt.match(e)),a=>{let t=e(a);return t===void 0?null:[this,t]}}}xu.closedBy=new xu({deserialize:u=>u.split(" ")});xu.openedBy=new xu({deserialize:u=>u.split(" ")});xu.group=new xu({deserialize:u=>u.split(" ")});xu.isolate=new xu({deserialize:u=>{if(u&&u!="rtl"&&u!="ltr"&&u!="auto")throw new RangeError("Invalid value for isolate: "+u);return u||"auto"}});xu.contextHash=new xu({perNode:!0});xu.lookAhead=new xu({perNode:!0});xu.mounted=new xu({perNode:!0});class BE{constructor(e,a,t){this.tree=e,this.overlay=a,this.parser=t}static get(e){return e&&e.props&&e.props[xu.mounted.id]}}const FEu=Object.create(null);class qt{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):FEu,t=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new qt(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(xu.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(xu.group),n=-1;n<(r?r.length:0);n++){let i=a[n<0?t.name:r[n]];if(i)return i}}}}qt.none=new qt("",Object.create(null),0,8);class bg{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 qt(t.name,r,t.id,t.flags):t)}return new bg(a)}}const dx=new WeakMap,Vj=new WeakMap;var Da;(function(u){u[u.ExcludeBuffers=1]="ExcludeBuffers",u[u.IncludeAnonymous=2]="IncludeAnonymous",u[u.IgnoreMounts=4]="IgnoreMounts",u[u.IgnoreOverlays=8]="IgnoreOverlays"})(Da||(Da={}));let ga=class fC{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=BE.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 sD(this.topNode,e)}cursorAt(e,a=0,t=0){let r=dx.get(this)||this.topNode,n=new sD(r);return n.moveTo(e,a),dx.set(this,n._tree),n}get topNode(){return new v0(this,0,0,null)}resolve(e,a=0){let t=OE(dx.get(this)||this.topNode,e,a,!1);return dx.set(this,t),t}resolveInner(e,a=0){let t=OE(Vj.get(this)||this.topNode,e,a,!0);return Vj.set(this,t),t}resolveStack(e,a=0){return OEu(this,e,a)}iterate(e){let{enter:a,leave:t,from:r=0,to:n=this.length}=e,i=e.mode||0,o=(i&Da.IncludeAnonymous)>0;for(let s=this.cursor(i|Da.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:UA(qt.none,this.children,this.positions,0,this.children.length,0,this.length,(a,t,r)=>new fC(this.type,a,t,r,this.propValues),e.makeTree||((a,t,r)=>new fC(qt.none,a,t,r)))}static build(e){return SEu(e)}};ga.empty=new ga(qt.none,[],[],0);class WA{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 WA(this.buffer,this.index)}}class ts{constructor(e,a,t){this.buffer=e,this.length=a,this.set=t}get type(){return qt.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&&!(gJ(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 ts(n,i,this.set)}}function gJ(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 OE(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 v0&&u.index<0?null:u.parent;if(!i)return u;u=i}let n=t?0:Da.IgnoreOverlays;if(t)for(let i=u,o=i.parent;o;i=o,o=i.parent)i instanceof v0&&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 vJ{cursor(e=0){return new sD(this,e)}getChild(e,a=null,t=null){let r=Gj(this,e,a,t);return r.length?r[0]:null}getChildren(e,a=null,t=null){return Gj(this,e,a,t)}resolve(e,a=0){return OE(this,e,a,!1)}resolveInner(e,a=0){return OE(this,e,a,!0)}matchContext(e){return gC(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 v0=class bh extends vJ{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(gJ(r,t,d,d+c.length)){if(c instanceof ts){if(n&Da.ExcludeBuffers)continue;let E=c.findChild(0,c.buffer.length,a,t-d,r);if(E>-1)return new On(new AEu(i,c,e,d),null,E)}else if(n&Da.IncludeAnonymous||!c.type.isAnonymous||JA(c)){let E;if(!(n&Da.IgnoreMounts)&&(E=BE.get(c))&&!E.overlay)return new bh(E.tree,d,e,i);let p=new bh(c,d,e,i);return n&Da.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(a<0?c.children.length-1:0,a,t,r)}}}if(n&Da.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&Da.IgnoreOverlays)&&(r=BE.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 bh(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 Gj(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 gC(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 AEu{constructor(e,a,t,r){this.parent=e,this.buffer=a,this.index=t,this.start=r}}class On extends vJ{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 On(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&Da.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 On(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 On(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 On(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 ga(this.type,e,a,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function kJ(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 v0&&a.index<0?null:a.parent,r=u.slice();return t?r[e]=t:r.splice(e,1),new BEu(r,a)}class BEu{constructor(e,a){this.heads=e,this.node=a}get next(){return kJ(this.heads)}}function OEu(u,e,a){let t=u.resolveInner(e,a),r=null;for(let n=t instanceof v0?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=BE.get(n.tree);if(i&&i.overlay&&i.overlay[0].from<=e&&i.overlay[i.overlay.length-1].to>=e){let o=new v0(i.tree,i.overlay[0].from+n.from,-1,n);(r||(r=[t])).push(OE(o,e,a,!1))}}return r?kJ(r):t}class sD{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 v0)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 v0?(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&Da.ExcludeBuffers?!1:this.enterChild(1,e,a):this.yield(this._tree.enter(e,a,t))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Da.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Da.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&Da.IncludeAnonymous||o instanceof ts||!o.type.isAnonymous||JA(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 On(this.buffer,a,this.stack[r]);return this.bufferNode=new On(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 gC(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 gC(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 JA(u){return u.children.some(e=>e instanceof ts||!e.type.isAnonymous||JA(e))}function SEu(u){var e;let{buffer:a,nodeSet:t,maxBufferLength:r=fJ,reused:n=[],minRepeatType:i=t.types.length}=u,o=Array.isArray(a)?new WA(a,a.length):a,s=t.types,l=0,c=0;function d(k,b,C,B,O,T){let{id:M,start:R,end:K,size:q}=o,W=c,Y=l;for(;q<0;)if(o.next(),q==-1){let $=n[M];C.push($),B.push(R-k);return}else if(q==-3){l=M;return}else if(q==-4){c=M;return}else throw new RangeError(`Unrecognized record size: ${q}`);let ie=s[M],te,me,I=R-k;if(K-R<=r&&(me=f(o.pos-b,O))){let $=new Uint16Array(me.size-me.skip),G=o.pos-me.size,_=$.length;for(;o.pos>G;)_=D(me.start,$,_);te=new ts($,K-me.start,t),I=me.start-k}else{let $=o.pos-q;o.next();let G=[],_=[],A=M>=i?M:-1,z=0,N=K;for(;o.pos>$;)A>=0&&o.id==A&&o.size>=0?(o.end<=N-r&&(h(G,_,R,z,o.end,N,A,W,Y),z=G.length,N=o.end),o.next()):T>2500?E(R,$,G,_):d(R,$,G,_,A,T+1);if(A>=0&&z>0&&z<G.length&&h(G,_,R,z,R,N,A,W,Y),G.reverse(),_.reverse(),A>-1&&z>0){let J=p(ie,Y);te=UA(ie,G,_,0,G.length,0,K-R,J,J)}else te=x(ie,G,_,K-R,W-K,Y)}C.push(te),B.push(I)}function E(k,b,C,B){let O=[],T=0,M=-1;for(;o.pos>b;){let{id:R,start:K,end:q,size:W}=o;if(W>4)o.next();else{if(M>-1&&K<M)break;M<0&&(M=q-r),O.push(R,K,q),T++,o.next()}}if(T){let R=new Uint16Array(T*4),K=O[O.length-2];for(let q=O.length-3,W=0;q>=0;q-=3)R[W++]=O[q],R[W++]=O[q+1]-K,R[W++]=O[q+2]-K,R[W++]=W;C.push(new ts(R,O[2]-K,t)),B.push(K-k)}}function p(k,b){return(C,B,O)=>{let T=0,M=C.length-1,R,K;if(M>=0&&(R=C[M])instanceof ga){if(!M&&R.type==k&&R.length==O)return R;(K=R.prop(xu.lookAhead))&&(T=B[M]+R.length+K)}return x(k,C,B,O,T,b)}}function h(k,b,C,B,O,T,M,R,K){let q=[],W=[];for(;k.length>B;)q.push(k.pop()),W.push(b.pop()+C-O);k.push(x(t.types[M],q,W,T-O,R-T,K)),b.push(O-C)}function x(k,b,C,B,O,T,M){if(T){let R=[xu.contextHash,T];M=M?[R].concat(M):[R]}if(O>25){let R=[xu.lookAhead,O];M=M?[R].concat(M):[R]}return new ga(k,b,C,B,M)}function f(k,b){let C=o.fork(),B=0,O=0,T=0,M=C.end-r,R={size:0,start:0,skip:0};e:for(let K=C.pos-k;C.pos>K;){let q=C.size;if(C.id==b&&q>=0){R.size=B,R.start=O,R.skip=T,T+=4,B+=4,C.next();continue}let W=C.pos-q;if(q<0||W<K||C.start<M)break;let Y=C.id>=i?4:0,ie=C.start;for(C.next();C.pos>W;){if(C.size<0)if(C.size==-3)Y+=4;else break e;else C.id>=i&&(Y+=4);C.next()}O=ie,B+=q,T+=Y}return(b<0||B==k)&&(R.size=B,R.start=O,R.skip=T),R.size>4?R:void 0}function D(k,b,C){let{id:B,start:O,end:T,size:M}=o;if(o.next(),M>=0&&B<i){let R=C;if(M>4){let K=o.pos-(M-4);for(;o.pos>K;)C=D(k,b,C)}b[--C]=R,b[--C]=T-k,b[--C]=O-k,b[--C]=B}else M==-3?l=B:M==-4&&(c=B);return C}let g=[],v=[];for(;o.pos>0;)d(u.start||0,u.bufferStart||0,g,v,-1,0);let y=(e=u.length)!==null&&e!==void 0?e:g.length?v[0]+g[0].length:0;return new ga(s[u.topID],g.reverse(),v.reverse(),y)}const Hj=new WeakMap;function yh(u,e){if(!u.isAnonymous||e instanceof ts||e.type!=u)return 1;let a=Hj.get(e);if(a==null){a=1;for(let t of e.children){if(t.type!=u||!(t instanceof ga)){a=1;break}a+=yh(u,t)}Hj.set(e,a)}return a}function UA(u,e,a,t,r,n,i,o,s){let l=0;for(let h=t;h<r;h++)l+=yh(u,e[h]);let c=Math.ceil(l*1.5/8),d=[],E=[];function p(h,x,f,D,g){for(let v=f;v<D;){let y=v,k=x[v],b=yh(u,h[v]);for(v++;v<D;v++){let C=yh(u,h[v]);if(b+C>=c)break;b+=C}if(v==y+1){if(b>c){let C=h[y];p(C.children,C.positions,0,C.children.length,x[y]+g);continue}d.push(h[y])}else{let C=x[v-1]+h[v-1].length-k;d.push(UA(u,h,x,y,v,k,C,null,s))}E.push(k+g-n)}}return p(e,a,t,r,0),(o||s)(d,E,i)}class ZA{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 On?this.setBuffer(e.context.buffer,e.index,a):e instanceof v0&&this.map.set(e.tree,a)}get(e){return e instanceof On?this.getBuffer(e.context.buffer,e.index):e instanceof v0?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 Ki{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 Ki(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 Ki(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 XA=class{startParse(e,a,t){return typeof e=="string"&&(e=new zEu(e)),t=t?t.length?t.map(r=>new p0(r.from,r.to)):[new p0(0,0)]:[new p0(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 zEu{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 wEu(u){return(e,a,t,r)=>new jEu(e,u,a,t,r)}class Qj{constructor(e,a,t,r,n){this.parser=e,this.parse=a,this.overlay=t,this.target=r,this.from=n}}function qj(u){if(!u.length||u.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(u))}class PEu{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 vC=new xu({perNode:!0});class jEu{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 ga(t.type,t.children,t.positions,t.length,t.propValues.concat([[vC,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[xu.mounted.id]=new BE(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 REu(this.fragments),a=null,t=null,r=new sD(new v0(this.baseTree,this.ranges[0].from,0,null),Da.IncludeAnonymous|Da.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=MEu(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||TEu(r);let l=e.findMounts(r.from,n.parser);if(typeof n.overlay=="function")a=new PEu(n.parser,n.overlay,l,this.inner.length,r.from,r.tree,a);else{let c=Uj(this.ranges,n.overlay||(r.from<r.to?[new p0(r.from,r.to)]:[]));c.length&&qj(c),(c.length||!n.overlay)&&this.inner.push(new Qj(n.parser,c.length?n.parser.startParse(this.input,Zj(l,c),c):n.parser.startParse(""),n.overlay?n.overlay.map(d=>new p0(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 p0(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=Uj(this.ranges,a.ranges);l.length&&(qj(l),this.inner.splice(a.index,0,new Qj(a.parser,a.parser.startParse(this.input,Zj(a.mounts,l),l),a.ranges.map(c=>new p0(c.from-a.start,c.to-a.start)),a.target,l[0].from))),a=a.prev}t&&!--t.depth&&(t=t.prev)}}}}function MEu(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 Wj(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 TEu(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=[];Wj(i,c,f,D,g,p);let v=o[f+1],y=o[f+2];s.push(D.length);let k=x?l(f+4,o[f+3],i.set.types[o[f]],v,y-v,x-1):e.toTree();return D.push(k),g.push(v-p),Wj(i,o[f+3],d,D,g,p),new ga(E,D,g,h)}r.children[n]=l(0,o.length,qt.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 v0(d,E+u.from,c,u._tree))}}class Jj{constructor(e,a){this.offset=a,this.done=!1,this.cursor=e.cursor(Da.IncludeAnonymous|Da.IgnoreMounts)}moveTo(e){let{cursor:a}=this,t=e-this.offset;for(;!this.done&&a.from<t;)a.to>=e&&a.enter(t,1,Da.IgnoreOverlays|Da.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 ga)a=a.children[0];else break}return!1}}let REu=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(vC))!==null&&a!==void 0?a:t.to,this.inner=new Jj(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(vC))!==null&&e!==void 0?e:a.to,this.inner=new Jj(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(xu.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 Uj(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 p0(s.from,i),s.to>o&&a.splice(n+1,0,new p0(o,s.to))):s.to>o?a[n--]=new p0(o,s.to):a.splice(n--,1))}}return t}function $Eu(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 p0(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 Zj(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 p0(E.from+t,E.to+t)),d=$Eu(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 Ki(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 Ki(s,l,r.tree,-i,n.from>=i||n.openStart,n.to<=o||n.openEnd))}return a}class lD{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 lD(e,[],a,t,t,0,[],0,r?new Xj(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 lD(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 _Eu(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 Xj(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 Xj{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class _Eu{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 cD{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 cD(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 cD(this.stack,this.pos,this.index)}}function vd(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 Ch{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Yj=new Ch;class NEu{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Yj,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=Yj,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 tc{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;bJ(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}tc.prototype.contextual=tc.prototype.fallback=tc.prototype.extend=!1;class dD{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?vd(e):e}token(e,a){let t=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(bJ(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))}}dD.prototype.contextual=tc.prototype.fallback=tc.prototype.extend=!1;class Ha{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function bJ(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||LEu(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 eM(u,e,a){for(let t=e,r;(r=u[t])!=65535;t++)if(r==a)return t-e;return-1}function LEu(u,e,a,t){let r=eM(a,t,e);return r<0||eM(a,t,u)<r}const Pr=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let Sk=null;function uM(u,e,a){let t=u.cursor(Da.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 IEu{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?uM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?uM(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 ga){if(i==e){if(i<this.safeFrom)return null;let o=i+n.length;if(o<=this.safeTo){let s=n.prop(xu.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 KEu{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Ch)}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 Ch,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 Ch,{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=Pi(o,l+2);else{r==0&&o[l+1]==2&&(r=this.putAction(Pi(o,l+2),a,t,r));break}o[l]==a&&(r=this.putAction(Pi(o,l+1),a,t,r))}return r}}let VEu=class{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 NEu(a,r),this.tokens=new KEu(e,this.stream),this.topTerm=e.top[1];let{from:n}=r[0];this.stacks=[lD.start(this,e.top[0],n)],this.fragments=t.length&&this.stream.end-n>e.bufferLength*4?new IEu(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&&HEu(r);if(i)return Pr&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Pr&&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 Pr&&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=Pr?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(xu.contextHash)||0)==c))return e.useNode(d,E),Pr&&console.log(i+this.stackID(e)+` (via reuse of ${n.getName(d.type.id)})`),!0;if(!(d instanceof ga)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof ga&&d.positions[0]==0)d=p;else break}}let o=n.stateSlot(e.state,4);if(o>0)return e.reduce(o),Pr&&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),Pr&&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 aM(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=Pr?this.stackID(o)+" -> ":"";if(o.deadEnd&&(n||(n=!0,o.restart(),Pr&&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&&(Pr&&console.log(E+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,t));p++)Pr&&(E=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(s))Pr&&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),Pr&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),aM(o,t)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),ga.build({buffer:cD.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=(Sk||(Sk=new WeakMap)).get(e);return a||Sk.set(e,a=String.fromCodePoint(this.nextStackID++)),a+e}};function aM(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 GEu{constructor(e,a,t){this.source=e,this.flags=a,this.disabled=t}allows(e){return!this.disabled||this.disabled[e]==0}}const zk=u=>u;class A3{constructor(e){this.start=e.start,this.shift=e.shift||zk,this.reduce=e.reduce||zk,this.reuse=e.reuse||zk,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class W0 extends XA{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=xu[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 bg(a.map((o,s)=>qt.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=fJ;let i=vd(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(tM),this.states=vd(e.states,Uint32Array),this.data=vd(e.stateData),this.goto=vd(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new tc(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 VEu(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=Pi(t,n+2)];else{if(t[n+1]==2)return Pi(t,n+2);break}if(i==a||i==0)return Pi(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=Pi(this.data,n+2);else break;r=a(Pi(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=Pi(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(W0.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]=tM(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 GEu(e,t,r)}static deserialize(e){return new W0(e)}}function Pi(u,e){return u[e]|u[e+1]<<16}function HEu(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 tM(u){if(u.external){let e=u.extend?1:0;return(a,t)=>u.external(a,t)<<1|e}return u.get}let QEu=0,ji=class kC{constructor(e,a,t,r){this.name=e,this.set=a,this.base=t,this.modified=r,this.id=QEu++}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 kC&&(a=e),a?.base)throw new Error("Can not derive from a modified tag");let r=new kC(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 ED(e);return t=>t.modified.indexOf(a)>-1?t:ED.get(t.base||t,t.modified.concat(a).sort((r,n)=>r.id-n.id))}},qEu=0;class ED{constructor(e){this.name=e,this.instances=[],this.id=qEu++}static get(e,a){if(!a.length)return e;let t=a[0].instances.find(o=>o.base==e&&WEu(a,o.modified));if(t)return t;let r=[],n=new ji(e.name,r,e,a);for(let o of a)o.instances.push(n);let i=JEu(a);for(let o of e.set)if(!o.modified.length)for(let s of i)r.push(ED.get(o,s));return n}}function WEu(u,e){return u.length==e.length&&u.every((a,t)=>a==e[t])}function JEu(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 ro(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 pD(t,i,s>0?n.slice(0,s):null);e[l]=c.sort(e[l])}}return yJ.add(e)}const yJ=new xu;class pD{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}}pD.empty=new pD([],2,null);function CJ(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 UEu(u,e){let a=null;for(let t of u){let r=t.style(e);r&&(a=a?a+" "+r:r)}return a}function ZEu(u,e,a,t=0,r=u.length){let n=new XEu(t,Array.isArray(e)?e:[e],a);n.highlightRange(u.cursor(),t,r,"",n.highlighters),n.flush(r)}class XEu{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=YEu(e)||pD.empty,d=UEu(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(xu.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,v=g?g.from+o:s,y=Math.max(a,D),k=Math.min(t,v);if(y<k&&x)for(;e.from<k&&(this.highlightRange(e,y,k,r,n),this.startSpan(Math.min(k,e.to),l),!(e.to>=v||!e.nextSibling())););if(!g||v>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 YEu(u){let e=u.type.prop(yJ);for(;e&&e.context&&!u.matchContext(e.context);)e=e.next;return e||null}const Re=ji.define,Ex=Re(),wo=Re(),rM=Re(wo),nM=Re(wo),Po=Re(),px=Re(Po),wk=Re(Po),hn=Re(),Ks=Re(hn),dn=Re(),En=Re(),bC=Re(),J4=Re(bC),mx=Re(),H={comment:Ex,lineComment:Re(Ex),blockComment:Re(Ex),docComment:Re(Ex),name:wo,variableName:Re(wo),typeName:rM,tagName:Re(rM),propertyName:nM,attributeName:Re(nM),className:Re(wo),labelName:Re(wo),namespace:Re(wo),macroName:Re(wo),literal:Po,string:px,docString:Re(px),character:Re(px),attributeValue:Re(px),number:wk,integer:Re(wk),float:Re(wk),bool:Re(Po),regexp:Re(Po),escape:Re(Po),color:Re(Po),url:Re(Po),keyword:dn,self:Re(dn),null:Re(dn),atom:Re(dn),unit:Re(dn),modifier:Re(dn),operatorKeyword:Re(dn),controlKeyword:Re(dn),definitionKeyword:Re(dn),moduleKeyword:Re(dn),operator:En,derefOperator:Re(En),arithmeticOperator:Re(En),logicOperator:Re(En),bitwiseOperator:Re(En),compareOperator:Re(En),updateOperator:Re(En),definitionOperator:Re(En),typeOperator:Re(En),controlOperator:Re(En),punctuation:bC,separator:Re(bC),bracket:J4,angleBracket:Re(J4),squareBracket:Re(J4),paren:Re(J4),brace:Re(J4),content:hn,heading:Ks,heading1:Re(Ks),heading2:Re(Ks),heading3:Re(Ks),heading4:Re(Ks),heading5:Re(Ks),heading6:Re(Ks),contentSeparator:Re(hn),list:Re(hn),quote:Re(hn),emphasis:Re(hn),strong:Re(hn),link:Re(hn),monospace:Re(hn),strikethrough:Re(hn),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:mx,documentMeta:Re(mx),annotation:Re(mx),processingInstruction:Re(mx),definition:ji.defineModifier("definition"),constant:ji.defineModifier("constant"),function:ji.defineModifier("function"),standard:ji.defineModifier("standard"),local:ji.defineModifier("local"),special:ji.defineModifier("special")};for(let u in H){let e=H[u];e instanceof ji&&(e.name=u)}CJ([{tag:H.link,class:"tok-link"},{tag:H.heading,class:"tok-heading"},{tag:H.emphasis,class:"tok-emphasis"},{tag:H.strong,class:"tok-strong"},{tag:H.keyword,class:"tok-keyword"},{tag:H.atom,class:"tok-atom"},{tag:H.bool,class:"tok-bool"},{tag:H.url,class:"tok-url"},{tag:H.labelName,class:"tok-labelName"},{tag:H.inserted,class:"tok-inserted"},{tag:H.deleted,class:"tok-deleted"},{tag:H.literal,class:"tok-literal"},{tag:H.string,class:"tok-string"},{tag:H.number,class:"tok-number"},{tag:[H.regexp,H.escape,H.special(H.string)],class:"tok-string2"},{tag:H.variableName,class:"tok-variableName"},{tag:H.local(H.variableName),class:"tok-variableName tok-local"},{tag:H.definition(H.variableName),class:"tok-variableName tok-definition"},{tag:H.special(H.variableName),class:"tok-variableName2"},{tag:H.definition(H.propertyName),class:"tok-propertyName tok-definition"},{tag:H.typeName,class:"tok-typeName"},{tag:H.namespace,class:"tok-namespace"},{tag:H.className,class:"tok-className"},{tag:H.macroName,class:"tok-macroName"},{tag:H.propertyName,class:"tok-propertyName"},{tag:H.operator,class:"tok-operator"},{tag:H.comment,class:"tok-comment"},{tag:H.meta,class:"tok-meta"},{tag:H.invalid,class:"tok-invalid"},{tag:H.punctuation,class:"tok-punctuation"}]);const e3u=ro({String:H.string,Number:H.number,"True False":H.bool,PropertyName:H.propertyName,Null:H.null,",":H.separator,"[ ]":H.squareBracket,"{ }":H.brace}),u3u=W0.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:[e3u],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 yC=[],FJ=[];(()=>{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?FJ:yC).push(a=a+u[e])})();function a3u(u){if(u<768)return!1;for(let e=0,a=yC.length;;){let t=e+a>>1;if(u<yC[t])a=t;else if(u>=FJ[t])e=t+1;else return!0;if(e==a)return!1}}function iM(u){return u>=127462&&u<=127487}const oM=8205;function t3u(u,e,a=!0,t=!0){return(a?AJ:r3u)(u,e,t)}function AJ(u,e,a){if(e==u.length)return e;e&&BJ(u.charCodeAt(e))&&OJ(u.charCodeAt(e-1))&&e--;let t=Pk(u,e);for(e+=sM(t);e<u.length;){let r=Pk(u,e);if(t==oM||r==oM||a&&a3u(r))e+=sM(r),t=r;else if(iM(r)){let n=0,i=e-2;for(;i>=0&&iM(Pk(u,i));)n++,i-=2;if(n%2==0)break;e+=2}else break}return e}function r3u(u,e,a){for(;e>0;){let t=AJ(u,e-2,a);if(t<e)return t;e--}return 0}function Pk(u,e){let a=u.charCodeAt(e);if(!OJ(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return BJ(t)?(a-55296<<10)+(t-56320)+65536:a}function BJ(u){return u>=56320&&u<57344}function OJ(u){return u>=55296&&u<56320}function sM(u){return u<65536?1:2}class _u{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]=Oc(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),Cn.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]=Oc(this,e,a);let t=[];return this.decompose(e,a,t,0),Cn.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 Kd(this),n=new Kd(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 Kd(this,e)}iterRange(e,a=this.length){return new SJ(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 zJ(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]?_u.empty:e.length<=32?new Va(e):Cn.from(Va.split(e,[]))}}class Va extends _u{constructor(e,a=n3u(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 i3u(r,o,t,i);r=o+1,t++}}decompose(e,a,t,r){let n=e<=0&&a>=this.length?this:new Va(lM(this.text,e,a),Math.min(a,this.length)-Math.max(0,e));if(r&1){let i=t.pop(),o=Fh(n.text,i.text.slice(),0,n.length);if(o.length<=32)t.push(new Va(o,i.length+n.length));else{let s=o.length>>1;t.push(new Va(o.slice(0,s)),new Va(o.slice(s)))}}else t.push(n)}replace(e,a,t){if(!(t instanceof Va))return super.replace(e,a,t);[e,a]=Oc(this,e,a);let r=Fh(this.text,Fh(t.text,lM(this.text,0,e)),a),n=this.length+t.length-(a-e);return r.length<=32?new Va(r,n):Cn.from(Va.split(r,[]),n)}sliceString(e,a=this.length,t=`
397
+ `;function RA({input:u,onSave:e,onCancel:a,...t}){const[r,n]=P.useState(!!u.isSecret),i=({name:o,value:s})=>{e({...u,name:o,value:s,isSecret:r})};return m.jsx(AW,{variable:u,onSave:i,onCancel:a,...t,children:m.jsx(CE,{children:m.jsx(FW,{value:r,onChange:o=>n(o),title:"Make it secret"})})})}const sC=()=>({name:"",value:"",isSecret:!1}),Oa=u=>vK+"$inputs."+u+Q2,BW=(u,e)=>e.inputs.find(a=>a.get().name===u.match(`^${$f}$`)?.[1]);function qlu({environments:u,activeEnvironmentId:e}){return u.get().find(t=>t.name===e.get())?.inputs||[]}function bo(u){const e=new RegExp($f,"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 xg(u){const e=/^\{?\$inputs\.([^\}\s]+)\}?$/,a=u.match(e);return a?a[1]:null}function gh(u){const e=new Error(u);return e.source="ulid",e}const $A="0123456789ABCDEFGHJKMNPQRSTVWXYZ",_d=$A.length,pj=Math.pow(2,48)-1,Wlu=10,Jlu=16;function Ulu(u){let e=Math.floor(u()*_d);return e===_d&&(e=_d-1),$A.charAt(e)}function Zlu(u,e){if(isNaN(u))throw new Error(u+" must be a number");if(u>pj)throw gh("cannot encode time greater than "+pj);if(u<0)throw gh("time must be positive");if(Number.isInteger(Number(u))===!1)throw gh("time must be an integer");let a,t="";for(;e>0;e--)a=u%_d,t=$A.charAt(a)+t,u=(u-a)/_d;return t}function Xlu(u,e){let a="";for(;u>0;u--)a=Ulu(e)+a;return a}function Ylu(u=!1,e){e||(e=typeof window<"u"?window:null);const a=e&&(e.crypto||e.msCrypto);if(a)return()=>{const t=new Uint8Array(1);return a.getRandomValues(t),t[0]/255};try{const t=require("crypto");return()=>t.randomBytes(1).readUInt8()/255}catch{}if(u){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw gh("secure crypto unusable, insecure Math.random not allowed")}function e1u(u){return u||(u=Ylu()),function(a){return isNaN(a)&&(a=Date.now()),Zlu(a,Wlu)+Xlu(Jlu,u)}}const uD=e1u();var u1u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},tl="1.9.0",mj=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function a1u(u){var e=new Set([u]),a=new Set,t=u.match(mj);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(mj);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 t1u=a1u(tl),r1u=tl.split(".")[0],FE=Symbol.for("opentelemetry.js.api."+r1u),AE=u1u;function y3(u,e,a,t){var r;t===void 0&&(t=!1);var n=AE[FE]=(r=AE[FE])!==null&&r!==void 0?r:{version:tl};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!==tl){var i=new Error("@opentelemetry/api: Registration of version v"+n.version+" for "+u+" does not match previously registered API v"+tl);return a.error(i.stack||i.message),!1}return n[u]=e,a.debug("@opentelemetry/api: Registered a global for "+u+" v"+tl+"."),!0}function vl(u){var e,a,t=(e=AE[FE])===null||e===void 0?void 0:e.version;if(!(!t||!t1u(t)))return(a=AE[FE])===null||a===void 0?void 0:a[u]}function C3(u,e){e.debug("@opentelemetry/api: Unregistering a global for "+u+" v"+tl+".");var a=AE[FE];a&&delete a[u]}var n1u=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},i1u=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))},o1u=(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 H4("debug",this._namespace,e)},u.prototype.error=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("error",this._namespace,e)},u.prototype.info=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("info",this._namespace,e)},u.prototype.warn=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("warn",this._namespace,e)},u.prototype.verbose=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return H4("verbose",this._namespace,e)},u})();function H4(u,e,a){var t=vl("diag");if(t)return a.unshift(e),t[u].apply(t,i1u([],n1u(a),!1))}var Lr;(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"})(Lr||(Lr={}));function s1u(u,e){u<Lr.NONE?u=Lr.NONE:u>Lr.ALL&&(u=Lr.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",Lr.ERROR),warn:a("warn",Lr.WARN),info:a("info",Lr.INFO),debug:a("debug",Lr.DEBUG),verbose:a("verbose",Lr.VERBOSE)}}var l1u=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},c1u=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))},d1u="diag",Ln=(function(){function u(){function e(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=vl("diag");if(o)return o[r].apply(o,c1u([],l1u(n),!1))}}var a=this,t=function(r,n){var i,o,s;if(n===void 0&&(n={logLevel:Lr.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=vl("diag"),d=s1u((o=n.logLevel)!==null&&o!==void 0?o:Lr.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 y3("diag",d,a,!0)};a.setLogger=t,a.disable=function(){C3(d1u,a)},a.createComponentLogger=function(r){return new o1u(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})(),E1u=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},p1u=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.")},m1u=(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=E1u(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=p1u(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})(),x1u=Symbol("BaggageEntryMetadata"),h1u=Ln.instance();function D1u(u){return u===void 0&&(u={}),new m1u(new Map(Object.entries(u)))}function f1u(u){return typeof u!="string"&&(h1u.error("Cannot create baggage metadata from unknown type: "+typeof u),u=""),{__TYPE__:x1u,toString:function(){return u}}}function _A(u){return Symbol.for(u)}var g1u=(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})(),R1=new g1u,Tl=(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)}})(),v1u=(function(){function u(){}return u.prototype.createGauge=function(e,a){return z1u},u.prototype.createHistogram=function(e,a){return w1u},u.prototype.createCounter=function(e,a){return S1u},u.prototype.createUpDownCounter=function(e,a){return P1u},u.prototype.createObservableGauge=function(e,a){return M1u},u.prototype.createObservableCounter=function(e,a){return j1u},u.prototype.createObservableUpDownCounter=function(e,a){return T1u},u.prototype.addBatchObservableCallback=function(e,a){},u.prototype.removeBatchObservableCallback=function(e){},u})(),hg=(function(){function u(){}return u})(),k1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(hg),b1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.add=function(a,t){},e})(hg),y1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(hg),C1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e.prototype.record=function(a,t){},e})(hg),NA=(function(){function u(){}return u.prototype.addCallback=function(e){},u.prototype.removeCallback=function(e){},u})(),F1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(NA),A1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(NA),B1u=(function(u){Tl(e,u);function e(){return u!==null&&u.apply(this,arguments)||this}return e})(NA),O1u=new v1u,S1u=new k1u,z1u=new y1u,w1u=new C1u,P1u=new b1u,j1u=new F1u,M1u=new A1u,T1u=new B1u,R1u={get:function(u,e){if(u!=null)return u[e]},keys:function(u){return u==null?[]:Object.keys(u)}},$1u={set:function(u,e,a){u!=null&&(u[e]=a)}},_1u=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},N1u=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))},L1u=(function(){function u(){}return u.prototype.active=function(){return R1},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,N1u([t],_1u(r),!1))},u.prototype.bind=function(e,a){return a},u.prototype.enable=function(){return this},u.prototype.disable=function(){return this},u})(),I1u=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},K1u=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))},hk="context",V1u=new L1u,Dg=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalContextManager=function(e){return y3(hk,e,Ln.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,K1u([e,a,t],I1u(n),!1))},u.prototype.bind=function(e,a){return this._getContextManager().bind(e,a)},u.prototype._getContextManager=function(){return vl(hk)||V1u},u.prototype.disable=function(){this._getContextManager().disable(),C3(hk,Ln.instance())},u})(),Ui;(function(u){u[u.NONE=0]="NONE",u[u.SAMPLED=1]="SAMPLED"})(Ui||(Ui={}));var OW="0000000000000000",SW="00000000000000000000000000000000",zW={traceId:SW,spanId:OW,traceFlags:Ui.NONE},Nd=(function(){function u(e){e===void 0&&(e=zW),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})(),LA=_A("OpenTelemetry Context Key SPAN");function IA(u){return u.getValue(LA)||void 0}function G1u(){return IA(Dg.getInstance().active())}function KA(u,e){return u.setValue(LA,e)}function H1u(u){return u.deleteValue(LA)}function Q1u(u,e){return KA(u,new Nd(e))}function wW(u){var e;return(e=IA(u))===null||e===void 0?void 0:e.spanContext()}var q1u=/^([0-9a-f]{32})$/i,W1u=/^[0-9a-f]{16}$/i;function PW(u){return q1u.test(u)&&u!==SW}function J1u(u){return W1u.test(u)&&u!==OW}function fg(u){return PW(u.traceId)&&J1u(u.spanId)}function U1u(u){return new Nd(u)}var Dk=Dg.getInstance(),jW=(function(){function u(){}return u.prototype.startSpan=function(e,a,t){t===void 0&&(t=Dk.active());var r=!!a?.root;if(r)return new Nd;var n=t&&wW(t);return Z1u(n)&&fg(n)?new Nd(n):new Nd},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??Dk.active(),l=this.startSpan(e,n,s),c=KA(s,l);return Dk.with(c,o,void 0,l)}},u})();function Z1u(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}var X1u=new jW,Y1u=(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):X1u},u})(),ecu=(function(){function u(){}return u.prototype.getTracer=function(e,a,t){return new jW},u})(),ucu=new ecu,xj=(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 Y1u(this,e,a,t)},u.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:ucu},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})(),aD;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(aD||(aD={}));var lC;(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"})(lC||(lC={}));exports.SpanStatusCode=void 0;(function(u){u[u.UNSET=0]="UNSET",u[u.OK=1]="OK",u[u.ERROR=2]="ERROR"})(exports.SpanStatusCode||(exports.SpanStatusCode={}));var Li=Dg.getInstance(),Hu=Ln.instance(),acu=(function(){function u(){}return u.prototype.getMeter=function(e,a,t){return O1u},u})(),tcu=new acu,fk="metrics",rcu=(function(){function u(){}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalMeterProvider=function(e){return y3(fk,e,Ln.instance())},u.prototype.getMeterProvider=function(){return vl(fk)||tcu},u.prototype.getMeter=function(e,a,t){return this.getMeterProvider().getMeter(e,a,t)},u.prototype.disable=function(){C3(fk,Ln.instance())},u})(),MW=rcu.getInstance(),ncu=(function(){function u(){}return u.prototype.inject=function(e,a){},u.prototype.extract=function(e,a){return e},u.prototype.fields=function(){return[]},u})(),VA=_A("OpenTelemetry Baggage Key");function TW(u){return u.getValue(VA)||void 0}function icu(){return TW(Dg.getInstance().active())}function ocu(u,e){return u.setValue(VA,e)}function scu(u){return u.deleteValue(VA)}var gk="propagation",lcu=new ncu,ccu=(function(){function u(){this.createBaggage=D1u,this.getBaggage=TW,this.getActiveBaggage=icu,this.setBaggage=ocu,this.deleteBaggage=scu}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalPropagator=function(e){return y3(gk,e,Ln.instance())},u.prototype.inject=function(e,a,t){return t===void 0&&(t=$1u),this._getGlobalPropagator().inject(e,a,t)},u.prototype.extract=function(e,a,t){return t===void 0&&(t=R1u),this._getGlobalPropagator().extract(e,a,t)},u.prototype.fields=function(){return this._getGlobalPropagator().fields()},u.prototype.disable=function(){C3(gk,Ln.instance())},u.prototype._getGlobalPropagator=function(){return vl(gk)||lcu},u})(),Ld=ccu.getInstance(),vk="trace",dcu=(function(){function u(){this._proxyTracerProvider=new xj,this.wrapSpanContext=U1u,this.isSpanContextValid=fg,this.deleteSpan=H1u,this.getSpan=IA,this.getActiveSpan=G1u,this.getSpanContext=wW,this.setSpan=KA,this.setSpanContext=Q1u}return u.getInstance=function(){return this._instance||(this._instance=new u),this._instance},u.prototype.setGlobalTracerProvider=function(e){var a=y3(vk,this._proxyTracerProvider,Ln.instance());return a&&this._proxyTracerProvider.setDelegate(e),a},u.prototype.getTracerProvider=function(){return vl(vk)||this._proxyTracerProvider},u.prototype.getTracer=function(e,a){return this.getTracerProvider().getTracer(e,a)},u.prototype.disable=function(){C3(vk,Ln.instance()),this._proxyTracerProvider=new xj},u})(),gr=dcu.getInstance();const RW=_A("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ecu(u){return u.setValue(RW,!0)}function GA(u){return u.getValue(RW)===!0}const pcu="=",cC=";",dC=",",kk="baggage",mcu=180,xcu=4096,hcu=8192;function Dcu(u){return u.reduce((e,a)=>{const t=`${e}${e!==""?dC:""}${a}`;return t.length>hcu?e:t},"")}function fcu(u){return u.getAllEntries().map(([e,a])=>{let t=`${encodeURIComponent(e)}=${encodeURIComponent(a.value)}`;return a.metadata!==void 0&&(t+=cC+a.metadata.toString()),t})}function gcu(u){const e=u.split(cC);if(e.length<=0)return;const a=e.shift();if(!a)return;const t=a.indexOf(pcu);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=f1u(e.join(cC))),{key:r,value:n,metadata:i}}class vcu{inject(e,a,t){const r=Ld.getBaggage(e);if(!r||GA(e))return;const n=fcu(r).filter(o=>o.length<=xcu).slice(0,mcu),i=Dcu(n);i.length>0&&t.set(a,kk,i)}extract(e,a,t){const r=t.get(a,kk),n=Array.isArray(r)?r.join(dC):r;if(!n)return e;const i={};return n.length===0||(n.split(dC).forEach(s=>{const l=gcu(s);if(l){const c={value:l.value};l.metadata&&(c.metadata=l.metadata),i[l.key]=c}}),Object.entries(i).length===0)?e:Ld.setBaggage(e,Ld.createBaggage(i))}fields(){return[kk]}}function vh(u){const e={};if(typeof u!="object"||u==null)return e;for(const[a,t]of Object.entries(u)){if(!kcu(a)){Hu.warn(`Invalid attribute key: ${a}`);continue}if(!$W(t)){Hu.warn(`Invalid attribute value set for key: ${a}`);continue}Array.isArray(t)?e[a]=t.slice():e[a]=t}return e}function kcu(u){return typeof u=="string"&&u.length>0}function $W(u){return u==null?!0:Array.isArray(u)?bcu(u):_W(u)}function bcu(u){let e;for(const a of u)if(a!=null){if(!e){if(_W(a)){e=typeof a;continue}return!1}if(typeof a!==e)return!1}return!0}function _W(u){switch(typeof u){case"number":case"boolean":case"string":return!0}return!1}function ycu(){return u=>{Hu.error(Ccu(u))}}function Ccu(u){return typeof u=="string"?u:JSON.stringify(Fcu(u))}function Fcu(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 Acu=ycu();function Ac(u){try{Acu(u)}catch{}}const uc=performance,Bcu="2.0.1",bk="exception.message",Ocu="exception.stacktrace",yk="exception.type",NW="service.name",Scu="service.version",EC="telemetry.sdk.language",zcu="webjs",pC="telemetry.sdk.name",mC="telemetry.sdk.version",wcu="process.runtime.name",Ck={[pC]:"opentelemetry",[wcu]:"browser",[EC]:zcu,[mC]:Bcu};const Pcu=9,jcu=6,Mcu=Math.pow(10,jcu),tD=Math.pow(10,Pcu);function H1(u){const e=u/1e3,a=Math.trunc(e),t=Math.round(u%1e3*Mcu);return[a,t]}function LW(){let u=uc.timeOrigin;if(typeof u!="number"){const e=uc;u=e.timing&&e.timing.fetchStart}return u}function Tcu(u){const e=H1(LW()),a=H1(typeof u=="number"?u:uc.now());return KW(e,a)}function Rcu(u,e){let a=e[0]-u[0],t=e[1]-u[1];return t<0&&(a-=1,t+=tD),[a,t]}function $cu(u){return u[0]*tD+u[1]}function IW(u){return Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"}function hj(u){return IW(u)||typeof u=="number"||u instanceof Date}function KW(u,e){const a=[u[0]+e[0],u[1]+e[1]];return a[1]>=tD&&(a[1]-=tD,a[0]+=1),a}var vn;(function(u){u[u.SUCCESS=0]="SUCCESS",u[u.FAILED=1]="FAILED"})(vn||(vn={}));class _cu{_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){Hu.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){Hu.warn(`Failed to extract with ${n.constructor.name}. Err: ${i.message}`)}return r},e)}fields(){return this._fields.slice()}}const xC="[_0-9a-z-*/]",Ncu=`[a-z]${xC}{0,255}`,Lcu=`[a-z0-9]${xC}{0,240}@[a-z]${xC}{0,13}`,Icu=new RegExp(`^(?:${Ncu}|${Lcu})$`),Kcu=/^[ -~]{0,255}[!-~]$/,Vcu=/,|=/;function Gcu(u){return Icu.test(u)}function Hcu(u){return Kcu.test(u)&&!Vcu.test(u)}const Dj=32,Qcu=512,fj=",",gj="=";class HA{_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+gj+this.get(a)),e),[]).join(fj)}_parse(e){e.length>Qcu||(this._internalState=e.split(fj).reverse().reduce((a,t)=>{const r=t.trim(),n=r.indexOf(gj);if(n!==-1){const i=r.slice(0,n),o=r.slice(n+1,t.length);Gcu(i)&&Hcu(o)&&a.set(i,o)}return a},new Map),this._internalState.size>Dj&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Dj))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new HA;return e._internalState=new Map(this._internalState),e}}const Fk="traceparent",Ak="tracestate",qcu="00",Wcu="(?!ff)[\\da-f]{2}",Jcu="(?![0]{32})[\\da-f]{32}",Ucu="(?![0]{16})[\\da-f]{16}",Zcu="[\\da-f]{2}",Xcu=new RegExp(`^\\s?(${Wcu})-(${Jcu})-(${Ucu})-(${Zcu})(-.*)?\\s?$`);function Ycu(u){const e=Xcu.exec(u);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}class e4u{inject(e,a,t){const r=gr.getSpanContext(e);if(!r||GA(e)||!fg(r))return;const n=`${qcu}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Ui.NONE).toString(16)}`;t.set(a,Fk,n),r.traceState&&t.set(a,Ak,r.traceState.serialize())}extract(e,a,t){const r=t.get(a,Fk);if(!r)return e;const n=Array.isArray(r)?r[0]:r;if(typeof n!="string")return e;const i=Ycu(n);if(!i)return e;i.isRemote=!0;const o=t.get(a,Ak);if(o){const s=Array.isArray(o)?o.join(","):o;i.traceState=new HA(typeof s=="string"?s:void 0)}return gr.setSpanContext(e,i)}fields(){return[Fk,Ak]}}const u4u="[object Object]",a4u="[object Null]",t4u="[object Undefined]",r4u=Function.prototype,VW=r4u.toString,n4u=VW.call(Object),i4u=Object.getPrototypeOf,GW=Object.prototype,HW=GW.hasOwnProperty,Js=Symbol?Symbol.toStringTag:void 0,QW=GW.toString;function vj(u){if(!o4u(u)||s4u(u)!==u4u)return!1;const e=i4u(u);if(e===null)return!0;const a=HW.call(e,"constructor")&&e.constructor;return typeof a=="function"&&a instanceof a&&VW.call(a)===n4u}function o4u(u){return u!=null&&typeof u=="object"}function s4u(u){return u==null?u===void 0?t4u:a4u:Js&&Js in Object(u)?l4u(u):c4u(u)}function l4u(u){const e=HW.call(u,Js),a=u[Js];let t=!1;try{u[Js]=void 0,t=!0}catch{}const r=QW.call(u);return t&&(e?u[Js]=a:delete u[Js]),r}function c4u(u){return QW.call(u)}const d4u=20;function E4u(...u){let e=u.shift();const a=new WeakMap;for(;u.length>0;)e=qW(e,u.shift(),0,a);return e}function Bk(u){return rD(u)?u.slice():u}function qW(u,e,a=0,t){let r;if(!(a>d4u)){if(a++,kh(u)||kh(e)||WW(e))r=Bk(e);else if(rD(u)){if(r=u.slice(),rD(e))for(let n=0,i=e.length;n<i;n++)r.push(Bk(e[n]));else if(Q4(e)){const n=Object.keys(e);for(let i=0,o=n.length;i<o;i++){const s=n[i];r[s]=Bk(e[s])}}}else if(Q4(u))if(Q4(e)){if(!p4u(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(kh(l))typeof l>"u"?delete r[s]:r[s]=l;else{const c=r[s],d=l;if(kj(u,s,t)||kj(e,s,t))delete r[s];else{if(Q4(c)&&Q4(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]=qW(r[s],l,a,t)}}}}else r=e;return r}}function kj(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 rD(u){return Array.isArray(u)}function WW(u){return typeof u=="function"}function Q4(u){return!kh(u)&&!rD(u)&&!WW(u)&&typeof u=="object"}function kh(u){return typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Date||u instanceof RegExp||u===null}function p4u(u,e){return!(!vj(u)||!vj(e))}class m4u{_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 x4u{_callback;_that;_isCalled=!1;_deferred=new m4u;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 h4u(){return"unknown_service"}const gd=u=>u!==null&&typeof u=="object"&&typeof u.then=="function";class nD{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const a=new nD({});return a._rawAttributes=bj(e),a._asyncAttributesPending=e.filter(([t,r])=>gd(r)).length>0,a}constructor(e){const a=e.attributes??{};this._rawAttributes=Object.entries(a).map(([t,r])=>(gd(r)&&(this._asyncAttributesPending=!0),[t,r])),this._rawAttributes=bj(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,gd(t)?await t:t]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Hu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[a,t]of this._rawAttributes){if(gd(t)){Hu.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:nD.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function JW(u){return nD.FromAttributeList(Object.entries(u))}function D4u(){return JW({[NW]:h4u(),[EC]:Ck[EC],[pC]:Ck[pC],[mC]:Ck[mC]})}function bj(u){return u.map(([e,a])=>gd(a)?[e,a.catch(t=>{Hu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,a])}const f4u="exception";class g4u{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:exports.SpanStatusCode.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=uc.now(),this._performanceOffset=a-(this._performanceStartTime+LW()),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 Hu.warn(`Invalid attribute key: ${e}`),this;if(!$W(a))return Hu.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 Hu.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Hu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),hj(a)&&(hj(t)||(t=a),a=void 0);const n=vh(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"&&(Hu.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()){Hu.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=Rcu(this.startTime,this.endTime),this._duration[0]<0&&(Hu.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&&Hu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=uc.now())return Tcu(e+this._performanceOffset);if(typeof e=="number")return H1(e);if(e instanceof Date)return H1(e.getTime());if(IW(e))return e;if(this._startTimeProvided)return H1(Date.now());const a=uc.now()-this._performanceStartTime;return KW(this.startTime,H1(a))}isRecording(){return this._ended===!1}recordException(e,a){const t={};typeof e=="string"?t[bk]=e:e&&(e.code?t[yk]=e.code.toString():e.name&&(t[yk]=e.name),e.message&&(t[bk]=e.message),e.stack&&(t[Ocu]=e.stack)),t[yk]||t[bk]?this.addEvent(f4u,t,a):Hu.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}}`);Hu.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?(Hu.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 Bc;(function(u){u[u.NOT_RECORD=0]="NOT_RECORD",u[u.RECORD=1]="RECORD",u[u.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Bc||(Bc={}));class iD{shouldSample(){return{decision:Bc.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class ac{shouldSample(){return{decision:Bc.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class sx{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Ac(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ac),this._remoteParentSampled=e.remoteParentSampled??new ac,this._remoteParentNotSampled=e.remoteParentNotSampled??new iD,this._localParentSampled=e.localParentSampled??new ac,this._localParentNotSampled=e.localParentNotSampled??new iD}shouldSample(e,a,t,r,n,i){const o=gr.getSpanContext(e);return!o||!fg(o)?this._root.shouldSample(e,a,t,r,n,i):o.isRemote?o.traceFlags&Ui.SAMPLED?this._remoteParentSampled.shouldSample(e,a,t,r,n,i):this._remoteParentNotSampled.shouldSample(e,a,t,r,n,i):o.traceFlags&Ui.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 yj{_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:PW(a)&&this._accumulate(a)<this._upperBound?Bc.RECORD_AND_SAMPLED:Bc.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 Cj=1;function UW(){return{sampler:ZW(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function ZW(){const u="parentbased_always_on";switch(u){case"always_on":return new ac;case"always_off":return new iD;case"parentbased_always_on":return new sx({root:new ac});case"parentbased_always_off":return new sx({root:new iD});case"traceidratio":return new yj(Fj());case"parentbased_traceidratio":return new sx({root:new yj(Fj())});default:return Hu.error(`OTEL_TRACES_SAMPLER value "${u}" invalid, defaulting to "parentbased_always_on".`),new sx({root:new ac})}}function Fj(){return Hu.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Cj}.`),Cj}const v4u=128,k4u=1/0;function b4u(u){const e={sampler:ZW()},a=UW(),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 y4u(u){const e=Object.assign({},u.spanLimits);return e.attributeCountLimit=u.spanLimits?.attributeCountLimit??u.generalLimits?.attributeCountLimit??void 0??void 0??v4u,e.attributeValueLengthLimit=u.spanLimits?.attributeValueLengthLimit??u.generalLimits?.attributeValueLengthLimit??void 0??void 0??k4u,Object.assign({},u,{spanLimits:e})}class C4u{_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 x4u(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Hu.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&Ui.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&&Hu.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Hu.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);Li.with(Ecu(Li.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===vn.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=>{Ac(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,Ac(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 F4u extends C4u{_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=>{Ac(a)})},this._pageHideListener=()=>{this.forceFlush().catch(a=>{Ac(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 A4u=8,B4u=16;class O4u{generateTraceId=Aj(B4u);generateSpanId=Aj(A4u)}const lx=Array(32);function Aj(u){return function(){for(let a=0;a<u*2;a++)lx[a]=Math.floor(Math.random()*16)+48,lx[a]>=58&&(lx[a]+=39);return String.fromCharCode.apply(null,lx.slice(0,u*2))}}class S4u{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,a,t,r){const n=b4u(a);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=a.idGenerator||new O4u,this._resource=t,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,a={},t=Li.active()){a.root&&(t=gr.deleteSpan(t));const r=gr.getSpan(t);if(GA(t))return Hu.debug("Instrumentation suppressed, returning Noop Span"),gr.wrapSpanContext(zW);const n=r?.spanContext(),i=this._idGenerator.generateSpanId();let o,s,l;!n||!gr.isSpanContextValid(n)?s=this._idGenerator.generateTraceId():(s=n.traceId,l=n.traceState,o=n);const c=a.kind??lC.INTERNAL,d=(a.links??[]).map(g=>({context:g.context,attributes:vh(g.attributes)})),E=vh(a.attributes),p=this._sampler.shouldSample(t,s,e,c,E,d);l=p.traceState??l;const h=p.decision===aD.RECORD_AND_SAMPLED?Ui.SAMPLED:Ui.NONE,x={traceId:s,spanId:i,traceFlags:h,traceState:l};if(p.decision===aD.NOT_RECORD)return Hu.debug("Recording is off, propagating context in a non-recording span"),gr.wrapSpanContext(x);const f=vh(Object.assign(E,p.attributes));return new g4u({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??Li.active(),l=this.startSpan(e,n,s),c=gr.setSpan(s,l);return Li.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class z4u{_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=>{Ac(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 Us;(function(u){u[u.resolved=0]="resolved",u[u.timeout=1]="timeout",u[u.error=2]="error",u[u.unresolved=3]="unresolved"})(Us||(Us={}));class w4u{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const a=E4u({},UW(),y4u(e));this._resource=a.resource??D4u(),this._config=Object.assign({},a,{resource:this._resource});const t=[];e.spanProcessors?.length&&t.push(...e.spanProcessors),this._activeSpanProcessor=new z4u(t)}getTracer(e,a,t){const r=`${e}@${a||""}:${t?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new S4u({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=Us.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),n!==Us.timeout&&(n=Us.resolved,r(n))}).catch(o=>{clearTimeout(i),n=Us.error,r(o)})}));return new Promise((t,r)=>{Promise.all(a).then(n=>{const i=n.filter(o=>o!==Us.resolved);i.length>0?r(i):t()}).catch(n=>r([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class P4u{_enabled=!1;_currentContext=R1;_bindFunction(e=R1,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=R1,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=R1,this)}with(e,a,t,...r){const n=this._currentContext;this._currentContext=e||R1;try{return a.call(t,...r)}finally{this._currentContext=n}}}function j4u(u){if(u!==null){if(u===void 0){const e=new P4u;e.enable(),Li.setGlobalContextManager(e);return}u.enable(),Li.setGlobalContextManager(u)}}function M4u(u){if(u!==null){if(u===void 0){Ld.setGlobalPropagator(new _cu({propagators:[new e4u,new vcu]}));return}Ld.setGlobalPropagator(u)}}class T4u extends w4u{constructor(e={}){super(e)}register(e={}){gr.setGlobalTracerProvider(this),M4u(e.propagator),j4u(e.contextManager)}}class R4u{_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 Bj extends Error{code;name="OTLPExporterError";data;constructor(e,a,t){super(e),this.data=t,this.code=a}}function $4u(u){if(Number.isFinite(u)&&u>0)return u;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${u}')`)}function _4u(u){if(u!=null)return()=>u}function N4u(u,e,a){return{timeoutMillis:$4u(u.timeoutMillis??e.timeoutMillis??a.timeoutMillis),concurrencyLimit:u.concurrencyLimit??e.concurrencyLimit??a.concurrencyLimit,compression:u.compression??e.compression??a.compression}}function L4u(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class I4u{_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 K4u(u){return new I4u(u.concurrencyLimit)}function V4u(u){return Object.prototype.hasOwnProperty.call(u,"partialSuccess")}function G4u(){return{handleResponse(u){u==null||!V4u(u)||u.partialSuccess==null||Object.keys(u.partialSuccess).length===0||Hu.warn("Received Partial Success response:",JSON.stringify(u.partialSuccess))}}}class H4u{_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=Hu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,a){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){a({code:vn.FAILED,error:new Error("Concurrent export limit reached")});return}const t=this._serializer.serializeRequest(e);if(t==null){a({code:vn.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:vn.SUCCESS});return}else if(r.status==="failure"&&r.error){a({code:vn.FAILED,error:r.error});return}else r.status==="retryable"?a({code:vn.FAILED,error:new Bj("Export failed with retryable status")}):a({code:vn.FAILED,error:new Bj("Export failed with unknown error")})},r=>a({code:vn.FAILED,error:r})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Q4u(u,e){return new H4u(u.transport,u.serializer,G4u(),u.promiseHandler,e.timeout)}function XW(u,e,a){return Q4u({transport:a,serializer:e,promiseHandler:K4u(u)},{timeout:u.timeoutMillis})}function Oj(u){return u>=48&&u<=57?u-48:u>=97&&u<=102?u-87:u-55}function YW(u){const e=new Uint8Array(u.length/2);let a=0;for(let t=0;t<u.length;t+=2){const r=Oj(u.charCodeAt(t)),n=Oj(u.charCodeAt(t+1));e[a++]=r<<4|n}return e}function eJ(u){const e=BigInt(1e9);return BigInt(u[0])*e+BigInt(u[1])}function q4u(u){const e=Number(BigInt.asUintN(32,u)),a=Number(BigInt.asUintN(32,u>>BigInt(32)));return{low:e,high:a}}function W4u(u){const e=eJ(u);return q4u(e)}function J4u(u){return eJ(u).toString()}const U4u=typeof BigInt<"u"?J4u:$cu;function Sj(u){return u}function Z4u(u){if(u!==void 0)return YW(u)}const X4u={encodeHrTime:W4u,encodeSpanContext:YW,encodeOptionalSpanContext:Z4u};function Y4u(u){return u===void 0?X4u:{encodeHrTime:U4u,encodeSpanContext:Sj,encodeOptionalSpanContext:Sj}}function edu(u){return{attributes:gg(u.attributes),droppedAttributesCount:0}}function udu(u){return{name:u.name,version:u.version}}function gg(u){return Object.keys(u).map(e=>uJ(e,u[e]))}function uJ(u,e){return{key:u,value:aJ(e)}}function aJ(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(aJ)}}:e==="object"&&u!=null?{kvlistValue:{values:Object.entries(u).map(([a,t])=>uJ(a,t))}}:{}}function adu(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:gg(u.attributes),droppedAttributesCount:u.droppedAttributesCount,events:u.events.map(n=>rdu(n,e)),droppedEventsCount:u.droppedEventsCount,status:{code:t.code,message:t.message},links:u.links.map(n=>tdu(n,e)),droppedLinksCount:u.droppedLinksCount}}function tdu(u,e){return{attributes:u.attributes?gg(u.attributes):[],spanId:e.encodeSpanContext(u.context.spanId),traceId:e.encodeSpanContext(u.context.traceId),traceState:u.context.traceState?.serialize(),droppedAttributesCount:u.droppedAttributesCount||0}}function rdu(u,e){return{attributes:u.attributes?gg(u.attributes):[],name:u.name,timeUnixNano:e.encodeHrTime(u.time),droppedAttributesCount:u.droppedAttributesCount||0}}function ndu(u,e){const a=Y4u(e);return{resourceSpans:odu(u,a)}}function idu(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 odu(u,e){const a=idu(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=>adu(h,e));s.push({scope:udu(E[0].instrumentationScope),spans:p,schemaUrl:E[0].instrumentationScope.schemaUrl})}c=l.next()}const d={resource:edu(i),scopeSpans:s,schemaUrl:void 0};t.push(d),n=r.next()}return t}const sdu={serializeRequest:u=>{const e=ndu(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))}},ldu=5,cdu=1e3,ddu=5e3,Edu=1.5,zj=.2;function pdu(){return Math.random()*(2*zj)-zj}class mdu{_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=ldu,i=cdu;for(;r.status==="retryable"&&n>0;){n--;const o=Math.max(Math.min(i,ddu)+pdu(),0);i=i*Edu;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 tJ(u){return new mdu(u.transport)}function xdu(u){return[429,502,503,504].includes(u)}function hdu(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 Ddu{_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?(Hu.debug("XHR success"),t({status:"success"})):r.status&&xdu(r.status)?t({status:"retryable",retryInMillis:hdu(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 fdu(u){return new Ddu(u)}class gdu{_params;constructor(e){this._params=e}send(e){return new Promise(a=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Hu.debug("SendBeacon success"),a({status:"success"})):a({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function vdu(u){return new gdu(u)}function kdu(u,e){return XW(u,e,tJ({transport:fdu(u)}))}function bdu(u,e){return XW(u,e,tJ({transport:vdu({url:u.url,blobType:u.headers()["Content-Type"]})}))}function ydu(u){return()=>{const e={};return Object.entries(u?.()??{}).forEach(([a,t])=>{typeof t<"u"?e[a]=String(t):Hu.warn(`Header "${a}" has invalid value (${t}) and will be ignored`)}),e}}function Cdu(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 Fdu(u){if(u!=null)try{return new URL(u),u}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${u}'`)}}function Adu(u,e,a){return{...N4u(u,e,a),headers:Cdu(ydu(u.headers),e.headers,a.headers),url:Fdu(u.url)??e.url??a.url,agentOptions:u.agentOptions??e.agentOptions??a.agentOptions}}function Bdu(u,e){return{...L4u(),headers:()=>u,url:"http://localhost:4318/"+e,agentOptions:{keepAlive:!0}}}function Odu(u,e,a){return Adu({url:u.url,timeoutMillis:u.timeoutMillis,headers:_4u(u.headers),concurrencyLimit:u.concurrencyLimit},{},Bdu(a,e))}function Sdu(u,e,a,t){const r=!!u.headers||typeof navigator.sendBeacon!="function",n=Odu(u,a,t);return r?kdu(n,e):bdu(n,e)}class zdu extends R4u{constructor(e={}){super(Sdu(e,sdu,"v1/traces",{"Content-Type":"application/json"}))}}class rJ{emit(e){}}const wdu=new rJ;class Pdu{getLogger(e,a,t){return new rJ}}const nJ=new Pdu;class jdu{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):wdu}}class wj{getLogger(e,a,t){var r;return(r=this.getDelegateLogger(e,a,t))!==null&&r!==void 0?r:new jdu(this,e,a,t)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:nJ}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 Mdu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},cx=Symbol.for("io.opentelemetry.js.api.logs"),q4=Mdu;function Tdu(u,e,a){return t=>t===u?e:a}const Pj=1;class QA{constructor(){this._proxyLoggerProvider=new wj}static getInstance(){return this._instance||(this._instance=new QA),this._instance}setGlobalLoggerProvider(e){return q4[cx]?this.getLoggerProvider():(q4[cx]=Tdu(Pj,e,nJ),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,a;return(a=(e=q4[cx])===null||e===void 0?void 0:e.call(q4,Pj))!==null&&a!==void 0?a:this._proxyLoggerProvider}getLogger(e,a,t){return this.getLoggerProvider().getLogger(e,a,t)}disable(){delete q4[cx],this._proxyLoggerProvider=new wj}}const iJ=QA.getInstance();function Rdu(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 $du(u){u.forEach(e=>e.disable())}function _du(u){const e=u.tracerProvider||gr.getTracerProvider(),a=u.meterProvider||MW.getMeterProvider(),t=u.loggerProvider||iJ.getLoggerProvider(),r=u.instrumentations?.flat()??[];return Rdu(r,e,a,t),()=>{$du(r)}}let Wr=console.error.bind(console);function W4(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 oJ=(u,e,a)=>{if(!u||!u[e]){Wr("no original function "+String(e)+" to wrap");return}if(!a){Wr("no wrapper function"),Wr(new Error().stack);return}const t=u[e];if(typeof t!="function"||typeof a!="function"){Wr("original object and wrapper must be functions");return}const r=a(t,e);return W4(r,"__original",t),W4(r,"__unwrap",()=>{u[e]===r&&W4(u,e,t)}),W4(r,"__wrapped",!0),W4(u,e,r),r},Ndu=(u,e,a)=>{if(u)Array.isArray(u)||(u=[u]);else{Wr("must provide one or more modules to patch"),Wr(new Error().stack);return}if(!(e&&Array.isArray(e))){Wr("must provide one or more functions to wrap on modules");return}u.forEach(t=>{e.forEach(r=>{oJ(t,r,a)})})},sJ=(u,e)=>{if(!u||!u[e]){Wr("no function to unwrap."),Wr(new Error().stack);return}const a=u[e];if(!a.__unwrap)Wr("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{a.__unwrap();return}},Ldu=(u,e)=>{if(u)Array.isArray(u)||(u=[u]);else{Wr("must provide one or more modules to patch"),Wr(new Error().stack);return}if(!(e&&Array.isArray(e))){Wr("must provide one or more functions to unwrap on modules");return}u.forEach(a=>{e.forEach(t=>{sJ(a,t)})})};class Idu{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,a,t){this.instrumentationName=e,this.instrumentationVersion=a,this.setConfig(t),this._diag=Hu.createComponentLogger({namespace:e}),this._tracer=gr.getTracer(e,a),this._meter=MW.getMeter(e,a),this._logger=iJ.getLogger(e,a),this._updateMetricInstruments()}_wrap=oJ;_unwrap=sJ;_massWrap=Ndu;_massUnwrap=Ldu;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 Kdu extends Idu{constructor(e,a,t){super(e,a,t),this._config.enabled&&this.enable()}}class Vdu{span=void 0;constructor(e){this.span=e}get context(){return this.span?.context}error(e){this.span&&(this.span.setStatus(exports.SpanStatusCode.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(exports.SpanStatusCode.OK),this.span.end())}}class Gdu{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":uD(),"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=gr.setSpan(Li.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=Li.active(),t=e.time?new Date(e.time):new Date,r=this.tracer.startSpan(`event.${e.type}`,{attributes:this.processAttributes(e,t)},a),n=gr.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 Vdu(a)}async forceFlush(){return this.tracerProvider?.forceFlush()}async shutdown(){return this.tracerProvider?.shutdown()}getKeySnakeValue=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase()}class Hdu extends Gdu{tracerProvider=null;tracer=null;initialized=!1;constructor(){super()}initTracer(e){if(!e.collectorUrl&&!e.collectorTraceUrl)return;const a=`ses_${uD()}`,t=JW({[NW]:e.serviceName,[Scu]:e.serviceVersion,session_id:a}),r=e.collectorTraceUrl||`${e.collectorUrl}/v1/traces`;this.tracerProvider=new T4u({resource:t,spanProcessors:[new F4u(new zdu({url:r,headers:{}}))]}),this.tracer=this.tracerProvider.getTracer(e.tracerName),this.tracerProvider.register(),_du({instrumentations:e.instrumentations??[]}),this.initialized=!0}}class Ti extends Kdu{sendErrorEvent;originalConsoleError;constructor(e,a){super("errors","1.0",e||{}),this.sendErrorEvent=a}static toErrorEvent(e,a){return{type:"error",payload:{handler:a,errorType:Ti.getErrorType(e),message:Ti.getErrorMessage(e),stack:Ti.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=Ti.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(Ti.toErrorEvent(e,a))}}class Qdu{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 Hdu,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 Ti(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_${uD()}`,type:e,source:t.request.source||"",specversion:"1.0",datacontenttype:"application/json",time:new Date().toISOString(),data:a,origin:t.origin||"ui",sourceDetails:{id:t.sourceDetails.user||`usr_${uD()}`,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(Ti.toErrorEvent(e,a).type,Ti.toErrorEvent(e,a).payload)}sendTabChangeMessage(){this.send("tab.change")}sendButtonClickMessage(){this.send("button.click")}sendChangeMessage(){this.send("change")}sendContentCopyMessage(){this.send("content.copy")}sendRequestSendMessage(){this.send("request.send")}sendTokenGenerateMessage(){this.send("token.generate")}sendAppLifecycleMessage(){this.send("app.lifecycle")}sendEnvironmentManagementMessage(){this.send("environment.management")}sendServerManagementMessage(){this.send("server.management")}sendInputManagementMessage(){this.send("input.management")}sendNodeManagementMessage(){this.send("node.management")}sendHistoryManagementMessage(){this.send("history.management")}sendCredentialManagementMessage(){this.send("credential.management")}sendPanelToggleMessage(){this.send("panel.toggle")}sendWorkflowRunClickMessage(){this.send("workflow.run.click")}sendWorkflowRunResultMessage(){this.send("workflow.run.result")}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")}sendUpdaterCheckMessage(){this.send("updater.check")}sendUpdaterDownloadMessage(){this.send("updater.download")}sendUpdaterInstallMessage(){this.send("updater.install")}sendUpdaterProcessMessage(){this.send("updater.process")}sendErrorMessage(e){this.send("error",e)}sendCodeEditorSearchMessage(e){this.send("code_editor.search",e)}}const vg=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],qdu="https://cors.redocly.com/";function Wdu(u,e,a){return e in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function jj(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 Mj(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?jj(Object(a),!0).forEach(function(t){Wdu(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):jj(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function yt(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 Tj=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Ok=function(){return Math.random().toString(36).substring(7).split("").join(".")},Uo={INIT:"@@redux/INIT"+Ok(),REPLACE:"@@redux/REPLACE"+Ok(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ok()}};function lJ(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 Jdu(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(Xdu(u))return"date";if(Zdu(u))return"error";var a=Udu(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 Udu(u){return typeof u.constructor=="function"?u.constructor.name:null}function Zdu(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function Xdu(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function zo(u){var e=typeof u;return process.env.NODE_ENV!=="production"&&(e=Jdu(u)),e}function kg(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"?yt(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"?yt(1):"Expected the enhancer to be a function. Instead, received: '"+zo(a)+"'");return a(kg)(u,e)}if(typeof u!="function")throw new Error(process.env.NODE_ENV==="production"?yt(2):"Expected the root reducer to be a function. Instead, received: '"+zo(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"?yt(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"?yt(4):"Expected the listener to be a function. Instead, received: '"+zo(x)+"'");if(s)throw new Error(process.env.NODE_ENV==="production"?yt(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"?yt(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(!lJ(x))throw new Error(process.env.NODE_ENV==="production"?yt(7):"Actions must be plain objects. Instead, the actual type was: '"+zo(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"?yt(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"?yt(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"?yt(10):"Expected the nextReducer to be a function. Instead, received: '"+zo(x));r=x,E({type:Uo.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"?yt(11):"Expected the observer to be an object. Instead, received: '"+zo(g)+"'");function v(){g.next&&g.next(c())}v();var y=f(v);return{unsubscribe:y}}},x[Tj]=function(){return this},x}return E({type:Uo.INIT}),t={dispatch:E,subscribe:d,getState:c,replaceReducer:p},t[Tj]=h,t}var Ydu=kg;function hC(u){typeof console<"u"&&typeof console.error=="function"&&console.error(u);try{throw new Error(u)}catch{}}function eEu(u,e,a,t){var r=Object.keys(e),n=a&&a.type===Uo.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(!lJ(u))return"The "+n+' has unexpected type of "'+zo(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===Uo.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 uEu(u){Object.keys(u).forEach(function(e){var a=u[e],t=a(void 0,{type:Uo.INIT});if(typeof t>"u")throw new Error(process.env.NODE_ENV==="production"?yt(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:Uo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?yt(13):'The slice reducer for key "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle '"+Uo.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 aEu(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"&&hC('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{uEu(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=eEu(l,a,c,i);d&&hC(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 v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?yt(14):"When called with an action of type "+(v?'"'+String(v)+'"':"(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 Rj(u,e){return function(){return e(u.apply(this,arguments))}}function tEu(u,e){if(typeof u=="function")return Rj(u,e);if(typeof u!="object"||u===null)throw new Error(process.env.NODE_ENV==="production"?yt(16):"bindActionCreators expected an object or a function, but instead received: '"+zo(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]=Rj(r,e))}return a}function cJ(){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 rEu(){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"?yt(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=cJ.apply(void 0,o)(r.dispatch),Mj(Mj({},r),{},{dispatch:n})}}}function $j(){}process.env.NODE_ENV!=="production"&&typeof $j.name=="string"&&$j.name!=="isCrushed"&&hC('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 nEu=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:Uo,applyMiddleware:rEu,bindActionCreators:tEu,combineReducers:aEu,compose:cJ,createStore:kg,legacy_createStore:Ydu});function iEu(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 oEu=iEu(nEu);oEu.compose;var sEu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(u){return u}};function lEu(u,e,a){var t=!1,r=!1,n=kg(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(Eu)}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?Eu:u.get({noproxy:!0})},sEu({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 cEu(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=lEu(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 Ku=(u=>(u.Normal="Normal",u.Edit="Edit",u.Draft="Draft",u))(Ku||{});const F3="default",dJ=[{name:F3,inputs:[],servers:[],state:Ku.Normal}],EJ={activeTabIdx:0,tabs:[]};var fn=(u=>(u.Idle="idle",u.Loading="loading",u.Success="success",u.Error="error",u))(fn||{});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 DC(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(!DC(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)||!DC(u[n],e[n]))return!1}return!0}return u!==u&&e!==e}function _j(u){return Object.keys(u).forEach(e=>{u[e]===void 0&&delete u[e]}),u}function Rl(){return!!window?.__TAURI__}async function Pt(u,e={},a){return window.__TAURI_INTERNALS__.invoke(u,e,a)}async function Nj(u,e,a){const t=[],r=[];for(const n of u){const i=Promise.resolve().then(()=>a(n,u));if(t.push(i),e<=u.length){const o=i.then(()=>r.splice(r.indexOf(o),1));r.push(o),r.length>=e&&await Promise.race(r)}}return Promise.all(t)}const or={FS:"fs",WEB:"web"};var oD;(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"})(oD||(oD={}));async function dEu(){return Pt("plugin:path|resolve_directory",{directory:oD.AppData})}async function EEu(){return Pt("plugin:path|resolve_directory",{directory:oD.Desktop})}function pJ(){return window.__TAURI_INTERNALS__.plugins.path.sep}async function pEu(...u){return Pt("plugin:path|resolve",{paths:u})}async function Id(...u){return Pt("plugin:path|join",{paths:u})}async function mEu(u){return Pt("plugin:path|dirname",{path:u})}async function xEu(u){return Pt("plugin:path|extname",{path:u})}async function mJ(u,e){return Pt("plugin:path|basename",{path:u,ext:e})}async function hEu(u){return Pt("plugin:path|is_absolute",{path:u})}var Lj;(function(u){u[u.Start=0]="Start",u[u.Current=1]="Current",u[u.End=2]="End"})(Lj||(Lj={}));async function Ij(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Pt("plugin:fs|mkdir",{path:u instanceof URL?u.toString():u,options:e})}async function xJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Pt("plugin:fs|read_dir",{path:u instanceof URL?u.toString():u,options:e})}async function DEu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");const a=await Pt("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 qA(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Pt("plugin:fs|read_text_file",{path:u instanceof URL?u.toString():u,options:e})}async function fEu(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Pt("plugin:fs|remove",{path:u instanceof URL?u.toString():u,options:e})}async function gEu(u,e,a){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");await Pt("plugin:fs|write_text_file",{path:u instanceof URL?u.toString():u,data:e,options:a})}async function hJ(u,e){if(u instanceof URL&&u.protocol!=="file:")throw new TypeError("Must be a file URL.");return await Pt("plugin:fs|exists",{path:u instanceof URL?u.toString():u,options:e})}class ca{static utils=null;static async getUtils(){return ca.utils||(ca.utils=Rl()?await Promise.resolve().then(()=>require("./replay-tauri-path-9tVAG1LA.js")):await Promise.resolve().then(()=>Sie)),ca.utils}static async dirname(e){return(await ca.getUtils()).dirname(e)}static async join(...e){return(await ca.getUtils()).join(...e)}static async resolve(e){return(await ca.getUtils()).resolve(e)}static async isAbsolute(e){return(await ca.getUtils()).isAbsolute(e)}static async relative(e,a){return(await ca.getUtils()).relative(e,a)}static async extname(e){return(await ca.getUtils()).extname(e)}}const vEu=new Set(["node_modules"]);class Kj{constructor(e){this.baseDir=e,this.initializeDirectory(e)}async initializeDirectory(e){await Ij(e,{recursive:!0})}async ls(e){const a=await this.getFullPath(e);return this.getDirEntryFilesRecursively(a)}async getDirEntryFilesRecursively(e){try{const a=[],t=await xJ(e);for(const r of t)if(r.isDirectory){if(vEu.has(r.name))continue;const n=await Id(e,r.name),i=await this.getDirEntryFilesRecursively(n);a.push(...i)}else{const n=await Id(e,r.name),i=await ca.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 qA(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=pJ(),n=t.split(r).slice(0,-1).join(r);await Ij(n,{recursive:!0}),await gEu(t,a)}async remove(e){const a=await this.getFullPath(e);try{await fEu(a)}catch(t){!t.includes("No such file or directory")&&!t.includes("forbidden path")&&console.error(t)}}async getFullPath(e){return await Id(this.baseDir,e??"")}}class kEu{baseDir="";async ls(e=""){return[]}async get(e){return null}async set(e,a){}async remove(e){}}class bEu{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 DJ{constructor(e){this.storage=e}itemIds=[];async getAbsolutePath(e){return await ca.resolve(await ca.join(this.storage.baseDir,"/",e))}async parseMany(e,a){return(await Promise.all(e.map(async r=>{try{return await this.parse(r,a)}catch(n){return console.error(`Error parsing from ${r.type} ${r.uri}:`,n),null}}))).filter(r=>r!==null)}setItemIds(e){this.itemIds=e}async write(e){e.state===Ku.Draft||e.srcType!==or.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 yEu extends DJ{parse(e){return{...e.content,id:e.uri,srcType:e.type}}async stringify(e){const{id:a,srcType:t,...r}=e;return await ca.extname(a)===".json"?JSON.stringify(r,null,2):Ji.dump(r)}}var It=(u=>(u.SIMPLE="simple",u.REGEX="regex",u.JSONPATH="jsonpath",u.XPATH="xpath",u))(It||{});const fJ=1024;let CEu=0,p0=class{constructor(e,a){this.from=e,this.to=a}};class xu{constructor(e={}){this.id=CEu++,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=qt.match(e)),a=>{let t=e(a);return t===void 0?null:[this,t]}}}xu.closedBy=new xu({deserialize:u=>u.split(" ")});xu.openedBy=new xu({deserialize:u=>u.split(" ")});xu.group=new xu({deserialize:u=>u.split(" ")});xu.isolate=new xu({deserialize:u=>{if(u&&u!="rtl"&&u!="ltr"&&u!="auto")throw new RangeError("Invalid value for isolate: "+u);return u||"auto"}});xu.contextHash=new xu({perNode:!0});xu.lookAhead=new xu({perNode:!0});xu.mounted=new xu({perNode:!0});class BE{constructor(e,a,t){this.tree=e,this.overlay=a,this.parser=t}static get(e){return e&&e.props&&e.props[xu.mounted.id]}}const FEu=Object.create(null);class qt{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):FEu,t=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new qt(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(xu.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(xu.group),n=-1;n<(r?r.length:0);n++){let i=a[n<0?t.name:r[n]];if(i)return i}}}}qt.none=new qt("",Object.create(null),0,8);class bg{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 qt(t.name,r,t.id,t.flags):t)}return new bg(a)}}const dx=new WeakMap,Vj=new WeakMap;var Da;(function(u){u[u.ExcludeBuffers=1]="ExcludeBuffers",u[u.IncludeAnonymous=2]="IncludeAnonymous",u[u.IgnoreMounts=4]="IgnoreMounts",u[u.IgnoreOverlays=8]="IgnoreOverlays"})(Da||(Da={}));let ga=class fC{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=BE.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 sD(this.topNode,e)}cursorAt(e,a=0,t=0){let r=dx.get(this)||this.topNode,n=new sD(r);return n.moveTo(e,a),dx.set(this,n._tree),n}get topNode(){return new v0(this,0,0,null)}resolve(e,a=0){let t=OE(dx.get(this)||this.topNode,e,a,!1);return dx.set(this,t),t}resolveInner(e,a=0){let t=OE(Vj.get(this)||this.topNode,e,a,!0);return Vj.set(this,t),t}resolveStack(e,a=0){return OEu(this,e,a)}iterate(e){let{enter:a,leave:t,from:r=0,to:n=this.length}=e,i=e.mode||0,o=(i&Da.IncludeAnonymous)>0;for(let s=this.cursor(i|Da.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:UA(qt.none,this.children,this.positions,0,this.children.length,0,this.length,(a,t,r)=>new fC(this.type,a,t,r,this.propValues),e.makeTree||((a,t,r)=>new fC(qt.none,a,t,r)))}static build(e){return SEu(e)}};ga.empty=new ga(qt.none,[],[],0);class WA{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 WA(this.buffer,this.index)}}class ts{constructor(e,a,t){this.buffer=e,this.length=a,this.set=t}get type(){return qt.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&&!(gJ(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 ts(n,i,this.set)}}function gJ(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 OE(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 v0&&u.index<0?null:u.parent;if(!i)return u;u=i}let n=t?0:Da.IgnoreOverlays;if(t)for(let i=u,o=i.parent;o;i=o,o=i.parent)i instanceof v0&&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 vJ{cursor(e=0){return new sD(this,e)}getChild(e,a=null,t=null){let r=Gj(this,e,a,t);return r.length?r[0]:null}getChildren(e,a=null,t=null){return Gj(this,e,a,t)}resolve(e,a=0){return OE(this,e,a,!1)}resolveInner(e,a=0){return OE(this,e,a,!0)}matchContext(e){return gC(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 v0=class bh extends vJ{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(gJ(r,t,d,d+c.length)){if(c instanceof ts){if(n&Da.ExcludeBuffers)continue;let E=c.findChild(0,c.buffer.length,a,t-d,r);if(E>-1)return new On(new AEu(i,c,e,d),null,E)}else if(n&Da.IncludeAnonymous||!c.type.isAnonymous||JA(c)){let E;if(!(n&Da.IgnoreMounts)&&(E=BE.get(c))&&!E.overlay)return new bh(E.tree,d,e,i);let p=new bh(c,d,e,i);return n&Da.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(a<0?c.children.length-1:0,a,t,r)}}}if(n&Da.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&Da.IgnoreOverlays)&&(r=BE.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 bh(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 Gj(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 gC(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 AEu{constructor(e,a,t,r){this.parent=e,this.buffer=a,this.index=t,this.start=r}}class On extends vJ{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 On(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&Da.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 On(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 On(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 On(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 ga(this.type,e,a,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function kJ(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 v0&&a.index<0?null:a.parent,r=u.slice();return t?r[e]=t:r.splice(e,1),new BEu(r,a)}class BEu{constructor(e,a){this.heads=e,this.node=a}get next(){return kJ(this.heads)}}function OEu(u,e,a){let t=u.resolveInner(e,a),r=null;for(let n=t instanceof v0?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=BE.get(n.tree);if(i&&i.overlay&&i.overlay[0].from<=e&&i.overlay[i.overlay.length-1].to>=e){let o=new v0(i.tree,i.overlay[0].from+n.from,-1,n);(r||(r=[t])).push(OE(o,e,a,!1))}}return r?kJ(r):t}class sD{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 v0)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 v0?(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&Da.ExcludeBuffers?!1:this.enterChild(1,e,a):this.yield(this._tree.enter(e,a,t))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Da.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Da.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&Da.IncludeAnonymous||o instanceof ts||!o.type.isAnonymous||JA(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 On(this.buffer,a,this.stack[r]);return this.bufferNode=new On(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 gC(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 gC(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 JA(u){return u.children.some(e=>e instanceof ts||!e.type.isAnonymous||JA(e))}function SEu(u){var e;let{buffer:a,nodeSet:t,maxBufferLength:r=fJ,reused:n=[],minRepeatType:i=t.types.length}=u,o=Array.isArray(a)?new WA(a,a.length):a,s=t.types,l=0,c=0;function d(k,b,C,B,O,T){let{id:M,start:R,end:K,size:q}=o,W=c,Y=l;for(;q<0;)if(o.next(),q==-1){let $=n[M];C.push($),B.push(R-k);return}else if(q==-3){l=M;return}else if(q==-4){c=M;return}else throw new RangeError(`Unrecognized record size: ${q}`);let ie=s[M],te,me,I=R-k;if(K-R<=r&&(me=f(o.pos-b,O))){let $=new Uint16Array(me.size-me.skip),G=o.pos-me.size,_=$.length;for(;o.pos>G;)_=D(me.start,$,_);te=new ts($,K-me.start,t),I=me.start-k}else{let $=o.pos-q;o.next();let G=[],_=[],A=M>=i?M:-1,z=0,N=K;for(;o.pos>$;)A>=0&&o.id==A&&o.size>=0?(o.end<=N-r&&(h(G,_,R,z,o.end,N,A,W,Y),z=G.length,N=o.end),o.next()):T>2500?E(R,$,G,_):d(R,$,G,_,A,T+1);if(A>=0&&z>0&&z<G.length&&h(G,_,R,z,R,N,A,W,Y),G.reverse(),_.reverse(),A>-1&&z>0){let J=p(ie,Y);te=UA(ie,G,_,0,G.length,0,K-R,J,J)}else te=x(ie,G,_,K-R,W-K,Y)}C.push(te),B.push(I)}function E(k,b,C,B){let O=[],T=0,M=-1;for(;o.pos>b;){let{id:R,start:K,end:q,size:W}=o;if(W>4)o.next();else{if(M>-1&&K<M)break;M<0&&(M=q-r),O.push(R,K,q),T++,o.next()}}if(T){let R=new Uint16Array(T*4),K=O[O.length-2];for(let q=O.length-3,W=0;q>=0;q-=3)R[W++]=O[q],R[W++]=O[q+1]-K,R[W++]=O[q+2]-K,R[W++]=W;C.push(new ts(R,O[2]-K,t)),B.push(K-k)}}function p(k,b){return(C,B,O)=>{let T=0,M=C.length-1,R,K;if(M>=0&&(R=C[M])instanceof ga){if(!M&&R.type==k&&R.length==O)return R;(K=R.prop(xu.lookAhead))&&(T=B[M]+R.length+K)}return x(k,C,B,O,T,b)}}function h(k,b,C,B,O,T,M,R,K){let q=[],W=[];for(;k.length>B;)q.push(k.pop()),W.push(b.pop()+C-O);k.push(x(t.types[M],q,W,T-O,R-T,K)),b.push(O-C)}function x(k,b,C,B,O,T,M){if(T){let R=[xu.contextHash,T];M=M?[R].concat(M):[R]}if(O>25){let R=[xu.lookAhead,O];M=M?[R].concat(M):[R]}return new ga(k,b,C,B,M)}function f(k,b){let C=o.fork(),B=0,O=0,T=0,M=C.end-r,R={size:0,start:0,skip:0};e:for(let K=C.pos-k;C.pos>K;){let q=C.size;if(C.id==b&&q>=0){R.size=B,R.start=O,R.skip=T,T+=4,B+=4,C.next();continue}let W=C.pos-q;if(q<0||W<K||C.start<M)break;let Y=C.id>=i?4:0,ie=C.start;for(C.next();C.pos>W;){if(C.size<0)if(C.size==-3)Y+=4;else break e;else C.id>=i&&(Y+=4);C.next()}O=ie,B+=q,T+=Y}return(b<0||B==k)&&(R.size=B,R.start=O,R.skip=T),R.size>4?R:void 0}function D(k,b,C){let{id:B,start:O,end:T,size:M}=o;if(o.next(),M>=0&&B<i){let R=C;if(M>4){let K=o.pos-(M-4);for(;o.pos>K;)C=D(k,b,C)}b[--C]=R,b[--C]=T-k,b[--C]=O-k,b[--C]=B}else M==-3?l=B:M==-4&&(c=B);return C}let g=[],v=[];for(;o.pos>0;)d(u.start||0,u.bufferStart||0,g,v,-1,0);let y=(e=u.length)!==null&&e!==void 0?e:g.length?v[0]+g[0].length:0;return new ga(s[u.topID],g.reverse(),v.reverse(),y)}const Hj=new WeakMap;function yh(u,e){if(!u.isAnonymous||e instanceof ts||e.type!=u)return 1;let a=Hj.get(e);if(a==null){a=1;for(let t of e.children){if(t.type!=u||!(t instanceof ga)){a=1;break}a+=yh(u,t)}Hj.set(e,a)}return a}function UA(u,e,a,t,r,n,i,o,s){let l=0;for(let h=t;h<r;h++)l+=yh(u,e[h]);let c=Math.ceil(l*1.5/8),d=[],E=[];function p(h,x,f,D,g){for(let v=f;v<D;){let y=v,k=x[v],b=yh(u,h[v]);for(v++;v<D;v++){let C=yh(u,h[v]);if(b+C>=c)break;b+=C}if(v==y+1){if(b>c){let C=h[y];p(C.children,C.positions,0,C.children.length,x[y]+g);continue}d.push(h[y])}else{let C=x[v-1]+h[v-1].length-k;d.push(UA(u,h,x,y,v,k,C,null,s))}E.push(k+g-n)}}return p(e,a,t,r,0),(o||s)(d,E,i)}class ZA{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 On?this.setBuffer(e.context.buffer,e.index,a):e instanceof v0&&this.map.set(e.tree,a)}get(e){return e instanceof On?this.getBuffer(e.context.buffer,e.index):e instanceof v0?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 Ki{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 Ki(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 Ki(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 XA=class{startParse(e,a,t){return typeof e=="string"&&(e=new zEu(e)),t=t?t.length?t.map(r=>new p0(r.from,r.to)):[new p0(0,0)]:[new p0(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 zEu{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 wEu(u){return(e,a,t,r)=>new jEu(e,u,a,t,r)}class Qj{constructor(e,a,t,r,n){this.parser=e,this.parse=a,this.overlay=t,this.target=r,this.from=n}}function qj(u){if(!u.length||u.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(u))}class PEu{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 vC=new xu({perNode:!0});class jEu{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 ga(t.type,t.children,t.positions,t.length,t.propValues.concat([[vC,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[xu.mounted.id]=new BE(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 REu(this.fragments),a=null,t=null,r=new sD(new v0(this.baseTree,this.ranges[0].from,0,null),Da.IncludeAnonymous|Da.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=MEu(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||TEu(r);let l=e.findMounts(r.from,n.parser);if(typeof n.overlay=="function")a=new PEu(n.parser,n.overlay,l,this.inner.length,r.from,r.tree,a);else{let c=Uj(this.ranges,n.overlay||(r.from<r.to?[new p0(r.from,r.to)]:[]));c.length&&qj(c),(c.length||!n.overlay)&&this.inner.push(new Qj(n.parser,c.length?n.parser.startParse(this.input,Zj(l,c),c):n.parser.startParse(""),n.overlay?n.overlay.map(d=>new p0(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 p0(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=Uj(this.ranges,a.ranges);l.length&&(qj(l),this.inner.splice(a.index,0,new Qj(a.parser,a.parser.startParse(this.input,Zj(a.mounts,l),l),a.ranges.map(c=>new p0(c.from-a.start,c.to-a.start)),a.target,l[0].from))),a=a.prev}t&&!--t.depth&&(t=t.prev)}}}}function MEu(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 Wj(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 TEu(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=[];Wj(i,c,f,D,g,p);let v=o[f+1],y=o[f+2];s.push(D.length);let k=x?l(f+4,o[f+3],i.set.types[o[f]],v,y-v,x-1):e.toTree();return D.push(k),g.push(v-p),Wj(i,o[f+3],d,D,g,p),new ga(E,D,g,h)}r.children[n]=l(0,o.length,qt.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 v0(d,E+u.from,c,u._tree))}}class Jj{constructor(e,a){this.offset=a,this.done=!1,this.cursor=e.cursor(Da.IncludeAnonymous|Da.IgnoreMounts)}moveTo(e){let{cursor:a}=this,t=e-this.offset;for(;!this.done&&a.from<t;)a.to>=e&&a.enter(t,1,Da.IgnoreOverlays|Da.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 ga)a=a.children[0];else break}return!1}}let REu=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(vC))!==null&&a!==void 0?a:t.to,this.inner=new Jj(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(vC))!==null&&e!==void 0?e:a.to,this.inner=new Jj(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(xu.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 Uj(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 p0(s.from,i),s.to>o&&a.splice(n+1,0,new p0(o,s.to))):s.to>o?a[n--]=new p0(o,s.to):a.splice(n--,1))}}return t}function $Eu(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 p0(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 Zj(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 p0(E.from+t,E.to+t)),d=$Eu(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 Ki(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 Ki(s,l,r.tree,-i,n.from>=i||n.openStart,n.to<=o||n.openEnd))}return a}class lD{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 lD(e,[],a,t,t,0,[],0,r?new Xj(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 lD(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 _Eu(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 Xj(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 Xj{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class _Eu{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 cD{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 cD(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 cD(this.stack,this.pos,this.index)}}function vd(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 Ch{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Yj=new Ch;class NEu{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Yj,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=Yj,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 tc{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;bJ(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}tc.prototype.contextual=tc.prototype.fallback=tc.prototype.extend=!1;class dD{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?vd(e):e}token(e,a){let t=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(bJ(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))}}dD.prototype.contextual=tc.prototype.fallback=tc.prototype.extend=!1;class Ha{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function bJ(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||LEu(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 eM(u,e,a){for(let t=e,r;(r=u[t])!=65535;t++)if(r==a)return t-e;return-1}function LEu(u,e,a,t){let r=eM(a,t,e);return r<0||eM(a,t,u)<r}const Pr=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let Sk=null;function uM(u,e,a){let t=u.cursor(Da.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 IEu{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?uM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?uM(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 ga){if(i==e){if(i<this.safeFrom)return null;let o=i+n.length;if(o<=this.safeTo){let s=n.prop(xu.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 KEu{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Ch)}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 Ch,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 Ch,{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=Pi(o,l+2);else{r==0&&o[l+1]==2&&(r=this.putAction(Pi(o,l+2),a,t,r));break}o[l]==a&&(r=this.putAction(Pi(o,l+1),a,t,r))}return r}}let VEu=class{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 NEu(a,r),this.tokens=new KEu(e,this.stream),this.topTerm=e.top[1];let{from:n}=r[0];this.stacks=[lD.start(this,e.top[0],n)],this.fragments=t.length&&this.stream.end-n>e.bufferLength*4?new IEu(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&&HEu(r);if(i)return Pr&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Pr&&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 Pr&&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=Pr?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(xu.contextHash)||0)==c))return e.useNode(d,E),Pr&&console.log(i+this.stackID(e)+` (via reuse of ${n.getName(d.type.id)})`),!0;if(!(d instanceof ga)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof ga&&d.positions[0]==0)d=p;else break}}let o=n.stateSlot(e.state,4);if(o>0)return e.reduce(o),Pr&&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),Pr&&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 aM(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=Pr?this.stackID(o)+" -> ":"";if(o.deadEnd&&(n||(n=!0,o.restart(),Pr&&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&&(Pr&&console.log(E+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,t));p++)Pr&&(E=this.stackID(d)+" -> ");for(let p of o.recoverByInsert(s))Pr&&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),Pr&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),aM(o,t)):(!r||r.score<o.score)&&(r=o)}return r}stackToTree(e){return e.close(),ga.build({buffer:cD.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=(Sk||(Sk=new WeakMap)).get(e);return a||Sk.set(e,a=String.fromCodePoint(this.nextStackID++)),a+e}};function aM(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 GEu{constructor(e,a,t){this.source=e,this.flags=a,this.disabled=t}allows(e){return!this.disabled||this.disabled[e]==0}}const zk=u=>u;class A3{constructor(e){this.start=e.start,this.shift=e.shift||zk,this.reduce=e.reduce||zk,this.reuse=e.reuse||zk,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class W0 extends XA{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=xu[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 bg(a.map((o,s)=>qt.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=fJ;let i=vd(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(tM),this.states=vd(e.states,Uint32Array),this.data=vd(e.stateData),this.goto=vd(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new tc(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 VEu(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=Pi(t,n+2)];else{if(t[n+1]==2)return Pi(t,n+2);break}if(i==a||i==0)return Pi(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=Pi(this.data,n+2);else break;r=a(Pi(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=Pi(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(W0.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]=tM(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 GEu(e,t,r)}static deserialize(e){return new W0(e)}}function Pi(u,e){return u[e]|u[e+1]<<16}function HEu(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 tM(u){if(u.external){let e=u.extend?1:0;return(a,t)=>u.external(a,t)<<1|e}return u.get}let QEu=0,ji=class kC{constructor(e,a,t,r){this.name=e,this.set=a,this.base=t,this.modified=r,this.id=QEu++}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 kC&&(a=e),a?.base)throw new Error("Can not derive from a modified tag");let r=new kC(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 ED(e);return t=>t.modified.indexOf(a)>-1?t:ED.get(t.base||t,t.modified.concat(a).sort((r,n)=>r.id-n.id))}},qEu=0;class ED{constructor(e){this.name=e,this.instances=[],this.id=qEu++}static get(e,a){if(!a.length)return e;let t=a[0].instances.find(o=>o.base==e&&WEu(a,o.modified));if(t)return t;let r=[],n=new ji(e.name,r,e,a);for(let o of a)o.instances.push(n);let i=JEu(a);for(let o of e.set)if(!o.modified.length)for(let s of i)r.push(ED.get(o,s));return n}}function WEu(u,e){return u.length==e.length&&u.every((a,t)=>a==e[t])}function JEu(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 ro(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 pD(t,i,s>0?n.slice(0,s):null);e[l]=c.sort(e[l])}}return yJ.add(e)}const yJ=new xu;class pD{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}}pD.empty=new pD([],2,null);function CJ(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 UEu(u,e){let a=null;for(let t of u){let r=t.style(e);r&&(a=a?a+" "+r:r)}return a}function ZEu(u,e,a,t=0,r=u.length){let n=new XEu(t,Array.isArray(e)?e:[e],a);n.highlightRange(u.cursor(),t,r,"",n.highlighters),n.flush(r)}class XEu{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=YEu(e)||pD.empty,d=UEu(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(xu.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,v=g?g.from+o:s,y=Math.max(a,D),k=Math.min(t,v);if(y<k&&x)for(;e.from<k&&(this.highlightRange(e,y,k,r,n),this.startSpan(Math.min(k,e.to),l),!(e.to>=v||!e.nextSibling())););if(!g||v>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 YEu(u){let e=u.type.prop(yJ);for(;e&&e.context&&!u.matchContext(e.context);)e=e.next;return e||null}const Re=ji.define,Ex=Re(),wo=Re(),rM=Re(wo),nM=Re(wo),Po=Re(),px=Re(Po),wk=Re(Po),hn=Re(),Ks=Re(hn),dn=Re(),En=Re(),bC=Re(),J4=Re(bC),mx=Re(),H={comment:Ex,lineComment:Re(Ex),blockComment:Re(Ex),docComment:Re(Ex),name:wo,variableName:Re(wo),typeName:rM,tagName:Re(rM),propertyName:nM,attributeName:Re(nM),className:Re(wo),labelName:Re(wo),namespace:Re(wo),macroName:Re(wo),literal:Po,string:px,docString:Re(px),character:Re(px),attributeValue:Re(px),number:wk,integer:Re(wk),float:Re(wk),bool:Re(Po),regexp:Re(Po),escape:Re(Po),color:Re(Po),url:Re(Po),keyword:dn,self:Re(dn),null:Re(dn),atom:Re(dn),unit:Re(dn),modifier:Re(dn),operatorKeyword:Re(dn),controlKeyword:Re(dn),definitionKeyword:Re(dn),moduleKeyword:Re(dn),operator:En,derefOperator:Re(En),arithmeticOperator:Re(En),logicOperator:Re(En),bitwiseOperator:Re(En),compareOperator:Re(En),updateOperator:Re(En),definitionOperator:Re(En),typeOperator:Re(En),controlOperator:Re(En),punctuation:bC,separator:Re(bC),bracket:J4,angleBracket:Re(J4),squareBracket:Re(J4),paren:Re(J4),brace:Re(J4),content:hn,heading:Ks,heading1:Re(Ks),heading2:Re(Ks),heading3:Re(Ks),heading4:Re(Ks),heading5:Re(Ks),heading6:Re(Ks),contentSeparator:Re(hn),list:Re(hn),quote:Re(hn),emphasis:Re(hn),strong:Re(hn),link:Re(hn),monospace:Re(hn),strikethrough:Re(hn),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:mx,documentMeta:Re(mx),annotation:Re(mx),processingInstruction:Re(mx),definition:ji.defineModifier("definition"),constant:ji.defineModifier("constant"),function:ji.defineModifier("function"),standard:ji.defineModifier("standard"),local:ji.defineModifier("local"),special:ji.defineModifier("special")};for(let u in H){let e=H[u];e instanceof ji&&(e.name=u)}CJ([{tag:H.link,class:"tok-link"},{tag:H.heading,class:"tok-heading"},{tag:H.emphasis,class:"tok-emphasis"},{tag:H.strong,class:"tok-strong"},{tag:H.keyword,class:"tok-keyword"},{tag:H.atom,class:"tok-atom"},{tag:H.bool,class:"tok-bool"},{tag:H.url,class:"tok-url"},{tag:H.labelName,class:"tok-labelName"},{tag:H.inserted,class:"tok-inserted"},{tag:H.deleted,class:"tok-deleted"},{tag:H.literal,class:"tok-literal"},{tag:H.string,class:"tok-string"},{tag:H.number,class:"tok-number"},{tag:[H.regexp,H.escape,H.special(H.string)],class:"tok-string2"},{tag:H.variableName,class:"tok-variableName"},{tag:H.local(H.variableName),class:"tok-variableName tok-local"},{tag:H.definition(H.variableName),class:"tok-variableName tok-definition"},{tag:H.special(H.variableName),class:"tok-variableName2"},{tag:H.definition(H.propertyName),class:"tok-propertyName tok-definition"},{tag:H.typeName,class:"tok-typeName"},{tag:H.namespace,class:"tok-namespace"},{tag:H.className,class:"tok-className"},{tag:H.macroName,class:"tok-macroName"},{tag:H.propertyName,class:"tok-propertyName"},{tag:H.operator,class:"tok-operator"},{tag:H.comment,class:"tok-comment"},{tag:H.meta,class:"tok-meta"},{tag:H.invalid,class:"tok-invalid"},{tag:H.punctuation,class:"tok-punctuation"}]);const e3u=ro({String:H.string,Number:H.number,"True False":H.bool,PropertyName:H.propertyName,Null:H.null,",":H.separator,"[ ]":H.squareBracket,"{ }":H.brace}),u3u=W0.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:[e3u],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 yC=[],FJ=[];(()=>{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?FJ:yC).push(a=a+u[e])})();function a3u(u){if(u<768)return!1;for(let e=0,a=yC.length;;){let t=e+a>>1;if(u<yC[t])a=t;else if(u>=FJ[t])e=t+1;else return!0;if(e==a)return!1}}function iM(u){return u>=127462&&u<=127487}const oM=8205;function t3u(u,e,a=!0,t=!0){return(a?AJ:r3u)(u,e,t)}function AJ(u,e,a){if(e==u.length)return e;e&&BJ(u.charCodeAt(e))&&OJ(u.charCodeAt(e-1))&&e--;let t=Pk(u,e);for(e+=sM(t);e<u.length;){let r=Pk(u,e);if(t==oM||r==oM||a&&a3u(r))e+=sM(r),t=r;else if(iM(r)){let n=0,i=e-2;for(;i>=0&&iM(Pk(u,i));)n++,i-=2;if(n%2==0)break;e+=2}else break}return e}function r3u(u,e,a){for(;e>0;){let t=AJ(u,e-2,a);if(t<e)return t;e--}return 0}function Pk(u,e){let a=u.charCodeAt(e);if(!OJ(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return BJ(t)?(a-55296<<10)+(t-56320)+65536:a}function BJ(u){return u>=56320&&u<57344}function OJ(u){return u>=55296&&u<56320}function sM(u){return u<65536?1:2}class _u{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]=Oc(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),Cn.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]=Oc(this,e,a);let t=[];return this.decompose(e,a,t,0),Cn.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 Kd(this),n=new Kd(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 Kd(this,e)}iterRange(e,a=this.length){return new SJ(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 zJ(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]?_u.empty:e.length<=32?new Va(e):Cn.from(Va.split(e,[]))}}class Va extends _u{constructor(e,a=n3u(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 i3u(r,o,t,i);r=o+1,t++}}decompose(e,a,t,r){let n=e<=0&&a>=this.length?this:new Va(lM(this.text,e,a),Math.min(a,this.length)-Math.max(0,e));if(r&1){let i=t.pop(),o=Fh(n.text,i.text.slice(),0,n.length);if(o.length<=32)t.push(new Va(o,i.length+n.length));else{let s=o.length>>1;t.push(new Va(o.slice(0,s)),new Va(o.slice(s)))}}else t.push(n)}replace(e,a,t){if(!(t instanceof Va))return super.replace(e,a,t);[e,a]=Oc(this,e,a);let r=Fh(this.text,Fh(t.text,lM(this.text,0,e)),a),n=this.length+t.length-(a-e);return r.length<=32?new Va(r,n):Cn.from(Va.split(r,[]),n)}sliceString(e,a=this.length,t=`
398
398
  `){[e,a]=Oc(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 Va(t,r)),t=[],r=-1);return r>-1&&a.push(new Va(t,r)),a}}class Cn extends _u{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]=Oc(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 Cn(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=`
399
399
  `){[e,a]=Oc(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 Cn))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 Va(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 Cn)for(let x of p.children)d(x);else p.lines>i&&(s>i||!s)?(E(),o.push(p)):p instanceof Va&&s&&(h=c[c.length-1])instanceof Va&&p.lines+h.lines<=32?(s+=p.lines,l+=p.length+1,c[c.length-1]=new Va(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]:Cn.from(c,l)),l=-1,s=c.length=0)}for(let p of e)d(p);return E(),o.length==1?o[0]:new Cn(o,a)}}_u.empty=new Va([""],0);function n3u(u){let e=-1;for(let a of u)e+=a.length+1;return e}function Fh(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 lM(u,e,a){return Fh(u,[""],e,a)}class Kd{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 Va?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 Va?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=`
400
400
  `,this;e--}else if(r instanceof Va){let s=r.text[i+(a<0?-1:0)];if(this.offsets[t]+=a,s.length>Math.max(0,e))return this.value=e==0?s:a>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{let s=r.children[i+(a<0?-1:0)];e>s.length?(e-=s.length,this.offsets[t]+=a):(a<0&&this.offsets[t]--,this.nodes.push(s),this.offsets.push(a>0?1:(s instanceof Va?s.text.length:s.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class SJ{constructor(e,a,t){this.value="",this.done=!1,this.cursor=new Kd(e,a>t?-1:1),this.pos=a>t?e.length:0,this.from=Math.min(a,t),this.to=Math.max(a,t)}nextInner(e,a){if(a<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,a<0?this.pos-this.to:this.from-this.pos);let t=a<0?this.pos-this.from:this.to-this.pos;e>t&&(e=t),t-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*a,this.value=r.length<=t?r:a<0?r.slice(r.length-t):r.slice(0,t),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zJ{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:a,lineBreak:t,value:r}=this.inner.next(e);return a&&this.afterBreak?(this.value="",this.afterBreak=!1):a?(this.done=!0,this.value=""):t?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(_u.prototype[Symbol.iterator]=function(){return this.iter()},Kd.prototype[Symbol.iterator]=SJ.prototype[Symbol.iterator]=zJ.prototype[Symbol.iterator]=function(){return this});let i3u=class{constructor(e,a,t,r){this.from=e,this.to=a,this.number=t,this.text=r}get length(){return this.to-this.from}};function Oc(u,e,a){return e=Math.max(0,Math.min(u.length,e)),[e,Math.max(e,Math.min(u.length,a))]}function Ot(u,e,a=!0,t=!0){return t3u(u,e,a,t)}function o3u(u){return u>=56320&&u<57344}function s3u(u){return u>=55296&&u<56320}function vr(u,e){let a=u.charCodeAt(e);if(!s3u(a)||e+1==u.length)return a;let t=u.charCodeAt(e+1);return o3u(t)?(a-55296<<10)+(t-56320)+65536:a}function YA(u){return u<=65535?String.fromCharCode(u):(u-=65536,String.fromCharCode((u>>10)+55296,(u&1023)+56320))}function Fn(u){return u<65536?1:2}const CC=/\r\n?|\n/;var Bt=(function(u){return u[u.Simple=0]="Simple",u[u.TrackDel=1]="TrackDel",u[u.TrackBefore=2]="TrackBefore",u[u.TrackAfter=3]="TrackAfter",u})(Bt||(Bt={}));class Rn{constructor(e){this.sections=e}get length(){let e=0;for(let a=0;a<this.sections.length;a+=2)e+=this.sections[a];return e}get newLength(){let e=0;for(let a=0;a<this.sections.length;a+=2){let t=this.sections[a+1];e+=t<0?this.sections[a]:t}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let a=0,t=0,r=0;a<this.sections.length;){let n=this.sections[a++],i=this.sections[a++];i<0?(e(t,r,n),r+=n):r+=i,t+=n}}iterChangedRanges(e,a=!1){FC(this,e,a)}get invertedDesc(){let e=[];for(let a=0;a<this.sections.length;){let t=this.sections[a++],r=this.sections[a++];r<0?e.push(t,r):e.push(r,t)}return new Rn(e)}composeDesc(e){return this.empty?e:e.empty?this:wJ(this,e)}mapDesc(e,a=!1){return e.empty?this:AC(this,e,a)}mapPos(e,a=-1,t=Bt.Simple){let r=0,n=0;for(let i=0;i<this.sections.length;){let o=this.sections[i++],s=this.sections[i++],l=r+o;if(s<0){if(l>e)return n+(e-r);n+=o}else{if(t!=Bt.Simple&&l>=e&&(t==Bt.TrackDel&&r<e&&l>e||t==Bt.TrackBefore&&r<e||t==Bt.TrackAfter&&l>e))return null;if(l>e||l==e&&a<0&&!o)return e==r||a<0?n:n+s;n+=s}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return n}touchesRange(e,a=e){for(let t=0,r=0;t<this.sections.length&&r<=a;){let n=this.sections[t++],i=this.sections[t++],o=r+n;if(i>=0&&r<=a&&o>=e)return r<e&&o>a?"cover":!0;r=o}return!1}toString(){let e="";for(let a=0;a<this.sections.length;){let t=this.sections[a++],r=this.sections[a++];e+=(e?" ":"")+t+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(a=>typeof a!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Rn(e)}static create(e){return new Rn(e)}}class rt extends Rn{constructor(e,a){super(e),this.inserted=a}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return FC(this,(a,t,r,n,i)=>e=e.replace(r,r+(t-a),i),!1),e}mapDesc(e,a=!1){return AC(this,e,a,!0)}invert(e){let a=this.sections.slice(),t=[];for(let r=0,n=0;r<a.length;r+=2){let i=a[r],o=a[r+1];if(o>=0){a[r]=o,a[r+1]=i;let s=r>>1;for(;t.length<s;)t.push(_u.empty);t.push(i?e.slice(n,n+i):_u.empty)}n+=i}return new rt(a,t)}compose(e){return this.empty?e:e.empty?this:wJ(this,e,!0)}map(e,a=!1){return e.empty?this:AC(this,e,a,!0)}iterChanges(e,a=!1){FC(this,e,a)}get desc(){return Rn.create(this.sections)}filter(e){let a=[],t=[],r=[],n=new SE(this);e:for(let i=0,o=0;;){let s=i==e.length?1e9:e[i++];for(;o<s||o==s&&n.len==0;){if(n.done)break e;let c=Math.min(n.len,s-o);Kt(r,c,-1);let d=n.ins==-1?-1:n.off==0?n.ins:0;Kt(a,c,d),d>0&&Lo(t,a,n.text),n.forward(c),o+=c}let l=e[i++];for(;o<l;){if(n.done)break e;let c=Math.min(n.len,l-o);Kt(a,c,-1),Kt(r,c,n.ins==-1?-1:n.off==0?n.ins:0),n.forward(c),o+=c}}return{changes:new rt(a,t),filtered:Rn.create(r)}}toJSON(){let e=[];for(let a=0;a<this.sections.length;a+=2){let t=this.sections[a],r=this.sections[a+1];r<0?e.push(t):r==0?e.push([t]):e.push([t].concat(this.inserted[a>>1].toJSON()))}return e}static of(e,a,t){let r=[],n=[],i=0,o=null;function s(c=!1){if(!c&&!r.length)return;i<a&&Kt(r,a-i,-1);let d=new rt(r,n);o=o?o.compose(d.map(o)):d,r=[],n=[],i=0}function l(c){if(Array.isArray(c))for(let d of c)l(d);else if(c instanceof rt){if(c.length!=a)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${a})`);s(),o=o?o.compose(c.map(o)):c}else{let{from:d,to:E=d,insert:p}=c;if(d>E||d<0||E>a)throw new RangeError(`Invalid change range ${d} to ${E} (in doc of length ${a})`);let h=p?typeof p=="string"?_u.of(p.split(t||CC)):p:_u.empty,x=h.length;if(d==E&&x==0)return;d<i&&s(),d>i&&Kt(r,d-i,-1),Kt(r,E-d,x),Lo(n,r,h),i=E}}return l(e),s(!o),o}static empty(e){return new rt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let a=[],t=[];for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="number")a.push(n,-1);else{if(!Array.isArray(n)||typeof n[0]!="number"||n.some((i,o)=>o&&typeof i!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(n.length==1)a.push(n[0],0);else{for(;t.length<r;)t.push(_u.empty);t[r]=_u.of(n.slice(1)),a.push(n[0],t[r].length)}}}return new rt(a,t)}static createSet(e,a){return new rt(e,a)}}function Kt(u,e,a,t=!1){if(e==0&&a<=0)return;let r=u.length-2;r>=0&&a<=0&&a==u[r+1]?u[r]+=e:r>=0&&e==0&&u[r]==0?u[r+1]+=a:t?(u[r]+=e,u[r+1]+=a):u.push(e,a)}function Lo(u,e,a){if(a.length==0)return;let t=e.length-2>>1;if(t<u.length)u[u.length-1]=u[u.length-1].append(a);else{for(;u.length<t;)u.push(_u.empty);u.push(a)}}function FC(u,e,a){let t=u.inserted;for(let r=0,n=0,i=0;i<u.sections.length;){let o=u.sections[i++],s=u.sections[i++];if(s<0)r+=o,n+=o;else{let l=r,c=n,d=_u.empty;for(;l+=o,c+=s,s&&t&&(d=d.append(t[i-2>>1])),!(a||i==u.sections.length||u.sections[i+1]<0);)o=u.sections[i++],s=u.sections[i++];e(r,l,n,c,d),r=l,n=c}}}function AC(u,e,a,t=!1){let r=[],n=t?[]:null,i=new SE(u),o=new SE(e);for(let s=-1;;){if(i.done&&o.len||o.done&&i.len)throw new Error("Mismatched change set lengths");if(i.ins==-1&&o.ins==-1){let l=Math.min(i.len,o.len);Kt(r,l,-1),i.forward(l),o.forward(l)}else if(o.ins>=0&&(i.ins<0||s==i.i||i.off==0&&(o.len<i.len||o.len==i.len&&!a))){let l=o.len;for(Kt(r,o.ins,-1);l;){let c=Math.min(i.len,l);i.ins>=0&&s<i.i&&i.len<=c&&(Kt(r,0,i.ins),n&&Lo(n,r,i.text),s=i.i),i.forward(c),l-=c}o.next()}else if(i.ins>=0){let l=0,c=i.len;for(;c;)if(o.ins==-1){let d=Math.min(c,o.len);l+=d,c-=d,o.forward(d)}else if(o.ins==0&&o.len<c)c-=o.len,o.next();else break;Kt(r,l,s<i.i?i.ins:0),n&&s<i.i&&Lo(n,r,i.text),s=i.i,i.forward(i.len-c)}else{if(i.done&&o.done)return n?rt.createSet(r,n):Rn.create(r);throw new Error("Mismatched change set lengths")}}}function wJ(u,e,a=!1){let t=[],r=a?[]:null,n=new SE(u),i=new SE(e);for(let o=!1;;){if(n.done&&i.done)return r?rt.createSet(t,r):Rn.create(t);if(n.ins==0)Kt(t,n.len,0,o),n.next();else if(i.len==0&&!i.done)Kt(t,0,i.ins,o),r&&Lo(r,t,i.text),i.next();else{if(n.done||i.done)throw new Error("Mismatched change set lengths");{let s=Math.min(n.len2,i.len),l=t.length;if(n.ins==-1){let c=i.ins==-1?-1:i.off?0:i.ins;Kt(t,s,c,o),r&&c&&Lo(r,t,i.text)}else i.ins==-1?(Kt(t,n.off?0:n.len,s,o),r&&Lo(r,t,n.textBit(s))):(Kt(t,n.off?0:n.len,i.off?0:i.ins,o),r&&!i.off&&Lo(r,t,i.text));o=(n.ins>s||i.ins>=0&&i.len>s)&&(o||t.length>l),n.forward2(s),i.forward(s)}}}}class SE{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,a=this.i-2>>1;return a>=e.length?_u.empty:e[a]}textBit(e){let{inserted:a}=this.set,t=this.i-2>>1;return t>=a.length&&!e?_u.empty:a[t].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}let xx=class BC{constructor(e,a,t){this.from=e,this.to=a,this.flags=t}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,a=-1){let t,r;return this.empty?t=r=e.mapPos(this.from,a):(t=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),t==this.from&&r==this.to?this:new BC(t,r,this.flags)}extend(e,a=e){if(e<=this.anchor&&a>=this.anchor)return Se.range(e,a);let t=Math.abs(e-this.anchor)>Math.abs(a-this.anchor)?e:a;return Se.range(this.anchor,t)}eq(e,a=!1){return this.anchor==e.anchor&&this.head==e.head&&(!a||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Se.range(e.anchor,e.head)}static create(e,a,t){return new BC(e,a,t)}};class Se{constructor(e,a){this.ranges=e,this.mainIndex=a}map(e,a=-1){return e.empty?this:Se.create(this.ranges.map(t=>t.map(e,a)),this.mainIndex)}eq(e,a=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t],a))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Se([this.main],0)}addRange(e,a=!0){return Se.create([e].concat(this.ranges),a?0:this.mainIndex+1)}replaceRange(e,a=this.mainIndex){let t=this.ranges.slice();return t[a]=e,Se.create(t,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Se(e.ranges.map(a=>xx.fromJSON(a)),e.main)}static single(e,a=e){return new Se([Se.range(e,a)],0)}static create(e,a=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let t=0,r=0;r<e.length;r++){let n=e[r];if(n.empty?n.from<=t:n.from<t)return Se.normalized(e.slice(),a);t=n.to}return new Se(e,a)}static cursor(e,a=0,t,r){return xx.create(e,e,(a==0?0:a<0?8:16)|(t==null?7:Math.min(6,t))|(r??16777215)<<6)}static range(e,a,t,r){let n=(t??16777215)<<6|(r==null?7:Math.min(6,r));return a<e?xx.create(a,e,48|n):xx.create(e,a,(a>e?8:0)|n)}static normalized(e,a=0){let t=e[a];e.sort((r,n)=>r.from-n.from),a=e.indexOf(t);for(let r=1;r<e.length;r++){let n=e[r],i=e[r-1];if(n.empty?n.from<=i.to:n.from<i.to){let o=i.from,s=Math.max(n.to,i.to);r<=a&&a--,e.splice(--r,2,n.anchor>n.head?Se.range(s,o):Se.range(o,s))}}return new Se(e,a)}}function PJ(u,e){for(let a of u.ranges)if(a.to>e)throw new RangeError("Selection points outside of document")}let e9=0;class Ne{constructor(e,a,t,r,n){this.combine=e,this.compareInput=a,this.compare=t,this.isStatic=r,this.id=e9++,this.default=e([]),this.extensions=typeof n=="function"?n(this):n}get reader(){return this}static define(e={}){return new Ne(e.combine||(a=>a),e.compareInput||((a,t)=>a===t),e.compare||(e.combine?(a,t)=>a===t:u9),!!e.static,e.enables)}of(e){return new Ah([],this,0,e)}compute(e,a){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ah(e,this,1,a)}computeN(e,a){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ah(e,this,2,a)}from(e,a){return a||(a=t=>t),this.compute([e],t=>a(t.field(e)))}}function u9(u,e){return u==e||u.length==e.length&&u.every((a,t)=>a===e[t])}class Ah{constructor(e,a,t,r){this.dependencies=e,this.facet=a,this.type=t,this.value=r,this.id=e9++}dynamicSlot(e){var a;let t=this.value,r=this.facet.compareInput,n=this.id,i=e[n]>>1,o=this.type==2,s=!1,l=!1,c=[];for(let d of this.dependencies)d=="doc"?s=!0:d=="selection"?l=!0:(((a=e[d.id])!==null&&a!==void 0?a:1)&1)==0&&c.push(e[d.id]);return{create(d){return d.values[i]=t(d),1},update(d,E){if(s&&E.docChanged||l&&(E.docChanged||E.selection)||OC(d,c)){let p=t(d);if(o?!cM(p,d.values[i],r):!r(p,d.values[i]))return d.values[i]=p,1}return 0},reconfigure:(d,E)=>{let p,h=E.config.address[n];if(h!=null){let x=xD(E,h);if(this.dependencies.every(f=>f instanceof Ne?E.facet(f)===d.facet(f):f instanceof ot?E.field(f,!1)==d.field(f,!1):!0)||(o?cM(p=t(d),x,r):r(p=t(d),x)))return d.values[i]=x,0}else p=t(d);return d.values[i]=p,1}}}}function cM(u,e,a){if(u.length!=e.length)return!1;for(let t=0;t<u.length;t++)if(!a(u[t],e[t]))return!1;return!0}function OC(u,e){let a=!1;for(let t of e)Vd(u,t)&1&&(a=!0);return a}function l3u(u,e,a){let t=a.map(s=>u[s.id]),r=a.map(s=>s.type),n=t.filter(s=>!(s&1)),i=u[e.id]>>1;function o(s){let l=[];for(let c=0;c<t.length;c++){let d=xD(s,t[c]);if(r[c]==2)for(let E of d)l.push(E);else l.push(d)}return e.combine(l)}return{create(s){for(let l of t)Vd(s,l);return s.values[i]=o(s),1},update(s,l){if(!OC(s,n))return 0;let c=o(s);return e.compare(c,s.values[i])?0:(s.values[i]=c,1)},reconfigure(s,l){let c=OC(s,t),d=l.config.facets[e.id],E=l.facet(e);if(d&&!c&&u9(a,d))return s.values[i]=E,0;let p=o(s);return e.compare(p,E)?(s.values[i]=E,0):(s.values[i]=p,1)}}}const hx=Ne.define({static:!0});class ot{constructor(e,a,t,r,n){this.id=e,this.createF=a,this.updateF=t,this.compareF=r,this.spec=n,this.provides=void 0}static define(e){let a=new ot(e9++,e.create,e.update,e.compare||((t,r)=>t===r),e);return e.provide&&(a.provides=e.provide(a)),a}create(e){let a=e.facet(hx).find(t=>t.field==this);return(a?.create||this.createF)(e)}slot(e){let a=e[this.id]>>1;return{create:t=>(t.values[a]=this.create(t),1),update:(t,r)=>{let n=t.values[a],i=this.updateF(n,r);return this.compareF(n,i)?0:(t.values[a]=i,1)},reconfigure:(t,r)=>{let n=t.facet(hx),i=r.facet(hx),o;return(o=n.find(s=>s.field==this))&&o!=i.find(s=>s.field==this)?(t.values[a]=o.create(t),1):r.config.address[this.id]!=null?(t.values[a]=r.field(this),0):(t.values[a]=this.create(t),1)}}}init(e){return[this,hx.of({field:this,create:e})]}get extension(){return this}}const Zs={lowest:4,low:3,default:2,high:1,highest:0};function U4(u){return e=>new jJ(e,u)}const Vn={highest:U4(Zs.highest),high:U4(Zs.high),default:U4(Zs.default),low:U4(Zs.low),lowest:U4(Zs.lowest)};class jJ{constructor(e,a){this.inner=e,this.prec=a}}class yg{of(e){return new SC(this,e)}reconfigure(e){return yg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class SC{constructor(e,a){this.compartment=e,this.inner=a}}class mD{constructor(e,a,t,r,n,i){for(this.base=e,this.compartments=a,this.dynamicSlots=t,this.address=r,this.staticValues=n,this.facets=i,this.statusTemplate=[];this.statusTemplate.length<t.length;)this.statusTemplate.push(0)}staticFacet(e){let a=this.address[e.id];return a==null?e.default:this.staticValues[a>>1]}static resolve(e,a,t){let r=[],n=Object.create(null),i=new Map;for(let E of c3u(e,a,i))E instanceof ot?r.push(E):(n[E.facet.id]||(n[E.facet.id]=[])).push(E);let o=Object.create(null),s=[],l=[];for(let E of r)o[E.id]=l.length<<1,l.push(p=>E.slot(p));let c=t?.config.facets;for(let E in n){let p=n[E],h=p[0].facet,x=c&&c[E]||[];if(p.every(f=>f.type==0))if(o[h.id]=s.length<<1|1,u9(x,p))s.push(t.facet(h));else{let f=h.combine(p.map(D=>D.value));s.push(t&&h.compare(f,t.facet(h))?t.facet(h):f)}else{for(let f of p)f.type==0?(o[f.id]=s.length<<1|1,s.push(f.value)):(o[f.id]=l.length<<1,l.push(D=>f.dynamicSlot(D)));o[h.id]=l.length<<1,l.push(f=>l3u(f,h,p))}}let d=l.map(E=>E(o));return new mD(e,i,d,o,s,n)}}function c3u(u,e,a){let t=[[],[],[],[],[]],r=new Map;function n(i,o){let s=r.get(i);if(s!=null){if(s<=o)return;let l=t[s].indexOf(i);l>-1&&t[s].splice(l,1),i instanceof SC&&a.delete(i.compartment)}if(r.set(i,o),Array.isArray(i))for(let l of i)n(l,o);else if(i instanceof SC){if(a.has(i.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(i.compartment)||i.inner;a.set(i.compartment,l),n(l,o)}else if(i instanceof jJ)n(i.inner,i.prec);else if(i instanceof ot)t[o].push(i),i.provides&&n(i.provides,o);else if(i instanceof Ah)t[o].push(i),i.facet.extensions&&n(i.facet.extensions,Zs.default);else{let l=i.extension;if(!l)throw new Error(`Unrecognized extension value in extension set (${i}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);n(l,o)}}return n(u,Zs.default),t.reduce((i,o)=>i.concat(o))}function Vd(u,e){if(e&1)return 2;let a=e>>1,t=u.status[a];if(t==4)throw new Error("Cyclic dependency between fields and/or facets");if(t&2)return t;u.status[a]=4;let r=u.computeSlot(u,u.config.dynamicSlots[a]);return u.status[a]=2|r}function xD(u,e){return e&1?u.config.staticValues[e>>1]:u.values[e>>1]}const MJ=Ne.define(),zC=Ne.define({combine:u=>u.some(e=>e),static:!0}),TJ=Ne.define({combine:u=>u.length?u[0]:void 0,static:!0}),RJ=Ne.define(),$J=Ne.define(),_J=Ne.define(),NJ=Ne.define({combine:u=>u.length?u[0]:!1});class Gn{constructor(e,a){this.type=e,this.value=a}static define(){return new d3u}}class d3u{of(e){return new Gn(this,e)}}class E3u{constructor(e){this.map=e}of(e){return new cu(this,e)}}class cu{constructor(e,a){this.type=e,this.value=a}map(e){let a=this.type.map(this.value,e);return a===void 0?void 0:a==this.value?this:new cu(this.type,a)}is(e){return this.type==e}static define(e={}){return new E3u(e.map||(a=>a))}static mapEffects(e,a){if(!e.length)return e;let t=[];for(let r of e){let n=r.map(a);n&&t.push(n)}return t}}cu.reconfigure=cu.define();cu.appendConfig=cu.define();class Xa{constructor(e,a,t,r,n,i){this.startState=e,this.changes=a,this.selection=t,this.effects=r,this.annotations=n,this.scrollIntoView=i,this._doc=null,this._state=null,t&&PJ(t,a.newLength),n.some(o=>o.type==Xa.time)||(this.annotations=n.concat(Xa.time.of(Date.now())))}static create(e,a,t,r,n,i){return new Xa(e,a,t,r,n,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let a of this.annotations)if(a.type==e)return a.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let a=this.annotation(Xa.userEvent);return!!(a&&(a==e||a.length>e.length&&a.slice(0,e.length)==e&&a[e.length]=="."))}}Xa.time=Gn.define();Xa.userEvent=Gn.define();Xa.addToHistory=Gn.define();Xa.remote=Gn.define();function p3u(u,e){let a=[];for(let t=0,r=0;;){let n,i;if(t<u.length&&(r==e.length||e[r]>=u[t]))n=u[t++],i=u[t++];else if(r<e.length)n=e[r++],i=e[r++];else return a;!a.length||a[a.length-1]<n?a.push(n,i):a[a.length-1]<i&&(a[a.length-1]=i)}}function LJ(u,e,a){var t;let r,n,i;return a?(r=e.changes,n=rt.empty(e.changes.length),i=u.changes.compose(e.changes)):(r=e.changes.map(u.changes),n=u.changes.mapDesc(e.changes,!0),i=u.changes.compose(r)),{changes:i,selection:e.selection?e.selection.map(n):(t=u.selection)===null||t===void 0?void 0:t.map(r),effects:cu.mapEffects(u.effects,r).concat(cu.mapEffects(e.effects,n)),annotations:u.annotations.length?u.annotations.concat(e.annotations):e.annotations,scrollIntoView:u.scrollIntoView||e.scrollIntoView}}function wC(u,e,a){let t=e.selection,r=rc(e.annotations);return e.userEvent&&(r=r.concat(Xa.userEvent.of(e.userEvent))),{changes:e.changes instanceof rt?e.changes:rt.of(e.changes||[],a,u.facet(TJ)),selection:t&&(t instanceof Se?t:Se.single(t.anchor,t.head)),effects:rc(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function IJ(u,e,a){let t=wC(u,e.length?e[0]:{},u.doc.length);e.length&&e[0].filter===!1&&(a=!1);for(let n=1;n<e.length;n++){e[n].filter===!1&&(a=!1);let i=!!e[n].sequential;t=LJ(t,wC(u,e[n],i?t.changes.newLength:u.doc.length),i)}let r=Xa.create(u,t.changes,t.selection,t.effects,t.annotations,t.scrollIntoView);return x3u(a?m3u(r):r)}function m3u(u){let e=u.startState,a=!0;for(let r of e.facet(RJ)){let n=r(u);if(n===!1){a=!1;break}Array.isArray(n)&&(a=a===!0?n:p3u(a,n))}if(a!==!0){let r,n;if(a===!1)n=u.changes.invertedDesc,r=rt.empty(e.doc.length);else{let i=u.changes.filter(a);r=i.changes,n=i.filtered.mapDesc(i.changes).invertedDesc}u=Xa.create(e,r,u.selection&&u.selection.map(n),cu.mapEffects(u.effects,n),u.annotations,u.scrollIntoView)}let t=e.facet($J);for(let r=t.length-1;r>=0;r--){let n=t[r](u);n instanceof Xa?u=n:Array.isArray(n)&&n.length==1&&n[0]instanceof Xa?u=n[0]:u=IJ(e,rc(n),!1)}return u}function x3u(u){let e=u.startState,a=e.facet(_J),t=u;for(let r=a.length-1;r>=0;r--){let n=a[r](u);n&&Object.keys(n).length&&(t=LJ(t,wC(e,n,u.changes.newLength),!0))}return t==u?u:Xa.create(e,u.changes,u.selection,t.effects,t.annotations,t.scrollIntoView)}const h3u=[];function rc(u){return u==null?h3u:Array.isArray(u)?u:[u]}var za=(function(u){return u[u.Word=0]="Word",u[u.Space=1]="Space",u[u.Other=2]="Other",u})(za||(za={}));const D3u=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let PC;try{PC=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function f3u(u){if(PC)return PC.test(u);for(let e=0;e<u.length;e++){let a=u[e];if(/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||D3u.test(a)))return!0}return!1}function g3u(u){return e=>{if(!/\S/.test(e))return za.Space;if(f3u(e))return za.Word;for(let a=0;a<u.length;a++)if(e.indexOf(u[a])>-1)return za.Word;return za.Other}}class Mu{constructor(e,a,t,r,n,i){this.config=e,this.doc=a,this.selection=t,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=n,i&&(i._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)Vd(this,o<<1);this.computeSlot=null}field(e,a=!0){let t=this.config.address[e.id];if(t==null){if(a)throw new RangeError("Field is not present in this state");return}return Vd(this,t),xD(this,t)}update(...e){return IJ(this,e,!0)}applyTransaction(e){let a=this.config,{base:t,compartments:r}=a;for(let o of e.effects)o.is(yg.reconfigure)?(a&&(r=new Map,a.compartments.forEach((s,l)=>r.set(l,s)),a=null),r.set(o.value.compartment,o.value.extension)):o.is(cu.reconfigure)?(a=null,t=o.value):o.is(cu.appendConfig)&&(a=null,t=rc(t).concat(o.value));let n;a?n=e.startState.values.slice():(a=mD.resolve(t,r,this),n=new Mu(a,this.doc,this.selection,a.dynamicSlots.map(()=>null),(s,l)=>l.reconfigure(s,this),null).values);let i=e.startState.facet(zC)?e.newSelection:e.newSelection.asSingle();new Mu(a,e.newDoc,i,n,(o,s)=>s.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(a=>({changes:{from:a.from,to:a.to,insert:e},range:Se.cursor(a.from+e.length)}))}changeByRange(e){let a=this.selection,t=e(a.ranges[0]),r=this.changes(t.changes),n=[t.range],i=rc(t.effects);for(let o=1;o<a.ranges.length;o++){let s=e(a.ranges[o]),l=this.changes(s.changes),c=l.map(r);for(let E=0;E<o;E++)n[E]=n[E].map(c);let d=r.mapDesc(l,!0);n.push(s.range.map(d)),r=r.compose(c),i=cu.mapEffects(i,c).concat(cu.mapEffects(rc(s.effects),d))}return{changes:r,selection:Se.create(n,a.mainIndex),effects:i}}changes(e=[]){return e instanceof rt?e:rt.of(e,this.doc.length,this.facet(Mu.lineSeparator))}toText(e){return _u.of(e.split(this.facet(Mu.lineSeparator)||CC))}sliceDoc(e=0,a=this.doc.length){return this.doc.sliceString(e,a,this.lineBreak)}facet(e){let a=this.config.address[e.id];return a==null?e.default:(Vd(this,a),xD(this,a))}toJSON(e){let a={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let t in e){let r=e[t];r instanceof ot&&this.config.address[r.id]!=null&&(a[t]=r.spec.toJSON(this.field(e[t]),this))}return a}static fromJSON(e,a={},t){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(t){for(let n in t)if(Object.prototype.hasOwnProperty.call(e,n)){let i=t[n],o=e[n];r.push(i.init(s=>i.spec.fromJSON(o,s)))}}return Mu.create({doc:e.doc,selection:Se.fromJSON(e.selection),extensions:a.extensions?r.concat([a.extensions]):r})}static create(e={}){let a=mD.resolve(e.extensions||[],new Map),t=e.doc instanceof _u?e.doc:_u.of((e.doc||"").split(a.staticFacet(Mu.lineSeparator)||CC)),r=e.selection?e.selection instanceof Se?e.selection:Se.single(e.selection.anchor,e.selection.head):Se.single(0);return PJ(r,t.length),a.staticFacet(zC)||(r=r.asSingle()),new Mu(a,t,r,a.dynamicSlots.map(()=>null),(n,i)=>i.create(n),null)}get tabSize(){return this.facet(Mu.tabSize)}get lineBreak(){return this.facet(Mu.lineSeparator)||`
@@ -446,7 +446,7 @@ html body {
446
446
 
447
447
  $3`);return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function ovu(u){return u.indexOf("`")!==-1?"`` "+u+" ``":u}var svu=(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)}})(),La,WE;if(typeof process=="object")WE=process.platform==="win32";else if(typeof navigator=="object"){var lvu=navigator.userAgent;WE=lvu.indexOf("Windows")>=0}var cvu=/^\w[\w\d+.-]*$/,dvu=/^\//,Evu=/^\/\//;function pvu(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&&!cvu.test(u.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(u.path){if(u.authority){if(!dvu.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(Evu.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 mvu(u,e){return!u&&!e?"file":u}function xvu(u,e){switch(u){case"https":case"http":case"file":e?e[0]!==N0&&(e=N0+e):e=N0;break}return e}var pa="",N0="/",hvu=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,GF=(function(){function u(e,a,t,r,n,i){i===void 0&&(i=!1),typeof e=="object"?(this.scheme=e.scheme||pa,this.authority=e.authority||pa,this.path=e.path||pa,this.query=e.query||pa,this.fragment=e.fragment||pa):(this.scheme=mvu(e,i),this.authority=a||pa,this.path=xvu(this.scheme,t||pa),this.query=r||pa,this.fragment=n||pa,pvu(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 pY(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=pa),t===void 0?t=this.authority:t===null&&(t=pa),r===void 0?r=this.path:r===null&&(r=pa),n===void 0?n=this.query:n===null&&(n=pa),i===void 0?i=this.fragment:i===null&&(i=pa),a===this.scheme&&t===this.authority&&r===this.path&&n===this.query&&i===this.fragment?this:new g1(a,t,r,n,i)},u.parse=function(e,a){a===void 0&&(a=!1);var t=hvu.exec(e);return t?new g1(t[2]||pa,Tx(t[4]||pa),Tx(t[5]||pa),Tx(t[7]||pa),Tx(t[9]||pa),a):new g1(pa,pa,pa,pa,pa)},u.file=function(e){var a=pa;if(WE&&(e=e.replace(/\\/g,N0)),e[0]===N0&&e[1]===N0){var t=e.indexOf(N0,2);t===-1?(a=e.substring(2),e=N0):(a=e.substring(2,t),e=e.substring(t)||N0)}return new g1("file",a,e,pa,pa)},u.from=function(e){return new g1(e.scheme,e.authority,e.path,e.query,e.fragment)},u.prototype.toString=function(e){return e===void 0&&(e=!1),HF(this,e)},u.prototype.toJSON=function(){return this},u.revive=function(e){if(e){if(e instanceof u)return e;var a=new g1(e);return a._formatted=e.external,a._fsPath=e._sep===dY?e.fsPath:null,a}else return e},u})(),dY=WE?1:void 0,g1=(function(u){svu(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=pY(this)),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.toString=function(a){return a===void 0&&(a=!1),a?HF(this,!0):(this._formatted||(this._formatted=HF(this,!1)),this._formatted)},e.prototype.toJSON=function(){var a={$mid:1};return this._fsPath&&(a.fsPath=this._fsPath,a._sep=dY),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})(GF),EY=(La={},La[58]="%3A",La[47]="%2F",La[63]="%3F",La[35]="%23",La[91]="%5B",La[93]="%5D",La[64]="%40",La[33]="%21",La[36]="%24",La[38]="%26",La[39]="%27",La[40]="%28",La[41]="%29",La[42]="%2A",La[43]="%2B",La[44]="%2C",La[59]="%3B",La[61]="%3D",La[32]="%20",La);function k$(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=EY[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 Dvu(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+=EY[t]):e!==void 0&&(e+=u[a])}return e!==void 0?e:u}function pY(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,WE&&(a=a.replace(/\//g,"\\")),a}function HF(u,e){var a=e?Dvu:k$,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+=N0,t+=N0),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:k$(s,!1)),t}function mY(u){try{return decodeURIComponent(u)}catch{return u.length>3?u.substr(0,3)+mY(u.substr(3)):u}}var b$=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Tx(u){return u.match(b$)?u.replace(b$,function(e){return mY(e)}):u}var fvu=(function(){function u(e){try{this.patternRegExp=new RegExp(avu(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})(),gvu=(function(){function u(e,a,t){this.service=e,this.url=a,this.dependencies={},t&&(this.unresolvedSchema=this.service.promise.resolve(new J1(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})(),J1=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u})(),y$=(function(){function u(e,a){a===void 0&&(a=[]),this.schema=e,this.errors=a}return u.prototype.getSection=function(e){return xr(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})(),vvu=(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=GF.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 GF.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 gvu(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 fvu(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 J1({},[a]))}return this.requestService(e).then(function(t){if(!t){var r="Unable to load schema from '"+e+"': No content.";return new J1({},[r])}var n={},i=[];n=_6u(t,i);var o=i.length?["Unable to parse content from '"+e+"': Parse error at offset "+i[0].offset]:[];return new J1(n,o)},function(t){var r="Unable to load schema from '"+e+"': "+t.toString();return new J1({},[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 y$({},["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(v){if(D[h]=!0,v.errors.length){var y=x?h+"#"+x:h;n.push("Problems loading reference '"+y+"': "+v.errors[0]+".")}return c(p,v.schema,h,x),E(p,v.schema,h,g.dependencies)})},E=function(p,h,x,f){if(!p||typeof p!="object")return Promise.resolve(null);for(var D=[p],g=[],v=[],y=function(){for(var O=[],T=0;T<arguments.length;T++)O[T]=arguments[T];for(var M=0,R=O;M<R.length;M++){var K=R[M];typeof K=="object"&&D.push(K)}},k=function(){for(var O=[],T=0;T<arguments.length;T++)O[T]=arguments[T];for(var M=0,R=O;M<R.length;M++){var K=R[M];if(typeof K=="object")for(var q in K){var W=K[q];typeof W=="object"&&D.push(W)}}},b=function(){for(var O=[],T=0;T<arguments.length;T++)O[T]=arguments[T];for(var M=0,R=O;M<R.length;M++){var K=R[M];if(Array.isArray(K))for(var q=0,W=K;q<W.length;q++){var Y=W[q];typeof Y=="object"&&D.push(Y)}}},C=function(O){for(var T=[];O.$ref;){var M=O.$ref,R=M.split("#",2);if(delete O.$ref,R[0].length>0){v.push(d(O,R[0],R[1],x,f));return}else T.indexOf(M)===-1&&(c(O,h,x,R[1]),T.push(M))}y(O.items,O.additionalProperties,O.not,O.contains,O.propertyNames,O.if,O.then,O.else),k(O.definitions,O.properties,O.patternProperties,O.dependencies),b(O.anyOf,O.allOf,O.oneOf,O.items)};D.length;){var B=D.pop();g.indexOf(B)>=0||(g.push(B),C(B))}return r.promise.all(v)};return E(i,i,a,t).then(function(p){return new y$(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=Xo(t[0].valueNode);if(r&&uvu(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 kvu=(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:gu.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?C$(t.trailingCommas):gu.Error,p=t?C$(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=Vu.create(e.positionAt(f.offset),e.positionAt(f.offset+f.length));s(Hi.create(D,d.errors[0],gu.Warning,Ru.SchemaResolveError))}else{var D=Vu.create(e.positionAt(h.offset),e.positionAt(h.offset+1));s(Hi.create(D,d.errors[0],gu.Warning,Ru.SchemaResolveError))}}else{var g=a.validate(e,d.schema);g&&g.forEach(s)}xY(d.schema)&&(p=void 0),hY(d.schema)&&(E=void 0)}for(var v=0,y=a.syntaxErrors;v<y.length;v++){var k=y[v];if(k.code===Ru.TrailingComma){if(typeof E!="number")continue;k.severity=E}s(k)}if(typeof p=="number"){var b="Comments are not permitted in JSON.";a.comments.forEach(function(C){s(Hi.create(C,b,p,Ru.CommentNotPermitted))})}return i};if(r){var c=r.id||"schemaservice://untitled/"+bvu++;return this.jsonSchemaService.resolveSchemaContent(new J1(r),c,{}).then(function(d){return l(d)})}return this.jsonSchemaService.getSchemaForResource(e.uri,a).then(function(d){return l(d)})},u})(),bvu=0;function xY(u){if(u&&typeof u=="object"){if(Pn(u.allowComments))return u.allowComments;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=xY(t);if(Pn(r))return r}}}function hY(u){if(u&&typeof u=="object"){if(Pn(u.allowTrailingCommas))return u.allowTrailingCommas;if(Pn(u.allowsTrailingCommas))return u.allowsTrailingCommas;if(u.allOf)for(var e=0,a=u.allOf;e<a.length;e++){var t=a[e],r=hY(t);if(Pn(r))return r}}}function C$(u){switch(u){case"error":return gu.Error;case"warning":return gu.Warning;case"ignore":return}}var F$=48,yvu=57,Cvu=65,Rx=97,Fvu=102;function Ia(u){return u<F$?0:u<=yvu?u-F$:(u<Rx&&(u+=Rx-Cvu),u>=Rx&&u<=Fvu?u-Rx+10:0)}function Avu(u){if(u[0]!=="#")return null;switch(u.length){case 4:return{red:Ia(u.charCodeAt(1))*17/255,green:Ia(u.charCodeAt(2))*17/255,blue:Ia(u.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Ia(u.charCodeAt(1))*17/255,green:Ia(u.charCodeAt(2))*17/255,blue:Ia(u.charCodeAt(3))*17/255,alpha:Ia(u.charCodeAt(4))*17/255};case 7:return{red:(Ia(u.charCodeAt(1))*16+Ia(u.charCodeAt(2)))/255,green:(Ia(u.charCodeAt(3))*16+Ia(u.charCodeAt(4)))/255,blue:(Ia(u.charCodeAt(5))*16+Ia(u.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Ia(u.charCodeAt(1))*16+Ia(u.charCodeAt(2)))/255,green:(Ia(u.charCodeAt(3))*16+Ia(u.charCodeAt(4)))/255,blue:(Ia(u.charCodeAt(5))*16+Ia(u.charCodeAt(6)))/255,alpha:(Ia(u.charCodeAt(7))*16+Ia(u.charCodeAt(8)))/255}}return null}var Bvu=(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"||VF(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=Lc.create(e.uri,Co(e,d));if(s.push({name:Xo(h.valueNode),kind:gn.Function,location:x}),i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o),s}}}return s}var f=function(g,v,y){return i>=0&&(v.type==="array"?v.items.forEach(function(k){return f(g,k,y)}):v.type==="object"&&v.properties.forEach(function(k){if(i>=0){var b=k.valueNode;if(b){i--;var C=Lc.create(e.uri,Co(e,k)),B=y?y+"."+k.keyNode.value:k.keyNode.value;g.push({name:r.getKeyLabel(k),kind:r.getSymbolKind(b.type),location:C,containerName:y}),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"||VF(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=Co(e,d),f=Co(e,h.keyNode);if(s.push({name:Xo(h.valueNode),kind:gn.Function,range:x,selectionRange:f}),i--,i<=0)return t&&t.onResultLimitExceeded&&t.onResultLimitExceeded(o),s}}}return s}var D=function(v,y){return i>=0&&(y.type==="array"?y.items.forEach(function(k,b){if(k&&i>=0){i--;var C=Co(e,k),B=C,O=String(b),T=D([],k);v.push({name:O,kind:r.getSymbolKind(k.type),range:C,selectionRange:B,children:T})}}):y.type==="object"&&y.properties.forEach(function(k){var b=k.valueNode;if(b&&i>=0){i--;var C=Co(e,k),B=Co(e,k.keyNode),O=D([],b);v.push({name:r.getKeyLabel(k),kind:r.getSymbolKind(b.type),range:C,selectionRange:B,children:O})}})),v},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 gn.Module;case"string":return gn.String;case"number":return gn.Number;case"array":return gn.Array;case"boolean":return gn.Boolean;default:return gn.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=Avu(Xo(d.node));if(p){var h=Co(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:eo.replace(r,JSON.stringify(c))}),n},u})();function Co(u,e){return Vu.create(u.positionAt(e.offset),u.positionAt(e.offset+e.length))}var Ovu={schemaAssociations:{},schemas:{}};function Svu(u,e){var a=[],t=[],r=[],n=-1,i=lc(u.getText(),!1),o=i.scan();function s(T){a.push(T),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(d0.create(l+1,0))):l<p&&(s({startLine:l,endLine:p,kind:Jd.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:Jd.Region};r.push(c)}else{for(var f=r.length-1;f>=0&&r[f].kind!==Jd.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=[],v=0,y=t;v<y.length;v++){var k=y[v];k<30&&(g[k]=(g[k]||0)+1)}for(var b=0,C=0,f=0;f<g.length;f++){var B=g[f];if(B){if(B+b>D){C=f;break}b+=B}}for(var O=[],f=0;f<a.length;f++){var k=t[f];typeof k=="number"&&(k<C||k===C&&b++<D)&&O.push(a[f])}return O}function zvu(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=LD.create(c[x],h);return h||(h=LD.create(Vu.create(o,o))),h}function r(o,s){return Vu.create(u.positionAt(o),u.positionAt(s))}var n=lc(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 DY(u){var e=u.promiseConstructor||Promise,a=new vvu(u.schemaRequestService,u.workspaceContext,e);a.setSchemaContributions(Ovu);var t=new nvu(a,u.contributions,e,u.clientCapabilities),r=new ivu(a,u.contributions,e),n=new Bvu(a),i=new kvu(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 evu(o,{collectComments:!0})},newJSONDocument:function(o,s){return Y6u(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:Svu,getSelectionRanges:zvu,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:`
448
448
  `};return K6u(o.getText(),c,p).map(function(h){return eo.replace(Vu.create(o.positionAt(h.offset),o.positionAt(h.offset+h.length)),h.content)})}}}var Qr=(u=>(u.Normal="Normal",u.Preview="Preview",u))(Qr||{});function Il(){const{tabsState:u}=yu(),e=P.useCallback(({type:r,collectionId:n,workflowId:i,stepId:o,historyId:s})=>u.tabs.findIndex(l=>{const c=l.data.get();return Za(c,r)?(!n||c.collectionId===n)&&(!i||c.workflowId===i)&&(!o||c.stepId===o)&&(!s||c.historyId===s):!1}),[u]),a=P.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=P.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&&((Za(o,Je.Workflow)||Za(o,Je.WorkflowRun))&&o.workflowId===r.workflowId&&i.data.workflowId.set(n.workflowId),Za(o,Je.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&&Za(o,Je.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 Za(u,e){return u.type===e}const Tg=DY({});let A$=null;function fY(u){A$!==u&&(A$=u,Tg.configure({validate:!0,schemas:[{uri:"stub://test",fileMatch:["*"],schema:u}]}))}function gY(u){const e=ID.create("stub.json","json",0,u),a=Tg.parseJSONDocument(e);return{textDoc:e,jsonDoc:a}}const vY=ot.define({create(){},update(u){return u}}),kY=u=>u.field(vY,!1),wvu=({store:u,isResponse:e,apiOperation:a})=>{const r=zB(u).data.get();let n=a?.body?.mediaTypes?.[Ht.JSON]?.schema;if(Za(r,Je.Step)&&e){const i=r.response?.status;i&&(n=a?.responses?.[i]?.mediaTypes?.[Ht.JSON]?.schema)}return[vY.init(()=>({schema:Ii(n||{}),store:u}))]};function Pvu(){return async u=>{const{schema:e}=kY(u.state)||{};if(!e)return[];fY(e);const a=u.state.doc,{textDoc:t,jsonDoc:r}=gY(a.toString());return(await Tg.doValidation(t,r))?.map(i=>({from:QF(a,i.range.start),to:QF(a,i.range.end),message:i.message,severity:Tvu[i.severity||3]}))}}const jvu=Vn.highest($l.of([{key:"Tab",run:u=>IZ(u)}]));function Mvu(){return async function(e){const a={from:e.pos,to:e.pos,options:[],filter:!1},{schema:t}=kY(e.state)||{};if(!t)return a;fY(t);const r=e.state.doc,n=QF.bind(null,r),{textDoc:i,jsonDoc:o}=gY(r.toString()),s=e.state.doc.lineAt(e.pos),l=s.number-1,c=e.pos-s.from,d=await Tg.doComplete(i,{line:l,character:c},o);if(!d)return a;const E=e.state.sliceDoc(s.from,e.pos);if(E.trim().endsWith(",")||Rvu(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 v=x.textEdit.newText.replace(/(\$1|\${1:.*?})/,"");const y=g===-1?0:g-v.length;f.dispatch({changes:{from:n(D.start),to:n(D.end),insert:v}});const k=v.length-(D.end.character-D.start.character);f.dispatch({selection:Se.single(n(D.end)+k+y)})}}))||[];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 Tvu={1:"error",2:"warning",3:"info",4:"hint"};function QF(u,e){return u.line(e.line+1).from+e.character}function Rvu(u){try{return JSON.parse(`{${u}}`),!0}catch{return!1}}const bY=cu.define();function d4(u){const e=u.activeEnvironmentId.get();return u.environments.find(a=>a.name.get()===e)?.get()||u.environments[0].get()}const qF=u=>Pa.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=d4(a.store)?.inputs,n=[],i=Ve.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),o=s=>Ve.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=sg(c);for(const E of d){const p=s+E.start,h=s+E.end;if(!(p>=h))if(E.prefix==="inputs"){const x=xg(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 Ve.set(n,!0)}},{decorations:e=>e.decorations}),$vu=DY({});function _vu(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 Nvu(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 Lvu=u=>Pa.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=ID.create("inmemory://model.json","json",0,t),p=$vu.parseJSONDocument(d)?.root;r=_vu(p)?p:void 0}catch{r=void 0}const i=d4(a.store)?.inputs,o=Ve.mark({attributes:{style:"background-color: var(--bg-color-active);"}}),s=d=>Ve.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 Ve.set([],!0);const c=Nvu(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=sg(x);for(const D of f){const g=p+D.start,v=p+D.end;if(!(g>=v))if(D.prefix==="inputs"){const y=xg(D.match),b=!i?.find(C=>C.name===y)?.value;l.push({from:g,to:v,value:s(b)})}else l.push({from:g,to:v,value:o})}}return Ve.set(l,!0)}},{decorations:e=>e.decorations}),K0={[Ht.Text]:{name:"Text",extensions:[Me.lineWrapping],stateExtensions:[qF]},[Ht.JSON]:{name:"JSON",extensions:[qxu(),kfu(Pvu(),{delay:0,needsRefresh:u=>u.transactions.some(e=>e.effects.some(a=>a.is(bY)))}),gZ.data.of({autocomplete:Mvu()}),jvu],stateExtensions:[wvu,Lvu]},[Ht.XML]:{name:"XML",extensions:[lfu()],stateExtensions:[qF]}},Ivu={[Ht.Image]:{name:"Image",extensions:[],stateExtensions:[]}},Kvu={[Ht.HTML]:{name:"HTML",extensions:[NDu()],stateExtensions:[qF]}},Vo={...K0,...Ivu,...Kvu},yY={[Ht.FormData]:{name:"form-data",extensions:void 0},[Ht["application/x-www-form-urlencoded"]]:{name:"x-www-form-urlencoded",extensions:void 0}},CY={[Ht.Binary]:{name:"Binary",extensions:void 0}},Ol={...K0,...yY,...CY},Vvu=Object.keys(K0),Q9=Object.keys(yY),FY=Object.keys(CY);function AY(u=[],e){const a={};return u.forEach(t=>{const r=String(t[e]);a[r]||(a[r]=[]),a[r].push(t)}),a}const R3={active:!0,key:"",value:""};function Go(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})),Ta(e.in)]}function $3(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 D0(){return{id:crypto.randomUUID(),...R3}}function yr(){return{id:crypto.randomUUID(),...R3,description:""}}function Ta(u){return{...R3,id:crypto.randomUUID(),in:u}}function pl(){return{id:crypto.randomUUID(),...R3,type:"text",files:null}}function q9(){return{id:crypto.randomUUID(),...R3,sendIn:Gt.URL}}function Db(u){return u.map(e=>({id:crypto.randomUUID(),key:"",value:e,active:!0}))}function Rg(u,e){return u.filter(a=>a.active&&a.value).map(({value:a})=>(e?oa(a,e):a).trim())}function Yo(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 BY(u,e){return u.map(({value:a,...t})=>({...t,value:oa(a,e)}))}function Gvu(u,e){if(!u.startsWith("$components.parameters."))return null;const a=u.replace("$components.parameters.","");return a&&e[a]||null}function Ra(u=[],e={}){const a=[];for(const t of u)if(Qo(t)){const r=Gvu(t.reference,e);r&&a.push({...r,active:t.active,value:t.value||r.value})}else a.push(t);return a}function jo(u){return Object.entries(u).map(([e,a])=>({id:crypto.randomUUID(),key:"",value:e,active:!0,description:a}))}function Hvu(u){return u.replace(/{/g,"{{").replace(/}/g,"}}")}const B$={documentedOAuth2Types:[],grantType:Ce.ClientCredentials,authRequestExtraParams:[D0()],tokenRequestExtraParams:[q9()],[Ce.ClientCredentials]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[yr()],accessToken:""},[Ce.ClientCredentialsWithJwtAssertion]:{clientId:"",clientSecret:"",clientAssertion:"",tokenUrl:"",scopes:[yr()],accessToken:""},[Ce.AuthorizationCode]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[yr()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ce.AuthorizationCodeWithPkce]:{clientId:"",clientSecret:"",tokenUrl:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[yr()],codeVerifier:"",codeChallenge:"",accessToken:""},[Ce.Implicit]:{clientId:"",authorizationUrl:"",callbackUrl:"",availableScopes:[],scopes:[yr()],accessToken:""},[Ce.Password]:{username:"",password:"",clientId:"",clientSecret:"",tokenUrl:"",accessToken:"",scopes:[yr()]}},Qvu={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:qr.Header,name:"",key:""},[ke.OAuth2]:B$,[ke.OpenIDConnect]:{...B$,openIdConnectUrl:"",userInfoUrl:""}},WF="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",qvu={[It.SIMPLE]:{condition:"",type:It.SIMPLE},[It.REGEX]:{condition:"",type:It.REGEX,context:""},[It.JSONPATH]:{condition:"",type:It.JSONPATH,context:""},[It.XPATH]:{condition:"",type:It.XPATH,context:""}};function KD(){return structuredClone({type:Et.Text,content:"",activeExampleName:"",formData:{"multipart/form-data":[pl()],"application/x-www-form-urlencoded":[pl()]},binary:null})}const Wvu={method:"GET",url:"",security:[Wn()],body:KD(),queryParameters:[D0()],headers:[D0()],cookies:[D0()],pathParameters:[D0()]};function OY(){return structuredClone(Wvu)}function Wn(){return Ii(Qvu)}function Jvu(u){return Ii({id:crypto.randomUUID(),...qvu[u]})}function SY(u,e,a){for(const t of a){const r=O$(u,t),n=O$(e,t);if(typeof r=="object"&&typeof n=="object"){if(!SY(r,n,a))return!1}else if(r!==n)return!1}return!0}function O$(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 Uvu(u,e){return u.length===e.length&&u.sort().join()===e.sort().join()}function Zvu(u,e){return u.every(a=>e.includes(a))}function Xvu(u){switch(u){case"query":return qr.Query;case"cookie":return qr.Cookie;case"header":return qr.Header;default:return}}function Yvu(u,e,a){const{security:t}=e,r=qlu(u);if(!a)return!1;const n=W9(a),i=n.map(c=>c.securityType),o=t.map(c=>c.securityType);if(!Uvu(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||SY(c,h,uku(d,E)),f=eku(c,d,c[ke.OAuth2]?.grantType,r),D=!!(p&&h&&x&&f);l.push(!a.security?.length||D)}),l.includes(!1)}function eku(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=Rg(u[ke.OAuth2][a]?.scopes,t);return Zvu(n,r)}return!0}function uku(u,e){return u===ke.APIKey?[`${ke.APIKey}/name`,`${ke.APIKey}/location`]:u===ke.OAuth2?[`${ke.OAuth2}/grantType`,...aku(e)]:u===ke.OpenIDConnect?[`${ke.OpenIDConnect}/openIdConnectUrl`]:[]}function aku(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 tku(u){return u.map(e=>{const a=e.map(t=>t.id).join("_");return e.map(t=>({...t,schemeId:a}))})}function rku(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(J9(i))}),{id:r,security:n}});return e.length?a:[]}function nku(u,e){const a=u.security||[];return a?.length?PY(a).map((t,r)=>J9(t)):[]}function W9(u){const a=(u.security||[])[0];return a?a.map(t=>J9(t)):[Wn()]}function J9(u,e){const a={...Wn(),securitySchemeId:u.id},t=$g(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=Oa(r+Q.SecurityVariablesEnvSuffix.Username)),a[ke.BasicAuth].password||(a[ke.BasicAuth].password=Oa(r+Q.SecurityVariablesEnvSuffix.Password))),t===ke.DigestAuth&&(a[ke.DigestAuth].username||(a[ke.DigestAuth].username=Oa(r+Q.SecurityVariablesEnvSuffix.Username)),a[ke.DigestAuth].password||(a[ke.DigestAuth].password=Oa(r+Q.SecurityVariablesEnvSuffix.Password))),t===ke.JWT&&!a[ke.JWT].token&&(a[ke.JWT].token=Oa(r+Q.SecurityVariablesEnvSuffix.JWTToken)),t===ke.APIKey&&!a[ke.APIKey].key){a[ke.APIKey].name=u.name||"",a[ke.APIKey].key=Oa(r+Q.SecurityVariablesEnvSuffix.APIKey);const n=Xvu(u.in);n&&(a[ke.APIKey].location=n)}if(t===ke.OAuth2){const n=Z9(u),i=Oa(r+Q.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=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),o[Ce.AuthorizationCode].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Ce.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Ce.AuthorizationCode].clientSecret=Oa(r+Q.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.AuthorizationCode].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Ce.AuthorizationCode].scopes=[...jo(u.flows?.authorizationCode?.scopes||{})||[],yr()]),s===Ce.AuthorizationCodeWithPkce&&!o[Ce.AuthorizationCodeWithPkce].accessToken&&(o[Ce.AuthorizationCodeWithPkce].accessToken=i,o[Ce.AuthorizationCodeWithPkce].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),o[Ce.AuthorizationCodeWithPkce].authorizationUrl=u.flows?.authorizationCode?.authorizationUrl||"",o[Ce.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||"",o[Ce.AuthorizationCodeWithPkce].clientSecret=Oa(r+Q.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.AuthorizationCodeWithPkce].availableScopes=Object.keys(u.flows?.authorizationCode?.scopes||{})||[],o[Ce.AuthorizationCodeWithPkce].scopes=[...jo(u.flows?.authorizationCode?.scopes||{}),yr()]),s===Ce.ClientCredentials&&!o[Ce.ClientCredentials].accessToken&&(o[Ce.ClientCredentials].accessToken=i,o[Ce.ClientCredentials].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),o[Ce.ClientCredentials].clientSecret=Oa(r+Q.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.ClientCredentials].tokenUrl=u.flows?.clientCredentials?.tokenUrl||"",o[Ce.ClientCredentials].scopes=[...jo(u.flows?.clientCredentials?.scopes||{}),yr()]),s===Ce.ClientCredentialsWithJwtAssertion&&!o[Ce.ClientCredentialsWithJwtAssertion].accessToken&&(o[Ce.ClientCredentialsWithJwtAssertion].accessToken=i,o[Ce.ClientCredentialsWithJwtAssertion].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),o[Ce.ClientCredentialsWithJwtAssertion].clientAssertion=Oa(r+Q.SecurityVariablesEnvSuffix.ClientAssertion),o[Ce.ClientCredentialsWithJwtAssertion].scopes=[...jo(u.flows?.clientCredentials?.scopes||{}),yr()]),s===Ce.Implicit&&!o[Ce.Implicit].accessToken&&(o[Ce.Implicit].accessToken=i,o[Ce.Implicit].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),o[Ce.Implicit].authorizationUrl=u.flows?.implicit?.authorizationUrl||"",o[Ce.Implicit].availableScopes=Object.keys(u.flows?.implicit?.scopes||{})||[],o[Ce.Implicit].scopes=[...jo(u.flows?.implicit?.scopes||{}),yr()]),s===Ce.Password&&!o[Ce.Password].accessToken&&(o[Ce.Password].accessToken=i,o[Ce.Password].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),o[Ce.Password].clientSecret=Oa(r+Q.SecurityVariablesEnvSuffix.ClientSecret),o[Ce.Password].tokenUrl=u.flows?.password?.tokenUrl||"",o[Ce.Password].scopes=[...jo(u.flows?.password?.scopes||{}),yr()])})}if(t===ke.OpenIDConnect){const n=Oa(r+Q.SecurityVariablesEnvSuffix.Token),i=a[ke.OpenIDConnect];i[Ce.AuthorizationCode].accessToken||(i[Ce.AuthorizationCode].accessToken=n,i[Ce.AuthorizationCode].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),i[Ce.AuthorizationCode].clientSecret=Oa(r+Q.SecurityVariablesEnvSuffix.ClientSecret),i[Ce.AuthorizationCode].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Ce.AuthorizationCodeWithPkce].accessToken||(i[Ce.AuthorizationCodeWithPkce].accessToken=n,i[Ce.AuthorizationCodeWithPkce].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId),i[Ce.AuthorizationCodeWithPkce].clientSecret=Oa(r+Q.SecurityVariablesEnvSuffix.ClientSecret),i[Ce.AuthorizationCodeWithPkce].tokenUrl=u.flows?.authorizationCode?.tokenUrl||""),i[Ce.Implicit].accessToken||(i[Ce.Implicit].accessToken=n,i[Ce.Implicit].clientId=Oa(r+Q.SecurityVariablesEnvSuffix.ClientId))}return a}function iku(u,e=!1,a="",t){const r=AY(u.parameters,"in"),n=zY(u),i=W9(u),o=Go(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:Go(r.path||[],{in:"path"}),method:u.method.toLocaleUpperCase(),url:$3(Hvu(u.path),o),headers:Go(r.header||[],{in:"header"}),queryParameters:o,cookies:Go(r.cookie||[],{in:"cookie"}),body:n,security:i},response:null}}function U9(u){const e=AY(u.parameters,"in"),a=zY(u),t=W9(u);return{parameters:{queryParameters:Go(e.query||[],{in:"query"}),headers:Go(e.header||[],{in:"header"}),cookies:Go(e.cookie||[],{in:"cookie"}),pathParameters:Go(e.path||[],{initializeWithInputs:!0,in:"path"})},requestBody:a,security:t}}function zY(u){const e=u.body?.mediaTypes;if(!e||!Object.keys(e).length)return KD();const a=oku(e,u),t=a?.name||"",r=!Q9.includes(t)&&!FY.includes(t),n=JF(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{...KD(),activeExampleName:u.body?.activeExampleName||n[0]?.key||"",...a&&{type:a.name},content:i,formData:{"multipart/form-data":S$(e[Ht.FormData]),"application/x-www-form-urlencoded":S$(e[Ht["application/x-www-form-urlencoded"]])}}}function wY(u){return u?{...(Object.keys(u?.body?.mediaTypes||{})||[]).reduce((a,t)=>(a[t]={name:t,extensions:void 0},a),{}),...Ol}:Ol}function S$(u){if(!u)return[pl()];if(!u.parameters)return[pl()];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(pl()),e}function JF(u){const e=u?.examples;return Object.keys(e||{}).map(a=>{const t=e?.[a];return{name:Q.isString(t?.summary)?t?.summary:t?.summary?.raw||a,key:a,value:e?.[a].value}})}function oku(u,e){const a=wY(e),t=Object.keys(u).find(r=>!!a[r]);return t?u[t]:null}function sku(u){return!u?.security?.length||!u?[]:nku(u)}function PY(u){const e=new Set;return u.flat().filter(a=>e.has(a.id)?!1:(e.add(a.id),!0))}function $g(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 lku(u,e){if(u==="clientCredentials"&&e&&"x-assertionType"in e&&e["x-assertionType"]===WF)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 cku(u,e){const a=u?.security;if(!a?.length)return[];const n=tku(a).flat().filter(i=>i.schemeId===e).find(i=>$g(i)===ke.OAuth2);return Z9(n)}function Z9(u){return Object.entries(u?.flows||{}).map(([e,a])=>lku(e,a)).filter(Boolean)}async function _3(u){try{const e=await DEu(u),a=await mJ(u);return{absolutePath:u,file:new File([e],a)}}catch(e){return console.error("Failed to init replay file",e),null}}async function jY(u){return(await Promise.allSettled(u.map(a=>_3(a)))).map(a=>a.status==="fulfilled"?a.value:null).filter(a=>a!==null)}function _h(u){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(u)}function UF(u){return u.endsWith("/")?u.substring(0,u.length-1):u}function dku(u){try{const e=new URL(u);return e.search="",e.hash="",e.toString()}catch{return u}}function _g(u){return/^https?:\/\//i.test(u)}function Eku(u,e){let a;if(e.startsWith("//")){const{protocol:t}=new URL(u);a=`${t||"https:"}${e}`}else if(_h(e))a=e;else if(!e.startsWith("/"))a=UF(u)+"/"+e;else{const t=new URL(u);t.pathname=e,a=t.toString()}return UF(a)}function VD(u,e){let a=u;return e.forEach(({key:t,value:r,active:n})=>{r&&n&&(a=a.replaceAll(`{${t}}`,r))}),a}function X9(u,e){let a=u;return e.forEach(({name:t,value:r})=>{r&&(a=a.replaceAll(`{${t}}`,r))}),a}function pku(u){return u.startsWith("http://")||u.startsWith("https://")}function $x({url:u,serverUrl:e,corsProxyUrl:a}){let t;if(pku(u)||!e)t=u;else{const r=new URL(e);r.pathname=u,r.search="",r.hash="",t=r.toString()}return a?`${a}${t}`:t}async function mku(u,e,a,t,r,n){const i=await Promise.all(u.sourceDescriptions?.map(async s=>({...s,apiId:await MY({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:Ku.Normal,sourceDescriptions:i,components:o,workflows:await Promise.all(u.workflows.map(async s=>({...s,state:Ku.Normal,parameters:_$(s.parameters,s["x-replay-disabled-parameters"],u.components?.parameters),outputs:R$(s.outputs),security:j$(s["x-security"]),steps:await Promise.all(s.steps.map(async l=>{const c=_$(l.parameters,l["x-replay-disabled-parameters"],u.components?.parameters),d=l["x-operation"]??null;d&&(d.url=$3(d.url,c.queryParameters.filter(xK)));const E=xku(l,i,r);let p;if(E&&n){const x=r?.find(f=>f.id===E.apiId);try{p=n(E.path,E.method,x)}catch(f){console.error("Failed to convert operation to replay value",f),p=void 0}}delete l.operationId,delete l["x-operation"];const h=await kku(l.requestBody,t);return{...l,state:Ku.Normal,parameters:c,outputs:R$(l.outputs),successCriteria:l.successCriteria?.map(x=>({...x,type:x.type??It.SIMPLE}))||[],requestBody:h,xOperation:d,security:j$(l["x-security"],p),operation:E}}))})))}}async function MY({projectPath:u,apiUrl:e,collectionId:a}){if(_g(e))return e;if(await ca.isAbsolute(e))return await ca.relative(u,e);const t=await ca.resolve(await ca.join(u,a,"..",e));return await ca.relative(u,t)}function xku(u,e,a){if(u["x-operation"])return null;const{path:t,method:r,apiId:n,isAdditionalOperation:i}=TY({operationPath:u.operationPath,parsedSourceDescriptions:e}),{operationId:o,apiId:s}=hku({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=yku(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 hku({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 z$(u){return"reference"in u&&typeof u.reference=="string"}function TY({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:gE.unescape(l.pop()||""),method:c.toLowerCase(),apiId:i,isAdditionalOperation:d}}catch{return{path:"",method:"",apiId:null,isAdditionalOperation:!1}}}function Dku(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 RY(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 fku(u){return{query:qr.Query,header:qr.Header,cookie:qr.Cookie}[u.toLowerCase()]||qr.Header}function gku(u){return{body:Gt.Body,header:Gt.Header,url:Gt.URL}[u.toLowerCase()]||Gt.URL}function w$(u,e,a){return Object.keys(u).reduce((t,r)=>{const n=RY(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:Vs(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:Vs(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:Vs(u[r].availableScopes),scopes:Vs(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:Vs(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:Vs(u[r].availableScopes),scopes:Vs(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 P$(u,e,a){const r={...Wn(),securityType:u},n=Object.keys(e.flows||{})[0],i=RY(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:fku(e.in),name:e.name,key:a.apiKey,schemeName:e.id}};case ke.OAuth2:return{...r,[ke.OAuth2]:{...r[ke.OAuth2],...w$(e.flows||{},a||{},r[ke.OAuth2]),authRequestExtraParams:M$(a.authRequestExtraParams),tokenRequestExtraParams:T$(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};case ke.OpenIDConnect:return{...r,[ke.OpenIDConnect]:{...r[ke.OpenIDConnect],...w$(a.flows||{},a||{},r[ke.OpenIDConnect]),openIdConnectUrl:a.openIdConnectUrl,userInfoUrl:a.userInfoUrl,authRequestExtraParams:M$(a.authRequestExtraParams),tokenRequestExtraParams:T$(a.tokenRequestExtraParams),grantType:i,schemeName:e.id}};default:return r}}function vku(u,e){return[...u.map(t=>{if("scheme"in t){const n=Dku(t.scheme);return P$(n,t.scheme,t.values)}const r=e.find(n=>n.id===t.schemeName);if(r){const n=$g(r),i=P$(n,r,t.values);return i.securitySchemeId=r.id,i}return Wn()})]}function j$(u=[],e){const a=PY(e?.security||[]);return u.length?vku(u,a):[Wn()]}function Vs(u,e){const a=jo(u||{}),t=jo(e||{});return[...a,...t,yr()]}function M$(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0})).concat(D0())}function T$(u){return(u||[]).map(e=>({id:crypto.randomUUID(),key:e.key??"",value:e.value??"",active:e.active??!0,sendIn:gku(e.in)})).concat(q9())}function R$(u){if(!u)return[D0()];const e=[];for(const a in u)e.push({id:crypto.randomUUID(),key:a,value:u[a],active:!0});return e.push(D0()),e}const v1={query:"queryParameters",path:"pathParameters",header:"headers",cookie:"cookies"};function $$(u,e){const a="$components.parameters.";if(u.reference.startsWith(a)){const t=u.reference.replace(a,"");return e?.[t]}}function _$(u,e,a){if(!u&&!e)return{pathParameters:[Ta("path")],queryParameters:[Ta("query")],headers:[Ta("header")],cookies:[Ta("cookie")]};const t={pathParameters:[],queryParameters:[],headers:[],cookies:[]};if(u)for(const r of u)if(z$(r)){const n=$$(r,a),i=v1[n?.in];i&&t[i].push({reference:r.reference,active:!0,value:r.value})}else v1[r.in]&&t[v1[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(z$(r)){const n=$$(r,a),i=v1[n?.in];i&&t[i].push({reference:r.reference,active:!1,value:r.value})}else v1[r.in]&&t[v1[r.in]].push({id:crypto.randomUUID(),key:r.name,value:r.value,active:!1,in:r.in});return t.pathParameters.push(Ta("path")),t.queryParameters.push(Ta("query")),t.headers.push(Ta("header")),t.cookies.push(Ta("cookie")),t}async function kku(u,e){const a=OY().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 bku(u,e)};case"application/octet-stream":const t=u.payload?await $Y(u.payload,e):[],r=t.length>0?await _3(t[0]):null;return{...a,type:u.contentType,binary:r};case"application/json":case"application/ld+json":return{...a,type:u.contentType,content:L$(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:L$(u.payload)}}}}async function N$(u,e,a,t){const r=await $Y(e,t),n=r.length>0||Array.isArray(e),i=n?await jY(r):void 0;return{id:crypto.randomUUID(),key:u,value:n?"":e,type:n?"file":"text",active:a,files:i}}async function bku(u,e){const a=OY().body.formData,t=u.contentType,r=u.payload?await Promise.all(Object.entries(u.payload).map(([o,s])=>N$(o,s,!0,e))):[],n=u["x-replay-disabled-payload"]?await Promise.all(Object.entries(u["x-replay-disabled-payload"]||{}).map(([o,s])=>N$(o,s,!1,e))):[];return{...a,[t]:[...r,...n,pl()]}}function L$(u){return u?JSON.stringify(u,null,2):""}function yku(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 $Y(u,e){return Array.isArray(u)?(await Promise.all(u.map(a=>I$(a,e)))).flat():typeof u=="string"?await I$(u,e):[]}async function I$(u,e){const a=/\$file\(['"](.+?)['"]\)/g,t=Array.from(u.matchAll(a));return Promise.all(t.map(r=>Cku(r[1],e)))}async function Cku(u,e){return await ca.isAbsolute(u)?u:await ca.resolve(await ca.join(e,u))}const cr=u=>!u||typeof u=="boolean"?{type:"object",properties:{}}:u.type?u:{...u,type:"object"},K$=(u,e,a)=>{if(!u.properties)return u;const t=u.properties[e],r=cr(t);return{...u,properties:{...u.properties,[e]:{...r,...a}}}},Fku=(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})},Aku=(u,e)=>{if(!u.properties)return u;const a={...u.properties};return delete a[e],{...u,properties:a}},Bku=(u,e,a={type:"string"})=>{const t=u.properties||{};return{...u,type:"object",properties:{...t,[e]:a}}};function V$(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 G$(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(Qo(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 Oku(u){const e=u?.map(a=>({condition:a.condition,context:a.context,type:a.type==It.SIMPLE?void 0:a.type}));if(e?.length!==0)return e}function Sku(u){if(!(!u||u.length===0))return[...u]}async function _Y(u,e){return u.absolutePath?`$file('${await ca.relative(e,u.absolutePath)}')`:null}async function zku(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=>_Y(i,e)))).filter(i=>i!==null)),n.length===0?"":n.length===1?n[0]:n}}async function wku(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 zku(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 Pku(u){if(!u)return u;try{const e=JSON.parse(u);return typeof e=="object"?e:u}catch{return u}}async function jku(u,e){if(u)switch(u.type){case"application/x-www-form-urlencoded":case"multipart/form-data":return{contentType:u.type,...await wku(u,e)};case"application/octet-stream":return{contentType:u.type,payload:u.binary?await _Y(u.binary,e):null};case"application/json":case"application/ld+json":return u.content?{contentType:u.type,payload:Pku(u.content)}:void 0;default:return u.content?{contentType:u.type,payload:u.content}:void 0}}function Mku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"basic"}},values:{username:u.username,password:u.password}}}function Tku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"apiKey",name:u.name,in:u.location.toLowerCase()}},values:{apiKey:u.key}}}function Rku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"bearer"}},values:{token:u.token}}}function $ku(u){return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"http",scheme:"digest"}},values:{username:u.username,password:u.password}}}function _ku(u){const{flows:e,values:a}=IY(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"openIdConnect",flows:e}},values:{...a,openIdConnectUrl:u.openIdConnectUrl,userInfoUrl:u.userInfoUrl,authRequestExtraParams:NY(u.authRequestExtraParams),tokenRequestExtraParams:LY(u.tokenRequestExtraParams)}}}function Nku(u){const{flows:e,values:a}=IY(u);return{...u.schemeName?{schemeName:u.schemeName}:{scheme:{type:"oauth2",flows:e}},values:{...a,authRequestExtraParams:NY(u.authRequestExtraParams),tokenRequestExtraParams:LY(u.tokenRequestExtraParams)}}}function k1(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 NY(u){return u.filter(e=>e.value||e.key).map(e=>({key:e.key,value:e.value,active:e.active}))}function LY(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 IY(u){let e;switch(u.grantType){case Ce.ClientCredentials:return e=u[Ce.ClientCredentials],{flows:{clientCredentials:{tokenUrl:e.tokenUrl,...k1(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,...k1(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,...k1(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,...k1(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,...k1(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,...k1(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 H$(u){const e=u.map(a=>{switch(a.securityType){case ke.OpenIDConnect:{const r=a[ke.OpenIDConnect];return _ku(r)}case ke.OAuth2:{const r=a[ke.OAuth2];return Nku(r)}case ke.APIKey:{const r=a[ke.APIKey];return Tku(r)}case ke.BasicAuth:{const r=a[ke.BasicAuth];return Mku(r)}case ke.DigestAuth:{const r=a[ke.DigestAuth];return $ku(r)}case ke.JWT:{const r=a[ke.JWT];return Rku(r)}default:return null}}).filter(a=>a!==null);return{"x-security":e.length?e:void 0}}function Lku(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 Iku(u,e){const{id:a,state:t,srcType:r,sourceDescriptions:n,workflows:i,components:o,...s}=u;return{arazzoObject:{...s,sourceDescriptions:n.map(l=>({...l,name:l.name,url:l.url,type:l.type||"openapi",apiId:void 0})),components:Lku(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:Sku(d),outputs:V$(E),inputs:x?cr(x):void 0,...H$(c),...G$(l),steps:await Promise.all(h.map(async({parameters:D,security:g,operation:v,requestBody:y,successCriteria:k,outputs:b,state:C,xOperation:B,...O})=>{const T={operationId:void 0,operationPath:void 0,"x-operation":void 0};if(v){const M=u.sourceDescriptions.find(({apiId:R})=>R===v.apiId)||u.sourceDescriptions[0];if(v.operationId){const R=u.sourceDescriptions.length<=1;T.operationId=R?v.operationId:`$sourceDescriptions.${M.name}.${v.operationId}`}else T.operationPath=v.isAdditionalOperation?`{$sourceDescriptions.${M.name}.url}#/paths/${gE.escape(v.path)}/additionalOperations/${v.method}`:`{$sourceDescriptions.${M.name}.url}#/paths/${gE.escape(v.path)}/${v.method}`}else B&&(T["x-operation"]={...B,url:B.url.split("?")[0]});return{...O,...T,...H$(g),...G$(D),requestBody:await jku(y,e),successCriteria:Oku(k),outputs:V$(b)}}))})))}}}class Kku extends DJ{constructor(e,a){super(e),this.convertOperationToReplayValue=a}parse(e,a){return mku(e.content,e.uri,e.type,this.storage.baseDir,a,this.convertOperationToReplayValue)}async stringify(e){const{arazzoObject:a}=await Iku(e,this.storage.baseDir);return await ca.extname(e.id)===".json"?JSON.stringify(a,null,2):Ji.dump(a)}}class Vku{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=Ji.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:Ku.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",Ji.dump(r))}}class Gku{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 Hku=(u,e)=>({data:u,version:e});class ZF extends Gku{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(Hku(e,this.version))}}function Qku(u){return{data:{...u.data,tabs:u.data.tabs.map(e=>e.data.type===Je.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 Q$=2,qku="tabs.json";class Wku extends ZF{migrationMap={1:Qku};constructor(e){super(e,qku,Ii(EJ),Q$)}async parse(e){let a=JSON.parse(e);a.version!==Q$&&(a=this.migrate(a));const t=await Promise.all(a.data.tabs.map(async r=>{if(r.data.type===Je.Step&&r.data.draftStep){const n=r.data.draftStep.requestBody.formData;n["multipart/form-data"]=await q$(n["multipart/form-data"]),n["application/x-www-form-urlencoded"]=await q$(n["application/x-www-form-urlencoded"]),r.data.draftStep.requestBody.binary&&r.data.draftStep.requestBody.binary.absolutePath&&(r.data.draftStep.requestBody.binary=await _3(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===Je.Step?{...a,data:{...a.data,response:null}}:a.data.type===Je.WorkflowRun?{...a,data:{...a.data,result:null}}:a)})}}async function q$(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 jY(t)}return a}))}const Jku=1,Uku=1;class KY{constructor(e,a,t,r,n,i){this.systemFilesStorage=e,this.userFilesStorage=a,this.project=t,this.isApiPersisted=r,this.convertOperationToReplayValue=n,this.telemetry=i,this.localStorageSecretsProvider=new bEu(this.project.id);const o=new kEu;this.historyStorage=new ZF(this.systemFilesStorage,"history.json",[],Jku),this.activeEnvironmentIdStorage=new ZF(this.systemFilesStorage,"active_environment_id.json",F3,Uku),this.tabsStateStorage=new Wku(this.systemFilesStorage),this.environmentsStorage=new Vku(this.userFilesStorage,this.localStorageSecretsProvider),this.collectionsStorage=new Kku(this.userFilesStorage,this.convertOperationToReplayValue),this.apisStorage=new yEu(this.isApiPersisted?this.userFilesStorage:o)}historyStorage;activeEnvironmentIdStorage;tabsStateStorage;environmentsStorage;collectionsStorage;apisStorage;localStorageSecretsProvider;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.isApiPersisted&&await this.apisStorage.update(e,a.apis.get());break;case"collections":await this.collectionsStorage.update(e,a.collections.get());break}}}var fb={exports:{}},W$;function Zku(){return W$||(W$=1,(function(u){var e=Object.prototype.hasOwnProperty,a="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(a=!1));function r(s,l,c){this.fn=s,this.context=l,this.once=c||!1}function n(s,l,c,d,E){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new r(c,d||s,E),h=a?a+l:l;return s._events[h]?s._events[h].fn?s._events[h]=[s._events[h],p]:s._events[h].push(p):(s._events[h]=p,s._eventsCount++),s}function i(s,l){--s._eventsCount===0?s._events=new t:delete s._events[l]}function o(){this._events=new t,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)e.call(c,d)&&l.push(a?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=a?a+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var E=0,p=d.length,h=new Array(p);E<p;E++)h[E]=d[E].fn;return h},o.prototype.listenerCount=function(l){var c=a?a+l:l,d=this._events[c];return d?d.fn?1:d.length:0},o.prototype.emit=function(l,c,d,E,p,h){var x=a?a+l:l;if(!this._events[x])return!1;var f=this._events[x],D=arguments.length,g,v;if(f.fn){switch(f.once&&this.removeListener(l,f.fn,void 0,!0),D){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,c),!0;case 3:return f.fn.call(f.context,c,d),!0;case 4:return f.fn.call(f.context,c,d,E),!0;case 5:return f.fn.call(f.context,c,d,E,p),!0;case 6:return f.fn.call(f.context,c,d,E,p,h),!0}for(v=1,g=new Array(D-1);v<D;v++)g[v-1]=arguments[v];f.fn.apply(f.context,g)}else{var y=f.length,k;for(v=0;v<y;v++)switch(f[v].once&&this.removeListener(l,f[v].fn,void 0,!0),D){case 1:f[v].fn.call(f[v].context);break;case 2:f[v].fn.call(f[v].context,c);break;case 3:f[v].fn.call(f[v].context,c,d);break;case 4:f[v].fn.call(f[v].context,c,d,E);break;default:if(!g)for(k=1,g=new Array(D-1);k<D;k++)g[k-1]=arguments[k];f[v].fn.apply(f[v].context,g)}}return!0},o.prototype.on=function(l,c,d){return n(this,l,c,d,!1)},o.prototype.once=function(l,c,d){return n(this,l,c,d,!0)},o.prototype.removeListener=function(l,c,d,E){var p=a?a+l:l;if(!this._events[p])return this;if(!c)return i(this,p),this;var h=this._events[p];if(h.fn)h.fn===c&&(!E||h.once)&&(!d||h.context===d)&&i(this,p);else{for(var x=0,f=[],D=h.length;x<D;x++)(h[x].fn!==c||E&&!h[x].once||d&&h[x].context!==d)&&f.push(h[x]);f.length?this._events[p]=f.length===1?f[0]:f:i(this,p)}return this},o.prototype.removeAllListeners=function(l){var c;return l?(c=a?a+l:l,this._events[c]&&i(this,c)):(this._events=new t,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=a,o.EventEmitter=o,u.exports=o})(fb)),fb.exports}var Xku=Zku();const Yku=wt(Xku);class VY extends Error{constructor(e){super(e),this.name="TimeoutError"}}let ebu=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const J$=u=>globalThis.DOMException===void 0?new ebu(u):new DOMException(u),U$=u=>{const e=u.reason===void 0?J$("This operation was aborted."):u.reason;return e instanceof Error?e:J$(e)};function ubu(u,e,a,t){let r;const n=new Promise((i,o)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){i(u);return}if(t={customTimers:{setTimeout,clearTimeout},...t},t.signal){const{signal:s}=t;s.aborted&&o(U$(s)),s.addEventListener("abort",()=>{o(U$(s))})}r=t.customTimers.setTimeout.call(void 0,()=>{const s=`Promise timed out after ${e} milliseconds`,l=a instanceof Error?a:new VY(s);typeof u.cancel=="function"&&u.cancel(),o(l)},e),(async()=>{try{i(await u)}catch(s){o(s)}finally{t.customTimers.clearTimeout.call(void 0,r)}})()});return n.clear=()=>{clearTimeout(r),r=void 0},n}function abu(u,e,a){let t=0,r=u.length;for(;r>0;){const n=Math.trunc(r/2);let i=t+n;a(u[i],e)<=0?(t=++i,r-=n+1):r=n}return t}var Gs=function(u,e,a,t){if(a==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?u!==e||!t:!e.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?t:a==="a"?t.call(u):t?t.value:e.get(u)},Ai;class tbu{constructor(){Ai.set(this,[])}enqueue(e,a){a={priority:0,...a};const t={priority:a.priority,run:e};if(this.size&&Gs(this,Ai,"f")[this.size-1].priority>=a.priority){Gs(this,Ai,"f").push(t);return}const r=abu(Gs(this,Ai,"f"),t,(n,i)=>i.priority-n.priority);Gs(this,Ai,"f").splice(r,0,t)}dequeue(){const e=Gs(this,Ai,"f").shift();return e?.run}filter(e){return Gs(this,Ai,"f").filter(a=>a.priority===e.priority).map(a=>a.run)}get size(){return Gs(this,Ai,"f").length}}Ai=new WeakMap;var ja=function(u,e,a,t,r){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?u!==e||!r:!e.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?r.call(u,a):r?r.value=a:e.set(u,a),a},Qe=function(u,e,a,t){if(a==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?u!==e||!t:!e.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?t:a==="a"?t.call(u):t?t.value:e.get(u)},Ka,Ud,Zd,$o,GD,Xd,Nh,$0,Fd,Nr,Lh,Kr,Yd,Mo,Ih,Z$,X$,GY,Y$,e_,Kh,gb,vb,HD,HY,Vh;class QY extends Error{}class rbu extends Yku{constructor(e){var a,t,r,n;if(super(),Ka.add(this),Ud.set(this,void 0),Zd.set(this,void 0),$o.set(this,0),GD.set(this,void 0),Xd.set(this,void 0),Nh.set(this,0),$0.set(this,void 0),Fd.set(this,void 0),Nr.set(this,void 0),Lh.set(this,void 0),Kr.set(this,0),Yd.set(this,void 0),Mo.set(this,void 0),Ih.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:tbu,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(t=(a=e.intervalCap)===null||a===void 0?void 0:a.toString())!==null&&t!==void 0?t:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(n=(r=e.interval)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.interval})`);ja(this,Ud,e.carryoverConcurrencyCount,"f"),ja(this,Zd,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),ja(this,GD,e.intervalCap,"f"),ja(this,Xd,e.interval,"f"),ja(this,Nr,new e.queueClass,"f"),ja(this,Lh,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,ja(this,Ih,e.throwOnTimeout===!0,"f"),ja(this,Mo,e.autoStart===!1,"f")}get concurrency(){return Qe(this,Yd,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);ja(this,Yd,e,"f"),Qe(this,Ka,"m",HD).call(this)}async add(e,a={}){return a={timeout:this.timeout,throwOnTimeout:Qe(this,Ih,"f"),...a},new Promise((t,r)=>{Qe(this,Nr,"f").enqueue(async()=>{var n,i,o;ja(this,Kr,(i=Qe(this,Kr,"f"),i++,i),"f"),ja(this,$o,(o=Qe(this,$o,"f"),o++,o),"f");try{if(!((n=a.signal)===null||n===void 0)&&n.aborted)throw new QY("The task was aborted.");let s=e({signal:a.signal});a.timeout&&(s=ubu(Promise.resolve(s),a.timeout)),a.signal&&(s=Promise.race([s,Qe(this,Ka,"m",HY).call(this,a.signal)]));const l=await s;t(l),this.emit("completed",l)}catch(s){if(s instanceof VY&&!a.throwOnTimeout){t();return}r(s),this.emit("error",s)}finally{Qe(this,Ka,"m",GY).call(this)}},a),this.emit("add"),Qe(this,Ka,"m",Kh).call(this)})}async addAll(e,a){return Promise.all(e.map(async t=>this.add(t,a)))}start(){return Qe(this,Mo,"f")?(ja(this,Mo,!1,"f"),Qe(this,Ka,"m",HD).call(this),this):this}pause(){ja(this,Mo,!0,"f")}clear(){ja(this,Nr,new(Qe(this,Lh,"f")),"f")}async onEmpty(){Qe(this,Nr,"f").size!==0&&await Qe(this,Ka,"m",Vh).call(this,"empty")}async onSizeLessThan(e){Qe(this,Nr,"f").size<e||await Qe(this,Ka,"m",Vh).call(this,"next",()=>Qe(this,Nr,"f").size<e)}async onIdle(){Qe(this,Kr,"f")===0&&Qe(this,Nr,"f").size===0||await Qe(this,Ka,"m",Vh).call(this,"idle")}get size(){return Qe(this,Nr,"f").size}sizeBy(e){return Qe(this,Nr,"f").filter(e).length}get pending(){return Qe(this,Kr,"f")}get isPaused(){return Qe(this,Mo,"f")}}Ud=new WeakMap,Zd=new WeakMap,$o=new WeakMap,GD=new WeakMap,Xd=new WeakMap,Nh=new WeakMap,$0=new WeakMap,Fd=new WeakMap,Nr=new WeakMap,Lh=new WeakMap,Kr=new WeakMap,Yd=new WeakMap,Mo=new WeakMap,Ih=new WeakMap,Ka=new WeakSet,Z$=function(){return Qe(this,Zd,"f")||Qe(this,$o,"f")<Qe(this,GD,"f")},X$=function(){return Qe(this,Kr,"f")<Qe(this,Yd,"f")},GY=function(){var e;ja(this,Kr,(e=Qe(this,Kr,"f"),e--,e),"f"),Qe(this,Ka,"m",Kh).call(this),this.emit("next")},Y$=function(){Qe(this,Ka,"m",vb).call(this),Qe(this,Ka,"m",gb).call(this),ja(this,Fd,void 0,"f")},e_=function(){const e=Date.now();if(Qe(this,$0,"f")===void 0){const a=Qe(this,Nh,"f")-e;if(a<0)ja(this,$o,Qe(this,Ud,"f")?Qe(this,Kr,"f"):0,"f");else return Qe(this,Fd,"f")===void 0&&ja(this,Fd,setTimeout(()=>{Qe(this,Ka,"m",Y$).call(this)},a),"f"),!0}return!1},Kh=function(){if(Qe(this,Nr,"f").size===0)return Qe(this,$0,"f")&&clearInterval(Qe(this,$0,"f")),ja(this,$0,void 0,"f"),this.emit("empty"),Qe(this,Kr,"f")===0&&this.emit("idle"),!1;if(!Qe(this,Mo,"f")){const e=!Qe(this,Ka,"a",e_);if(Qe(this,Ka,"a",Z$)&&Qe(this,Ka,"a",X$)){const a=Qe(this,Nr,"f").dequeue();return a?(this.emit("active"),a(),e&&Qe(this,Ka,"m",gb).call(this),!0):!1}}return!1},gb=function(){Qe(this,Zd,"f")||Qe(this,$0,"f")!==void 0||(ja(this,$0,setInterval(()=>{Qe(this,Ka,"m",vb).call(this)},Qe(this,Xd,"f")),"f"),ja(this,Nh,Date.now()+Qe(this,Xd,"f"),"f"))},vb=function(){Qe(this,$o,"f")===0&&Qe(this,Kr,"f")===0&&Qe(this,$0,"f")&&(clearInterval(Qe(this,$0,"f")),ja(this,$0,void 0,"f")),ja(this,$o,Qe(this,Ud,"f")?Qe(this,Kr,"f"):0,"f"),Qe(this,Ka,"m",HD).call(this)},HD=function(){for(;Qe(this,Ka,"m",Kh).call(this););},HY=async function(e){return new Promise((a,t)=>{e.addEventListener("abort",()=>{t(new QY("The task was aborted."))},{once:!0})})},Vh=async function(e,a){return new Promise(t=>{const r=()=>{a&&!a()||(this.off(e,r),t())};this.on(e,r)})};const Qi=window.__TAURI__?.http.fetch??globalThis.fetch;class qY extends ng{constructor(){super()}resolveExternalRef(e,a){return _h(a)?a:e&&_h(e)?new URL(a,e).href:e?fl.resolve(fl.dirname(e),a):a}async loadExternalRef(e){if(_h(e)){const{body:a,mimeType:t}=await FK(e,{...this.config.http,customFetch:Qi});return new kc(e,a,t)}else{if(!await hJ(e))throw new Error(`File not found at ${e}.`);try{throw await xJ(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 qA(e);return new kc(e,t.replace(/\r\n/g,`
449
- `))}}}async function XF(u,e){const a=new Uf({});a.getRulesForSpecVersion=()=>[];const t=await ca.dirname(u),r={config:a,base:t,externalRefResolver:new qY,dereference:!0};e?r.doc={source:{absoluteRef:u},parsed:e}:r.ref=u;const{bundle:{parsed:n}}=await fQ(r);return n}class nbu{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new rbu({concurrency:20});async get(e){return this.data.has(e)?this.data.get(e):(await this.loadAndParse(e),this.data.get(e))}async load(e){this.data.has(e)||await this.loadAndParse(e)}async loadAndParse(e){if(this.loading.has(e))return await this.pQueue.add(()=>this.get(e));this.loading.add(e),await this.pQueue.add(async()=>{const a=_g(e)?or.WEB:or.FS,t=a===or.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const r=await XF(t);if(!r){this.data.set(e,void 0);return}const n=this.apisStorage.parse({uri:e,type:a,content:r});this.data.set(e,n)}catch(r){console.error("Error loading api "+e,r),this.data.set(e,void 0);return}}),this.loading.delete(e)}get size(){return this.data.size}delete(e){this.data.delete(e)}getAll(){return Array.from(this.data.values()).filter(e=>e!==void 0)}clear(){this.data.clear(),this.loading.clear()}}class ibu extends KY{apiLoader;constructor(e,a,t){const r=new Kj(e.systemFilesDir),n=new Kj(e.userFilesDir);super(r,n,e,!0,a,t),this.apiLoader=new nbu(this.apisStorage)}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(exports.SpanStatusCode.OK),a?.end();const{apiFiles:o,collectionFiles:s}=await this.detectProjectFiles(e);await this.loadAndParseApis(o,e);const l=await this.loadAndParseCollections(s,e);this.collectionsStorage.setItemIds(l.map(d=>d.id));const c=this.apiLoader.getAll();return this.apisStorage.setItemIds(c.map(d=>d.id)),this.apiLoader.clear(),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:t,activeEnvironmentId:r,tabsState:n,environments:i,apis:c,collections:l}}async detectProjectFiles(e){const a=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{api_files:t,collection_files:r}=await Pt("fs_scan",{dir:this.project.userFilesDir});return a?.setAttribute("status","completed"),a?.setAttribute("filesCount",t.length+r.length),a?.setAttribute("apiFilesCount",t.length),a?.setAttribute("collectionFilesCount",r.length),a?.setStatus(exports.SpanStatusCode.OK),a?.end(),{apiFiles:t,collectionFiles:r}}async loadAndParseApis(e,a){const t=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},a?.parentCtx);await Nj(e,20,async r=>{try{await this.apiLoader.load(r.relative_path)}catch(n){return console.error(`Error parsing YAML/JSON file ${r.absolute_path}:`,n),null}}),t?.setAttribute("status","completed"),t?.setAttribute("parsedApisCount",this.apiLoader.size),t?.setStatus(exports.SpanStatusCode.OK),t?.end()}async loadAndParseCollections(e,a){const t=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},a?.parentCtx),r=await Nj(e,20,async n=>{try{const i=await this.userFilesStorage.get(n.relative_path);if(!i)return null;const o=Ji.load(i??"");if(typeof o!="object"||o===null||typeof o.arazzo!="string")return null;const s=[];return await Promise.all(o.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=await MY({projectPath:this.project.userFilesDir,apiUrl:d,collectionId:n.relative_path});if(E){const h=await this.apiLoader.get(p);h&&s.push(h)}})),await this.collectionsStorage.parse({uri:n.relative_path,type:or.FS,content:o},s)}catch(i){return console.error(`Error parsing Arazzo file ${n.relative_path}:`,i),null}});return t?.setAttribute("status","completed"),t?.setAttribute("parsedCollectionsCount",r.length),t?.setStatus(exports.SpanStatusCode.OK),t?.end(),r.filter(n=>n!==null)}}class u_{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 obu extends KY{constructor(e,a,t){const r=new u_(e.systemFilesDir),n=new u_(e.userFilesDir);super(r,n,e,!1,a,t)}async detectProjectFiles(e){const a=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),r=(await this.userFilesStorage.ls()).filter(s=>/\.(ya?ml|json)$/.test(s)),n=[],i=[],o=new Set;return await Promise.all(r.map(async s=>{const l=await this.userFilesStorage.get(s);if(l)try{const c=Ji.load(l);if(typeof c=="object"&&c!==null)if(typeof c.openapi=="string"){const d=await ca.resolve(await ca.join(this.userFilesStorage.baseDir,s)),E=await XF(d,c);n.push({uri:s,type:or.FS,content:E})}else typeof c.arazzo=="string"&&(i.push({uri:s,type:or.FS,content:c}),c.sourceDescriptions?.forEach(d=>{const E=d.type,p=d.url,h=!E||E==="openapi",x=typeof p=="string"&&_g(p);h&&x&&o.add(p)}))}catch(c){console.error(`Error parsing YAML/JSON file ${s}:`,c)}})),a?.setAttribute("status","completed"),a?.setAttribute("filesCount",r.length),a?.setAttribute("apiFilesCount",n.length),a?.setAttribute("collectionFilesCount",i.length),a?.setAttribute("apiUrlsCount",o.size),a?.setStatus(exports.SpanStatusCode.OK),a?.end(),{apiFiles:n,collectionFiles:i,apiUrls:o}}async loadApis(e,a){const t=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:e.size},a?.parentCtx),r=[];return await Promise.all(Array.from(e).map(async n=>{try{const i=await XF(n);r.push({uri:n,type:or.WEB,content:i})}catch(i){console.error(`Error parsing YAML from ${n}:`,i)}})),t?.setAttribute("status","completed"),t?.setStatus(exports.SpanStatusCode.OK),t?.end(),r}async parseApis(e,a){const t=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},a?.parentCtx),r=await this.apisStorage.parseMany(e);return t?.setAttribute("status","completed"),t?.setAttribute("parsedApisCount",r.length),t?.setStatus(exports.SpanStatusCode.OK),t?.end(),r}async parseCollections(e,a,t){const r=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},t?.parentCtx),n=await this.collectionsStorage.parseMany(e,a);return r?.setAttribute("status","completed"),r?.setAttribute("parsedCollectionsCount",n.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end(),n}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(exports.SpanStatusCode.OK),a?.end();const{apiFiles:o,collectionFiles:s,apiUrls:l}=await this.detectProjectFiles(e),c=await this.loadApis(l,e),d=await this.parseApis([...o,...c],e);this.apisStorage.setItemIds(d.map(p=>p.id));const E=await this.parseCollections(s,d,e);return this.collectionsStorage.setItemIds(E.map(p=>p.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:t,activeEnvironmentId:r,tabsState:n,environments:i,apis:d,collections:E}}}function WY(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=Rl()?new ibu(r,n,i):new obu(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 JY({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:Ii(EJ),activeEnvironmentId:F3,environments:u||dJ,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:fn.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const sbu=dK(JY(),EK(cEu({key:"replay-root-store"}),WY())),Y9=P.createContext(sbu),lbu=Y9.Provider;function yu(){const u=P.useContext(Y9);return pK(u)}function cbu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const dbu=cbu(),Ebu=P.createContext(dbu);function Jn(){const u=P.useContext(Ebu);return pK(u)}function pbu(u,e){const{apps:{apiId:a}}=yu(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=Jn();t.set(u?.corsProxyUrl??qdu),n.set(u?.mockServer),a.set(u?.apiId),i.set(u?.oAuth2RedirectURI),r.set(!!u?.disableCollectionsTab),s.set(u?.storageKey),l.set(!!e),P.useEffect(()=>{o.set(u?.certificates||[])},[u?.certificates])}const Ng=P.createContext({});function Kl(){return P.useContext(Ng)||{}}const mbu="0.19.0",xbu={version:mbu};class UY{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new Qdu}get isInitialized(){return this._isInitialized}get client(){return this._client}awaitInit(){return this._initPromise}updateCloudEventData(e){this._client.updateCloudEventData(e)}enrichGlobalAttributes(e){this._globalAttributes={...this._globalAttributes,...e}}getGlobalAttributes(){return{...this._globalAttributes}}clearGlobalAttributes(){this._globalAttributes={platform:"",deviceId:""}}init(e){if(this.isInitialized)return;const a=!0,t=e?.tracerName||"desktop",r=e?.enableErrorInstrumentation??t==="desktop",n={serviceName:"replay",serviceVersion:xbu.version,version:"1.0.0",tracerName:t,collectorUrl:"",isProd:a,enableErrorInstrumentation:r};this._client.init({otel:{...n,...e}}),this._initResolve?.(this),this._isInitialized=!0}sendEvent(e,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}const t={...this._globalAttributes,...a};try{this.client.send(e,t)}catch(r){console.error("Failed to send telemetry event:",r)}}startSpan(e,a,t){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this._client.startSpan(e,{...this._globalAttributes,...a},t)}catch(r){console.error("Failed to start telemetry span:",r);return}}}const U1=new UY;function du(){const{telemetry:u}=Kl();return U1.isInitialized||U1.init(u),{sendEvent:(e,a)=>{U1.sendEvent(e,a)},startSpan:(e,a,t)=>U1.startSpan(e,a,t)}}const hbu=({awaitInit:u=!0}={})=>{const[e,a]=P.useState(void 0);return P.useEffect(()=>{(async()=>{const r=u?await U1.awaitInit():U1;a(r)})()},[u]),e},Qt=800;function Sl(u){"@babel/helpers - typeof";return Sl=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},Sl(u)}function Dbu(u,e){if(Sl(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Sl(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function ZY(u){var e=Dbu(u,"string");return Sl(e)=="symbol"?e:e+""}function Ad(u,e,a){return(e=ZY(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function a_(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 eu(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?a_(Object(a),!0).forEach(function(t){Ad(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):a_(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function fbu(u){if(Array.isArray(u))return u}function gbu(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 YF(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 XY(u,e){if(u){if(typeof u=="string")return YF(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)?YF(u,e):void 0}}function vbu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
449
+ `))}}}async function XF(u,e){const a=new Uf({});a.getRulesForSpecVersion=()=>[];const t=await ca.dirname(u),r={config:a,base:t,externalRefResolver:new qY,dereference:!0};e?r.doc={source:{absoluteRef:u},parsed:e}:r.ref=u;const{bundle:{parsed:n}}=await fQ(r);return n}class nbu{constructor(e){this.apisStorage=e}data=new Map;loading=new Set;pQueue=new rbu({concurrency:20});async get(e){return this.data.has(e)?this.data.get(e):(await this.loadAndParse(e),this.data.get(e))}async load(e){this.data.has(e)||await this.loadAndParse(e)}async loadAndParse(e){if(this.loading.has(e))return await this.pQueue.add(()=>this.get(e));this.loading.add(e),await this.pQueue.add(async()=>{const a=_g(e)?or.WEB:or.FS,t=a===or.WEB?e:await this.apisStorage.getAbsolutePath(e);try{const r=await XF(t);if(!r){this.data.set(e,void 0);return}const n=this.apisStorage.parse({uri:e,type:a,content:r});this.data.set(e,n)}catch(r){console.error("Error loading api "+e,r),this.data.set(e,void 0);return}}),this.loading.delete(e)}get size(){return this.data.size}delete(e){this.data.delete(e)}getAll(){return Array.from(this.data.values()).filter(e=>e!==void 0)}clear(){this.data.clear(),this.loading.clear()}}class ibu extends KY{apiLoader;constructor(e,a,t){const r=new Kj(e.systemFilesDir),n=new Kj(e.userFilesDir);super(r,n,e,!0,a,t),this.apiLoader=new nbu(this.apisStorage)}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(exports.SpanStatusCode.OK),a?.end();const{apiFiles:o,collectionFiles:s}=await this.detectProjectFiles(e);await this.loadAndParseApis(o,e);const l=await this.loadAndParseCollections(s,e);this.collectionsStorage.setItemIds(l.map(d=>d.id));const c=this.apiLoader.getAll();return this.apisStorage.setItemIds(c.map(d=>d.id)),this.apiLoader.clear(),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:t,activeEnvironmentId:r,tabsState:n,environments:i,apis:c,collections:l}}async detectProjectFiles(e){const a=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),{api_files:t,collection_files:r}=await Pt("fs_scan",{dir:this.project.userFilesDir});return a?.setAttribute("status","completed"),a?.setAttribute("filesCount",t.length+r.length),a?.setAttribute("apiFilesCount",t.length),a?.setAttribute("collectionFilesCount",r.length),a?.setStatus(exports.SpanStatusCode.OK),a?.end(),{apiFiles:t,collectionFiles:r}}async loadAndParseApis(e,a){const t=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},a?.parentCtx);await Nj(e,20,async r=>{try{await this.apiLoader.load(r.relative_path)}catch(n){return console.error(`Error parsing YAML/JSON file ${r.absolute_path}:`,n),null}}),t?.setAttribute("status","completed"),t?.setAttribute("parsedApisCount",this.apiLoader.size),t?.setStatus(exports.SpanStatusCode.OK),t?.end()}async loadAndParseCollections(e,a){const t=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},a?.parentCtx),r=await Nj(e,20,async n=>{try{const i=await this.userFilesStorage.get(n.relative_path);if(!i)return null;const o=Ji.load(i??"");if(typeof o!="object"||o===null||typeof o.arazzo!="string")return null;const s=[];return await Promise.all(o.sourceDescriptions?.map(async l=>{const c=l.type,d=l.url,E=!c||c==="openapi",p=await MY({projectPath:this.project.userFilesDir,apiUrl:d,collectionId:n.relative_path});if(E){const h=await this.apiLoader.get(p);h&&s.push(h)}})),await this.collectionsStorage.parse({uri:n.relative_path,type:or.FS,content:o},s)}catch(i){return console.error(`Error parsing Arazzo file ${n.relative_path}:`,i),null}});return t?.setAttribute("status","completed"),t?.setAttribute("parsedCollectionsCount",r.length),t?.setStatus(exports.SpanStatusCode.OK),t?.end(),r.filter(n=>n!==null)}}class u_{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 obu extends KY{constructor(e,a,t){const r=new u_(e.systemFilesDir),n=new u_(e.userFilesDir);super(r,n,e,!1,a,t)}async detectProjectFiles(e){const a=this.telemetry?.startSpan("storage.detectFiles",{},e?.parentCtx),r=(await this.userFilesStorage.ls()).filter(s=>/\.(ya?ml|json)$/.test(s)),n=[],i=[],o=new Set;return await Promise.all(r.map(async s=>{const l=await this.userFilesStorage.get(s);if(l)try{const c=Ji.load(l);if(typeof c=="object"&&c!==null)if(typeof c.openapi=="string"){const d=await ca.resolve(await ca.join(this.userFilesStorage.baseDir,s)),E=await XF(d,c);n.push({uri:s,type:or.FS,content:E})}else typeof c.arazzo=="string"&&(i.push({uri:s,type:or.FS,content:c}),c.sourceDescriptions?.forEach(d=>{const E=d.type,p=d.url,h=!E||E==="openapi",x=typeof p=="string"&&_g(p);h&&x&&o.add(p)}))}catch(c){console.error(`Error parsing YAML/JSON file ${s}:`,c)}})),a?.setAttribute("status","completed"),a?.setAttribute("filesCount",r.length),a?.setAttribute("apiFilesCount",n.length),a?.setAttribute("collectionFilesCount",i.length),a?.setAttribute("apiUrlsCount",o.size),a?.setStatus(exports.SpanStatusCode.OK),a?.end(),{apiFiles:n,collectionFiles:i,apiUrls:o}}async loadApis(e,a){const t=this.telemetry?.startSpan("storage.loadApis",{apiUrlsCount:e.size},a?.parentCtx),r=[];return await Promise.all(Array.from(e).map(async n=>{try{const i=await XF(n);r.push({uri:n,type:or.WEB,content:i})}catch(i){console.error(`Error parsing YAML from ${n}:`,i)}})),t?.setAttribute("status","completed"),t?.setStatus(exports.SpanStatusCode.OK),t?.end(),r}async parseApis(e,a){const t=this.telemetry?.startSpan("storage.parseApis",{apisCount:e.length},a?.parentCtx),r=await this.apisStorage.parseMany(e);return t?.setAttribute("status","completed"),t?.setAttribute("parsedApisCount",r.length),t?.setStatus(exports.SpanStatusCode.OK),t?.end(),r}async parseCollections(e,a,t){const r=this.telemetry?.startSpan("storage.parseCollections",{collectionsCount:e.length},t?.parentCtx),n=await this.collectionsStorage.parseMany(e,a);return r?.setAttribute("status","completed"),r?.setAttribute("parsedCollectionsCount",n.length),r?.setStatus(exports.SpanStatusCode.OK),r?.end(),n}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(exports.SpanStatusCode.OK),a?.end();const{apiFiles:o,collectionFiles:s,apiUrls:l}=await this.detectProjectFiles(e),c=await this.loadApis(l,e),d=await this.parseApis([...o,...c],e);this.apisStorage.setItemIds(d.map(p=>p.id));const E=await this.parseCollections(s,d,e);return this.collectionsStorage.setItemIds(E.map(p=>p.id)),e?.setAttribute("status","completed"),e?.setStatus(exports.SpanStatusCode.OK),e?.end(),{project:this.project,history:t,activeEnvironmentId:r,tabsState:n,environments:i,apis:d,collections:E}}}function WY(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=Rl()?new ibu(r,n,i):new obu(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 JY({defaultEnvironments:u}={}){return structuredClone({project:{id:"default",userFilesDir:"default",systemFilesDir:"default"},history:[],tabsState:Ii(EJ),activeEnvironmentId:F3,environments:u||dJ,collections:[],apis:[],requestController:null,apps:{apps:[],appsLoadingState:fn.Idle},predefinedApiId:null,predefinedEnvironmentNames:new Set,predefinedInputNames:new Set})}const sbu=dK(JY(),EK(cEu({key:"replay-root-store"}),WY())),Y9=P.createContext(sbu),lbu=Y9.Provider;function yu(){const u=P.useContext(Y9);return pK(u)}function cbu(){return{theme:"light",disableCollectionsTab:!1,oAuth2RedirectURI:null,corsProxyUrl:void 0,mockServer:void 0,certificates:[],isApiBased:!1,generatedEnvironments:[],generatedInputs:[],hideOtherSecuritySchemes:!1}}const dbu=cbu(),Ebu=P.createContext(dbu);function Jn(){const u=P.useContext(Ebu);return pK(u)}function pbu(u,e){const{apps:{apiId:a}}=yu(),{corsProxyUrl:t,disableCollectionsTab:r,mockServer:n,oAuth2RedirectURI:i,certificates:o,storageKey:s,isApiBased:l}=Jn();t.set(u?.corsProxyUrl??qdu),n.set(u?.mockServer),a.set(u?.apiId),i.set(u?.oAuth2RedirectURI),r.set(!!u?.disableCollectionsTab),s.set(u?.storageKey),l.set(!!e),P.useEffect(()=>{o.set(u?.certificates||[])},[u?.certificates])}const Ng=P.createContext({});function Kl(){return P.useContext(Ng)||{}}const mbu="0.0.0-20251222115527",xbu={version:mbu};class UY{_client;_isInitialized=!1;_initResolve=null;_initPromise=new Promise(e=>{this._initResolve=e});_globalAttributes={platform:"",deviceId:""};constructor(){this._client=new Qdu}get isInitialized(){return this._isInitialized}get client(){return this._client}awaitInit(){return this._initPromise}updateCloudEventData(e){this._client.updateCloudEventData(e)}enrichGlobalAttributes(e){this._globalAttributes={...this._globalAttributes,...e}}getGlobalAttributes(){return{...this._globalAttributes}}clearGlobalAttributes(){this._globalAttributes={platform:"",deviceId:""}}init(e){if(this.isInitialized)return;const a=!0,t=e?.tracerName||"desktop",r=e?.enableErrorInstrumentation??t==="desktop",n={serviceName:"replay",serviceVersion:xbu.version,version:"1.0.0",tracerName:t,collectorUrl:"",isProd:a,enableErrorInstrumentation:r};this._client.init({otel:{...n,...e}}),this._initResolve?.(this),this._isInitialized=!0}sendEvent(e,a){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}const t={...this._globalAttributes,...a};try{this.client.send(e,t)}catch(r){console.error("Failed to send telemetry event:",r)}}startSpan(e,a,t){if(!this.isInitialized){console.warn("Telemetry client not initialized. Call init() first.");return}try{return this._client.startSpan(e,{...this._globalAttributes,...a},t)}catch(r){console.error("Failed to start telemetry span:",r);return}}}const U1=new UY;function du(){const{telemetry:u}=Kl();return U1.isInitialized||U1.init(u),{sendEvent:(e,a)=>{U1.sendEvent(e,a)},startSpan:(e,a,t)=>U1.startSpan(e,a,t)}}const hbu=({awaitInit:u=!0}={})=>{const[e,a]=P.useState(void 0);return P.useEffect(()=>{(async()=>{const r=u?await U1.awaitInit():U1;a(r)})()},[u]),e},Qt=800;function Sl(u){"@babel/helpers - typeof";return Sl=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},Sl(u)}function Dbu(u,e){if(Sl(u)!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var t=a.call(u,e);if(Sl(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function ZY(u){var e=Dbu(u,"string");return Sl(e)=="symbol"?e:e+""}function Ad(u,e,a){return(e=ZY(e))in u?Object.defineProperty(u,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[e]=a,u}function a_(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 eu(u){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?a_(Object(a),!0).forEach(function(t){Ad(u,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):a_(Object(a)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(a,t))})}return u}function fbu(u){if(Array.isArray(u))return u}function gbu(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 YF(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 XY(u,e){if(u){if(typeof u=="string")return YF(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)?YF(u,e):void 0}}function vbu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
450
450
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qi(u,e){return fbu(u)||gbu(u,e)||XY(u,e)||vbu()}function kbu(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 io(u,e){if(u==null)return{};var a,t,r=kbu(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 bbu=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function ybu(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=io(u,bbu),x=P.useState(o!==void 0?o:a),f=qi(x,2),D=f[0],g=f[1],v=P.useState(s!==void 0?s:r),y=qi(v,2),k=y[0],b=y[1],C=P.useState(p!==void 0?p:i),B=qi(C,2),O=B[0],T=B[1],M=P.useCallback(function(te,me){typeof l=="function"&&l(te,me),T(te)},[l]),R=P.useCallback(function(te,me){var I;typeof c=="function"&&(I=c(te,me)),g(I!==void 0?I:te)},[c]),K=P.useCallback(function(){typeof E=="function"&&E(),b(!0)},[E]),q=P.useCallback(function(){typeof d=="function"&&d(),b(!1)},[d]),W=o!==void 0?o:D,Y=s!==void 0?s:k,ie=p!==void 0?p:O;return eu(eu({},h),{},{inputValue:W,menuIsOpen:Y,onChange:M,onInputChange:R,onMenuClose:q,onMenuOpen:K,value:ie})}function nu(){return nu=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},nu.apply(null,arguments)}function Cbu(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function t_(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,ZY(t.key),t)}}function Fbu(u,e,a){return e&&t_(u.prototype,e),a&&t_(u,a),Object.defineProperty(u,"prototype",{writable:!1}),u}function e2(u,e){return e2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,t){return a.__proto__=t,a},e2(u,e)}function Abu(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&&e2(u,e)}function QD(u){return QD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},QD(u)}function YY(){try{var u=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YY=function(){return!!u})()}function Bbu(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Obu(u,e){if(e&&(Sl(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bbu(u)}function Sbu(u){var e=YY();return function(){var a,t=QD(u);if(e){var r=QD(this).constructor;a=Reflect.construct(t,arguments,r)}else a=t.apply(this,arguments);return Obu(this,a)}}function zbu(u){if(Array.isArray(u))return YF(u)}function wbu(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function Pbu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
451
451
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eB(u){return zbu(u)||wbu(u)||XY(u)||Pbu()}function jbu(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 Mbu(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 Tbu=(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(Mbu(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:
452
452
  `+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=jbu(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})(),$t="-ms-",qD="-moz-",Wu="-webkit-",uB="comm",aB="rule",tB="decl",Rbu="@import",eee="@keyframes",$bu=Math.abs,Lg=String.fromCharCode,_bu=Object.assign;function Nbu(u,e){return Ft(u,0)^45?(((e<<2^Ft(u,0))<<2^Ft(u,1))<<2^Ft(u,2))<<2^Ft(u,3):0}function uee(u){return u.trim()}function Lbu(u,e){return(u=e.exec(u))?u[0]:u}function ua(u,e,a){return u.replace(e,a)}function u2(u,e){return u.indexOf(e)}function Ft(u,e){return u.charCodeAt(e)|0}function JE(u,e,a){return u.slice(e,a)}function yn(u){return u.length}function rB(u){return u.length}function _x(u,e){return e.push(u),u}function Ibu(u,e){return u.map(e).join("")}var Ig=1,Vc=1,aee=0,Ar=0,Ja=0,E4="";function Kg(u,e,a,t,r,n,i){return{value:u,root:e,parent:a,type:t,props:r,children:n,line:Ig,column:Vc,length:i,return:""}}function rd(u,e){return _bu(Kg("",null,null,"",null,null,0),u,{length:-u.length},e)}function Kbu(){return Ja}function Vbu(){return Ja=Ar>0?Ft(E4,--Ar):0,Vc--,Ja===10&&(Vc=1,Ig--),Ja}function Ur(){return Ja=Ar<aee?Ft(E4,Ar++):0,Vc++,Ja===10&&(Vc=1,Ig++),Ja}function _n(){return Ft(E4,Ar)}function Gh(){return Ar}function N3(u,e){return JE(E4,u,e)}function UE(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 tee(u){return Ig=Vc=1,aee=yn(E4=u),Ar=0,[]}function ree(u){return E4="",u}function Hh(u){return uee(N3(Ar-1,a2(u===91?u+2:u===40?u+1:u)))}function Gbu(u){for(;(Ja=_n())&&Ja<33;)Ur();return UE(u)>2||UE(Ja)>3?"":" "}function Hbu(u,e){for(;--e&&Ur()&&!(Ja<48||Ja>102||Ja>57&&Ja<65||Ja>70&&Ja<97););return N3(u,Gh()+(e<6&&_n()==32&&Ur()==32))}function a2(u){for(;Ur();)switch(Ja){case u:return Ar;case 34:case 39:u!==34&&u!==39&&a2(Ja);break;case 40:u===41&&a2(u);break;case 92:Ur();break}return Ar}function Qbu(u,e){for(;Ur()&&u+Ja!==57;)if(u+Ja===84&&_n()===47)break;return"/*"+N3(e,Ar-1)+"*"+Lg(u===47?u:Ur())}function qbu(u){for(;!UE(_n());)Ur();return N3(u,Ar)}function Wbu(u){return ree(Qh("",null,null,null,[""],u=tee(u),0,[0],u))}function Qh(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,v="",y=r,k=n,b=t,C=v;f;)switch(h=g,g=Ur()){case 40:if(h!=108&&Ft(C,d-1)==58){u2(C+=ua(Hh(g),"&","&\f"),"&\f")!=-1&&(D=-1);break}case 34:case 39:case 91:C+=Hh(g);break;case 9:case 10:case 13:case 32:C+=Gbu(h);break;case 92:C+=Hbu(Gh()-1,7);continue;case 47:switch(_n()){case 42:case 47:_x(Jbu(Qbu(Ur(),Gh()),e,a),s);break;default:C+="/"}break;case 123*x:o[l++]=yn(C)*D;case 125*x:case 59:case 0:switch(g){case 0:case 125:f=0;case 59+c:p>0&&yn(C)-d&&_x(p>32?n_(C+";",t,a,d-1):n_(ua(C," ","")+";",t,a,d-2),s);break;case 59:C+=";";default:if(_x(b=r_(C,e,a,l,c,r,o,v,y=[],k=[],d),n),g===123)if(c===0)Qh(C,e,b,b,y,n,d,o,k);else switch(E===99&&Ft(C,3)===110?100:E){case 100:case 109:case 115:Qh(u,b,b,t&&_x(r_(u,b,b,0,0,r,o,v,r,y=[],d),k),r,k,d,o,t?y:k);break;default:Qh(C,b,b,b,[""],k,0,o,k)}}l=c=p=0,x=D=1,v=C="",d=i;break;case 58:d=1+yn(C),p=h;default:if(x<1){if(g==123)--x;else if(g==125&&x++==0&&Vbu()==125)continue}switch(C+=Lg(g),g*x){case 38:D=c>0?1:(C+="\f",-1);break;case 44:o[l++]=(yn(C)-1)*D,D=1;break;case 64:_n()===45&&(C+=Hh(Ur())),E=_n(),c=d=yn(v=C+=qbu(Gh())),g++;break;case 45:h===45&&yn(C)==2&&(x=0)}}return n}function r_(u,e,a,t,r,n,i,o,s,l,c){for(var d=r-1,E=r===0?n:[""],p=rB(E),h=0,x=0,f=0;h<t;++h)for(var D=0,g=JE(u,d+1,d=$bu(x=i[h])),v=u;D<p;++D)(v=uee(x>0?E[D]+" "+g:ua(g,/&\f/g,E[D])))&&(s[f++]=v);return Kg(u,e,a,r===0?aB:o,s,l,c)}function Jbu(u,e,a){return Kg(u,e,a,uB,Lg(Kbu()),JE(u,2,-2),0)}function n_(u,e,a,t){return Kg(u,e,a,tB,JE(u,0,t),JE(u,t+1,-1),t)}function cc(u,e){for(var a="",t=rB(u),r=0;r<t;r++)a+=e(u[r],r,u,e)||"";return a}function Ubu(u,e,a,t){switch(u.type){case Rbu:case tB:return u.return=u.return||u.value;case uB:return"";case eee:return u.return=u.value+"{"+cc(u.children,t)+"}";case aB:u.value=u.props.join(",")}return yn(a=cc(u.children,t))?u.return=u.value+"{"+a+"}":""}function Zbu(u){var e=rB(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 Xbu(u){return function(e){e.root||(e=e.return)&&u(e)}}function Ybu(u){var e=Object.create(null);return function(a){return e[a]===void 0&&(e[a]=u(a)),e[a]}}var eyu=function(e,a,t){for(var r=0,n=0;r=n,n=_n(),r===38&&n===12&&(a[t]=1),!UE(n);)Ur();return N3(e,Ar)},uyu=function(e,a){var t=-1,r=44;do switch(UE(r)){case 0:r===38&&_n()===12&&(a[t]=1),e[t]+=eyu(Ar-1,a,t);break;case 2:e[t]+=Hh(r);break;case 4:if(r===44){e[++t]=_n()===58?"&\f":"",a[t]=e[t].length;break}default:e[t]+=Lg(r)}while(r=Ur());return e},ayu=function(e,a){return ree(uyu(tee(e),a))},i_=new WeakMap,tyu=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&&!i_.get(t))&&!r){i_.set(e,!0);for(var n=[],i=ayu(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]}}},ryu=function(e){if(e.type==="decl"){var a=e.value;a.charCodeAt(0)===108&&a.charCodeAt(2)===98&&(e.return="",e.value="")}},nyu="emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason",iyu=function(e){return e.type==="comm"&&e.children.indexOf(nyu)>-1},oyu=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(iyu(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".')})}}}},nee=function(e){return e.type.charCodeAt(1)===105&&e.type.charCodeAt(0)===64},syu=function(e,a){for(var t=e-1;t>=0;t--)if(!nee(a[t]))return!0;return!1},o_=function(e){e.type="",e.value="",e.return="",e.children="",e.props=""},lyu=function(e,a,t){nee(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."),o_(e)):syu(a,t)&&(console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."),o_(e)))};function iee(u,e){switch(Nbu(u,e)){case 5103:return Wu+"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 Wu+u+u;case 5349:case 4246:case 4810:case 6968:case 2756:return Wu+u+qD+u+$t+u+u;case 6828:case 4268:return Wu+u+$t+u+u;case 6165:return Wu+u+$t+"flex-"+u+u;case 5187:return Wu+u+ua(u,/(\w+).+(:[^]+)/,Wu+"box-$1$2"+$t+"flex-$1$2")+u;case 5443:return Wu+u+$t+"flex-item-"+ua(u,/flex-|-self/,"")+u;case 4675:return Wu+u+$t+"flex-line-pack"+ua(u,/align-content|flex-|-self/,"")+u;case 5548:return Wu+u+$t+ua(u,"shrink","negative")+u;case 5292:return Wu+u+$t+ua(u,"basis","preferred-size")+u;case 6060:return Wu+"box-"+ua(u,"-grow","")+Wu+u+$t+ua(u,"grow","positive")+u;case 4554:return Wu+ua(u,/([^-])(transform)/g,"$1"+Wu+"$2")+u;case 6187:return ua(ua(ua(u,/(zoom-|grab)/,Wu+"$1"),/(image-set)/,Wu+"$1"),u,"")+u;case 5495:case 3959:return ua(u,/(image-set\([^]*)/,Wu+"$1$`$1");case 4968:return ua(ua(u,/(.+:)(flex-)?(.*)/,Wu+"box-pack:$3"+$t+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Wu+u+u;case 4095:case 3583:case 4068:case 2532:return ua(u,/(.+)-inline(.+)/,Wu+"$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(yn(u)-1-e>6)switch(Ft(u,e+1)){case 109:if(Ft(u,e+4)!==45)break;case 102:return ua(u,/(.+:)(.+)-([^]+)/,"$1"+Wu+"$2-$3$1"+qD+(Ft(u,e+3)==108?"$3":"$2-$3"))+u;case 115:return~u2(u,"stretch")?iee(ua(u,"stretch","fill-available"),e)+u:u}break;case 4949:if(Ft(u,e+1)!==115)break;case 6444:switch(Ft(u,yn(u)-3-(~u2(u,"!important")&&10))){case 107:return ua(u,":",":"+Wu)+u;case 101:return ua(u,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Wu+(Ft(u,14)===45?"inline-":"")+"box$3$1"+Wu+"$2$3$1"+$t+"$2box$3")+u}break;case 5936:switch(Ft(u,e+11)){case 114:return Wu+u+$t+ua(u,/[svh]\w+-[tblr]{2}/,"tb")+u;case 108:return Wu+u+$t+ua(u,/[svh]\w+-[tblr]{2}/,"tb-rl")+u;case 45:return Wu+u+$t+ua(u,/[svh]\w+-[tblr]{2}/,"lr")+u}return Wu+u+$t+u+u}return u}var cyu=function(e,a,t,r){if(e.length>-1&&!e.return)switch(e.type){case tB:e.return=iee(e.value,e.length);break;case eee:return cc([rd(e,{value:ua(e.value,"@","@"+Wu)})],r);case aB:if(e.length)return Ibu(e.props,function(n){switch(Lbu(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return cc([rd(e,{props:[ua(n,/:(read-\w+)/,":"+qD+"$1")]})],r);case"::placeholder":return cc([rd(e,{props:[ua(n,/:(plac\w+)/,":"+Wu+"input-$1")]}),rd(e,{props:[ua(n,/:(plac\w+)/,":"+qD+"$1")]}),rd(e,{props:[ua(n,/:(plac\w+)/,$t+"input-$1")]})],r)}return""})}},dyu=[cyu],Eyu=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.
@@ -2328,7 +2328,7 @@ Please report this to https://github.com/markedjs/marked.`,u){const r="<p>An err
2328
2328
  gap: var(--spacing-xs);
2329
2329
  `,d5={[It.SIMPLE]:{label:"Simple",tooltipContent:"Success criteria conditions in the form of basic literals, operators, and loose comparisons"},[It.REGEX]:{label:"Regex",tooltipContent:"Regex patterns used as success criteria conditions"},[It.JSONPATH]:{label:"JSONPath",tooltipContent:"JSONPath expressions as success criteria conditions"},[It.XPATH]:{label:"XPath",tooltipContent:"XPath expressions as success criteria conditions"}},TNu=Object.keys(d5);function RNu({successCriteria:u}){const{sendEvent:e}=du(),a=n=>{e("button.click",{source:"workflow",action:"add_success_criteria",success_criteria_type:n}),u.set(i=>[...i||[],{...Jvu(n)}])},t=P.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(Eu)};return m.jsxs(m.Fragment,{children:[m.jsxs(ls,{children:["Success criteria",m.jsx(V0,{content:"List of conditions required to complete the step."})]}),t.map(n=>m.jsx(P.Fragment,{children:m.jsx(zNu,{successCriteria:n,label:d5[n.get().type].label,tooltipContent:d5[n.get().type].tooltipContent,additionalActions:m.jsx(dr,{"data-testid":"remove-success-criteria-button",variant:"text",icon:m.jsx(Q.TrashCanIcon,{}),onClick:()=>r(n)})})},n.get().id)),m.jsx($Nu,{renderInput:()=>m.jsx(Q.Button,{variant:"outlined",icon:m.jsx(Q.AddIcon,{}),iconPosition:"left",size:"small",children:"Add success criteria"}),dataTestId:"workflow-step-success-criteria-select",options:TNu.map(n=>({element:d5[n].label,label:n,value:n})),onChange:n=>{a(n)},placement:"top",hideCheckmarkIcon:!0})]})}const $Nu=j(Q.Select)`
2330
2330
  border-radius: var(--border-radius-md);
2331
- `;function _Nu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=Il(),r=u.stepId.get();return m.jsx(m.Fragment,{children:m.jsxs(vre,{children:[m.jsx(ls,{children:"Info"}),m.jsxs(Gu,{children:[m.jsxs(Gu.Row,{children:[m.jsx(Gu.Cell,{children:m.jsxs(ml,{children:["Step ID",m.jsx(V0,{content:"This step's unique identifier"})]})}),m.jsx(Gu.Cell,{$readonly:!0,children:m.jsx(z2,{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(Gu.Row,{children:[m.jsx(Gu.Cell,{children:m.jsxs(ml,{children:["Description",m.jsx(V0,{content:"The step's purpose in the workflow."})]})}),m.jsx(Gu.Cell,{children:m.jsx(IB,{state:u.description,placeholder:"Add description"})})]})]}),m.jsxs(xc,{children:[m.jsx(ls,{children:"Operation"}),m.jsx(ANu,{step:u,collectionId:a})]}),m.jsx(xc,{children:m.jsx(gre,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),m.jsx(xc,{children:m.jsx(RNu,{successCriteria:u.successCriteria})})]})})}function NNu({onParameterChange:u,files:e}){const a=P.useRef(null),t=o=>{o.target.files?.length&&u(Array.from(o.target.files).map(s=>({absolutePath:null,file:s})))},r=async()=>{if(Rl())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-XdVm__ud.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(_3),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=P.useCallback(()=>{u(null)},[u]),i=P.useMemo(()=>{if(!e)return null;if(e.length===1)return m.jsx(eI,{icon:m.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsx(uI,{children:e[0].file.name})});if(e.length>1)return m.jsx(eI,{icon:m.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsxs(uI,{children:[e.length," files"]})})},[e,n]);return m.jsx(LNu,{children:m.jsxs(INu,{children:[m.jsx(KNu,{children:i||m.jsx(GNu,{children:"Add files here"})}),m.jsxs(VNu,{children:[m.jsx(b2u,{onClick:r,variant:"text","data-testid":"add-button",icon:m.jsx(Q.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 LNu=j.div`
2331
+ `;function _Nu({step:u,workflowId:e,collectionId:a}){const{handleIdChange:t}=Il(),r=u.stepId.get();return m.jsx(m.Fragment,{children:m.jsxs(vre,{children:[m.jsx(ls,{children:"Info"}),m.jsxs(Gu,{children:[m.jsxs(Gu.Row,{children:[m.jsx(Gu.Cell,{children:m.jsxs(ml,{children:["Step ID",m.jsx(V0,{content:"This step's unique identifier"})]})}),m.jsx(Gu.Cell,{$readonly:!0,children:m.jsx(z2,{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(Gu.Row,{children:[m.jsx(Gu.Cell,{children:m.jsxs(ml,{children:["Description",m.jsx(V0,{content:"The step's purpose in the workflow."})]})}),m.jsx(Gu.Cell,{children:m.jsx(IB,{state:u.description,placeholder:"Add description"})})]})]}),m.jsxs(xc,{children:[m.jsx(ls,{children:"Operation"}),m.jsx(ANu,{step:u,collectionId:a})]}),m.jsx(xc,{children:m.jsx(gre,{outputs:u.outputs,tooltipText:"Data generated in this step that can be used in the next steps."})}),m.jsx(xc,{children:m.jsx(RNu,{successCriteria:u.successCriteria})})]})})}function NNu({onParameterChange:u,files:e}){const a=P.useRef(null),t=o=>{o.target.files?.length&&u(Array.from(o.target.files).map(s=>({absolutePath:null,file:s})))},r=async()=>{if(Rl())try{const{open:o}=await Promise.resolve().then(()=>require("./replay-index-C-PVPdpg.js")),s=await o({multiple:!0});if(!s)return;const c=(Array.isArray(s)?s:[s]).map(_3),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=P.useCallback(()=>{u(null)},[u]),i=P.useMemo(()=>{if(!e)return null;if(e.length===1)return m.jsx(eI,{icon:m.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsx(uI,{children:e[0].file.name})});if(e.length>1)return m.jsx(eI,{icon:m.jsx(Q.CloseIcon,{}),variant:"secondary",onClick:n,iconPosition:"right",size:"small",children:m.jsxs(uI,{children:[e.length," files"]})})},[e,n]);return m.jsx(LNu,{children:m.jsxs(INu,{children:[m.jsx(KNu,{children:i||m.jsx(GNu,{children:"Add files here"})}),m.jsxs(VNu,{children:[m.jsx(b2u,{onClick:r,variant:"text","data-testid":"add-button",icon:m.jsx(Q.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 LNu=j.div`
2332
2332
  position: relative;
2333
2333
  display: flex;
2334
2334
  flex-grow: 1;
@@ -2455,7 +2455,7 @@ Please report this to https://github.com/markedjs/marked.`,u){const r="<p>An err
2455
2455
  `,rLu=j.div`
2456
2456
  display: flex;
2457
2457
  justify-content: center;
2458
- `;function nLu({data:u,type:e,editable:a}){const t=ta(),r=u[e];function n(o,s){s&&r.merge([pl()])}function i(o){r[o].set(Eu)}return m.jsx(QNu,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==Ht["application/x-www-form-urlencoded"],editable:a,actions:o=>m.jsx(dr,{onClick:()=>i(o),variant:"text",icon:m.jsx(Q.TrashCanIcon,{})})})}const iLu=({data:u})=>{const e=u.get(),[a,t]=P.useState(!1),r=P.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(),Rl())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-XdVm__ud.js")),d=await c();if(!d)return;const E=await _3(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(oLu,{children:[m.jsx(Q.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?m.jsxs(sLu,{children:[m.jsxs(lLu,{children:[m.jsx(Q.DocumentBlankIcon,{size:"16px"}),m.jsx(cLu,{children:e.file?.name})]}),m.jsx(dr,{onClick:s,icon:m.jsx(Q.TrashCanIcon,{})})]}):m.jsx(kre,{children:!e&&m.jsxs(dLu,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[m.jsx("input",{type:"file",onChange:n,ref:r}),m.jsx(Q.CloudUploadIcon,{}),"Upload file"]})})},kre=j.div`
2458
+ `;function nLu({data:u,type:e,editable:a}){const t=ta(),r=u[e];function n(o,s){s&&r.merge([pl()])}function i(o){r[o].set(Eu)}return m.jsx(QNu,{keyName:"Param",formElements:r,onParameterChange:n,environment:t,enableInputTypeSelection:e!==Ht["application/x-www-form-urlencoded"],editable:a,actions:o=>m.jsx(dr,{onClick:()=>i(o),variant:"text",icon:m.jsx(Q.TrashCanIcon,{})})})}const iLu=({data:u})=>{const e=u.get(),[a,t]=P.useState(!1),r=P.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(),Rl())try{const{open:c}=await Promise.resolve().then(()=>require("./replay-index-C-PVPdpg.js")),d=await c();if(!d)return;const E=await _3(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(oLu,{children:[m.jsx(Q.SpinnerIcon,{}),"Loading..."]}):e&&e.file?.name?m.jsxs(sLu,{children:[m.jsxs(lLu,{children:[m.jsx(Q.DocumentBlankIcon,{size:"16px"}),m.jsx(cLu,{children:e.file?.name})]}),m.jsx(dr,{onClick:s,icon:m.jsx(Q.TrashCanIcon,{})})]}):m.jsx(kre,{children:!e&&m.jsxs(dLu,{tabIndex:0,role:"button",onKeyDown:o,onClick:i,children:[m.jsx("input",{type:"file",onChange:n,ref:r}),m.jsx(Q.CloudUploadIcon,{}),"Upload file"]})})},kre=j.div`
2459
2459
  display: flex;
2460
2460
  align-items: center;
2461
2461
  justify-content: flex-start;
@@ -2627,7 +2627,7 @@ Please report this to https://github.com/markedjs/marked.`,u){const r="<p>An err
2627
2627
  font-size: var(--font-size-base);
2628
2628
  font-weight: var(--font-weight-medium);
2629
2629
  padding: var(--spacing-xs);
2630
- `;function KLu(u=32){let e="";for(;e.length<u;)e+=Math.random().toString(32).substring(2);return e.substring(0,u)}async function VLu(u){const e=new TextEncoder().encode(u);return crypto?.subtle.digest("SHA-256",e)}function GLu(u){if(u)return btoa(String.fromCharCode.apply(null,new Uint8Array(u))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function tI(u,e,a){const t=typeof u=="string"?u:u.toString();if(Rl()){const{openUrl:r}=await Promise.resolve().then(()=>require("./replay-index-B-2BPGqI.js"));await r(t);return}window.open(t,e,a)}const rI="/_auth/oauth2-redirect.html";let h6=class wd{static async authorizeImplicit({authorizationUrl:e,clientId:a,scopes:t,extraAuthParams:r={},routingBasePath:n="/",redirectUri:i,successCallback:o,errorCallback:s}){const l=nI({date:new Date().toString()});try{const c=new URL(e),d=n==="/"?"":n,E=`${window.location.origin}${d}${rI}`;c.searchParams.set("client_id",a),c.searchParams.set("redirect_uri",i||E),c.searchParams.set("response_type","token"),c.searchParams.set("state",l),Array.isArray(t)&&c.searchParams.set("scope",t.join(" "));for(const p in r)c.searchParams.set(p,r[p]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:e,clientId:a,scopes:t},state:l,successCallback:p=>{o(p),wd.clearRedirectData("implicit")},errorCallback:p=>{s(p),wd.clearRedirectData("implicit")}},await tI(c.toString())}catch(c){s(wi.OAuth2Error.fromError(c))}}static async authorizeAuthorizationCode({authorizationUrl:e,tokenUrl:a,serverUrl:t,clientId:r,clientSecret:n,codeVerifier:i,codeChallenge:o,scopes:s,extraAuthParams:l={},extraTokenHeaders:c={},extraTokenBody:d={},extraTokenParams:E={},routingBasePath:p="/",redirectUri:h,withPkce:x,successCallback:f,errorCallback:D}){try{const g=$x({url:e,serverUrl:t}),v=new URL(g),y=$x({url:a,serverUrl:t}),k=new URL(y),b=p==="/"?"":p,C=`${window.location.origin}${b}${rI}`,B=nI({date:new Date().toString()});v.searchParams.set("client_id",r),v.searchParams.set("redirect_uri",h||C),v.searchParams.set("response_type","code"),v.searchParams.set("state",B),Array.isArray(s)&&v.searchParams.set("scope",s.join(" ")),x&&(!o&&!i&&(i=qLu(),o=await HLu(i)),o&&(v.searchParams.set("code_challenge",o),v.searchParams.set("code_challenge_method","S256")));for(const O in l)v.searchParams.set(O,l[O]);for(const O in E)k.searchParams.set(O,E[O]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:e,clientId:r,scopes:s},state:B,successCallback:async({auth_code:O})=>{const T=Ii({client_id:r,client_secret:n,...i&&{code_verifier:i},code:O,grant_type:"authorization_code",redirect_uri:h||C,...d});try{const M=await Qi(k,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...c},body:new URLSearchParams(T).toString()});await oy(M,f,D)}catch(M){D(wi.OAuth2Error.fromError(M))}wd.clearRedirectData("authorizationCode")},errorCallback:O=>{D(wi.OAuth2Error.fromError(O)),wd.clearRedirectData("authorizationCode")}},await tI(v.toString())}catch(g){D(wi.OAuth2Error.fromError(g))}}static clearRedirectData(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static async authorizeClientCredentials({tokenUrl:e,clientId:a,clientSecret:t,scopes:r=[],extraTokenParams:n={},extraTokenHeaders:i={},extraTokenBody:o={},corsProxyUrl:s,serverUrl:l,assertionType:c,clientAssertion:d,successCallback:E,errorCallback:p}){try{const h={client_id:a,client_secret:t,grant_type:"client_credentials",scope:Array.isArray(r)&&r.length?r.join(" "):void 0,client_assertion_type:c,client_assertion:d,...o},x=$x({url:e,serverUrl:l,corsProxyUrl:s}),f=new URL(x);for(const g in n)f.searchParams.set(g,n[g]);const D=await Qi(x,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...i},body:new URLSearchParams(_j(h)).toString()});await oy(D,E,p)}catch(h){p(wi.OAuth2Error.fromError(h))}}static async authorizePasswordGrant({username:e,password:a,tokenUrl:t,clientId:r,clientSecret:n,scopes:i=[],extraTokenParams:o={},extraTokenHeaders:s={},extraTokenBody:l={},corsProxyUrl:c,serverUrl:d,successCallback:E,errorCallback:p}){try{const h={client_id:r,client_secret:n,grant_type:"password",username:e,password:a,scope:Array.isArray(i)&&i.length?i.join(" "):void 0,...l},x=$x({url:t,serverUrl:d,corsProxyUrl:c}),f=new URL(x);for(const g in o)f.searchParams.set(g,o[g]);const D=await Qi(x,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...s},body:new URLSearchParams(_j(h)).toString()});await oy(D,E,p)}catch(h){p(wi.OAuth2Error.fromError(h))}}};function nI(u){const e={randomStr:KLu(),...u};return btoa(encodeURIComponent(JSON.stringify(e)))}async function oy(u,e,a){if(u.ok){const t=await u.json();if(t.error){a(wi.OAuth2Error.fromJsonData(t));return}e(t)}else{if((u.headers.get("Content-Type")||"").indexOf("json")>-1){const n=await u.json();a(wi.OAuth2Error.fromJsonData(n));return}a(wi.OAuth2Error.fromTextData(await u.text()))}}async function HLu(u){return GLu(await VLu(u))}function QLu(u){return("0"+u.toString(16)).substring(-2)}function qLu(){const u=new Uint32Array(28);return crypto.getRandomValues(u),Array.from(u,QLu).join("")}function D6({scopes:u,environment:e,editable:a}){const t=(n,i)=>{i&&u.merge([yr()])},r=n=>{u[n].set(Eu)};return m.jsx(WLu,{children:m.jsx(JLu,{keyName:"Scopes",elements:u,onParameterChange:t,environment:e,actions:n=>m.jsx(dr,{onClick:()=>r(n),variant:"text",icon:m.jsx(Q.TrashCanIcon,{})}),singleValue:!0,hideOuterBorders:!0,valuePlaceholder:"New scope item",editable:a})})}const WLu=j.div`
2630
+ `;function KLu(u=32){let e="";for(;e.length<u;)e+=Math.random().toString(32).substring(2);return e.substring(0,u)}async function VLu(u){const e=new TextEncoder().encode(u);return crypto?.subtle.digest("SHA-256",e)}function GLu(u){if(u)return btoa(String.fromCharCode.apply(null,new Uint8Array(u))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function tI(u,e,a){const t=typeof u=="string"?u:u.toString();if(Rl()){const{openUrl:r}=await Promise.resolve().then(()=>require("./replay-index-yk0sTuq_.js"));await r(t);return}window.open(t,e,a)}const rI="/_auth/oauth2-redirect.html";let h6=class wd{static async authorizeImplicit({authorizationUrl:e,clientId:a,scopes:t,extraAuthParams:r={},routingBasePath:n="/",redirectUri:i,successCallback:o,errorCallback:s}){const l=nI({date:new Date().toString()});try{const c=new URL(e),d=n==="/"?"":n,E=`${window.location.origin}${d}${rI}`;c.searchParams.set("client_id",a),c.searchParams.set("redirect_uri",i||E),c.searchParams.set("response_type","token"),c.searchParams.set("state",l),Array.isArray(t)&&c.searchParams.set("scope",t.join(" "));for(const p in r)c.searchParams.set(p,r[p]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:e,clientId:a,scopes:t},state:l,successCallback:p=>{o(p),wd.clearRedirectData("implicit")},errorCallback:p=>{s(p),wd.clearRedirectData("implicit")}},await tI(c.toString())}catch(c){s(wi.OAuth2Error.fromError(c))}}static async authorizeAuthorizationCode({authorizationUrl:e,tokenUrl:a,serverUrl:t,clientId:r,clientSecret:n,codeVerifier:i,codeChallenge:o,scopes:s,extraAuthParams:l={},extraTokenHeaders:c={},extraTokenBody:d={},extraTokenParams:E={},routingBasePath:p="/",redirectUri:h,withPkce:x,successCallback:f,errorCallback:D}){try{const g=$x({url:e,serverUrl:t}),v=new URL(g),y=$x({url:a,serverUrl:t}),k=new URL(y),b=p==="/"?"":p,C=`${window.location.origin}${b}${rI}`,B=nI({date:new Date().toString()});v.searchParams.set("client_id",r),v.searchParams.set("redirect_uri",h||C),v.searchParams.set("response_type","code"),v.searchParams.set("state",B),Array.isArray(s)&&v.searchParams.set("scope",s.join(" ")),x&&(!o&&!i&&(i=qLu(),o=await HLu(i)),o&&(v.searchParams.set("code_challenge",o),v.searchParams.set("code_challenge_method","S256")));for(const O in l)v.searchParams.set(O,l[O]);for(const O in E)k.searchParams.set(O,E[O]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:e,clientId:r,scopes:s},state:B,successCallback:async({auth_code:O})=>{const T=Ii({client_id:r,client_secret:n,...i&&{code_verifier:i},code:O,grant_type:"authorization_code",redirect_uri:h||C,...d});try{const M=await Qi(k,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...c},body:new URLSearchParams(T).toString()});await oy(M,f,D)}catch(M){D(wi.OAuth2Error.fromError(M))}wd.clearRedirectData("authorizationCode")},errorCallback:O=>{D(wi.OAuth2Error.fromError(O)),wd.clearRedirectData("authorizationCode")}},await tI(v.toString())}catch(g){D(wi.OAuth2Error.fromError(g))}}static clearRedirectData(e){window.redirectOAuth2={flow:e,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static async authorizeClientCredentials({tokenUrl:e,clientId:a,clientSecret:t,scopes:r=[],extraTokenParams:n={},extraTokenHeaders:i={},extraTokenBody:o={},corsProxyUrl:s,serverUrl:l,assertionType:c,clientAssertion:d,successCallback:E,errorCallback:p}){try{const h={client_id:a,client_secret:t,grant_type:"client_credentials",scope:Array.isArray(r)&&r.length?r.join(" "):void 0,client_assertion_type:c,client_assertion:d,...o},x=$x({url:e,serverUrl:l,corsProxyUrl:s}),f=new URL(x);for(const g in n)f.searchParams.set(g,n[g]);const D=await Qi(x,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...i},body:new URLSearchParams(_j(h)).toString()});await oy(D,E,p)}catch(h){p(wi.OAuth2Error.fromError(h))}}static async authorizePasswordGrant({username:e,password:a,tokenUrl:t,clientId:r,clientSecret:n,scopes:i=[],extraTokenParams:o={},extraTokenHeaders:s={},extraTokenBody:l={},corsProxyUrl:c,serverUrl:d,successCallback:E,errorCallback:p}){try{const h={client_id:r,client_secret:n,grant_type:"password",username:e,password:a,scope:Array.isArray(i)&&i.length?i.join(" "):void 0,...l},x=$x({url:t,serverUrl:d,corsProxyUrl:c}),f=new URL(x);for(const g in o)f.searchParams.set(g,o[g]);const D=await Qi(x,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",Accept:"application/json",...s},body:new URLSearchParams(_j(h)).toString()});await oy(D,E,p)}catch(h){p(wi.OAuth2Error.fromError(h))}}};function nI(u){const e={randomStr:KLu(),...u};return btoa(encodeURIComponent(JSON.stringify(e)))}async function oy(u,e,a){if(u.ok){const t=await u.json();if(t.error){a(wi.OAuth2Error.fromJsonData(t));return}e(t)}else{if((u.headers.get("Content-Type")||"").indexOf("json")>-1){const n=await u.json();a(wi.OAuth2Error.fromJsonData(n));return}a(wi.OAuth2Error.fromTextData(await u.text()))}}async function HLu(u){return GLu(await VLu(u))}function QLu(u){return("0"+u.toString(16)).substring(-2)}function qLu(){const u=new Uint32Array(28);return crypto.getRandomValues(u),Array.from(u,QLu).join("")}function D6({scopes:u,environment:e,editable:a}){const t=(n,i)=>{i&&u.merge([yr()])},r=n=>{u[n].set(Eu)};return m.jsx(WLu,{children:m.jsx(JLu,{keyName:"Scopes",elements:u,onParameterChange:t,environment:e,actions:n=>m.jsx(dr,{onClick:()=>r(n),variant:"text",icon:m.jsx(Q.TrashCanIcon,{})}),singleValue:!0,hideOuterBorders:!0,valuePlaceholder:"New scope item",editable:a})})}const WLu=j.div`
2631
2631
  width: 100%;
2632
2632
 
2633
2633
  > div {
@@ -3449,7 +3449,7 @@ Please report this to https://github.com/markedjs/marked.`,u){const r="<p>An err
3449
3449
  @media (max-width: ${Qt}px) {
3450
3450
  padding: var(--spacing-xs) var(--spacing-sm);
3451
3451
  }
3452
- `,HVu={info:u=>{},error:u=>{},warn:u=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(u,e)=>u,output:u=>u},QVu=u=>u instanceof URL?u.toString():u instanceof Request?u.url:u;function qVu({collectionId:u,workflowId:e}){const{project:{userFilesDir:a}}=yu(),{certificates:t}=Jn(),r=ta(),{getCollection:n}=H3(),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 qY,x=s.map(g=>JSON.stringify({[g.name]:g.value})),f=WVu(l,c),{run:D}=await Promise.resolve().then(()=>require("./replay-index-ByJ9CDjb.js"));return await D({files:[p],workflow:e?[e]:[],fetch:(g,v)=>{const y=QVu(g),{clientCert:k,clientKey:b}=Fue(y,t?t.get({noproxy:!0}):[]);return Qi(y,{...v,clientCert:k,clientKey:b})},logger:HVu,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async g=>{if(!await hJ(g))throw new Error(`File ${g} doesn't exist or isn't readable.`);try{const y=await qA(g),k=new TextEncoder().encode(y);return new File([k],await mJ(g))}catch(y){throw new Error(`Failed to read file ${g}: ${y}`)}}},envVariables:{},config:await vQ({}),externalRefResolver:h,input:x,server:f,severity:JSON.stringify(E),skipLint:!0,noSecretsMasking:!0})}}}function WVu(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 y7(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function Vre({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]=De.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(Q.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):n>0?m.jsx(Q.ErrorFilledIcon,{color:"var(--color-error-base)"}):m.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)"}),E=p=>{p.stopPropagation(),l(!s)};return!e||e.length===0?null:m.jsxs(JVu,{children:[m.jsxs(UVu,{onClick:E,children:[m.jsxs(ZVu,{children:[m.jsx(XVu,{children:m.jsx(YVu,{children:d()})}),m.jsxs(eGu,{children:[m.jsx(uGu,{children:c()}),m.jsxs(aGu,{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(tGu,{isExpanded:s,children:s?m.jsx(Q.ChevronDownIcon,{}):m.jsx(Q.ChevronRightIcon,{})})]}),m.jsx(rGu,{isExpanded:s,children:e.map((p,h)=>m.jsxs(nGu,{children:[m.jsx(iGu,{children:p.passed?m.jsx(Q.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!p.passed&&["warn"].includes(p.severity)?m.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):m.jsx(Q.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),m.jsxs(oGu,{children:[m.jsx(sGu,{children:p.name}),p.message&&m.jsx(lGu,{children:p.message})]})]},h))})]})}const JVu=j.div`
3452
+ `,HVu={info:u=>{},error:u=>{},warn:u=>{},printNewLine:()=>{},printSeparator:()=>{},indent:(u,e)=>u,output:u=>u},QVu=u=>u instanceof URL?u.toString():u instanceof Request?u.url:u;function qVu({collectionId:u,workflowId:e}){const{project:{userFilesDir:a}}=yu(),{certificates:t}=Jn(),r=ta(),{getCollection:n}=H3(),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 qY,x=s.map(g=>JSON.stringify({[g.name]:g.value})),f=WVu(l,c),{run:D}=await Promise.resolve().then(()=>require("./replay-index-NZomfg-i.js"));return await D({files:[p],workflow:e?[e]:[],fetch:(g,v)=>{const y=QVu(g),{clientCert:k,clientKey:b}=Fue(y,t?t.get({noproxy:!0}):[]);return Qi(y,{...v,clientCert:k,clientKey:b})},logger:HVu,maxSteps:500,maxFetchTimeout:4e4,requestFileLoader:{getFileBody:async g=>{if(!await hJ(g))throw new Error(`File ${g} doesn't exist or isn't readable.`);try{const y=await qA(g),k=new TextEncoder().encode(y);return new File([k],await mJ(g))}catch(y){throw new Error(`Failed to read file ${g}: ${y}`)}}},envVariables:{},config:await vQ({}),externalRefResolver:h,input:x,server:f,severity:JSON.stringify(E),skipLint:!0,noSecretsMasking:!0})}}}function WVu(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 y7(u){return u==null?"N/A":u<1e3?`${u} ms`:u<1e4?`${(u/1e3).toFixed(1)} s`:`${Math.round(u/1e3)} s`}function Vre({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]=De.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(Q.CheckmarkFilledIcon,{color:"var(--color-success-base)"}):n>0?m.jsx(Q.ErrorFilledIcon,{color:"var(--color-error-base)"}):m.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)"}),E=p=>{p.stopPropagation(),l(!s)};return!e||e.length===0?null:m.jsxs(JVu,{children:[m.jsxs(UVu,{onClick:E,children:[m.jsxs(ZVu,{children:[m.jsx(XVu,{children:m.jsx(YVu,{children:d()})}),m.jsxs(eGu,{children:[m.jsx(uGu,{children:c()}),m.jsxs(aGu,{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(tGu,{isExpanded:s,children:s?m.jsx(Q.ChevronDownIcon,{}):m.jsx(Q.ChevronRightIcon,{})})]}),m.jsx(rGu,{isExpanded:s,children:e.map((p,h)=>m.jsxs(nGu,{children:[m.jsx(iGu,{children:p.passed?m.jsx(Q.CheckmarkIcon,{color:"var(--color-success-base)",size:"14px"}):!p.passed&&["warn"].includes(p.severity)?m.jsx(Q.WarningFilledIcon,{color:"var(--color-warning-base)",size:"14px"}):m.jsx(Q.CloseOutlineIcon,{color:"var(--color-error-base)",size:"14px"})}),m.jsxs(oGu,{children:[m.jsx(sGu,{children:p.name}),p.message&&m.jsx(lGu,{children:p.message})]})]},h))})]})}const JVu=j.div`
3453
3453
  margin-bottom: 0;
3454
3454
  margin-top: var(--spacing-xxs);
3455
3455
  `,UVu=j.div`