lone-format 0.6.0 → 0.7.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.
@@ -1,16 +1,16 @@
1
- (function(q,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(q=typeof globalThis<"u"?globalThis:q||self,o(q.LoneFormat={},q.Vue))})(this,function(q,o){"use strict";class Ie{add(e,t,s){if(typeof arguments[0]!="string")for(let n in arguments[0])this.add(n,arguments[0][n],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(n){this[n]=this[n]||[],t&&this[n][s?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(s){s.call(t&&t.context?t.context:t,t)})}}class ve{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}}class u{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+u.version}static addUnaryOp(e){return u.max_unop_len=Math.max(e.length,u.max_unop_len),u.unary_ops[e]=1,u}static addBinaryOp(e,t,s){return u.max_binop_len=Math.max(e.length,u.max_binop_len),u.binary_ops[e]=t,s?u.right_associative.add(e):u.right_associative.delete(e),u}static addIdentifierChar(e){return u.additional_identifier_chars.add(e),u}static addLiteral(e,t){return u.literals[e]=t,u}static removeUnaryOp(e){return delete u.unary_ops[e],e.length===u.max_unop_len&&(u.max_unop_len=u.getMaxKeyLen(u.unary_ops)),u}static removeAllUnaryOps(){return u.unary_ops={},u.max_unop_len=0,u}static removeIdentifierChar(e){return u.additional_identifier_chars.delete(e),u}static removeBinaryOp(e){return delete u.binary_ops[e],e.length===u.max_binop_len&&(u.max_binop_len=u.getMaxKeyLen(u.binary_ops)),u.right_associative.delete(e),u}static removeAllBinaryOps(){return u.binary_ops={},u.max_binop_len=0,u}static removeLiteral(e){return delete u.literals[e],u}static removeAllLiterals(){return u.literals={},u}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new u(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(t=>t.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return u.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!u.binary_ops[String.fromCharCode(e)]||u.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return u.isIdentifierStart(e)||u.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(u.hooks[e]){const s={context:this,node:t};return u.hooks.run(e,s),s.node}return t}searchHook(e){if(u.hooks[e]){const t={context:this};return u.hooks[e].find(function(s){return s.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===u.SPACE_CODE||e===u.TAB_CODE||e===u.LF_CODE||e===u.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=e.length===1?e[0]:{type:u.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],s,n;for(;this.index<this.expr.length;)if(s=this.code,s===u.SEMCOL_CODE||s===u.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())t.push(n);else if(this.index<this.expr.length){if(s===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,u.max_binop_len),t=e.length;for(;t>0;){if(u.binary_ops.hasOwnProperty(e)&&(!u.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!u.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,s,n,l,i,d,a,c;if(i=this.gobbleToken(),!i||(t=this.gobbleBinaryOp(),!t))return i;for(l={value:t,prec:u.binaryPrecedence(t),right_a:u.right_associative.has(t)},d=this.gobbleToken(),d||this.throwError("Expected expression after "+t),n=[i,l,d];t=this.gobbleBinaryOp();){if(s=u.binaryPrecedence(t),s===0){this.index-=t.length;break}l={value:t,prec:s,right_a:u.right_associative.has(t)},c=t;const p=h=>l.right_a&&h.right_a?s>h.prec:s<=h.prec;for(;n.length>2&&p(n[n.length-2]);)d=n.pop(),t=n.pop().value,i=n.pop(),e={type:u.BINARY_EXP,operator:t,left:i,right:d},n.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),n.push(l,e)}for(a=n.length-1,e=n[a];a>1;)e={type:u.BINARY_EXP,operator:n[a-1].value,left:n[a-2],right:e},a-=2;return e}gobbleToken(){let e,t,s,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(e=this.code,u.isDecimalDigit(e)||e===u.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===u.SQUOTE_CODE||e===u.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===u.OBRACK_CODE)n=this.gobbleArray();else{for(t=this.expr.substr(this.index,u.max_unop_len),s=t.length;s>0;){if(u.unary_ops.hasOwnProperty(t)&&(!u.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!u.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=s;const l=this.gobbleToken();return l||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:u.UNARY_EXP,operator:t,argument:l,prefix:!0})}t=t.substr(0,--s)}u.isIdentifierStart(e)?(n=this.gobbleIdentifier(),u.literals.hasOwnProperty(n.name)?n={type:u.LITERAL,value:u.literals[n.name],raw:n.name}:n.name===u.this_str&&(n={type:u.THIS_EXP})):e===u.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===u.PERIOD_CODE||t===u.OBRACK_CODE||t===u.OPAREN_CODE||t===u.QUMARK_CODE;){let s;if(t===u.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==u.PERIOD_CODE)break;s=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===u.OBRACK_CODE?(e={type:u.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},e.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),t=this.code,t!==u.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===u.OPAREN_CODE?e={type:u.CALL_EXP,arguments:this.gobbleArguments(u.CPAREN_CODE),callee:e}:(t===u.PERIOD_CODE||s)&&(s&&this.index--,this.gobbleSpaces(),e={type:u.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),s&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,s;for(;u.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===u.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);u.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(t=this.char,t==="e"||t==="E"){for(e+=this.expr.charAt(this.index++),t=this.char,(t==="+"||t==="-")&&(e+=this.expr.charAt(this.index++));u.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);u.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return s=this.code,u.isIdentifierStart(s)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(s===u.PERIOD_CODE||e.length===1&&e.charCodeAt(0)===u.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:u.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="";const t=this.index,s=this.expr.charAt(this.index++);let n=!1;for(;this.index<this.expr.length;){let l=this.expr.charAt(this.index++);if(l===s){n=!0;break}else if(l==="\\")switch(l=this.expr.charAt(this.index++),l){case"n":e+=`
2
- `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=l}else e+=l}return n||this.throwError('Unclosed quote after "'+e+'"'),{type:u.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(u.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,u.isIdentifierPart(e));)this.index++;return{type:u.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let s=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let l=this.code;if(l===e){s=!0,this.index++,e===u.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}else if(l===u.COMMA_CODE){if(this.index++,n++,n!==t.length){if(e===u.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===u.CBRACK_CODE)for(let i=t.length;i<n;i++)t.push(null)}}else if(t.length!==n&&n!==0)this.throwError("Expected comma");else{const i=this.gobbleExpression();(!i||i.type===u.COMPOUND)&&this.throwError("Expected comma"),t.push(i)}}return s||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(u.CPAREN_CODE);if(this.code===u.CPAREN_CODE)return this.index++,e.length===1?e[0]:e.length?{type:u.SEQUENCE_EXP,expressions:e}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:u.ARRAY_EXP,elements:this.gobbleArguments(u.CBRACK_CODE)}}}const Le=new Ie;Object.assign(u,{hooks:Le,plugins:new ve(u),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),u.max_unop_len=u.getMaxKeyLen(u.unary_ops),u.max_binop_len=u.getMaxKeyLen(u.binary_ops);const Q=r=>new u(r).parse(),Re=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(u).filter(r=>!Re.includes(r)&&Q[r]===void 0).forEach(r=>{Q[r]=u[r]}),Q.Jsep=u;const je="ConditionalExpression";var Me={name:"ternary",init(r){r.hooks.add("after-expression",function(t){if(t.node&&this.code===r.QUMARK_CODE){this.index++;const s=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===r.COLON_CODE){this.index++;const l=this.gobbleExpression();if(l||this.throwError("Expected expression"),t.node={type:je,test:s,consequent:n,alternate:l},s.operator&&r.binary_ops[s.operator]<=.9){let i=s;for(;i.right.operator&&r.binary_ops[i.right.operator]<=.9;)i=i.right;t.node.test=i.right,i.right=t.node,t.node=s}}else this.throwError("Expected :")}})}};Q.plugins.register(Me);const ge=47,Fe=92;var Ue={name:"regex",init(r){r.hooks.add("gobble-token",function(t){if(this.code===ge){const s=++this.index;let n=!1;for(;this.index<this.expr.length;){if(this.code===ge&&!n){const l=this.expr.slice(s,this.index);let i="";for(;++this.index<this.expr.length;){const a=this.code;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)i+=this.char;else break}let d;try{d=new RegExp(l,i)}catch(a){this.throwError(a.message)}return t.node={type:r.LITERAL,value:d,raw:this.expr.slice(s-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===r.OBRACK_CODE?n=!0:n&&this.code===r.CBRACK_CODE&&(n=!1),this.index+=this.code===Fe?2:1}this.throwError("Unclosed Regex")}})}};const de=43,re={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[de,45],assignmentPrecedence:.9,init(r){const e=[r.IDENTIFIER,r.MEMBER_EXP];re.assignmentOperators.forEach(s=>r.addBinaryOp(s,re.assignmentPrecedence,!0)),r.hooks.add("gobble-token",function(n){const l=this.code;re.updateOperators.some(i=>i===l&&i===this.expr.charCodeAt(this.index+1))&&(this.index+=2,n.node={type:"UpdateExpression",operator:l===de?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!n.node.argument||!e.includes(n.node.argument.type))&&this.throwError(`Unexpected ${n.node.operator}`))}),r.hooks.add("after-token",function(n){if(n.node){const l=this.code;re.updateOperators.some(i=>i===l&&i===this.expr.charCodeAt(this.index+1))&&(e.includes(n.node.type)||this.throwError(`Unexpected ${n.node.operator}`),this.index+=2,n.node={type:"UpdateExpression",operator:l===de?"++":"--",argument:n.node,prefix:!1})}}),r.hooks.add("after-expression",function(n){n.node&&t(n.node)});function t(s){re.assignmentOperators.has(s.operator)?(s.type="AssignmentExpression",t(s.left),t(s.right)):s.operator||Object.values(s).forEach(n=>{n&&typeof n=="object"&&t(n)})}}};Q.plugins.register(Ue,re),Q.addUnaryOp("typeof"),Q.addLiteral("null",null),Q.addLiteral("undefined",void 0);const Xe=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),V={evalAst(r,e){switch(r.type){case"BinaryExpression":case"LogicalExpression":return V.evalBinaryExpression(r,e);case"Compound":return V.evalCompound(r,e);case"ConditionalExpression":return V.evalConditionalExpression(r,e);case"Identifier":return V.evalIdentifier(r,e);case"Literal":return V.evalLiteral(r,e);case"MemberExpression":return V.evalMemberExpression(r,e);case"UnaryExpression":return V.evalUnaryExpression(r,e);case"ArrayExpression":return V.evalArrayExpression(r,e);case"CallExpression":return V.evalCallExpression(r,e);case"AssignmentExpression":return V.evalAssignmentExpression(r,e);default:throw SyntaxError("Unexpected expression",r)}},evalBinaryExpression(r,e){return{"||":(s,n)=>s||n(),"&&":(s,n)=>s&&n(),"|":(s,n)=>s|n(),"^":(s,n)=>s^n(),"&":(s,n)=>s&n(),"==":(s,n)=>s==n(),"!=":(s,n)=>s!=n(),"===":(s,n)=>s===n(),"!==":(s,n)=>s!==n(),"<":(s,n)=>s<n(),">":(s,n)=>s>n(),"<=":(s,n)=>s<=n(),">=":(s,n)=>s>=n(),"<<":(s,n)=>s<<n(),">>":(s,n)=>s>>n(),">>>":(s,n)=>s>>>n(),"+":(s,n)=>s+n(),"-":(s,n)=>s-n(),"*":(s,n)=>s*n(),"/":(s,n)=>s/n(),"%":(s,n)=>s%n()}[r.operator](V.evalAst(r.left,e),()=>V.evalAst(r.right,e))},evalCompound(r,e){let t;for(let s=0;s<r.body.length;s++){r.body[s].type==="Identifier"&&["var","let","const"].includes(r.body[s].name)&&r.body[s+1]&&r.body[s+1].type==="AssignmentExpression"&&(s+=1);const n=r.body[s];t=V.evalAst(n,e)}return t},evalConditionalExpression(r,e){return V.evalAst(r.test,e)?V.evalAst(r.consequent,e):V.evalAst(r.alternate,e)},evalIdentifier(r,e){if(Object.hasOwn(e,r.name))return e[r.name];throw ReferenceError(`${r.name} is not defined`)},evalLiteral(r){return r.value},evalMemberExpression(r,e){const t=String(r.computed?V.evalAst(r.property):r.property.name),s=V.evalAst(r.object,e);if(s==null)throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);if(!Object.hasOwn(s,t)&&Xe.has(t))throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);const n=s[t];return typeof n=="function"?n.bind(s):n},evalUnaryExpression(r,e){return{"-":s=>-V.evalAst(s,e),"!":s=>!V.evalAst(s,e),"~":s=>~V.evalAst(s,e),"+":s=>+V.evalAst(s,e),typeof:s=>typeof V.evalAst(s,e)}[r.operator](r.argument)},evalArrayExpression(r,e){return r.elements.map(t=>V.evalAst(t,e))},evalCallExpression(r,e){const t=r.arguments.map(n=>V.evalAst(n,e));return V.evalAst(r.callee,e)(...t)},evalAssignmentExpression(r,e){if(r.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const t=r.left.name,s=V.evalAst(r.right,e);return e[t]=s,e[t]}};class ze{constructor(e){this.code=e,this.ast=Q(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return V.evalAst(this.ast,t)}}function Y(r,e){return r=r.slice(),r.push(e),r}function ue(r,e){return e=e.slice(),e.unshift(r),e}class He extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function P(r,e,t,s,n){if(!(this instanceof P))try{return new P(r,e,t,s,n)}catch(i){if(!i.avoidNew)throw i;return i.value}typeof r=="string"&&(n=s,s=t,t=e,e=r,r=null);const l=r&&typeof r=="object";if(r=r||{},this.json=r.json||t,this.path=r.path||e,this.resultType=r.resultType||"value",this.flatten=r.flatten||!1,this.wrap=Object.hasOwn(r,"wrap")?r.wrap:!0,this.sandbox=r.sandbox||{},this.eval=r.eval===void 0?"safe":r.eval,this.ignoreEvalErrors=typeof r.ignoreEvalErrors>"u"?!1:r.ignoreEvalErrors,this.parent=r.parent||null,this.parentProperty=r.parentProperty||null,this.callback=r.callback||s||null,this.otherTypeCallback=r.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},r.autostart!==!1){const i={path:l?r.path:e};l?"json"in r&&(i.json=r.json):i.json=t;const d=this.evaluate(i);if(!d||typeof d!="object")throw new He(d);return d}}P.prototype.evaluate=function(r,e,t,s){let n=this.parent,l=this.parentProperty,{flatten:i,wrap:d}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,t=t||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,e=e||this.json,r=r||this.path,r&&typeof r=="object"&&!Array.isArray(r)){if(!r.path&&r.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(r,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=r),i=Object.hasOwn(r,"flatten")?r.flatten:i,this.currResultType=Object.hasOwn(r,"resultType")?r.resultType:this.currResultType,this.currSandbox=Object.hasOwn(r,"sandbox")?r.sandbox:this.currSandbox,d=Object.hasOwn(r,"wrap")?r.wrap:d,this.currEval=Object.hasOwn(r,"eval")?r.eval:this.currEval,t=Object.hasOwn(r,"callback")?r.callback:t,this.currOtherTypeCallback=Object.hasOwn(r,"otherTypeCallback")?r.otherTypeCallback:this.currOtherTypeCallback,n=Object.hasOwn(r,"parent")?r.parent:n,l=Object.hasOwn(r,"parentProperty")?r.parentProperty:l,r=r.path}if(n=n||null,l=l||null,Array.isArray(r)&&(r=P.toPathString(r)),!r&&r!==""||!e)return;const a=P.toPathArray(r);a[0]==="$"&&a.length>1&&a.shift(),this._hasParentSelector=null;const c=this._trace(a,e,["$"],n,l,t).filter(function(p){return p&&!p.isParentSelector});return c.length?!d&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce((p,h)=>{const k=this._getPreferredOutput(h);return i&&Array.isArray(k)?p=p.concat(k):p.push(k),p},[]):d?[]:void 0},P.prototype._getPreferredOutput=function(r){const e=this.currResultType;switch(e){case"all":{const t=Array.isArray(r.path)?r.path:P.toPathArray(r.path);return r.pointer=P.toPointer(t),r.path=typeof r.path=="string"?r.path:P.toPathString(r.path),r}case"value":case"parent":case"parentProperty":return r[e];case"path":return P.toPathString(r[e]);case"pointer":return P.toPointer(r.path);default:throw new TypeError("Unknown result type")}},P.prototype._handleCallback=function(r,e,t){if(e){const s=this._getPreferredOutput(r);r.path=typeof r.path=="string"?r.path:P.toPathString(r.path),e(s,t,r)}},P.prototype._trace=function(r,e,t,s,n,l,i,d){let a;if(!r.length)return a={path:t,value:e,parent:s,parentProperty:n,hasArrExpr:i},this._handleCallback(a,l,"value"),a;const c=r[0],p=r.slice(1),h=[];function k(_){Array.isArray(_)?_.forEach(N=>{h.push(N)}):h.push(_)}if((typeof c!="string"||d)&&e&&Object.hasOwn(e,c))k(this._trace(p,e[c],Y(t,c),e,c,l,i));else if(c==="*")this._walk(e,_=>{k(this._trace(p,e[_],Y(t,_),e,_,l,!0,!0))});else if(c==="..")k(this._trace(p,e,t,s,n,l,i)),this._walk(e,_=>{typeof e[_]=="object"&&k(this._trace(r.slice(),e[_],Y(t,_),e,_,l,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:t.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return a={path:Y(t,c),value:n,parent:s,parentProperty:null},this._handleCallback(a,l,"property"),a;if(c==="$")k(this._trace(p,e,t,null,null,l,i));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))k(this._slice(c,p,e,t,s,n,l));else if(c.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const _=c.replace(/^\?\((.*?)\)$/u,"$1"),N=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(_);N?this._walk(e,C=>{const x=[N[2]],O=N[1]?e[C][N[1]]:e[C];this._trace(x,O,t,s,n,l,!0).length>0&&k(this._trace(p,e[C],Y(t,C),e,C,l,!0))}):this._walk(e,C=>{this._eval(_,e[C],C,t,s,n)&&k(this._trace(p,e[C],Y(t,C),e,C,l,!0))})}else if(c[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");k(this._trace(ue(this._eval(c,e,t.at(-1),t.slice(0,-1),s,n),p),e,t,s,n,l,i))}else if(c[0]==="@"){let _=!1;const N=c.slice(1,-2);switch(N){case"scalar":(!e||!["object","function"].includes(typeof e))&&(_=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===N&&(_=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(_=!0);break;case"number":Number.isFinite(e)&&(_=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(_=!0);break;case"object":e&&typeof e===N&&(_=!0);break;case"array":Array.isArray(e)&&(_=!0);break;case"other":_=this.currOtherTypeCallback(e,t,s,n);break;case"null":e===null&&(_=!0);break;default:throw new TypeError("Unknown value type "+N)}if(_)return a={path:t,value:e,parent:s,parentProperty:n},this._handleCallback(a,l,"value"),a}else if(c[0]==="`"&&e&&Object.hasOwn(e,c.slice(1))){const _=c.slice(1);k(this._trace(p,e[_],Y(t,_),e,_,l,i,!0))}else if(c.includes(",")){const _=c.split(",");for(const N of _)k(this._trace(ue(N,p),e,t,s,n,l,!0))}else!d&&e&&Object.hasOwn(e,c)&&k(this._trace(p,e[c],Y(t,c),e,c,l,i,!0))}if(this._hasParentSelector)for(let _=0;_<h.length;_++){const N=h[_];if(N&&N.isParentSelector){const C=this._trace(N.expr,e,N.path,s,n,l,i);if(Array.isArray(C)){h[_]=C[0];const x=C.length;for(let O=1;O<x;O++)_++,h.splice(_,0,C[O])}else h[_]=C}}return h},P.prototype._walk=function(r,e){if(Array.isArray(r)){const t=r.length;for(let s=0;s<t;s++)e(s)}else r&&typeof r=="object"&&Object.keys(r).forEach(t=>{e(t)})},P.prototype._slice=function(r,e,t,s,n,l,i){if(!Array.isArray(t))return;const d=t.length,a=r.split(":"),c=a[2]&&Number.parseInt(a[2])||1;let p=a[0]&&Number.parseInt(a[0])||0,h=a[1]&&Number.parseInt(a[1])||d;p=p<0?Math.max(0,p+d):Math.min(d,p),h=h<0?Math.max(0,h+d):Math.min(d,h);const k=[];for(let _=p;_<h;_+=c)this._trace(ue(_,e),t,s,n,l,i,!0).forEach(C=>{k.push(C)});return k},P.prototype._eval=function(r,e,t,s,n,l){this.currSandbox._$_parentProperty=l,this.currSandbox._$_parent=n,this.currSandbox._$_property=t,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;const i=r.includes("@path");i&&(this.currSandbox._$_path=P.toPathString(s.concat([t])));const d=this.currEval+"Script:"+r;if(!P.cache[d]){let a=r.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(i&&(a=a.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)P.cache[d]=new this.safeVm.Script(a);else if(this.currEval==="native")P.cache[d]=new this.vm.Script(a);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const c=this.currEval;P.cache[d]=new c(a)}else if(typeof this.currEval=="function")P.cache[d]={runInNewContext:c=>this.currEval(a,c)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return P.cache[d].runInNewContext(this.currSandbox)}catch(a){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+a.message+": "+r)}},P.cache={},P.toPathString=function(r){const e=r,t=e.length;let s="$";for(let n=1;n<t;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(s+=/^[0-9*]+$/u.test(e[n])?"["+e[n]+"]":"['"+e[n]+"']");return s},P.toPointer=function(r){const e=r,t=e.length;let s="";for(let n=1;n<t;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(s+="/"+e[n].toString().replaceAll("~","~0").replaceAll("/","~1"));return s},P.toPathArray=function(r){const{cache:e}=P;if(e[r])return e[r].concat();const t=[],n=r.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(l,i){return"[#"+(t.push(i)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(l,i){return"['"+i.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(l,i){return";"+i.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(l){const i=l.match(/#(\d+)/u);return!i||!i[1]?l:t[i[1]]});return e[r]=n,e[r].concat()},P.prototype.safeVm={Script:ze};const Ke=function(r,e,t){const s=r.length;for(let n=0;n<s;n++){const l=r[n];t(l)&&e.push(r.splice(n--,1)[0])}};class qe{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const s=Object.keys(e),n=[];Ke(s,n,c=>typeof e[c]=="function");const l=s.map(c=>e[c]);t=n.reduce((c,p)=>{let h=e[p].toString();return/function/u.test(h)||(h="function "+h),"var "+p+"="+h+";"+c},"")+t,!/(['"])use strict\1/u.test(t)&&!s.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const d=t.lastIndexOf(";"),a=d!==-1?t.slice(0,d+1)+" return "+t.slice(d+1):" return "+t;return new Function(...s,a)(...l)}}P.prototype.vm={Script:qe};const Qe={class:"json-node"},We={key:0,class:"json-node__container"},Ye={class:"json-node__line"},Ge=["contenteditable","onKeydown"],Ze={key:1,class:"json-node__colon"},De=["title"],Je=["title"],et={key:4,class:"json-node__comma"},tt={key:0,class:"json-node__children"},rt={class:"json-node__children-content"},nt={class:"json-node__line json-node__closing-bracket"},ot={class:"json-node__bracket"},st={key:0,class:"json-node__comma"},lt={key:1,class:"json-node__primitive"},it=["contenteditable","onKeydown"],at={key:1,class:"json-node__colon"},ct=["title"],dt=["contenteditable","onKeydown"],ut={key:0,class:"json-node__comma"},ft=o.defineComponent({name:"JsonNode",__name:"JsonNode",props:{value:{},keyName:{},level:{},path:{default:""},expanded:{},isLast:{type:Boolean,default:!1},theme:{}},emits:["update:value","toggle-expand","copy","update:key"],setup(r,{emit:e}){o.useCssVars(f=>({"2a18b018":f.level,"58a14b93":f.theme.colors.syntaxKey,"46fe1b3e":f.theme.colors.hoverBackground,fbe2c048:f.theme.colors.syntaxBracket,"4bd524bb":f.theme.colors.collapsedText,"3308d23c":f.theme.colors.collapsedBackground,"36380c60":f.theme.colors.collapsedBackgroundHover,"0892365d":f.theme.colors.syntaxString,"0015b195":f.theme.colors.syntaxNumber,"7db95f5c":f.theme.colors.syntaxBoolean,"88ec825a":f.theme.colors.syntaxNull,"537157f7":f.theme.colors.background,"3cee3331":f.theme.colors.selectionBackground,"81323cee":f.theme.colors.indentLine}));const t=r,s=e,n=o.ref(!1),l=o.ref(!1),i=o.ref(""),d=o.ref(""),a=o.ref("string"),c=o.ref(null),p=o.ref(null),h=f=>f!==null&&typeof f=="object"&&!Array.isArray(f)&&"__protected_number__"in f&&Object.keys(f).length===1,k=f=>h(f)?f.__protected_number__:"",_=o.computed(()=>h(t.value)?!1:t.value!==null&&typeof t.value=="object"),N=o.computed(()=>Array.isArray(t.value)),C=o.computed(()=>t.path?t.path:t.keyName?t.keyName:"root"),x=o.computed(()=>t.expanded.has(C.value)),O=o.computed(()=>t.keyName),R=o.computed(()=>N.value?"[":"{"),z=o.computed(()=>N.value?"]":"}"),m=o.computed(()=>{if(!t.value)return"";const y=Object.keys(t.value).length;return N.value?y>0?` ${y} items `:" ":y>0?` ${y} keys `:" "}),g=o.computed(()=>{const f=typeof t.value;return t.value===null?"json-node__value--null":f==="boolean"?"json-node__value--boolean":f==="number"||h(t.value)?"json-node__value--number":f==="string"?"json-node__value--string":""}),A=o.computed(()=>t.value===null?"null":typeof t.value=="boolean"||typeof t.value=="number"?String(t.value):h(t.value)?k(t.value):typeof t.value=="string"?`"${t.value}"`:String(t.value)),T=o.computed(()=>"Double-click to edit"),$=f=>t.level===0?f:C.value?`${C.value}.${f}`:f,j=f=>{const y=Object.keys(t.value);return y.indexOf(f)===y.length-1},X=()=>{s("toggle-expand",C.value)},F=()=>{t.level!==0&&(n.value=!0,i.value=t.keyName,o.nextTick(()=>{if(c.value){c.value.focus();const f=document.createRange();f.selectNodeContents(c.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(f)}}))},ee=()=>{_.value||(l.value=!0,t.value===null?a.value="null":h(t.value)?a.value="protected-number":typeof t.value=="string"?a.value="string":typeof t.value=="number"?a.value="number":typeof t.value=="boolean"&&(a.value="boolean"),h(t.value)?d.value=k(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value),o.nextTick(()=>{if(p.value){p.value.focus();const f=document.createRange();f.selectNodeContents(p.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(f)}}))},W=()=>{if(t.level===0||!n.value)return;const f=c.value?.innerText.trim()||"";if(!f){b();return}if(f===t.keyName){n.value=!1;return}n.value=!1,s("update:key",C.value,f)},te=()=>{if(l.value)try{let f;const y=p.value?.innerText.trim()||"";if(a.value==="string")y==="null"?f=null:y==="true"||y==="false"?f=y==="true":f=y;else if(a.value==="protected-number")f={__protected_number__:y};else if(y==="null")f=null;else if(y==="true"||y==="false")f=y==="true";else if(!isNaN(Number(y))&&y!==""){const w=Number(y);!Number.isSafeInteger(w)||y.length>15?f={__protected_number__:y}:f=w}else f=y;s("update:value",C.value,f),l.value=!1}catch(f){console.error("Failed to parse value:",f),l.value=!1}},b=()=>{n.value=!1,i.value=t.keyName},E=()=>{l.value=!1,h(t.value)?d.value=k(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value)};return(f,y)=>{const w=o.resolveComponent("JsonNode",!0);return o.openBlock(),o.createElementBlock("div",Qe,[_.value?(o.openBlock(),o.createElementBlock("div",We,[o.createElementVNode("div",Ye,[f.keyName?(o.openBlock(),o.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:n.value,onDblclick:F,onKeydown:[o.withKeys(o.withModifiers(W,["prevent"]),["enter"]),o.withKeys(b,["escape"])],onBlur:W,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},o.toDisplayString(n.value?i.value:`"${O.value}"`),41,Ge)):o.createCommentVNode("",!0),f.keyName?(o.openBlock(),o.createElementBlock("span",Ze,": ")):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"json-node__bracket json-node__bracket--clickable",onClick:X,title:x.value?"Click to collapse":"Click to expand"},o.toDisplayString(R.value),9,De),x.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:2,class:"json-node__collapsed-info",onClick:X,title:`Click to expand ${m.value.trim()}`},o.toDisplayString(m.value),9,Je)),x.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",{key:3,class:"json-node__bracket json-node__bracket--clickable",onClick:X,title:"Click to expand"},o.toDisplayString(z.value),1)),!x.value&&!f.isLast?(o.openBlock(),o.createElementBlock("span",et,",")):o.createCommentVNode("",!0)]),x.value?(o.openBlock(),o.createElementBlock("div",tt,[o.createElementVNode("div",rt,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f.value,(B,S)=>(o.openBlock(),o.createElementBlock("div",{key:S,class:"json-node__child"},[o.createVNode(w,{value:B,"key-name":N.value?"":String(S),level:f.level+1,path:$(String(S)),expanded:f.expanded,theme:f.theme,"onUpdate:value":y[0]||(y[0]=(I,L)=>f.$emit("update:value",I,L)),onToggleExpand:y[1]||(y[1]=I=>f.$emit("toggle-expand",I)),onCopy:y[2]||(y[2]=I=>f.$emit("copy",I)),"onUpdate:key":y[3]||(y[3]=(I,L)=>f.$emit("update:key",I,L)),"is-last":j(String(S))},null,8,["value","key-name","level","path","expanded","theme","is-last"])]))),128))]),o.createElementVNode("div",nt,[o.createElementVNode("span",ot,o.toDisplayString(z.value),1),f.isLast?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",st,","))])])):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",lt,[f.keyName?(o.openBlock(),o.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:n.value,onDblclick:F,onKeydown:[o.withKeys(o.withModifiers(W,["prevent"]),["enter"]),o.withKeys(b,["escape"])],onBlur:W,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},o.toDisplayString(n.value?i.value:`"${O.value}"`),41,it)):o.createCommentVNode("",!0),f.keyName?(o.openBlock(),o.createElementBlock("span",at,": ")):o.createCommentVNode("",!0),o.createElementVNode("span",{class:o.normalizeClass(["json-node__value-wrapper",g.value]),onDblclick:ee,title:T.value},[o.createElementVNode("span",{class:"json-node__value",contenteditable:l.value,onKeydown:[o.withKeys(o.withModifiers(te,["prevent"]),["enter"]),o.withKeys(E,["escape"])],onBlur:te,ref_key:"valueRef",ref:p},o.toDisplayString(l.value?d.value:A.value),41,dt),f.isLast?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",ut,","))],42,ct)]))])}}}),le=(r,e)=>{const t=r.__vccOpts||r;for(const[s,n]of e)t[s]=n;return t},ht=le(ft,[["__scopeId","data-v-1472a8af"]]),ye={name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#656d76",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#2da44e",buttonPrimaryHover:"#2c974b",success:"#1a7f37",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",syntaxString:"#0a3069",syntaxNumber:"#0969da",syntaxBoolean:"#8250df",syntaxNull:"#656d76",syntaxKey:"#0969da",syntaxBracket:"#24292f",hoverBackground:"#f6f8fa",selectionBackground:"rgba(9, 105, 218, 0.2)",collapsedBackground:"#ddf4ff",collapsedBackgroundHover:"#b6e3ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},pt={"github-light":ye,"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#e6edf3",textSecondary:"#7d8590",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#e6edf3",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2419",error:"#f85149",errorBackground:"#381921",syntaxString:"#a5d6ff",syntaxNumber:"#79c0ff",syntaxBoolean:"#d2a8ff",syntaxNull:"#7d8590",syntaxKey:"#79c0ff",syntaxBracket:"#e6edf3",hoverBackground:"#161b22",selectionBackground:"rgba(121, 192, 255, 0.2)",collapsedBackground:"#1c2128",collapsedBackgroundHover:"#2d333b",collapsedText:"#79c0ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#333333",textSecondary:"#888888",buttonBackground:"#f8f8f8",buttonBackgroundHover:"#eeeeee",buttonBorder:"#e0e0e0",buttonText:"#333333",buttonPrimary:"#007acc",buttonPrimaryHover:"#005a9e",success:"#22c55e",successBackground:"#f0fdf4",error:"#ef4444",errorBackground:"#fef2f2",syntaxString:"#22c55e",syntaxNumber:"#3b82f6",syntaxBoolean:"#8b5cf6",syntaxNull:"#6b7280",syntaxKey:"#1f2937",syntaxBracket:"#374151",hoverBackground:"#f9f9f9",selectionBackground:"rgba(59, 130, 246, 0.2)",collapsedBackground:"#e0f2fe",collapsedBackgroundHover:"#bae6fd",collapsedText:"#0284c7",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fefbf6",surfaceBackground:"#faf6f0",border:"#e8d5b7",text:"#4a3b2a",textSecondary:"#8b7355",buttonBackground:"#f4ede4",buttonBackgroundHover:"#efe5d8",buttonBorder:"#e8d5b7",buttonText:"#4a3b2a",buttonPrimary:"#ff6b35",buttonPrimaryHover:"#e55a2b",success:"#ff9500",successBackground:"#fff8f0",error:"#d73502",errorBackground:"#ffeee8",syntaxString:"#d73502",syntaxNumber:"#ff6b35",syntaxBoolean:"#b7472a",syntaxNull:"#8b7355",syntaxKey:"#4a3b2a",syntaxBracket:"#6b5444",hoverBackground:"#f8f2eb",selectionBackground:"rgba(255, 107, 53, 0.2)",collapsedBackground:"#ffe8d6",collapsedBackgroundHover:"#ffd4b0",collapsedText:"#d73502",indentLine:"#e8d5b7"}}};function mt(r="github-light"){return pt[r]||ye}const gt={key:0,class:"json-format__toolbar"},yt={class:"json-format__actions"},bt=["disabled"],Et=["disabled"],_t=["disabled"],kt=["disabled"],xt={class:"json-format__info"},Nt={key:0,class:"json-format__status json-format__status--success"},At={key:1,class:"json-format__status json-format__status--error"},Ct={class:"json-format__content"},wt={key:0,class:"json-format__error"},Bt={key:1,class:"json-format__error"},Tt={key:2,class:"json-format__viewer"},be=le(o.defineComponent({name:"JsonFormat",__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress"],setup(r,{expose:e,emit:t}){o.useCssVars(b=>({"325d5f6b":h.value.colors.border,"407388ed":h.value.colors.background,"1276f42c":h.value.colors.text,"34805dc8":h.value.colors.surfaceBackground,"212f19fd":h.value.colors.buttonBorder,b83cab02:h.value.colors.buttonBackground,b58ba984:h.value.colors.buttonText,d50a3406:h.value.colors.buttonBackgroundHover,"2421bb5e":h.value.colors.buttonPrimary,"0299816b":h.value.colors.buttonPrimaryHover,"55f370f2":h.value.colors.successBackground,b3fc86b8:h.value.colors.success,"781064f7":h.value.colors.errorBackground,"3b9a02e9":h.value.colors.error}));const s=r,n=t,l=o.ref(null),i=o.ref(""),d=o.ref(new Set),a=o.ref(null),c=o.ref(""),p=o.computed(()=>i.value===""),h=o.computed(()=>mt(s.theme)),k=o.computed(()=>c.value?null:a.value!==null?a.value:l.value),_=b=>{if(!b.trim()){l.value=null,i.value="",a.value=null,c.value="";return}try{let E=b;const f=/(:\s*|,\s*|\[\s*)-?\d{16,}/.test(E),y=/(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(E);if(!f&&!y)try{l.value=JSON.parse(E),i.value="",a.value=null,c.value="",o.nextTick(()=>{k.value!==null&&m()});return}catch{}E=(B=>{let S="",I=!1,L=!1,K=0;for(;K<B.length;){const ne=B[K];if(I)L?L=!1:ne==="\\"?L=!0:ne==='"'&&(I=!1),S+=ne,K++;else if(ne==='"')I=!0,S+=ne,K++;else{const Ve=B.slice(K);let H=Ve.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);if(H){S+=H[1]+'{"__protected_number__":"'+H[2]+'"}'+H[3],K+=H[0].length;continue}if(H=Ve.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/),H){S+=H[1]+'{"__protected_number__":"'+H[2]+'"}'+H[3],K+=H[0].length;continue}S+=ne,K++}}return S})(E),l.value=JSON.parse(E),i.value="",a.value=null,c.value="",o.nextTick(()=>{k.value!==null&&m()})}catch(E){i.value=E instanceof Error?E.message:"Unknown parsing error",l.value=null,a.value=null,c.value=""}},N=b=>{if(!b||!b.expression.trim()){C();return}if(!l.value){c.value="No valid JSON data to filter";return}try{let E;if(b.type==="jsonpath")E=P({path:b.expression,json:l.value}),E.length===1&&b.expression.includes("$[")===!1&&!b.expression.endsWith("[*]")?a.value=E[0]:a.value=E;else if(b.type==="js")E=new Function("data",`
1
+ (function(ne,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(ne=typeof globalThis<"u"?globalThis:ne||self,r(ne.LoneFormat={},ne.Vue))})(this,function(ne,r){"use strict";class We{add(e,t,s){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(o){this[o]=this[o]||[],t&&this[o][s?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(s){s.call(t&&t.context?t.context:t,t)})}}class Qe{constructor(e){this.jsep=e,this.registered={}}register(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.forEach(o=>{if(typeof o!="object"||!o.name||!o.init)throw new Error("Invalid JSEP plugin format");this.registered[o.name]||(o.init(this.jsep),this.registered[o.name]=o)})}}class f{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+f.version}static addUnaryOp(e){return f.max_unop_len=Math.max(e.length,f.max_unop_len),f.unary_ops[e]=1,f}static addBinaryOp(e,t,s){return f.max_binop_len=Math.max(e.length,f.max_binop_len),f.binary_ops[e]=t,s?f.right_associative.add(e):f.right_associative.delete(e),f}static addIdentifierChar(e){return f.additional_identifier_chars.add(e),f}static addLiteral(e,t){return f.literals[e]=t,f}static removeUnaryOp(e){return delete f.unary_ops[e],e.length===f.max_unop_len&&(f.max_unop_len=f.getMaxKeyLen(f.unary_ops)),f}static removeAllUnaryOps(){return f.unary_ops={},f.max_unop_len=0,f}static removeIdentifierChar(e){return f.additional_identifier_chars.delete(e),f}static removeBinaryOp(e){return delete f.binary_ops[e],e.length===f.max_binop_len&&(f.max_binop_len=f.getMaxKeyLen(f.binary_ops)),f.right_associative.delete(e),f}static removeAllBinaryOps(){return f.binary_ops={},f.max_binop_len=0,f}static removeLiteral(e){return delete f.literals[e],f}static removeAllLiterals(){return f.literals={},f}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new f(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(t=>t.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return f.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!f.binary_ops[String.fromCharCode(e)]||f.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return f.isIdentifierStart(e)||f.isDecimalDigit(e)}throwError(e){const t=new Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(f.hooks[e]){const s={context:this,node:t};return f.hooks.run(e,s),s.node}return t}searchHook(e){if(f.hooks[e]){const t={context:this};return f.hooks[e].find(function(s){return s.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===f.SPACE_CODE||e===f.TAB_CODE||e===f.LF_CODE||e===f.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const e=this.gobbleExpressions(),t=e.length===1?e[0]:{type:f.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],s,o;for(;this.index<this.expr.length;)if(s=this.code,s===f.SEMCOL_CODE||s===f.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())t.push(o);else if(this.index<this.expr.length){if(s===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){const e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,f.max_binop_len),t=e.length;for(;t>0;){if(f.binary_ops.hasOwnProperty(e)&&(!f.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!f.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,s,o,l,a,d,i,c;if(a=this.gobbleToken(),!a||(t=this.gobbleBinaryOp(),!t))return a;for(l={value:t,prec:f.binaryPrecedence(t),right_a:f.right_associative.has(t)},d=this.gobbleToken(),d||this.throwError("Expected expression after "+t),o=[a,l,d];t=this.gobbleBinaryOp();){if(s=f.binaryPrecedence(t),s===0){this.index-=t.length;break}l={value:t,prec:s,right_a:f.right_associative.has(t)},c=t;const b=p=>l.right_a&&p.right_a?s>p.prec:s<=p.prec;for(;o.length>2&&b(o[o.length-2]);)d=o.pop(),t=o.pop().value,a=o.pop(),e={type:f.BINARY_EXP,operator:t,left:a,right:d},o.push(e);e=this.gobbleToken(),e||this.throwError("Expected expression after "+c),o.push(l,e)}for(i=o.length-1,e=o[i];i>1;)e={type:f.BINARY_EXP,operator:o[i-1].value,left:o[i-2],right:e},i-=2;return e}gobbleToken(){let e,t,s,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(e=this.code,f.isDecimalDigit(e)||e===f.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===f.SQUOTE_CODE||e===f.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(e===f.OBRACK_CODE)o=this.gobbleArray();else{for(t=this.expr.substr(this.index,f.max_unop_len),s=t.length;s>0;){if(f.unary_ops.hasOwnProperty(t)&&(!f.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!f.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=s;const l=this.gobbleToken();return l||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:f.UNARY_EXP,operator:t,argument:l,prefix:!0})}t=t.substr(0,--s)}f.isIdentifierStart(e)?(o=this.gobbleIdentifier(),f.literals.hasOwnProperty(o.name)?o={type:f.LITERAL,value:f.literals[o.name],raw:o.name}:o.name===f.this_str&&(o={type:f.THIS_EXP})):e===f.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===f.PERIOD_CODE||t===f.OBRACK_CODE||t===f.OPAREN_CODE||t===f.QUMARK_CODE;){let s;if(t===f.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==f.PERIOD_CODE)break;s=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===f.OBRACK_CODE?(e={type:f.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()},e.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),t=this.code,t!==f.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===f.OPAREN_CODE?e={type:f.CALL_EXP,arguments:this.gobbleArguments(f.CPAREN_CODE),callee:e}:(t===f.PERIOD_CODE||s)&&(s&&this.index--,this.gobbleSpaces(),e={type:f.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),s&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,s;for(;f.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===f.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);f.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(t=this.char,t==="e"||t==="E"){for(e+=this.expr.charAt(this.index++),t=this.char,(t==="+"||t==="-")&&(e+=this.expr.charAt(this.index++));f.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);f.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return s=this.code,f.isIdentifierStart(s)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(s===f.PERIOD_CODE||e.length===1&&e.charCodeAt(0)===f.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:f.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="";const t=this.index,s=this.expr.charAt(this.index++);let o=!1;for(;this.index<this.expr.length;){let l=this.expr.charAt(this.index++);if(l===s){o=!0;break}else if(l==="\\")switch(l=this.expr.charAt(this.index++),l){case"n":e+=`
2
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=l}else e+=l}return o||this.throwError('Unclosed quote after "'+e+'"'),{type:f.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(f.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(e=this.code,f.isIdentifierPart(e));)this.index++;return{type:f.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){const t=[];let s=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let l=this.code;if(l===e){s=!0,this.index++,e===f.CPAREN_CODE&&o&&o>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}else if(l===f.COMMA_CODE){if(this.index++,o++,o!==t.length){if(e===f.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===f.CBRACK_CODE)for(let a=t.length;a<o;a++)t.push(null)}}else if(t.length!==o&&o!==0)this.throwError("Expected comma");else{const a=this.gobbleExpression();(!a||a.type===f.COMPOUND)&&this.throwError("Expected comma"),t.push(a)}}return s||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(f.CPAREN_CODE);if(this.code===f.CPAREN_CODE)return this.index++,e.length===1?e[0]:e.length?{type:f.SEQUENCE_EXP,expressions:e}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:f.ARRAY_EXP,elements:this.gobbleArguments(f.CBRACK_CODE)}}}const Ye=new We;Object.assign(f,{hooks:Ye,plugins:new Qe(f),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),f.max_unop_len=f.getMaxKeyLen(f.unary_ops),f.max_binop_len=f.getMaxKeyLen(f.binary_ops);const re=n=>new f(n).parse(),De=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(f).filter(n=>!De.includes(n)&&re[n]===void 0).forEach(n=>{re[n]=f[n]}),re.Jsep=f;const Ge="ConditionalExpression";var Ze={name:"ternary",init(n){n.hooks.add("after-expression",function(t){if(t.node&&this.code===n.QUMARK_CODE){this.index++;const s=t.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===n.COLON_CODE){this.index++;const l=this.gobbleExpression();if(l||this.throwError("Expected expression"),t.node={type:Ge,test:s,consequent:o,alternate:l},s.operator&&n.binary_ops[s.operator]<=.9){let a=s;for(;a.right.operator&&n.binary_ops[a.right.operator]<=.9;)a=a.right;t.node.test=a.right,a.right=t.node,t.node=s}}else this.throwError("Expected :")}})}};re.plugins.register(Ze);const Te=47,Je=92;var et={name:"regex",init(n){n.hooks.add("gobble-token",function(t){if(this.code===Te){const s=++this.index;let o=!1;for(;this.index<this.expr.length;){if(this.code===Te&&!o){const l=this.expr.slice(s,this.index);let a="";for(;++this.index<this.expr.length;){const i=this.code;if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)a+=this.char;else break}let d;try{d=new RegExp(l,a)}catch(i){this.throwError(i.message)}return t.node={type:n.LITERAL,value:d,raw:this.expr.slice(s-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===n.OBRACK_CODE?o=!0:o&&this.code===n.CBRACK_CODE&&(o=!1),this.index+=this.code===Je?2:1}this.throwError("Unclosed Regex")}})}};const ke=43,fe={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[ke,45],assignmentPrecedence:.9,init(n){const e=[n.IDENTIFIER,n.MEMBER_EXP];fe.assignmentOperators.forEach(s=>n.addBinaryOp(s,fe.assignmentPrecedence,!0)),n.hooks.add("gobble-token",function(o){const l=this.code;fe.updateOperators.some(a=>a===l&&a===this.expr.charCodeAt(this.index+1))&&(this.index+=2,o.node={type:"UpdateExpression",operator:l===ke?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!o.node.argument||!e.includes(o.node.argument.type))&&this.throwError(`Unexpected ${o.node.operator}`))}),n.hooks.add("after-token",function(o){if(o.node){const l=this.code;fe.updateOperators.some(a=>a===l&&a===this.expr.charCodeAt(this.index+1))&&(e.includes(o.node.type)||this.throwError(`Unexpected ${o.node.operator}`),this.index+=2,o.node={type:"UpdateExpression",operator:l===ke?"++":"--",argument:o.node,prefix:!1})}}),n.hooks.add("after-expression",function(o){o.node&&t(o.node)});function t(s){fe.assignmentOperators.has(s.operator)?(s.type="AssignmentExpression",t(s.left),t(s.right)):s.operator||Object.values(s).forEach(o=>{o&&typeof o=="object"&&t(o)})}}};re.plugins.register(et,fe),re.addUnaryOp("typeof"),re.addLiteral("null",null),re.addLiteral("undefined",void 0);const tt=new Set(["constructor","__proto__","__defineGetter__","__defineSetter__"]),j={evalAst(n,e){switch(n.type){case"BinaryExpression":case"LogicalExpression":return j.evalBinaryExpression(n,e);case"Compound":return j.evalCompound(n,e);case"ConditionalExpression":return j.evalConditionalExpression(n,e);case"Identifier":return j.evalIdentifier(n,e);case"Literal":return j.evalLiteral(n,e);case"MemberExpression":return j.evalMemberExpression(n,e);case"UnaryExpression":return j.evalUnaryExpression(n,e);case"ArrayExpression":return j.evalArrayExpression(n,e);case"CallExpression":return j.evalCallExpression(n,e);case"AssignmentExpression":return j.evalAssignmentExpression(n,e);default:throw SyntaxError("Unexpected expression",n)}},evalBinaryExpression(n,e){return{"||":(s,o)=>s||o(),"&&":(s,o)=>s&&o(),"|":(s,o)=>s|o(),"^":(s,o)=>s^o(),"&":(s,o)=>s&o(),"==":(s,o)=>s==o(),"!=":(s,o)=>s!=o(),"===":(s,o)=>s===o(),"!==":(s,o)=>s!==o(),"<":(s,o)=>s<o(),">":(s,o)=>s>o(),"<=":(s,o)=>s<=o(),">=":(s,o)=>s>=o(),"<<":(s,o)=>s<<o(),">>":(s,o)=>s>>o(),">>>":(s,o)=>s>>>o(),"+":(s,o)=>s+o(),"-":(s,o)=>s-o(),"*":(s,o)=>s*o(),"/":(s,o)=>s/o(),"%":(s,o)=>s%o()}[n.operator](j.evalAst(n.left,e),()=>j.evalAst(n.right,e))},evalCompound(n,e){let t;for(let s=0;s<n.body.length;s++){n.body[s].type==="Identifier"&&["var","let","const"].includes(n.body[s].name)&&n.body[s+1]&&n.body[s+1].type==="AssignmentExpression"&&(s+=1);const o=n.body[s];t=j.evalAst(o,e)}return t},evalConditionalExpression(n,e){return j.evalAst(n.test,e)?j.evalAst(n.consequent,e):j.evalAst(n.alternate,e)},evalIdentifier(n,e){if(Object.hasOwn(e,n.name))return e[n.name];throw ReferenceError(`${n.name} is not defined`)},evalLiteral(n){return n.value},evalMemberExpression(n,e){const t=String(n.computed?j.evalAst(n.property):n.property.name),s=j.evalAst(n.object,e);if(s==null)throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);if(!Object.hasOwn(s,t)&&tt.has(t))throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);const o=s[t];return typeof o=="function"?o.bind(s):o},evalUnaryExpression(n,e){return{"-":s=>-j.evalAst(s,e),"!":s=>!j.evalAst(s,e),"~":s=>~j.evalAst(s,e),"+":s=>+j.evalAst(s,e),typeof:s=>typeof j.evalAst(s,e)}[n.operator](n.argument)},evalArrayExpression(n,e){return n.elements.map(t=>j.evalAst(t,e))},evalCallExpression(n,e){const t=n.arguments.map(o=>j.evalAst(o,e));return j.evalAst(n.callee,e)(...t)},evalAssignmentExpression(n,e){if(n.left.type!=="Identifier")throw SyntaxError("Invalid left-hand side in assignment");const t=n.left.name,s=j.evalAst(n.right,e);return e[t]=s,e[t]}};class nt{constructor(e){this.code=e,this.ast=re(this.code)}runInNewContext(e){const t=Object.assign(Object.create(null),e);return j.evalAst(this.ast,t)}}function le(n,e){return n=n.slice(),n.push(e),n}function Ne(n,e){return e=e.slice(),e.unshift(n),e}class rt extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}}function K(n,e,t,s,o){if(!(this instanceof K))try{return new K(n,e,t,s,o)}catch(a){if(!a.avoidNew)throw a;return a.value}typeof n=="string"&&(o=s,s=t,t=e,e=n,n=null);const l=n&&typeof n=="object";if(n=n||{},this.json=n.json||t,this.path=n.path||e,this.resultType=n.resultType||"value",this.flatten=n.flatten||!1,this.wrap=Object.hasOwn(n,"wrap")?n.wrap:!0,this.sandbox=n.sandbox||{},this.eval=n.eval===void 0?"safe":n.eval,this.ignoreEvalErrors=typeof n.ignoreEvalErrors>"u"?!1:n.ignoreEvalErrors,this.parent=n.parent||null,this.parentProperty=n.parentProperty||null,this.callback=n.callback||s||null,this.otherTypeCallback=n.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},n.autostart!==!1){const a={path:l?n.path:e};l?"json"in n&&(a.json=n.json):a.json=t;const d=this.evaluate(a);if(!d||typeof d!="object")throw new rt(d);return d}}K.prototype.evaluate=function(n,e,t,s){let o=this.parent,l=this.parentProperty,{flatten:a,wrap:d}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,t=t||this.callback,this.currOtherTypeCallback=s||this.otherTypeCallback,e=e||this.json,n=n||this.path,n&&typeof n=="object"&&!Array.isArray(n)){if(!n.path&&n.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!Object.hasOwn(n,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=n),a=Object.hasOwn(n,"flatten")?n.flatten:a,this.currResultType=Object.hasOwn(n,"resultType")?n.resultType:this.currResultType,this.currSandbox=Object.hasOwn(n,"sandbox")?n.sandbox:this.currSandbox,d=Object.hasOwn(n,"wrap")?n.wrap:d,this.currEval=Object.hasOwn(n,"eval")?n.eval:this.currEval,t=Object.hasOwn(n,"callback")?n.callback:t,this.currOtherTypeCallback=Object.hasOwn(n,"otherTypeCallback")?n.otherTypeCallback:this.currOtherTypeCallback,o=Object.hasOwn(n,"parent")?n.parent:o,l=Object.hasOwn(n,"parentProperty")?n.parentProperty:l,n=n.path}if(o=o||null,l=l||null,Array.isArray(n)&&(n=K.toPathString(n)),!n&&n!==""||!e)return;const i=K.toPathArray(n);i[0]==="$"&&i.length>1&&i.shift(),this._hasParentSelector=null;const c=this._trace(i,e,["$"],o,l,t).filter(function(b){return b&&!b.isParentSelector});return c.length?!d&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce((b,p)=>{const k=this._getPreferredOutput(p);return a&&Array.isArray(k)?b=b.concat(k):b.push(k),b},[]):d?[]:void 0},K.prototype._getPreferredOutput=function(n){const e=this.currResultType;switch(e){case"all":{const t=Array.isArray(n.path)?n.path:K.toPathArray(n.path);return n.pointer=K.toPointer(t),n.path=typeof n.path=="string"?n.path:K.toPathString(n.path),n}case"value":case"parent":case"parentProperty":return n[e];case"path":return K.toPathString(n[e]);case"pointer":return K.toPointer(n.path);default:throw new TypeError("Unknown result type")}},K.prototype._handleCallback=function(n,e,t){if(e){const s=this._getPreferredOutput(n);n.path=typeof n.path=="string"?n.path:K.toPathString(n.path),e(s,t,n)}},K.prototype._trace=function(n,e,t,s,o,l,a,d){let i;if(!n.length)return i={path:t,value:e,parent:s,parentProperty:o,hasArrExpr:a},this._handleCallback(i,l,"value"),i;const c=n[0],b=n.slice(1),p=[];function k(E){Array.isArray(E)?E.forEach(O=>{p.push(O)}):p.push(E)}if((typeof c!="string"||d)&&e&&Object.hasOwn(e,c))k(this._trace(b,e[c],le(t,c),e,c,l,a));else if(c==="*")this._walk(e,E=>{k(this._trace(b,e[E],le(t,E),e,E,l,!0,!0))});else if(c==="..")k(this._trace(b,e,t,s,o,l,a)),this._walk(e,E=>{typeof e[E]=="object"&&k(this._trace(n.slice(),e[E],le(t,E),e,E,l,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:t.slice(0,-1),expr:b,isParentSelector:!0};if(c==="~")return i={path:le(t,c),value:o,parent:s,parentProperty:null},this._handleCallback(i,l,"property"),i;if(c==="$")k(this._trace(b,e,t,null,null,l,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(c))k(this._slice(c,b,e,t,s,o,l));else if(c.indexOf("?(")===0){if(this.currEval===!1)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const E=c.replace(/^\?\((.*?)\)$/u,"$1"),O=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(E);O?this._walk(e,$=>{const w=[O[2]],L=O[1]?e[$][O[1]]:e[$];this._trace(w,L,t,s,o,l,!0).length>0&&k(this._trace(b,e[$],le(t,$),e,$,l,!0))}):this._walk(e,$=>{this._eval(E,e[$],$,t,s,o)&&k(this._trace(b,e[$],le(t,$),e,$,l,!0))})}else if(c[0]==="("){if(this.currEval===!1)throw new Error("Eval [(expr)] prevented in JSONPath expression.");k(this._trace(Ne(this._eval(c,e,t.at(-1),t.slice(0,-1),s,o),b),e,t,s,o,l,a))}else if(c[0]==="@"){let E=!1;const O=c.slice(1,-2);switch(O){case"scalar":(!e||!["object","function"].includes(typeof e))&&(E=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===O&&(E=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(E=!0);break;case"number":Number.isFinite(e)&&(E=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(E=!0);break;case"object":e&&typeof e===O&&(E=!0);break;case"array":Array.isArray(e)&&(E=!0);break;case"other":E=this.currOtherTypeCallback(e,t,s,o);break;case"null":e===null&&(E=!0);break;default:throw new TypeError("Unknown value type "+O)}if(E)return i={path:t,value:e,parent:s,parentProperty:o},this._handleCallback(i,l,"value"),i}else if(c[0]==="`"&&e&&Object.hasOwn(e,c.slice(1))){const E=c.slice(1);k(this._trace(b,e[E],le(t,E),e,E,l,a,!0))}else if(c.includes(",")){const E=c.split(",");for(const O of E)k(this._trace(Ne(O,b),e,t,s,o,l,!0))}else!d&&e&&Object.hasOwn(e,c)&&k(this._trace(b,e[c],le(t,c),e,c,l,a,!0))}if(this._hasParentSelector)for(let E=0;E<p.length;E++){const O=p[E];if(O&&O.isParentSelector){const $=this._trace(O.expr,e,O.path,s,o,l,a);if(Array.isArray($)){p[E]=$[0];const w=$.length;for(let L=1;L<w;L++)E++,p.splice(E,0,$[L])}else p[E]=$}}return p},K.prototype._walk=function(n,e){if(Array.isArray(n)){const t=n.length;for(let s=0;s<t;s++)e(s)}else n&&typeof n=="object"&&Object.keys(n).forEach(t=>{e(t)})},K.prototype._slice=function(n,e,t,s,o,l,a){if(!Array.isArray(t))return;const d=t.length,i=n.split(":"),c=i[2]&&Number.parseInt(i[2])||1;let b=i[0]&&Number.parseInt(i[0])||0,p=i[1]&&Number.parseInt(i[1])||d;b=b<0?Math.max(0,b+d):Math.min(d,b),p=p<0?Math.max(0,p+d):Math.min(d,p);const k=[];for(let E=b;E<p;E+=c)this._trace(Ne(E,e),t,s,o,l,a,!0).forEach($=>{k.push($)});return k},K.prototype._eval=function(n,e,t,s,o,l){this.currSandbox._$_parentProperty=l,this.currSandbox._$_parent=o,this.currSandbox._$_property=t,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;const a=n.includes("@path");a&&(this.currSandbox._$_path=K.toPathString(s.concat([t])));const d=this.currEval+"Script:"+n;if(!K.cache[d]){let i=n.replaceAll("@parentProperty","_$_parentProperty").replaceAll("@parent","_$_parent").replaceAll("@property","_$_property").replaceAll("@root","_$_root").replaceAll(/@([.\s)[])/gu,"_$_v$1");if(a&&(i=i.replaceAll("@path","_$_path")),this.currEval==="safe"||this.currEval===!0||this.currEval===void 0)K.cache[d]=new this.safeVm.Script(i);else if(this.currEval==="native")K.cache[d]=new this.vm.Script(i);else if(typeof this.currEval=="function"&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,"runInNewContext")){const c=this.currEval;K.cache[d]=new c(i)}else if(typeof this.currEval=="function")K.cache[d]={runInNewContext:c=>this.currEval(i,c)};else throw new TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return K.cache[d].runInNewContext(this.currSandbox)}catch(i){if(this.ignoreEvalErrors)return!1;throw new Error("jsonPath: "+i.message+": "+n)}},K.cache={},K.toPathString=function(n){const e=n,t=e.length;let s="$";for(let o=1;o<t;o++)/^(~|\^|@.*?\(\))$/u.test(e[o])||(s+=/^[0-9*]+$/u.test(e[o])?"["+e[o]+"]":"['"+e[o]+"']");return s},K.toPointer=function(n){const e=n,t=e.length;let s="";for(let o=1;o<t;o++)/^(~|\^|@.*?\(\))$/u.test(e[o])||(s+="/"+e[o].toString().replaceAll("~","~0").replaceAll("/","~1"));return s},K.toPathArray=function(n){const{cache:e}=K;if(e[n])return e[n].concat();const t=[],o=n.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(l,a){return"[#"+(t.push(a)-1)+"]"}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(l,a){return"['"+a.replaceAll(".","%@%").replaceAll("~","%%@@%%")+"']"}).replaceAll("~",";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replaceAll("%@%",".").replaceAll("%%@@%%","~").replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(l,a){return";"+a.split("").join(";")+";"}).replaceAll(/;;;|;;/gu,";..;").replaceAll(/;$|'?\]|'$/gu,"").split(";").map(function(l){const a=l.match(/#(\d+)/u);return!a||!a[1]?l:t[a[1]]});return e[n]=o,e[n].concat()},K.prototype.safeVm={Script:nt};const ot=function(n,e,t){const s=n.length;for(let o=0;o<s;o++){const l=n[o];t(l)&&e.push(n.splice(o--,1)[0])}};class st{constructor(e){this.code=e}runInNewContext(e){let t=this.code;const s=Object.keys(e),o=[];ot(s,o,c=>typeof e[c]=="function");const l=s.map(c=>e[c]);t=o.reduce((c,b)=>{let p=e[b].toString();return/function/u.test(p)||(p="function "+p),"var "+b+"="+p+";"+c},"")+t,!/(['"])use strict\1/u.test(t)&&!s.includes("arguments")&&(t="var arguments = undefined;"+t),t=t.replace(/;\s*$/u,"");const d=t.lastIndexOf(";"),i=d!==-1?t.slice(0,d+1)+" return "+t.slice(d+1):" return "+t;return new Function(...s,i)(...l)}}K.prototype.vm={Script:st};const lt={class:"json-node"},at={key:0,class:"json-node__container"},it={class:"json-node__line"},ct=["contenteditable","onKeydown"],dt={key:1,class:"json-node__colon"},ut=["title"],ft=["title"],ht={key:4,class:"json-node__comma"},pt={key:0,class:"json-node__children"},mt={class:"json-node__children-content"},gt={class:"json-node__line json-node__closing-bracket"},yt={class:"json-node__bracket"},bt={key:0,class:"json-node__comma"},Et={key:1,class:"json-node__primitive"},_t=["contenteditable","onKeydown"],xt={key:1,class:"json-node__colon"},kt=["title"],Nt=["contenteditable","onKeydown"],wt={key:0,class:"json-node__comma"},At=r.defineComponent({name:"JsonNode",__name:"JsonNode",props:{value:{},keyName:{},level:{},path:{default:""},expanded:{},isLast:{type:Boolean,default:!1},theme:{}},emits:["update:value","toggle-expand","copy","update:key"],setup(n,{emit:e}){r.useCssVars(u=>({"2a18b018":u.level,"58a14b93":u.theme.colors.syntaxKey,"46fe1b3e":u.theme.colors.hoverBackground,fbe2c048:u.theme.colors.syntaxBracket,"4bd524bb":u.theme.colors.collapsedText,"3308d23c":u.theme.colors.collapsedBackground,"36380c60":u.theme.colors.collapsedBackgroundHover,"0892365d":u.theme.colors.syntaxString,"0015b195":u.theme.colors.syntaxNumber,"7db95f5c":u.theme.colors.syntaxBoolean,"88ec825a":u.theme.colors.syntaxNull,"537157f7":u.theme.colors.background,"3cee3331":u.theme.colors.selectionBackground,"81323cee":u.theme.colors.indentLine}));const t=n,s=e,o=r.ref(!1),l=r.ref(!1),a=r.ref(""),d=r.ref(""),i=r.ref("string"),c=r.ref(null),b=r.ref(null),p=u=>u!==null&&typeof u=="object"&&!Array.isArray(u)&&"__protected_number__"in u&&Object.keys(u).length===1,k=u=>p(u)?u.__protected_number__:"",E=r.computed(()=>p(t.value)?!1:t.value!==null&&typeof t.value=="object"),O=r.computed(()=>Array.isArray(t.value)),$=r.computed(()=>t.path?t.path:t.keyName?t.keyName:"root"),w=r.computed(()=>t.expanded.has($.value)),L=r.computed(()=>t.keyName),F=r.computed(()=>O.value?"[":"{"),M=r.computed(()=>O.value?"]":"}"),z=r.computed(()=>{if(!t.value)return"";const y=Object.keys(t.value).length;return O.value?y>0?` ${y} items `:" ":y>0?` ${y} keys `:" "}),ee=r.computed(()=>{const u=typeof t.value;return t.value===null?"json-node__value--null":u==="boolean"?"json-node__value--boolean":u==="number"||p(t.value)?"json-node__value--number":u==="string"?"json-node__value--string":""}),G=r.computed(()=>t.value===null?"null":typeof t.value=="boolean"||typeof t.value=="number"?String(t.value):p(t.value)?k(t.value):typeof t.value=="string"?`"${t.value}"`:String(t.value)),Z=r.computed(()=>"Double-click to edit"),J=u=>t.level===0?u:$.value?`${$.value}.${u}`:u,te=u=>{const y=Object.keys(t.value);return y.indexOf(u)===y.length-1},_=()=>{s("toggle-expand",$.value)},C=()=>{t.level!==0&&(o.value=!0,a.value=t.keyName,r.nextTick(()=>{if(c.value){c.value.focus();const u=document.createRange();u.selectNodeContents(c.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(u)}}))},V=()=>{E.value||(l.value=!0,t.value===null?i.value="null":p(t.value)?i.value="protected-number":typeof t.value=="string"?i.value="string":typeof t.value=="number"?i.value="number":typeof t.value=="boolean"&&(i.value="boolean"),p(t.value)?d.value=k(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value),r.nextTick(()=>{if(b.value){b.value.focus();const u=document.createRange();u.selectNodeContents(b.value);const y=window.getSelection();y?.removeAllRanges(),y?.addRange(u)}}))},A=()=>{if(t.level===0||!o.value)return;const u=c.value?.innerText.trim()||"";if(!u){g();return}if(u===t.keyName){o.value=!1;return}o.value=!1,s("update:key",$.value,u)},T=()=>{if(l.value)try{let u;const y=b.value?.innerText.trim()||"";if(i.value==="string")y==="null"?u=null:y==="true"||y==="false"?u=y==="true":u=y;else if(i.value==="protected-number")u={__protected_number__:y};else if(y==="null")u=null;else if(y==="true"||y==="false")u=y==="true";else if(!isNaN(Number(y))&&y!==""){const B=Number(y);!Number.isSafeInteger(B)||y.length>15?u={__protected_number__:y}:u=B}else u=y;s("update:value",$.value,u),l.value=!1}catch(u){console.error("Failed to parse value:",u),l.value=!1}},g=()=>{o.value=!1,a.value=t.keyName},m=()=>{l.value=!1,p(t.value)?d.value=k(t.value):typeof t.value=="string"?d.value=t.value:d.value=String(t.value)};return(u,y)=>{const B=r.resolveComponent("JsonNode",!0);return r.openBlock(),r.createElementBlock("div",lt,[E.value?(r.openBlock(),r.createElementBlock("div",at,[r.createElementVNode("div",it,[u.keyName?(r.openBlock(),r.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:o.value,onDblclick:C,onKeydown:[r.withKeys(r.withModifiers(A,["prevent"]),["enter"]),r.withKeys(g,["escape"])],onBlur:A,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},r.toDisplayString(o.value?a.value:`"${L.value}"`),41,ct)):r.createCommentVNode("",!0),u.keyName?(r.openBlock(),r.createElementBlock("span",dt,": ")):r.createCommentVNode("",!0),r.createElementVNode("span",{class:"json-node__bracket json-node__bracket--clickable",onClick:_,title:w.value?"Click to collapse":"Click to expand"},r.toDisplayString(F.value),9,ut),w.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",{key:2,class:"json-node__collapsed-info",onClick:_,title:`Click to expand ${z.value.trim()}`},r.toDisplayString(z.value),9,ft)),w.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",{key:3,class:"json-node__bracket json-node__bracket--clickable",onClick:_,title:"Click to expand"},r.toDisplayString(M.value),1)),!w.value&&!u.isLast?(r.openBlock(),r.createElementBlock("span",ht,",")):r.createCommentVNode("",!0)]),w.value?(r.openBlock(),r.createElementBlock("div",pt,[r.createElementVNode("div",mt,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,(x,v)=>(r.openBlock(),r.createElementBlock("div",{key:v,class:"json-node__child"},[r.createVNode(B,{value:x,"key-name":O.value?"":String(v),level:u.level+1,path:J(String(v)),expanded:u.expanded,theme:u.theme,"onUpdate:value":y[0]||(y[0]=(S,I)=>u.$emit("update:value",S,I)),onToggleExpand:y[1]||(y[1]=S=>u.$emit("toggle-expand",S)),onCopy:y[2]||(y[2]=S=>u.$emit("copy",S)),"onUpdate:key":y[3]||(y[3]=(S,I)=>u.$emit("update:key",S,I)),"is-last":te(String(v))},null,8,["value","key-name","level","path","expanded","theme","is-last"])]))),128))]),r.createElementVNode("div",gt,[r.createElementVNode("span",yt,r.toDisplayString(M.value),1),u.isLast?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",bt,","))])])):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",Et,[u.keyName?(r.openBlock(),r.createElementBlock("span",{key:0,class:"json-node__key",contenteditable:o.value,onDblclick:C,onKeydown:[r.withKeys(r.withModifiers(A,["prevent"]),["enter"]),r.withKeys(g,["escape"])],onBlur:A,ref_key:"keyRef",ref:c,title:"Double-click to edit key"},r.toDisplayString(o.value?a.value:`"${L.value}"`),41,_t)):r.createCommentVNode("",!0),u.keyName?(r.openBlock(),r.createElementBlock("span",xt,": ")):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["json-node__value-wrapper",ee.value]),onDblclick:V,title:Z.value},[r.createElementVNode("span",{class:"json-node__value",contenteditable:l.value,onKeydown:[r.withKeys(r.withModifiers(T,["prevent"]),["enter"]),r.withKeys(m,["escape"])],onBlur:T,ref_key:"valueRef",ref:b},r.toDisplayString(l.value?d.value:G.value),41,Nt),u.isLast?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",wt,","))],42,kt)]))])}}}),ge=(n,e)=>{const t=n.__vccOpts||n;for(const[s,o]of e)t[s]=o;return t},Ct=ge(At,[["__scopeId","data-v-1472a8af"]]),ve={name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#656d76",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#2da44e",buttonPrimaryHover:"#2c974b",success:"#1a7f37",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",syntaxString:"#0a3069",syntaxNumber:"#0969da",syntaxBoolean:"#8250df",syntaxNull:"#656d76",syntaxKey:"#0969da",syntaxBracket:"#24292f",hoverBackground:"#f6f8fa",selectionBackground:"rgba(9, 105, 218, 0.2)",collapsedBackground:"#ddf4ff",collapsedBackgroundHover:"#b6e3ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},Bt={"github-light":ve,"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#e6edf3",textSecondary:"#7d8590",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#e6edf3",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2419",error:"#f85149",errorBackground:"#381921",syntaxString:"#a5d6ff",syntaxNumber:"#79c0ff",syntaxBoolean:"#d2a8ff",syntaxNull:"#7d8590",syntaxKey:"#79c0ff",syntaxBracket:"#e6edf3",hoverBackground:"#161b22",selectionBackground:"rgba(121, 192, 255, 0.2)",collapsedBackground:"#1c2128",collapsedBackgroundHover:"#2d333b",collapsedText:"#79c0ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#333333",textSecondary:"#888888",buttonBackground:"#f8f8f8",buttonBackgroundHover:"#eeeeee",buttonBorder:"#e0e0e0",buttonText:"#333333",buttonPrimary:"#007acc",buttonPrimaryHover:"#005a9e",success:"#22c55e",successBackground:"#f0fdf4",error:"#ef4444",errorBackground:"#fef2f2",syntaxString:"#22c55e",syntaxNumber:"#3b82f6",syntaxBoolean:"#8b5cf6",syntaxNull:"#6b7280",syntaxKey:"#1f2937",syntaxBracket:"#374151",hoverBackground:"#f9f9f9",selectionBackground:"rgba(59, 130, 246, 0.2)",collapsedBackground:"#e0f2fe",collapsedBackgroundHover:"#bae6fd",collapsedText:"#0284c7",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fefbf6",surfaceBackground:"#faf6f0",border:"#e8d5b7",text:"#4a3b2a",textSecondary:"#8b7355",buttonBackground:"#f4ede4",buttonBackgroundHover:"#efe5d8",buttonBorder:"#e8d5b7",buttonText:"#4a3b2a",buttonPrimary:"#ff6b35",buttonPrimaryHover:"#e55a2b",success:"#ff9500",successBackground:"#fff8f0",error:"#d73502",errorBackground:"#ffeee8",syntaxString:"#d73502",syntaxNumber:"#ff6b35",syntaxBoolean:"#b7472a",syntaxNull:"#8b7355",syntaxKey:"#4a3b2a",syntaxBracket:"#6b5444",hoverBackground:"#f8f2eb",selectionBackground:"rgba(255, 107, 53, 0.2)",collapsedBackground:"#ffe8d6",collapsedBackgroundHover:"#ffd4b0",collapsedText:"#d73502",indentLine:"#e8d5b7"}}};function Tt(n="github-light"){return Bt[n]||ve}const vt={key:0,class:"json-format__toolbar"},St={class:"json-format__actions"},Ot=["disabled"],$t=["disabled"],Pt=["disabled"],Vt=["disabled"],It={class:"json-format__info"},Rt={key:0,class:"json-format__status json-format__status--success"},Lt={key:1,class:"json-format__status json-format__status--error"},Mt={class:"json-format__content"},Kt={key:0,class:"json-format__error"},jt={key:1,class:"json-format__error"},Ut={key:2,class:"json-format__viewer"},Se=ge(r.defineComponent({name:"JsonFormat",__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress"],setup(n,{expose:e,emit:t}){r.useCssVars(g=>({"325d5f6b":p.value.colors.border,"407388ed":p.value.colors.background,"1276f42c":p.value.colors.text,"34805dc8":p.value.colors.surfaceBackground,"212f19fd":p.value.colors.buttonBorder,b83cab02:p.value.colors.buttonBackground,b58ba984:p.value.colors.buttonText,d50a3406:p.value.colors.buttonBackgroundHover,"2421bb5e":p.value.colors.buttonPrimary,"0299816b":p.value.colors.buttonPrimaryHover,"55f370f2":p.value.colors.successBackground,b3fc86b8:p.value.colors.success,"781064f7":p.value.colors.errorBackground,"3b9a02e9":p.value.colors.error}));const s=n,o=t,l=r.ref(null),a=r.ref(""),d=r.ref(new Set),i=r.ref(null),c=r.ref(""),b=r.computed(()=>a.value===""),p=r.computed(()=>Tt(s.theme)),k=r.computed(()=>c.value?null:i.value!==null?i.value:l.value),E=g=>{if(!g.trim()){l.value=null,a.value="",i.value=null,c.value="";return}try{let m=g;const u=/(:\s*|,\s*|\[\s*)-?\d{16,}/.test(m),y=/(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(m);if(!u&&!y)try{l.value=JSON.parse(m),a.value="",i.value=null,c.value="",r.nextTick(()=>{k.value!==null&&z()});return}catch{}m=(x=>{let v="",S=!1,I=!1,U=0;for(;U<x.length;){const Y=x[U];if(S)I?I=!1:Y==="\\"?I=!0:Y==='"'&&(S=!1),v+=Y,U++;else if(Y==='"')S=!0,v+=Y,U++;else{const ue=x.slice(U);let q=ue.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);if(q){v+=q[1]+'{"__protected_number__":"'+q[2]+'"}'+q[3],U+=q[0].length;continue}if(q=ue.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/),q){v+=q[1]+'{"__protected_number__":"'+q[2]+'"}'+q[3],U+=q[0].length;continue}v+=Y,U++}}return v})(m),l.value=JSON.parse(m),a.value="",i.value=null,c.value="",r.nextTick(()=>{k.value!==null&&z()})}catch(m){a.value=m instanceof Error?m.message:"Unknown parsing error",l.value=null,i.value=null,c.value=""}},O=g=>{if(!g||!g.expression.trim()){$();return}if(!l.value){c.value="No valid JSON data to filter";return}try{let m;if(g.type==="jsonpath")m=K({path:g.expression,json:l.value}),m.length===1&&g.expression.includes("$[")===!1&&!g.expression.endsWith("[*]")?i.value=m[0]:i.value=m;else if(g.type==="js")m=new Function("data",`
3
3
  try {
4
- return ${b.expression};
4
+ return ${g.expression};
5
5
  } catch (error) {
6
6
  throw new Error('JavaScript expression error: ' + error.message);
7
7
  }
8
- `)(l.value),a.value=E;else throw new Error(`Unsupported filter type: ${b.type}`);c.value="",o.nextTick(()=>{m()})}catch(E){c.value=E instanceof Error?E.message:"Filter execution error",a.value=null}},C=()=>{a.value=null,c.value=""};o.watch(()=>s.modelValue,b=>{_(b)},{immediate:!0});const x=(b,E,f)=>{const y=S=>{if(S===null||typeof S!="object")return S;if(!Array.isArray(S)&&"__protected_number__"in S&&Object.keys(S).length===1)return`__PROTECTED_NUMBER_${S.__protected_number__}_PROTECTED_NUMBER__`;if(Array.isArray(S))return S.map(L=>y(L));const I={};for(const[L,K]of Object.entries(S))I[L]=y(K);return I},w=y(b);return JSON.stringify(w,E,f).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g,"$1")},O=(b,E)=>{if(!s.readonly)try{const f=R(l.value,b,E),y=x(f,null,2);n("update:modelValue",y)}catch(f){console.error("Failed to update JSON:",f)}},R=(b,E,f)=>{if(!E||E==="root")return f;const y=E.split("."),w=F(b,y.slice(0,-1));let B=w;for(let I=0;I<y.length-1;I++){const L=y[I];L!=="root"&&(Array.isArray(B)?B=B[parseInt(L)]:B=B[L])}const S=y[y.length-1];return S==="root"?f:(Array.isArray(B)?B[parseInt(S)]=f:B[S]=f,w)},z=b=>{d.value.has(b)?d.value.delete(b):d.value.add(b)},m=()=>{const b=new Set,E=(f,y="")=>{f!==null&&typeof f=="object"&&(b.add(y||"root"),Array.isArray(f)?f.forEach((w,B)=>{const S=y?`${y}.${B}`:`${B}`;E(w,S)}):Object.keys(f).forEach(w=>{const B=y?`${y}.${w}`:w;E(f[w],B)}))};E(k.value),d.value=b,n("expand-all")},g=()=>{d.value=new Set(["root"]),n("collapse-all")},A=async()=>{if(p.value)try{const b=k.value,E=x(b,null,2);await navigator.clipboard.writeText(E),n("copy-success",E)}catch(b){console.error("Failed to copy JSON:",b),n("copy-error",b instanceof Error?b:new Error("Failed to copy JSON"))}},T=()=>{if(p.value)try{const b=k.value,E=x(b);n("update:modelValue",E),n("compress",E)}catch(b){console.error("Failed to compress JSON:",b)}},$=async b=>{try{let E;typeof b=="object"&&b!==null&&!Array.isArray(b)&&"__protected_number__"in b&&Object.keys(b).length===1?E=b.__protected_number__:typeof b=="string"?E=`"${b}"`:E=JSON.stringify(b),await navigator.clipboard.writeText(E)}catch(E){console.error("Failed to copy value:",E)}},j=(b,E)=>{if(!s.readonly)try{const f=X(l.value,b,E),y=x(f,null,2);n("update:modelValue",y),te(b,E)}catch(f){console.error("Failed to rename key:",f)}},X=(b,E,f)=>{if(!E||E==="root")return b;const y=E.split("."),w=F(b,y.slice(0,-1));if(y.length===1){const I=y[0];return w&&typeof w=="object"&&!Array.isArray(w)?ee(w,I,f):w}let B=w;for(let I=0;I<y.length-1;I++){const L=y[I];Array.isArray(B)?B=B[parseInt(L)]:B=B[L]}const S=y[y.length-1];if(!Array.isArray(B)&&B&&typeof B=="object"){const I=ee(B,S,f),L=y.slice(0,-1);L.length>0&&W(w,L,I)}return w},F=(b,E)=>{if(E.length===0)return b;if(Array.isArray(b)){const f=[...b],y=E[0],w=parseInt(y);return E.length===1||(f[w]=F(b[w],E.slice(1))),f}else if(b&&typeof b=="object"){const f={...b},y=E[0];return E.length===1||(f[y]=F(b[y],E.slice(1))),f}return b},ee=(b,E,f)=>{if(!b||typeof b!="object"||Array.isArray(b))return b;const y=Object.keys(b),w={};for(const B of y)B===E?w[f]=b[B]:w[B]=b[B];return w},W=(b,E,f)=>{let y=b;for(let B=0;B<E.length-1;B++){const S=E[B];Array.isArray(y)?y=y[parseInt(S)]:y=y[S]}const w=E[E.length-1];Array.isArray(y)?y[parseInt(w)]=f:y[w]=f},te=(b,E)=>{const f=new Set;d.value.forEach(y=>{if(y===b){const w=b.split(".");w[w.length-1]=E,f.add(w.join("."))}else if(y.startsWith(b+".")){const w=b.split(".");w[w.length-1]=E;const B=w.join("."),S=y.substring(b.length);f.add(B+S)}else f.add(y)}),d.value=f};return e({copyJson:A,compressSource:T,expandAll:m,collapseAll:g,toggleExpand:z,updateValue:O,updateKey:j,filter:N,clearFilter:C,isValidJson:()=>p.value,getParsedJson:()=>l.value,getFilteredJson:()=>a.value,getExpandedNodes:()=>d.value,getParseError:()=>i.value,getFilterError:()=>c.value,parseJson:b=>_(b),copyValue:b=>$(b)}),(b,E)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["json-format",`json-format--${h.value.name}`])},[b.showToolbar?(o.openBlock(),o.createElementBlock("div",gt,[o.createElementVNode("div",yt,[o.createElementVNode("button",{class:"json-format__btn json-format__btn--primary",onClick:A,disabled:!p.value,title:"Copy JSON"}," 📋 Copy ",8,bt),o.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:m,disabled:!p.value,title:"Expand All"}," ⬇️ Expand All ",8,Et),o.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:g,disabled:!p.value,title:"Collapse All"}," ➡️ Collapse All ",8,_t),o.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:T,disabled:!p.value,title:"Compress JSON"}," 📦 Compress ",8,kt)]),o.createElementVNode("div",xt,[p.value?(o.openBlock(),o.createElementBlock("span",Nt," ✅ Valid JSON ")):(o.openBlock(),o.createElementBlock("span",At," ❌ Invalid JSON "))])])):o.createCommentVNode("",!0),o.createElementVNode("div",Ct,[p.value?c.value?(o.openBlock(),o.createElementBlock("div",Bt,[E[1]||(E[1]=o.createElementVNode("h4",null,"Filter Error:",-1)),o.createElementVNode("pre",null,o.toDisplayString(c.value),1)])):(o.openBlock(),o.createElementBlock("div",Tt,[o.createVNode(ht,{value:k.value,"key-name":"",level:0,expanded:d.value,"is-last":!0,theme:h.value,"onUpdate:value":O,onToggleExpand:z,onCopy:$,"onUpdate:key":j},null,8,["value","expanded","theme"])])):(o.openBlock(),o.createElementBlock("div",wt,[E[0]||(E[0]=o.createElementVNode("h4",null,"JSON Parse Error:",-1)),o.createElementVNode("pre",null,o.toDisplayString(i.value),1)]))])],2))}}),[["__scopeId","data-v-b956002c"]]),Ot={key:0,class:"xml-node__comment"},St={key:1,class:"xml-node__cdata"},Pt={key:2,class:"xml-node__element"},$t={key:0,class:"xml-node__line"},Vt={key:1,class:"xml-node__line"},It={key:2},vt={key:0,class:"xml-node__line"},Lt=["title"],Rt={class:"xml-node__line"},jt=["title"],Mt={key:1},Ft=["title"],Ut={key:0,class:"xml-node__children"},Xt={key:0,class:"xml-node__text"},zt={key:1,class:"xml-node__line"},Ht=le(o.defineComponent({__name:"XmlNode",props:{node:{},index:{},level:{default:0},parentPath:{default:""},expanded:{},theme:{}},emits:["toggle-expand","copy"],setup(r,{emit:e}){const t=r,s=e,n=o.computed(()=>Object.keys(t.node).find(g=>!g.startsWith(":")&&!g.startsWith("#"))||""),l=o.computed(()=>n.value?t.parentPath?`${t.parentPath}[${t.index}]`:`${n.value}[${t.index}]`:""),i=o.computed(()=>t.expanded.has(l.value)),d=o.computed(()=>t.node["#comment"]?"comment":t.node.__cdata?"cdata":n.value?"element":"unknown"),a=o.computed(()=>{const m=t.node[":@"]||{},g={};return Object.keys(m).forEach(A=>{A.startsWith("@_")&&(g[A.substring(2)]=m[A])}),g}),c=o.computed(()=>{if(d.value!=="element"||!n.value)return[];const m=t.node[n.value];return Array.isArray(m)?m:[]}),p=o.computed(()=>c.value.some(m=>m.__cdata)),h=o.computed(()=>{if(!p.value)return"";const m=c.value.find(g=>g.__cdata);if(m&&Array.isArray(m.__cdata)){const g=m.__cdata;if(g.length>0&&g[0]["#text"])return g[0]["#text"]}return""}),k=o.computed(()=>{if(d.value!=="element"||!n.value||p.value)return"";const m=t.node[n.value];if(!Array.isArray(m))return"";const g=m.find(A=>A["#text"]);return g?g["#text"]:""}),_=o.computed(()=>{if(d.value!=="comment")return"";const m=t.node["#comment"];return Array.isArray(m)&&m.length>0&&m[0]["#text"]||""}),N=o.computed(()=>c.value.some(m=>Object.keys(m).some(A=>!A.startsWith("#")&&!A.startsWith(":")))),C=o.computed(()=>N.value?c.value.filter(m=>Object.keys(m).some(A=>!A.startsWith("#")&&!A.startsWith(":"))).length:0),x=o.computed(()=>d.value==="element"&&!N.value&&k.value.trim()!==""),O=()=>{N.value&&s("toggle-expand",l.value)},R=(m,g)=>`${l.value}-child-${g}`,z=()=>`${l.value}.${n.value}`;return(m,g)=>{const A=o.resolveComponent("XmlNode",!0);return o.openBlock(),o.createElementBlock("div",{class:"xml-node",style:o.normalizeStyle({paddingLeft:m.level>0?"16px":"0"})},[d.value==="comment"?(o.openBlock(),o.createElementBlock("div",Ot,[o.createElementVNode("span",{style:o.normalizeStyle({color:m.theme.colors.xmlComment})}," <!-- "+o.toDisplayString(_.value)+" --> ",5)])):d.value==="cdata"?(o.openBlock(),o.createElementBlock("div",St,[o.createElementVNode("span",{style:o.normalizeStyle({color:m.theme.colors.xmlCdata})}," <![CDATA["+o.toDisplayString(m.node.__cdata)+"]]> ",5)])):d.value==="element"?(o.openBlock(),o.createElementBlock("div",Pt,[p.value?(o.openBlock(),o.createElementBlock("div",$t,[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4),o.createElementVNode("span",{class:"xml-node__cdata",style:o.normalizeStyle({color:m.theme.colors.xmlCdata})},"<![CDATA["+o.toDisplayString(h.value)+"]]>",5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])):x.value?(o.openBlock(),o.createElementBlock("div",Vt,[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4),o.createElementVNode("span",{class:"xml-node__text-content",style:o.normalizeStyle({color:m.theme.colors.xmlText})},o.toDisplayString(k.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])):(o.openBlock(),o.createElementBlock("div",It,[!i.value&&N.value?(o.openBlock(),o.createElementBlock("div",vt,[o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[0]||(g[0]=T=>O()),title:"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[1]||(g[1]=T=>O()),title:"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)]),o.createElementVNode("span",{class:"xml-node__collapsed-badge",style:o.normalizeStyle({backgroundColor:m.theme.colors.collapsedBackground,color:m.theme.colors.collapsedText}),onClick:g[2]||(g[2]=T=>O()),title:`Click to expand ${C.value} child element${C.value>1?"s":""}`},o.toDisplayString(C.value)+" child"+o.toDisplayString(C.value>1?"ren":""),13,Lt),o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[3]||(g[3]=T=>O()),title:"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",Rt,[N.value?(o.openBlock(),o.createElementBlock("span",{key:0,class:"xml-node__clickable-part",onClick:g[4]||(g[4]=T=>O()),title:i.value?"Click to collapse":"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5)],8,jt)):(o.openBlock(),o.createElementBlock("span",Mt,[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"<",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5)])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(T,$)=>(o.openBlock(),o.createElementBlock("span",{key:$,class:"xml-node__attribute"},[o.createElementVNode("span",{class:"xml-node__attr-name",style:o.normalizeStyle({color:m.theme.colors.xmlAttribute})},o.toDisplayString($),5),o.createElementVNode("span",{class:"xml-node__equals",style:o.normalizeStyle({color:m.theme.colors.xmlEquals})},"=",4),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4),o.createElementVNode("span",{class:"xml-node__attr-value",style:o.normalizeStyle({color:m.theme.colors.xmlAttributeValue})},o.toDisplayString(T),5),o.createElementVNode("span",{class:"xml-node__quote",style:o.normalizeStyle({color:m.theme.colors.xmlQuote})},'"',4)]))),128)),N.value?(o.openBlock(),o.createElementBlock("span",{key:2,class:"xml-node__clickable-part",onClick:g[5]||(g[5]=T=>O()),title:i.value?"Click to collapse":"Click to expand"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)],8,Ft)):(o.openBlock(),o.createElementBlock("span",{key:3,class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},o.toDisplayString(N.value?">":"/>"),5))]),i.value&&N.value?(o.openBlock(),o.createElementBlock("div",Ut,[c.value.length===0&&k.value.trim()?(o.openBlock(),o.createElementBlock("div",Xt,[o.createElementVNode("span",{class:"xml-node__text-content",style:o.normalizeStyle({color:m.theme.colors.xmlText})},o.toDisplayString(k.value),5)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(T,$)=>(o.openBlock(),o.createBlock(A,{key:R(T,$),node:T,index:$,level:m.level+1,"parent-path":z(),expanded:m.expanded,theme:m.theme,onToggleExpand:g[6]||(g[6]=j=>m.$emit("toggle-expand",j)),onCopy:g[7]||(g[7]=j=>m.$emit("copy",j))},null,8,["node","index","level","parent-path","expanded","theme"]))),128))])):o.createCommentVNode("",!0),i.value&&N.value?(o.openBlock(),o.createElementBlock("div",zt,[o.createElementVNode("span",{class:"xml-node__clickable-part",onClick:g[8]||(g[8]=T=>O()),title:"Click to collapse"},[o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},"</",4),o.createElementVNode("span",{class:"xml-node__tag",style:o.normalizeStyle({color:m.theme.colors.xmlTag})},o.toDisplayString(n.value),5),o.createElementVNode("span",{class:"xml-node__bracket",style:o.normalizeStyle({color:m.theme.colors.xmlBracket})},">",4)])])):o.createCommentVNode("",!0)],64))]))])):o.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-afb7b2ab"]]),Ee={"github-light":{name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#57606a",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#1f883d",buttonPrimaryHover:"#1a7f37",success:"#1f883d",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",xmlTag:"#116329",xmlAttribute:"#0550ae",xmlAttributeValue:"#0a3069",xmlText:"#24292f",xmlComment:"#6e7781",xmlCdata:"#8250df",xmlDeclaration:"#953800",xmlBracket:"#6e7781",xmlEquals:"#6e7781",xmlQuote:"#0550ae",collapsedBackground:"#ddf4ff",collapsedText:"#0969da"}},"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#c9d1d9",textSecondary:"#8b949e",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#c9d1d9",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2e1c",error:"#f85149",errorBackground:"#3d1319",xmlTag:"#7ee787",xmlAttribute:"#79c0ff",xmlAttributeValue:"#a5d6ff",xmlText:"#c9d1d9",xmlComment:"#8b949e",xmlCdata:"#d2a8ff",xmlDeclaration:"#ffa657",xmlBracket:"#8b949e",xmlEquals:"#8b949e",xmlQuote:"#79c0ff",collapsedBackground:"#1c2d41",collapsedText:"#58a6ff"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#171717",textSecondary:"#737373",buttonBackground:"#fafafa",buttonBackgroundHover:"#f5f5f5",buttonBorder:"#e5e5e5",buttonText:"#171717",buttonPrimary:"#22c55e",buttonPrimaryHover:"#16a34a",success:"#22c55e",successBackground:"#dcfce7",error:"#ef4444",errorBackground:"#fee2e2",xmlTag:"#16a34a",xmlAttribute:"#2563eb",xmlAttributeValue:"#1e40af",xmlText:"#171717",xmlComment:"#737373",xmlCdata:"#9333ea",xmlDeclaration:"#ea580c",xmlBracket:"#737373",xmlEquals:"#737373",xmlQuote:"#2563eb",collapsedBackground:"#dbeafe",collapsedText:"#1d4ed8"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fef5ed",surfaceBackground:"#fef9f3",border:"#e9dcc9",text:"#3d3c40",textSecondary:"#616061",buttonBackground:"#fef9f3",buttonBackgroundHover:"#f9f0e5",buttonBorder:"#e9dcc9",buttonText:"#3d3c40",buttonPrimary:"#007a5a",buttonPrimaryHover:"#006644",success:"#007a5a",successBackground:"#d1f4e0",error:"#e01e5a",errorBackground:"#ffdbea",xmlTag:"#007a5a",xmlAttribute:"#1264a3",xmlAttributeValue:"#0b4c8c",xmlText:"#3d3c40",xmlComment:"#616061",xmlCdata:"#8b2eff",xmlDeclaration:"#e8912d",xmlBracket:"#616061",xmlEquals:"#616061",xmlQuote:"#1264a3",collapsedBackground:"#d8eaf5",collapsedText:"#0b4c8c"}}},Kt=r=>Ee[r]||Ee["github-light"],_e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",qt=_e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Qt="["+_e+"]["+qt+"]*",Wt=new RegExp("^"+Qt+"$");function ke(r,e){const t=[];let s=e.exec(r);for(;s;){const n=[];n.startIndex=e.lastIndex-s[0].length;const l=s.length;for(let i=0;i<l;i++)n.push(s[i]);t.push(n),s=e.exec(r)}return t}const ie=function(r){const e=Wt.exec(r);return!(e===null||typeof e>"u")};function Yt(r){return typeof r<"u"}const Gt={allowBooleanAttributes:!1,unpairedTags:[]};function xe(r,e){e=Object.assign({},Gt,e);const t=[];let s=!1,n=!1;r[0]==="\uFEFF"&&(r=r.substr(1));for(let l=0;l<r.length;l++)if(r[l]==="<"&&r[l+1]==="?"){if(l+=2,l=Ae(r,l),l.err)return l}else if(r[l]==="<"){let i=l;if(l++,r[l]==="!"){l=Ce(r,l);continue}else{let d=!1;r[l]==="/"&&(d=!0,l++);let a="";for(;l<r.length&&r[l]!==">"&&r[l]!==" "&&r[l]!==" "&&r[l]!==`
9
- `&&r[l]!=="\r";l++)a+=r[l];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),l--),!or(a)){let h;return a.trim().length===0?h="Invalid space after '<'.":h="Tag '"+a+"' is an invalid name.",v("InvalidTag",h,M(r,l))}const c=Jt(r,l);if(c===!1)return v("InvalidAttr","Attributes for '"+a+"' have open quote.",M(r,l));let p=c.value;if(l=c.index,p[p.length-1]==="/"){const h=l-p.length;p=p.substring(0,p.length-1);const k=we(p,e);if(k===!0)s=!0;else return v(k.err.code,k.err.msg,M(r,h+k.err.line))}else if(d)if(c.tagClosed){if(p.trim().length>0)return v("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",M(r,i));if(t.length===0)return v("InvalidTag","Closing tag '"+a+"' has not been opened.",M(r,i));{const h=t.pop();if(a!==h.tagName){let k=M(r,h.tagStartPos);return v("InvalidTag","Expected closing tag '"+h.tagName+"' (opened in line "+k.line+", col "+k.col+") instead of closing tag '"+a+"'.",M(r,i))}t.length==0&&(n=!0)}}else return v("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",M(r,l));else{const h=we(p,e);if(h!==!0)return v(h.err.code,h.err.msg,M(r,l-p.length+h.err.line));if(n===!0)return v("InvalidXml","Multiple possible root nodes found.",M(r,l));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:i}),s=!0}for(l++;l<r.length;l++)if(r[l]==="<")if(r[l+1]==="!"){l++,l=Ce(r,l);continue}else if(r[l+1]==="?"){if(l=Ae(r,++l),l.err)return l}else break;else if(r[l]==="&"){const h=rr(r,l);if(h==-1)return v("InvalidChar","char '&' is not expected.",M(r,l));l=h}else if(n===!0&&!Ne(r[l]))return v("InvalidXml","Extra text at the end",M(r,l));r[l]==="<"&&l--}}else{if(Ne(r[l]))continue;return v("InvalidChar","char '"+r[l]+"' is not expected.",M(r,l))}if(s){if(t.length==1)return v("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",M(r,t[0].tagStartPos));if(t.length>0)return v("InvalidXml","Invalid '"+JSON.stringify(t.map(l=>l.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return v("InvalidXml","Start tag expected.",1);return!0}function Ne(r){return r===" "||r===" "||r===`
10
- `||r==="\r"}function Ae(r,e){const t=e;for(;e<r.length;e++)if(r[e]=="?"||r[e]==" "){const s=r.substr(t,e-t);if(e>5&&s==="xml")return v("InvalidXml","XML declaration allowed only at the start of the document.",M(r,e));if(r[e]=="?"&&r[e+1]==">"){e++;break}else continue}return e}function Ce(r,e){if(r.length>e+5&&r[e+1]==="-"&&r[e+2]==="-"){for(e+=3;e<r.length;e++)if(r[e]==="-"&&r[e+1]==="-"&&r[e+2]===">"){e+=2;break}}else if(r.length>e+8&&r[e+1]==="D"&&r[e+2]==="O"&&r[e+3]==="C"&&r[e+4]==="T"&&r[e+5]==="Y"&&r[e+6]==="P"&&r[e+7]==="E"){let t=1;for(e+=8;e<r.length;e++)if(r[e]==="<")t++;else if(r[e]===">"&&(t--,t===0))break}else if(r.length>e+9&&r[e+1]==="["&&r[e+2]==="C"&&r[e+3]==="D"&&r[e+4]==="A"&&r[e+5]==="T"&&r[e+6]==="A"&&r[e+7]==="["){for(e+=8;e<r.length;e++)if(r[e]==="]"&&r[e+1]==="]"&&r[e+2]===">"){e+=2;break}}return e}const Zt='"',Dt="'";function Jt(r,e){let t="",s="",n=!1;for(;e<r.length;e++){if(r[e]===Zt||r[e]===Dt)s===""?s=r[e]:s!==r[e]||(s="");else if(r[e]===">"&&s===""){n=!0;break}t+=r[e]}return s!==""?!1:{value:t,index:e,tagClosed:n}}const er=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function we(r,e){const t=ke(r,er),s={};for(let n=0;n<t.length;n++){if(t[n][1].length===0)return v("InvalidAttr","Attribute '"+t[n][2]+"' has no space in starting.",oe(t[n]));if(t[n][3]!==void 0&&t[n][4]===void 0)return v("InvalidAttr","Attribute '"+t[n][2]+"' is without value.",oe(t[n]));if(t[n][3]===void 0&&!e.allowBooleanAttributes)return v("InvalidAttr","boolean attribute '"+t[n][2]+"' is not allowed.",oe(t[n]));const l=t[n][2];if(!nr(l))return v("InvalidAttr","Attribute '"+l+"' is an invalid name.",oe(t[n]));if(!s.hasOwnProperty(l))s[l]=1;else return v("InvalidAttr","Attribute '"+l+"' is repeated.",oe(t[n]))}return!0}function tr(r,e){let t=/\d/;for(r[e]==="x"&&(e++,t=/[\da-fA-F]/);e<r.length;e++){if(r[e]===";")return e;if(!r[e].match(t))break}return-1}function rr(r,e){if(e++,r[e]===";")return-1;if(r[e]==="#")return e++,tr(r,e);let t=0;for(;e<r.length;e++,t++)if(!(r[e].match(/\w/)&&t<20)){if(r[e]===";")break;return-1}return e}function v(r,e,t){return{err:{code:r,msg:e,line:t.line||t,col:t.col}}}function nr(r){return ie(r)}function or(r){return ie(r)}function M(r,e){const t=r.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function oe(r){return r.startIndex+r[1].length}const sr={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,e){return e},attributeValueProcessor:function(r,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,e,t){return r},captureMetaData:!1},lr=function(r){return Object.assign({},sr,r)};let ae;typeof Symbol!="function"?ae="@@xmlMetadata":ae=Symbol("XML Node Metadata");class Z{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][ae]={startIndex:t})}static getMetaDataSymbol(){return ae}}class ir{constructor(e){this.suppressValidationErr=!e}readDocType(e,t){const s={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let n=1,l=!1,i=!1,d="";for(;t<e.length;t++)if(e[t]==="<"&&!i){if(l&&D(e,"!ENTITY",t)){t+=7;let a,c;[a,c,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),c.indexOf("&")===-1&&(s[a]={regx:RegExp(`&${a};`,"g"),val:c})}else if(l&&D(e,"!ELEMENT",t)){t+=8;const{index:a}=this.readElementExp(e,t+1);t=a}else if(l&&D(e,"!ATTLIST",t))t+=8;else if(l&&D(e,"!NOTATION",t)){t+=9;const{index:a}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=a}else if(D(e,"!--",t))i=!0;else throw new Error("Invalid DOCTYPE");n++,d=""}else if(e[t]===">"){if(i?e[t-1]==="-"&&e[t-2]==="-"&&(i=!1,n--):n--,n===0)break}else e[t]==="["?l=!0:d+=e[t];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:t}}readEntityExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)s+=e[t],t++;if(se(s),t=U(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let n="";return[t,n]=this.readIdentifierVal(e,t,"entity"),t--,[s,n,t]}readNotationExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;!this.suppressValidationErr&&se(s),t=U(e,t);const n=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&n!=="SYSTEM"&&n!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);t+=n.length,t=U(e,t);let l=null,i=null;if(n==="PUBLIC")[t,l]=this.readIdentifierVal(e,t,"publicIdentifier"),t=U(e,t),(e[t]==='"'||e[t]==="'")&&([t,i]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(n==="SYSTEM"&&([t,i]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:l,systemIdentifier:i,index:--t}}readIdentifierVal(e,t,s){let n="";const l=e[t];if(l!=='"'&&l!=="'")throw new Error(`Expected quoted string, found "${l}"`);for(t++;t<e.length&&e[t]!==l;)n+=e[t],t++;if(e[t]!==l)throw new Error(`Unterminated ${s} value`);return t++,[t,n]}readElementExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;if(!this.suppressValidationErr&&!ie(s))throw new Error(`Invalid element name: "${s}"`);t=U(e,t);let n="";if(e[t]==="E"&&D(e,"MPTY",t))t+=4;else if(e[t]==="A"&&D(e,"NY",t))t+=2;else if(e[t]==="("){for(t++;t<e.length&&e[t]!==")";)n+=e[t],t++;if(e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:s,contentModel:n.trim(),index:t}}readAttlistExp(e,t){t=U(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;se(s),t=U(e,t);let n="";for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!se(n))throw new Error(`Invalid attribute name: "${n}"`);t=U(e,t);let l="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(l="NOTATION",t+=8,t=U(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let d=[];for(;t<e.length&&e[t]!==")";){let a="";for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)a+=e[t],t++;if(a=a.trim(),!se(a))throw new Error(`Invalid notation name: "${a}"`);d.push(a),e[t]==="|"&&(t++,t=U(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,l+=" ("+d.join("|")+")"}else{for(;t<e.length&&!/\s/.test(e[t]);)l+=e[t],t++;const d=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!d.includes(l.toUpperCase()))throw new Error(`Invalid attribute type: "${l}"`)}t=U(e,t);let i="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",t+=7):[t,i]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:s,attributeName:n,attributeType:l,defaultValue:i,index:t}}}const U=(r,e)=>{for(;e<r.length&&/\s/.test(r[e]);)e++;return e};function D(r,e,t){for(let s=0;s<e.length;s++)if(e[s]!==r[t+s+1])return!1;return!0}function se(r){if(ie(r))return r;throw new Error(`Invalid entity name ${r}`)}const ar=/^[-+]?0x[a-fA-F0-9]+$/,cr=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,dr={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function ur(r,e={}){if(e=Object.assign({},dr,e),!r||typeof r!="string")return r;let t=r.trim();if(e.skipLike!==void 0&&e.skipLike.test(t))return r;if(r==="0")return 0;if(e.hex&&ar.test(t))return mr(t,16);if(t.search(/.+[eE].+/)!==-1)return hr(r,t,e);{const s=cr.exec(t);if(s){const n=s[1]||"",l=s[2];let i=pr(s[3]);const d=n?r[l.length+1]===".":r[l.length]===".";if(!e.leadingZeros&&(l.length>1||l.length===1&&!d))return r;{const a=Number(t),c=String(a);if(a===0)return a;if(c.search(/[eE]/)!==-1)return e.eNotation?a:r;if(t.indexOf(".")!==-1)return c==="0"||c===i||c===`${n}${i}`?a:r;let p=l?i:t;return l?p===c||n+p===c?a:r:p===c||p===n+c?a:r}}else return r}}const fr=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function hr(r,e,t){if(!t.eNotation)return r;const s=e.match(fr);if(s){let n=s[1]||"";const l=s[3].indexOf("e")===-1?"E":"e",i=s[2],d=n?r[i.length+1]===l:r[i.length]===l;return i.length>1&&d?r:i.length===1&&(s[3].startsWith(`.${l}`)||s[3][0]===l)?Number(e):t.leadingZeros&&!d?(e=(s[1]||"")+s[3],Number(e)):r}else return r}function pr(r){return r&&r.indexOf(".")!==-1&&(r=r.replace(/0+$/,""),r==="."?r="0":r[0]==="."?r="0"+r:r[r.length-1]==="."&&(r=r.substring(0,r.length-1))),r}function mr(r,e){if(parseInt)return parseInt(r,e);if(Number.parseInt)return Number.parseInt(r,e);if(window&&window.parseInt)return window.parseInt(r,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Be(r){return typeof r=="function"?r:Array.isArray(r)?e=>{for(const t of r)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class gr{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=yr,this.parseXml=xr,this.parseTextData=br,this.resolveNameSpace=Er,this.buildAttributesMap=kr,this.isItStopNode=wr,this.replaceEntitiesValue=Ar,this.readStopNodeData=Tr,this.saveTextToParentTag=Cr,this.addChild=Nr,this.ignoreAttributesFn=Be(this.options.ignoreAttributes)}}function yr(r){const e=Object.keys(r);for(let t=0;t<e.length;t++){const s=e[t];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:r[s]}}}function br(r,e,t,s,n,l,i){if(r!==void 0&&(this.options.trimValues&&!s&&(r=r.trim()),r.length>0)){i||(r=this.replaceEntitiesValue(r));const d=this.options.tagValueProcessor(e,r,t,n,l);return d==null?r:typeof d!=typeof r||d!==r?d:this.options.trimValues?he(r,this.options.parseTagValue,this.options.numberParseOptions):r.trim()===r?he(r,this.options.parseTagValue,this.options.numberParseOptions):r}}function Er(r){if(this.options.removeNSPrefix){const e=r.split(":"),t=r.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(r=t+e[1])}return r}const _r=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function kr(r,e,t){if(this.options.ignoreAttributes!==!0&&typeof r=="string"){const s=ke(r,_r),n=s.length,l={};for(let i=0;i<n;i++){const d=this.resolveNameSpace(s[i][1]);if(this.ignoreAttributesFn(d,e))continue;let a=s[i][4],c=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);const p=this.options.attributeValueProcessor(d,a,e);p==null?l[c]=a:typeof p!=typeof a||p!==a?l[c]=p:l[c]=he(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(l[c]=!0)}if(!Object.keys(l).length)return;if(this.options.attributesGroupName){const i={};return i[this.options.attributesGroupName]=l,i}return l}}const xr=function(r){r=r.replace(/\r\n?/g,`
11
- `);const e=new Z("!xml");let t=e,s="",n="";const l=new ir(this.options.processEntities);for(let i=0;i<r.length;i++)if(r[i]==="<")if(r[i+1]==="/"){const a=J(r,">",i,"Closing Tag is not closed.");let c=r.substring(i+2,a).trim();if(this.options.removeNSPrefix){const k=c.indexOf(":");k!==-1&&(c=c.substr(k+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&(s=this.saveTextToParentTag(s,t,n));const p=n.substring(n.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let h=0;p&&this.options.unpairedTags.indexOf(p)!==-1?(h=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=n.lastIndexOf("."),n=n.substring(0,h),t=this.tagsNodeStack.pop(),s="",i=a}else if(r[i+1]==="?"){let a=fe(r,i,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,n),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const c=new Z(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,n,a.tagName)),this.addChild(t,c,n,i)}i=a.closeIndex+1}else if(r.substr(i+1,3)==="!--"){const a=J(r,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const c=r.substring(i+4,a-2);s=this.saveTextToParentTag(s,t,n),t.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}i=a}else if(r.substr(i+1,2)==="!D"){const a=l.readDocType(r,i);this.docTypeEntities=a.entities,i=a.i}else if(r.substr(i+1,2)==="!["){const a=J(r,"]]>",i,"CDATA is not closed.")-2,c=r.substring(i+9,a);s=this.saveTextToParentTag(s,t,n);let p=this.parseTextData(c,t.tagname,n,!0,!1,!0,!0);p==null&&(p=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):t.add(this.options.textNodeName,p),i=a+2}else{let a=fe(r,i,this.options.removeNSPrefix),c=a.tagName;const p=a.rawTagName;let h=a.tagExp,k=a.attrExpPresent,_=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,n,!1));const N=t;N&&this.options.unpairedTags.indexOf(N.tagname)!==-1&&(t=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),c!==e.tagname&&(n+=n?"."+c:c);const C=i;if(this.isItStopNode(this.options.stopNodes,n,c)){let x="";if(h.length>0&&h.lastIndexOf("/")===h.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),n=n.substr(0,n.length-1),h=c):h=h.substr(0,h.length-1),i=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)i=a.closeIndex;else{const R=this.readStopNodeData(r,p,_+1);if(!R)throw new Error(`Unexpected end of ${p}`);i=R.i,x=R.tagContent}const O=new Z(c);c!==h&&k&&(O[":@"]=this.buildAttributesMap(h,n,c)),x&&(x=this.parseTextData(x,c,n,!0,k,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),O.add(this.options.textNodeName,x),this.addChild(t,O,n,C)}else{if(h.length>0&&h.lastIndexOf("/")===h.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),n=n.substr(0,n.length-1),h=c):h=h.substr(0,h.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const x=new Z(c);c!==h&&k&&(x[":@"]=this.buildAttributesMap(h,n,c)),this.addChild(t,x,n,C),n=n.substr(0,n.lastIndexOf("."))}else{const x=new Z(c);this.tagsNodeStack.push(t),c!==h&&k&&(x[":@"]=this.buildAttributesMap(h,n,c)),this.addChild(t,x,n,C),t=x}s="",i=_}}else s+=r[i];return e.child};function Nr(r,e,t,s){this.options.captureMetaData||(s=void 0);const n=this.options.updateTag(e.tagname,t,e[":@"]);n===!1||(typeof n=="string"&&(e.tagname=n),r.addChild(e,s))}const Ar=function(r){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];r=r.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];r=r.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];r=r.replace(t.regex,t.val)}r=r.replace(this.ampEntity.regex,this.ampEntity.val)}return r};function Cr(r,e,t,s){return r&&(s===void 0&&(s=e.child.length===0),r=this.parseTextData(r,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),r!==void 0&&r!==""&&e.add(this.options.textNodeName,r),r=""),r}function wr(r,e,t){const s="*."+t;for(const n in r){const l=r[n];if(s===l||e===l)return!0}return!1}function Br(r,e,t=">"){let s,n="";for(let l=e;l<r.length;l++){let i=r[l];if(s)i===s&&(s="");else if(i==='"'||i==="'")s=i;else if(i===t[0])if(t[1]){if(r[l+1]===t[1])return{data:n,index:l}}else return{data:n,index:l};else i===" "&&(i=" ");n+=i}}function J(r,e,t,s){const n=r.indexOf(e,t);if(n===-1)throw new Error(s);return n+e.length-1}function fe(r,e,t,s=">"){const n=Br(r,e+1,s);if(!n)return;let l=n.data;const i=n.index,d=l.search(/\s/);let a=l,c=!0;d!==-1&&(a=l.substring(0,d),l=l.substring(d+1).trimStart());const p=a;if(t){const h=a.indexOf(":");h!==-1&&(a=a.substr(h+1),c=a!==n.data.substr(h+1))}return{tagName:a,tagExp:l,closeIndex:i,attrExpPresent:c,rawTagName:p}}function Tr(r,e,t){const s=t;let n=1;for(;t<r.length;t++)if(r[t]==="<")if(r[t+1]==="/"){const l=J(r,">",t,`${e} is not closed`);if(r.substring(t+2,l).trim()===e&&(n--,n===0))return{tagContent:r.substring(s,t),i:l};t=l}else if(r[t+1]==="?")t=J(r,"?>",t+1,"StopNode is not closed.");else if(r.substr(t+1,3)==="!--")t=J(r,"-->",t+3,"StopNode is not closed.");else if(r.substr(t+1,2)==="![")t=J(r,"]]>",t,"StopNode is not closed.")-2;else{const l=fe(r,t,">");l&&((l&&l.tagName)===e&&l.tagExp[l.tagExp.length-1]!=="/"&&n++,t=l.closeIndex)}}function he(r,e,t){if(e&&typeof r=="string"){const s=r.trim();return s==="true"?!0:s==="false"?!1:ur(r,t)}else return Yt(r)?r:""}const pe=Z.getMetaDataSymbol();function Or(r,e){return Te(r,e)}function Te(r,e,t){let s;const n={};for(let l=0;l<r.length;l++){const i=r[l],d=Sr(i);let a="";if(t===void 0?a=d:a=t+"."+d,d===e.textNodeName)s===void 0?s=i[d]:s+=""+i[d];else{if(d===void 0)continue;if(i[d]){let c=Te(i[d],e,a);const p=$r(c,e);i[pe]!==void 0&&(c[pe]=i[pe]),i[":@"]?Pr(c,i[":@"],a,e):Object.keys(c).length===1&&c[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?c=c[e.textNodeName]:Object.keys(c).length===0&&(e.alwaysCreateTextNode?c[e.textNodeName]="":c=""),n[d]!==void 0&&n.hasOwnProperty(d)?(Array.isArray(n[d])||(n[d]=[n[d]]),n[d].push(c)):e.isArray(d,a,p)?n[d]=[c]:n[d]=c}}}return typeof s=="string"?s.length>0&&(n[e.textNodeName]=s):s!==void 0&&(n[e.textNodeName]=s),n}function Sr(r){const e=Object.keys(r);for(let t=0;t<e.length;t++){const s=e[t];if(s!==":@")return s}}function Pr(r,e,t,s){if(e){const n=Object.keys(e),l=n.length;for(let i=0;i<l;i++){const d=n[i];s.isArray(d,t+"."+d,!0,!0)?r[d]=[e[d]]:r[d]=e[d]}}}function $r(r,e){const{textNodeName:t}=e,s=Object.keys(r).length;return!!(s===0||s===1&&(r[t]||typeof r[t]=="boolean"||r[t]===0))}class Vr{constructor(e){this.externalEntities={},this.options=lr(e)}parse(e,t){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const l=xe(e,t);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const s=new gr(this.options);s.addExternalEntities(this.externalEntities);const n=s.parseXml(e);return this.options.preserveOrder||n===void 0?n:Or(n,this.options)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return Z.getMetaDataSymbol()}}const Ir=`
12
- `;function vr(r,e){let t="";return e.format&&e.indentBy.length>0&&(t=Ir),Oe(r,e,"",t)}function Oe(r,e,t,s){let n="",l=!1;for(let i=0;i<r.length;i++){const d=r[i],a=Lr(d);if(a===void 0)continue;let c="";if(t.length===0?c=a:c=`${t}.${a}`,a===e.textNodeName){let N=d[a];Rr(c,e)||(N=e.tagValueProcessor(a,N),N=Pe(N,e)),l&&(n+=s),n+=N,l=!1;continue}else if(a===e.cdataPropName){l&&(n+=s),n+=`<![CDATA[${d[a][0][e.textNodeName]}]]>`,l=!1;continue}else if(a===e.commentPropName){n+=s+`<!--${d[a][0][e.textNodeName]}-->`,l=!0;continue}else if(a[0]==="?"){const N=Se(d[":@"],e),C=a==="?xml"?"":s;let x=d[a][0][e.textNodeName];x=x.length!==0?" "+x:"",n+=C+`<${a}${x}${N}?>`,l=!0;continue}let p=s;p!==""&&(p+=e.indentBy);const h=Se(d[":@"],e),k=s+`<${a}${h}`,_=Oe(d[a],e,c,p);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?n+=k+">":n+=k+"/>":(!_||_.length===0)&&e.suppressEmptyNode?n+=k+"/>":_&&_.endsWith(">")?n+=k+`>${_}${s}</${a}>`:(n+=k+">",_&&s!==""&&(_.includes("/>")||_.includes("</"))?n+=s+e.indentBy+_+s:n+=_,n+=`</${a}>`),l=!0}return n}function Lr(r){const e=Object.keys(r);for(let t=0;t<e.length;t++){const s=e[t];if(r.hasOwnProperty(s)&&s!==":@")return s}}function Se(r,e){let t="";if(r&&!e.ignoreAttributes)for(let s in r){if(!r.hasOwnProperty(s))continue;let n=e.attributeValueProcessor(s,r[s]);n=Pe(n,e),n===!0&&e.suppressBooleanAttributes?t+=` ${s.substr(e.attributeNamePrefix.length)}`:t+=` ${s.substr(e.attributeNamePrefix.length)}="${n}"`}return t}function Rr(r,e){r=r.substr(0,r.length-e.textNodeName.length-1);let t=r.substr(r.lastIndexOf(".")+1);for(let s in e.stopNodes)if(e.stopNodes[s]===r||e.stopNodes[s]==="*."+t)return!0;return!1}function Pe(r,e){if(r&&r.length>0&&e.processEntities)for(let t=0;t<e.entities.length;t++){const s=e.entities[t];r=r.replace(s.regex,s.val)}return r}const jr={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(r,e){return e},attributeValueProcessor:function(r,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function G(r){this.options=Object.assign({},jr,r),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Be(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Ur),this.processTextOrObjNode=Mr,this.options.format?(this.indentate=Fr,this.tagEndChar=`>
8
+ `)(l.value),i.value=m;else throw new Error(`Unsupported filter type: ${g.type}`);c.value="",r.nextTick(()=>{z()})}catch(m){c.value=m instanceof Error?m.message:"Filter execution error",i.value=null}},$=()=>{i.value=null,c.value=""};r.watch(()=>s.modelValue,g=>{E(g)},{immediate:!0});const w=(g,m,u)=>{const y=v=>{if(v===null||typeof v!="object")return v;if(!Array.isArray(v)&&"__protected_number__"in v&&Object.keys(v).length===1)return`__PROTECTED_NUMBER_${v.__protected_number__}_PROTECTED_NUMBER__`;if(Array.isArray(v))return v.map(I=>y(I));const S={};for(const[I,U]of Object.entries(v))S[I]=y(U);return S},B=y(g);return JSON.stringify(B,m,u).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g,"$1")},L=(g,m)=>{if(!s.readonly)try{const u=F(l.value,g,m),y=w(u,null,2);o("update:modelValue",y)}catch(u){console.error("Failed to update JSON:",u)}},F=(g,m,u)=>{if(!m||m==="root")return u;const y=m.split("."),B=C(g,y.slice(0,-1));let x=B;for(let S=0;S<y.length-1;S++){const I=y[S];I!=="root"&&(Array.isArray(x)?x=x[parseInt(I)]:x=x[I])}const v=y[y.length-1];return v==="root"?u:(Array.isArray(x)?x[parseInt(v)]=u:x[v]=u,B)},M=g=>{d.value.has(g)?d.value.delete(g):d.value.add(g)},z=()=>{const g=new Set,m=(u,y="")=>{u!==null&&typeof u=="object"&&(g.add(y||"root"),Array.isArray(u)?u.forEach((B,x)=>{const v=y?`${y}.${x}`:`${x}`;m(B,v)}):Object.keys(u).forEach(B=>{const x=y?`${y}.${B}`:B;m(u[B],x)}))};m(k.value),d.value=g,o("expand-all")},ee=()=>{d.value=new Set(["root"]),o("collapse-all")},G=async()=>{if(b.value)try{const g=k.value,m=w(g,null,2);await navigator.clipboard.writeText(m),o("copy-success",m)}catch(g){console.error("Failed to copy JSON:",g),o("copy-error",g instanceof Error?g:new Error("Failed to copy JSON"))}},Z=()=>{if(b.value)try{const g=k.value,m=w(g);o("update:modelValue",m),o("compress",m)}catch(g){console.error("Failed to compress JSON:",g)}},J=async g=>{try{let m;typeof g=="object"&&g!==null&&!Array.isArray(g)&&"__protected_number__"in g&&Object.keys(g).length===1?m=g.__protected_number__:typeof g=="string"?m=`"${g}"`:m=JSON.stringify(g),await navigator.clipboard.writeText(m)}catch(m){console.error("Failed to copy value:",m)}},te=(g,m)=>{if(!s.readonly)try{const u=_(l.value,g,m),y=w(u,null,2);o("update:modelValue",y),T(g,m)}catch(u){console.error("Failed to rename key:",u)}},_=(g,m,u)=>{if(!m||m==="root")return g;const y=m.split("."),B=C(g,y.slice(0,-1));if(y.length===1){const S=y[0];return B&&typeof B=="object"&&!Array.isArray(B)?V(B,S,u):B}let x=B;for(let S=0;S<y.length-1;S++){const I=y[S];Array.isArray(x)?x=x[parseInt(I)]:x=x[I]}const v=y[y.length-1];if(!Array.isArray(x)&&x&&typeof x=="object"){const S=V(x,v,u),I=y.slice(0,-1);I.length>0&&A(B,I,S)}return B},C=(g,m)=>{if(m.length===0)return g;if(Array.isArray(g)){const u=[...g],y=m[0],B=parseInt(y);return m.length===1||(u[B]=C(g[B],m.slice(1))),u}else if(g&&typeof g=="object"){const u={...g},y=m[0];return m.length===1||(u[y]=C(g[y],m.slice(1))),u}return g},V=(g,m,u)=>{if(!g||typeof g!="object"||Array.isArray(g))return g;const y=Object.keys(g),B={};for(const x of y)x===m?B[u]=g[x]:B[x]=g[x];return B},A=(g,m,u)=>{let y=g;for(let x=0;x<m.length-1;x++){const v=m[x];Array.isArray(y)?y=y[parseInt(v)]:y=y[v]}const B=m[m.length-1];Array.isArray(y)?y[parseInt(B)]=u:y[B]=u},T=(g,m)=>{const u=new Set;d.value.forEach(y=>{if(y===g){const B=g.split(".");B[B.length-1]=m,u.add(B.join("."))}else if(y.startsWith(g+".")){const B=g.split(".");B[B.length-1]=m;const x=B.join("."),v=y.substring(g.length);u.add(x+v)}else u.add(y)}),d.value=u};return e({copyJson:G,compressSource:Z,expandAll:z,collapseAll:ee,toggleExpand:M,updateValue:L,updateKey:te,filter:O,clearFilter:$,isValidJson:()=>b.value,getParsedJson:()=>l.value,getFilteredJson:()=>i.value,getExpandedNodes:()=>d.value,getParseError:()=>a.value,getFilterError:()=>c.value,parseJson:g=>E(g),copyValue:g=>J(g)}),(g,m)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["json-format",`json-format--${p.value.name}`])},[g.showToolbar?(r.openBlock(),r.createElementBlock("div",vt,[r.createElementVNode("div",St,[r.createElementVNode("button",{class:"json-format__btn json-format__btn--primary",onClick:G,disabled:!b.value,title:"Copy JSON"}," 📋 Copy ",8,Ot),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:z,disabled:!b.value,title:"Expand All"}," ⬇️ Expand All ",8,$t),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:ee,disabled:!b.value,title:"Collapse All"}," ➡️ Collapse All ",8,Pt),r.createElementVNode("button",{class:"json-format__btn json-format__btn--secondary",onClick:Z,disabled:!b.value,title:"Compress JSON"}," 📦 Compress ",8,Vt)]),r.createElementVNode("div",It,[b.value?(r.openBlock(),r.createElementBlock("span",Rt," ✅ Valid JSON ")):(r.openBlock(),r.createElementBlock("span",Lt," ❌ Invalid JSON "))])])):r.createCommentVNode("",!0),r.createElementVNode("div",Mt,[b.value?c.value?(r.openBlock(),r.createElementBlock("div",jt,[m[1]||(m[1]=r.createElementVNode("h4",null,"Filter Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(c.value),1)])):(r.openBlock(),r.createElementBlock("div",Ut,[r.createVNode(Ct,{value:k.value,"key-name":"",level:0,expanded:d.value,"is-last":!0,theme:p.value,"onUpdate:value":L,onToggleExpand:M,onCopy:J,"onUpdate:key":te},null,8,["value","expanded","theme"])])):(r.openBlock(),r.createElementBlock("div",Kt,[m[0]||(m[0]=r.createElementVNode("h4",null,"JSON Parse Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(a.value),1)]))])],2))}}),[["__scopeId","data-v-b956002c"]]),Ft={key:0,class:"xml-node__comment"},zt={key:1,class:"xml-node__cdata"},Xt={key:2,class:"xml-node__element"},Ht={key:0,class:"xml-node__line"},qt=["contenteditable","onKeydown"],Wt=["contenteditable","onDblclick","onKeydown"],Qt=["contenteditable","onDblclick","onKeydown"],Yt=["contenteditable","onKeydown"],Dt={key:1,class:"xml-node__line"},Gt=["contenteditable","onKeydown"],Zt=["contenteditable","onDblclick","onKeydown"],Jt=["contenteditable","onDblclick","onKeydown"],en=["contenteditable","onKeydown"],tn={key:2},nn={key:0,class:"xml-node__line"},rn=["contenteditable","onKeydown"],on=["contenteditable","onDblclick","onKeydown"],sn=["contenteditable","onDblclick","onKeydown"],ln=["title"],an={class:"xml-node__line"},cn=["title"],dn=["contenteditable","onKeydown"],un={key:1},fn=["contenteditable","onKeydown"],hn=["contenteditable","onDblclick","onKeydown"],pn=["contenteditable","onDblclick","onKeydown"],mn=["title"],gn={key:0,class:"xml-node__children"},yn={key:0,class:"xml-node__text"},bn=["contenteditable","onKeydown"],En={key:1,class:"xml-node__line"},_n=ge(r.defineComponent({__name:"XmlNode",props:{node:{},index:{},level:{default:0},parentPath:{default:""},expanded:{},theme:{}},emits:["toggle-expand","copy","update:tagName","update:attributeName","update:attributeValue","update:textContent","update:cdataContent"],setup(n,{emit:e}){r.useCssVars(h=>({"623698b5":h.theme.colors.indentLine}));const t=n,s=e,o=r.ref(!1),l=r.ref(null),a=r.ref(null),d=r.ref(!1),i=r.ref(!1),c=r.ref(""),b=r.ref(""),p=r.ref(""),k=r.ref(""),E=r.ref(""),O=r.ref(null),$=r.ref(null),w=r.ref(null),L=r.ref(null),F=r.ref(null),M=r.computed(()=>Object.keys(t.node).find(N=>!N.startsWith(":")&&!N.startsWith("#"))||""),z=r.computed(()=>M.value?t.parentPath?`${t.parentPath}.${M.value}[${t.index}]`:`${M.value}[${t.index}]`:""),ee=r.computed(()=>t.expanded.has(z.value)),G=r.computed(()=>t.node["#comment"]?"comment":t.node.__cdata?"cdata":M.value?"element":"unknown"),Z=r.computed(()=>{const h=t.node[":@"]||{},N={};return Object.keys(h).forEach(H=>{H.startsWith("@_")&&(N[H.substring(2)]=h[H])}),N}),J=r.computed(()=>{if(G.value!=="element"||!M.value)return[];const h=t.node[M.value];return Array.isArray(h)?h:[]}),te=r.computed(()=>J.value.some(h=>h.__cdata)),_=r.computed(()=>{if(!te.value)return"";const h=J.value.find(N=>N.__cdata);if(h&&Array.isArray(h.__cdata)){const N=h.__cdata;if(N.length>0&&N[0]["#text"])return N[0]["#text"]}return""}),C=r.computed(()=>{if(G.value!=="element"||!M.value||te.value)return"";const h=t.node[M.value];if(!Array.isArray(h))return"";const N=h.find(H=>H["#text"]);return N?N["#text"]:""}),V=r.computed(()=>{if(G.value!=="comment")return"";const h=t.node["#comment"];return Array.isArray(h)&&h.length>0&&h[0]["#text"]||""}),A=r.computed(()=>J.value.some(h=>Object.keys(h).some(H=>!H.startsWith("#")&&!H.startsWith(":")))),T=r.computed(()=>A.value?J.value.filter(h=>Object.keys(h).some(H=>!H.startsWith("#")&&!H.startsWith(":"))).length:0),g=r.computed(()=>G.value==="element"&&!A.value&&C.value.trim()!==""),m=()=>{A.value&&s("toggle-expand",z.value)},u=(h,N)=>`${z.value}-child-${N}`,y=()=>`${z.value}.${M.value}`,B=()=>{o.value=!0,c.value=M.value,r.nextTick(()=>{if(O.value){O.value.focus();const h=document.createRange();h.selectNodeContents(O.value);const N=window.getSelection();N?.removeAllRanges(),N?.addRange(h)}})},x=h=>{l.value=h,b.value=h,r.nextTick(()=>{if($.value){$.value.focus();const N=document.createRange();N.selectNodeContents($.value);const H=window.getSelection();H?.removeAllRanges(),H?.addRange(N)}})},v=h=>{a.value=h,p.value=Z.value[h]||"",r.nextTick(()=>{if(w.value){w.value.focus();const N=document.createRange();N.selectNodeContents(w.value);const H=window.getSelection();H?.removeAllRanges(),H?.addRange(N)}})},S=()=>{d.value=!0,k.value=C.value,r.nextTick(()=>{if(L.value){L.value.focus();const h=document.createRange();h.selectNodeContents(L.value);const N=window.getSelection();N?.removeAllRanges(),N?.addRange(h)}})},I=()=>{if(!o.value)return;const h=O.value?.innerText.trim()||"";if(!h||h===M.value){o.value=!1;return}o.value=!1,s("update:tagName",z.value,M.value,h)},U=()=>{if(!l.value)return;const h=l.value,N=$.value?.innerText.trim()||"";if(!N||N===h){l.value=null;return}l.value=null,s("update:attributeName",z.value,h,N)},Y=()=>{if(!a.value)return;const h=a.value,N=w.value?.innerText.trim()||"";a.value=null,s("update:attributeValue",z.value,h,N)},ue=()=>{if(!d.value)return;const h=L.value?.innerText||"";if(h===C.value){d.value=!1;return}d.value=!1,s("update:textContent",z.value,h)},q=()=>{o.value=!1,c.value=M.value},Ee=()=>{l.value&&(b.value=l.value,l.value=null)},_e=()=>{a.value&&(p.value=Z.value[a.value]||"",a.value=null)},He=()=>{d.value=!1,k.value=C.value},jr=()=>{i.value=!0,E.value=_.value,r.nextTick(()=>{if(F.value){F.value.focus();const h=document.createRange();h.selectNodeContents(F.value);const N=window.getSelection();N?.removeAllRanges(),N?.addRange(h)}})},qe=()=>{if(!i.value)return;const h=F.value?.innerText||"";if(h===_.value){i.value=!1;return}i.value=!1,s("update:cdataContent",z.value,h)},Ur=()=>{i.value=!1,E.value=_.value},xe=h=>{A.value&&(h.preventDefault(),B())};return(h,N)=>{const H=r.resolveComponent("XmlNode",!0);return r.openBlock(),r.createElementBlock("div",{class:"xml-node",style:r.normalizeStyle({paddingLeft:h.level>0?"16px":"0"})},[G.value==="comment"?(r.openBlock(),r.createElementBlock("div",Ft,[r.createElementVNode("span",{style:r.normalizeStyle({color:h.theme.colors.xmlComment})}," <!-- "+r.toDisplayString(V.value)+" --> ",5)])):G.value==="cdata"?(r.openBlock(),r.createElementBlock("div",zt,[r.createElementVNode("span",{style:r.normalizeStyle({color:h.theme.colors.xmlCdata})}," <![CDATA["+r.toDisplayString(h.node.__cdata)+"]]> ",5)])):G.value==="element"?(r.openBlock(),r.createElementBlock("div",Xt,[te.value?(r.openBlock(),r.createElementBlock("div",Ht,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:B,onContextmenu:xe,onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(q,["escape"])],onBlur:I,ref_key:"tagNameRef",ref:O,title:"Double-click to edit tag name"},r.toDisplayString(o.value?c.value:M.value),45,qt),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Z.value,(W,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:R=>x(P),onKeydown:[r.withKeys(r.withModifiers(U,["prevent"]),["enter"]),r.withKeys(Ee,["escape"])],onBlur:U,ref_for:!0,ref:R=>{l.value===P&&($.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?b.value:P),45,Wt),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:R=>v(P),onKeydown:[r.withKeys(r.withModifiers(Y,["prevent"]),["enter"]),r.withKeys(_e,["escape"])],onBlur:Y,ref_for:!0,ref:R=>{a.value===P&&(w.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:W),45,Qt),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4),r.createElementVNode("span",{class:"xml-node__cdata",style:r.normalizeStyle({color:h.theme.colors.xmlCdata})},"<![CDATA[",4),r.createElementVNode("span",{class:"xml-node__cdata-content xml-node__cdata-content--editable",style:r.normalizeStyle({color:h.theme.colors.xmlCdata}),contenteditable:i.value,onDblclick:jr,onKeydown:[r.withKeys(r.withModifiers(qe,["prevent"]),["enter"]),r.withKeys(Ur,["escape"])],onBlur:qe,ref_key:"cdataContentRef",ref:F,title:"Double-click to edit CDATA content"},r.toDisplayString(i.value?E.value:_.value),45,Yt),r.createElementVNode("span",{class:"xml-node__cdata",style:r.normalizeStyle({color:h.theme.colors.xmlCdata})},"]]>",4),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:M.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])):g.value?(r.openBlock(),r.createElementBlock("div",Dt,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:B,onContextmenu:xe,onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(q,["escape"])],onBlur:I,ref_key:"tagNameRef",ref:O,title:"Double-click to edit tag name"},r.toDisplayString(o.value?c.value:M.value),45,Gt),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Z.value,(W,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:R=>x(P),onKeydown:[r.withKeys(r.withModifiers(U,["prevent"]),["enter"]),r.withKeys(Ee,["escape"])],onBlur:U,ref_for:!0,ref:R=>{l.value===P&&($.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?b.value:P),45,Zt),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:R=>v(P),onKeydown:[r.withKeys(r.withModifiers(Y,["prevent"]),["enter"]),r.withKeys(_e,["escape"])],onBlur:Y,ref_for:!0,ref:R=>{a.value===P&&(w.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:W),45,Jt),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4),r.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:r.normalizeStyle({color:h.theme.colors.xmlText}),contenteditable:d.value,onDblclick:S,onKeydown:[r.withKeys(r.withModifiers(ue,["prevent"]),["enter"]),r.withKeys(He,["escape"])],onBlur:ue,ref_key:"textContentRef",ref:L,title:"Double-click to edit text content"},r.toDisplayString(d.value?k.value:C.value),45,en),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:M.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])):(r.openBlock(),r.createElementBlock("div",tn,[!ee.value&&A.value?(r.openBlock(),r.createElementBlock("div",nn,[r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:N[0]||(N[0]=W=>m()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:r.withModifiers(B,["stop"]),onContextmenu:xe,onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(q,["escape"])],onBlur:I,ref_key:"tagNameRef",ref:O,title:"Double-click or right-click to edit tag name"},r.toDisplayString(o.value?c.value:M.value),45,rn)]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Z.value,(W,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:R=>x(P),onKeydown:[r.withKeys(r.withModifiers(U,["prevent"]),["enter"]),r.withKeys(Ee,["escape"])],onBlur:U,ref_for:!0,ref:R=>{l.value===P&&($.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?b.value:P),45,on),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:R=>v(P),onKeydown:[r.withKeys(r.withModifiers(Y,["prevent"]),["enter"]),r.withKeys(_e,["escape"])],onBlur:Y,ref_for:!0,ref:R=>{a.value===P&&(w.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:W),45,sn),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:N[1]||(N[1]=W=>m()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)]),r.createElementVNode("span",{class:"xml-node__collapsed-badge",style:r.normalizeStyle({backgroundColor:h.theme.colors.collapsedBackground,color:h.theme.colors.collapsedText}),onClick:N[2]||(N[2]=W=>m()),title:`Click to expand ${T.value} child element${T.value>1?"s":""}`},r.toDisplayString(T.value)+" child"+r.toDisplayString(T.value>1?"ren":""),13,ln),r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:N[3]||(N[3]=W=>m()),title:"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:M.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createElementVNode("div",an,[A.value?(r.openBlock(),r.createElementBlock("span",{key:0,class:"xml-node__clickable-part",onClick:N[4]||(N[4]=W=>m()),title:ee.value?"Click to collapse":"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:r.withModifiers(B,["stop"]),onContextmenu:xe,onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(q,["escape"])],onBlur:I,ref_key:"tagNameRef",ref:O,title:"Double-click or right-click to edit tag name"},r.toDisplayString(o.value?c.value:M.value),45,dn)],8,cn)):(r.openBlock(),r.createElementBlock("span",un,[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"<",4),r.createElementVNode("span",{class:"xml-node__tag xml-node__tag--editable",style:r.normalizeStyle({color:h.theme.colors.xmlTag}),contenteditable:o.value,onDblclick:B,onKeydown:[r.withKeys(r.withModifiers(I,["prevent"]),["enter"]),r.withKeys(q,["escape"])],onBlur:I,ref_key:"tagNameRef",ref:O,title:"Double-click to edit tag name"},r.toDisplayString(o.value?c.value:M.value),45,fn)])),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Z.value,(W,P)=>(r.openBlock(),r.createElementBlock("span",{key:P,class:"xml-node__attribute"},[r.createElementVNode("span",{class:"xml-node__attr-name xml-node__attr-name--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttribute}),contenteditable:l.value===P,onDblclick:R=>x(P),onKeydown:[r.withKeys(r.withModifiers(U,["prevent"]),["enter"]),r.withKeys(Ee,["escape"])],onBlur:U,ref_for:!0,ref:R=>{l.value===P&&($.value=R)},title:"Double-click to edit attribute name"},r.toDisplayString(l.value===P?b.value:P),45,hn),r.createElementVNode("span",{class:"xml-node__equals",style:r.normalizeStyle({color:h.theme.colors.xmlEquals})},"=",4),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4),r.createElementVNode("span",{class:"xml-node__attr-value xml-node__attr-value--editable",style:r.normalizeStyle({color:h.theme.colors.xmlAttributeValue}),contenteditable:a.value===P,onDblclick:R=>v(P),onKeydown:[r.withKeys(r.withModifiers(Y,["prevent"]),["enter"]),r.withKeys(_e,["escape"])],onBlur:Y,ref_for:!0,ref:R=>{a.value===P&&(w.value=R)},title:"Double-click to edit attribute value"},r.toDisplayString(a.value===P?p.value:W),45,pn),r.createElementVNode("span",{class:"xml-node__quote",style:r.normalizeStyle({color:h.theme.colors.xmlQuote})},'"',4)]))),128)),A.value?(r.openBlock(),r.createElementBlock("span",{key:2,class:"xml-node__clickable-part",onClick:N[5]||(N[5]=W=>m()),title:ee.value?"Click to collapse":"Click to expand"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)],8,mn)):(r.openBlock(),r.createElementBlock("span",{key:3,class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},r.toDisplayString(A.value?">":"/>"),5))]),ee.value&&A.value?(r.openBlock(),r.createElementBlock("div",gn,[J.value.length===0&&C.value.trim()?(r.openBlock(),r.createElementBlock("div",yn,[r.createElementVNode("span",{class:"xml-node__text-content xml-node__text-content--editable",style:r.normalizeStyle({color:h.theme.colors.xmlText}),contenteditable:d.value,onDblclick:S,onKeydown:[r.withKeys(r.withModifiers(ue,["prevent"]),["enter"]),r.withKeys(He,["escape"])],onBlur:ue,ref_key:"textContentRef",ref:L,title:"Double-click to edit text content"},r.toDisplayString(d.value?k.value:C.value),45,bn)])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(J.value,(W,P)=>(r.openBlock(),r.createBlock(H,{key:u(W,P),node:W,index:P,level:h.level+1,"parent-path":y(),expanded:h.expanded,theme:h.theme,onToggleExpand:N[6]||(N[6]=R=>h.$emit("toggle-expand",R)),onCopy:N[7]||(N[7]=R=>h.$emit("copy",R)),"onUpdate:tagName":N[8]||(N[8]=(R,se,me)=>h.$emit("update:tagName",R,se,me)),"onUpdate:attributeName":N[9]||(N[9]=(R,se,me)=>h.$emit("update:attributeName",R,se,me)),"onUpdate:attributeValue":N[10]||(N[10]=(R,se,me)=>h.$emit("update:attributeValue",R,se,me)),"onUpdate:textContent":N[11]||(N[11]=(R,se)=>h.$emit("update:textContent",R,se)),"onUpdate:cdataContent":N[12]||(N[12]=(R,se)=>h.$emit("update:cdataContent",R,se))},null,8,["node","index","level","parent-path","expanded","theme"]))),128))])):r.createCommentVNode("",!0),ee.value&&A.value?(r.openBlock(),r.createElementBlock("div",En,[r.createElementVNode("span",{class:"xml-node__clickable-part",onClick:N[13]||(N[13]=W=>m()),title:"Click to collapse"},[r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},"</",4),r.createElementVNode("span",{class:"xml-node__tag",style:r.normalizeStyle({color:h.theme.colors.xmlTag})},r.toDisplayString(o.value?c.value:M.value),5),r.createElementVNode("span",{class:"xml-node__bracket",style:r.normalizeStyle({color:h.theme.colors.xmlBracket})},">",4)])])):r.createCommentVNode("",!0)],64))]))])):r.createCommentVNode("",!0)],4)}}}),[["__scopeId","data-v-44ac0d91"]]),Oe={"github-light":{name:"github-light",colors:{background:"#ffffff",surfaceBackground:"#f6f8fa",border:"#d0d7de",text:"#24292f",textSecondary:"#57606a",buttonBackground:"#f6f8fa",buttonBackgroundHover:"#f3f4f6",buttonBorder:"#d0d7de",buttonText:"#24292f",buttonPrimary:"#1f883d",buttonPrimaryHover:"#1a7f37",success:"#1f883d",successBackground:"#dafbe1",error:"#cf222e",errorBackground:"#ffebe9",xmlTag:"#116329",xmlAttribute:"#0550ae",xmlAttributeValue:"#0a3069",xmlText:"#24292f",xmlComment:"#6e7781",xmlCdata:"#8250df",xmlDeclaration:"#953800",xmlBracket:"#6e7781",xmlEquals:"#6e7781",xmlQuote:"#0550ae",collapsedBackground:"#ddf4ff",collapsedText:"#0969da",indentLine:"#d0d7de"}},"github-dark":{name:"github-dark",colors:{background:"#0d1117",surfaceBackground:"#161b22",border:"#30363d",text:"#c9d1d9",textSecondary:"#8b949e",buttonBackground:"#21262d",buttonBackgroundHover:"#30363d",buttonBorder:"#30363d",buttonText:"#c9d1d9",buttonPrimary:"#238636",buttonPrimaryHover:"#2ea043",success:"#3fb950",successBackground:"#0f2e1c",error:"#f85149",errorBackground:"#3d1319",xmlTag:"#7ee787",xmlAttribute:"#79c0ff",xmlAttributeValue:"#a5d6ff",xmlText:"#c9d1d9",xmlComment:"#8b949e",xmlCdata:"#d2a8ff",xmlDeclaration:"#ffa657",xmlBracket:"#8b949e",xmlEquals:"#8b949e",xmlQuote:"#79c0ff",collapsedBackground:"#1c2d41",collapsedText:"#58a6ff",indentLine:"#30363d"}},"min-light":{name:"min-light",colors:{background:"#ffffff",surfaceBackground:"#fafafa",border:"#e5e5e5",text:"#171717",textSecondary:"#737373",buttonBackground:"#fafafa",buttonBackgroundHover:"#f5f5f5",buttonBorder:"#e5e5e5",buttonText:"#171717",buttonPrimary:"#22c55e",buttonPrimaryHover:"#16a34a",success:"#22c55e",successBackground:"#dcfce7",error:"#ef4444",errorBackground:"#fee2e2",xmlTag:"#16a34a",xmlAttribute:"#2563eb",xmlAttributeValue:"#1e40af",xmlText:"#171717",xmlComment:"#737373",xmlCdata:"#9333ea",xmlDeclaration:"#ea580c",xmlBracket:"#737373",xmlEquals:"#737373",xmlQuote:"#2563eb",collapsedBackground:"#dbeafe",collapsedText:"#1d4ed8",indentLine:"#e5e7eb"}},"slack-ochin":{name:"slack-ochin",colors:{background:"#fef5ed",surfaceBackground:"#fef9f3",border:"#e9dcc9",text:"#3d3c40",textSecondary:"#616061",buttonBackground:"#fef9f3",buttonBackgroundHover:"#f9f0e5",buttonBorder:"#e9dcc9",buttonText:"#3d3c40",buttonPrimary:"#007a5a",buttonPrimaryHover:"#006644",success:"#007a5a",successBackground:"#d1f4e0",error:"#e01e5a",errorBackground:"#ffdbea",xmlTag:"#007a5a",xmlAttribute:"#1264a3",xmlAttributeValue:"#0b4c8c",xmlText:"#3d3c40",xmlComment:"#616061",xmlCdata:"#8b2eff",xmlDeclaration:"#e8912d",xmlBracket:"#616061",xmlEquals:"#616061",xmlQuote:"#1264a3",collapsedBackground:"#d8eaf5",collapsedText:"#0b4c8c",indentLine:"#e8d5b7"}}},xn=n=>Oe[n]||Oe["github-light"],$e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",kn=$e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Nn="["+$e+"]["+kn+"]*",wn=new RegExp("^"+Nn+"$");function Pe(n,e){const t=[];let s=e.exec(n);for(;s;){const o=[];o.startIndex=e.lastIndex-s[0].length;const l=s.length;for(let a=0;a<l;a++)o.push(s[a]);t.push(o),s=e.exec(n)}return t}const ye=function(n){const e=wn.exec(n);return!(e===null||typeof e>"u")};function An(n){return typeof n<"u"}const Cn={allowBooleanAttributes:!1,unpairedTags:[]};function Ve(n,e){e=Object.assign({},Cn,e);const t=[];let s=!1,o=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let l=0;l<n.length;l++)if(n[l]==="<"&&n[l+1]==="?"){if(l+=2,l=Re(n,l),l.err)return l}else if(n[l]==="<"){let a=l;if(l++,n[l]==="!"){l=Le(n,l);continue}else{let d=!1;n[l]==="/"&&(d=!0,l++);let i="";for(;l<n.length&&n[l]!==">"&&n[l]!==" "&&n[l]!==" "&&n[l]!==`
9
+ `&&n[l]!=="\r";l++)i+=n[l];if(i=i.trim(),i[i.length-1]==="/"&&(i=i.substring(0,i.length-1),l--),!Vn(i)){let p;return i.trim().length===0?p="Invalid space after '<'.":p="Tag '"+i+"' is an invalid name.",X("InvalidTag",p,Q(n,l))}const c=vn(n,l);if(c===!1)return X("InvalidAttr","Attributes for '"+i+"' have open quote.",Q(n,l));let b=c.value;if(l=c.index,b[b.length-1]==="/"){const p=l-b.length;b=b.substring(0,b.length-1);const k=Me(b,e);if(k===!0)s=!0;else return X(k.err.code,k.err.msg,Q(n,p+k.err.line))}else if(d)if(c.tagClosed){if(b.trim().length>0)return X("InvalidTag","Closing tag '"+i+"' can't have attributes or invalid starting.",Q(n,a));if(t.length===0)return X("InvalidTag","Closing tag '"+i+"' has not been opened.",Q(n,a));{const p=t.pop();if(i!==p.tagName){let k=Q(n,p.tagStartPos);return X("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+k.line+", col "+k.col+") instead of closing tag '"+i+"'.",Q(n,a))}t.length==0&&(o=!0)}}else return X("InvalidTag","Closing tag '"+i+"' doesn't have proper closing.",Q(n,l));else{const p=Me(b,e);if(p!==!0)return X(p.err.code,p.err.msg,Q(n,l-b.length+p.err.line));if(o===!0)return X("InvalidXml","Multiple possible root nodes found.",Q(n,l));e.unpairedTags.indexOf(i)!==-1||t.push({tagName:i,tagStartPos:a}),s=!0}for(l++;l<n.length;l++)if(n[l]==="<")if(n[l+1]==="!"){l++,l=Le(n,l);continue}else if(n[l+1]==="?"){if(l=Re(n,++l),l.err)return l}else break;else if(n[l]==="&"){const p=$n(n,l);if(p==-1)return X("InvalidChar","char '&' is not expected.",Q(n,l));l=p}else if(o===!0&&!Ie(n[l]))return X("InvalidXml","Extra text at the end",Q(n,l));n[l]==="<"&&l--}}else{if(Ie(n[l]))continue;return X("InvalidChar","char '"+n[l]+"' is not expected.",Q(n,l))}if(s){if(t.length==1)return X("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",Q(n,t[0].tagStartPos));if(t.length>0)return X("InvalidXml","Invalid '"+JSON.stringify(t.map(l=>l.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return X("InvalidXml","Start tag expected.",1);return!0}function Ie(n){return n===" "||n===" "||n===`
10
+ `||n==="\r"}function Re(n,e){const t=e;for(;e<n.length;e++)if(n[e]=="?"||n[e]==" "){const s=n.substr(t,e-t);if(e>5&&s==="xml")return X("InvalidXml","XML declaration allowed only at the start of the document.",Q(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function Le(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e<n.length;e++)if(n[e]==="-"&&n[e+1]==="-"&&n[e+2]===">"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e<n.length;e++)if(n[e]==="<")t++;else if(n[e]===">"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e<n.length;e++)if(n[e]==="]"&&n[e+1]==="]"&&n[e+2]===">"){e+=2;break}}return e}const Bn='"',Tn="'";function vn(n,e){let t="",s="",o=!1;for(;e<n.length;e++){if(n[e]===Bn||n[e]===Tn)s===""?s=n[e]:s!==n[e]||(s="");else if(n[e]===">"&&s===""){o=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:o}}const Sn=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Me(n,e){const t=Pe(n,Sn),s={};for(let o=0;o<t.length;o++){if(t[o][1].length===0)return X("InvalidAttr","Attribute '"+t[o][2]+"' has no space in starting.",he(t[o]));if(t[o][3]!==void 0&&t[o][4]===void 0)return X("InvalidAttr","Attribute '"+t[o][2]+"' is without value.",he(t[o]));if(t[o][3]===void 0&&!e.allowBooleanAttributes)return X("InvalidAttr","boolean attribute '"+t[o][2]+"' is not allowed.",he(t[o]));const l=t[o][2];if(!Pn(l))return X("InvalidAttr","Attribute '"+l+"' is an invalid name.",he(t[o]));if(!s.hasOwnProperty(l))s[l]=1;else return X("InvalidAttr","Attribute '"+l+"' is repeated.",he(t[o]))}return!0}function On(n,e){let t=/\d/;for(n[e]==="x"&&(e++,t=/[\da-fA-F]/);e<n.length;e++){if(n[e]===";")return e;if(!n[e].match(t))break}return-1}function $n(n,e){if(e++,n[e]===";")return-1;if(n[e]==="#")return e++,On(n,e);let t=0;for(;e<n.length;e++,t++)if(!(n[e].match(/\w/)&&t<20)){if(n[e]===";")break;return-1}return e}function X(n,e,t){return{err:{code:n,msg:e,line:t.line||t,col:t.col}}}function Pn(n){return ye(n)}function Vn(n){return ye(n)}function Q(n,e){const t=n.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function he(n){return n.startIndex+n[1].length}const In={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,e){return e},attributeValueProcessor:function(n,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n},captureMetaData:!1},Rn=function(n){return Object.assign({},In,n)};let be;typeof Symbol!="function"?be="@@xmlMetadata":be=Symbol("XML Node Metadata");class ie{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][be]={startIndex:t})}static getMetaDataSymbol(){return be}}class Ln{constructor(e){this.suppressValidationErr=!e}readDocType(e,t){const s={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let o=1,l=!1,a=!1,d="";for(;t<e.length;t++)if(e[t]==="<"&&!a){if(l&&ce(e,"!ENTITY",t)){t+=7;let i,c;[i,c,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),c.indexOf("&")===-1&&(s[i]={regx:RegExp(`&${i};`,"g"),val:c})}else if(l&&ce(e,"!ELEMENT",t)){t+=8;const{index:i}=this.readElementExp(e,t+1);t=i}else if(l&&ce(e,"!ATTLIST",t))t+=8;else if(l&&ce(e,"!NOTATION",t)){t+=9;const{index:i}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=i}else if(ce(e,"!--",t))a=!0;else throw new Error("Invalid DOCTYPE");o++,d=""}else if(e[t]===">"){if(a?e[t-1]==="-"&&e[t-2]==="-"&&(a=!1,o--):o--,o===0)break}else e[t]==="["?l=!0:d+=e[t];if(o!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:t}}readEntityExp(e,t){t=D(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)s+=e[t],t++;if(pe(s),t=D(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let o="";return[t,o]=this.readIdentifierVal(e,t,"entity"),t--,[s,o,t]}readNotationExp(e,t){t=D(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;!this.suppressValidationErr&&pe(s),t=D(e,t);const o=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&o!=="SYSTEM"&&o!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${o}"`);t+=o.length,t=D(e,t);let l=null,a=null;if(o==="PUBLIC")[t,l]=this.readIdentifierVal(e,t,"publicIdentifier"),t=D(e,t),(e[t]==='"'||e[t]==="'")&&([t,a]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(o==="SYSTEM"&&([t,a]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!a))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:l,systemIdentifier:a,index:--t}}readIdentifierVal(e,t,s){let o="";const l=e[t];if(l!=='"'&&l!=="'")throw new Error(`Expected quoted string, found "${l}"`);for(t++;t<e.length&&e[t]!==l;)o+=e[t],t++;if(e[t]!==l)throw new Error(`Unterminated ${s} value`);return t++,[t,o]}readElementExp(e,t){t=D(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;if(!this.suppressValidationErr&&!ye(s))throw new Error(`Invalid element name: "${s}"`);t=D(e,t);let o="";if(e[t]==="E"&&ce(e,"MPTY",t))t+=4;else if(e[t]==="A"&&ce(e,"NY",t))t+=2;else if(e[t]==="("){for(t++;t<e.length&&e[t]!==")";)o+=e[t],t++;if(e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:s,contentModel:o.trim(),index:t}}readAttlistExp(e,t){t=D(e,t);let s="";for(;t<e.length&&!/\s/.test(e[t]);)s+=e[t],t++;pe(s),t=D(e,t);let o="";for(;t<e.length&&!/\s/.test(e[t]);)o+=e[t],t++;if(!pe(o))throw new Error(`Invalid attribute name: "${o}"`);t=D(e,t);let l="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(l="NOTATION",t+=8,t=D(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let d=[];for(;t<e.length&&e[t]!==")";){let i="";for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)i+=e[t],t++;if(i=i.trim(),!pe(i))throw new Error(`Invalid notation name: "${i}"`);d.push(i),e[t]==="|"&&(t++,t=D(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,l+=" ("+d.join("|")+")"}else{for(;t<e.length&&!/\s/.test(e[t]);)l+=e[t],t++;const d=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!d.includes(l.toUpperCase()))throw new Error(`Invalid attribute type: "${l}"`)}t=D(e,t);let a="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(a="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(a="#IMPLIED",t+=7):[t,a]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:s,attributeName:o,attributeType:l,defaultValue:a,index:t}}}const D=(n,e)=>{for(;e<n.length&&/\s/.test(n[e]);)e++;return e};function ce(n,e,t){for(let s=0;s<e.length;s++)if(e[s]!==n[t+s+1])return!1;return!0}function pe(n){if(ye(n))return n;throw new Error(`Invalid entity name ${n}`)}const Mn=/^[-+]?0x[a-fA-F0-9]+$/,Kn=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,jn={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Un(n,e={}){if(e=Object.assign({},jn,e),!n||typeof n!="string")return n;let t=n.trim();if(e.skipLike!==void 0&&e.skipLike.test(t))return n;if(n==="0")return 0;if(e.hex&&Mn.test(t))return Hn(t,16);if(t.search(/.+[eE].+/)!==-1)return zn(n,t,e);{const s=Kn.exec(t);if(s){const o=s[1]||"",l=s[2];let a=Xn(s[3]);const d=o?n[l.length+1]===".":n[l.length]===".";if(!e.leadingZeros&&(l.length>1||l.length===1&&!d))return n;{const i=Number(t),c=String(i);if(i===0)return i;if(c.search(/[eE]/)!==-1)return e.eNotation?i:n;if(t.indexOf(".")!==-1)return c==="0"||c===a||c===`${o}${a}`?i:n;let b=l?a:t;return l?b===c||o+b===c?i:n:b===c||b===o+c?i:n}}else return n}}const Fn=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function zn(n,e,t){if(!t.eNotation)return n;const s=e.match(Fn);if(s){let o=s[1]||"";const l=s[3].indexOf("e")===-1?"E":"e",a=s[2],d=o?n[a.length+1]===l:n[a.length]===l;return a.length>1&&d?n:a.length===1&&(s[3].startsWith(`.${l}`)||s[3][0]===l)?Number(e):t.leadingZeros&&!d?(e=(s[1]||"")+s[3],Number(e)):n}else return n}function Xn(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function Hn(n,e){if(parseInt)return parseInt(n,e);if(Number.parseInt)return Number.parseInt(n,e);if(window&&window.parseInt)return window.parseInt(n,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Ke(n){return typeof n=="function"?n:Array.isArray(n)?e=>{for(const t of n)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class qn{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=Wn,this.parseXml=Zn,this.parseTextData=Qn,this.resolveNameSpace=Yn,this.buildAttributesMap=Gn,this.isItStopNode=nr,this.replaceEntitiesValue=er,this.readStopNodeData=or,this.saveTextToParentTag=tr,this.addChild=Jn,this.ignoreAttributesFn=Ke(this.options.ignoreAttributes)}}function Wn(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const s=e[t];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:n[s]}}}function Qn(n,e,t,s,o,l,a){if(n!==void 0&&(this.options.trimValues&&!s&&(n=n.trim()),n.length>0)){a||(n=this.replaceEntitiesValue(n));const d=this.options.tagValueProcessor(e,n,t,o,l);return d==null?n:typeof d!=typeof n||d!==n?d:this.options.trimValues?Ae(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Ae(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Yn(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Dn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Gn(n,e,t){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const s=Pe(n,Dn),o=s.length,l={};for(let a=0;a<o;a++){const d=this.resolveNameSpace(s[a][1]);if(this.ignoreAttributesFn(d,e))continue;let i=s[a][4],c=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),i!==void 0){this.options.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i);const b=this.options.attributeValueProcessor(d,i,e);b==null?l[c]=i:typeof b!=typeof i||b!==i?l[c]=b:l[c]=Ae(i,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(l[c]=!0)}if(!Object.keys(l).length)return;if(this.options.attributesGroupName){const a={};return a[this.options.attributesGroupName]=l,a}return l}}const Zn=function(n){n=n.replace(/\r\n?/g,`
11
+ `);const e=new ie("!xml");let t=e,s="",o="";const l=new Ln(this.options.processEntities);for(let a=0;a<n.length;a++)if(n[a]==="<")if(n[a+1]==="/"){const i=de(n,">",a,"Closing Tag is not closed.");let c=n.substring(a+2,i).trim();if(this.options.removeNSPrefix){const k=c.indexOf(":");k!==-1&&(c=c.substr(k+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&(s=this.saveTextToParentTag(s,t,o));const b=o.substring(o.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let p=0;b&&this.options.unpairedTags.indexOf(b)!==-1?(p=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):p=o.lastIndexOf("."),o=o.substring(0,p),t=this.tagsNodeStack.pop(),s="",a=i}else if(n[a+1]==="?"){let i=we(n,a,!1,"?>");if(!i)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,o),!(this.options.ignoreDeclaration&&i.tagName==="?xml"||this.options.ignorePiTags)){const c=new ie(i.tagName);c.add(this.options.textNodeName,""),i.tagName!==i.tagExp&&i.attrExpPresent&&(c[":@"]=this.buildAttributesMap(i.tagExp,o,i.tagName)),this.addChild(t,c,o,a)}a=i.closeIndex+1}else if(n.substr(a+1,3)==="!--"){const i=de(n,"-->",a+4,"Comment is not closed.");if(this.options.commentPropName){const c=n.substring(a+4,i-2);s=this.saveTextToParentTag(s,t,o),t.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}a=i}else if(n.substr(a+1,2)==="!D"){const i=l.readDocType(n,a);this.docTypeEntities=i.entities,a=i.i}else if(n.substr(a+1,2)==="!["){const i=de(n,"]]>",a,"CDATA is not closed.")-2,c=n.substring(a+9,i);s=this.saveTextToParentTag(s,t,o);let b=this.parseTextData(c,t.tagname,o,!0,!1,!0,!0);b==null&&(b=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):t.add(this.options.textNodeName,b),a=i+2}else{let i=we(n,a,this.options.removeNSPrefix),c=i.tagName;const b=i.rawTagName;let p=i.tagExp,k=i.attrExpPresent,E=i.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,o,!1));const O=t;O&&this.options.unpairedTags.indexOf(O.tagname)!==-1&&(t=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),c!==e.tagname&&(o+=o?"."+c:c);const $=a;if(this.isItStopNode(this.options.stopNodes,o,c)){let w="";if(p.length>0&&p.lastIndexOf("/")===p.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),o=o.substr(0,o.length-1),p=c):p=p.substr(0,p.length-1),a=i.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)a=i.closeIndex;else{const F=this.readStopNodeData(n,b,E+1);if(!F)throw new Error(`Unexpected end of ${b}`);a=F.i,w=F.tagContent}const L=new ie(c);c!==p&&k&&(L[":@"]=this.buildAttributesMap(p,o,c)),w&&(w=this.parseTextData(w,c,o,!0,k,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),L.add(this.options.textNodeName,w),this.addChild(t,L,o,$)}else{if(p.length>0&&p.lastIndexOf("/")===p.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),o=o.substr(0,o.length-1),p=c):p=p.substr(0,p.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const w=new ie(c);c!==p&&k&&(w[":@"]=this.buildAttributesMap(p,o,c)),this.addChild(t,w,o,$),o=o.substr(0,o.lastIndexOf("."))}else{const w=new ie(c);this.tagsNodeStack.push(t),c!==p&&k&&(w[":@"]=this.buildAttributesMap(p,o,c)),this.addChild(t,w,o,$),t=w}s="",a=E}}else s+=n[a];return e.child};function Jn(n,e,t,s){this.options.captureMetaData||(s=void 0);const o=this.options.updateTag(e.tagname,t,e[":@"]);o===!1||(typeof o=="string"&&(e.tagname=o),n.addChild(e,s))}const er=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function tr(n,e,t,s){return n&&(s===void 0&&(s=e.child.length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function nr(n,e,t){const s="*."+t;for(const o in n){const l=n[o];if(s===l||e===l)return!0}return!1}function rr(n,e,t=">"){let s,o="";for(let l=e;l<n.length;l++){let a=n[l];if(s)a===s&&(s="");else if(a==='"'||a==="'")s=a;else if(a===t[0])if(t[1]){if(n[l+1]===t[1])return{data:o,index:l}}else return{data:o,index:l};else a===" "&&(a=" ");o+=a}}function de(n,e,t,s){const o=n.indexOf(e,t);if(o===-1)throw new Error(s);return o+e.length-1}function we(n,e,t,s=">"){const o=rr(n,e+1,s);if(!o)return;let l=o.data;const a=o.index,d=l.search(/\s/);let i=l,c=!0;d!==-1&&(i=l.substring(0,d),l=l.substring(d+1).trimStart());const b=i;if(t){const p=i.indexOf(":");p!==-1&&(i=i.substr(p+1),c=i!==o.data.substr(p+1))}return{tagName:i,tagExp:l,closeIndex:a,attrExpPresent:c,rawTagName:b}}function or(n,e,t){const s=t;let o=1;for(;t<n.length;t++)if(n[t]==="<")if(n[t+1]==="/"){const l=de(n,">",t,`${e} is not closed`);if(n.substring(t+2,l).trim()===e&&(o--,o===0))return{tagContent:n.substring(s,t),i:l};t=l}else if(n[t+1]==="?")t=de(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=de(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=de(n,"]]>",t,"StopNode is not closed.")-2;else{const l=we(n,t,">");l&&((l&&l.tagName)===e&&l.tagExp[l.tagExp.length-1]!=="/"&&o++,t=l.closeIndex)}}function Ae(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:Un(n,t)}else return An(n)?n:""}const Ce=ie.getMetaDataSymbol();function sr(n,e){return je(n,e)}function je(n,e,t){let s;const o={};for(let l=0;l<n.length;l++){const a=n[l],d=lr(a);let i="";if(t===void 0?i=d:i=t+"."+d,d===e.textNodeName)s===void 0?s=a[d]:s+=""+a[d];else{if(d===void 0)continue;if(a[d]){let c=je(a[d],e,i);const b=ir(c,e);a[Ce]!==void 0&&(c[Ce]=a[Ce]),a[":@"]?ar(c,a[":@"],i,e):Object.keys(c).length===1&&c[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?c=c[e.textNodeName]:Object.keys(c).length===0&&(e.alwaysCreateTextNode?c[e.textNodeName]="":c=""),o[d]!==void 0&&o.hasOwnProperty(d)?(Array.isArray(o[d])||(o[d]=[o[d]]),o[d].push(c)):e.isArray(d,i,b)?o[d]=[c]:o[d]=c}}}return typeof s=="string"?s.length>0&&(o[e.textNodeName]=s):s!==void 0&&(o[e.textNodeName]=s),o}function lr(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const s=e[t];if(s!==":@")return s}}function ar(n,e,t,s){if(e){const o=Object.keys(e),l=o.length;for(let a=0;a<l;a++){const d=o[a];s.isArray(d,t+"."+d,!0,!0)?n[d]=[e[d]]:n[d]=e[d]}}}function ir(n,e){const{textNodeName:t}=e,s=Object.keys(n).length;return!!(s===0||s===1&&(n[t]||typeof n[t]=="boolean"||n[t]===0))}class cr{constructor(e){this.externalEntities={},this.options=Rn(e)}parse(e,t){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const l=Ve(e,t);if(l!==!0)throw Error(`${l.err.msg}:${l.err.line}:${l.err.col}`)}const s=new qn(this.options);s.addExternalEntities(this.externalEntities);const o=s.parseXml(e);return this.options.preserveOrder||o===void 0?o:sr(o,this.options)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return ie.getMetaDataSymbol()}}const dr=`
12
+ `;function ur(n,e){let t="";return e.format&&e.indentBy.length>0&&(t=dr),Ue(n,e,"",t)}function Ue(n,e,t,s){let o="",l=!1;for(let a=0;a<n.length;a++){const d=n[a],i=fr(d);if(i===void 0)continue;let c="";if(t.length===0?c=i:c=`${t}.${i}`,i===e.textNodeName){let O=d[i];hr(c,e)||(O=e.tagValueProcessor(i,O),O=ze(O,e)),l&&(o+=s),o+=O,l=!1;continue}else if(i===e.cdataPropName){l&&(o+=s),o+=`<![CDATA[${d[i][0][e.textNodeName]}]]>`,l=!1;continue}else if(i===e.commentPropName){o+=s+`<!--${d[i][0][e.textNodeName]}-->`,l=!0;continue}else if(i[0]==="?"){const O=Fe(d[":@"],e),$=i==="?xml"?"":s;let w=d[i][0][e.textNodeName];w=w.length!==0?" "+w:"",o+=$+`<${i}${w}${O}?>`,l=!0;continue}let b=s;b!==""&&(b+=e.indentBy);const p=Fe(d[":@"],e),k=s+`<${i}${p}`,E=Ue(d[i],e,c,b);e.unpairedTags.indexOf(i)!==-1?e.suppressUnpairedNode?o+=k+">":o+=k+"/>":(!E||E.length===0)&&e.suppressEmptyNode?o+=k+"/>":E&&E.endsWith(">")?o+=k+`>${E}${s}</${i}>`:(o+=k+">",E&&s!==""&&(E.includes("/>")||E.includes("</"))?o+=s+e.indentBy+E+s:o+=E,o+=`</${i}>`),l=!0}return o}function fr(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const s=e[t];if(n.hasOwnProperty(s)&&s!==":@")return s}}function Fe(n,e){let t="";if(n&&!e.ignoreAttributes)for(let s in n){if(!n.hasOwnProperty(s))continue;let o=e.attributeValueProcessor(s,n[s]);o=ze(o,e),o===!0&&e.suppressBooleanAttributes?t+=` ${s.substr(e.attributeNamePrefix.length)}`:t+=` ${s.substr(e.attributeNamePrefix.length)}="${o}"`}return t}function hr(n,e){n=n.substr(0,n.length-e.textNodeName.length-1);let t=n.substr(n.lastIndexOf(".")+1);for(let s in e.stopNodes)if(e.stopNodes[s]===n||e.stopNodes[s]==="*."+t)return!0;return!1}function ze(n,e){if(n&&n.length>0&&e.processEntities)for(let t=0;t<e.entities.length;t++){const s=e.entities[t];n=n.replace(s.regex,s.val)}return n}const pr={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(n,e){return e},attributeValueProcessor:function(n,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ae(n){this.options=Object.assign({},pr,n),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Ke(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=yr),this.processTextOrObjNode=mr,this.options.format?(this.indentate=gr,this.tagEndChar=`>
13
13
  `,this.newLine=`
14
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}G.prototype.build=function(r){return this.options.preserveOrder?vr(r,this.options):(Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r}),this.j2x(r,0,[]).val)},G.prototype.j2x=function(r,e,t){let s="",n="";const l=t.join(".");for(let i in r)if(Object.prototype.hasOwnProperty.call(r,i))if(typeof r[i]>"u")this.isAttribute(i)&&(n+="");else if(r[i]===null)this.isAttribute(i)||i===this.options.cdataPropName?n+="":i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(r[i]instanceof Date)n+=this.buildTextValNode(r[i],i,"",e);else if(typeof r[i]!="object"){const d=this.isAttribute(i);if(d&&!this.ignoreAttributesFn(d,l))s+=this.buildAttrPairStr(d,""+r[i]);else if(!d)if(i===this.options.textNodeName){let a=this.options.tagValueProcessor(i,""+r[i]);n+=this.replaceEntitiesValue(a)}else n+=this.buildTextValNode(r[i],i,"",e)}else if(Array.isArray(r[i])){const d=r[i].length;let a="",c="";for(let p=0;p<d;p++){const h=r[i][p];if(!(typeof h>"u"))if(h===null)i[0]==="?"?n+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(typeof h=="object")if(this.options.oneListGroup){const k=this.j2x(h,e+1,t.concat(i));a+=k.val,this.options.attributesGroupName&&h.hasOwnProperty(this.options.attributesGroupName)&&(c+=k.attrStr)}else a+=this.processTextOrObjNode(h,i,e,t);else if(this.options.oneListGroup){let k=this.options.tagValueProcessor(i,h);k=this.replaceEntitiesValue(k),a+=k}else a+=this.buildTextValNode(h,i,"",e)}this.options.oneListGroup&&(a=this.buildObjectNode(a,i,c,e)),n+=a}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const d=Object.keys(r[i]),a=d.length;for(let c=0;c<a;c++)s+=this.buildAttrPairStr(d[c],""+r[i][d[c]])}else n+=this.processTextOrObjNode(r[i],i,e,t);return{attrStr:s,val:n}},G.prototype.buildAttrPairStr=function(r,e){return e=this.options.attributeValueProcessor(r,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+r:" "+r+'="'+e+'"'};function Mr(r,e,t,s){const n=this.j2x(r,t+1,s.concat(e));return r[this.options.textNodeName]!==void 0&&Object.keys(r).length===1?this.buildTextValNode(r[this.options.textNodeName],e,n.attrStr,t):this.buildObjectNode(n.val,e,n.attrStr,t)}G.prototype.buildObjectNode=function(r,e,t,s){if(r==="")return e[0]==="?"?this.indentate(s)+"<"+e+t+"?"+this.tagEndChar:this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar;{let n="</"+e+this.tagEndChar,l="";return e[0]==="?"&&(l="?",n=""),(t||t==="")&&r.indexOf("<")===-1?this.indentate(s)+"<"+e+t+l+">"+r+n:this.options.commentPropName!==!1&&e===this.options.commentPropName&&l.length===0?this.indentate(s)+`<!--${r}-->`+this.newLine:this.indentate(s)+"<"+e+t+l+this.tagEndChar+r+this.indentate(s)+n}},G.prototype.closeTag=function(r){let e="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${r}`,e},G.prototype.buildTextValNode=function(r,e,t,s){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${r}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+`<!--${r}-->`+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,r);return n=this.replaceEntitiesValue(n),n===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+n+"</"+e+this.tagEndChar}},G.prototype.replaceEntitiesValue=function(r){if(r&&r.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const t=this.options.entities[e];r=r.replace(t.regex,t.val)}return r};function Fr(r){return this.options.indentBy.repeat(r)}function Ur(r){return r.startsWith(this.options.attributeNamePrefix)&&r!==this.options.textNodeName?r.substr(this.attrPrefixLen):!1}const Xr={validate:xe},zr={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",ignoreDeclaration:!1,commentPropName:"#comment",cdataPropName:"__cdata",preserveOrder:!0,parseAttributeValue:!1,trimValues:!0,parseTagValue:!1,processEntities:!0,htmlEntities:!1,ignoreNameSpace:!1,allowBooleanAttributes:!0,unpairedTags:[],stopNodes:[],alwaysCreateTextNode:!1},Hr={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",format:!0,indentBy:" ",suppressEmptyNode:!1,suppressBooleanAttributes:!1,suppressUnpairedNode:!1},Kr=r=>{try{const e=Xr.validate(r,{allowBooleanAttributes:!0});return e===!0?{valid:!0}:{valid:!1,error:`Line ${e.err.line}: ${e.err.msg}`}}catch(e){return{valid:!1,error:e instanceof Error?e.message:"Unknown validation error"}}},$e=(r,e)=>{try{return new Vr({...zr,...e}).parse(r)}catch(t){throw new Error(`XML 解析失败: ${t instanceof Error?t.message:"Unknown error"}`)}},me=(r,e)=>{try{let s=new G({...Hr,format:e?.format??!0,indentBy:e?.indentBy??" "}).build(r);return e?.showDeclaration!==!1&&!s.startsWith("<?xml")&&(s=`<?xml version="1.0" encoding="UTF-8"?>
15
- `+s),s}catch(t){throw new Error(`XML 构建失败: ${t instanceof Error?t.message:"Unknown error"}`)}},qr=r=>Array.isArray(r)?ce(r,{format:!1}):me(r,{format:!1,showDeclaration:!1}),Qr=(r,e)=>{const t=$e(r);return Array.isArray(t)?ce(t,{indent:e?.indentBy}):me(t,e)},ce=(r,e={})=>{const t=e.indent!==void 0?e.indent:" ",s=e.level||0,n=e.format!==!1,l=n?t.repeat(s):"",i=n?`
16
- `:"";let d="";for(const a of r){if(a["?xml"]){const x=a[":@"]||{},O=Object.entries(x).map(([R,z])=>`${R.startsWith("@_")?R.substring(2):R}="${z}"`).join(" ");d+=`<?xml ${O}?>${i}`;continue}if(a["#comment"]){const x=a["#comment"];if(Array.isArray(x)&&x.length>0){const O=x[0]["#text"]||x[0];d+=`${l}<!--${O}-->${i}`}continue}const c=Object.keys(a).find(x=>!x.startsWith(":")&&!x.startsWith("#")&&!x.startsWith("__"));if(!c)continue;const p=a[c],h=a[":@"]||{},k=Object.entries(h).map(([x,O])=>`${x.startsWith("@_")?x.substring(2):x}="${O}"`).join(" "),_=k?" "+k:"";if(!Array.isArray(p)||p.length===0){d+=`${l}<${c}${_}/>${i}`;continue}const N=p.length===1&&p[0]["#text"]!==void 0;if(p.some(x=>x.__cdata)){const x=p.find(O=>O.__cdata);if(x){const O=x.__cdata[0]["#text"]||"";d+=`${l}<${c}${_}><![CDATA[${O}]]></${c}>${i}`}}else if(N){const x=p[0]["#text"];d+=`${l}<${c}${_}>${x}</${c}>${i}`}else d+=`${l}<${c}${_}>${i}`,d+=ce(p,{indent:t,level:s+1,format:n}),d+=`${l}</${c}>${i}`}return d},Wr={key:0,class:"xml-format__toolbar"},Yr={class:"xml-format__actions"},Gr=["disabled"],Zr=["disabled"],Dr=["disabled"],Jr=["disabled"],en=["disabled"],tn={class:"xml-format__info"},rn={key:0,class:"xml-format__status xml-format__status--success"},nn={key:1,class:"xml-format__status xml-format__status--error"},on={class:"xml-format__content"},sn={key:0,class:"xml-format__error"},ln={key:1,class:"xml-format__viewer"},an=le(o.defineComponent({__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"},showComments:{type:Boolean,default:!0},showCdata:{type:Boolean,default:!0},preserveWhitespace:{type:Boolean,default:!1}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress","format"],setup(r,{expose:e,emit:t}){o.useCssVars(g=>({"0db40539":c.value.colors.border,bd72d08a:c.value.colors.background,"1738b57a":c.value.colors.text,"69331e8e":c.value.colors.surfaceBackground,cd0ca56a:c.value.colors.buttonBorder,"02f5e6cd":c.value.colors.buttonBackground,"060d3a0c":c.value.colors.buttonText,"6ac62a6f":c.value.colors.buttonBackgroundHover,"7ef6f8c3":c.value.colors.buttonPrimary,"24e03b8e":c.value.colors.buttonPrimaryHover,"357fd096":c.value.colors.success,"4d328338":c.value.colors.successBackground,"61df294a":c.value.colors.error,"3307322e":c.value.colors.errorBackground}));const s=r,n=t,l=o.ref(null),i=o.ref(""),d=o.ref(new Set),a=o.computed(()=>i.value===""),c=o.computed(()=>Kt(s.theme)),p=o.computed(()=>!l.value||!Array.isArray(l.value)?[]:l.value.filter(g=>!g["?xml"])),h=o.computed(()=>{if(!l.value||!Array.isArray(l.value))return null;const g=l.value.find($=>$["?xml"]);if(!g||!g[":@"])return null;const A=g[":@"],T=[];return A["@_version"]&&T.push(`version="${A["@_version"]}"`),A["@_encoding"]&&T.push(`encoding="${A["@_encoding"]}"`),A["@_standalone"]&&T.push(`standalone="${A["@_standalone"]}"`),T.length>0?`<?xml ${T.join(" ")}?>`:null}),k=o.computed(()=>p.value),_=g=>{if(!g||!g.trim()){i.value="",l.value=null;return}try{const A=Kr(g);if(!A.valid){i.value=A.error||"Invalid XML",l.value=null;return}l.value=$e(g),i.value="",o.nextTick(()=>{C()})}catch(A){i.value=A instanceof Error?A.message:"Unknown parse error",l.value=null}},N=g=>{d.value.has(g)?d.value.delete(g):d.value.add(g)},C=()=>{const g=new Set,A=(T,$="")=>{Array.isArray(T)&&T.forEach((j,X)=>{const F=Object.keys(j).find(te=>!te.startsWith(":")&&!te.startsWith("#"));if(!F)return;const ee=$?`${$}[${X}]`:`${F}[${X}]`;g.add(ee);const W=j[F];Array.isArray(W)&&A(W,ee+"."+F)})};p.value.forEach((T,$)=>{const j=Object.keys(T).find(X=>!X.startsWith(":")&&!X.startsWith("#"));if(j){const X=`${j}[${$}]`;g.add(X);const F=T[j];Array.isArray(F)&&A(F,X+"."+j)}}),d.value=g,n("expand-all")},x=()=>{d.value.clear(),n("collapse-all")},O=async()=>{if(!(!a.value||!l.value))try{const g=Array.isArray(l.value)?ce(l.value,{indent:" "}):me(l.value,{format:!0,indentBy:" "});await navigator.clipboard.writeText(g),n("copy-success",g)}catch(g){const A=g instanceof Error?g:new Error("Copy failed");n("copy-error",A),console.error("Failed to copy XML:",g)}},R=()=>{if(!(!a.value||!l.value))try{const g=qr(l.value);n("update:modelValue",g),n("compress",g)}catch(g){console.error("Failed to compress XML:",g)}},z=()=>{if(a.value)try{const g=Qr(s.modelValue,{format:!0,indentBy:" "});n("update:modelValue",g),n("format",g)}catch(g){console.error("Failed to format XML:",g)}},m=async g=>{try{const A=typeof g=="string"?g:JSON.stringify(g,null,2);await navigator.clipboard.writeText(A),n("copy-success",A)}catch(A){const T=A instanceof Error?A:new Error("Copy failed");n("copy-error",T),console.error("Failed to copy value:",A)}};return o.watch(()=>s.modelValue,g=>{_(g)},{immediate:!0}),e({copyXml:O,compressSource:R,formatSource:z,expandAll:C,collapseAll:x,toggleExpand:N,isValidXml:()=>a.value,getParsedXml:()=>l.value,getExpandedNodes:()=>d.value,getParseError:()=>i.value,parseXmlString:g=>_(g),copyValue:g=>m(g)}),(g,A)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["xml-format",`xml-format--${c.value.name}`])},[g.showToolbar?(o.openBlock(),o.createElementBlock("div",Wr,[o.createElementVNode("div",Yr,[o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--primary",onClick:O,disabled:!a.value,title:"Copy XML"}," 📋 Copy ",8,Gr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:C,disabled:!a.value,title:"Expand All"}," ⬇️ Expand All ",8,Zr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:x,disabled:!a.value,title:"Collapse All"}," ➡️ Collapse All ",8,Dr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:R,disabled:!a.value,title:"Compress XML"}," 📦 Compress ",8,Jr),o.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:z,disabled:!a.value,title:"Format XML"}," ✨ Format ",8,en)]),o.createElementVNode("div",tn,[a.value?(o.openBlock(),o.createElementBlock("span",rn," ✅ Valid XML ")):(o.openBlock(),o.createElementBlock("span",nn," ❌ Invalid XML "))])])):o.createCommentVNode("",!0),o.createElementVNode("div",on,[a.value?(o.openBlock(),o.createElementBlock("div",ln,[h.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"xml-declaration",style:o.normalizeStyle({color:c.value.colors.xmlDeclaration})},o.toDisplayString(h.value),5)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(k.value,(T,$)=>(o.openBlock(),o.createBlock(Ht,{key:$,node:T,index:$,level:0,expanded:d.value,theme:c.value,onToggleExpand:N,onCopy:m},null,8,["node","index","expanded","theme"]))),128))])):(o.openBlock(),o.createElementBlock("div",sn,[A[0]||(A[0]=o.createElementVNode("h4",null,"XML Parse Error:",-1)),o.createElementVNode("pre",null,o.toDisplayString(i.value),1)]))])],2))}}),[["__scopeId","data-v-f9125514"]]),cn=[be],dn={install:r=>{cn.forEach(e=>{const t=e.name||e.__name||"UnknownComponent";r.component(t,e)})}};q.JsonFormat=be,q.XmlFormat=an,q.default=dn,Object.defineProperties(q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
14
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}ae.prototype.build=function(n){return this.options.preserveOrder?ur(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0,[]).val)},ae.prototype.j2x=function(n,e,t){let s="",o="";const l=t.join(".");for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a))if(typeof n[a]>"u")this.isAttribute(a)&&(o+="");else if(n[a]===null)this.isAttribute(a)||a===this.options.cdataPropName?o+="":a[0]==="?"?o+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:o+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(n[a]instanceof Date)o+=this.buildTextValNode(n[a],a,"",e);else if(typeof n[a]!="object"){const d=this.isAttribute(a);if(d&&!this.ignoreAttributesFn(d,l))s+=this.buildAttrPairStr(d,""+n[a]);else if(!d)if(a===this.options.textNodeName){let i=this.options.tagValueProcessor(a,""+n[a]);o+=this.replaceEntitiesValue(i)}else o+=this.buildTextValNode(n[a],a,"",e)}else if(Array.isArray(n[a])){const d=n[a].length;let i="",c="";for(let b=0;b<d;b++){const p=n[a][b];if(!(typeof p>"u"))if(p===null)a[0]==="?"?o+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:o+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(typeof p=="object")if(this.options.oneListGroup){const k=this.j2x(p,e+1,t.concat(a));i+=k.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(c+=k.attrStr)}else i+=this.processTextOrObjNode(p,a,e,t);else if(this.options.oneListGroup){let k=this.options.tagValueProcessor(a,p);k=this.replaceEntitiesValue(k),i+=k}else i+=this.buildTextValNode(p,a,"",e)}this.options.oneListGroup&&(i=this.buildObjectNode(i,a,c,e)),o+=i}else if(this.options.attributesGroupName&&a===this.options.attributesGroupName){const d=Object.keys(n[a]),i=d.length;for(let c=0;c<i;c++)s+=this.buildAttrPairStr(d[c],""+n[a][d[c]])}else o+=this.processTextOrObjNode(n[a],a,e,t);return{attrStr:s,val:o}},ae.prototype.buildAttrPairStr=function(n,e){return e=this.options.attributeValueProcessor(n,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+n:" "+n+'="'+e+'"'};function mr(n,e,t,s){const o=this.j2x(n,t+1,s.concat(e));return n[this.options.textNodeName]!==void 0&&Object.keys(n).length===1?this.buildTextValNode(n[this.options.textNodeName],e,o.attrStr,t):this.buildObjectNode(o.val,e,o.attrStr,t)}ae.prototype.buildObjectNode=function(n,e,t,s){if(n==="")return e[0]==="?"?this.indentate(s)+"<"+e+t+"?"+this.tagEndChar:this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar;{let o="</"+e+this.tagEndChar,l="";return e[0]==="?"&&(l="?",o=""),(t||t==="")&&n.indexOf("<")===-1?this.indentate(s)+"<"+e+t+l+">"+n+o:this.options.commentPropName!==!1&&e===this.options.commentPropName&&l.length===0?this.indentate(s)+`<!--${n}-->`+this.newLine:this.indentate(s)+"<"+e+t+l+this.tagEndChar+n+this.indentate(s)+o}},ae.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${n}`,e},ae.prototype.buildTextValNode=function(n,e,t,s){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${n}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+`<!--${n}-->`+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(e,n);return o=this.replaceEntitiesValue(o),o===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+o+"</"+e+this.tagEndChar}},ae.prototype.replaceEntitiesValue=function(n){if(n&&n.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const t=this.options.entities[e];n=n.replace(t.regex,t.val)}return n};function gr(n){return this.options.indentBy.repeat(n)}function yr(n){return n.startsWith(this.options.attributeNamePrefix)&&n!==this.options.textNodeName?n.substr(this.attrPrefixLen):!1}const br={validate:Ve},Er={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",ignoreDeclaration:!1,commentPropName:"#comment",cdataPropName:"__cdata",preserveOrder:!0,parseAttributeValue:!1,trimValues:!0,parseTagValue:!1,processEntities:!0,htmlEntities:!1,ignoreNameSpace:!1,allowBooleanAttributes:!0,unpairedTags:[],stopNodes:[],alwaysCreateTextNode:!1},_r={ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text",format:!0,indentBy:" ",suppressEmptyNode:!1,suppressBooleanAttributes:!1,suppressUnpairedNode:!1},xr=n=>{try{const e=br.validate(n,{allowBooleanAttributes:!0});return e===!0?{valid:!0}:{valid:!1,error:`Line ${e.err.line}: ${e.err.msg}`}}catch(e){return{valid:!1,error:e instanceof Error?e.message:"Unknown validation error"}}},Xe=(n,e)=>{try{return new cr({...Er,...e}).parse(n)}catch(t){throw new Error(`XML 解析失败: ${t instanceof Error?t.message:"Unknown error"}`)}},Be=(n,e)=>{try{let s=new ae({..._r,format:e?.format??!0,indentBy:e?.indentBy??" "}).build(n);return e?.showDeclaration!==!1&&!s.startsWith("<?xml")&&(s=`<?xml version="1.0" encoding="UTF-8"?>
15
+ `+s),s}catch(t){throw new Error(`XML 构建失败: ${t instanceof Error?t.message:"Unknown error"}`)}},kr=n=>Array.isArray(n)?oe(n,{format:!1}):Be(n,{format:!1,showDeclaration:!1}),Nr=(n,e)=>{const t=Xe(n);return Array.isArray(t)?oe(t,{indent:e?.indentBy}):Be(t,e)},oe=(n,e={})=>{const t=e.indent!==void 0?e.indent:" ",s=e.level||0,o=e.format!==!1,l=o?t.repeat(s):"",a=o?`
16
+ `:"";let d="";for(const i of n){if(i["?xml"]){const w=i[":@"]||{},L=Object.entries(w).map(([F,M])=>`${F.startsWith("@_")?F.substring(2):F}="${M}"`).join(" ");d+=`<?xml ${L}?>${a}`;continue}if(i["#comment"]){const w=i["#comment"];if(Array.isArray(w)&&w.length>0){const L=w[0]["#text"]||w[0];d+=`${l}<!--${L}-->${a}`}continue}const c=Object.keys(i).find(w=>!w.startsWith(":")&&!w.startsWith("#")&&!w.startsWith("__"));if(!c)continue;const b=i[c],p=i[":@"]||{},k=Object.entries(p).map(([w,L])=>`${w.startsWith("@_")?w.substring(2):w}="${L}"`).join(" "),E=k?" "+k:"";if(!Array.isArray(b)||b.length===0){d+=`${l}<${c}${E}/>${a}`;continue}const O=b.length===1&&b[0]["#text"]!==void 0;if(b.some(w=>w.__cdata)){const w=b.find(L=>L.__cdata);if(w){const L=w.__cdata[0]["#text"]||"";d+=`${l}<${c}${E}><![CDATA[${L}]]></${c}>${a}`}}else if(O){const w=b[0]["#text"];d+=`${l}<${c}${E}>${w}</${c}>${a}`}else d+=`${l}<${c}${E}>${a}`,d+=oe(b,{indent:t,level:s+1,format:o}),d+=`${l}</${c}>${a}`}return d},wr={key:0,class:"xml-format__toolbar"},Ar={class:"xml-format__actions"},Cr=["disabled"],Br=["disabled"],Tr=["disabled"],vr=["disabled"],Sr=["disabled"],Or={class:"xml-format__info"},$r={key:0,class:"xml-format__status xml-format__status--success"},Pr={key:1,class:"xml-format__status xml-format__status--error"},Vr={class:"xml-format__content"},Ir={key:0,class:"xml-format__error"},Rr={key:1,class:"xml-format__viewer"},Lr=ge(r.defineComponent({__name:"index",props:{modelValue:{default:""},readonly:{type:Boolean,default:!1},maxDepth:{default:10},showToolbar:{type:Boolean,default:!0},theme:{default:"github-light"},showComments:{type:Boolean,default:!0},showCdata:{type:Boolean,default:!0},preserveWhitespace:{type:Boolean,default:!1}},emits:["update:modelValue","copy-success","copy-error","expand-all","collapse-all","compress","format"],setup(n,{expose:e,emit:t}){r.useCssVars(_=>({dafdfa5a:c.value.colors.border,"54718f56":c.value.colors.background,"5e7c5194":c.value.colors.text,"5e337cb4":c.value.colors.surfaceBackground,"9f56e136":c.value.colors.buttonBorder,e203a832:c.value.colors.buttonBackground,"3a8ddaa6":c.value.colors.buttonText,"0e7f0595":c.value.colors.buttonBackgroundHover,"437859e9":c.value.colors.buttonPrimary,cec96e5a:c.value.colors.buttonPrimaryHover,"4a52863c":c.value.colors.success,"6331c6ec":c.value.colors.successBackground,70405281:c.value.colors.error,dfabd2e2:c.value.colors.errorBackground}));const s=n,o=t,l=r.ref(null),a=r.ref(""),d=r.ref(new Set),i=r.computed(()=>a.value===""),c=r.computed(()=>xn(s.theme)),b=r.computed(()=>!l.value||!Array.isArray(l.value)?[]:l.value.map((_,C)=>({node:_,originalIndex:C})).filter(_=>!_.node["?xml"])),p=r.computed(()=>{if(!l.value||!Array.isArray(l.value))return null;const _=l.value.find(A=>A["?xml"]);if(!_||!_[":@"])return null;const C=_[":@"],V=[];return C["@_version"]&&V.push(`version="${C["@_version"]}"`),C["@_encoding"]&&V.push(`encoding="${C["@_encoding"]}"`),C["@_standalone"]&&V.push(`standalone="${C["@_standalone"]}"`),V.length>0?`<?xml ${V.join(" ")}?>`:null}),k=r.computed(()=>b.value),E=_=>{if(!_||!_.trim()){a.value="",l.value=null;return}try{const C=xr(_);if(!C.valid){a.value=C.error||"Invalid XML",l.value=null;return}l.value=Xe(_),a.value="",r.nextTick(()=>{$()})}catch(C){a.value=C instanceof Error?C.message:"Unknown parse error",l.value=null}},O=_=>{d.value.has(_)?d.value.delete(_):d.value.add(_)},$=()=>{const _=new Set,C=(V,A="")=>{Array.isArray(V)&&V.forEach((T,g)=>{const m=Object.keys(T).find(B=>!B.startsWith(":")&&!B.startsWith("#"));if(!m)return;const u=A?`${A}.${m}[${g}]`:`${m}[${g}]`;_.add(u);const y=T[m];Array.isArray(y)&&C(y,u+"."+m)})};b.value.forEach(({node:V,originalIndex:A})=>{const T=Object.keys(V).find(g=>!g.startsWith(":")&&!g.startsWith("#"));if(T){const g=`${T}[${A}]`;_.add(g);const m=V[T];Array.isArray(m)&&C(m,g+"."+T)}}),d.value=_,o("expand-all")},w=()=>{d.value.clear(),o("collapse-all")},L=async()=>{if(!(!i.value||!l.value))try{const _=Array.isArray(l.value)?oe(l.value,{indent:" "}):Be(l.value,{format:!0,indentBy:" "});await navigator.clipboard.writeText(_),o("copy-success",_)}catch(_){const C=_ instanceof Error?_:new Error("Copy failed");o("copy-error",C),console.error("Failed to copy XML:",_)}},F=()=>{if(!(!i.value||!l.value))try{const _=kr(l.value);o("update:modelValue",_),o("compress",_)}catch(_){console.error("Failed to compress XML:",_)}},M=()=>{if(i.value)try{const _=Nr(s.modelValue,{format:!0,indentBy:" "});o("update:modelValue",_),o("format",_)}catch(_){console.error("Failed to format XML:",_)}},z=async _=>{try{const C=typeof _=="string"?_:JSON.stringify(_,null,2);await navigator.clipboard.writeText(C),o("copy-success",C)}catch(C){const V=C instanceof Error?C:new Error("Copy failed");o("copy-error",V),console.error("Failed to copy value:",C)}},ee=(_,C,V)=>{if(!(!l.value||!Array.isArray(l.value)))try{const A=_.split(/\./).filter(Boolean);let T=l.value;for(let m=0;m<A.length;m++){const u=A[m],y=u.match(/^(.+?)\[(\d+)\]$/);if(y){const B=y[1],x=parseInt(y[2]);if(m===A.length-1){if(Array.isArray(T)&&T[x]){const v=T[x];if(v[C]){const S=v[C];delete v[C],v[V]=S}}}else Array.isArray(T)&&T[x]&&(T=T[x])}else T[u]&&(T=T[u])}const g=oe(l.value,{indent:" "});o("update:modelValue",g)}catch(A){console.error("Failed to update tag name:",A)}},G=(_,C,V)=>{if(!(!l.value||!Array.isArray(l.value)))try{const A=_.split(/\./).filter(Boolean);let T=l.value;for(let m=0;m<A.length;m++){const u=A[m],y=u.match(/^(.+?)\[(\d+)\]$/);if(y){const B=y[1],x=parseInt(y[2]);if(m===A.length-1){if(Array.isArray(T)&&T[x]){const S=T[x][":@"];if(S&&S[`@_${C}`]!==void 0){const I=S[`@_${C}`];delete S[`@_${C}`],S[`@_${V}`]=I}}}else Array.isArray(T)&&T[x]&&(T=T[x])}else T[u]&&(T=T[u])}const g=oe(l.value,{indent:" "});o("update:modelValue",g)}catch(A){console.error("Failed to update attribute name:",A)}},Z=(_,C,V)=>{if(!(!l.value||!Array.isArray(l.value)))try{const A=_.split(/\./).filter(Boolean);let T=l.value;for(let m=0;m<A.length;m++){const u=A[m],y=u.match(/^(.+?)\[(\d+)\]$/);if(y){const B=y[1],x=parseInt(y[2]);if(m===A.length-1){if(Array.isArray(T)&&T[x]){const S=T[x][":@"];S&&S[`@_${C}`]!==void 0&&(S[`@_${C}`]=V)}}else Array.isArray(T)&&T[x]&&(T=T[x])}else T[u]&&(T=T[u])}const g=oe(l.value,{indent:" "});o("update:modelValue",g)}catch(A){console.error("Failed to update attribute value:",A)}},J=(_,C)=>{if(!(!l.value||!Array.isArray(l.value)))try{const V=_.split(/\./).filter(Boolean);let A=l.value,T="";for(let m=0;m<V.length;m++){const u=V[m],y=u.match(/^(.+?)\[(\d+)\]$/);if(y){const B=y[1],x=parseInt(y[2]);if(m===V.length-1){if(Array.isArray(A)&&A[x]){const v=A[x];if(T=Object.keys(v).find(S=>!S.startsWith(":")&&!S.startsWith("#"))||"",T&&Array.isArray(v[T])){const S=v[T],I=S.findIndex(U=>U["#text"]!==void 0);I!==-1?S[I]["#text"]=C:S.push({"#text":C})}}}else Array.isArray(A)&&A[x]&&(A=A[x])}else A[u]&&(A=A[u])}const g=oe(l.value,{indent:" "});o("update:modelValue",g)}catch(V){console.error("Failed to update text content:",V)}},te=(_,C)=>{if(!(!l.value||!Array.isArray(l.value)))try{const V=_.split(/\./).filter(Boolean);let A=l.value;for(let g=0;g<V.length;g++){const m=V[g],u=m.match(/^(.+?)\[(\d+)\]$/);if(u){const y=u[1],B=parseInt(u[2]);if(g===V.length-1){if(Array.isArray(A)&&A[B]){const x=A[B],v=Object.keys(x).find(S=>!S.startsWith(":")&&!S.startsWith("#"));if(v&&Array.isArray(x[v])){const S=x[v],I=S.findIndex(U=>U.__cdata!==void 0);if(I!==-1){const U=S[I];Array.isArray(U.__cdata)&&U.__cdata[0]&&(U.__cdata[0]["#text"]=C)}else S.push({__cdata:[{"#text":C}]})}}}else Array.isArray(A)&&A[B]&&(A=A[B])}else A[m]&&(A=A[m])}const T=oe(l.value,{indent:" "});o("update:modelValue",T)}catch(V){console.error("Failed to update CDATA content:",V)}};return r.watch(()=>s.modelValue,_=>{E(_)},{immediate:!0}),e({copyXml:L,compressSource:F,formatSource:M,expandAll:$,collapseAll:w,toggleExpand:O,isValidXml:()=>i.value,getParsedXml:()=>l.value,getExpandedNodes:()=>d.value,getParseError:()=>a.value,parseXmlString:_=>E(_),copyValue:_=>z(_)}),(_,C)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["xml-format",`xml-format--${c.value.name}`])},[_.showToolbar?(r.openBlock(),r.createElementBlock("div",wr,[r.createElementVNode("div",Ar,[r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--primary",onClick:L,disabled:!i.value,title:"Copy XML"}," 📋 Copy ",8,Cr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:$,disabled:!i.value,title:"Expand All"}," ⬇️ Expand All ",8,Br),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:w,disabled:!i.value,title:"Collapse All"}," ➡️ Collapse All ",8,Tr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:F,disabled:!i.value,title:"Compress XML"}," 📦 Compress ",8,vr),r.createElementVNode("button",{class:"xml-format__btn xml-format__btn--secondary",onClick:M,disabled:!i.value,title:"Format XML"}," ✨ Format ",8,Sr)]),r.createElementVNode("div",Or,[i.value?(r.openBlock(),r.createElementBlock("span",$r," ✅ Valid XML ")):(r.openBlock(),r.createElementBlock("span",Pr," ❌ Invalid XML "))])])):r.createCommentVNode("",!0),r.createElementVNode("div",Vr,[i.value?(r.openBlock(),r.createElementBlock("div",Rr,[p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"xml-declaration",style:r.normalizeStyle({color:c.value.colors.xmlDeclaration})},r.toDisplayString(p.value),5)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,(V,A)=>(r.openBlock(),r.createBlock(_n,{key:A,node:V.node,index:V.originalIndex,level:0,expanded:d.value,theme:c.value,onToggleExpand:O,onCopy:z,"onUpdate:tagName":ee,"onUpdate:attributeName":G,"onUpdate:attributeValue":Z,"onUpdate:textContent":J,"onUpdate:cdataContent":te},null,8,["node","index","expanded","theme"]))),128))])):(r.openBlock(),r.createElementBlock("div",Ir,[C[0]||(C[0]=r.createElementVNode("h4",null,"XML Parse Error:",-1)),r.createElementVNode("pre",null,r.toDisplayString(a.value),1)]))])],2))}}),[["__scopeId","data-v-078198c5"]]),Mr=[Se],Kr={install:n=>{Mr.forEach(e=>{const t=e.name||e.__name||"UnknownComponent";n.component(t,e)})}};ne.JsonFormat=Se,ne.XmlFormat=Lr,ne.default=Kr,Object.defineProperties(ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});