import{e as Ye,g as Ge,f as Ie,j}from"./app-BBZbvTSO.js";import Ze from"./FieldBase-C0gzKbbb.js";import{B as Je}from"./button-CZmOQP7j.js";import{C as Ve}from"./code-aABRHl_L.js";import{C as Xe}from"./check-yuW7wFtQ.js";import{C as Qe}from"./circle-alert-bp8tLLkJ.js";/* empty css            */import"./label-BPDCCRHl.js";import"./index-13DH8-b5.js";import"./utils-YhN_nlHn.js";import"./input-error-Bz7f2c6i.js";var D={},Pe;function et(){if(Pe)return D;Pe=1;var m=D&&D.__assign||function(){return m=Object.assign||function(a){for(var e,s=1,c=arguments.length;s<c;s++){e=arguments[s];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(a[l]=e[l])}return a},m.apply(this,arguments)},q=D&&D.__createBinding||(Object.create?function(a,e,s,c){c===void 0&&(c=s);var l=Object.getOwnPropertyDescriptor(e,s);(!l||("get"in l?!e.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(a,c,l)}:function(a,e,s,c){c===void 0&&(c=s),a[c]=e[s]}),u=D&&D.__setModuleDefault||(Object.create?function(a,e){Object.defineProperty(a,"default",{enumerable:!0,value:e})}:function(a,e){a.default=e}),f=D&&D.__importStar||function(a){if(a&&a.__esModule)return a;var e={};if(a!=null)for(var s in a)s!=="default"&&Object.prototype.hasOwnProperty.call(a,s)&&q(e,a,s);return u(e,a),e},w=D&&D.__rest||function(a,e){var s={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&e.indexOf(c)<0&&(s[c]=a[c]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,c=Object.getOwnPropertySymbols(a);l<c.length;l++)e.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(a,c[l])&&(s[c[l]]=a[c[l]]);return s};Object.defineProperty(D,"__esModule",{value:!0});var v=f(Ye()),$=89,o=90,F=77,I=57,_=219,z=222,R=192,Z=100,J=3e3,S=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),h=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),b="npm__react-simple-code-editor__textarea",n=`
/**
 * Reset the text fill color so that placeholder is visible
 */
.`.concat(b,`:empty {
  -webkit-text-fill-color: inherit !important;
}

/**
 * Hack to apply on some CSS on IE10 and IE11
 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /**
    * IE doesn't support '-webkit-text-fill-color'
    * So we use 'color: transparent' to make the text transparent on IE
    * Unlike other browsers, it doesn't affect caret color in IE
    */
  .`).concat(b,` {
    color: transparent !important;
  }

  .`).concat(b,`::selection {
    background-color: #accef7 !important;
    color: transparent !important;
  }
}
`),t=v.forwardRef(function(e,s){var c=e.autoFocus,l=e.disabled,y=e.form,k=e.highlight,L=e.ignoreTabKey,ge=L===void 0?!1:L,ne=e.insertSpaces,ye=ne===void 0?!0:ne,be=e.maxLength,de=e.minLength,A=e.name,M=e.onBlur,W=e.onClick,V=e.onFocus,T=e.onKeyDown,xe=e.onKeyUp,P=e.onValueChange,U=e.padding,C=U===void 0?0:U,X=e.placeholder,ae=e.preClassName,fe=e.readOnly,re=e.required,Q=e.style,he=e.tabSize,ie=he===void 0?2:he,ke=e.textareaClassName,ze=e.textareaId,Ae=e.value,Le=w(e,["autoFocus","disabled","form","highlight","ignoreTabKey","insertSpaces","maxLength","minLength","name","onBlur","onClick","onFocus","onKeyDown","onKeyUp","onValueChange","padding","placeholder","preClassName","readOnly","required","style","tabSize","textareaClassName","textareaId","value"]),x=v.useRef({stack:[],offset:-1}),pe=v.useRef(null),Ce=v.useState(!0),Ne=Ce[0],Re=Ce[1],_e={paddingTop:typeof C=="object"?C.top:C,paddingRight:typeof C=="object"?C.right:C,paddingBottom:typeof C=="object"?C.bottom:C,paddingLeft:typeof C=="object"?C.left:C},we=k(Ae),G=function(i,p){return i.substring(0,p).split(`
`)},ve=v.useCallback(function(i,p){var g,d,E;p===void 0&&(p=!1);var O=x.current,B=O.stack,se=O.offset;if(B.length&&se>-1){x.current.stack=B.slice(0,se+1);var le=x.current.stack.length;if(le>Z){var te=le-Z;x.current.stack=B.slice(te,le),x.current.offset=Math.max(x.current.offset-te,0)}}var N=Date.now();if(p){var Y=x.current.stack[x.current.offset];if(Y&&N-Y.timestamp<J){var oe=/[^a-z0-9]([a-z0-9]+)$/i,K=(g=G(Y.value,Y.selectionStart).pop())===null||g===void 0?void 0:g.match(oe),ue=(d=G(i.value,i.selectionStart).pop())===null||d===void 0?void 0:d.match(oe);if(K!=null&&K[1]&&(!((E=ue==null?void 0:ue[1])===null||E===void 0)&&E.startsWith(K[1]))){x.current.stack[x.current.offset]=m(m({},i),{timestamp:N});return}}}x.current.stack.push(m(m({},i),{timestamp:N})),x.current.offset++},[]),Oe=v.useCallback(function(){var i=pe.current;if(i){var p=i.value,g=i.selectionStart,d=i.selectionEnd;ve({value:p,selectionStart:g,selectionEnd:d})}},[ve]),Fe=function(i){var p=pe.current;p&&(p.value=i.value,p.selectionStart=i.selectionStart,p.selectionEnd=i.selectionEnd,P==null||P(i.value))},ee=function(i){var p=pe.current,g=x.current.stack[x.current.offset];g&&p&&(x.current.stack[x.current.offset]=m(m({},g),{selectionStart:p.selectionStart,selectionEnd:p.selectionEnd})),ve(i),Fe(i)},Be=function(){var i=x.current,p=i.stack,g=i.offset,d=p[g-1];d&&(Fe(d),x.current.offset=Math.max(g-1,0))},He=function(){var i=x.current,p=i.stack,g=i.offset,d=p[g+1];d&&(Fe(d),x.current.offset=Math.min(g+1,p.length-1))},qe=function(i){if(!(T&&(T(i),i.defaultPrevented))){i.key==="Escape"&&i.currentTarget.blur();var p=i.currentTarget,g=p.value,d=p.selectionStart,E=p.selectionEnd,O=(ye?" ":"	").repeat(ie);if(i.key==="Tab"&&!ge&&Ne)if(i.preventDefault(),i.shiftKey){var B=G(g,d),se=B.length-1,le=G(g,E).length-1,te=g.split(`
`).map(function(ce,$e){return $e>=se&&$e<=le&&ce.startsWith(O)?ce.substring(O.length):ce}).join(`
`);if(g!==te){var N=B[se];ee({value:te,selectionStart:N!=null&&N.startsWith(O)?d-O.length:d,selectionEnd:E-(g.length-te.length)})}}else if(d!==E){var B=G(g,d),Y=B.length-1,oe=G(g,E).length-1,N=B[Y];ee({value:g.split(`
`).map(function(Te,De){return De>=Y&&De<=oe?O+Te:Te}).join(`
`),selectionStart:N&&/\S/.test(N)?d+O.length:d,selectionEnd:E+O.length*(oe-Y+1)})}else{var K=d+O.length;ee({value:g.substring(0,d)+O+g.substring(E),selectionStart:K,selectionEnd:K})}else if(i.key==="Backspace"){var ue=d!==E,Ue=g.substring(0,d);if(Ue.endsWith(O)&&!ue){i.preventDefault();var K=d-O.length;ee({value:g.substring(0,d-O.length)+g.substring(E),selectionStart:K,selectionEnd:K})}}else if(i.key==="Enter"){if(d===E){var Se=G(g,d).pop(),me=Se==null?void 0:Se.match(/^\s+/);if(me!=null&&me[0]){i.preventDefault();var je=`
`+me[0],K=d+je.length;ee({value:g.substring(0,d)+je+g.substring(E),selectionStart:K,selectionEnd:K})}}}else if(i.keyCode===I||i.keyCode===_||i.keyCode===z||i.keyCode===R){var H=void 0;i.keyCode===I&&i.shiftKey?H=["(",")"]:i.keyCode===_?i.shiftKey?H=["{","}"]:H=["[","]"]:i.keyCode===z?i.shiftKey?H=['"','"']:H=["'","'"]:i.keyCode===R&&!i.shiftKey&&(H=["`","`"]),d!==E&&H&&(i.preventDefault(),ee({value:g.substring(0,d)+H[0]+g.substring(d,E)+H[1]+g.substring(E),selectionStart:d,selectionEnd:E+2}))}else(h?i.metaKey&&i.keyCode===o:i.ctrlKey&&i.keyCode===o)&&!i.shiftKey&&!i.altKey?(i.preventDefault(),Be()):(h?i.metaKey&&i.keyCode===o&&i.shiftKey:S?i.ctrlKey&&i.keyCode===$:i.ctrlKey&&i.keyCode===o&&i.shiftKey)&&!i.altKey?(i.preventDefault(),He()):i.keyCode===F&&i.ctrlKey&&(!h||i.shiftKey)&&(i.preventDefault(),Re(function(ce){return!ce}))}},We=function(i){var p=i.currentTarget,g=p.value,d=p.selectionStart,E=p.selectionEnd;ve({value:g,selectionStart:d,selectionEnd:E},!0),P(g)};return v.useEffect(function(){Oe()},[Oe]),v.useImperativeHandle(s,function(){return{get session(){return{history:x.current}},set session(i){x.current=i.history}}},[]),v.createElement("div",m({},Le,{style:m(m({},r.container),Q)}),v.createElement("pre",m({className:ae,"aria-hidden":"true",style:m(m(m({},r.editor),r.highlight),_e)},typeof we=="string"?{dangerouslySetInnerHTML:{__html:we+"<br />"}}:{children:we})),v.createElement("textarea",{ref:function(i){return pe.current=i},style:m(m(m({},r.editor),r.textarea),_e),className:b+(ke?" ".concat(ke):""),id:ze,value:Ae,onChange:We,onKeyDown:qe,onClick:W,onKeyUp:xe,onFocus:V,onBlur:M,disabled:l,form:y,maxLength:be,minLength:de,name:A,placeholder:X,readOnly:fe,required:re,autoFocus:c,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),v.createElement("style",{dangerouslySetInnerHTML:{__html:n}}))}),r={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}};return D.default=t,D}var tt=et();const nt=Ge(tt);var Ee={exports:{}},Ke;function at(){return Ke||(Ke=1,function(m){var q=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
 * Prism: Lightweight, robust, elegant syntax highlighting
 *
 * @license MIT <https://opensource.org/licenses/MIT>
 * @author Lea Verou <https://lea.verou.me>
 * @namespace
 * @public
 */var u=function(f){var w=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,v=0,$={},o={manual:f.Prism&&f.Prism.manual,disableWorkerMessageHandler:f.Prism&&f.Prism.disableWorkerMessageHandler,util:{encode:function n(t){return t instanceof F?new F(t.type,n(t.content),t.alias):Array.isArray(t)?t.map(n):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(n){return Object.prototype.toString.call(n).slice(8,-1)},objId:function(n){return n.__id||Object.defineProperty(n,"__id",{value:++v}),n.__id},clone:function n(t,r){r=r||{};var a,e;switch(o.util.type(t)){case"Object":if(e=o.util.objId(t),r[e])return r[e];a={},r[e]=a;for(var s in t)t.hasOwnProperty(s)&&(a[s]=n(t[s],r));return a;case"Array":return e=o.util.objId(t),r[e]?r[e]:(a=[],r[e]=a,t.forEach(function(c,l){a[l]=n(c,r)}),a);default:return t}},getLanguage:function(n){for(;n;){var t=w.exec(n.className);if(t)return t[1].toLowerCase();n=n.parentElement}return"none"},setLanguage:function(n,t){n.className=n.className.replace(RegExp(w,"gi"),""),n.classList.add("language-"+t)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(a){var n=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack)||[])[1];if(n){var t=document.getElementsByTagName("script");for(var r in t)if(t[r].src==n)return t[r]}return null}},isActive:function(n,t,r){for(var a="no-"+t;n;){var e=n.classList;if(e.contains(t))return!0;if(e.contains(a))return!1;n=n.parentElement}return!!r}},languages:{plain:$,plaintext:$,text:$,txt:$,extend:function(n,t){var r=o.util.clone(o.languages[n]);for(var a in t)r[a]=t[a];return r},insertBefore:function(n,t,r,a){a=a||o.languages;var e=a[n],s={};for(var c in e)if(e.hasOwnProperty(c)){if(c==t)for(var l in r)r.hasOwnProperty(l)&&(s[l]=r[l]);r.hasOwnProperty(c)||(s[c]=e[c])}var y=a[n];return a[n]=s,o.languages.DFS(o.languages,function(k,L){L===y&&k!=n&&(this[k]=s)}),s},DFS:function n(t,r,a,e){e=e||{};var s=o.util.objId;for(var c in t)if(t.hasOwnProperty(c)){r.call(t,c,t[c],a||c);var l=t[c],y=o.util.type(l);y==="Object"&&!e[s(l)]?(e[s(l)]=!0,n(l,r,null,e)):y==="Array"&&!e[s(l)]&&(e[s(l)]=!0,n(l,r,c,e))}}},plugins:{},highlightAll:function(n,t){o.highlightAllUnder(document,n,t)},highlightAllUnder:function(n,t,r){var a={callback:r,container:n,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",a),a.elements=Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)),o.hooks.run("before-all-elements-highlight",a);for(var e=0,s;s=a.elements[e++];)o.highlightElement(s,t===!0,a.callback)},highlightElement:function(n,t,r){var a=o.util.getLanguage(n),e=o.languages[a];o.util.setLanguage(n,a);var s=n.parentElement;s&&s.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(s,a);var c=n.textContent,l={element:n,language:a,grammar:e,code:c};function y(L){l.highlightedCode=L,o.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,o.hooks.run("after-highlight",l),o.hooks.run("complete",l),r&&r.call(l.element)}if(o.hooks.run("before-sanity-check",l),s=l.element.parentElement,s&&s.nodeName.toLowerCase()==="pre"&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!l.code){o.hooks.run("complete",l),r&&r.call(l.element);return}if(o.hooks.run("before-highlight",l),!l.grammar){y(o.util.encode(l.code));return}if(t&&f.Worker){var k=new Worker(o.filename);k.onmessage=function(L){y(L.data)},k.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else y(o.highlight(l.code,l.grammar,l.language))},highlight:function(n,t,r){var a={code:n,grammar:t,language:r};if(o.hooks.run("before-tokenize",a),!a.grammar)throw new Error('The language "'+a.language+'" has no grammar.');return a.tokens=o.tokenize(a.code,a.grammar),o.hooks.run("after-tokenize",a),F.stringify(o.util.encode(a.tokens),a.language)},tokenize:function(n,t){var r=t.rest;if(r){for(var a in r)t[a]=r[a];delete t.rest}var e=new z;return R(e,e.head,n),_(n,e,t,e.head,0),J(e)},hooks:{all:{},add:function(n,t){var r=o.hooks.all;r[n]=r[n]||[],r[n].push(t)},run:function(n,t){var r=o.hooks.all[n];if(!(!r||!r.length))for(var a=0,e;e=r[a++];)e(t)}},Token:F};f.Prism=o;function F(n,t,r,a){this.type=n,this.content=t,this.alias=r,this.length=(a||"").length|0}F.stringify=function n(t,r){if(typeof t=="string")return t;if(Array.isArray(t)){var a="";return t.forEach(function(y){a+=n(y,r)}),a}var e={type:t.type,content:n(t.content,r),tag:"span",classes:["token",t.type],attributes:{},language:r},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(e.classes,s):e.classes.push(s)),o.hooks.run("wrap",e);var c="";for(var l in e.attributes)c+=" "+l+'="'+(e.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+e.tag+' class="'+e.classes.join(" ")+'"'+c+">"+e.content+"</"+e.tag+">"};function I(n,t,r,a){n.lastIndex=t;var e=n.exec(r);if(e&&a&&e[1]){var s=e[1].length;e.index+=s,e[0]=e[0].slice(s)}return e}function _(n,t,r,a,e,s){for(var c in r)if(!(!r.hasOwnProperty(c)||!r[c])){var l=r[c];l=Array.isArray(l)?l:[l];for(var y=0;y<l.length;++y){if(s&&s.cause==c+","+y)return;var k=l[y],L=k.inside,ge=!!k.lookbehind,ne=!!k.greedy,ye=k.alias;if(ne&&!k.pattern.global){var be=k.pattern.toString().match(/[imsuy]*$/)[0];k.pattern=RegExp(k.pattern.source,be+"g")}for(var de=k.pattern||k,A=a.next,M=e;A!==t.tail&&!(s&&M>=s.reach);M+=A.value.length,A=A.next){var W=A.value;if(t.length>n.length)return;if(!(W instanceof F)){var V=1,T;if(ne){if(T=I(de,M,n,ge),!T||T.index>=n.length)break;var C=T.index,xe=T.index+T[0].length,P=M;for(P+=A.value.length;C>=P;)A=A.next,P+=A.value.length;if(P-=A.value.length,M=P,A.value instanceof F)continue;for(var U=A;U!==t.tail&&(P<xe||typeof U.value=="string");U=U.next)V++,P+=U.value.length;V--,W=n.slice(M,P),T.index-=M}else if(T=I(de,0,W,ge),!T)continue;var C=T.index,X=T[0],ae=W.slice(0,C),fe=W.slice(C+X.length),re=M+W.length;s&&re>s.reach&&(s.reach=re);var Q=A.prev;ae&&(Q=R(t,Q,ae),M+=ae.length),Z(t,Q,V);var he=new F(c,L?o.tokenize(X,L):X,ye,X);if(A=R(t,Q,he),fe&&R(t,A,fe),V>1){var ie={cause:c+","+y,reach:re};_(n,t,r,A.prev,M,ie),s&&ie.reach>s.reach&&(s.reach=ie.reach)}}}}}}function z(){var n={value:null,prev:null,next:null},t={value:null,prev:n,next:null};n.next=t,this.head=n,this.tail=t,this.length=0}function R(n,t,r){var a=t.next,e={value:r,prev:t,next:a};return t.next=e,a.prev=e,n.length++,e}function Z(n,t,r){for(var a=t.next,e=0;e<r&&a!==n.tail;e++)a=a.next;t.next=a,a.prev=t,n.length-=e}function J(n){for(var t=[],r=n.head.next;r!==n.tail;)t.push(r.value),r=r.next;return t}if(!f.document)return f.addEventListener&&(o.disableWorkerMessageHandler||f.addEventListener("message",function(n){var t=JSON.parse(n.data),r=t.language,a=t.code,e=t.immediateClose;f.postMessage(o.highlight(a,o.languages[r],r)),e&&f.close()},!1)),o;var S=o.util.currentScript();S&&(o.filename=S.src,S.hasAttribute("data-manual")&&(o.manual=!0));function h(){o.manual||o.highlightAll()}if(!o.manual){var b=document.readyState;b==="loading"||b==="interactive"&&S&&S.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return o}(q);m.exports&&(m.exports=u),typeof Ie<"u"&&(Ie.Prism=u),u.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},u.languages.markup.tag.inside["attr-value"].inside.entity=u.languages.markup.entity,u.languages.markup.doctype.inside["internal-subset"].inside=u.languages.markup,u.hooks.add("wrap",function(f){f.type==="entity"&&(f.attributes.title=f.content.replace(/&amp;/,"&"))}),Object.defineProperty(u.languages.markup.tag,"addInlined",{value:function(w,v){var $={};$["language-"+v]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:u.languages[v]},$.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:$}};o["language-"+v]={pattern:/[\s\S]+/,inside:u.languages[v]};var F={};F[w]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return w}),"i"),lookbehind:!0,greedy:!0,inside:o},u.languages.insertBefore("markup","cdata",F)}}),Object.defineProperty(u.languages.markup.tag,"addAttribute",{value:function(f,w){u.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+f+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[w,"language-"+w],inside:u.languages[w]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),u.languages.html=u.languages.markup,u.languages.mathml=u.languages.markup,u.languages.svg=u.languages.markup,u.languages.xml=u.languages.extend("markup",{}),u.languages.ssml=u.languages.xml,u.languages.atom=u.languages.xml,u.languages.rss=u.languages.xml,function(f){var w=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;f.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+w.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+w.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+w.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+w.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:w,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},f.languages.css.atrule.inside.rest=f.languages.css;var v=f.languages.markup;v&&(v.tag.addInlined("style","css"),v.tag.addAttribute("style","css"))}(u),u.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},u.languages.javascript=u.languages.extend("clike",{"class-name":[u.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),u.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,u.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:u.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:u.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:u.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:u.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:u.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),u.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:u.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),u.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),u.languages.markup&&(u.languages.markup.tag.addInlined("script","javascript"),u.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),u.languages.js=u.languages.javascript,function(){if(typeof u>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var f="Loading…",w=function(S,h){return"✖ Error "+S+" while fetching file: "+h},v="✖ Error: File does not exist or is empty",$={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},o="data-src-status",F="loading",I="loaded",_="failed",z="pre[data-src]:not(["+o+'="'+I+'"]):not(['+o+'="'+F+'"])';function R(S,h,b){var n=new XMLHttpRequest;n.open("GET",S,!0),n.onreadystatechange=function(){n.readyState==4&&(n.status<400&&n.responseText?h(n.responseText):n.status>=400?b(w(n.status,n.statusText)):b(v))},n.send(null)}function Z(S){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(S||"");if(h){var b=Number(h[1]),n=h[2],t=h[3];return n?t?[b,Number(t)]:[b,void 0]:[b,b]}}u.hooks.add("before-highlightall",function(S){S.selector+=", "+z}),u.hooks.add("before-sanity-check",function(S){var h=S.element;if(h.matches(z)){S.code="",h.setAttribute(o,F);var b=h.appendChild(document.createElement("CODE"));b.textContent=f;var n=h.getAttribute("data-src"),t=S.language;if(t==="none"){var r=(/\.(\w+)$/.exec(n)||[,"none"])[1];t=$[r]||r}u.util.setLanguage(b,t),u.util.setLanguage(h,t);var a=u.plugins.autoloader;a&&a.loadLanguages(t),R(n,function(e){h.setAttribute(o,I);var s=Z(h.getAttribute("data-range"));if(s){var c=e.split(/\r\n?|\n/g),l=s[0],y=s[1]==null?c.length:s[1];l<0&&(l+=c.length),l=Math.max(0,Math.min(l-1,c.length)),y<0&&(y+=c.length),y=Math.max(0,Math.min(y,c.length)),e=c.slice(l,y).join(`
`),h.hasAttribute("data-start")||h.setAttribute("data-start",String(l+1))}b.textContent=e,u.highlightElement(b)},function(e){h.setAttribute(o,_),b.textContent=e})}}),u.plugins.fileHighlight={highlight:function(h){for(var b=(h||document).querySelectorAll(z),n=0,t;t=b[n++];)u.highlightElement(t)}};var J=!1;u.fileHighlight=function(){J||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),J=!0),u.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(Ee)),Ee.exports}var Me=at();Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;function pt({field:m,value:q,onChange:u,processing:f,errors:w}){const v=_=>{try{return _===""||JSON.parse(_),!0}catch{return!1}},$=()=>{u(m,`{
  
}`)},o=typeof q=="object"&&q!==null?JSON.stringify(q,null,2):q||"",F=v(o),I=!o||o==="";return j.jsx(Ze,{field:m,value:o,onChange:u,processing:f,errors:w,children:j.jsxs("div",{className:"space-y-2",children:[j.jsxs("div",{className:`border rounded-md overflow-hidden focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 
                    ${!F&&!I?"border-red-500":"border-input"}`,children:[j.jsxs("div",{className:"flex items-center justify-between bg-muted py-1 px-3 border-b",children:[j.jsxs("div",{className:"flex items-center",children:[j.jsx(Ve,{className:"h-4 w-4 mr-2 text-muted-foreground"}),j.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"JSON Editor"})]}),j.jsxs("div",{className:"flex items-center",children:[F&&!I&&j.jsxs("span",{className:"flex items-center text-xs text-green-500 mr-2",children:[j.jsx(Xe,{className:"h-3 w-3 mr-1"})," Valid JSON"]}),!F&&!I&&j.jsxs("span",{className:"flex items-center text-xs text-red-500 mr-2",children:[j.jsx(Qe,{className:"h-3 w-3 mr-1"})," Invalid JSON"]})]})]}),j.jsx(nt,{value:o,onValueChange:_=>u(m,_),highlight:_=>{const z=typeof _=="string"?_:String(_||"");return Me.highlight(z,Me.languages.json,"json")},padding:12,disabled:f,placeholder:m.placeholder||`{
  "key": "value"
}`,style:{fontFamily:'"Fira code", "Fira Mono", monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New"',fontSize:14,minHeight:"200px"},className:"min-h-[200px]"})]}),j.jsx("div",{className:"flex gap-2",children:I&&j.jsx(Je,{type:"button",onClick:$,variant:"outline",size:"sm",disabled:f,className:"text-xs",children:"Initialize Empty Object"})})]})})}export{pt as default};
