@openapi-studio/core 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/ssr-manifest.json +58 -58
- package/dist/assets/{Main-CMK9wQCJ.css → Main-B4YDXfN4.css} +1 -1
- package/dist/assets/Main-CWVVijRK.js +29 -0
- package/dist/assets/{NotFound-Cat7CdKJ.js → NotFound-COIg6CS4.js} +1 -1
- package/dist/assets/{app-CB6IRUmn.js → app-jfWpanfK.js} +2 -2
- package/dist/assets/{styles-handler-ChlYo-U5.js → styles-handler-N75IOYWX.js} +1 -1
- package/dist/assets/{vanilla-jsoneditor-DGRLPOia.js → vanilla-jsoneditor-DhKpF9_o.js} +1 -1
- package/dist/build.json +1 -1
- package/dist/index.html +5 -6
- package/package.json +1 -1
- package/dist/assets/Main-D-Gy0vw8.js +0 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as aN}from"./app-CB6IRUmn.js";function Ng(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vj={},mj;function lN(){return mj||(mj=1,(function(t){(function(e){function n(E){return E!==null?Object.prototype.toString.call(E)==="[object Array]":!1}function r(E){return E!==null?Object.prototype.toString.call(E)==="[object Object]":!1}function o(E,D){if(E===D)return!0;var F=Object.prototype.toString.call(E);if(F!==Object.prototype.toString.call(D))return!1;if(n(E)===!0){if(E.length!==D.length)return!1;for(var ee=0;ee<E.length;ee++)if(o(E[ee],D[ee])===!1)return!1;return!0}if(r(E)===!0){var xe={};for(var Ne in E)if(hasOwnProperty.call(E,Ne)){if(o(E[Ne],D[Ne])===!1)return!1;xe[Ne]=!0}for(var Be in D)if(hasOwnProperty.call(D,Be)&&xe[Be]!==!0)return!1;return!0}return!1}function i(E){if(E===""||E===!1||E===null||n(E)&&E.length===0)return!0;if(r(E)){for(var D in E)if(E.hasOwnProperty(D))return!1;return!0}else return!1}function s(E){for(var D=Object.keys(E),F=[],ee=0;ee<D.length;ee++)F.push(E[D[ee]]);return F}var a;typeof String.prototype.trimLeft=="function"?a=function(E){return E.trimLeft()}:a=function(E){return E.match(/^\s*(.*)/)[1]};var l=0,u=1,h=2,d=3,f=4,p=5,v=6,g=7,m=8,b=9,y={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},w="EOF",j="UnquotedIdentifier",x="QuotedIdentifier",k="Rbracket",$="Rparen",T="Comma",M="Colon",z="Rbrace",V="Number",I="Current",J="Expref",he="Pipe",re="Or",Se="And",de="EQ",we="GT",ie="LT",X="GTE",W="LTE",ce="NE",N="Flatten",_="Star",P="Filter",oe="Dot",Ae="Not",ae="Lbrace",Y="Lbracket",ye="Lparen",A="Literal",q={".":oe,"*":_,",":T,":":M,"{":ae,"}":z,"]":k,"(":ye,")":$,"@":I},U={"<":!0,">":!0,"=":!0,"!":!0},fe={" ":!0," ":!0,"\n":!0};function Z(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E==="_"}function H(E){return E>="0"&&E<="9"||E==="-"}function at(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E>="0"&&E<="9"||E==="_"}function ct(){}ct.prototype={tokenize:function(E){var D=[];this._current=0;for(var F,ee,xe;this._current<E.length;)if(Z(E[this._current]))F=this._current,ee=this._consumeUnquotedIdentifier(E),D.push({type:j,value:ee,start:F});else if(q[E[this._current]]!==void 0)D.push({type:q[E[this._current]],value:E[this._current],start:this._current}),this._current++;else if(H(E[this._current]))xe=this._consumeNumber(E),D.push(xe);else if(E[this._current]==="[")xe=this._consumeLBracket(E),D.push(xe);else if(E[this._current]==='"')F=this._current,ee=this._consumeQuotedIdentifier(E),D.push({type:x,value:ee,start:F});else if(E[this._current]==="'")F=this._current,ee=this._consumeRawStringLiteral(E),D.push({type:A,value:ee,start:F});else if(E[this._current]==="`"){F=this._current;var Ne=this._consumeLiteral(E);D.push({type:A,value:Ne,start:F})}else if(U[E[this._current]]!==void 0)D.push(this._consumeOperator(E));else if(fe[E[this._current]]!==void 0)this._current++;else if(E[this._current]==="&")F=this._current,this._current++,E[this._current]==="&"?(this._current++,D.push({type:Se,value:"&&",start:F})):D.push({type:J,value:"&",start:F});else if(E[this._current]==="|")F=this._current,this._current++,E[this._current]==="|"?(this._current++,D.push({type:re,value:"||",start:F})):D.push({type:he,value:"|",start:F});else{var Be=new Error("Unknown character:"+E[this._current]);throw Be.name="LexerError",Be}return D},_consumeUnquotedIdentifier:function(E){var D=this._current;for(this._current++;this._current<E.length&&at(E[this._current]);)this._current++;return E.slice(D,this._current)},_consumeQuotedIdentifier:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=='"'&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==='"')?ee+=2:ee++,this._current=ee}return this._current++,JSON.parse(E.slice(D,this._current))},_consumeRawStringLiteral:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=="'"&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==="'")?ee+=2:ee++,this._current=ee}this._current++;var xe=E.slice(D+1,this._current-1);return xe.replace("\\'","'")},_consumeNumber:function(E){var D=this._current;this._current++;for(var F=E.length;H(E[this._current])&&this._current<F;)this._current++;var ee=parseInt(E.slice(D,this._current));return{type:V,value:ee,start:D}},_consumeLBracket:function(E){var D=this._current;return this._current++,E[this._current]==="?"?(this._current++,{type:P,value:"[?",start:D}):E[this._current]==="]"?(this._current++,{type:N,value:"[]",start:D}):{type:Y,value:"[",start:D}},_consumeOperator:function(E){var D=this._current,F=E[D];if(this._current++,F==="!")return E[this._current]==="="?(this._current++,{type:ce,value:"!=",start:D}):{type:Ae,value:"!",start:D};if(F==="<")return E[this._current]==="="?(this._current++,{type:W,value:"<=",start:D}):{type:ie,value:"<",start:D};if(F===">")return E[this._current]==="="?(this._current++,{type:X,value:">=",start:D}):{type:we,value:">",start:D};if(F==="="&&E[this._current]==="=")return this._current++,{type:de,value:"==",start:D}},_consumeLiteral:function(E){this._current++;for(var D=this._current,F=E.length,ee;E[this._current]!=="`"&&this._current<F;){var xe=this._current;E[xe]==="\\"&&(E[xe+1]==="\\"||E[xe+1]==="`")?xe+=2:xe++,this._current=xe}var Ne=a(E.slice(D,this._current));return Ne=Ne.replace("\\`","`"),this._looksLikeJSON(Ne)?ee=JSON.parse(Ne):ee=JSON.parse('"'+Ne+'"'),this._current++,ee},_looksLikeJSON:function(E){var D='[{"',F=["true","false","null"],ee="-0123456789";if(E==="")return!1;if(D.indexOf(E[0])>=0||F.indexOf(E)>=0)return!0;if(ee.indexOf(E[0])>=0)try{return JSON.parse(E),!0}catch{return!1}else return!1}};var Ee={};Ee[w]=0,Ee[j]=0,Ee[x]=0,Ee[k]=0,Ee[$]=0,Ee[T]=0,Ee[z]=0,Ee[V]=0,Ee[I]=0,Ee[J]=0,Ee[he]=1,Ee[re]=2,Ee[Se]=3,Ee[de]=5,Ee[we]=5,Ee[ie]=5,Ee[X]=5,Ee[W]=5,Ee[ce]=5,Ee[N]=9,Ee[_]=20,Ee[P]=21,Ee[oe]=40,Ee[Ae]=45,Ee[ae]=50,Ee[Y]=55,Ee[ye]=60;function pt(){}pt.prototype={parse:function(E){this._loadTokens(E),this.index=0;var D=this.expression(0);if(this._lookahead(0)!==w){var F=this._lookaheadToken(0),ee=new Error("Unexpected token type: "+F.type+", value: "+F.value);throw ee.name="ParserError",ee}return D},_loadTokens:function(E){var D=new ct,F=D.tokenize(E);F.push({type:w,value:"",start:E.length}),this.tokens=F},expression:function(E){var D=this._lookaheadToken(0);this._advance();for(var F=this.nud(D),ee=this._lookahead(0);E<Ee[ee];)this._advance(),F=this.led(ee,F),ee=this._lookahead(0);return F},_lookahead:function(E){return this.tokens[this.index+E].type},_lookaheadToken:function(E){return this.tokens[this.index+E]},_advance:function(){this.index++},nud:function(E){var D,F,ee;switch(E.type){case A:return{type:"Literal",value:E.value};case j:return{type:"Field",name:E.value};case x:var xe={type:"Field",name:E.value};if(this._lookahead(0)===ye)throw new Error("Quoted identifier not allowed for function names.");return xe;case Ae:return F=this.expression(Ee.Not),{type:"NotExpression",children:[F]};case _:return D={type:"Identity"},F=null,this._lookahead(0)===k?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Star),{type:"ValueProjection",children:[D,F]};case P:return this.led(E.type,{type:"Identity"});case ae:return this._parseMultiselectHash();case N:return D={type:N,children:[{type:"Identity"}]},F=this._parseProjectionRHS(Ee.Flatten),{type:"Projection",children:[D,F]};case Y:return this._lookahead(0)===V||this._lookahead(0)===M?(F=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},F)):this._lookahead(0)===_&&this._lookahead(1)===k?(this._advance(),this._advance(),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[{type:"Identity"},F]}):this._parseMultiselectList();case I:return{type:I};case J:return ee=this.expression(Ee.Expref),{type:"ExpressionReference",children:[ee]};case ye:for(var Ne=[];this._lookahead(0)!==$;)this._lookahead(0)===I?(ee={type:I},this._advance()):ee=this.expression(0),Ne.push(ee);return this._match($),Ne[0];default:this._errorToken(E)}},led:function(E,D){var F;switch(E){case oe:var ee=Ee.Dot;return this._lookahead(0)!==_?(F=this._parseDotRHS(ee),{type:"Subexpression",children:[D,F]}):(this._advance(),F=this._parseProjectionRHS(ee),{type:"ValueProjection",children:[D,F]});case he:return F=this.expression(Ee.Pipe),{type:he,children:[D,F]};case re:return F=this.expression(Ee.Or),{type:"OrExpression",children:[D,F]};case Se:return F=this.expression(Ee.And),{type:"AndExpression",children:[D,F]};case ye:for(var xe=D.name,Ne=[],Be,ge;this._lookahead(0)!==$;)this._lookahead(0)===I?(Be={type:I},this._advance()):Be=this.expression(0),this._lookahead(0)===T&&this._match(T),Ne.push(Be);return this._match($),ge={type:"Function",name:xe,children:Ne},ge;case P:var je=this.expression(0);return this._match(k),this._lookahead(0)===N?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Filter),{type:"FilterProjection",children:[D,F,je]};case N:var wt={type:N,children:[D]},ut=this._parseProjectionRHS(Ee.Flatten);return{type:"Projection",children:[wt,ut]};case de:case ce:case we:case X:case ie:case W:return this._parseComparator(D,E);case Y:var Ye=this._lookaheadToken(0);return Ye.type===V||Ye.type===M?(F=this._parseIndexExpression(),this._projectIfSlice(D,F)):(this._match(_),this._match(k),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[D,F]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(E){if(this._lookahead(0)===E)this._advance();else{var D=this._lookaheadToken(0),F=new Error("Expected "+E+", got: "+D.type);throw F.name="ParserError",F}},_errorToken:function(E){var D=new Error("Invalid token ("+E.type+'): "'+E.value+'"');throw D.name="ParserError",D},_parseIndexExpression:function(){if(this._lookahead(0)===M||this._lookahead(1)===M)return this._parseSliceExpression();var E={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(k),E},_projectIfSlice:function(E,D){var F={type:"IndexExpression",children:[E,D]};return D.type==="Slice"?{type:"Projection",children:[F,this._parseProjectionRHS(Ee.Star)]}:F},_parseSliceExpression:function(){for(var E=[null,null,null],D=0,F=this._lookahead(0);F!==k&&D<3;){if(F===M)D++,this._advance();else if(F===V)E[D]=this._lookaheadToken(0).value,this._advance();else{var ee=this._lookahead(0),xe=new Error("Syntax error, unexpected token: "+ee.value+"("+ee.type+")");throw xe.name="Parsererror",xe}F=this._lookahead(0)}return this._match(k),{type:"Slice",children:E}},_parseComparator:function(E,D){var F=this.expression(Ee[D]);return{type:"Comparator",name:D,children:[E,F]}},_parseDotRHS:function(E){var D=this._lookahead(0),F=[j,x,_];if(F.indexOf(D)>=0)return this.expression(E);if(D===Y)return this._match(Y),this._parseMultiselectList();if(D===ae)return this._match(ae),this._parseMultiselectHash()},_parseProjectionRHS:function(E){var D;if(Ee[this._lookahead(0)]<10)D={type:"Identity"};else if(this._lookahead(0)===Y)D=this.expression(E);else if(this._lookahead(0)===P)D=this.expression(E);else if(this._lookahead(0)===oe)this._match(oe),D=this._parseDotRHS(E);else{var F=this._lookaheadToken(0),ee=new Error("Sytanx error, unexpected token: "+F.value+"("+F.type+")");throw ee.name="ParserError",ee}return D},_parseMultiselectList:function(){for(var E=[];this._lookahead(0)!==k;){var D=this.expression(0);if(E.push(D),this._lookahead(0)===T&&(this._match(T),this._lookahead(0)===k))throw new Error("Unexpected token Rbracket")}return this._match(k),{type:"MultiSelectList",children:E}},_parseMultiselectHash:function(){for(var E=[],D=[j,x],F,ee,xe,Ne;;){if(F=this._lookaheadToken(0),D.indexOf(F.type)<0)throw new Error("Expecting an identifier token, got: "+F.type);if(ee=F.value,this._advance(),this._match(M),xe=this.expression(0),Ne={type:"KeyValuePair",name:ee,value:xe},E.push(Ne),this._lookahead(0)===T)this._match(T);else if(this._lookahead(0)===z){this._match(z);break}}return{type:"MultiSelectHash",children:E}}};function Le(E){this.runtime=E}Le.prototype={search:function(E,D){return this.visit(E,D)},visit:function(E,D){var F,ee,xe,Ne,Be,ge,je,wt,ut,Ye;switch(E.type){case"Field":return D!==null&&r(D)?(ge=D[E.name],ge===void 0?null:ge):null;case"Subexpression":for(xe=this.visit(E.children[0],D),Ye=1;Ye<E.children.length;Ye++)if(xe=this.visit(E.children[1],xe),xe===null)return null;return xe;case"IndexExpression":return je=this.visit(E.children[0],D),wt=this.visit(E.children[1],je),wt;case"Index":if(!n(D))return null;var Xe=E.value;return Xe<0&&(Xe=D.length+Xe),xe=D[Xe],xe===void 0&&(xe=null),xe;case"Slice":if(!n(D))return null;var Jt=E.children.slice(0),Un=this.computeSliceParams(D.length,Jt),Jn=Un[0],Kt=Un[1],Nn=Un[2];if(xe=[],Nn>0)for(Ye=Jn;Ye<Kt;Ye+=Nn)xe.push(D[Ye]);else for(Ye=Jn;Ye>Kt;Ye+=Nn)xe.push(D[Ye]);return xe;case"Projection":var rn=this.visit(E.children[0],D);if(!n(rn))return null;for(ut=[],Ye=0;Ye<rn.length;Ye++)ee=this.visit(E.children[1],rn[Ye]),ee!==null&&ut.push(ee);return ut;case"ValueProjection":if(rn=this.visit(E.children[0],D),!r(rn))return null;ut=[];var ln=s(rn);for(Ye=0;Ye<ln.length;Ye++)ee=this.visit(E.children[1],ln[Ye]),ee!==null&&ut.push(ee);return ut;case"FilterProjection":if(rn=this.visit(E.children[0],D),!n(rn))return null;var Sn=[],St=[];for(Ye=0;Ye<rn.length;Ye++)F=this.visit(E.children[2],rn[Ye]),i(F)||Sn.push(rn[Ye]);for(var Mn=0;Mn<Sn.length;Mn++)ee=this.visit(E.children[1],Sn[Mn]),ee!==null&&St.push(ee);return St;case"Comparator":switch(Ne=this.visit(E.children[0],D),Be=this.visit(E.children[1],D),E.name){case de:xe=o(Ne,Be);break;case ce:xe=!o(Ne,Be);break;case we:xe=Ne>Be;break;case X:xe=Ne>=Be;break;case ie:xe=Ne<Be;break;case W:xe=Ne<=Be;break;default:throw new Error("Unknown comparator: "+E.name)}return xe;case N:var Dt=this.visit(E.children[0],D);if(!n(Dt))return null;var nt=[];for(Ye=0;Ye<Dt.length;Ye++)ee=Dt[Ye],n(ee)?nt.push.apply(nt,ee):nt.push(ee);return nt;case"Identity":return D;case"MultiSelectList":if(D===null)return null;for(ut=[],Ye=0;Ye<E.children.length;Ye++)ut.push(this.visit(E.children[Ye],D));return ut;case"MultiSelectHash":if(D===null)return null;ut={};var cn;for(Ye=0;Ye<E.children.length;Ye++)cn=E.children[Ye],ut[cn.name]=this.visit(cn.value,D);return ut;case"OrExpression":return F=this.visit(E.children[0],D),i(F)&&(F=this.visit(E.children[1],D)),F;case"AndExpression":return Ne=this.visit(E.children[0],D),i(Ne)===!0?Ne:this.visit(E.children[1],D);case"NotExpression":return Ne=this.visit(E.children[0],D),i(Ne);case"Literal":return E.value;case he:return je=this.visit(E.children[0],D),this.visit(E.children[1],je);case I:return D;case"Function":var Gt=[];for(Ye=0;Ye<E.children.length;Ye++)Gt.push(this.visit(E.children[Ye],D));return this.runtime.callFunction(E.name,Gt);case"ExpressionReference":var ir=E.children[0];return ir.jmespathType=J,ir;default:throw new Error("Unknown node type: "+E.type)}},computeSliceParams:function(E,D){var F=D[0],ee=D[1],xe=D[2],Ne=[null,null,null];if(xe===null)xe=1;else if(xe===0){var Be=new Error("Invalid slice, step cannot be 0");throw Be.name="RuntimeError",Be}var ge=xe<0;return F===null?F=ge?E-1:0:F=this.capSliceRange(E,F,xe),ee===null?ee=ge?-1:E:ee=this.capSliceRange(E,ee,xe),Ne[0]=F,Ne[1]=ee,Ne[2]=xe,Ne},capSliceRange:function(E,D,F){return D<0?(D+=E,D<0&&(D=F<0?-1:0)):D>=E&&(D=F<0?E-1:E),D}};function Ke(E){this._interpreter=E,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[m]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[h,d]},{types:[u]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[h]},{types:[h]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[h,d,f]}]},map:{_func:this._functionMap,_signature:[{types:[v]},{types:[d]}]},max:{_func:this._functionMax,_signature:[{types:[m,b]}]},merge:{_func:this._functionMerge,_signature:[{types:[f],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[d]},{types:[v]}]},sum:{_func:this._functionSum,_signature:[{types:[m]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[h]},{types:[h]}]},min:{_func:this._functionMin,_signature:[{types:[m,b]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[d]},{types:[v]}]},type:{_func:this._functionType,_signature:[{types:[u]}]},keys:{_func:this._functionKeys,_signature:[{types:[f]}]},values:{_func:this._functionValues,_signature:[{types:[f]}]},sort:{_func:this._functionSort,_signature:[{types:[b,m]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[d]},{types:[v]}]},join:{_func:this._functionJoin,_signature:[{types:[h]},{types:[b]}]},reverse:{_func:this._functionReverse,_signature:[{types:[h,d]}]},to_array:{_func:this._functionToArray,_signature:[{types:[u]}]},to_string:{_func:this._functionToString,_signature:[{types:[u]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[u]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[u],variadic:!0}]}}}Ke.prototype={callFunction:function(E,D){var F=this.functionTable[E];if(F===void 0)throw new Error("Unknown function: "+E+"()");return this._validateArgs(E,D,F._signature),F._func.call(this,D)},_validateArgs:function(E,D,F){var ee;if(F[F.length-1].variadic){if(D.length<F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes at least"+F.length+ee+" but received "+D.length)}else if(D.length!==F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes "+F.length+ee+" but received "+D.length);for(var xe,Ne,Be,ge=0;ge<F.length;ge++){Be=!1,xe=F[ge].types,Ne=this._getTypeName(D[ge]);for(var je=0;je<xe.length;je++)if(this._typeMatches(Ne,xe[je],D[ge])){Be=!0;break}if(!Be){var wt=xe.map(function(ut){return y[ut]}).join(",");throw new Error("TypeError: "+E+"() expected argument "+(ge+1)+" to be type "+wt+" but received type "+y[Ne]+" instead.")}}},_typeMatches:function(E,D,F){if(D===u)return!0;if(D===b||D===m||D===d){if(D===d)return E===d;if(E===d){var ee;D===m?ee=l:D===b&&(ee=h);for(var xe=0;xe<F.length;xe++)if(!this._typeMatches(this._getTypeName(F[xe]),ee,F[xe]))return!1;return!0}}else return E===D},_getTypeName:function(E){switch(Object.prototype.toString.call(E)){case"[object String]":return h;case"[object Number]":return l;case"[object Array]":return d;case"[object Boolean]":return p;case"[object Null]":return g;case"[object Object]":return E.jmespathType===J?v:f}},_functionStartsWith:function(E){return E[0].lastIndexOf(E[1])===0},_functionEndsWith:function(E){var D=E[0],F=E[1];return D.indexOf(F,D.length-F.length)!==-1},_functionReverse:function(E){var D=this._getTypeName(E[0]);if(D===h){for(var F=E[0],ee="",xe=F.length-1;xe>=0;xe--)ee+=F[xe];return ee}else{var Ne=E[0].slice(0);return Ne.reverse(),Ne}},_functionAbs:function(E){return Math.abs(E[0])},_functionCeil:function(E){return Math.ceil(E[0])},_functionAvg:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D/F.length},_functionContains:function(E){return E[0].indexOf(E[1])>=0},_functionFloor:function(E){return Math.floor(E[0])},_functionLength:function(E){return r(E[0])?Object.keys(E[0]).length:E[0].length},_functionMap:function(E){for(var D=[],F=this._interpreter,ee=E[0],xe=E[1],Ne=0;Ne<xe.length;Ne++)D.push(F.visit(ee,xe[Ne]));return D},_functionMerge:function(E){for(var D={},F=0;F<E.length;F++){var ee=E[F];for(var xe in ee)D[xe]=ee[xe]}return D},_functionMax:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.max.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)ee.localeCompare(F[xe])<0&&(ee=F[xe]);return ee}else return null},_functionMin:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.min.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)F[xe].localeCompare(ee)<0&&(ee=F[xe]);return ee}else return null},_functionSum:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D},_functionType:function(E){switch(this._getTypeName(E[0])){case l:return"number";case h:return"string";case d:return"array";case f:return"object";case p:return"boolean";case v:return"expref";case g:return"null"}},_functionKeys:function(E){return Object.keys(E[0])},_functionValues:function(E){for(var D=E[0],F=Object.keys(D),ee=[],xe=0;xe<F.length;xe++)ee.push(D[F[xe]]);return ee},_functionJoin:function(E){var D=E[0],F=E[1];return F.join(D)},_functionToArray:function(E){return this._getTypeName(E[0])===d?E[0]:[E[0]]},_functionToString:function(E){return this._getTypeName(E[0])===h?E[0]:JSON.stringify(E[0])},_functionToNumber:function(E){var D=this._getTypeName(E[0]),F;return D===l?E[0]:D===h&&(F=+E[0],!isNaN(F))?F:null},_functionNotNull:function(E){for(var D=0;D<E.length;D++)if(this._getTypeName(E[D])!==g)return E[D];return null},_functionSort:function(E){var D=E[0].slice(0);return D.sort(),D},_functionSortBy:function(E){var D=E[0].slice(0);if(D.length===0)return D;var F=this._interpreter,ee=E[1],xe=this._getTypeName(F.visit(ee,D[0]));if([l,h].indexOf(xe)<0)throw new Error("TypeError");for(var Ne=this,Be=[],ge=0;ge<D.length;ge++)Be.push([ge,D[ge]]);Be.sort(function(wt,ut){var Ye=F.visit(ee,wt[1]),Xe=F.visit(ee,ut[1]);if(Ne._getTypeName(Ye)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Ye));if(Ne._getTypeName(Xe)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Xe));return Ye>Xe?1:Ye<Xe?-1:wt[0]-ut[0]});for(var je=0;je<Be.length;je++)D[je]=Be[je][1];return D},_functionMaxBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=-1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be>xe&&(xe=Be,Ne=F[ge]);return Ne},_functionMinBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be<xe&&(xe=Be,Ne=F[ge]);return Ne},createKeyFunction:function(E,D){var F=this,ee=this._interpreter,xe=function(Ne){var Be=ee.visit(E,Ne);if(D.indexOf(F._getTypeName(Be))<0){var ge="TypeError: expected one of "+D+", received "+F._getTypeName(Be);throw new Error(ge)}return Be};return xe}};function ft(E){var D=new pt,F=D.parse(E);return F}function We(E){var D=new ct;return D.tokenize(E)}function Nt(E,D){var F=new pt,ee=new Ke,xe=new Le(ee);ee._interpreter=xe;var Ne=F.parse(D);return xe.search(Ne,E)}e.tokenize=We,e.compile=ft,e.search=Nt,e.strictDeepEqual=o})(t)})(vj)),vj}var cN=lN();const uN=Ng(cN);var Tp={},gj;function hN(){if(gj)return Tp;gj=1;var t={b:"\b",f:"\f",n:`
|
|
1
|
+
import{_ as aN}from"./app-jfWpanfK.js";function Ng(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vj={},mj;function lN(){return mj||(mj=1,(function(t){(function(e){function n(E){return E!==null?Object.prototype.toString.call(E)==="[object Array]":!1}function r(E){return E!==null?Object.prototype.toString.call(E)==="[object Object]":!1}function o(E,D){if(E===D)return!0;var F=Object.prototype.toString.call(E);if(F!==Object.prototype.toString.call(D))return!1;if(n(E)===!0){if(E.length!==D.length)return!1;for(var ee=0;ee<E.length;ee++)if(o(E[ee],D[ee])===!1)return!1;return!0}if(r(E)===!0){var xe={};for(var Ne in E)if(hasOwnProperty.call(E,Ne)){if(o(E[Ne],D[Ne])===!1)return!1;xe[Ne]=!0}for(var Be in D)if(hasOwnProperty.call(D,Be)&&xe[Be]!==!0)return!1;return!0}return!1}function i(E){if(E===""||E===!1||E===null||n(E)&&E.length===0)return!0;if(r(E)){for(var D in E)if(E.hasOwnProperty(D))return!1;return!0}else return!1}function s(E){for(var D=Object.keys(E),F=[],ee=0;ee<D.length;ee++)F.push(E[D[ee]]);return F}var a;typeof String.prototype.trimLeft=="function"?a=function(E){return E.trimLeft()}:a=function(E){return E.match(/^\s*(.*)/)[1]};var l=0,u=1,h=2,d=3,f=4,p=5,v=6,g=7,m=8,b=9,y={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},w="EOF",j="UnquotedIdentifier",x="QuotedIdentifier",k="Rbracket",$="Rparen",T="Comma",M="Colon",z="Rbrace",V="Number",I="Current",J="Expref",he="Pipe",re="Or",Se="And",de="EQ",we="GT",ie="LT",X="GTE",W="LTE",ce="NE",N="Flatten",_="Star",P="Filter",oe="Dot",Ae="Not",ae="Lbrace",Y="Lbracket",ye="Lparen",A="Literal",q={".":oe,"*":_,",":T,":":M,"{":ae,"}":z,"]":k,"(":ye,")":$,"@":I},U={"<":!0,">":!0,"=":!0,"!":!0},fe={" ":!0," ":!0,"\n":!0};function Z(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E==="_"}function H(E){return E>="0"&&E<="9"||E==="-"}function at(E){return E>="a"&&E<="z"||E>="A"&&E<="Z"||E>="0"&&E<="9"||E==="_"}function ct(){}ct.prototype={tokenize:function(E){var D=[];this._current=0;for(var F,ee,xe;this._current<E.length;)if(Z(E[this._current]))F=this._current,ee=this._consumeUnquotedIdentifier(E),D.push({type:j,value:ee,start:F});else if(q[E[this._current]]!==void 0)D.push({type:q[E[this._current]],value:E[this._current],start:this._current}),this._current++;else if(H(E[this._current]))xe=this._consumeNumber(E),D.push(xe);else if(E[this._current]==="[")xe=this._consumeLBracket(E),D.push(xe);else if(E[this._current]==='"')F=this._current,ee=this._consumeQuotedIdentifier(E),D.push({type:x,value:ee,start:F});else if(E[this._current]==="'")F=this._current,ee=this._consumeRawStringLiteral(E),D.push({type:A,value:ee,start:F});else if(E[this._current]==="`"){F=this._current;var Ne=this._consumeLiteral(E);D.push({type:A,value:Ne,start:F})}else if(U[E[this._current]]!==void 0)D.push(this._consumeOperator(E));else if(fe[E[this._current]]!==void 0)this._current++;else if(E[this._current]==="&")F=this._current,this._current++,E[this._current]==="&"?(this._current++,D.push({type:Se,value:"&&",start:F})):D.push({type:J,value:"&",start:F});else if(E[this._current]==="|")F=this._current,this._current++,E[this._current]==="|"?(this._current++,D.push({type:re,value:"||",start:F})):D.push({type:he,value:"|",start:F});else{var Be=new Error("Unknown character:"+E[this._current]);throw Be.name="LexerError",Be}return D},_consumeUnquotedIdentifier:function(E){var D=this._current;for(this._current++;this._current<E.length&&at(E[this._current]);)this._current++;return E.slice(D,this._current)},_consumeQuotedIdentifier:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=='"'&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==='"')?ee+=2:ee++,this._current=ee}return this._current++,JSON.parse(E.slice(D,this._current))},_consumeRawStringLiteral:function(E){var D=this._current;this._current++;for(var F=E.length;E[this._current]!=="'"&&this._current<F;){var ee=this._current;E[ee]==="\\"&&(E[ee+1]==="\\"||E[ee+1]==="'")?ee+=2:ee++,this._current=ee}this._current++;var xe=E.slice(D+1,this._current-1);return xe.replace("\\'","'")},_consumeNumber:function(E){var D=this._current;this._current++;for(var F=E.length;H(E[this._current])&&this._current<F;)this._current++;var ee=parseInt(E.slice(D,this._current));return{type:V,value:ee,start:D}},_consumeLBracket:function(E){var D=this._current;return this._current++,E[this._current]==="?"?(this._current++,{type:P,value:"[?",start:D}):E[this._current]==="]"?(this._current++,{type:N,value:"[]",start:D}):{type:Y,value:"[",start:D}},_consumeOperator:function(E){var D=this._current,F=E[D];if(this._current++,F==="!")return E[this._current]==="="?(this._current++,{type:ce,value:"!=",start:D}):{type:Ae,value:"!",start:D};if(F==="<")return E[this._current]==="="?(this._current++,{type:W,value:"<=",start:D}):{type:ie,value:"<",start:D};if(F===">")return E[this._current]==="="?(this._current++,{type:X,value:">=",start:D}):{type:we,value:">",start:D};if(F==="="&&E[this._current]==="=")return this._current++,{type:de,value:"==",start:D}},_consumeLiteral:function(E){this._current++;for(var D=this._current,F=E.length,ee;E[this._current]!=="`"&&this._current<F;){var xe=this._current;E[xe]==="\\"&&(E[xe+1]==="\\"||E[xe+1]==="`")?xe+=2:xe++,this._current=xe}var Ne=a(E.slice(D,this._current));return Ne=Ne.replace("\\`","`"),this._looksLikeJSON(Ne)?ee=JSON.parse(Ne):ee=JSON.parse('"'+Ne+'"'),this._current++,ee},_looksLikeJSON:function(E){var D='[{"',F=["true","false","null"],ee="-0123456789";if(E==="")return!1;if(D.indexOf(E[0])>=0||F.indexOf(E)>=0)return!0;if(ee.indexOf(E[0])>=0)try{return JSON.parse(E),!0}catch{return!1}else return!1}};var Ee={};Ee[w]=0,Ee[j]=0,Ee[x]=0,Ee[k]=0,Ee[$]=0,Ee[T]=0,Ee[z]=0,Ee[V]=0,Ee[I]=0,Ee[J]=0,Ee[he]=1,Ee[re]=2,Ee[Se]=3,Ee[de]=5,Ee[we]=5,Ee[ie]=5,Ee[X]=5,Ee[W]=5,Ee[ce]=5,Ee[N]=9,Ee[_]=20,Ee[P]=21,Ee[oe]=40,Ee[Ae]=45,Ee[ae]=50,Ee[Y]=55,Ee[ye]=60;function pt(){}pt.prototype={parse:function(E){this._loadTokens(E),this.index=0;var D=this.expression(0);if(this._lookahead(0)!==w){var F=this._lookaheadToken(0),ee=new Error("Unexpected token type: "+F.type+", value: "+F.value);throw ee.name="ParserError",ee}return D},_loadTokens:function(E){var D=new ct,F=D.tokenize(E);F.push({type:w,value:"",start:E.length}),this.tokens=F},expression:function(E){var D=this._lookaheadToken(0);this._advance();for(var F=this.nud(D),ee=this._lookahead(0);E<Ee[ee];)this._advance(),F=this.led(ee,F),ee=this._lookahead(0);return F},_lookahead:function(E){return this.tokens[this.index+E].type},_lookaheadToken:function(E){return this.tokens[this.index+E]},_advance:function(){this.index++},nud:function(E){var D,F,ee;switch(E.type){case A:return{type:"Literal",value:E.value};case j:return{type:"Field",name:E.value};case x:var xe={type:"Field",name:E.value};if(this._lookahead(0)===ye)throw new Error("Quoted identifier not allowed for function names.");return xe;case Ae:return F=this.expression(Ee.Not),{type:"NotExpression",children:[F]};case _:return D={type:"Identity"},F=null,this._lookahead(0)===k?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Star),{type:"ValueProjection",children:[D,F]};case P:return this.led(E.type,{type:"Identity"});case ae:return this._parseMultiselectHash();case N:return D={type:N,children:[{type:"Identity"}]},F=this._parseProjectionRHS(Ee.Flatten),{type:"Projection",children:[D,F]};case Y:return this._lookahead(0)===V||this._lookahead(0)===M?(F=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},F)):this._lookahead(0)===_&&this._lookahead(1)===k?(this._advance(),this._advance(),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[{type:"Identity"},F]}):this._parseMultiselectList();case I:return{type:I};case J:return ee=this.expression(Ee.Expref),{type:"ExpressionReference",children:[ee]};case ye:for(var Ne=[];this._lookahead(0)!==$;)this._lookahead(0)===I?(ee={type:I},this._advance()):ee=this.expression(0),Ne.push(ee);return this._match($),Ne[0];default:this._errorToken(E)}},led:function(E,D){var F;switch(E){case oe:var ee=Ee.Dot;return this._lookahead(0)!==_?(F=this._parseDotRHS(ee),{type:"Subexpression",children:[D,F]}):(this._advance(),F=this._parseProjectionRHS(ee),{type:"ValueProjection",children:[D,F]});case he:return F=this.expression(Ee.Pipe),{type:he,children:[D,F]};case re:return F=this.expression(Ee.Or),{type:"OrExpression",children:[D,F]};case Se:return F=this.expression(Ee.And),{type:"AndExpression",children:[D,F]};case ye:for(var xe=D.name,Ne=[],Be,ge;this._lookahead(0)!==$;)this._lookahead(0)===I?(Be={type:I},this._advance()):Be=this.expression(0),this._lookahead(0)===T&&this._match(T),Ne.push(Be);return this._match($),ge={type:"Function",name:xe,children:Ne},ge;case P:var je=this.expression(0);return this._match(k),this._lookahead(0)===N?F={type:"Identity"}:F=this._parseProjectionRHS(Ee.Filter),{type:"FilterProjection",children:[D,F,je]};case N:var wt={type:N,children:[D]},ut=this._parseProjectionRHS(Ee.Flatten);return{type:"Projection",children:[wt,ut]};case de:case ce:case we:case X:case ie:case W:return this._parseComparator(D,E);case Y:var Ye=this._lookaheadToken(0);return Ye.type===V||Ye.type===M?(F=this._parseIndexExpression(),this._projectIfSlice(D,F)):(this._match(_),this._match(k),F=this._parseProjectionRHS(Ee.Star),{type:"Projection",children:[D,F]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(E){if(this._lookahead(0)===E)this._advance();else{var D=this._lookaheadToken(0),F=new Error("Expected "+E+", got: "+D.type);throw F.name="ParserError",F}},_errorToken:function(E){var D=new Error("Invalid token ("+E.type+'): "'+E.value+'"');throw D.name="ParserError",D},_parseIndexExpression:function(){if(this._lookahead(0)===M||this._lookahead(1)===M)return this._parseSliceExpression();var E={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(k),E},_projectIfSlice:function(E,D){var F={type:"IndexExpression",children:[E,D]};return D.type==="Slice"?{type:"Projection",children:[F,this._parseProjectionRHS(Ee.Star)]}:F},_parseSliceExpression:function(){for(var E=[null,null,null],D=0,F=this._lookahead(0);F!==k&&D<3;){if(F===M)D++,this._advance();else if(F===V)E[D]=this._lookaheadToken(0).value,this._advance();else{var ee=this._lookahead(0),xe=new Error("Syntax error, unexpected token: "+ee.value+"("+ee.type+")");throw xe.name="Parsererror",xe}F=this._lookahead(0)}return this._match(k),{type:"Slice",children:E}},_parseComparator:function(E,D){var F=this.expression(Ee[D]);return{type:"Comparator",name:D,children:[E,F]}},_parseDotRHS:function(E){var D=this._lookahead(0),F=[j,x,_];if(F.indexOf(D)>=0)return this.expression(E);if(D===Y)return this._match(Y),this._parseMultiselectList();if(D===ae)return this._match(ae),this._parseMultiselectHash()},_parseProjectionRHS:function(E){var D;if(Ee[this._lookahead(0)]<10)D={type:"Identity"};else if(this._lookahead(0)===Y)D=this.expression(E);else if(this._lookahead(0)===P)D=this.expression(E);else if(this._lookahead(0)===oe)this._match(oe),D=this._parseDotRHS(E);else{var F=this._lookaheadToken(0),ee=new Error("Sytanx error, unexpected token: "+F.value+"("+F.type+")");throw ee.name="ParserError",ee}return D},_parseMultiselectList:function(){for(var E=[];this._lookahead(0)!==k;){var D=this.expression(0);if(E.push(D),this._lookahead(0)===T&&(this._match(T),this._lookahead(0)===k))throw new Error("Unexpected token Rbracket")}return this._match(k),{type:"MultiSelectList",children:E}},_parseMultiselectHash:function(){for(var E=[],D=[j,x],F,ee,xe,Ne;;){if(F=this._lookaheadToken(0),D.indexOf(F.type)<0)throw new Error("Expecting an identifier token, got: "+F.type);if(ee=F.value,this._advance(),this._match(M),xe=this.expression(0),Ne={type:"KeyValuePair",name:ee,value:xe},E.push(Ne),this._lookahead(0)===T)this._match(T);else if(this._lookahead(0)===z){this._match(z);break}}return{type:"MultiSelectHash",children:E}}};function Le(E){this.runtime=E}Le.prototype={search:function(E,D){return this.visit(E,D)},visit:function(E,D){var F,ee,xe,Ne,Be,ge,je,wt,ut,Ye;switch(E.type){case"Field":return D!==null&&r(D)?(ge=D[E.name],ge===void 0?null:ge):null;case"Subexpression":for(xe=this.visit(E.children[0],D),Ye=1;Ye<E.children.length;Ye++)if(xe=this.visit(E.children[1],xe),xe===null)return null;return xe;case"IndexExpression":return je=this.visit(E.children[0],D),wt=this.visit(E.children[1],je),wt;case"Index":if(!n(D))return null;var Xe=E.value;return Xe<0&&(Xe=D.length+Xe),xe=D[Xe],xe===void 0&&(xe=null),xe;case"Slice":if(!n(D))return null;var Jt=E.children.slice(0),Un=this.computeSliceParams(D.length,Jt),Jn=Un[0],Kt=Un[1],Nn=Un[2];if(xe=[],Nn>0)for(Ye=Jn;Ye<Kt;Ye+=Nn)xe.push(D[Ye]);else for(Ye=Jn;Ye>Kt;Ye+=Nn)xe.push(D[Ye]);return xe;case"Projection":var rn=this.visit(E.children[0],D);if(!n(rn))return null;for(ut=[],Ye=0;Ye<rn.length;Ye++)ee=this.visit(E.children[1],rn[Ye]),ee!==null&&ut.push(ee);return ut;case"ValueProjection":if(rn=this.visit(E.children[0],D),!r(rn))return null;ut=[];var ln=s(rn);for(Ye=0;Ye<ln.length;Ye++)ee=this.visit(E.children[1],ln[Ye]),ee!==null&&ut.push(ee);return ut;case"FilterProjection":if(rn=this.visit(E.children[0],D),!n(rn))return null;var Sn=[],St=[];for(Ye=0;Ye<rn.length;Ye++)F=this.visit(E.children[2],rn[Ye]),i(F)||Sn.push(rn[Ye]);for(var Mn=0;Mn<Sn.length;Mn++)ee=this.visit(E.children[1],Sn[Mn]),ee!==null&&St.push(ee);return St;case"Comparator":switch(Ne=this.visit(E.children[0],D),Be=this.visit(E.children[1],D),E.name){case de:xe=o(Ne,Be);break;case ce:xe=!o(Ne,Be);break;case we:xe=Ne>Be;break;case X:xe=Ne>=Be;break;case ie:xe=Ne<Be;break;case W:xe=Ne<=Be;break;default:throw new Error("Unknown comparator: "+E.name)}return xe;case N:var Dt=this.visit(E.children[0],D);if(!n(Dt))return null;var nt=[];for(Ye=0;Ye<Dt.length;Ye++)ee=Dt[Ye],n(ee)?nt.push.apply(nt,ee):nt.push(ee);return nt;case"Identity":return D;case"MultiSelectList":if(D===null)return null;for(ut=[],Ye=0;Ye<E.children.length;Ye++)ut.push(this.visit(E.children[Ye],D));return ut;case"MultiSelectHash":if(D===null)return null;ut={};var cn;for(Ye=0;Ye<E.children.length;Ye++)cn=E.children[Ye],ut[cn.name]=this.visit(cn.value,D);return ut;case"OrExpression":return F=this.visit(E.children[0],D),i(F)&&(F=this.visit(E.children[1],D)),F;case"AndExpression":return Ne=this.visit(E.children[0],D),i(Ne)===!0?Ne:this.visit(E.children[1],D);case"NotExpression":return Ne=this.visit(E.children[0],D),i(Ne);case"Literal":return E.value;case he:return je=this.visit(E.children[0],D),this.visit(E.children[1],je);case I:return D;case"Function":var Gt=[];for(Ye=0;Ye<E.children.length;Ye++)Gt.push(this.visit(E.children[Ye],D));return this.runtime.callFunction(E.name,Gt);case"ExpressionReference":var ir=E.children[0];return ir.jmespathType=J,ir;default:throw new Error("Unknown node type: "+E.type)}},computeSliceParams:function(E,D){var F=D[0],ee=D[1],xe=D[2],Ne=[null,null,null];if(xe===null)xe=1;else if(xe===0){var Be=new Error("Invalid slice, step cannot be 0");throw Be.name="RuntimeError",Be}var ge=xe<0;return F===null?F=ge?E-1:0:F=this.capSliceRange(E,F,xe),ee===null?ee=ge?-1:E:ee=this.capSliceRange(E,ee,xe),Ne[0]=F,Ne[1]=ee,Ne[2]=xe,Ne},capSliceRange:function(E,D,F){return D<0?(D+=E,D<0&&(D=F<0?-1:0)):D>=E&&(D=F<0?E-1:E),D}};function Ke(E){this._interpreter=E,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[m]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[h,d]},{types:[u]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[h]},{types:[h]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[h,d,f]}]},map:{_func:this._functionMap,_signature:[{types:[v]},{types:[d]}]},max:{_func:this._functionMax,_signature:[{types:[m,b]}]},merge:{_func:this._functionMerge,_signature:[{types:[f],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[d]},{types:[v]}]},sum:{_func:this._functionSum,_signature:[{types:[m]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[h]},{types:[h]}]},min:{_func:this._functionMin,_signature:[{types:[m,b]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[d]},{types:[v]}]},type:{_func:this._functionType,_signature:[{types:[u]}]},keys:{_func:this._functionKeys,_signature:[{types:[f]}]},values:{_func:this._functionValues,_signature:[{types:[f]}]},sort:{_func:this._functionSort,_signature:[{types:[b,m]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[d]},{types:[v]}]},join:{_func:this._functionJoin,_signature:[{types:[h]},{types:[b]}]},reverse:{_func:this._functionReverse,_signature:[{types:[h,d]}]},to_array:{_func:this._functionToArray,_signature:[{types:[u]}]},to_string:{_func:this._functionToString,_signature:[{types:[u]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[u]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[u],variadic:!0}]}}}Ke.prototype={callFunction:function(E,D){var F=this.functionTable[E];if(F===void 0)throw new Error("Unknown function: "+E+"()");return this._validateArgs(E,D,F._signature),F._func.call(this,D)},_validateArgs:function(E,D,F){var ee;if(F[F.length-1].variadic){if(D.length<F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes at least"+F.length+ee+" but received "+D.length)}else if(D.length!==F.length)throw ee=F.length===1?" argument":" arguments",new Error("ArgumentError: "+E+"() takes "+F.length+ee+" but received "+D.length);for(var xe,Ne,Be,ge=0;ge<F.length;ge++){Be=!1,xe=F[ge].types,Ne=this._getTypeName(D[ge]);for(var je=0;je<xe.length;je++)if(this._typeMatches(Ne,xe[je],D[ge])){Be=!0;break}if(!Be){var wt=xe.map(function(ut){return y[ut]}).join(",");throw new Error("TypeError: "+E+"() expected argument "+(ge+1)+" to be type "+wt+" but received type "+y[Ne]+" instead.")}}},_typeMatches:function(E,D,F){if(D===u)return!0;if(D===b||D===m||D===d){if(D===d)return E===d;if(E===d){var ee;D===m?ee=l:D===b&&(ee=h);for(var xe=0;xe<F.length;xe++)if(!this._typeMatches(this._getTypeName(F[xe]),ee,F[xe]))return!1;return!0}}else return E===D},_getTypeName:function(E){switch(Object.prototype.toString.call(E)){case"[object String]":return h;case"[object Number]":return l;case"[object Array]":return d;case"[object Boolean]":return p;case"[object Null]":return g;case"[object Object]":return E.jmespathType===J?v:f}},_functionStartsWith:function(E){return E[0].lastIndexOf(E[1])===0},_functionEndsWith:function(E){var D=E[0],F=E[1];return D.indexOf(F,D.length-F.length)!==-1},_functionReverse:function(E){var D=this._getTypeName(E[0]);if(D===h){for(var F=E[0],ee="",xe=F.length-1;xe>=0;xe--)ee+=F[xe];return ee}else{var Ne=E[0].slice(0);return Ne.reverse(),Ne}},_functionAbs:function(E){return Math.abs(E[0])},_functionCeil:function(E){return Math.ceil(E[0])},_functionAvg:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D/F.length},_functionContains:function(E){return E[0].indexOf(E[1])>=0},_functionFloor:function(E){return Math.floor(E[0])},_functionLength:function(E){return r(E[0])?Object.keys(E[0]).length:E[0].length},_functionMap:function(E){for(var D=[],F=this._interpreter,ee=E[0],xe=E[1],Ne=0;Ne<xe.length;Ne++)D.push(F.visit(ee,xe[Ne]));return D},_functionMerge:function(E){for(var D={},F=0;F<E.length;F++){var ee=E[F];for(var xe in ee)D[xe]=ee[xe]}return D},_functionMax:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.max.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)ee.localeCompare(F[xe])<0&&(ee=F[xe]);return ee}else return null},_functionMin:function(E){if(E[0].length>0){var D=this._getTypeName(E[0][0]);if(D===l)return Math.min.apply(Math,E[0]);for(var F=E[0],ee=F[0],xe=1;xe<F.length;xe++)F[xe].localeCompare(ee)<0&&(ee=F[xe]);return ee}else return null},_functionSum:function(E){for(var D=0,F=E[0],ee=0;ee<F.length;ee++)D+=F[ee];return D},_functionType:function(E){switch(this._getTypeName(E[0])){case l:return"number";case h:return"string";case d:return"array";case f:return"object";case p:return"boolean";case v:return"expref";case g:return"null"}},_functionKeys:function(E){return Object.keys(E[0])},_functionValues:function(E){for(var D=E[0],F=Object.keys(D),ee=[],xe=0;xe<F.length;xe++)ee.push(D[F[xe]]);return ee},_functionJoin:function(E){var D=E[0],F=E[1];return F.join(D)},_functionToArray:function(E){return this._getTypeName(E[0])===d?E[0]:[E[0]]},_functionToString:function(E){return this._getTypeName(E[0])===h?E[0]:JSON.stringify(E[0])},_functionToNumber:function(E){var D=this._getTypeName(E[0]),F;return D===l?E[0]:D===h&&(F=+E[0],!isNaN(F))?F:null},_functionNotNull:function(E){for(var D=0;D<E.length;D++)if(this._getTypeName(E[D])!==g)return E[D];return null},_functionSort:function(E){var D=E[0].slice(0);return D.sort(),D},_functionSortBy:function(E){var D=E[0].slice(0);if(D.length===0)return D;var F=this._interpreter,ee=E[1],xe=this._getTypeName(F.visit(ee,D[0]));if([l,h].indexOf(xe)<0)throw new Error("TypeError");for(var Ne=this,Be=[],ge=0;ge<D.length;ge++)Be.push([ge,D[ge]]);Be.sort(function(wt,ut){var Ye=F.visit(ee,wt[1]),Xe=F.visit(ee,ut[1]);if(Ne._getTypeName(Ye)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Ye));if(Ne._getTypeName(Xe)!==xe)throw new Error("TypeError: expected "+xe+", received "+Ne._getTypeName(Xe));return Ye>Xe?1:Ye<Xe?-1:wt[0]-ut[0]});for(var je=0;je<Be.length;je++)D[je]=Be[je][1];return D},_functionMaxBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=-1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be>xe&&(xe=Be,Ne=F[ge]);return Ne},_functionMinBy:function(E){for(var D=E[1],F=E[0],ee=this.createKeyFunction(D,[l,h]),xe=1/0,Ne,Be,ge=0;ge<F.length;ge++)Be=ee(F[ge]),Be<xe&&(xe=Be,Ne=F[ge]);return Ne},createKeyFunction:function(E,D){var F=this,ee=this._interpreter,xe=function(Ne){var Be=ee.visit(E,Ne);if(D.indexOf(F._getTypeName(Be))<0){var ge="TypeError: expected one of "+D+", received "+F._getTypeName(Be);throw new Error(ge)}return Be};return xe}};function ft(E){var D=new pt,F=D.parse(E);return F}function We(E){var D=new ct;return D.tokenize(E)}function Nt(E,D){var F=new pt,ee=new Ke,xe=new Le(ee);ee._interpreter=xe;var Ne=F.parse(D);return xe.search(Ne,E)}e.tokenize=We,e.compile=ft,e.search=Nt,e.strictDeepEqual=o})(t)})(vj)),vj}var cN=lN();const uN=Ng(cN);var Tp={},gj;function hN(){if(gj)return Tp;gj=1;var t={b:"\b",f:"\f",n:`
|
|
2
2
|
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},e=97;Tp.parse=function(v,g,m){var b={},y=0,w=0,j=0,x=m&&m.bigint&&typeof BigInt<"u";return{data:k("",!0),pointers:b};function k(N,_){$();var P;de(N,"value");var oe=J();switch(oe){case"t":I("rue"),P=!0;break;case"f":I("alse"),P=!1;break;case"n":I("ull"),P=null;break;case'"':P=T();break;case"[":P=z(N);break;case"{":P=V(N);break;default:he(),"-0123456789".indexOf(oe)>=0?P=M():X()}return de(N,"valueEnd"),$(),_&&j<v.length&&X(),P}function $(){e:for(;j<v.length;){switch(v[j]){case" ":w++;break;case" ":w+=4;break;case"\r":w=0;break;case`
|
|
3
3
|
`:w=0,y++;break;default:break e}j++}}function T(){for(var N="",_;_=J(),_!='"';)_=="\\"?(_=J(),_ in t?N+=t[_]:_=="u"?N+=re():W()):N+=_;return N}function M(){var N="",_=!0;v[j]=="-"&&(N+=J()),N+=v[j]=="0"?J():Se(),v[j]=="."&&(N+=J()+Se(),_=!1),(v[j]=="e"||v[j]=="E")&&(N+=J(),(v[j]=="+"||v[j]=="-")&&(N+=J()),N+=Se(),_=!1);var P=+N;return x&&_&&(P>Number.MAX_SAFE_INTEGER||P<Number.MIN_SAFE_INTEGER)?BigInt(N):P}function z(N){$();var _=[],P=0;if(J()=="]")return _;for(he();;){var oe=N+"/"+P;_.push(k(oe)),$();var Ae=J();if(Ae=="]")break;Ae!=","&&W(),$(),P++}return _}function V(N){$();var _={};if(J()=="}")return _;for(he();;){var P=ie();J()!='"'&&W();var oe=T(),Ae=N+"/"+p(oe);we(Ae,"key",P),de(Ae,"keyEnd"),$(),J()!=":"&&W(),$(),_[oe]=k(Ae),$();var ae=J();if(ae=="}")break;ae!=","&&W(),$()}return _}function I(N){for(var _=0;_<N.length;_++)J()!==N[_]&&W()}function J(){ce();var N=v[j];return j++,w++,N}function he(){j--,w--}function re(){for(var N=4,_=0;N--;){_<<=4;var P=J().toLowerCase();P>="a"&&P<="f"?_+=P.charCodeAt()-e+10:P>="0"&&P<="9"?_+=+P:W()}return String.fromCharCode(_)}function Se(){for(var N="";v[j]>="0"&&v[j]<="9";)N+=J();if(N.length)return N;ce(),X()}function de(N,_){we(N,_,ie())}function we(N,_,P){b[N]=b[N]||{},b[N][_]=P}function ie(){return{line:y,column:w,pos:j}}function X(){throw new SyntaxError("Unexpected token "+v[j]+" in JSON at position "+j)}function W(){he(),X()}function ce(){if(j>=v.length)throw new SyntaxError("Unexpected end of JSON input")}},Tp.stringify=function(v,g,m){if(!r(v))return;var b=0,y,w,j=typeof m=="object"?m.space:m;switch(typeof j){case"number":var x=j>10?10:j<0?0:Math.floor(j);j=x&&we(x," "),y=x,w=x;break;case"string":j=j.slice(0,10),y=0,w=0;for(var k=0;k<j.length;k++){var $=j[k];switch($){case" ":w++;break;case" ":w+=4;break;case"\r":w=0;break;case`
|
|
4
4
|
`:w=0,b++;break;default:throw new Error("whitespace characters not allowed in JSON")}y++}break;default:j=void 0}var T="",M={},z=0,V=0,I=0,J=m&&m.es6&&typeof Map=="function";return he(v,0,""),{json:T,pointers:M};function he(ie,X,W){switch(de(W,"value"),typeof ie){case"number":case"bigint":case"boolean":re(""+ie);break;case"string":re(h(ie));break;case"object":ie===null?re("null"):typeof ie.toJSON=="function"?re(h(ie.toJSON())):Array.isArray(ie)?ce():J?ie.constructor.BYTES_PER_ELEMENT?ce():ie instanceof Map?_():ie instanceof Set?_(!0):N():N()}de(W,"valueEnd");function ce(){if(ie.length){re("[");for(var P=X+1,oe=0;oe<ie.length;oe++){oe&&re(","),Se(P);var Ae=r(ie[oe])?ie[oe]:null,ae=W+"/"+oe;he(Ae,P,ae)}Se(X),re("]")}else re("[]")}function N(){var P=Object.keys(ie);if(P.length){re("{");for(var oe=X+1,Ae=0;Ae<P.length;Ae++){var ae=P[Ae],Y=ie[ae];if(r(Y)){Ae&&re(",");var ye=W+"/"+p(ae);Se(oe),de(ye,"key"),re(h(ae)),de(ye,"keyEnd"),re(":"),j&&re(" "),he(Y,oe,ye)}}Se(X),re("}")}else re("{}")}function _(P){if(ie.size){re("{");for(var oe=X+1,Ae=!0,ae=ie.entries(),Y=ae.next();!Y.done;){var ye=Y.value,A=ye[0],q=P?!0:ye[1];if(r(q)){Ae||re(","),Ae=!1;var U=W+"/"+p(A);Se(oe),de(U,"key"),re(h(A)),de(U,"keyEnd"),re(":"),j&&re(" "),he(q,oe,U)}Y=ae.next()}Se(X),re("}")}else re("{}")}}function re(ie){V+=ie.length,I+=ie.length,T+=ie}function Se(ie){if(j){for(T+=`
|
package/dist/build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.2.0","build_id":"958152ab4181e3a7faed6fc24e6b47743d4a886f"}
|
package/dist/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
type="module"
|
|
15
15
|
async
|
|
16
16
|
crossorigin
|
|
17
|
-
src="/assets/app-
|
|
17
|
+
src="/assets/app-jfWpanfK.js"
|
|
18
18
|
></script>
|
|
19
19
|
<style>
|
|
20
20
|
@font-face {
|
|
@@ -504,8 +504,8 @@
|
|
|
504
504
|
href="/assets/app-Dzrp8B7R.css"
|
|
505
505
|
as="style"
|
|
506
506
|
/>
|
|
507
|
-
<link rel="modulepreload" crossorigin href="/assets/Main-
|
|
508
|
-
<link rel="preload" href="/assets/Main-
|
|
507
|
+
<link rel="modulepreload" crossorigin href="/assets/Main-CWVVijRK.js" />
|
|
508
|
+
<link rel="preload" href="/assets/Main-B4YDXfN4.css" as="style" />
|
|
509
509
|
<link
|
|
510
510
|
rel="preload"
|
|
511
511
|
as="font"
|
|
@@ -792,10 +792,9 @@
|
|
|
792
792
|
</div>
|
|
793
793
|
</div>
|
|
794
794
|
|
|
795
|
-
<link rel="stylesheet" href="/assets/
|
|
795
|
+
<link rel="stylesheet" crossorigin href="/assets/app-Dzrp8B7R.css" /><link
|
|
796
796
|
rel="stylesheet"
|
|
797
|
-
|
|
798
|
-
href="/assets/app-Dzrp8B7R.css"
|
|
797
|
+
href="/assets/Main-B4YDXfN4.css"
|
|
799
798
|
/>
|
|
800
799
|
</body>
|
|
801
800
|
</html>
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vanilla-jsoneditor-DGRLPOia.js","assets/app-CB6IRUmn.js","assets/app-Dzrp8B7R.css","assets/styles-handler-ChlYo-U5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{d as ft,c as d,o as u,r as Bt,a as _,w as fe,n as _e,b as K,i as qt,e as B,f as $,g as At,h as de,_ as re,j as ht,k as Ke,l as Lt,m as Je,p as Tt,q as Rt,u as zt,s as Mt,t as It,v as Pt,x as Vt,y as Nt,z as s,A as g,B as b,C as P,D as Q,E as Dt,S as Ut,U as Ft,F as ue,G as ce,H as $e,I as Ue,J as rt,K as Ht,L as it}from"./app-CB6IRUmn.js";const Kt=["selection","mainMenuBar","navigationBar","statusBar","askToFormat","readOnly","indentation","tabSize","escapeControlCharacters","escapeUnicodeCharacters","flattenColumns","validator","onClassName","onRenderValue","onRenderMenu"],Jt=["selection","mode","mainMenuBar","navigationBar","statusBar","askToFormat","readOnly","indentation","tabSize","escapeControlCharacters","escapeUnicodeCharacters","flattenColumns","validator","parser","validationParser","pathParser","onClassName","onRenderValue","onRenderMenu"],Qt=(i={},E)=>{const S={};for(const k of Jt){const m=E[k]!==void 0?E[k]:i[k];m!==void 0&&(S[k]=m)}return S},Wt=`
|
|
3
|
-
<svg
|
|
4
|
-
class="fa-icon svelte-1dof0an"
|
|
5
|
-
viewBox="0 0 1024 1024"
|
|
6
|
-
version="1.1"
|
|
7
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
p-id="1927" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
9
|
-
width="24"
|
|
10
|
-
height="24"
|
|
11
|
-
>
|
|
12
|
-
<path d="M63.989383 105.442494l0 268.396843c0 18.935258 15.368012 34.304294 34.304294 34.304294 18.936281 0 34.304294-15.369036 34.304294-34.304294L132.597971 180.156126l218.107483 218.176045c12.82919 12.830213 33.618679 12.830213 46.515407 0 12.830213-12.897751 12.830213-33.686217 0-46.51643l-218.176045-218.107483 193.683211 0c18.935258 0 34.304294-15.369036 34.304294-34.304294 0-18.935258-15.369036-34.304294-34.304294-34.304294L104.331183 65.09967C79.288834 65.09967 63.989383 77.999468 63.989383 105.442494L63.989383 105.442494z" p-id="1928" fill="#e6e6e6"></path><path d="M917.688719 65.09967 649.290853 65.09967c-18.935258 0-34.304294 15.369036-34.304294 34.304294 0 18.936281 15.369036 34.304294 34.304294 34.304294l193.683211 0-218.176045 218.107483c-12.830213 12.82919-12.830213 33.618679 0 46.51643 12.897751 12.830213 33.686217 12.830213 46.515407 0L889.420909 180.156126l0 193.683211c0 18.935258 15.369036 34.304294 34.304294 34.304294 18.936281 0 34.304294-15.369036 34.304294-34.304294L958.029496 105.442494C958.029496 77.999468 942.79963 65.09967 917.688719 65.09967L917.688719 65.09967z" p-id="1929" fill="#e6e6e6"></path>
|
|
13
|
-
<path d="M104.331183 957.013353l268.397866 0c18.935258 0 34.304294-15.368012 34.304294-34.304294 0-18.936281-15.369036-34.304294-34.304294-34.304294L179.045839 888.404766l218.176045-218.107483c12.830213-12.82919 12.830213-33.618679 0-46.515407-12.897751-12.830213-33.686217-12.830213-46.515407 0l-218.107483 218.176045L132.598994 648.27471c0-18.935258-15.368012-34.304294-34.304294-34.304294-18.936281 0-34.304294 15.369036-34.304294 34.304294l0 268.397866C63.989383 944.115602 79.288834 957.013353 104.331183 957.013353L104.331183 957.013353z" p-id="1930" fill="#e6e6e6"></path>
|
|
14
|
-
<path d="M958.029496 916.671553 958.029496 648.27471c0-18.935258-15.368012-34.304294-34.304294-34.304294-18.935258 0-34.304294 15.369036-34.304294 34.304294l0 193.683211L671.313425 623.781876c-12.82919-12.830213-33.618679-12.830213-46.515407 0-12.830213 12.897751-12.830213 33.686217 0 46.515407l218.176045 218.107483L649.290853 888.404766c-18.935258 0-34.304294 15.368012-34.304294 34.304294 0 18.936281 15.369036 34.304294 34.304294 34.304294l268.397866 0C942.79963 957.013353 958.029496 944.115602 958.029496 916.671553L958.029496 916.671553z" p-id="1931" fill="#e6e6e6"></path>
|
|
15
|
-
</svg>
|
|
16
|
-
`,ke=(i,E,S=!1)=>{const k=i&&typeof i[E]<"u";return!k&&S&&console.warn("Typeguard warn!!! The object has no property: ",E),k},Gt=ft({name:"JsonEditor",props:{modelValue:[Object,Array,Number,String,Boolean,String,null],value:{type:[Object,Array,Number,String,Boolean,String,null],default:void 0},json:{type:[Object,Array,Number,String,Boolean,null],default:void 0},text:String,jsonString:String,selection:{type:Object,default:void 0},mode:{type:String,default:"tree"},mainMenuBar:{type:Boolean,default:void 0},navigationBar:{type:Boolean,default:void 0},statusBar:{type:Boolean,default:void 0},askToFormat:{type:Boolean,default:void 0},readOnly:{type:Boolean,default:void 0},indentation:[String,Number],tabSize:Number,escapeControlCharacters:{type:Boolean,default:void 0},escapeUnicodeCharacters:{type:Boolean,default:void 0},flattenColumns:{type:Boolean,default:void 0},validator:Function,parser:Object,validationParser:Object,pathParser:Object,queryLanguagesIds:Array,queryLanguageId:String,onClassName:Function,onRenderValue:Function,onRenderMenu:Function,height:[String,Number],fullWidthButton:{type:Boolean,default:void 0},darkTheme:{type:Boolean,default:void 0}},emits:["update:modelValue","update:json","update:text","update:jsonString","update:selection","change","error","change-mode","update:mode","change-query-language","focus","blur"],setup(i,{expose:E,emit:S}){const k=qt("jsonEditorOptions",{}),m=B(),x=B(null),N=B(!1),M=B(!1),W=B("tree"),j=B(null),J=$(()=>{const a=i.height||k?.height;return a&&!N.value?{height:a+"px"}:{}}),U=$(()=>i.darkTheme||k?.darkTheme),F=$(()=>i.queryLanguagesIds||k?.queryLanguagesIds),G=$(()=>i.queryLanguageId||k?.queryLanguageId),O=At({}),z=async()=>{if(typeof window>"u"||typeof F.value>"u"||!F.value?.length)return;for(const w of F.value)if(!O[w])switch(w){case"javascript":{const{javascriptQueryLanguage:A}=await re(async()=>{const{javascriptQueryLanguage:q}=await import("./vanilla-jsoneditor-DGRLPOia.js");return{javascriptQueryLanguage:q}},__vite__mapDeps([0,1,2]));O[w]=A;break}case"lodash":{const{lodashQueryLanguage:A}=await re(async()=>{const{lodashQueryLanguage:q}=await import("./vanilla-jsoneditor-DGRLPOia.js");return{lodashQueryLanguage:q}},__vite__mapDeps([0,1,2]));O[w]=A;break}case"jmespath":{const{jmespathQueryLanguage:A}=await re(async()=>{const{jmespathQueryLanguage:q}=await import("./vanilla-jsoneditor-DGRLPOia.js");return{jmespathQueryLanguage:q}},__vite__mapDeps([0,1,2]));O[w]=A;break}case"jsonquery":{const{jsonQueryLanguage:A}=await re(async()=>{const{jsonQueryLanguage:q}=await import("./vanilla-jsoneditor-DGRLPOia.js");return{jsonQueryLanguage:q}},__vite__mapDeps([0,1,2]));O[w]=A;break}case"jsonpath":{const{jsonpathQueryLanguage:A}=await re(async()=>{const{jsonpathQueryLanguage:q}=await import("./vanilla-jsoneditor-DGRLPOia.js");return{jsonpathQueryLanguage:q}},__vite__mapDeps([0,1,2]));O[w]=A;break}}const a=Object.values(O);if(a.length!==0)return a},T=()=>{x.value&&(x.value.removeEventListener("click",H),x.value=null)},Y=async()=>{if(typeof window>"u")return;const{getElement:a,createElement:w}=await re(async()=>{const{getElement:oe,createElement:we}=await import("./full-width-button-handler-oqK5S8oj.js");return{getElement:oe,createElement:we}},[]),{setFullWidthButtonStyle:A}=await re(async()=>{const{setFullWidthButtonStyle:oe}=await import("./styles-handler-ChlYo-U5.js");return{setFullWidthButtonStyle:oe}},__vite__mapDeps([3,1,2]));await A();const q=a(m.value,".jse-full-width"),Se=k?.fullWidthButton!==void 0?k?.fullWidthButton:!0;if(!(i.fullWidthButton!==void 0?i.fullWidthButton:Se)||q)return;x.value&&T();const ye=a(m.value,".jse-menu"),X=Array.from(ye.classList).find(oe=>oe.startsWith("svelte-"));x.value=w("button"),x.value.classList.add("jse-full-width"),N.value&&x.value.classList.add("jse-full-width--active"),x.value.classList.add("jse-button"),x.value.classList.add(X),x.value.innerHTML+=Wt,ye.appendChild(x.value),x.value.addEventListener("click",H)},H=()=>{N.value=!N.value,N.value?x.value?.classList.add("jse-full-width--active"):(x.value?.classList.remove("jse-full-width--active"),x.value?.blur())},he=(a,w,A)=>{if(M.value){setTimeout(()=>{M.value=!1});return}M.value=!0,ke(a,"json")&&(S("update:json",a.json),S("update:modelValue",a.json)),ke(a,"text")&&(S("update:text",a.text),S("update:jsonString",a.text),S("update:modelValue",a.text)),S("change",a,w,A),setTimeout(()=>{M.value=!1})},pe=a=>{S("error",a)},ie=a=>{W.value=a,S("change-mode",a),S("update:mode",a)},ne=a=>{S("change-query-language",a)},ae=()=>{S("focus")},t=()=>{S("blur")},c=a=>{S("update:selection",a)},l=(a,w)=>(Ke(()=>{Y()}),typeof i.onRenderMenu=="function"?i.onRenderMenu(a,w):a),p=async()=>{const a={fullWidthButton:!0,...k||{}},w=await z();return{...Qt(a,i),queryLanguages:w,queryLanguageId:G.value,onChange:he,onError:pe,onChangeMode:ie,onChangeQueryLanguage:ne,onFocus:ae,onBlur:t,onRenderMenu:l,onSelect:c}},r=B(!0),v=()=>{const a=(q={})=>q===null||typeof q>"u"||typeof q=="number"||typeof q=="bigint"||typeof q=="string"||typeof q=="boolean"?{json:q}:Array.isArray(q)?{json:[...q]}:{json:{...q}},w=(q="")=>({text:q||""}),A=i.modelValue||i.value;return A?W.value==="text"&&typeof A=="string"?w(A):a(A):typeof i.json<"u"?a(i.json):typeof i.text<"u"?w(i.text):typeof i.jsonString<"u"?w(i.jsonString):w()},h=async()=>{if(!(typeof window>"u")){if(!j.value){const a=await p(),{createJSONEditor:w}=await re(async()=>{const{createJSONEditor:q}=await import("./vanilla-jsoneditor-DGRLPOia.js");return{createJSONEditor:q}},__vite__mapDeps([0,1,2]));r.value=!1,j.value=w({target:m.value,props:a});const A=v();j.value.set(A),setTimeout(()=>{M.value=!1},0)}j.value.focus()}},V=async()=>{const a=await p();j.value?.updateProps(a)},se=()=>{if(M.value)return;const a=v(),w=j.value?.get();let A=!1;if(ke(a,"text")&&ke(w,"text"))A=a.text===w.text;else if(ke(a,"json")&&ke(w,"json"))A=JSON.stringify(a.json)===JSON.stringify(w.json);else{const q=JSON.stringify(a),Se=JSON.stringify(w);A=q===Se}A||(M.value=!0,j.value?.update(a),setTimeout(()=>{M.value=!1}))},ee=()=>{j.value&&(j.value.destroy(),j.value=null),T()};de([...Kt.map(a=>()=>i[a])],V,{deep:!0});const y=()=>{M.value&&setTimeout(()=>{M.value=!1},10)};return de([()=>i.modelValue,()=>i.value,()=>i.json,()=>i.text,()=>i.jsonString],()=>{se(),y()},{deep:!0}),de(()=>i.mode,a=>{a!==W.value&&(W.value=a,V())}),de(()=>U.value,async a=>{if(a){const{setDarkThemeStyle:w}=await re(async()=>{const{setDarkThemeStyle:A}=await import("./styles-handler-ChlYo-U5.js");return{setDarkThemeStyle:A}},__vite__mapDeps([3,1,2]));await w()}},{immediate:!0}),ht(()=>{Ke(()=>{h()})}),Lt(()=>{ee()}),E({$collapseAll(){W.value==="tree"&&j.value?.collapse([],!0)},$expandAll(){W.value==="tree"&&j.value?.expand([])},$expand(a,w){typeof a=="function"?(j.value?.expand([],a),console.warn("In new API you must pass the path before the callback!!! Backwards compatibility is deprecated and will be discontinued in the future")):j.value?.expand(a,w)},$get(){return j.value?.get()},$set(a){j.value?.set(a)},$update(a){j.value?.update(a)},$updateProps(a){j.value?.updateProps(a)},async $refresh(){await j.value?.refresh()},$focus(){j.value?.focus()},async $destroy(){await j.value?.destroy()},$patch(a){return j.value?.patch(a)},$transform(a){j.value?.transform(a)},async $scrollTo(a){await j.value?.scrollTo(a)},$findElement(a){return j.value?.findElement(a)},$acceptAutoRepair(){return j.value?.acceptAutoRepair()},$validate(){return j.value?.validate()}}),{max:N,getHeight:J,container:m,darkThemeStyle:U,fallbackSlot:r}}}),Xt=(i,E)=>{const S=i.__vccOpts||i;for(const[k,m]of E)S[k]=m;return S};function Zt(i,E,S,k,m,x){return u(),d("div",{class:K(["vue-ts-json-editor",{"vue-ts-json-editor--max-box":i.max,"jse-theme-dark":i.darkThemeStyle}]),style:_e(i.getHeight),ref:"container",onKeydown:E[0]||(E[0]=fe(()=>{},["stop"]))},[i.fallbackSlot?Bt(i.$slots,"default",{key:0}):_("",!0)],38)}const be=Xt(Gt,[["render",Zt]]);be.install=()=>{console.error(`Default import not working!!! Use "import {JsonEditorPlugin} from 'vue3-ts-jsoneditor';"`)};const yt=i=>new Proxy(()=>{},{apply:async(E,S,k)=>{if(typeof window>"u")throw new Error(`${i} is not available on server side. Please use it only in client-side code.`);return(await re(()=>import("./vanilla-jsoneditor-DGRLPOia.js"),__vite__mapDeps([0,1,2])))[i](...k)}});yt("renderValue");yt("renderJSONSchemaEnum");const ut=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yt=i=>i.replace(/^([A-Z])|[\s-_]+(\w)/g,(E,S,k)=>k?k.toUpperCase():S.toLowerCase()),en=i=>{const E=Yt(i);return E.charAt(0).toUpperCase()+E.slice(1)},tn=(...i)=>i.filter((E,S,k)=>!!E&&E.trim()!==""&&k.indexOf(E)===S).join(" ").trim(),ct=i=>i==="";var xe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const nn=({name:i,iconNode:E,absoluteStrokeWidth:S,"absolute-stroke-width":k,strokeWidth:m,"stroke-width":x,size:N=xe.width,color:M=xe.stroke,...W},{slots:j})=>Je("svg",{...xe,...W,width:N,height:N,stroke:M,"stroke-width":ct(S)||ct(k)||S===!0||k===!0?Number(m||x||xe["stroke-width"])*24/Number(N):m||x||xe["stroke-width"],class:tn("lucide",W.class,...i?[`lucide-${ut(en(i))}-icon`,`lucide-${ut(i)}`]:["lucide-icon"])},[...E.map(J=>Je(...J)),...j.default?[j.default()]:[]]);const te=(i,E)=>(S,{slots:k,attrs:m})=>Je(nn,{...m,...S,iconNode:E,name:i},k);const sn=te("chart-no-axes-column-increasing",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]]);const Fe=te("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const dt=te("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const je=te("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const an=te("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const pt=te("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const on=te("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const He=te("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);const me=te("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const vt=te("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);const ln=te("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const rn=te("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),un=Tt("openapi",()=>{const i=B(null),E=B(!0),S=B(null),k=$(()=>Rt()),m=$(()=>{if(!i.value)return[];const t=[];for(const[c,l]of Object.entries(i.value.paths))if(l)for(const p of["get","post","put","patch","delete"]){const r=l[p];r&&t.push({path:c,method:p.toUpperCase(),operation:r})}return t.sort((c,l)=>c.path!==l.path?c.path.localeCompare(l.path):c.method.localeCompare(l.method))}),x=$(()=>{if(!i.value?.components?.securitySchemes)return[];const t=[];for(const[c,l]of Object.entries(i.value.components.securitySchemes))l&&typeof l=="object"&&!("$ref"in l)&&t.push({name:c,scheme:l});return t}),N=$(()=>i.value?.info?.title||"OpenAPI Studio"),M=$(()=>i.value?.info?.description||null),W=$(()=>i.value?.info?.version||null);async function j(t){E.value=!0,S.value=null;try{const c=t||k.value,l=await fetch(c);if(!l.ok)throw new Error(`Failed to fetch OpenAPI spec: ${l.statusText}`);i.value=await l.json()}catch(c){S.value=c instanceof Error?c.message:"Failed to load OpenAPI spec"}finally{E.value=!1}}function J(t,c){const l=(typeof t=="string"?t:t.$ref).replace("#/","").split("/");let p=c;for(const r of l)if(p&&typeof p=="object"&&r in p)p=p[r];else return null;return p}function U(t){if(!t||typeof t!="object")return null;if("$ref"in t&&t.$ref){if(!i.value)return null;const c=J(t.$ref,i.value);return c&&typeof c=="object"&&"name"in c&&"in"in c?c:null}return"name"in t&&"in"in t?t:null}function F(t,c){if(!t||typeof t!="object")return null;if("$ref"in t&&t.$ref){const r=J(t.$ref,c);return!r||typeof r!="object"?null:F(r,c)}if("example"in t&&t.example!==void 0)return t.example;if("enum"in t&&t.enum&&t.enum.length>0)return t.enum[0];const l=t,p=l.type||(l.anyOf?"anyOf":l.oneOf?"oneOf":l.allOf?"allOf":"object");switch(p){case"string":if("format"in l)switch(l.format){case"date":return"2024-01-01";case"date-time":return"2024-01-01T00:00:00Z";case"email":return"example@example.com";case"uri":return"https://example.com";case"uuid":return"123e4567-e89b-12d3-a456-426614174000"}return"default"in l&&l.default!==void 0?l.default:"string";case"number":case"integer":return"default"in l&&l.default!==void 0?l.default:0;case"boolean":return"default"in l&&l.default!==void 0?l.default:!1;case"array":if("items"in t&&t.items){const v=F(t.items,c);return t.minItems&&t.minItems>0?Array(t.minItems).fill(v):[v]}return[];case"object":const r={};if("properties"in t&&t.properties)for(const[v,h]of Object.entries(t.properties))"required"in t&&t.required&&t.required.includes(v)?r[v]=F(h,c):"required"in t||(r[v]=F(h,c));return r;case"anyOf":return"anyOf"in t&&t.anyOf&&t.anyOf.length>0?F(t.anyOf[0],c):{};case"oneOf":return"oneOf"in t&&t.oneOf&&t.oneOf.length>0?F(t.oneOf[0],c):{};case"allOf":if("allOf"in t&&t.allOf){const v={};for(const h of t.allOf){const V=F(h,c);typeof V=="object"&&V!==null&&!Array.isArray(V)&&Object.assign(v,V)}return v}return{};default:return null}}function G(t,c,l=new Set,p=0,r){if(!t||typeof t!="object")return"";const v=" ".repeat(p);let h="";if("$ref"in t&&t.$ref){if(l.has(t.$ref))return`${v}${r||""} → ${t.$ref.split("/").pop()} ⚠ circular
|
|
17
|
-
`;l.add(t.$ref);const y=J(t.$ref,c);if(!y||typeof y!="object")return l.delete(t.$ref),`${v}${r||""} → ${t.$ref.split("/").pop()} (invalid)
|
|
18
|
-
`;const a=t.$ref.split("/").pop()||"Unknown";return r!==void 0?(h+=`${v}${r} → ${a}
|
|
19
|
-
`,h+=G(y,c,l,p,void 0)):(h+=`${v}→ ${a}
|
|
20
|
-
`,h+=G(y,c,l,p,void 0)),l.delete(t.$ref),h}const V=y=>{if(y.type==="array"&&y.items)return`Array<${V(y.items)}>`;if(y.type){let a=y.type;return y.format&&(a=`${y.type}(${y.format})`),y.enum&&(a=`${a} | ${y.enum.map(w=>JSON.stringify(w)).join(" | ")}`),a}return y.allOf?"allOf":y.anyOf?"anyOf":y.oneOf?"oneOf":"object"},se=V(t),ee=r&&"required"in t&&t.required&&Array.isArray(t.required)&&t.required.includes(r);if(r!==void 0?(h+=`${v}${r}${ee?"*":""}: ${se}`,"description"in t&&t.description&&(h+=` // ${t.description}`),h+=`
|
|
21
|
-
`):p===0&&"properties"in t&&(h+=`${v}{
|
|
22
|
-
`),"properties"in t&&t.properties){for(const[y,a]of Object.entries(t.properties))h+=G(a,c,l,p+1,y);p===0&&"type"in t&&t.type==="object"&&(h+=`${v}}
|
|
23
|
-
`)}if("items"in t&&t.items&&"type"in t&&t.type==="array"&&("properties"in t.items||"$ref"in t.items)&&(h+=`${v} items:
|
|
24
|
-
`,h+=G(t.items,c,l,p+2)),"allOf"in t&&t.allOf&&t.allOf.forEach((y,a)=>{h+=`${v} allOf[${a}]:
|
|
25
|
-
`,h+=G(y,c,l,p+2)}),"anyOf"in t&&t.anyOf&&t.anyOf.forEach((y,a)=>{h+=`${v} anyOf[${a}]:
|
|
26
|
-
`,h+=G(y,c,l,p+2)}),"oneOf"in t&&t.oneOf&&t.oneOf.forEach((y,a)=>{h+=`${v} oneOf[${a}]:
|
|
27
|
-
`,h+=G(y,c,l,p+2)}),r){const y=[];"pattern"in t&&t.pattern&&y.push(`pattern: ${t.pattern}`),"default"in t&&t.default!==void 0&&y.push(`default: ${JSON.stringify(t.default)}`),"minLength"in t&&t.minLength!==void 0&&y.push(`minLength: ${t.minLength}`),"maxLength"in t&&t.maxLength!==void 0&&y.push(`maxLength: ${t.maxLength}`),"minimum"in t&&t.minimum!==void 0&&y.push(`min: ${t.minimum}`),"maximum"in t&&t.maximum!==void 0&&y.push(`max: ${t.maximum}`),y.length>0&&(h+=`${v} (${y.join(", ")})
|
|
28
|
-
`)}return h}function O(t,c,l,p=new Set){if(!(!t||typeof t!="object")){if("$ref"in t&&t.$ref){if(p.has(t.$ref))return;p.add(t.$ref);const r=J(t.$ref,c);if(!r||typeof r!="object"){p.delete(t.$ref);return}const v=t.$ref.split("/").pop()||"Unknown";l.has(t.$ref)||l.set(t.$ref,{name:v,schema:r}),O(r,c,l,p),p.delete(t.$ref);return}if("properties"in t&&t.properties)for(const r of Object.values(t.properties))O(r,c,l,p);"items"in t&&t.items&&O(t.items,c,l,p),"allOf"in t&&t.allOf&&t.allOf.forEach(r=>O(r,c,l,p)),"anyOf"in t&&t.anyOf&&t.anyOf.forEach(r=>O(r,c,l,p)),"oneOf"in t&&t.oneOf&&t.oneOf.forEach(r=>O(r,c,l,p))}}function z(t,c){if(!i.value||!t||!c)return null;const l=i.value.paths[t];if(!l)return null;const p=c.toLowerCase();return l[p]||null}function T(t){if(!t||!i.value)return null;let c=t.requestBody;if(!c||typeof c!="object")return null;if("$ref"in c&&c.$ref){const p=J(c.$ref,i.value);if(!p||typeof p!="object")return null;c=p}if(!c||!("content"in c)||!c.content)return null;const l=c.content["application/json"];return!l||!l.schema?null:l.schema}function Y(t){if(!t||!i.value)return null;const c=T(t);return c?F(c,i.value):null}function H(t,c=!0){if(!t||!i.value)return null;const l=t.responses;if(!l||typeof l!="object")return null;const p=["200","201","202","204"];let r;if(c){for(const h of p)if(l&&h in l){r=l[h];break}}if(!r&&l){const h=Object.keys(l)[0];h&&(r=l[h])}if(!r||typeof r!="object")return null;if("$ref"in r&&r.$ref){const h=J(r.$ref,i.value);if(!h||typeof h!="object")return null;r=h}if(!r||typeof r!="object"||!("content"in r)||!r.content)return null;const v=r.content["application/json"];return!v||!v.schema?null:F(v.schema,i.value)}function he(t){if(!t||!i.value)return[];const c=t.responses;if(!c||typeof c!="object")return[];const l=[];for(const[p,r]of Object.entries(c)){let v=r;if(v&&typeof v=="object"&&"$ref"in v&&v.$ref){const a=J(v.$ref,i.value);if(!a||typeof a!="object")continue;v=a}if(!v||typeof v!="object")continue;const h="description"in v&&v.description||"No description";let V=null,se;if("content"in v&&v.content){const a=v.content["application/json"];a&&a.schema&&(se=a.schema,V=F(a.schema,i.value))}const ee=parseInt(p),y=!isNaN(ee)&&ee>=200&&ee<300;l.push({code:p,description:h,example:V,schema:se,isSuccess:y})}return l.sort((p,r)=>{if(p.isSuccess!==r.isSuccess)return p.isSuccess?-1:1;const v=parseInt(p.code),h=parseInt(r.code);return!isNaN(v)&&!isNaN(h)?v-h:p.code.localeCompare(r.code)})}function pe(t){if(!t||!i.value)return[];const c=new Map,l=T(t);if(l&&O(l,i.value,c),t.responses)for(const p of Object.values(t.responses)){let r=p;if(r&&typeof r=="object"&&"$ref"in r&&r.$ref){const v=J(r.$ref,i.value);v&&typeof v=="object"&&(r=v)}if(r&&typeof r=="object"&&"content"in r&&r.content){const v=r.content["application/json"];v&&v.schema&&O(v.schema,i.value,c)}}if(t.parameters)for(const p of t.parameters){const r=U(p);r&&r.schema&&O(r.schema,i.value,c)}return Array.from(c.values()).sort((p,r)=>p.name.localeCompare(r.name))}function ie(t){return i.value?!!(t.security&&t.security.length>0||i.value.security&&i.value.security.length>0):!1}function ne(t){if(!i.value?.components?.securitySchemes)return[];const c=new Set,l=[];if(t.security&&t.security.length>0){for(const p of t.security)for(const r in p)if(!c.has(r)){c.add(r);const v=x.value.find(h=>h.name===r);v&&l.push(v)}}else if(i.value.security&&i.value.security.length>0){for(const p of i.value.security)for(const r in p)if(!c.has(r)){c.add(r);const v=x.value.find(h=>h.name===r);v&&l.push(v)}}return l}function ae(t){if(!t||!i.value?.components?.securitySchemes)return[];const c=new Set,l=[];if(t.security&&t.security.length>0){for(const p of t.security)for(const r in p)if(!c.has(r)){c.add(r);const v=x.value.find(h=>h.name===r);v&&l.push(v)}return l}if(i.value.security&&i.value.security.length>0){for(const p of i.value.security)for(const r in p)if(!c.has(r)){c.add(r);const v=x.value.find(h=>h.name===r);v&&l.push(v)}}return l}return{openApiSpec:i,loading:E,error:S,openApiSpecUrl:k,endpoints:m,securitySchemes:x,openApiTitle:N,openApiDescription:M,openApiVersion:W,loadSpec:j,resolveReference:J,resolveParameter:U,generateExampleFromSchema:F,formatSchemaForDisplay:G,getSelectedEndpoint:z,getRequestBodySchema:T,getExampleFromRequestBody:Y,getExampleFromResponse:H,getAllResponseExamples:he,getEndpointSchemaReferences:pe,endpointRequiresSecurity:ie,getRequiredSecuritySchemes:ne,getAvailableSecuritySchemes:ae}}),cn={class:"openapi-test"},dn={class:"test-header"},pn={class:"header-content"},vn={class:"header-title-section"},fn={class:"title-row"},hn={class:"logo"},yn={key:0,class:"api-version"},mn={key:0,class:"api-description"},gn={class:"header-actions"},kn=["href"],_n={href:"https://github.com/gamja-labs/openapi-studio",target:"_blank",rel:"noopener noreferrer",class:"github-link",title:"View on GitHub"},bn={key:0,class:"auth-section"},Sn={key:1,class:"user-section"},wn={key:0,class:"auth-side-menu"},Cn={class:"auth-menu-header"},$n={class:"auth-menu-content"},xn={class:"auth-scheme-header"},jn={style:{display:"flex","align-items":"center",gap:"0.5rem"}},On={class:"auth-scheme-header"},En={style:{display:"flex","align-items":"center",gap:"0.5rem"}},Bn=["onClick"],qn={class:"auth-scheme-header"},An={style:{display:"flex","align-items":"center",gap:"0.5rem"}},Ln={class:"auth-scheme-type"},Tn={key:0,class:"auth-scheme-description"},Rn={class:"field-location"},zn=["value","onInput","placeholder"],Mn=["onClick"],In=["value","onInput"],Pn=["value","onInput"],Vn=["onClick"],Nn=["value","onInput"],Dn=["onClick"],Un=["value","onInput"],Fn=["onClick"],Hn=["value","onInput"],Kn=["onClick"],Jn={class:"clerk-key-card"},Qn={class:"clerk-key-description"},Wn={key:0},Gn={key:1},Xn={class:"clerk-key-fields"},Zn=["disabled"],Yn={class:"test-container"},es={class:"sidebar-header"},ts=["title"],ns={class:"sidebar-content"},ss={key:0,class:"loading"},as={key:1,class:"error"},os={key:2,class:"endpoints-groups"},ls=["onClick"],rs={class:"group-name"},is={class:"group-count"},us={class:"group-toggle"},cs={key:0,class:"group-endpoints"},ds=["onClick"],ps={class:"endpoint-path"},vs={class:"endpoint-meta"},fs={key:0,class:"endpoint-summary"},hs={key:1,class:"endpoint-content"},ys={class:"endpoint-tester"},ms={class:"endpoint-header"},gs={class:"endpoint-title"},ks={class:"endpoint-path"},_s={key:0,class:"endpoint-info"},bs={key:0,class:"endpoint-summary-text"},Ss={key:1,class:"endpoint-description"},ws={key:0,class:"security-schemes-wrapper"},Cs={class:"security-schemes-section"},$s=["onClick"],xs={class:"scheme-name"},js={class:"request-section"},Os={key:0,class:"params-section"},Es={class:"params-list"},Bs={class:"param-name"},qs={key:0,class:"required"},As={key:1,class:"param-desc"},Ls=["onUpdate:modelValue","placeholder"],Ts={key:1,class:"params-section"},Rs={class:"params-list"},zs={class:"param-name"},Ms={key:0,class:"required"},Is={key:1,class:"param-desc"},Ps=["onUpdate:modelValue","placeholder"],Vs={key:2,class:"body-section"},Ns={class:"json-editor-wrapper"},Ds=["disabled"],Us={class:"response-section"},Fs={class:"section-header"},Hs={key:0,class:"no-response"},Ks={key:1,class:"no-response"},Js={key:2,class:"request-history-list"},Qs={class:"history-item-header"},Ws={class:"history-item-title"},Gs={class:"history-url"},Xs={class:"history-meta-group"},Zs={key:0,class:"history-auth-scheme"},Ys={key:1,class:"history-auth-scheme"},ea={class:"history-timestamp"},ta={key:2,class:"history-status"},na={class:"history-curl-section"},sa=["onClick"],aa={class:"curl-header-left"},oa=["onClick"],la={key:0,class:"curl-command"},ra={key:0,class:"history-request-body"},ia={class:"json-editor-wrapper"},ua={key:1,class:"history-error"},ca={class:"error-message"},da={key:2,class:"history-response"},pa={class:"json-editor-wrapper"},va={class:"app-footer"},fa={class:"examples-header"},ha=["title"],ya={class:"examples-content"},ma={key:0,class:"example-section"},ga={class:"example-section-header"},ka={class:"view-toggle"},_a={class:"example-content"},ba={key:0,class:"schema-display"},Sa={class:"schema-text"},wa={key:1,class:"json-editor-wrapper"},Ca={key:1,class:"example-section"},$a={class:"response-codes-list"},xa={class:"response-code-number"},ja={class:"response-code-description"},Oa={class:"view-toggle"},Ea=["onClick"],Ba=["onClick"],qa={key:0,class:"example-content"},Aa={key:0,class:"schema-display"},La={class:"schema-text"},Ta={key:1,class:"json-editor-wrapper"},Ra={key:1,class:"no-example"},za={key:2,class:"no-examples"},Ma={key:3,class:"example-section"},Ia={class:"schema-references-list"},Pa=["onClick"],Va={class:"schema-reference-toggle"},Na={class:"schema-reference-name"},Da={key:0,class:"example-content"},Ua={class:"schema-display"},Fa={class:"schema-text"},Ha={key:2,class:"endpoint-tester empty"},Ka={class:"empty-state"},Ja={class:"welcome-content"},Qa={class:"welcome-icon"},Wa={class:"welcome-tips"},Ga={class:"tip-item"},Xa={class:"tip-item"},Za={class:"tip-item"},Ya={class:"app-footer"},ve="__clerk_bearer__",to=ft({__name:"Main",setup(i){const E=zt(),S=Mt(),k=It(),m=un(),x=Pt();let N=k.hasClerkKey,M=null;if(N)try{M=Vt()}catch(o){console.warn("Failed to initialize Clerk auth:",o),N=!1,M=null}const W=$(()=>{if(!M)return!1;try{return M.isSignedIn.value??!1}catch{return!1}}),j=M?.getToken?.value??(()=>Promise.resolve(null)),J=$(()=>{if(!M)return!1;try{return M.isLoaded.value??!1}catch{return!1}}),U=$(()=>m.openApiSpec),F=$(()=>m.loading),G=$(()=>m.error),O=B(null),z=B(null),T=B(null),Y=B({}),H=B(""),he=B(null),pe=B(null),ie=B(!1),ne=B(new Set),ae=B(new Set),t=B(new Map),c=B(!1),l=B({}),p=B(!1),r=B(!1),v=B(new Set),h=B(500),V=B(400),se=B(!1),ee=B(!1),y=B([]),a=$(()=>m.getSelectedEndpoint(O.value,T.value)),w=$(()=>m.endpoints),A=$(()=>{if(w.value.length===0)return[];const o=new Map;for(const n of w.value){const e=n.operation.tags||[];if(e.length>0){const f=e[0];f&&(o.has(f)||o.set(f,{name:f,endpoints:[]}),o.get(f).endpoints.push(n))}else{const f=n.path.split("/").filter(L=>L),C=f.length>0?`/${f[0]}`:"Other";o.has(C)||o.set(C,{name:C,endpoints:[]}),o.get(C).endpoints.push(n)}}return ne.value.size===0&&o.forEach((n,e)=>ne.value.add(e)),Array.from(o.values()).sort((n,e)=>n.name.localeCompare(e.name))}),q=o=>{ne.value.has(o)?ne.value.delete(o):ne.value.add(o)},Se=o=>{ae.value.has(o)?ae.value.delete(o):ae.value.add(o)},ye=o=>{const n=t.value.get(o)||!1;t.value.set(o,!n)},X=o=>t.value.get(o)||!1,oe=new Map;async function we(o,n){const e=`${n}:${o}`;if(oe.has(e))return oe.get(e);const C=new TextEncoder().encode(e),L=await crypto.subtle.digest("SHA-256",C),D=Array.from(new Uint8Array(L)).map(Ne=>Ne.toString(16).padStart(2,"0")).join("").slice(0,16);return oe.set(e,D),D}function mt(o,n){const e=`${n}:${o}`;return oe.get(e)||""}async function Qe(){const o=S.query.endpoint;if(!o)return null;for(const n of w.value)if(await we(n.path,n.method)===o)return{path:n.path,method:n.method};return null}ht(async()=>{x.initialize(),k.loadClerkKey(),p.value=x.loadSidebarCollapsed(),r.value=x.loadExamplesSidebarCollapsed(),h.value=x.loadEndpointsSidebarWidth(),V.value=x.loadExamplesSidebarWidth(),await m.loadSpec();for(const n of w.value)await we(n.path,n.method);const o=await Qe();o&&(await Ke(),await Le(o.path,o.method,!1)),de(()=>S.query.endpoint,async n=>{if(n){const e=await Qe();e&&(O.value!==e.path||T.value!==e.method)&&await Le(e.path,e.method,!1)}else(O.value||T.value)&&(O.value=null,T.value=null)}),de(p,n=>{x.saveSidebarCollapsed(n)}),de(r,n=>{x.saveExamplesSidebarCollapsed(n)}),de(h,n=>{x.saveEndpointsSidebarWidth(n)}),de(V,n=>{x.saveExamplesSidebarWidth(n)})});const gt=o=>{se.value=!0;const n=o.clientX,e=h.value,f=L=>{const le=L.clientX-n,D=Math.max(200,Math.min(800,e+le));h.value=D},C=()=>{se.value=!1,document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",f),document.addEventListener("mouseup",C)},kt=o=>{ee.value=!0;const n=o.clientX,e=V.value,f=L=>{const le=n-L.clientX,D=Math.max(200,Math.min(800,e+le));V.value=D},C=()=>{ee.value=!1,document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",f),document.addEventListener("mouseup",C)},ge=(o,n,e)=>{l.value[o]||(l.value[o]={}),l.value[o][n]=e},Ce=o=>{delete l.value[o]},_t=()=>{k.saveClerkKey()},bt=()=>{k.clearClerkKey()},Le=async(o,n,e=!0)=>{if(O.value=o,T.value=n,Y.value={},H.value="",he.value=null,pe.value=null,ae.value.clear(),t.value.clear(),e){const C=mt(o,n)||await we(o,n);S.query.endpoint!==C&&await E.replace({query:{...S.query,endpoint:C}})}const f=w.value.find(C=>C.path===o&&C.method===n);if(f?.operation.parameters)for(const C of f.operation.parameters){const L=m.resolveParameter(C);L&&(L.in==="query"||L.in==="path")&&(Y.value[L.name]="")}if(f?.operation.requestBody){let C=f.operation.requestBody;if(C&&typeof C=="object"&&"$ref"in C&&C.$ref&&U.value){const L=m.resolveReference(C.$ref,U.value);L&&typeof L=="object"&&(C=L)}if(C&&typeof C=="object"&&"content"in C&&C.content){const L=C.content["application/json"];if(L?.schema&&U.value){const le=m.generateExampleFromSchema(L.schema,U.value);H.value=JSON.stringify(le||{},null,2)}else H.value=JSON.stringify({},null,2)}}},St=async()=>{if(!O.value||!T.value)return;ie.value=!0,he.value=null,pe.value=null;const o={id:Date.now().toString()+Math.random().toString(36).substr(2,9),timestamp:new Date,method:T.value,path:O.value||"",url:"",requestBody:H.value.trim()?(()=>{try{return JSON.parse(H.value)}catch{return H.value}})():null,requestParams:{...Y.value},headers:{},response:null,responseError:null,authScheme:z.value};try{let e=`${Ht()}${O.value}`;const f={},C=new URLSearchParams;for(const[I,R]of Object.entries(Y.value))if(R!==""&&R!=null){const Z=w.value.find(Ae=>Ae.path===O.value&&Ae.method===T.value);let qe=!1;if(Z?.operation.parameters)for(const Ae of Z.operation.parameters){const De=m.resolveParameter(Ae);if(De&&De.name===I){qe=De.in==="path";break}}qe?f[I]=String(R):C.append(I,String(R))}for(const[I,R]of Object.entries(f))e=e.replace(`{${I}}`,encodeURIComponent(R));const L={"Content-Type":"application/json"};if(z.value===ve){if(W.value){J.value||await new Promise(R=>{const Z=setInterval(()=>{J.value&&(clearInterval(Z),R(void 0))},100)});const I=await j();I&&(L.Authorization=`Bearer ${I}`)}}else if(z.value&&U.value?.components?.securitySchemes){const I=U.value.components.securitySchemes[z.value];if(I&&typeof I=="object"&&!("$ref"in I)){const R=l.value[z.value];if(I.type==="apiKey"){const Z=I;R?.value&&(Z.in==="header"?L[Z.name]=R.value:Z.in==="query"?C.append(Z.name,R.value):Z.in)}else if(I.type==="http"){const Z=I;if(Z.scheme==="basic"){if(R?.username&&R?.password){const qe=`${R.username}:${R.password}`;L.Authorization=`Basic ${btoa(qe)}`}}else Z.scheme==="bearer"&&R?.token&&(L.Authorization=`Bearer ${R.token}`)}else I.type==="oauth2"?R?.accessToken&&(L.Authorization=`Bearer ${R.accessToken}`):I.type==="openIdConnect"&&R?.idToken&&(L.Authorization=`Bearer ${R.idToken}`)}}C.toString()&&(e+=`?${C.toString()}`),o.url=e,o.headers={...L};const le={method:T.value,headers:L};if(["POST","PUT","PATCH"].includes(T.value)&&H.value.trim())try{console.log(H.value),le.body=JSON.stringify(JSON.parse(H.value)),console.log(le.body)}catch{const R="Invalid JSON in request body";pe.value=R,o.responseError=R,y.value.unshift(o),ie.value=!1;return}const D=await fetch(e,le),Ne=D.headers.get("content-type");let Be;if(Ne?.includes("application/json"))Be={status:D.status,statusText:D.statusText,headers:Object.fromEntries(D.headers.entries()),body:await D.json()};else{const I=await D.text();Be={status:D.status,statusText:D.statusText,headers:Object.fromEntries(D.headers.entries()),body:I}}he.value=Be,o.response=Be,o.status=D.status,o.statusText=D.statusText}catch(n){const e=n instanceof Error?n.message:"Request failed";pe.value=e,o.responseError=e}finally{ie.value=!1,y.value.unshift(o)}},We=o=>{const n=["curl"];o.method!=="GET"&&n.push(`-X ${o.method}`);for(const[e,f]of Object.entries(o.headers||{})){const C=f.replace(/"/g,'\\"');n.push(`-H "${e}: ${C}"`)}if(["POST","PUT","PATCH"].includes(o.method)&&o.requestBody){const f=(typeof o.requestBody=="string"?o.requestBody:JSON.stringify(o.requestBody,null,2)).replace(/'/g,"'\\''").replace(/\n/g,"\\n");n.push(`-d '${f}'`)}return n.push(`"${o.url}"`),n.join(` \\
|
|
29
|
-
`)},wt=async o=>{const n=We(o);try{await navigator.clipboard.writeText(n)}catch(e){console.error("Failed to copy to clipboard:",e)}},Te=o=>({GET:"#61affe",POST:"#49cc90",PUT:"#fca130",PATCH:"#50e3c2",DELETE:"#f93e3e"})[o]||"#999",Ge=$(()=>!a.value||!a.value.parameters?[]:a.value.parameters.map(m.resolveParameter).filter(o=>o!==null&&o.in==="path")),Xe=$(()=>!a.value||!a.value.parameters?[]:a.value.parameters.map(m.resolveParameter).filter(o=>o!==null&&o.in==="query")),Ze=$({get:()=>{if(!H.value.trim())return"{}";try{return H.value}catch{return"{}"}},set:o=>{H.value=o}}),Re=$(()=>a.value?m.getExampleFromRequestBody(a.value):null),ze=$(()=>a.value?m.getRequestBodySchema(a.value):null),Ye=$(()=>!ze.value||!U.value?null:m.formatSchemaForDisplay(ze.value,U.value)),Ct=o=>!o||!U.value?null:m.formatSchemaForDisplay(o,U.value),Me=$(()=>a.value?m.getAllResponseExamples(a.value):[]),et=$(()=>a.value?m.getEndpointSchemaReferences(a.value):[]),Oe=$(()=>m.securitySchemes),tt=o=>m.endpointRequiresSecurity(o),nt=$(()=>a.value?m.getAvailableSecuritySchemes(a.value):[]),$t=$(()=>(a.value?nt.value:Oe.value).some(n=>n.scheme.type==="http"&&n.scheme.scheme==="bearer")),st=$(()=>{const o=a.value?[...nt.value]:[...Oe.value];return $t.value&&N&&(o.some(e=>e.name===ve)||o.push({name:ve,scheme:{type:"http",scheme:"bearer",description:"Clerk Bearer Authentication"}})),o}),xt=$(()=>m.openApiTitle),at=$(()=>m.openApiDescription),ot=$(()=>m.openApiVersion),Ie=$(()=>k.hasSavedClerkKey),Pe=$(()=>k.isClerkKeyReadOnly),jt=$(()=>k.clerkKeySource),lt=$(()=>{const o=jt.value;return o==="config.json"?`Key loaded from ${Nt()}`:o==="env"?"Key loaded from environment variable":null}),Ot=$(()=>{if(!z.value)return"Anonymous";if(z.value===ve)return"Clerk Bearer";const o=Oe.value.find(n=>n.name===z.value);return o?o.name:"Anonymous"}),Ee=o=>{o===null||z.value===o?z.value=null:z.value=o},Ve=$(()=>!O.value||!T.value?[]:y.value.filter(o=>o.path===O.value&&o.method===T.value)),Et=()=>{!O.value||!T.value||(y.value=y.value.filter(o=>!(o.path===O.value&&o.method===T.value)))};return(o,n)=>(u(),d("div",cn,[s("header",dn,[s("div",pn,[s("div",vn,[s("div",fn,[s("h1",hn,g(xt.value),1),ot.value?(u(),d("div",yn,"v"+g(ot.value),1)):_("",!0)]),at.value?(u(),d("p",mn,g(at.value),1)):_("",!0)]),s("div",gn,[s("a",{href:b(m).openApiSpecUrl,target:"_blank",rel:"noopener noreferrer",class:"openapi-spec-link",title:"View OpenAPI Spec JSON"},[P(b(pt),{size:20})],8,kn),s("a",_n,[P(b(on),{size:20})]),s("button",{onClick:n[0]||(n[0]=e=>c.value=!c.value),class:K(["auth-menu-toggle",{active:c.value,"has-selection":z.value}]),title:"Security Scheme"},[z.value?(u(),Q(b(me),{key:1,size:16})):(u(),Q(b(He),{key:0,size:16})),s("span",null,g(z.value?Ot.value:"Security"),1)],2),b(N)?(u(),d("div",bn,[W.value?(u(),d("div",Sn,[P(b(Ft))])):(u(),Q(b(Ut),{key:0,mode:"modal"},{default:Dt(()=>[...n[15]||(n[15]=[s("button",{class:"sign-in-btn"},"Sign In",-1)])]),_:1}))])):_("",!0)])])]),c.value?(u(),d("aside",wn,[s("div",Cn,[n[16]||(n[16]=s("h2",null,"Security Scheme",-1)),s("button",{onClick:n[1]||(n[1]=e=>c.value=!1),class:"close-auth-menu",title:"Close"},[P(b(ln),{size:20})])]),s("div",$n,[s("div",{class:K(["auth-scheme anonymous-option",{selected:z.value===null}]),onClick:n[2]||(n[2]=e=>Ee(null))},[s("div",xn,[s("div",jn,[P(b(He),{size:18}),n[17]||(n[17]=s("h3",null,"Anonymous",-1))]),n[18]||(n[18]=s("span",{class:"auth-scheme-type"},"NONE",-1))]),n[19]||(n[19]=s("div",{class:"auth-scheme-description"}," Make requests without authentication ",-1))],2),b(N)?(u(),d("div",{key:0,class:K(["auth-scheme clerk-bearer-option",{selected:z.value===ve}]),onClick:n[3]||(n[3]=e=>Ee(ve))},[s("div",On,[s("div",En,[P(b(me),{size:18}),n[20]||(n[20]=s("h3",null,"Clerk Bearer",-1))]),n[21]||(n[21]=s("span",{class:"auth-scheme-type"},"CLERK",-1))]),n[22]||(n[22]=s("div",{class:"auth-scheme-description"}," Use Clerk authentication token for bearer authentication ",-1))],2)):_("",!0),(u(!0),d(ue,null,ce(Oe.value,e=>(u(),d("div",{key:e.name,class:K(["auth-scheme",{selected:z.value===e.name}]),onClick:f=>Ee(e.name)},[s("div",qn,[s("div",An,[P(b(me),{size:18}),s("h3",null,g(e.name),1)]),s("span",Ln,g(e.scheme.type),1)]),e.scheme.description?(u(),d("div",Tn,g(e.scheme.description),1)):_("",!0),e.scheme.type==="apiKey"?(u(),d("div",{key:1,class:"auth-scheme-fields",onClick:n[4]||(n[4]=fe(()=>{},["stop"]))},[s("label",null,[s("span",null,g(e.scheme.name),1),s("span",Rn,"("+g(e.scheme.in)+")",1),s("input",{type:"text",value:l.value[e.name]?.value||"",onInput:f=>ge(e.name,"value",f.target.value),placeholder:`Enter ${e.scheme.name}`,class:"auth-input"},null,40,zn)]),l.value[e.name]?.value?(u(),d("button",{key:0,onClick:f=>Ce(e.name),class:"clear-credential-btn"}," Clear ",8,Mn)):_("",!0)])):e.scheme.type==="http"&&e.scheme.scheme==="basic"?(u(),d("div",{key:2,class:"auth-scheme-fields",onClick:n[5]||(n[5]=fe(()=>{},["stop"]))},[s("label",null,[n[23]||(n[23]=s("span",null,"Username",-1)),s("input",{type:"text",value:l.value[e.name]?.username||"",onInput:f=>ge(e.name,"username",f.target.value),placeholder:"Enter username",class:"auth-input"},null,40,In)]),s("label",null,[n[24]||(n[24]=s("span",null,"Password",-1)),s("input",{type:"text",value:l.value[e.name]?.password||"",onInput:f=>ge(e.name,"password",f.target.value),placeholder:"Enter password",class:"auth-input"},null,40,Pn)]),l.value[e.name]?.username||l.value[e.name]?.password?(u(),d("button",{key:0,onClick:f=>Ce(e.name),class:"clear-credential-btn"}," Clear ",8,Vn)):_("",!0)])):e.scheme.type==="http"&&e.scheme.scheme==="bearer"?(u(),d("div",{key:3,class:"auth-scheme-fields",onClick:n[6]||(n[6]=fe(()=>{},["stop"]))},[s("label",null,[n[25]||(n[25]=s("span",null,"Bearer Token",-1)),s("input",{type:"text",value:l.value[e.name]?.token||"",onInput:f=>ge(e.name,"token",f.target.value),placeholder:"Enter bearer token",class:"auth-input"},null,40,Nn)]),l.value[e.name]?.token?(u(),d("button",{key:0,onClick:f=>Ce(e.name),class:"clear-credential-btn"}," Clear ",8,Dn)):_("",!0)])):e.scheme.type==="oauth2"?(u(),d("div",{key:4,class:"auth-scheme-fields",onClick:n[7]||(n[7]=fe(()=>{},["stop"]))},[s("label",null,[n[26]||(n[26]=s("span",null,"Access Token",-1)),s("input",{type:"text",value:l.value[e.name]?.accessToken||"",onInput:f=>ge(e.name,"accessToken",f.target.value),placeholder:"Enter OAuth2 access token",class:"auth-input"},null,40,Un)]),l.value[e.name]?.accessToken?(u(),d("button",{key:0,onClick:f=>Ce(e.name),class:"clear-credential-btn"}," Clear ",8,Fn)):_("",!0)])):e.scheme.type==="openIdConnect"?(u(),d("div",{key:5,class:"auth-scheme-fields",onClick:n[8]||(n[8]=fe(()=>{},["stop"]))},[s("label",null,[n[27]||(n[27]=s("span",null,"ID Token",-1)),s("input",{type:"text",value:l.value[e.name]?.idToken||"",onInput:f=>ge(e.name,"idToken",f.target.value),placeholder:"Enter OpenID Connect ID token",class:"auth-input"},null,40,Hn)]),l.value[e.name]?.idToken?(u(),d("button",{key:0,onClick:f=>Ce(e.name),class:"clear-credential-btn"}," Clear ",8,Kn)):_("",!0)])):_("",!0)],10,Bn))),128)),s("div",Jn,[n[29]||(n[29]=s("div",{class:"clerk-key-header"},[s("h3",null,"Clerk Publishable Key")],-1)),s("div",Qn,[lt.value?(u(),d("span",Wn,g(lt.value),1)):(u(),d("span",Gn," Enter your Clerk publishable key to enable authentication. This will be stored locally in your browser. "))]),s("div",Xn,[s("label",null,[n[28]||(n[28]=s("span",null,"Publishable Key",-1)),$e(s("input",{"onUpdate:modelValue":n[9]||(n[9]=e=>b(k).clerkKey=e),type:"text",placeholder:"pk_test_...",class:"clerk-key-input",disabled:Ie.value||Pe.value},null,8,Zn),[[Ue,b(k).clerkKey]])]),!Ie.value&&!Pe.value?(u(),d("button",{key:0,onClick:_t,class:"save-button"}," Save and reload ")):Ie.value&&!Pe.value?(u(),d("button",{key:1,onClick:bt,class:"save-button"}," Clear and reload ")):_("",!0)])])])])):_("",!0),s("div",Yn,[s("aside",{class:K(["endpoints-sidebar",{collapsed:p.value,resizing:se.value}]),style:_e({width:p.value?"60px":`${h.value}px`})},[s("div",es,[n[30]||(n[30]=s("h2",null,"Endpoints",-1)),s("button",{onClick:n[10]||(n[10]=e=>p.value=!p.value),class:"sidebar-toggle",title:p.value?"Expand sidebar":"Collapse sidebar"},[p.value?(u(),Q(b(je),{key:0,size:16})):(u(),Q(b(dt),{key:1,size:16}))],8,ts)]),$e(s("div",ns,[F.value?(u(),d("div",ss,"Loading OpenAPI spec...")):G.value?(u(),d("div",as,g(G.value),1)):(u(),d("div",os,[(u(!0),d(ue,null,ce(A.value,e=>(u(),d("div",{key:e.name,class:"endpoint-group"},[s("div",{class:"group-header",onClick:f=>q(e.name)},[s("span",rs,g(e.name),1),s("span",is,"("+g(e.endpoints.length)+")",1),s("span",us,[ne.value.has(e.name)?(u(),Q(b(Fe),{key:0,size:14})):(u(),Q(b(je),{key:1,size:14}))])],8,ls),ne.value.has(e.name)?(u(),d("div",cs,[(u(!0),d(ue,null,ce(e.endpoints,f=>(u(),d("div",{key:`${f.method}-${f.path}`,class:K(["endpoint-item",{active:O.value===f.path&&T.value===f.method}]),onClick:fe(C=>Le(f.path,f.method),["stop"])},[s("span",{class:"method-badge",style:_e({backgroundColor:Te(f.method)})},g(f.method),5),s("span",ps,g(f.path),1),s("div",vs,[f.operation.summary?(u(),d("span",fs,g(f.operation.summary),1)):_("",!0),tt(f.operation)?(u(),Q(b(me),{key:1,size:14,class:"security-indicator",title:"Requires authentication"})):_("",!0)])],10,ds))),128))])):_("",!0)]))),128))]))],512),[[rt,!p.value]])],6),p.value?_("",!0):(u(),d("div",{key:0,class:K(["resize-handle resize-handle-endpoints",{resizing:se.value}]),onMousedown:gt},null,34)),a.value?(u(),d("div",hs,[s("main",ys,[s("div",ms,[s("div",gs,[s("span",{class:"method-badge large",style:_e({backgroundColor:Te(T.value||"")})},g(T.value),5),s("span",ks,g(O.value),1),tt(a.value)?(u(),Q(b(me),{key:0,size:18,class:"security-indicator-large",title:"Requires authentication"})):_("",!0)]),a.value.summary||a.value.description?(u(),d("div",_s,[a.value.summary?(u(),d("p",bs,g(a.value.summary),1)):_("",!0),a.value.description?(u(),d("p",Ss,g(a.value.description),1)):_("",!0)])):_("",!0)]),st.value.length>0?(u(),d("div",ws,[n[31]||(n[31]=s("h4",{class:"security-schemes-title"},"Security Schemes",-1)),s("div",Cs,[(u(!0),d(ue,null,ce(st.value,e=>(u(),d("div",{key:e.name,class:K(["security-scheme-card",{selected:z.value===e.name}]),onClick:f=>Ee(e.name)},[P(b(me),{size:12,class:"security-card-icon"}),s("span",xs,g(e.name===ve?"Clerk Bearer":e.name),1)],10,$s))),128))])])):_("",!0),s("div",js,[n[35]||(n[35]=s("h3",null,"Request",-1)),Ge.value.length>0?(u(),d("div",Os,[n[32]||(n[32]=s("h4",null,"Path Parameters",-1)),s("dl",Es,[(u(!0),d(ue,null,ce(Ge.value,e=>(u(),d("div",{key:e.name,class:"param-item"},[s("dt",null,[s("span",Bs,g(e.name),1),e.required?(u(),d("span",qs,"*")):_("",!0),e.description?(u(),d("span",As," - "+g(e.description),1)):_("",!0)]),s("dd",null,[$e(s("input",{"onUpdate:modelValue":f=>Y.value[e.name]=f,type:"text",placeholder:e.schema&&"default"in e.schema?String(e.schema.default):""},null,8,Ls),[[Ue,Y.value[e.name]]])])]))),128))])])):_("",!0),Xe.value.length>0?(u(),d("div",Ts,[n[33]||(n[33]=s("h4",null,"Query Parameters",-1)),s("dl",Rs,[(u(!0),d(ue,null,ce(Xe.value,e=>(u(),d("div",{key:e.name,class:"param-item"},[s("dt",null,[s("span",zs,g(e.name),1),e.required?(u(),d("span",Ms,"*")):_("",!0),e.description?(u(),d("span",Is," - "+g(e.description),1)):_("",!0)]),s("dd",null,[$e(s("input",{"onUpdate:modelValue":f=>Y.value[e.name]=f,type:"text",placeholder:e.schema&&"default"in e.schema?String(e.schema.default):""},null,8,Ps),[[Ue,Y.value[e.name]]])])]))),128))])])):_("",!0),a.value.requestBody?(u(),d("div",Vs,[n[34]||(n[34]=s("h4",null,"Request Body",-1)),s("div",Ns,[P(b(be),{text:Ze.value,"onUpdate:text":n[11]||(n[11]=e=>Ze.value=e),mode:"text",mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["text"])])])):_("",!0),s("button",{onClick:St,class:"send-button",disabled:ie.value},[P(b(vt),{size:16,class:"send-button-icon"}),s("span",null,g(ie.value?"Sending...":"Send Request"),1)],8,Ds)]),s("div",Us,[s("div",Fs,[n[36]||(n[36]=s("h3",null,"Request History",-1)),Ve.value.length>0?(u(),d("button",{key:0,onClick:Et,class:"clear-history-btn"}," Clear History ")):_("",!0)]),!O.value||!T.value?(u(),d("div",Hs," Select an endpoint to view request history. ")):Ve.value.length===0?(u(),d("div",Ks,' No requests sent yet. Click "Send Request" to test the endpoint. ')):(u(),d("div",Js,[(u(!0),d(ue,null,ce(Ve.value,e=>(u(),d("div",{key:e.id,class:"history-item"},[s("div",Qs,[s("div",Ws,[s("span",{class:"method-badge small",style:_e({backgroundColor:Te(e.method)})},g(e.method),5),s("span",Gs,g(e.url),1)]),s("div",Xs,[e.authScheme?(u(),d("span",Zs,[P(b(me),{size:12}),it(" "+g(e.authScheme===ve?"Clerk Bearer":e.authScheme),1)])):(u(),d("span",Ys,[P(b(He),{size:12}),n[37]||(n[37]=it(" Anonymous ",-1))])),s("span",ea,g(new Date(e.timestamp).toLocaleTimeString()),1),e.status?(u(),d("div",ta,[s("span",{class:K(["status-code",{success:e.status>=200&&e.status<300,error:e.status>=400,redirect:e.status>=300&&e.status<400}])},g(e.status)+" "+g(e.statusText),3)])):_("",!0)])]),s("div",na,[s("div",{class:"curl-header",onClick:f=>v.value.has(e.id)?v.value.delete(e.id):v.value.add(e.id)},[s("div",aa,[v.value.has(e.id)?(u(),Q(b(Fe),{key:0,size:16,class:"curl-toggle-icon"})):(u(),Q(b(je),{key:1,size:16,class:"curl-toggle-icon"})),n[38]||(n[38]=s("h5",null,"cURL Command",-1))]),s("button",{onClick:fe(f=>wt(e),["stop"]),class:"copy-curl-btn",title:"Copy cURL command"},[P(b(an),{size:16}),n[39]||(n[39]=s("span",null,"Copy",-1))],8,oa)],8,sa),v.value.has(e.id)?(u(),d("div",la,[s("pre",null,g(We(e)),1)])):_("",!0)]),e.requestBody?(u(),d("div",ra,[n[40]||(n[40]=s("h5",null,"Request Body",-1)),s("div",ia,[P(b(be),{"model-value":e.requestBody,mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])])])):_("",!0),e.responseError?(u(),d("div",ua,[n[41]||(n[41]=s("h5",null,"Error",-1)),s("div",ca,g(e.responseError),1)])):e.response?(u(),d("div",da,[n[42]||(n[42]=s("h5",null,"Response",-1)),s("div",pa,[P(b(be),{"model-value":(()=>{if(typeof e.response.body=="string")try{return JSON.parse(e.response.body)}catch{return{text:e.response.body}}return e.response.body||{}})(),mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])])])):_("",!0)]))),128))]))]),s("footer",va,[s("p",null,"© "+g(new Date().getFullYear())+" Gamja Labs",1)])]),r.value?_("",!0):(u(),d("div",{key:0,class:K(["resize-handle resize-handle-examples",{resizing:ee.value}]),onMousedown:kt},null,34)),s("aside",{class:K(["examples-sidebar",{collapsed:r.value,resizing:ee.value}]),style:_e({width:r.value?"60px":`${V.value}px`})},[s("div",fa,[n[43]||(n[43]=s("h3",null,"Examples",-1)),s("button",{onClick:n[12]||(n[12]=e=>r.value=!r.value),class:"examples-toggle",title:r.value?"Expand examples":"Collapse examples"},[r.value?(u(),Q(b(dt),{key:0,size:16})):(u(),Q(b(je),{key:1,size:16}))],8,ha)]),$e(s("div",ya,[Re.value||ze.value?(u(),d("div",ma,[s("div",ga,[s("h4",null,g(X("request-body")?"Request Body Schema":"Example Request Body"),1),s("div",ka,[s("button",{onClick:n[13]||(n[13]=e=>ye("request-body")),class:K([{active:!X("request-body")},"toggle-btn"])}," Example ",2),s("button",{onClick:n[14]||(n[14]=e=>ye("request-body")),class:K([{active:X("request-body")},"toggle-btn"])}," Schema ",2)])]),s("div",_a,[X("request-body")&&Ye.value?(u(),d("div",ba,[s("pre",Sa,g(Ye.value),1)])):X("request-body")?_("",!0):(u(),d("div",wa,[P(b(be),{"model-value":Re.value,mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])]))])])):_("",!0),Me.value.length>0?(u(),d("div",Ca,[n[44]||(n[44]=s("h4",null,"Response Codes",-1)),s("div",$a,[(u(!0),d(ue,null,ce(Me.value,e=>(u(),d("div",{key:e.code,class:"response-code-item"},[s("div",{class:K(["response-code-header",{success:e.isSuccess,error:!e.isSuccess}])},[s("span",xa,g(e.code),1),s("span",ja,g(e.description),1),s("div",Oa,[s("button",{onClick:f=>ye(`response-${e.code}`),class:K([{active:!X(`response-${e.code}`)},"toggle-btn small"])}," Example ",10,Ea),s("button",{onClick:f=>ye(`response-${e.code}`),class:K([{active:X(`response-${e.code}`)},"toggle-btn small"])}," Schema ",10,Ba)])],2),(X(`response-${e.code}`)?e.schema:e.example)?(u(),d("div",qa,[X(`response-${e.code}`)&&e.schema?(u(),d("div",Aa,[s("pre",La,g(Ct(e.schema)),1)])):X(`response-${e.code}`)?_("",!0):(u(),d("div",Ta,[P(b(be),{"model-value":e.example,mode:"text",readOnly:!0,mainMenuBar:!1,navigationBar:!1,statusBar:!1,darkTheme:!0},null,8,["model-value"])]))])):(u(),d("div",Ra," No "+g(X(`response-${e.code}`)?"schema":"example")+" available ",1))]))),128))])])):_("",!0),!Re.value&&Me.value.length===0?(u(),d("div",za," No examples available for this endpoint. ")):_("",!0),et.value.length>0?(u(),d("div",Ma,[n[45]||(n[45]=s("h4",null,"Referenced Schemas",-1)),s("div",Ia,[(u(!0),d(ue,null,ce(et.value,e=>(u(),d("div",{key:e.name,class:"schema-reference-item"},[s("div",{class:"schema-reference-header",onClick:f=>Se(e.name)},[s("span",Va,[ae.value.has(e.name)?(u(),Q(b(Fe),{key:0,size:14})):(u(),Q(b(je),{key:1,size:14}))]),s("span",Na,g(e.name),1)],8,Pa),ae.value.has(e.name)?(u(),d("div",Da,[s("div",Ua,[s("pre",Fa,g(b(m).formatSchemaForDisplay(e.schema,U.value)),1)])])):_("",!0)]))),128))])])):_("",!0)],512),[[rt,!r.value]])],6)])):(u(),d("main",Ha,[s("div",Ka,[s("div",Ja,[s("div",Qa,[P(b(vt),{size:64})]),n[49]||(n[49]=s("h1",{class:"welcome-title"},"Welcome to OpenAPI Studio",-1)),n[50]||(n[50]=s("p",{class:"welcome-description"}," Select an endpoint from the sidebar to start testing your API endpoints. ",-1)),s("div",Wa,[s("div",Ga,[P(b(pt),{size:20,class:"tip-icon"}),n[46]||(n[46]=s("span",null,"Browse available endpoints in the sidebar",-1))]),s("div",Xa,[P(b(rn),{size:20,class:"tip-icon"}),n[47]||(n[47]=s("span",null,"Test requests with custom parameters",-1))]),s("div",Za,[P(b(sn),{size:20,class:"tip-icon"}),n[48]||(n[48]=s("span",null,"View responses and schema documentation",-1))])])])]),s("footer",Ya,[s("p",null,"© "+g(new Date().getFullYear())+" Gamja Labs",1)])]))])]))}});export{to as default};
|