@neuralnomads/codenomad-dev 0.17.0-dev-20260608-ff10c1f3 → 0.17.1-dev-20260609-4a1d53bf

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.
Files changed (51) hide show
  1. package/dist/opencode-plugin/codenomad-opencode-plugin.tgz +0 -0
  2. package/package.json +1 -1
  3. package/public/assets/FilesTab-DDESrDrf.js +2 -0
  4. package/public/assets/GitChangesTab-BifTzULp.js +2 -0
  5. package/public/assets/{SplitFilePanel-DqxwMIe0.js → SplitFilePanel-BvSm0I4E.js} +1 -1
  6. package/public/assets/StatusTab-DpBnkHf3.js +1 -0
  7. package/public/assets/{align-justify-Dxvk4j0i.js → align-justify-Jh2pybfY.js} +1 -1
  8. package/public/assets/{bundle-full-D4mYh8t-.js → bundle-full-BVDA-a9Y.js} +2 -2
  9. package/public/assets/{diff-viewer-Dc4-Qlfy.js → diff-viewer-jlGVU3xf.js} +1 -1
  10. package/public/assets/{index-rOdMpwo6.css → index-B0riy-pu.css} +1 -1
  11. package/public/assets/index-BuHiIHOm.js +1 -0
  12. package/public/assets/index-C2Yiwzsc.js +1 -0
  13. package/public/assets/index-CZWS7SgB.js +1 -0
  14. package/public/assets/index-ChHJ_fkf.js +1 -0
  15. package/public/assets/index-DAlMX-U1.js +1 -0
  16. package/public/assets/index-DTmbg1an.js +1 -0
  17. package/public/assets/index-Ddsv8Uc0.js +1 -0
  18. package/public/assets/index-DnCBfFB3.js +1 -0
  19. package/public/assets/index-Dr3wNfb7.js +1 -0
  20. package/public/assets/index-DrJRCi0h.js +2 -0
  21. package/public/assets/index-J42KjtrP.js +1 -0
  22. package/public/assets/{loading-Cs2YiY8R.js → loading-4zKXtAet.js} +1 -1
  23. package/public/assets/main-BVWmUtQs.js +65 -0
  24. package/public/assets/{markdown-B2oEpKDv.js → markdown-a4rx162g.js} +3 -3
  25. package/public/assets/monaco-viewer-BFNhPQX7.js +26 -0
  26. package/public/assets/tool-call-DrVyw1PW.js +59 -0
  27. package/public/assets/{unified-picker-ccHSjvP1.js → unified-picker-GaCghQ1X.js} +1 -1
  28. package/public/assets/{wrap-text-B0kJ9Vff.js → wrap-text-Bpq-sgm2.js} +1 -1
  29. package/public/index.html +4 -4
  30. package/public/loading.html +4 -4
  31. package/public/sw.js +1 -1
  32. package/public/ui-version.json +1 -1
  33. package/public/assets/ChangesTab-BIh4_omv.js +0 -2
  34. package/public/assets/DiffToolbar-D5VJHBTG.js +0 -1
  35. package/public/assets/FilesTab-C-n54Sb9.js +0 -2
  36. package/public/assets/GitChangesTab-CZKmWbZm.js +0 -2
  37. package/public/assets/StatusTab-DPEERsjK.js +0 -1
  38. package/public/assets/index-BABoBC9z.js +0 -1
  39. package/public/assets/index-BOSM8vHG.js +0 -1
  40. package/public/assets/index-BojPpsvR.js +0 -1
  41. package/public/assets/index-BukIsQdK.js +0 -2
  42. package/public/assets/index-C67fezMm.js +0 -1
  43. package/public/assets/index-D0ddGssx.js +0 -1
  44. package/public/assets/index-DPOLN9hi.js +0 -1
  45. package/public/assets/index-R6xj13wr.js +0 -1
  46. package/public/assets/index-dnW0si-t.js +0 -1
  47. package/public/assets/index-vdSY4LFo.js +0 -1
  48. package/public/assets/index-xmIKK5uD.js +0 -1
  49. package/public/assets/main-CubPCiKs.js +0 -65
  50. package/public/assets/monaco-viewer-CavxO_DD.js +0 -26
  51. package/public/assets/tool-call-B4kil3h0.js +0 -59
@@ -1,26 +0,0 @@
1
- var no=Object.defineProperty;var ro=(e,t,n)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var st=(e,t,n)=>ro(e,typeof t!="symbol"?t+"":t,n);import{c as L,a as le,u as Ge,s as $t,b as W,r as oo,d as T,e as Gn,o as ue,g as yn,f as P,$ as U,h as Ae,i as mt,j as Je,k as Re,l as Ye,m as Jn,n as de,p as so,q as io,t as At,v as ao,S as co}from"./git-diff-vendor-CSgooKT_.js";import{g as lo}from"./fast-diff-vendor-DgdwVvTQ.js";const uo=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],fo=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...uo]),go=new Set(["innerHTML","textContent","innerText","children"]),ho=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),mo=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function po(e,t){const n=mo[e];return typeof n=="object"?n[t]?n.$:void 0:n}const yo=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),qn=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),bo={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},wo=e=>L(()=>e());function Co(e,t,n){let r=n.length,o=t.length,s=r,i=0,a=0,c=t[o-1].nextSibling,u=null;for(;i<o||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===i){const l=s<r?a?n[a-1].nextSibling:n[s-a]:c;for(;a<s;)e.insertBefore(n[a++],l)}else if(s===a)for(;i<o;)(!u||!u.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[s-1]&&n[a]===t[o-1]){const l=t[--o].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--s],l),t[o]=n[s]}else{if(!u){u=new Map;let d=a;for(;d<s;)u.set(n[d],d++)}const l=u.get(t[i]);if(l!=null)if(a<l&&l<s){let d=i,g=1,p;for(;++d<o&&d<s&&!((p=u.get(t[d]))==null||p!==l+g);)g++;if(g>l-a){const y=t[i];for(;a<l;)e.insertBefore(n[a++],y)}else e.replaceChild(n[a++],t[i++])}else i++;else t[i++].remove()}}}const bn="_$DX_DELEGATE";function jc(e,t,n,r={}){let o;return Gn(s=>{o=s,t===document?e():pt(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function sn(e,t,n,r){let o;const s=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=e,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},i=t?()=>Ge(()=>document.importNode(o||(o=s()),!0)):()=>(o||(o=s())).cloneNode(!0);return i.cloneNode=i,i}function Xn(e,t=window.document){const n=t[bn]||(t[bn]=new Set);for(let r=0,o=e.length;r<o;r++){const s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,To))}}function qe(e,t,n){Ce(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function So(e,t,n,r){Ce(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function xo(e,t,n){Ce(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function vo(e,t){Ce(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Oo(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function ko(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let s,i;for(s=0,i=o.length;s<i;s++){const a=o[s];!a||a==="undefined"||t[a]||(Cn(e,a,!1),delete n[a])}for(s=0,i=r.length;s<i;s++){const a=r[s],c=!!t[a];!a||a==="undefined"||n[a]===c||!c||(Cn(e,a,!0),n[a]=c)}return n}function $o(e,t,n){if(!t)return n?qe(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function wn(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function Yn(e,t={},n,r){const o={};return r||le(()=>o.children=Xe(e,t.children,o.children)),le(()=>typeof t.ref=="function"&&an(t.ref,e)),le(()=>Ao(e,t,n,!0,o,!0)),o}function an(e,t,n){return Ge(()=>e(t,n))}function pt(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Xe(e,t,r,n);le(o=>Xe(e,t(),o,n),r)}function Ao(e,t,n,r,o={},s=!1){t||(t={});for(const i in o)if(!(i in t)){if(i==="children")continue;o[i]=Sn(e,i,null,o[i],n,s,t)}for(const i in t){if(i==="children")continue;const a=t[i];o[i]=Sn(e,i,a,o[i],n,s,t)}}function Zn(e){let t,n;return!Ce()||!(t=P.registry.get(n=Mo()))?e():(P.completed&&P.completed.add(t),P.registry.delete(n),t)}function Ce(e){return!!P.context&&!P.done&&(!e||e.isConnected)}function Eo(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Cn(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,s=r.length;o<s;o++)e.classList.toggle(r[o],n)}function Sn(e,t,n,r,o,s,i){let a,c,u,l,d;if(t==="style")return $o(e,n,r);if(t==="classList")return ko(e,n,r);if(n===r)return r;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);r&&e.removeEventListener(g,r,typeof r!="function"&&r),n&&e.addEventListener(g,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);r&&e.removeEventListener(g,r,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),p=yo.has(g);if(!p&&r){const y=Array.isArray(r)?r[0]:r;e.removeEventListener(g,y)}(p||n)&&(Oo(e,g,n,p),p&&Xn([g]))}else if(t.slice(0,5)==="attr:")qe(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")xo(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(u=go.has(t))||!o&&((l=po(t,e.tagName))||(c=fo.has(t)))||(a=e.nodeName.includes("-")||"is"in i)){if(d)t=t.slice(5),c=!0;else if(Ce(e))return n;t==="class"||t==="className"?vo(e,n):a&&!c&&!u?e[Eo(t)]=n:e[l||t]=n}else{const g=o&&t.indexOf(":")>-1&&bo[t.split(":")[0]];g?So(e,g,t,n):qe(e,ho[t]||t,n)}return n}function To(e){if(P.registry&&P.events&&P.events.find(([c,u])=>u===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),i=()=>{const c=t[n];if(c&&!t.disabled){const u=t[`${n}Data`];if(u!==void 0?c.call(t,u,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},a=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),P.registry&&!P.done&&(P.done=_$HY.done=!0),e.composedPath){const c=e.composedPath();s(c[0]);for(let u=0;u<c.length-2&&(t=c[u],!!i());u++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();s(r)}function Xe(e,t,n,r,o){const s=Ce(e);if(s){!n&&(n=[...e.childNodes]);let c=[];for(let u=0;u<n.length;u++){const l=n[u];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():c.push(l)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(s||i==="number"&&(t=t.toString(),t===n))return n;if(a){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=ve(e,n,r,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(s)return n;n=ve(e,n,r)}else{if(i==="function")return le(()=>{let c=t();for(;typeof c=="function";)c=c();n=Xe(e,c,n,r)}),()=>n;if(Array.isArray(t)){const c=[],u=n&&Array.isArray(n);if(Kt(c,t,n,o))return le(()=>n=Xe(e,c,n,r,!0)),()=>n;if(s){if(!c.length)return n;if(r===void 0)return n=[...e.childNodes];let l=c[0];if(l.parentNode!==e)return n;const d=[l];for(;(l=l.nextSibling)!==r;)d.push(l);return n=d}if(c.length===0){if(n=ve(e,n,r),a)return n}else u?n.length===0?xn(e,c,r):Co(e,n,c):(n&&ve(e),xn(e,c));n=c}else if(t.nodeType){if(s&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=ve(e,n,r,t);ve(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Kt(e,t,n,r){let o=!1;for(let s=0,i=t.length;s<i;s++){let a=t[s],c=n&&n[e.length],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Kt(e,a,c)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=Kt(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||o}else e.push(a),o=!0;else{const l=String(a);c&&c.nodeType===3&&c.data===l?e.push(c):e.push(document.createTextNode(l))}}return o}function xn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ve(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let s=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const c=a.parentNode===e;!s&&!i?c?e.replaceChild(o,a):e.insertBefore(o,n):c&&a.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function Mo(){return P.getNextContextId()}const Io="http://www.w3.org/2000/svg";function Qn(e,t=!1,n=void 0){return t?document.createElementNS(Io,e):document.createElement(e,{is:n})}function Vc(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=yn();let s,i=!!P.context;return W(()=>{i&&(yn().user=i=!1),s||(s=oo(o,()=>L(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[c,u]=T(!1),l=()=>u(!0);Gn(d=>pt(a,()=>c()?d():s(),null)),ue(l)}else{const c=Qn(e.isSVG?"g":"div",e.isSVG),u=t&&c.attachShadow?c.attachShadow({mode:"open"}):c;Object.defineProperty(c,"_$host",{get(){return n.parentNode},configurable:!0}),pt(u,s),a.appendChild(c),e.ref&&e.ref(c),ue(()=>a.removeChild(c))}},void 0,{render:!i}),n}function Po(e,t){const n=L(e);return L(()=>{const r=n();switch(typeof r){case"function":return Ge(()=>r(t));case"string":const o=qn.has(r),s=P.context?Zn():Qn(r,o,Ge(()=>t.is));return Yn(s,t,o),s}})}function _c(e){const[,t]=$t(e,["component"]);return Po(()=>e.component,t)}const Le=Symbol("store-raw"),re=Symbol("store-node"),G=Symbol("store-has"),er=Symbol("store-self");function tr(e){let t=e[U];if(!t&&(Object.defineProperty(e,U,{value:t=new Proxy(e,Fo)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,s=n.length;o<s;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function Q(e){let t;return e!=null&&typeof e=="object"&&(e[U]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function ie(e,t=new Set){let n,r,o,s;if(n=e!=null&&e[Le])return n;if(!Q(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let i=0,a=e.length;i<a;i++)o=e[i],(r=ie(o,t))!==o&&(e[i]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const i=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,u=i.length;c<u;c++)s=i[c],!a[s].get&&(o=e[s],(r=ie(o,t))!==o&&(e[s]=r))}return e}function Fe(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function ye(e,t,n){if(e[t])return e[t];const[r,o]=T(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Lo(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===U||t===re||(delete n.value,delete n.writable,n.get=()=>e[U][t]),n}function cn(e){Je()&&ye(Fe(e,re),er)()}function nr(e){return cn(e),Reflect.ownKeys(e)}const Fo={get(e,t,n){if(t===Le)return e;if(t===U)return n;if(t===mt)return cn(e),n;const r=Fe(e,re),o=r[t];let s=o?o():e[t];if(t===re||t===G||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t);Je()&&(typeof s!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(s=ye(r,t,s)())}return Q(s)?tr(s):s},has(e,t){return t===Le||t===U||t===mt||t===re||t===G||t==="__proto__"?!0:(Je()&&ye(Fe(e,G),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:nr,getOwnPropertyDescriptor:Lo};function D(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],s=e.length;n===void 0?(delete e[t],e[G]&&e[G][t]&&o!==void 0&&e[G][t].$()):(e[t]=n,e[G]&&e[G][t]&&o===void 0&&e[G][t].$());let i=Fe(e,re),a;if((a=ye(i,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==s){for(let c=e.length;c<s;c++)(a=i[c])&&a.$();(a=ye(i,"length",s))&&a.$(e.length)}(a=i[er])&&a.$()}function rr(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];D(e,o,t[o])}}function Do(e,t){if(typeof t=="function"&&(t=t(e)),t=ie(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&D(e,n,o)}D(e,"length",r)}else rr(e,t)}function _e(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let c=0;c<r.length;c++)_e(e,[r[c]].concat(t),n);return}else if(a&&i==="function"){for(let c=0;c<e.length;c++)r(e[c],c)&&_e(e,[c].concat(t),n);return}else if(a&&i==="object"){const{from:c=0,to:u=e.length-1,by:l=1}=r;for(let d=c;d<=u;d+=l)_e(e,[d].concat(t),n);return}else if(t.length>1){_e(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let s=t[0];typeof s=="function"&&(s=s(o,n),s===o)||r===void 0&&s==null||(s=ie(s),r===void 0||Q(o)&&Q(s)&&!Array.isArray(s)?rr(o,s):D(e,r,s))}function Wc(...[e,t]){const n=ie(e||{}),r=Array.isArray(n),o=tr(n);function s(...i){Ae(()=>{r&&i.length===1?Do(n,i[0]):_e(n,i)})}return[o,s]}function No(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||n.set||!n.configurable||t===U||t===re||(delete n.value,delete n.writable,n.get=()=>e[U][t],n.set=r=>e[U][t]=r),n}const Ro={get(e,t,n){if(t===Le)return e;if(t===U)return n;if(t===mt)return cn(e),n;const r=Fe(e,re),o=r[t];let s=o?o():e[t];if(t===re||t===G||t==="__proto__")return s;if(!o){const i=Object.getOwnPropertyDescriptor(e,t),a=typeof s=="function";if(Je()&&(!a||e.hasOwnProperty(t))&&!(i&&i.get))s=ye(r,t,s)();else if(s!=null&&a&&s===Array.prototype[t])return(...c)=>Ae(()=>Array.prototype[t].apply(n,c))}return Q(s)?or(s):s},has(e,t){return t===Le||t===U||t===mt||t===re||t===G||t==="__proto__"?!0:(Je()&&ye(Fe(e,G),t)(),t in e)},set(e,t,n){return Ae(()=>D(e,t,ie(n))),!0},deleteProperty(e,t){return Ae(()=>D(e,t,void 0,!0)),!0},ownKeys:nr,getOwnPropertyDescriptor:No};function or(e){let t=e[U];if(!t){Object.defineProperty(e,U,{value:t=new Proxy(e,Ro)});const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),o=Object.getPrototypeOf(e),s=o!==null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&o!==Object.prototype;if(s){let i=o;for(;i!=null;){const a=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(a)),Object.assign(r,a),i=Object.getPrototypeOf(i)}}for(let i=0,a=n.length;i<a;i++){const c=n[i];if(!(s&&c==="constructor")){if(r[c].get){const u=r[c].get.bind(t);Object.defineProperty(e,c,{get:u,configurable:!0})}if(r[c].set){const u=r[c].set;Object.defineProperty(e,c,{set:d=>Ae(()=>u.call(t,d)),configurable:!0})}}}}return t}function Uo(e,t){const n=ie(e||{});return or(n)}const Ht=Symbol("store-root");function ke(e,t,n,r,o){const s=t[n];if(e===s)return;const i=Array.isArray(e);if(n!==Ht&&(!Q(e)||!Q(s)||i!==Array.isArray(s)||o&&e[o]!==s[o])){D(t,n,e);return}if(i){if(e.length&&s.length&&(!r||o&&e[0]&&e[0][o]!=null)){let u,l,d,g,p,y,C,b;for(d=0,g=Math.min(s.length,e.length);d<g&&(s[d]===e[d]||o&&s[d]&&e[d]&&s[d][o]&&s[d][o]===e[d][o]);d++)ke(e[d],s,d,r,o);const I=new Array(e.length),N=new Map;for(g=s.length-1,p=e.length-1;g>=d&&p>=d&&(s[g]===e[p]||o&&s[g]&&e[p]&&s[g][o]&&s[g][o]===e[p][o]);g--,p--)I[p]=s[g];if(d>p||d>g){for(l=d;l<=p;l++)D(s,l,e[l]);for(;l<e.length;l++)D(s,l,I[l]),ke(e[l],s,l,r,o);s.length>e.length&&D(s,"length",e.length);return}for(C=new Array(p+1),l=p;l>=d;l--)y=e[l],b=o&&y?y[o]:y,u=N.get(b),C[l]=u===void 0?-1:u,N.set(b,l);for(u=d;u<=g;u++)y=s[u],b=o&&y?y[o]:y,l=N.get(b),l!==void 0&&l!==-1&&(I[l]=s[u],l=C[l],N.set(b,l));for(l=d;l<e.length;l++)l in I?(D(s,l,I[l]),ke(e[l],s,l,r,o)):D(s,l,e[l])}else for(let u=0,l=e.length;u<l;u++)ke(e[u],s,u,r,o);s.length>e.length&&D(s,"length",e.length);return}const a=Object.keys(e);for(let u=0,l=a.length;u<l;u++)ke(e[a[u]],s,a[u],r,o);const c=Object.keys(s);for(let u=0,l=c.length;u<l;u++)e[c[u]]===void 0&&D(s,c[u],void 0)}function zc(e,t={}){const{merge:n,key:r="id"}=t,o=ie(e);return s=>{if(!Q(s)||!Q(o))return o;const i=ke(o,{[Ht]:s},Ht,n,r);return i===void 0?s:i}}const yt=new WeakMap,sr={get(e,t){if(t===Le)return e;const n=e[t];let r;return Q(n)?yt.get(n)||(yt.set(n,r=new Proxy(n,sr)),r):n},set(e,t,n){return D(e,t,ie(n)),!0},deleteProperty(e,t){return D(e,t,void 0,!0),!0}};function Kc(e){return t=>{if(Q(t)){let n;(n=yt.get(t))||yt.set(t,n=new Proxy(t,sr)),e(n)}return t}}function ln(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function Bo(e){e=e.substr(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function be(e){if(typeof e!="string")return e;if(e.charAt(0)==="#")return be(Bo(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error("MUI: Unsupported `%s` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). "+e);const r=e.substring(t+1,e.length-1);let o,s;if(n==="color"){if(o=r.split(" "),s=o.shift(),o.length===4&&o[3].charAt(0)==="/"&&(o[3]=o[3].substr(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(s)===-1)throw new Error("MUI: unsupported `%s` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020. "+s)}else o=r.split(",");return{type:n,values:o.map(i=>parseFloat(i)),colorSpace:s}}function Et(e){const{type:t,colorSpace:n}=e,{values:r}=e;let o;return t.indexOf("rgb")!==-1?o=r.map((s,i)=>i<3?parseInt(s.toString(),10):s).join(","):t.indexOf("hsl")!==-1&&(o=r.map((s,i)=>i===1||i===2?`${s}%`:s).join(",")),t.indexOf("color")!==-1?o=`${n} ${r.join(" ")}`:o=`${r.join(", ")}`,`${t}(${o})`}function jo(e){const t=be(e),{values:n}=t,r=n[0],o=n[1]/100,s=n[2]/100,i=o*Math.min(s,1-s),a=(l,d=(l+r/30)%12)=>s-i*Math.max(Math.min(d-3,9-d,1),-1);let c="rgb";const u=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(c+="a",u.push(n[3])),Et({type:c,values:u})}function vn(e){const{type:t,values:n}=be(e);let r=t==="hsl"?be(jo(e)).values:n;return r=r.map(o=>(t!=="color"&&(o/=255),o<=.03928?o/12.92:((o+.055)/1.055)**2.4)),Number((.2126*r[0]+.7152*r[1]+.0722*r[2]).toFixed(3))}function Vo(e,t){const n=vn(e),r=vn(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Hc(e,t){let{type:n,values:r}=be(e);return t=ln(t),(n==="rgb"||n==="hsl")&&(n+="a"),n==="color"?r[3]=`/${t}`:r[3]=t,Et({type:n,values:r})}function _o(e,t){const n=be(e);if(t=ln(t),n.type.indexOf("hsl")!==-1)n.values[2]*=1-t;else if(n.type.indexOf("rgb")!==-1||n.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)n.values[r]*=1-t;return Et(n)}function Wo(e,t){const n=be(e);if(t=ln(t),n.type.indexOf("hsl")!==-1)n.values[2]+=(100-n.values[2])*t;else if(n.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)n.values[r]+=(255-n.values[r])*t;else if(n.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)n.values[r]+=(1-n.values[r])*t;return Et(n)}const zo={xs:0,sm:600,md:900,lg:1200,xl:1536};function Ko(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const s=r.breakpoints;return t.reduce((i,a,c)=>(i={...i,...s.up(s.keys[c],n(t[c]))},i),{})}if(typeof t=="object"){const s=r.breakpoints;return Object.keys(t).reduce((a,c)=>{if(Object.keys(s.values||zo).indexOf(c)!==-1)a={...a,...s.up(c,n(t[c],c))};else{const u=c;a[u]=t[u]}return a},{})}return n(t)}const Ho={cleanupStyles:!0},Go=Re(Ho),we={black:"#000",white:"#fff"},Ee={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Te={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Me={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Ie={300:"#4fc3f7",400:"#29b6f6",700:"#0288d1",800:"#0277bd",900:"#01579b"},Pe={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},Ke={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},Jo={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function We(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function qo(e,t){for(const n of t){const r=e[n];delete e[n],e[n]=r}}function un(e,t,n={clone:!0}){const r=n.clone?{...e}:e,o=n.sortKeys?[]:void 0;return We(e)&&We(t)&&(Object.keys(t).forEach(s=>{if(s==="__proto__")return;o&&o.push(s);let i,a;We(i=t[s])&&s in e&&We(a=e[s])?r[s]=un(a,i,n):i!==void 0&&(r[s]=i)}),o&&qo(r,o)),r}function Gt(e){if(Array.isArray(e)){const t=[];for(const n of e)t.push(Gt(n));return t}else if(We(e)){const t={};for(const n in e)n!=="__proto__"&&(t[n]=Gt(e[n]));return t}else return e}function Ze(e,...t){for(const n of t)un(e,Gt(n),{clone:!1});return e}const Xo=()=>({text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:we.white,default:we.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}),Yo={primary:{main:Me[700],light:Me[400],dark:Me[800]},secondary:{main:Te[500],light:Te[300],dark:Te[700]},error:{main:Ee[700],light:Ee[400],dark:Ee[800]},info:{main:Ie[700],light:Ie[800],dark:Ie[900]},success:{main:Pe[800],light:Pe[500],dark:Pe[900]},warning:{main:"#ED6C02",light:Ke[500],dark:Ke[900]}},Zo=()=>({text:{primary:we.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:we.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}),Qo={primary:{main:Me[200],light:Me[50],dark:Me[400]},secondary:{main:Te[200],light:Te[50],dark:Te[400]},error:{main:Ee[500],light:Ee[300],dark:Ee[700]},info:{main:Ie[400],light:Ie[300],dark:Ie[700]},success:{main:Pe[400],light:Pe[300],dark:Pe[700]},warning:{main:Ke[400],light:Ke[300],dark:Ke[700]}},es={light:Xo,dark:Zo};function ir(e,t){return Vo(e,we.white)>=t?we.white:"rgba(0, 0, 0, 0.87)"}function On(e,t,n,r){const o=typeof r=="number"?r:r.light,s=typeof r=="number"?r*1.5:r.dark;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Wo(e.main,o):t==="dark"&&(e.dark=_o(e.main,s)))}function ts(e){const t={...e.color},n=e.mainShade??500;return!e.color.main&&e.color[n]&&(t.main=e.color[n]),On(t,"light",e.lightShade??300,e.tonalOffset),On(t,"dark",e.darkShade??700,e.tonalOffset),t.contrastText||(t.contrastText=ir(t.main,e.contrastThreshold)),t}const ns=()=>({mode:"light",tonalOffset:.2,contrastThreshold:3,grey:Jo,common:we});function rs(e){const t=["error","info","primary","secondary","success","warning"],n=ns(),r={...Ze({},n,es[(e==null?void 0:e.mode)??n.mode](),e),isColorName(s){return t.includes(s)},getColorObject(s){return r[s]},getColor(s){return r.mode==="light"?r[s].light:r[s].dark},augmentColor(s){return ts({...s,tonalOffset:r.tonalOffset,contrastThreshold:r.contrastThreshold})},getContrastText(s){return ir(s,r.contrastThreshold)}},o=s=>r.mode==="light"?Yo[s]:Qo[s];return r.primary=r.augmentColor({color:r.primary||o("primary")}),r.secondary=r.augmentColor({color:r.secondary||o("secondary"),mainShade:"A400",lightShade:"A200",darkShade:"A700"}),r.error=r.augmentColor({color:r.error||o("error")}),r.warning=r.augmentColor({color:r.warning||o("warning")}),r.info=r.augmentColor({color:r.info||o("info")}),r.success=r.augmentColor({color:r.success||o("success")}),r}const os={};function ss(e){return{...Ze({},os,e??{})}}function is(e,t=void 0,n={}){return{toolbar:{minHeight:56,[`${e.up("xs")} and (orientation: landscape)`]:{minHeight:48},[e.up("sm")]:{minHeight:64}},...n}}const Dt={},as=.2,cs=.14,ls=.12;function $(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${as})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${cs})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${ls})`].join(",")}const us=[()=>"none",()=>$(0,2,1,-1,0,1,1,0,0,1,3,0),()=>$(0,3,1,-2,0,2,2,0,0,1,5,0),()=>$(0,3,3,-2,0,3,4,0,0,1,8,0),()=>$(0,2,4,-1,0,4,5,0,0,1,10,0),()=>$(0,3,5,-1,0,5,8,0,0,1,14,0),()=>$(0,3,5,-1,0,6,10,0,0,1,18,0),()=>$(0,4,5,-2,0,7,10,1,0,2,16,1),()=>$(0,5,5,-3,0,8,10,1,0,3,14,2),()=>$(0,5,6,-3,0,9,12,1,0,3,16,2),()=>$(0,6,6,-3,0,10,14,1,0,4,18,3),()=>$(0,6,7,-4,0,11,15,1,0,4,20,3),()=>$(0,7,8,-4,0,12,17,2,0,5,22,4),()=>$(0,7,8,-4,0,13,19,2,0,5,24,4),()=>$(0,7,9,-4,0,14,21,2,0,5,26,4),()=>$(0,8,9,-5,0,15,22,2,0,6,28,5),()=>$(0,8,10,-5,0,16,24,2,0,6,30,5),()=>$(0,8,11,-5,0,17,26,2,0,6,32,5),()=>$(0,9,11,-5,0,18,28,2,0,7,34,6),()=>$(0,9,12,-6,0,19,29,2,0,7,36,6),()=>$(0,10,13,-6,0,20,31,3,0,8,38,7),()=>$(0,10,13,-6,0,21,33,3,0,8,40,7),()=>$(0,10,14,-6,0,22,35,3,0,8,42,7),()=>$(0,11,14,-7,0,23,36,3,0,9,44,8),()=>$(0,11,15,-7,0,24,38,3,0,9,46,8)];function ds(){return new Proxy([],{get:(e,t)=>typeof t!="string"||isNaN(Number(t))?e[t]:t in Dt?Dt[t]:Dt[t]=us[t]()})}const fs={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},gs={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function kn(e){return`${Math.round(e)}ms`}function hs(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function ms(e){const t={...fs,...e.easing},n={...gs,...e.duration};return{getAutoHeightDuration:hs,create:(o=["all"],s={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:c=0,...u}=s;return(Array.isArray(o)?o:[o]).map(l=>`${l} ${typeof i=="string"?i:kn(i)} ${a} ${typeof c=="string"?c:kn(c)}`).join(",")},...e,easing:t,duration:n}}const V={light:300,regular:400,medium:500},it={fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontSize:14,htmlFontSize:16,h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},subtitle1:{},subtitle2:{},body1:{},body2:{},button:{},caption:{},overline:{},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700};function ps(e){return Math.round(e*1e5)/1e5}function _(e,t,n,r,o,s){return{fontFamily:e.fontFamily,fontWeight:t,fontSize:e.pxToRem(n),lineHeight:`${r}`,letterSpacing:`${ps(o/n)}em`,...s?{textTransform:"uppercase"}:{}}}function ys(e={}){const t={fontFamily:e.fontFamily??it.fontFamily,fontSize:e.fontSize??it.fontSize,htmlFontSize:(e==null?void 0:e.htmlFontSize)??it.htmlFontSize,pxToRem:n=>{const r=t.fontSize/14;return`${n/t.htmlFontSize*r}rem`}};return Ze(it,t,{h1:_(t,V.light,96,1.167,-1.5),h2:_(t,V.light,60,1.2,-.5),h3:_(t,V.regular,48,1.167,0),h4:_(t,V.regular,34,1.235,.25),h5:_(t,V.regular,24,1.334,0),h6:_(t,V.medium,20,1.6,.15),subtitle1:_(t,V.regular,16,1.75,.15),subtitle2:_(t,V.medium,14,1.57,.1),body1:_(t,V.regular,16,1.5,.15),body2:_(t,V.regular,14,1.43,.15),button:_(t,V.medium,14,1.75,.4,!0),caption:_(t,V.regular,12,1.66,.4),overline:_(t,V.regular,12,2.66,1,!0)},e)}const bs={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function ws(e){return{...Ze({},bs,e)}}function Nt(e,t,n="px"){let r;if(e==="up")r=`(min-width:${t}${n})`;else if(e==="down")r=`(max-width:${t}${n})`;else if(e==="between"){const[o,s]=t;r=`(max-width:${o}${n}) and (min-width:${s}${n})`}else throw new Error(`Invalid comparator: ${e}`);return`@media ${r}`}const Cs={columns:12,keys:["xs","sm","md","lg","xl"],values:{xs:0,sm:600,md:900,lg:1200,xl:1536},unit:"px"};function ar(e){const t={...Cs,...e??{},up:(n,r)=>{const o=Nt("up",t.resolve(n));return r?{[o]:r}:o},down:(n,r)=>{const o=Nt("down",t.resolve(n));return r?{[o]:r}:o},between:(n,r)=>{const o=Nt("between",[t.resolve(n[0]),t.resolve(n[1])]);return r?{[o]:r}:o},resolve:n=>typeof n=="number"?n:t.values[n]};return t}function cr(e){return typeof e=="function"?e:(...n)=>n.map(r=>typeof r=="number"?`${r*(e??8)}px`:r).join(" ")}const Ss={borderRadius:4};function lr(e){return{...Ze({},Ss,e)}}function ur(e={}){const t={direction:"ltr",...e};function n(r,o){const s=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,...typeof s=="function"?{get:s}:{value:o({[r]:s})}})}return n("breakpoints",r=>ar(r.breakpoints)),n("components",r=>ss(r.components)),n("palette",r=>rs(r.palette)),n("shape",r=>lr(r.shape)),n("spacing",r=>cr(r.spacing)),n("typography",r=>ys(r.typography)),n("shadows",()=>ds()),n("transitions",()=>ms({})),n("zIndex",r=>ws(r.zIndex)),n("mixins",()=>is(t.breakpoints)),t}function dr(e){let t;return function(){return t||(t=e()),t}}const xs=dr(ur);let fr;fr=Re({});const Tt=fr;function vs(e){return{direction:"ltr",shadows:void 0,transitions:void 0,components:void 0,palette:void 0,typography:void 0,zIndex:void 0,mixins:void 0,...e,breakpoints:ar(e==null?void 0:e.breakpoints),shape:lr(e==null?void 0:e.shape),spacing:cr(e==null?void 0:e.spacing)}}const Os=dr(vs);function ks(e){for(const t in e)return!1;return!0}function dn(e=Os,t=Tt){const n=Ye(t);if(typeof n=="function")return new Proxy({},{get:(r,o)=>n()[o]});if(ks(n)&&e)return typeof e=="function"?e():e;if(!n)throw new Error("Theme is not defined");return n}function gr(e=xs){return dn(e,Tt)}function $s(e){return dn(e,Tt)}function As(e){var s,i;const t=[],n=typeof e.propDefaults=="function"?e.propDefaults({set:a=>a,inProps:e.props}):e.propDefaults,o=(i=(s=$s().components)==null?void 0:s[e.name])==null?void 0:i.defaultProps;return n&&t.push(n),o&&t.push(o),t.length?Jn(...t,e.props):e.props}function Es(e){return de(Tt.Provider,{get value(){return e.theme},get children(){return e.children}})}function Ts(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function Ms(e,t){switch(typeof e){case"function":return Object.assign(e,{[so]:!0}),Ge(()=>e(t));case"string":const n=qn.has(e),r=P.context?Zn():Ts(e,n);return Yn(r,t,n),r}}function hr(e,t){const n=L(e);return L(()=>Ms(n(),t))}function Gc(e){const[t,n]=$t(e,["$component"]);return hr(()=>t.$component,n)}function Is(e){const t=e.reduce((n,r)=>("name"in r&&(n[`--${r.name}`]="0"),un(n,r,{clone:!1,sortKeys:!0}),n),{});return delete t.name,t}function mr(e){return e.startsWith("--")}function Ps(e){return e.startsWith("__")}function pr(e){return/[^a-z-]/i.test(e)&&!mr(e)}function yr(e){return e.startsWith("@global")}function Jt(e){return e.startsWith("@media")}function br(e){return e.startsWith("@keyframes")}function $n(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function An(e,t,n=[],r={}){const o=e.split(",").map(s=>(s=s.trim(),s.includes("&")?s:`& ${s}`));return bt(t,(n.length?n:[""]).flatMap(s=>o.map(i=>i.replace(/&/g,s).trim())),{...r})}function En(e,t){if(!t)return $n(e);let n=t.get(e);return n||(t.set(e,n=$n(e)),n)}function bt(e,t=[],n={}){const r=[],o=[];for(let i in e){const a=e[i];if(!Ps(i))if(yr(i))for(const c in a)o.push(...An(c,a[c],[],n));else if(Jt(i))o.push(...bt(a,t,{...n,sublevel:!0}).map(c=>`${i} {
2
- ${c}
3
- }`));else if(mr(i))a!=null&&r.push(`${i}: ${a};`);else if(br(i)){const c=[];for(const u in a)c.push(...bt(a[u],[/^\d+$/.test(u)?`${u}%`:u],{...n,sublevel:!0}));o.push(`${i} {
4
- ${c.join(`
5
- `)}
6
- }`)}else if(pr(i))o.push(...An(i,a,t,n));else if(n.extraProperties&&i in n.extraProperties){const c=n.extraProperties[i](a);for(const u in c){const l=c[u],d=n.onPropertyValue?n.onPropertyValue(u,l):l;d!=null&&r.push(`${En(u,n.propertyNameCache)}: ${d};`)}}else{i=En(i,n.propertyNameCache);const c=n.onPropertyValue?n.onPropertyValue(i,a):a;c!=null&&r.push(`${i}: ${c};`)}}const s=i=>{const a=" ".repeat(i);return`${a}${r.join(`
7
- ${a}`)}`};if(t.length){const i=n.sublevel?" ":"",a=i+t.join(`,
8
- ${i}`);return[...r.length?[`${a} {
9
- ${s(n.sublevel?2:1)}
10
- ${i}}`]:[],...o]}else return[...r.length?[s(0)]:[],...o]}function Ls(e){return e?Array.isArray(e)?e:[e]:[]}function Fs(e){return typeof e=="function"&&(e=e()),e}class Ds{constructor(){st(this,"ids",new Map);st(this,"rules",new Map);st(this,"propertyNames",new Map)}create(t,n,r){let o=this.rules.get(n);if(o)return o;let s=this.ids.get(r);return typeof s=="number"&&(this.ids.set(r,++s),r+=`_${s}`),o=wr(t,n,r),this.save(o,n),o}save(t,n){this.ids.set(t.id,0),this.rules.set(n,t)}delete(t){this.ids.delete(t.id),this.rules.delete(t.rules)}}function wr(e,t,n){return{id:n,name:e,className:`${e}-${n}`,rules:t.replaceAll("$id",`${n}`)}}function Ns(e){var s,i;const t=`${e.name}-$id`,n=Ls(Fs(e.props)),r=(s=e.cache)==null?void 0:s.propertyNames,o=n.map(a=>typeof a=="string"?`.${t} {
11
- ${a}
12
- }`:bt(a,[`.${t}`],{extraProperties:e.extraProperties,propertyNameCache:r}).join(`
13
- `)).join(`
14
- `);return((i=e.cache)==null?void 0:i.create(e.name,o,e.componentId))||wr(e.name,o,e.componentId)}function Cr(e,t){"styleSheet"in e?e.styleSheet.cssText=t:(e.innerText="",e.appendChild(document.createTextNode(t)))}function Rs(e,t){for(const n in t){const r=t[n];r!==void 0&&(r===null?e.removeAttribute(n):e.setAttribute(n,r))}}function Us(e,t){const n=document.createElement("style");return n.type="text/css",t&&Rs(n,t),Cr(n,e),n}function qt(e){let t=Number(e.getAttribute("data-uses"));t++,e.setAttribute("data-uses",t.toString())}const Tn="suid-injectFirst";function Bs(e,t,n){Array.isArray(e)&&(e=e.join(`
15
- `));const r=t==null?void 0:t.id,o=document.head||document.getElementsByTagName("head")[0],s=r&&document.getElementById(r);if(s&&s instanceof HTMLStyleElement)return Cr(s,e),qt(s),s;{s&&s.remove();const i=Us(e,t);if(qt(i),n){let a=o.querySelector(`#${Tn}`);a||(a=document.createElement("style"),a.setAttribute("id",Tn),o.prepend(a)),o.insertBefore(i,a)}else o.appendChild(i);return i}}function js(e,t="css-"){if(typeof e=="string")return document.getElementById(e);const n=[...e.classList].find(r=>r.startsWith(t));if(n)return document.getElementById(n.slice(t.length))}function Mn(e,t=!0){let n=Number(e.getAttribute("data-uses"));n--,n<=0?t?e.remove():e.setAttribute("data-uses","0"):e.setAttribute("data-uses",n.toString())}function Jc(e){if(typeof e!="string")throw new Error("MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}function qc(e,t=166){let n;function r(...o){const s=()=>{e.apply(null,o)};clearTimeout(n),n=setTimeout(s,t)}return r.clear=()=>{clearTimeout(n)},r}function Xc(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function Vs(e){return e&&e.ownerDocument||document}function Yc(e){return Vs(e).defaultView||window}function Sr(){return Math.random().toString(36).substring(2,15).slice(0,8)}let Mt=!0,Xt=!1,In;const _s={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Ws(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&_s[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function zs(e){e.metaKey||e.altKey||e.ctrlKey||(Mt=!0)}function Rt(){Mt=!1}function Ks(){this.visibilityState==="hidden"&&Xt&&(Mt=!0)}function Hs(e){e.addEventListener("keydown",zs,!0),e.addEventListener("mousedown",Rt,!0),e.addEventListener("pointerdown",Rt,!0),e.addEventListener("touchstart",Rt,!0),e.addEventListener("visibilitychange",Ks,!0)}function Gs(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return Mt||Ws(t)}function Zc(){const e=s=>{s!=null&&Hs(s.ownerDocument)},[t,n]=T(!1);function r(){return t()?(Xt=!0,window.clearTimeout(In),In=window.setTimeout(()=>{Xt=!1},100),n(!1),!0):!1}function o(s){return Gs(s)?(n(!0),!0):!1}return{isFocusVisibleRef:{get current(){return t()}},onFocus:o,onBlur:r,ref:e}}const Js=new Ds;function qs(e){return e?Array.isArray(e)?e.flat(1/0).filter(t=>!!t):[e]:[]}function Xs(){if(!P.context)return Sr();const e=io().replaceAll("-",""),t=9,n=Math.ceil(e.length/t),r=[];for(let o=1;o<=n;++o){const s=(o-1)*t,i=Number(e.slice(s,s+t));r.push(i.toString(32))}return r.join("-")}function xr(e){const t=Ye(Go),[n,r]=T(""),o=Xs();let s,i=!1;return le(a=>{var l;const c=e();let u;if(c){const d=Is(qs(c));i="@global"in d,u=Ns({name:"css",props:d,cache:Js,componentId:o}),s=js(u.id),s?qt(s):s=Bs(u.rules,{id:u.id,nonce:(l=t.cache)==null?void 0:l.nonce},t.injectFirst),a!=null&&a.styleElement&&Mn(a.styleElement)}return typeof(u==null?void 0:u.className)=="string"?r(u.className):r(""),{className:u==null?void 0:u.className,styleElement:s}},void 0),ue(()=>{s&&Mn(s,t.cleanupStyles??i)}),n}function $e(e,t,n={}){for(const r in e){const o=e[r];if(yr(r))n[r]=$e(o,t);else if(Jt(r))n[r]=$e(o,t);else if(br(r)){n[r]={};for(const s in o)n[r][s]=$e(o[s],t)}else if(pr(r))n[r]=$e(o,t);else{const s=t(r,o);if(s)for(const i in s)n[i]=Jt(i)?{...n[i],...s[i]}:s[i];else n[r]=o}}return n}const Ys=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function vr(e,t){if(typeof t=="number")return{[e]:Ys.has(e)?t.toString():`${t}px`}}function Pn(e,t={}){return $e(e,vr,t)}function wt(e,t,n){if(typeof n!="string")return n;const r=n.split(".");let o=e[t];for(let s=0;s<r.length&&(o=o==null?void 0:o[r[s]],!!o);s++);return o??n}function Zs(e,t){return t.split(".").reduce((n,r)=>n&&n[r]?n[r]:null,e)}function Qs(e,t,n,r){const o=Zs(e,t)||n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}const ae={x:["Left","Right"],y:["Top","Bottom"]};function Or(e){return typeof e=="number"?`${e}px`:e}function kr(e,t){return(n,r)=>t(e,n,r)}function f(e,t){return t?(n,r)=>({[e]:t(e,n,r)}):n=>({[e]:n})}function ze(e){return f(e,(t,n)=>Or(n))}function H(e,t,n){const r=t.map(o=>`${e}${o}`);return n?(o,s)=>r.reduce((i,a)=>(i[a]=n(a,o,s),i),{}):o=>r.reduce((s,i)=>(s[i]=o,s),{})}function ei(){return{...ti(),...ni(),...ri(),...oi(),...si(),...ii(),...ai(),...li(),...ci()}}function ti(){return{displayPrint:kr("displayPrint",(e,t)=>({"@media print":{display:t}})),displayRaw:f("display"),overflow:f("overflow"),textOverflow:f("textOverflow"),visibility:f("visibility"),whiteSpace:f("whiteSpace")}}function ni(){return{flexBasis:f("flexBasis"),flexDirection:f("flexDirection"),flexWrap:f("flexWrap"),justifyContent:f("justifyContent"),alignItems:f("alignItems"),alignContent:f("alignContent"),order:f("order"),flex:f("flex"),flexGrow:f("flexGrow"),flexShrink:f("flexShrink"),alignSelf:f("alignSelf"),justifyItems:f("justifyItems"),justifySelf:f("justifySelf")}}function ri(){const e=(t,n,r)=>Qs(r,"spacing",8)(n);return{gap:f("gap",e),columnGap:f("columnGap",e),rowGap:f("rowGap",e),gridColumn:f("gridColumn"),gridRow:f("gridRow"),gridAutoFlow:f("gridAutoFlow"),gridAutoColumns:f("gridAutoColumns"),gridAutoRows:f("gridAutoRows"),gridTemplateColumns:f("gridTemplateColumns"),gridTemplateRows:f("gridTemplateRows"),gridTemplateAreas:f("gridTemplateAreas"),gridArea:f("gridArea")}}function oi(){return{position:f("position"),zIndex:f("zIndex",(e,t,n)=>{var r;return((r=n.zIndex)==null?void 0:r[e])??t}),top:ze("top"),right:ze("right"),bottom:ze("bottom"),left:ze("left")}}function si(){const e=(t,n,r)=>wt(r,"palette",n);return{color:f("color",e),bgcolor:f("backgroundColor",e),backgroundColor:f("backgroundColor",e)}}function ii(){const e=(t,n,r)=>(t==="maxWidth"&&(n=r.breakpoints.values[t]??n),typeof n=="number"&&(n=n>0&&n<=1?`${n*100}%`:`${n}px`),n);return{width:f("width",e),maxWidth:f("maxWidth",e),minWidth:f("minWidth",e),height:f("height",e),maxHeight:f("maxHeight",e),minHeight:f("minHeight",e),boxSizing:f("boxSizing",e)}}function ai(){const e=(n,r)=>typeof r=="number"?`${r}px solid`:r,t=(n,r,o)=>wt(o,"palette",r);return{border:f("border",e),borderTop:f("borderTop",e),borderRight:f("borderRight",e),borderBottom:f("borderBottom",e),borderLeft:f("borderLeft",e),borderColor:f("borderColor",t),borderTopColor:f("borderTopColor",t),borderRightColor:f("borderRightColor",t),borderBottomColor:f("borderBottomColor",t),borderLeftColor:f("borderLeftColor",t),borderRadius:f("borderRadius",(n,r,o)=>typeof r=="number"?`${o.shape.borderRadius*r}px`:r)}}function ci(){const e=(t,n,r)=>wt(r,"typography",n);return{typography:kr("typography",(t,n,r)=>wt(r,"typography",n)),fontFamily:f("fontFamily",e),fontSize:f("fontSize",(t,n,r)=>Or(e(t,n,r))),fontStyle:f("fontStyle",e),fontWeight:f("fontWeight",e),letterSpacing:ze("letterSpacing"),lineHeight:f("lineHeight"),textAlign:f("textAlign"),textTransform:f("textTransform")}}function li(){const e=(r,o,s)=>s.spacing(o),t="margin",n="padding";return{m:f(t,e),mt:f("marginTop",e),mr:f("marginRight",e),mb:f("marginBottom",e),ml:f("marginLeft",e),mx:H(t,ae.x,e),my:H(t,ae.y,e),margin:f(t,e),marginTop:f("marginTop",e),marginRight:f("marginRight",e),marginBottom:f("marginBottom",e),marginLeft:f("marginLeft",e),marginX:H(t,ae.x,e),marginY:H(t,ae.y,e),marginInline:H(t,["Inline","InlineStart"],e),marginInlineStart:f("marginInlineStart",e),marginInlineEnd:f("marginInlineEnd",e),marginBlock:H(t,["BlockStart","BlockEnd"],e),marginBlockStart:f("marginBlockStart",e),marginBlockEnd:f("marginBlockEnd",e),p:f(n,e),pt:f("paddingTop",e),pr:f("paddingRight",e),pb:f("paddingBottom",e),pl:f("paddingLeft",e),px:H(n,ae.x,e),py:H(n,ae.y,e),padding:f(n,e),paddingTop:f("paddingTop",e),paddingRight:f("paddingRight",e),paddingBottom:f("paddingBottom",e),paddingLeft:f("paddingLeft",e),paddingX:H(n,ae.x,e),paddingY:H(n,ae.y,e),paddingInline:H(n,["Inline","InlineStart"],e),paddingInlineStart:f("paddingInlineStart",e),paddingInlineEnd:f("paddingInlineEnd",e),paddingBlock:H(n,["BlockStart","BlockEnd"],e),paddingBlockStart:f("paddingBlockStart",e),paddingBlockEnd:f("paddingBlockEnd",e)}}const fn=ei(),Qc=Object.keys(fn);function ui(e,t,n){return fn[e](t,n)}function Ln(e,t,n){return e in fn?ui(e,t,n):vr(e,t)}function di(e,t){return $e(e,(n,r)=>{if(typeof r=="function"&&(r=r(t)),r==null)return r;if(typeof r=="object"){const o={};for(const s of t.breakpoints.keys)o[t.breakpoints.up(s)]={};return Object.assign(o,Ko({theme:t},r,s=>Ln(n,s,t)??{[n]:s}))}else return Ln(n,r,t)})}function $r(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=$r(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fi(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$r(e))&&(r&&(r+=" "),r+=t);return r}const Ar=["ownerState","theme","sx","as"];function gi(e,t){var n,r;return(r=(n=t.components)==null?void 0:n[e])==null?void 0:r.styleOverrides}function hi(e,t,n,r,o={}){return L(()=>{const s=e(),i=gi(o.name,s),a=r.ownerState,c=n.reduce((l,d)=>{let g;return typeof d=="function"?g=d({ownerState:a,theme:s,get sx(){return r.sx},get as(){return r.as},props:r}):d&&(g=d),g&&l.push(Pn(g,{name:t,__resolved:!0})),l},[]);let u=[];return o.overridesResolver&&typeof o.overridesResolver=="function"&&i&&(u=o.overridesResolver(r,i).map(l=>l?Pn(l,{}):null).filter(Boolean)),c.concat(u)})}function Er(e,t){e.__suid=t}function Fn(e){if(typeof e=="function")return e.__suid}function mi(e){return function(n,r={}){let o,s;if(r.name){const a=r.slot||"Root";s=o=`${r.name}-${a.slice(0,1).toLowerCase()+a.slice(1)}`}else s=`styled-${Sr()}`,o="css";const i=Fn(n);return function(...a){function c(u){let l;const d=()=>{const F=u.theme;return F||l||(l=e&&e.onUseTheme?e.onUseTheme():dn())},[,g]=$t(u,r.skipProps||Ar),p=hi(d,o,a,u,r),y=()=>{const F=u.sx;return F?Array.isArray(F)?F:[F]:[]},C=()=>{if(i)return n;const F=u.as;return F||n},b=i?()=>i:L(()=>Fn(C())),I=r.skipSx?()=>p():()=>{const F=d();return[...p(),...y().map(q=>q.__resolved?q:di(q,F))]},N=xr(()=>b()?void 0:I());return hr(C,Jn(g,{get children(){return u.children},get component(){return b()?u.component:null},get as(){return i?u.as:void 0},get sx(){return b()?I():void 0},get ownerState(){return b()==="system"?u.ownerState:void 0},get class(){return fi([...new Set([u.class,s,N()])])}}))}return Er(c,"system"),s&&(c.toString=()=>`.${s}`),c}}}const el=[...Ar,"classes"],tl=mi({onUseTheme:()=>gr()}),pi="codenomad.client-id",yi="codenomad.connection-id";let at=null,ct=null;function Yt(){return{clientId:bi(),connectionId:wi()}}function bi(){return at||(at=Tr(pi,window.localStorage),at)}function wi(){return ct||(ct=Tr(yi,window.sessionStorage),ct)}function Tr(e,t){if(typeof window>"u")return Ut();try{const r=t.getItem(e);if(r&&r.trim())return r.trim()}catch{return Ut()}const n=Ut();try{t.setItem(e,n)}catch{}return n}function Ut(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Zt={exports:{}},Bt,Dn;function Ci(){if(Dn)return Bt;Dn=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,s=r*365.25;Bt=function(l,d){d=d||{};var g=typeof l;if(g==="string"&&l.length>0)return i(l);if(g==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function i(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var g=parseFloat(d[1]),p=(d[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return g*s;case"weeks":case"week":case"w":return g*o;case"days":case"day":case"d":return g*r;case"hours":case"hour":case"hrs":case"hr":case"h":return g*n;case"minutes":case"minute":case"mins":case"min":case"m":return g*t;case"seconds":case"second":case"secs":case"sec":case"s":return g*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=n?Math.round(l/n)+"h":d>=t?Math.round(l/t)+"m":d>=e?Math.round(l/e)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?u(l,d,r,"day"):d>=n?u(l,d,n,"hour"):d>=t?u(l,d,t,"minute"):d>=e?u(l,d,e,"second"):l+" ms"}function u(l,d,g,p){var y=d>=g*1.5;return Math.round(l/g)+" "+p+(y?"s":"")}return Bt}function Si(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Ci(),n.destroy=u,Object.keys(e).forEach(l=>{n[l]=e[l]}),n.names=[],n.skips=[],n.formatters={};function t(l){let d=0;for(let g=0;g<l.length;g++)d=(d<<5)-d+l.charCodeAt(g),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(l){let d,g=null,p,y;function C(...b){if(!C.enabled)return;const I=C,N=Number(new Date),F=N-(d||N);I.diff=F,I.prev=d,I.curr=N,d=N,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let q=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(j,h)=>{if(j==="%%")return"%";q++;const w=n.formatters[h];if(typeof w=="function"){const k=b[q];j=w.call(I,k),b.splice(q,1),q--}return j}),n.formatArgs.call(I,b),(I.log||n.log).apply(I,b)}return C.namespace=l,C.useColors=n.useColors(),C.color=n.selectColor(l),C.extend=r,C.destroy=n.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(p!==n.namespaces&&(p=n.namespaces,y=n.enabled(l)),y),set:b=>{g=b}}),typeof n.init=="function"&&n.init(C),C}function r(l,d){const g=n(this.namespace+(typeof d>"u"?":":d)+l);return g.log=this.log,g}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];const d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const g of d)g[0]==="-"?n.skips.push(g.slice(1)):n.names.push(g)}function s(l,d){let g=0,p=0,y=-1,C=0;for(;g<l.length;)if(p<d.length&&(d[p]===l[g]||d[p]==="*"))d[p]==="*"?(y=p,C=g,p++):(g++,p++);else if(y!==-1)p=y+1,C++,g=C;else return!1;for(;p<d.length&&d[p]==="*";)p++;return p===d.length}function i(){const l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(const d of n.skips)if(s(l,d))return!1;for(const d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var xi=Si;(function(e,t){var n={};t.formatArgs=o,t.save=s,t.load=i,t.useColors=r,t.storage=a(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;u.splice(1,0,l,"color: inherit");let d=0,g=0;u[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(d++,p==="%c"&&(g=d))}),u.splice(g,0,l)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function i(){let u;try{u=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=xi(t);const{formatters:c}=e.exports;c.j=function(u){try{return JSON.stringify(u)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Zt,Zt.exports);var vi=Zt.exports;const Qt=lo(vi),Ue=["sse","api","session","actions"],Mr="opencode:logger:namespaces",jt=new Map,ee=new Set,ne=typeof globalThis<"u"?globalThis.console:void 0;function Qe(){ee.size===0?Qt.disable():Qt.enable(Array.from(ee).join(","))}function It(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{window.localStorage.setItem(Mr,JSON.stringify(Array.from(ee)))}catch(t){(e=ne==null?void 0:ne.warn)==null||e.call(ne,"Failed to persist logger namespaces",t)}}function Oi(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{const t=window.localStorage.getItem(Mr);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n))return;for(const r of n)Ue.includes(r)&&ee.add(r)}catch(t){(e=ne==null?void 0:ne.warn)==null||e.call(ne,"Failed to hydrate logger namespaces",t)}}Oi();Qe();function ki(e){const n=Qt(e),r=(o,s)=>{n(o,...s)};return{log:(...o)=>n(...o),info:(...o)=>n(...o),warn:(...o)=>r("[warn]",o),error:(...o)=>r("[error]",o)}}function Se(e){if(!Ue.includes(e))throw new Error(`Unknown logger namespace: ${e}`);return jt.has(e)||jt.set(e,ki(e)),jt.get(e)}function $i(){return Ue.map(e=>({name:e,enabled:ee.has(e)}))}function Ai(e){if(!Ue.includes(e))throw new Error(`Unknown logger namespace: ${e}`);ee.has(e)||(ee.add(e),It(),Qe())}function Ei(e){if(!Ue.includes(e))throw new Error(`Unknown logger namespace: ${e}`);ee.has(e)&&(ee.delete(e),It(),Qe())}function Ti(){ee.clear(),It(),Qe()}function Mi(){Ue.forEach(e=>ee.add(e)),It(),Qe()}const Ii={listLoggerNamespaces:$i,enableLogger:Ai,disableLogger:Ei,enableAllLoggers:Mi,disableAllLoggers:Ti};function Pi(){typeof window>"u"||(window.codenomadLogger=Ii)}Pi();function Li(e,t){let n=!1;e.onmessage=o=>{try{const s=JSON.parse(o.data);t.onEvent(s)}catch(s){t.logger.error("Failed to parse event",s)}};const r=o=>{var s;n||(n=!0,t.logger.warn(o),(s=t.onError)==null||s.call(t))};e.onerror=()=>{r("EventSource error, closing stream")},e.onclose=()=>{r("EventSource closed")},e.addEventListener("close",()=>{r("EventSource closed")}),e.addEventListener("codenomad.client.ping",o=>{var s;try{const i=o.data?JSON.parse(o.data):{};(s=t.onPing)==null||s.call(t,i)}catch(i){t.logger.error("Failed to parse ping event",i)}})}const Vt={};var Hn;const Fi=typeof window<"u"?(Hn=window.location)==null?void 0:Hn.origin:void 0,Di=typeof window<"u"?window.__CODENOMAD_API_BASE__??Fi:void 0,Ni=typeof window<"u"?window.__CODENOMAD_EVENTS_URL__??"/api/events":"/api/events",fe=(Vt==null?void 0:Vt.VITE_CODENOMAD_API_BASE)??Di,_t=Ri(fe,Ni),nl=fe;function rl(e,t){const n=encodeURIComponent(e),r=encodeURIComponent(t);return Ui(`/workspaces/${n}/plugin/background-processes/${r}/stream`)}function Ri(e,t){if(t.startsWith("http://")||t.startsWith("https://"))return t;if(e){const n=t.startsWith("/")?t:`/${t}`;return`${e}${n}`}return t}function Ui(e){if(e.startsWith("http://")||e.startsWith("https://")||!fe)return e;const t=e.startsWith("/")?e:`/${e}`;return`${fe}${t}`}const Nn=Se("api"),Rn=Se("sse");function Ir(e){const t={};if(!e)return t;if(e instanceof Headers)return e.forEach((n,r)=>{t[r]=n}),t;if(Array.isArray(e)){for(const[n,r]of e)t[n]=r;return t}return{...e}}function pe(e,t){if(t){Nn.info(e,t);return}Nn.info(e)}async function Pr(e){const t=await e.text();if(!t)return`Request failed with ${e.status}`;try{const n=JSON.parse(t);if(typeof(n==null?void 0:n.error)=="string"&&n.error.trim())return n.error;if(typeof(n==null?void 0:n.message)=="string"&&n.message.trim())return n.message}catch{}return t}async function m(e,t){const n=fe?new URL(e,fe).toString():e,r=Ir(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();pe(`${o} ${e}`);try{const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const c=await Pr(i);throw pe(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:c}),new Error(c||`Request failed with ${i.status}`)}const a=Date.now()-s;return pe(`${o} ${e} -> ${i.status}`,{durationMs:a}),i.status===204?void 0:await i.json()}catch(i){throw pe(`${o} ${e} failed`,{durationMs:Date.now()-s,error:i}),i}}async function Bi(e,t){const n=fe?new URL(e,fe).toString():e,r=Ir(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!r["Content-Type"]&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();pe(`${o} ${e}`);const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const a=await Pr(i);throw pe(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:a}),new Error(a||`Request failed with ${i.status}`)}return pe(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s}),i}const te={fetchWorkspaces(){return m("/api/workspaces")},fetchWorktrees(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees`)},createWorktree(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees`,{method:"POST",body:JSON.stringify(t)})},deleteWorktree(e,t,n){const r=new URLSearchParams;n!=null&&n.force&&r.set("force","true");const o=r.toString()?`?${r.toString()}`:"";return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}${o}`,{method:"DELETE"})},readWorktreeMap(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`)},writeWorktreeMap(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`,{method:"PUT",body:JSON.stringify(t)})},createWorkspace(e){return m("/api/workspaces",{method:"POST",body:JSON.stringify(e)})},fetchSidecars(){return m("/api/sidecars")},createSidecar(e){return m("/api/sidecars",{method:"POST",body:JSON.stringify(e)})},updateSidecar(e,t){return m(`/api/sidecars/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteSidecar(e){return m(`/api/sidecars/${encodeURIComponent(e)}`,{method:"DELETE"})},createPreview(e){return m("/api/previews",{method:"POST",body:JSON.stringify(e)})},deletePreview(e){return m(`/api/previews/${encodeURIComponent(e)}`,{method:"DELETE"})},fetchServerMeta(){return m("/api/meta")},probeRemoteServer(e){return m("/api/remote-servers/probe",{method:"POST",body:JSON.stringify(e)})},createRemoteProxySession(e){return m("/api/remote-proxy/sessions",{method:"POST",body:JSON.stringify(e)})},deleteRemoteProxySession(e){return m(`/api/remote-proxy/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},fetchAuthStatus(){return m("/api/auth/status")},listConfigFiles(){return m("/api/config-files")},readConfigFile(e){return m(`/api/config-files/${encodeURIComponent(e)}/content`)},writeConfigFile(e,t){const n={contents:t};return m(`/api/config-files/${encodeURIComponent(e)}/content`,{method:"PUT",body:JSON.stringify(n)})},setServerPassword(e){return m("/api/auth/password",{method:"POST",body:JSON.stringify({password:e})})},deleteWorkspace(e){return m(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})},cloneWorkspaceRepository(e){return m("/api/workspaces/clone",{method:"POST",body:JSON.stringify(e)})},listWorkspaceFiles(e,t="."){const n=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files?${n.toString()}`)},searchWorkspaceFiles(e,t,n){const r=t.trim();if(!r)return Promise.resolve([]);const o=new URLSearchParams({q:r});return n!=null&&n.limit&&o.set("limit",String(n.limit)),n!=null&&n.type&&o.set("type",n.type),m(`/api/workspaces/${encodeURIComponent(e)}/files/search?${o.toString()}`)},readWorkspaceFile(e,t,n){const r=new URLSearchParams({path:t});return n!=null&&n.encoding&&r.set("encoding",n.encoding),m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${r.toString()}`)},writeWorkspaceFile(e,t,n,r){const o=new URLSearchParams({path:t});return r!=null&&r.worktree&&r.worktree!=="root"&&o.set("worktree",r.worktree),m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${o.toString()}`,{method:"PUT",body:JSON.stringify({contents:n})})},fetchWorktreeGitStatus(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-status`)},fetchWorktreeGitDiff(e,t,n){const r=new URLSearchParams({path:n.path,scope:n.scope});return n.originalPath&&r.set("originalPath",n.originalPath),m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-diff?${r.toString()}`)},stageWorktreeGitPaths(e,t,n){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-stage`,{method:"POST",body:JSON.stringify(n)})},unstageWorktreeGitPaths(e,t,n){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-unstage`,{method:"POST",body:JSON.stringify(n)})},commitWorktreeGitChanges(e,t,n){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}/git-commit`,{method:"POST",body:JSON.stringify(n)})},fetchConfigOwner(e){return m(`/api/storage/config/${encodeURIComponent(e)}`)},patchConfigOwner(e,t){return m(`/api/storage/config/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},fetchStateOwner(e){return m(`/api/storage/state/${encodeURIComponent(e)}`)},patchStateOwner(e,t){return m(`/api/storage/state/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},validateBinary(e){return m("/api/storage/binaries/validate",{method:"POST",body:JSON.stringify({path:e})})},fetchSpeechCapabilities(){return m("/api/speech/capabilities")},transcribeAudio(e){return m("/api/speech/transcribe",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeech(e){return m("/api/speech/synthesize",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeechStream(e,t){return Bi("/api/speech/synthesize/stream",{method:"POST",body:JSON.stringify(e),signal:t})},listFileSystem(e,t){const n=new URLSearchParams;e&&e!=="."&&n.set("path",e),(t==null?void 0:t.includeFiles)!==void 0&&n.set("includeFiles",String(t.includeFiles));const r=n.toString();return m(r?`/api/filesystem?${r}`:"/api/filesystem")},createFileSystemFolder(e,t){return m("/api/filesystem/folders",{method:"POST",body:JSON.stringify({parentPath:e,name:t})})},readFileSystemFile(e,t){const n=new URLSearchParams({path:e});return t!=null&&t.encoding&&n.set("encoding",t.encoding),m(`/api/filesystem/files/content?${n.toString()}`)},readInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`)},writeInstanceData(e,t){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"DELETE"})},listBackgroundProcesses(e){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes`)},stopBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/stop`,{method:"POST"})},terminateBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/terminate`,{method:"POST"})},updateVoiceMode(e,t){const n=Yt();return m(`/workspaces/${encodeURIComponent(e)}/plugin/voice-mode`,{method:"POST",body:JSON.stringify({...n,enabled:t})})},sendClientConnectionPong(e){return m("/api/client-connections/pong",{method:"POST",body:JSON.stringify(e)})},fetchBackgroundProcessOutput(e,t,n){const r=new URLSearchParams;n!=null&&n.method&&r.set("method",n.method),n!=null&&n.pattern&&r.set("pattern",n.pattern),n!=null&&n.lines&&r.set("lines",String(n.lines)),(n==null?void 0:n.maxBytes)!==void 0&&r.set("maxBytes",String(n.maxBytes));const o=r.toString(),s=o?`?${o}`:"";return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/output${s}`)},connectEvents(e,t,n){const r=Yt(),o=ji(r);Rn.info(`Connecting to ${o}`);const s=new EventSource(o,{withCredentials:!0});return Li(s,{onEvent:e,onError:t,onPing:n,logger:Rn}),s}};function ji(e){const t=new URL(_t,typeof window<"u"?window.location.origin:"http://localhost");return t.searchParams.set("clientId",e.clientId),t.searchParams.set("connectionId",e.connectionId),_t.startsWith("http://")||_t.startsWith("https://")?t.toString():`${t.pathname}${t.search}`}const Un=1e3,Vi=1e4,en=Se("sse");function lt(e,t){if(t){en.info(e,t);return}en.info(e)}class _i{constructor(){this.handlers=new Map,this.openHandlers=new Set,this.source=null,this.retryDelay=Un,this.reconnectTimer=null,this.connect()}connect(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.source&&this.source.close(),lt("Connecting to backend events stream"),this.source=te.connectEvents(t=>this.dispatch(t),()=>this.scheduleReconnect(),t=>{te.sendClientConnectionPong({...Yt(),pingTs:t.ts}).catch(n=>{en.error("Failed to send client connection pong",n)})}),this.source.onopen=()=>{lt("Events stream connected"),this.retryDelay=Un,this.openHandlers.forEach(t=>t())}}scheduleReconnect(){if(this.reconnectTimer!==null)return;const t=this.source;this.source=null,lt("Events stream disconnected, scheduling reconnect",{delayMs:this.retryDelay}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.retryDelay=Math.min(this.retryDelay*2,Vi),this.connect()},this.retryDelay),t==null||t.close()}dispatch(t){var n,r;lt(`event ${t.type}`),(n=this.handlers.get("*"))==null||n.forEach(o=>o(t)),(r=this.handlers.get(t.type))==null||r.forEach(o=>o(t))}on(t,n){this.handlers.has(t)||this.handlers.set(t,new Set);const r=this.handlers.get(t);return r.add(n),()=>r.delete(n)}onOpen(t){return this.openHandlers.add(t),()=>this.openHandlers.delete(t)}}const Wt=new _i,Wi=Se("actions"),Bn={messageHistory:[],agentModelSelections:{}};function jn(e,t){if(e===t)return!0;if(typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null)try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){Wi.warn("Failed to compare config objects",n)}return!1}class zi{constructor(){this.configOwnerCache=new Map,this.stateOwnerCache=new Map,this.configOwnerLoadPromises=new Map,this.stateOwnerLoadPromises=new Map,this.configOwnerListeners=new Map,this.stateOwnerListeners=new Map,this.instanceDataCache=new Map,this.instanceDataListeners=new Map,this.instanceLoadPromises=new Map,Wt.on("storage.configChanged",t=>{t.type==="storage.configChanged"&&this.setOwnerCache("config",t.owner,t.value)}),Wt.on("storage.stateChanged",t=>{t.type==="storage.stateChanged"&&this.setOwnerCache("state",t.owner,t.value)}),Wt.on("instance.dataChanged",t=>{t.type==="instance.dataChanged"&&this.setInstanceDataCache(t.instanceId,t.data)})}async loadConfigOwner(t){const n=this.configOwnerCache.get(t);if(n)return n;if(!this.configOwnerLoadPromises.has(t)){const r=te.fetchConfigOwner(t).then(o=>(this.setOwnerCache("config",t,o),o)).finally(()=>{this.configOwnerLoadPromises.delete(t)});this.configOwnerLoadPromises.set(t,r)}return this.configOwnerLoadPromises.get(t)}async patchConfigOwner(t,n){const r=await te.patchConfigOwner(t,n);return this.setOwnerCache("config",t,r),r}async loadStateOwner(t){const n=this.stateOwnerCache.get(t);if(n)return n;if(!this.stateOwnerLoadPromises.has(t)){const r=te.fetchStateOwner(t).then(o=>(this.setOwnerCache("state",t,o),o)).finally(()=>{this.stateOwnerLoadPromises.delete(t)});this.stateOwnerLoadPromises.set(t,r)}return this.stateOwnerLoadPromises.get(t)}async patchStateOwner(t,n){const r=await te.patchStateOwner(t,n);return this.setOwnerCache("state",t,r),r}async loadInstanceData(t){const n=this.instanceDataCache.get(t);if(n)return n;if(!this.instanceLoadPromises.has(t)){const r=te.readInstanceData(t).then(o=>{const s=this.normalizeInstanceData(o);return this.setInstanceDataCache(t,s),s}).finally(()=>{this.instanceLoadPromises.delete(t)});this.instanceLoadPromises.set(t,r)}return this.instanceLoadPromises.get(t)}async saveInstanceData(t,n){const r=this.normalizeInstanceData(n);await te.writeInstanceData(t,r),this.setInstanceDataCache(t,r)}async deleteInstanceData(t){await te.deleteInstanceData(t),this.setInstanceDataCache(t,Bn)}onConfigOwnerChanged(t,n){this.configOwnerListeners.has(t)||this.configOwnerListeners.set(t,new Set);const r=this.configOwnerListeners.get(t);r.add(n);const o=this.configOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.configOwnerListeners.delete(t)}}onStateOwnerChanged(t,n){this.stateOwnerListeners.has(t)||this.stateOwnerListeners.set(t,new Set);const r=this.stateOwnerListeners.get(t);r.add(n);const o=this.stateOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.stateOwnerListeners.delete(t)}}onInstanceDataChanged(t,n){this.instanceDataListeners.has(t)||this.instanceDataListeners.set(t,new Set);const r=this.instanceDataListeners.get(t);r.add(n);const o=this.instanceDataCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.instanceDataListeners.delete(t)}}setOwnerCache(t,n,r){if(n==="*"){t==="config"?this.configOwnerCache.clear():this.stateOwnerCache.clear();return}const o=t==="config"?this.configOwnerCache:this.stateOwnerCache,s=t==="config"?this.configOwnerListeners:this.stateOwnerListeners,i=o.get(n);if(i&&jn(i,r)){o.set(n,r);return}o.set(n,r);const a=s.get(n);if(a)for(const c of a)c(r)}normalizeInstanceData(t){const n=t??Bn,r=Array.isArray(n.messageHistory)?[...n.messageHistory]:[],o={...n.agentModelSelections??{}};return{...n,messageHistory:r,agentModelSelections:o}}setInstanceDataCache(t,n){const r=this.normalizeInstanceData(n),o=this.instanceDataCache.get(t);if(o&&jn(o,r)){this.instanceDataCache.set(t,r);return}this.instanceDataCache.set(t,r),this.notifyInstanceDataChanged(t,r)}notifyInstanceDataChanged(t,n){const r=this.instanceDataListeners.get(t);if(r)for(const o of r)o(n)}}const Z=new zi,Lr=Se("api"),Pt={messageHistory:[],agentModelSelections:{}},[gn,Fr]=T(new Map),ut=new Map,De=new Map;function Dr(e){const t=e??Pt;return{...t,messageHistory:Array.isArray(t.messageHistory)?[...t.messageHistory]:[],agentModelSelections:{...t.agentModelSelections??{}}}}function Vn(e){if(De.has(e))return;const t=Z.onInstanceDataChanged(e,n=>{Ct(e,n)});De.set(e,t)}function Ki(e){const t=De.get(e);t&&(t(),De.delete(e))}function Ct(e,t){Fr(n=>{const r=new Map(n);return r.set(e,Dr(t)),r})}async function Lt(e){if(!e||gn().has(e))return;if(ut.has(e)){await ut.get(e);return}const t=Z.loadInstanceData(e).then(n=>{Ct(e,n),Vn(e)}).catch(n=>{Lr.warn("Failed to load instance data",n),Ct(e,Pt),Vn(e)}).finally(()=>{ut.delete(e)});ut.set(e,t),await t}async function Nr(e,t){if(!e)return;await Lt(e);const n=gn().get(e)??Pt,r=Dr(n);t(r);try{await Z.saveInstanceData(e,r)}catch(o){Lr.warn("Failed to persist instance data",o)}Ct(e,r)}function Rr(e){return gn().get(e)??Pt}function Hi(e){Fr(t=>{if(!t.has(e))return t;const n=new Map(t);return n.delete(e),n}),Ki(e)}const Gi=Re(),Ji={getInstanceConfig:Rr,ensureInstanceConfig:Lt,updateInstanceConfig:Nr,clearInstanceConfig:Hi},ol=e=>(ue(()=>{for(const t of De.values())t();De.clear()}),de(Gi.Provider,{value:Ji,get children(){return e.children}})),qi=Se("api"),[_n,tn]=T(null),[sl,Wn]=T(!1),[il,ht]=T(null);let je=null;async function Xi(e=!1){return!e&&_n()?_n():je||(Wn(!0),ht(null),je=te.fetchSpeechCapabilities().then(t=>(tn(t),ht(null),t)).catch(t=>(qi.error("Failed to load speech capabilities",t),tn(null),ht(t instanceof Error?t.message:String(t)),null)).finally(()=>{Wn(!1),je=null}),je)}function Yi(){tn(null),ht(null)}const O=Se("actions"),Zi=20,Qi=5,ea=50,E={showThinkingBlocks:!1,showKeyboardShortcutHints:!0,thinkingBlocksExpansion:"expanded",showMessageTimeline:!0,showTimelineTools:!0,holdLongAssistantReplies:!0,promptSubmitOnEnter:!1,showPromptVoiceInput:!0,diffViewMode:"split",toolOutputExpansion:"expanded",diagnosticsExpansion:"expanded",toolInputsVisibility:"collapsed",showUsageMetrics:!0,autoCleanupBlankSessions:!0,keepUnseenSubagentIdleStatus:!1,osNotificationsEnabled:!1,osNotificationsAllowWhenVisible:!1,notifyOnNeedsInput:!0,notifyOnIdle:!0},Oe={provider:"openai-compatible",sttModel:"gpt-4o-mini-transcribe",ttsModel:"gpt-4o-mini-tts",ttsVoice:"alloy",playbackMode:"streaming",ttsFormat:"mp3"};function Ur(e){const t=e??{};return{showThinkingBlocks:t.showThinkingBlocks??E.showThinkingBlocks,showKeyboardShortcutHints:t.showKeyboardShortcutHints??E.showKeyboardShortcutHints,thinkingBlocksExpansion:t.thinkingBlocksExpansion??E.thinkingBlocksExpansion,showMessageTimeline:t.showMessageTimeline??E.showMessageTimeline,showTimelineTools:t.showTimelineTools??E.showTimelineTools,holdLongAssistantReplies:t.holdLongAssistantReplies??E.holdLongAssistantReplies,promptSubmitOnEnter:t.promptSubmitOnEnter??E.promptSubmitOnEnter,showPromptVoiceInput:t.showPromptVoiceInput??E.showPromptVoiceInput,locale:t.locale??E.locale,diffViewMode:t.diffViewMode??E.diffViewMode,toolOutputExpansion:t.toolOutputExpansion??E.toolOutputExpansion,diagnosticsExpansion:t.diagnosticsExpansion??E.diagnosticsExpansion,toolInputsVisibility:t.toolInputsVisibility==="hidden"||t.toolInputsVisibility==="collapsed"||t.toolInputsVisibility==="expanded"?t.toolInputsVisibility:E.toolInputsVisibility,showUsageMetrics:t.showUsageMetrics??E.showUsageMetrics,autoCleanupBlankSessions:t.autoCleanupBlankSessions??E.autoCleanupBlankSessions,keepUnseenSubagentIdleStatus:t.keepUnseenSubagentIdleStatus??E.keepUnseenSubagentIdleStatus,osNotificationsEnabled:t.osNotificationsEnabled??E.osNotificationsEnabled,osNotificationsAllowWhenVisible:t.osNotificationsAllowWhenVisible??E.osNotificationsAllowWhenVisible,notifyOnNeedsInput:t.notifyOnNeedsInput??E.notifyOnNeedsInput,notifyOnIdle:t.notifyOnIdle??E.notifyOnIdle}}function Br(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e))typeof r=="string"&&(t[n]=r);return t}function jr(e){const t=e??{};return{provider:t.provider==="openai-compatible"?t.provider:Oe.provider,apiKey:typeof t.apiKey=="string"&&t.apiKey.trim()?t.apiKey.trim():void 0,hasApiKey:t.hasApiKey===!0||typeof t.apiKey=="string"&&t.apiKey.trim().length>0,baseUrl:typeof t.baseUrl=="string"&&t.baseUrl.trim()?t.baseUrl.trim():void 0,sttModel:typeof t.sttModel=="string"&&t.sttModel.trim()?t.sttModel.trim():Oe.sttModel,ttsModel:typeof t.ttsModel=="string"&&t.ttsModel.trim()?t.ttsModel.trim():Oe.ttsModel,ttsVoice:typeof t.ttsVoice=="string"&&t.ttsVoice.trim()?t.ttsVoice.trim():Oe.ttsVoice,playbackMode:t.playbackMode==="buffered"||t.playbackMode==="streaming"?t.playbackMode:Oe.playbackMode,ttsFormat:t.ttsFormat==="wav"||t.ttsFormat==="opus"||t.ttsFormat==="aac"||t.ttsFormat==="mp3"?t.ttsFormat:Oe.ttsFormat}}function Ve(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){const o=t(r);o&&n.push(o)}return n}function ta(e){var n,r,o;const t=e??{};return{recentFolders:Ve(t.recentFolders,s=>{if(!s||typeof s!="object")return null;const i=s.path,a=s.lastAccessed,c=s.projectName;if(typeof i!="string")return null;const u=typeof a=="number"?a:Date.now();return{path:i,lastAccessed:u,...typeof c=="string"&&c.trim()?{projectName:c.trim()}:{}}}),opencodeBinaries:Ve(t.opencodeBinaries,s=>{if(!s||typeof s!="object")return null;const i=s.path;if(typeof i!="string")return null;const a=typeof s.lastUsed=="number"?s.lastUsed:Date.now(),c=typeof s.version=="string"?s.version:void 0,u=typeof s.label=="string"?s.label:void 0;return{path:i,version:c,label:u,lastUsed:a}}),remoteServers:Ve(t.remoteServers,s=>{if(!s||typeof s!="object")return null;const i=typeof s.id=="string"?s.id.trim():"",a=typeof s.name=="string"?s.name.trim():"",c=typeof s.baseUrl=="string"?s.baseUrl.trim():"";if(!i||!a||!c)return null;const u=typeof s.createdAt=="string"?s.createdAt:new Date().toISOString(),l=typeof s.updatedAt=="string"?s.updatedAt:u,d=typeof s.lastConnectedAt=="string"?s.lastConnectedAt:void 0;return{id:i,name:a,baseUrl:c,skipTlsVerify:!!s.skipTlsVerify,createdAt:u,updatedAt:l,lastConnectedAt:d}}).sort((s,i)=>{const a=s.lastConnectedAt??s.updatedAt;return(i.lastConnectedAt??i.updatedAt).localeCompare(a)}),models:{recents:Ve((n=t.models)==null?void 0:n.recents,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),favorites:Ve((r=t.models)==null?void 0:r.favorites,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),thinkingSelections:Br((o=t.models)==null?void 0:o.thinkingSelections)}}}function na(e){const t=e??{},n=t.listeningMode==="all"?"all":"local",r=t.logLevel==="INFO"||t.logLevel==="WARN"||t.logLevel==="ERROR"||t.logLevel==="DEBUG"?t.logLevel:"DEBUG",o=typeof t.opencodeBinary=="string"&&t.opencodeBinary.trim()?t.opencodeBinary:"opencode",s=Br(t.environmentVariables),i=ra(t.secureEnvVars),a=jr(t.speech);return{listeningMode:n,logLevel:r,opencodeBinary:o,environmentVariables:s,secureEnvVars:i,speech:a}}function ra(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}function Vr(e){return`${e.providerId}/${e.modelId}`}function _r(e,t){const n=t.find(o=>o.path===e),r=t.filter(o=>o.path!==e);return r.unshift({path:e,lastAccessed:Date.now(),...n!=null&&n.projectName?{projectName:n.projectName}:{}}),r.slice(0,Zi)}function hn(e,t,n){const r=Date.now(),o=n.find(i=>i.path===e);if(o){const i={...o,lastUsed:r,version:t??o.version},a=n.filter(c=>c.path!==e);return[i,...a]}return[t?{path:e,version:t,lastUsed:r}:{path:e,lastUsed:r},...n].slice(0,10)}function oa(e,t){const n=e.id?t.find(o=>o.id===e.id):void 0,r=new Date().toISOString();return{id:(n==null?void 0:n.id)??e.id??sa(),name:e.name.trim(),baseUrl:e.baseUrl.trim(),skipTlsVerify:!!e.skipTlsVerify,createdAt:(n==null?void 0:n.createdAt)??r,updatedAt:r,lastConnectedAt:n==null?void 0:n.lastConnectedAt}}function Wr(e,t){const n=t.filter(r=>r.id!==e.id);return[e,...n].sort((r,o)=>{const s=r.lastConnectedAt??r.updatedAt;return(o.lastConnectedAt??o.updatedAt).localeCompare(s)})}function sa(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`remote-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}const[mn,St]=T({}),[ia,xt]=T({}),[aa,vt]=T({}),[zr,He]=T(!1),ca=L(()=>Ur(mn().settings)),Kr=L(()=>mn().theme??"system"),oe=L(()=>na(ia())),se=L(()=>ta(aa())),B=ca,et=L(()=>se().recentFolders),tt=L(()=>se().opencodeBinaries),Ne=L(()=>se().remoteServers);let dt=null;async function Ft(){zr()||(dt||(dt=Promise.all([Z.loadConfigOwner("ui"),Z.loadConfigOwner("server"),Z.loadStateOwner("ui")]).then(([e,t,n])=>{St(e),xt(t),vt(n),He(!0)}).catch(e=>{O.error("Failed to load settings",e),St({}),xt({}),vt({}),He(!0)}).finally(()=>{dt=null})),await dt)}async function J(e,t){await Ft();const n=await Z.patchConfigOwner(e,t);e==="ui"&&St(n),e==="server"&&xt(n)}async function z(e,t){await Ft();const n=await Z.patchStateOwner(e,t);vt(n)}function K(e){const t=mn(),r={settings:Ur({...t.settings??{},...e})};J("ui",r).catch(o=>O.error("Failed to patch ui settings",o))}function Hr(e){K(e)}function la(e){Kr()!==e&&J("ui",{theme:e}).catch(t=>O.error("Failed to set theme",t))}async function ua(e){oe().listeningMode!==e&&await J("server",{listeningMode:e})}function pn(e){J("server",{environmentVariables:e}).catch(t=>O.error("Failed to update environment variables",t))}function da(e,t,n=!0){const r=oe().environmentVariables;pn({...r,[e]:t});const o=oe().secureEnvVars,s=e.toUpperCase(),i=o.some(a=>a.toUpperCase()===s);if(n){if(!i){const a=[...o,e];J("server",{secureEnvVars:a}).catch(c=>O.error("Failed to add secure env var",c))}}else if(i){const a=o.filter(c=>c.toUpperCase()!==s);J("server",{secureEnvVars:a}).catch(c=>O.error("Failed to remove secure env var",c))}}function fa(e){const t=oe().environmentVariables,{[e]:n,...r}=t;pn(r)}function ga(e){return oe().secureEnvVars.some(n=>n.toUpperCase()===e.toUpperCase())}function ha(e){const t=oe().secureEnvVars,n=e.toUpperCase(),o=t.some(s=>s.toUpperCase()===n)?t.filter(s=>s.toUpperCase()!==n):[...t,e];J("server",{secureEnvVars:o}).catch(s=>O.error("Failed to update secure env vars",s))}function ma(e){const t=e&&e.trim().length>0?e:"opencode";J("server",{opencodeBinary:t}).catch(r=>O.error("Failed to set default binary",r));const n=hn(t,void 0,tt());z("ui",{opencodeBinaries:n}).catch(r=>O.error("Failed to update binary list",r))}function pa(e){J("server",{logLevel:e??"DEBUG"}).catch(n=>O.error("Failed to set log level",n))}async function ya(e){const t=e.apiKey,{apiKey:n,...r}=e,o=jr({...oe().speech,...r,...t===null?{}:{apiKey:t}}),{hasApiKey:s,...i}=o,a={...i,...t===null?{apiKey:null}:{}};try{await J("server",{speech:a})}catch(c){throw O.error("Failed to update speech settings",c),c}}function ba(e,t){const n=hn(e,t,tt());z("ui",{opencodeBinaries:n}).catch(r=>O.error("Failed to add binary",r))}function wa(e){const t=tt().filter(n=>n.path!==e);z("ui",{opencodeBinaries:t}).catch(n=>O.error("Failed to remove binary",n)),oe().opencodeBinary===e&&J("server",{opencodeBinary:"opencode"}).catch(n=>O.error("Failed to reset default binary",n))}function Ca(e){const t=_r(e,et());z("ui",{recentFolders:t}).catch(n=>O.error("Failed to add recent folder",n))}function Sa(e){const t=et().filter(n=>n.path!==e);z("ui",{recentFolders:t}).catch(n=>O.error("Failed to remove recent folder",n))}async function xa(e,t){const n=t.trim();if(!e||!n)return;const r=et().map(o=>o.path===e?{...o,projectName:n}:o);try{await z("ui",{recentFolders:r})}catch(o){throw O.error("Failed to rename recent folder",o),o}}async function va(e){const t=oa(e,Ne());return await z("ui",{remoteServers:Wr(t,Ne())}),t}async function Oa(e){const t=Ne().find(o=>o.id===e);if(!t)return;const n=new Date().toISOString(),r={...t,updatedAt:n,lastConnectedAt:n};await z("ui",{remoteServers:Wr(r,Ne())})}function ka(e){const t=Ne().filter(n=>n.id!==e);z("ui",{remoteServers:t}).catch(n=>O.error("Failed to remove remote server",n))}function $a(e,t){const n=t&&t.trim().length>0?t:oe().opencodeBinary,r=_r(e,et()),o=hn(n,void 0,tt());z("ui",{recentFolders:r,opencodeBinaries:o}).catch(s=>O.error("Failed to update ui state on launch",s)),J("server",{opencodeBinary:n}).catch(s=>O.error("Failed to persist selected binary",s))}function Aa(e){if(!e.providerId||!e.modelId)return;const n=se().models.recents.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId),r=[e,...n].slice(0,Qi);z("ui",{models:{recents:r}}).catch(o=>O.error("Failed to update model recents",o))}function Ea(e){return!e.providerId||!e.modelId?!1:se().models.favorites.some(t=>t.providerId===e.providerId&&t.modelId===e.modelId)}function Ta(e){if(!e.providerId||!e.modelId)return;const t=se().models.favorites,r=t.some(o=>o.providerId===e.providerId&&o.modelId===e.modelId)?t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId):[e,...t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId)].slice(0,ea);z("ui",{models:{favorites:r}}).catch(o=>O.error("Failed to update model favorites",o))}function Ma(e){if(!(!e.providerId||!e.modelId))return se().models.thinkingSelections[Vr(e)]}function Ia(e,t){if(!e.providerId||!e.modelId)return;const n=Vr(e);if(se().models.thinkingSelections[n]===t)return;const o={...se().models.thinkingSelections};t?o[n]=t:delete o[n],z("ui",{models:{thinkingSelections:o}}).catch(s=>O.error("Failed to update thinking selection",s))}function Pa(e){B().diffViewMode!==e&&K({diffViewMode:e})}function La(e){B().toolOutputExpansion!==e&&K({toolOutputExpansion:e})}function Fa(e){B().diagnosticsExpansion!==e&&K({diagnosticsExpansion:e})}function Da(e){B().toolInputsVisibility!==e&&K({toolInputsVisibility:e})}function Na(e){B().thinkingBlocksExpansion!==e&&K({thinkingBlocksExpansion:e})}function Ra(){K({showThinkingBlocks:!B().showThinkingBlocks})}function Ua(){Hr({showKeyboardShortcutHints:!B().showKeyboardShortcutHints})}function Ba(){K({showTimelineTools:!B().showTimelineTools})}function ja(){K({showMessageTimeline:!(B().showMessageTimeline??!0)})}function Va(){K({showUsageMetrics:!B().showUsageMetrics})}function _a(){K({promptSubmitOnEnter:!B().promptSubmitOnEnter})}function Wa(){K({showPromptVoiceInput:!B().showPromptVoiceInput})}function za(){const e=!B().autoCleanupBlankSessions;O.info("toggle auto cleanup",{value:e}),K({autoCleanupBlankSessions:e})}async function Ka(e,t,n){!e||!t||!n.providerId||!n.modelId||(await Lt(e),await Nr(e,r=>{const o={...r.agentModelSelections??{}},s=o[t];s&&s.providerId===n.providerId&&s.modelId===n.modelId||(o[t]=n,r.agentModelSelections=o)}))}async function Ha(e,t){return!e||!t?void 0:(await Lt(e),(Rr(e).agentModelSelections??{})[t])}Ft().catch(e=>{O.error("Failed to initialize settings",e)});const Gr=Re(),Ga={isLoaded:zr,preferences:B,updatePreferences:Hr,themePreference:Kr,setThemePreference:la,serverSettings:oe,setListeningMode:ua,updateEnvironmentVariables:pn,addEnvironmentVariable:da,removeEnvironmentVariable:fa,isSecureEnvVar:ga,toggleSecureEnvVar:ha,updateLastUsedBinary:ma,updateLogLevel:pa,updateSpeechSettings:ya,recentFolders:et,opencodeBinaries:tt,remoteServers:Ne,uiState:se,addRecentFolder:Ca,removeRecentFolder:Sa,renameRecentFolderProject:xa,addOpenCodeBinary:ba,removeOpenCodeBinary:wa,saveRemoteServerProfile:va,markRemoteServerConnected:Oa,removeRemoteServerProfile:ka,recordWorkspaceLaunch:$a,addRecentModelPreference:Aa,isFavoriteModelPreference:Ea,toggleFavoriteModelPreference:Ta,getModelThinkingSelection:Ma,setModelThinkingSelection:Ia,toggleShowThinkingBlocks:Ra,toggleKeyboardShortcutHints:Ua,toggleShowMessageTimeline:ja,toggleShowTimelineTools:Ba,toggleUsageMetrics:Va,toggleAutoCleanupBlankSessions:za,togglePromptSubmitOnEnter:_a,toggleShowPromptVoiceInput:Wa,setDiffViewMode:Pa,setToolOutputExpansion:La,setDiagnosticsExpansion:Fa,setThinkingBlocksExpansion:Na,setToolInputsVisibility:Da,setAgentModelPreference:Ka,getAgentModelPreference:Ha},al=e=>(At(()=>{Ft().catch(o=>{O.error("Failed to initialize settings",o)});const t=Z.onConfigOwnerChanged("ui",o=>{St(o),He(!0)}),n=Z.onConfigOwnerChanged("server",o=>{xt(o),He(!0),Yi(),Xi(!0)}),r=Z.onStateOwnerChanged("ui",o=>{vt(o),He(!0)});return()=>{t(),n(),r()}}),de(Gr.Provider,{value:Ga,get children(){return e.children}}));function Ja(){const e=Ye(Gr);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e}function qa(e,t,n){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((s,i)=>(i&&(n&&n[i]&&s.push(n[i]),s.push(t(i))),s),[]).join(" ")}),r}const Xa=Symbol("solid-inspect"),Ya=Re();function Za(e){function t(n){var r;return(r=Ye(Ya))!=null&&r.enabled?{Component:t,props:n,$INSPECT:Xa}:e(n)}return Object.defineProperty(t,"name",{value:e.name}),t.toString=e.toString,t}function Jr(){return function(e){function t(a){const c=!!e.slotClasses,u=()=>{if(!e.slotClasses)throw new Error("'slotClasses' option is not defined");if(!e.utilityClass)throw new Error("'utilityClass' option is not defined");return qa(e.slotClasses(a),e.utilityClass,a.classes??"")},l=Uo({});return c&&ao(()=>{const d=u();Ae(()=>{for(const g in d)l[g]=d[g]})}),l}function n(a){const[c,u]=$t(a,e.selfPropNames);return{allProps:a,props:c,otherProps:u}}function r(a){return As({propDefaults:a.propDefaults||e.propDefaults,props:a.props,name:e.name})}function o(a){const c=r({props:a});return n(c)}function s(a,c=!0){return a=Za(a),a.toString=()=>`.${e.name}-root`,c&&Er(a,"base"),a}function i(a){const c=s(function(l){const{allProps:d,otherProps:g,props:p}=o(l),y=e.autoCallUseClasses??!0?t(d):{};return a({allProps:d,otherProps:g,props:p,classes:y})});return Object.defineProperty(c,"name",{value:a.name}),c}return{name:e.name,selfPropNames:e.selfPropNames,component:i,defineComponent:s,useClasses:t,useThemeProps:r,useProps:o,splitInProps:n}}}const Qa=Jr()({name:"MuiGlobalStyles",selfPropNames:["styles"]}),ec=Qa.component(function({props:t}){return xr(()=>({"@global":t.styles||{}})),[]}),tc=Jr()({name:"MuiCssBaseline",selfPropNames:["children","enableColorScheme"],propDefaults:({set:e})=>e({enableColorScheme:!1})}),nc=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&{colorScheme:e.palette.mode}}),rc=e=>({color:e.palette.text.primary,...e.typography.body1,backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}}),oc=(e,t=!1)=>({html:nc(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...rc(e),"&::backdrop":{backgroundColor:e.palette.background.default}}}),sc=tc.component(function({props:t}){const n=gr();return de(ec,{get styles(){return oc(n,t.enableColorScheme)}})}),qr=Re();function zn(e){if(!(typeof document>"u")){if(e==="system"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}const ic={backgroundDefault:"#ffffff",backgroundPaper:"#f5f5f5",primary:"#0066ff",primaryContrast:"#ffffff",textPrimary:"#1a1a1a",textSecondary:"#666666",divider:"#e0e0e0"},ac={backgroundDefault:"#1a1a1a",backgroundPaper:"#2a2a2a",primary:"#0080ff",primaryContrast:"#1a1a1a",textPrimary:"#cfd4dc",textSecondary:"#999999",divider:"#3a3a3a"},me=(e,t,n)=>{if(!n)return t;const r=n.getPropertyValue(e);return r&&r.trim()||t},cc=e=>{const t=e?ac:ic,n=typeof window<"u"?getComputedStyle(document.documentElement):null;return{backgroundDefault:me("--surface-base",t.backgroundDefault,n),backgroundPaper:me("--surface-secondary",t.backgroundPaper,n),primary:me("--accent-primary",t.primary,n),primaryContrast:me("--text-inverted",t.primaryContrast,n),textPrimary:me("--text-primary",t.textPrimary,n),textSecondary:me("--text-secondary",t.textSecondary,n),divider:me("--border-base",t.divider,n)}};function cl(e){const t=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,{themePreference:n,setThemePreference:r}=Ja(),[o,s]=T(!0),[i,a]=T(0),c=()=>n(),u=()=>{const y=c();return y==="dark"?!0:y==="light"?!1:(t==null?void 0:t.matches)??!1},l=()=>{const y=c(),C=u();zn(y==="system"?"system":y),s(C),typeof window<"u"?requestAnimationFrame(()=>a(b=>b+1)):a(b=>b+1)};W(()=>{l()}),At(()=>{if(!t)return;const y=()=>{l()};return t.addEventListener("change",y),()=>{t.removeEventListener("change",y)}});const d=y=>{r(y)},g=()=>{const y=c();d(y==="system"?"light":y==="light"?"dark":"system")},p=L(()=>{i();const y=cc(o());return ur({palette:{mode:o()?"dark":"light",primary:{main:y.primary,contrastText:y.primaryContrast},secondary:{main:y.primary},background:{default:y.backgroundDefault,paper:y.backgroundPaper},text:{primary:y.textPrimary,secondary:y.textSecondary},divider:y.divider},typography:{fontFamily:"var(--font-family-sans)"},shape:{borderRadius:8},components:{MuiIconButton:{styleOverrides:{root:{color:"inherit","&.Mui-disabled":{color:"var(--text-muted)",opacity:.55}}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)"}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)",boxShadow:"none",borderBottom:"1px solid var(--border-base)",zIndex:10}}},MuiToolbar:{styleOverrides:{root:{minHeight:"56px"}}}}})});return de(qr.Provider,{value:{isDark:o,themeMode:c,setThemeMode:d,cycleThemeMode:g},get children(){return de(Es,{get theme(){return p()},get children(){return[de(sc,{}),wo(()=>e.children)]}})}})}function Xr(){const e=Ye(qr);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const lc=/(^|\n)@@/m,uc=/(^|\n)(diff --git |--- |\+\+\+)/,dc=/^\*\*\* (Begin|End) Patch/,fc=/^\*\*\* Update File: (.+)$/,gc=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function hc(e){const t=e.trim();if(!t.startsWith("```"))return t;const n=t.split(`
16
- `);return n.length<2?"":n[n.length-1].startsWith("```")?n.slice(1,-1).join(`
17
- `):t}function mc(e){var s;if(!e)return"";const n=hc(e.replace(/\r\n/g,`
18
- `)).split(`
19
- `).map(i=>i.replace(/\s+$/u,""));let r=null;const o=[];for(const i of n){if(!i||dc.test(i))continue;const a=i.match(fc);if(a){r=((s=a[1])==null?void 0:s.trim())||null;continue}o.push(i)}return r&&!uc.test(o.join(`
20
- `))&&(o.unshift(`+++ b/${r}`),o.unshift(`--- a/${r}`)),o.join(`
21
- `).trim()}function ll(e){if(!e)return!1;const t=mc(e);return t?lc.test(t):!1}function pc(e){if(!e||e.trim().length===0)return{before:"",after:""};const t=e.replace(/\r\n/g,`
22
- `).split(`
23
- `),n=[],r=[];for(const o of t)o.startsWith("---")||o.startsWith("+++")||o.startsWith("diff --git")||gc.test(o)||(o.startsWith("-")&&!o.startsWith("---")?n.push(o.slice(1)):o.startsWith("+")&&!o.startsWith("+++")?r.push(o.slice(1)):o.startsWith(" ")?(n.push(o.slice(1)),r.push(o.slice(1))):o===""?(n.push(""),r.push("")):(n.push(o),r.push(o)));for(;n.length>0&&n[n.length-1]==="";)n.pop();for(;r.length>0&&r[r.length-1]==="";)r.pop();return{before:n.join(`
24
- `),after:r.join(`
25
- `)}}const yc="0.52.2",nn=`https://cdn.jsdelivr.net/npm/monaco-editor@${yc}/min/vs`,Y="/monaco/vs";let ft=null;function bc(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("timeout")),t);e.then(s=>{clearTimeout(o),n(s)}).catch(s=>{clearTimeout(o),r(s)})})}async function wc(){if(typeof fetch>"u")return!1;try{const e=new AbortController,t=fetch(`${nn}/loader.js`,{method:"HEAD",signal:e.signal}),n=await bc(t,1200);return e.abort(),n.ok}catch{return!1}}function Cc(){return typeof document>"u"||document.querySelector('script[data-monaco-loader="true"]')?Promise.resolve():new Promise((t,n)=>{const r=document.createElement("script");r.dataset.monacoLoader="true",r.src=`${Y}/loader.js`,r.async=!0,r.onload=()=>t(),r.onerror=()=>n(new Error("Failed to load Monaco AMD loader")),document.head.appendChild(r)})}function Sc(){if(typeof document>"u"||document.querySelector('link[data-monaco-editor-css="true"]'))return;const t=document.createElement("link");t.rel="stylesheet",t.href=`${Y}/editor/editor.main.css`,t.dataset.monacoEditorCss="true",document.head.appendChild(t)}function xc(){const e=globalThis,t=e.MonacoEnvironment??{},n="/monaco.worker.js";e.MonacoEnvironment={...t,getWorkerUrl(r,o){return n}}}function Yr(){const e=globalThis.require;if(!e)throw new Error("Monaco AMD loader is not available");return e}function vc(){const t=Yr().config;if(!t)throw new Error("require.config is not available");return t}function rn(e){const t=Yr();return new Promise((n,r)=>{t(e,(...o)=>n(o),o=>r(o))})}function Oc(e){const t=String(e||"plaintext");return!t||t==="plaintext"?null:t==="typescript"||t==="javascript"?"vs/language/typescript/monaco.contribution":t==="json"?"vs/language/json/monaco.contribution":t==="css"||t==="scss"||t==="less"?"vs/language/css/monaco.contribution":t==="html"?"vs/language/html/monaco.contribution":t==="toml"?"vs/basic-languages/toml/toml":`vs/basic-languages/${t}/${t}`}const Kn=new Set,zt=new Map;async function Zr(e){const t=Oc(e);if(!t||Kn.has(t))return;const n=zt.get(t);if(n)return n;const r=(async()=>{let o=!1;try{await rn([t]),o=!0}catch{}finally{o&&Kn.add(t),zt.delete(t)}})();return zt.set(t,r),r}async function Qr(){return ft||(ft=(async()=>{await Cc(),xc(),Sc();const e=await wc(),t=vc(),n={vs:Y};e&&(n["vs/basic-languages"]=`${nn}/basic-languages`,n["vs/language"]=`${nn}/language`,n["vs/basic-languages/python"]=`${Y}/basic-languages/python`,n["vs/basic-languages/markdown"]=`${Y}/basic-languages/markdown`,n["vs/basic-languages/cpp"]=`${Y}/basic-languages/cpp`,n["vs/basic-languages/kotlin"]=`${Y}/basic-languages/kotlin`,n["vs/language/typescript"]=`${Y}/language/typescript`,n["vs/language/html"]=`${Y}/language/html`,n["vs/language/json"]=`${Y}/language/json`,n["vs/language/css"]=`${Y}/language/css`),t({paths:n,ignoreDuplicateModules:["vs/editor/editor.main"]});const[r]=await rn(["vs/editor/editor.main"]);return await rn(["vs/basic-languages/monaco.contribution"]).catch(()=>[]),globalThis.monaco??r})(),ft)}const kc=5,ce=new Map;function $c(e,t){ce.delete(e),ce.set(e,t)}function Ac(){for(;ce.size>kc;){const e=ce.keys().next().value;if(!e)return;const t=ce.get(e);ce.delete(e);try{t==null||t.model.dispose()}catch{}}}function on(e){const t=ce.get(e.cacheKey);if(t)return $c(e.cacheKey,t),t.model.getValue()!==e.value&&t.model.setValue(e.value),t.model;const n=e.monaco.Uri.parse(`opencode://model/${encodeURIComponent(e.cacheKey)}`),r=e.monaco.editor.createModel(e.value,"plaintext",n),o={model:r};return ce.set(e.cacheKey,o),Ac(),r}let gt=null;function Ec(e){var o;if(gt)return gt;const t=new Map,n=new Map,r=typeof((o=e==null?void 0:e.languages)==null?void 0:o.getLanguages)=="function"?e.languages.getLanguages():[];if(Array.isArray(r))for(const s of r){const i=typeof(s==null?void 0:s.id)=="string"?s.id:null;if(!i)continue;const a=Array.isArray(s==null?void 0:s.filenames)?s.filenames:[];for(const u of a)typeof u=="string"&&(t.has(u)||t.set(u,i));const c=Array.isArray(s==null?void 0:s.extensions)?s.extensions:[];for(const u of c)typeof u=="string"&&(n.has(u)||n.set(u,i))}return gt={fileNameToId:t,extToId:n},gt}function Tc(e){return e===".gitignore"||e===".gitattributes"||e===".gitmodules"||e==="Makefile"||e.startsWith("Makefile.")?"shell":null}function eo(e,t){const n=String(t||"").trim(),r=n.split("/").pop()||n,o=Tc(r);if(o)return o;const s=Ec(e),i=s.fileNameToId.get(r);if(i)return i;const a=r.lastIndexOf(".");if(a>0){const c=r.slice(a),u=s.extToId.get(c);if(u)return u}return"plaintext"}var Mc=sn("<div class=monaco-viewer>");function Ic(e){const{isDark:t}=Xr();let n,r=null,o=null;const[s,i]=T(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null},c=()=>{!r||!e.onSave||e.onSave(r.getValue())},u=l=>{if(!e.compactGutter)return 5;const d=l.split(/\r\n|\r|\n/).length;return Math.max(3,String(d).length+1)};return At(()=>{let l=!1;(async()=>(o=await Qr(),!l&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.create(n,{value:"",language:"plaintext",readOnly:!1,automaticLayout:!0,lineNumbers:"on",lineNumbersMinChars:u(e.content),glyphMargin:!1,folding:!e.compactGutter,lineDecorationsWidth:e.compactGutter?8:10,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"off",renderWhitespace:"selection",fontSize:13}),r.addCommand(o.KeyMod.CtrlCmd|o.KeyCode.KeyS,c),r.onDidChangeModelContent(()=>{e.onContentChange&&e.onContentChange(r.getValue())}),i(!0)))))(),ue(()=>{l=!0,i(!1),a()})}),W(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),W(()=>{!s()||!r||r.updateOptions({wordWrap:e.wordWrap==="on"?"on":"off"})}),W(()=>{!s()||!r||r.updateOptions({lineNumbersMinChars:u(e.content),folding:!e.compactGutter,lineDecorationsWidth:e.compactGutter?8:10})}),W(()=>{if(!s()||!o||!r)return;const l=eo(o,e.path),d=`${e.scopeKey}:file:${e.path}`,g=on({monaco:o,cacheKey:d,value:e.content});r.setModel(g),Zr(l).then(()=>{try{o.editor.setModelLanguage(g,l)}catch{}})}),(()=>{var l=Mc(),d=n;return typeof d=="function"?an(d,l):n=l,l})()}const ul=Object.freeze(Object.defineProperty({__proto__:null,MonacoFileViewer:Ic},Symbol.toStringTag,{value:"Module"}));var Pc=sn("<div class=monaco-viewer><div class=git-change-context-overlay>"),Lc=sn("<div class=git-change-context-widget-host><button type=button class=git-change-context-widget>+");function Ot(e){return e?e.split(`
26
- `).length:1}function kt(e){return String(Math.max(1,e)).length}function Fc(e){const t=Ot(e.before),n=Ot(e.after),r=kt(t),o=kt(n),s=Math.max(r,o),i=Math.max(0,s-2),a=Math.max(2,r),c=Math.max(2,o),u=Math.max(0,s-3);return{diffEditorLineNumbersMinChars:Math.max(a,c),originalLineNumbersMinChars:a,modifiedLineNumbersMinChars:c,lineDecorationsWidth:6+i*2+u*2}}function Dc(e){const t=Ot(e.before),n=Ot(e.after),r=kt(t),o=kt(n),s=Math.max(r,o),i=Math.max(0,s-2),a=Math.max(2,r),c=Math.max(2,o),u=Math.max(0,s-3);return{diffEditorLineNumbersMinChars:Math.max(a,c),originalLineNumbersMinChars:a,modifiedLineNumbersMinChars:c,lineDecorationsWidth:8+i*2+u}}function Nc(e){const{isDark:t}=Xr();let n,r=null,o=null,s=null;const[i,a]=T(!1),[c,u]=T(null),[l,d]=T(null),[g,p]=T(!1),[y,C]=T(null),b=L(()=>e.patch!==void 0&&e.patch!==null?pc(e.patch):{before:e.before??"",after:e.after??""}),I=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null},N=()=>{n&&(n.style.removeProperty("--split-original-line-number-width"),n.style.removeProperty("--split-original-delete-sign-left"),n.style.removeProperty("--split-original-gutter-width"))},F=h=>{if(n){if(s!==null&&typeof window<"u"&&(window.cancelAnimationFrame(s),s=null),h.viewMode!=="split"||typeof window>"u"){N();return}s=window.requestAnimationFrame(()=>{if(s=null,!n)return;const w=n.querySelector(".editor.original .line-numbers"),k=(w==null?void 0:w.getBoundingClientRect().width)??0,x=k>0?k:Math.max(12,h.originalLineNumbersMinChars*6);n.style.setProperty("--split-original-line-number-width",`${x}px`),n.style.setProperty("--split-original-delete-sign-left",`${x}px`),n.style.setProperty("--split-original-gutter-width",`${x+h.lineDecorationsWidth}px`)})}},q=()=>{var h;return((h=r==null?void 0:r.getModifiedEditor)==null?void 0:h.call(r))??null},nt=()=>{const h=l();if(h)return h;if(g()&&c())return{startLine:c(),endLine:c()};const w=c();return w?{startLine:w,endLine:w}:null},j=()=>{var x,v,A,S;const h=q(),w=n;if(!h||!w)return;const k=nt();if(!k){C(null);return}try{const M=(x=h.getDomNode)==null?void 0:x.call(h);if(!M){C(null);return}const R=M.querySelector(".margin"),X=M.querySelector(".monaco-scrollable-element.editor-scrollable"),ge=((v=h.getTopForLineNumber)==null?void 0:v.call(h,k.startLine))??0,xe=((A=h.getScrollTop)==null?void 0:A.call(h))??0,rt=Number(((S=h.getOption)==null?void 0:S.call(h,o.editor.EditorOption.lineHeight))??18),Be=M.getBoundingClientRect(),he=w.getBoundingClientRect(),ot=Be.left-he.left+((R==null?void 0:R.offsetWidth)??(X==null?void 0:X.offsetLeft)??0),to=Be.top-he.top+(ge-xe)+rt/2;C({top:to,left:ot})}catch{C(null)}};return At(()=>{let h=!1;(async()=>(o=await Qr(),!h&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.createDiffEditor(n,{readOnly:!0,automaticLayout:!0,renderSideBySide:!0,renderSideBySideInlineBreakpoint:0,renderMarginRevertIcon:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,renderWhitespace:"selection",fontSize:13,wordWrap:e.wordWrap==="on"?"on":"off",glyphMargin:!1,folding:!1,lineNumbersMinChars:4,lineDecorationsWidth:12,diffAlgorithm:"legacy",maxComputationTime:1e4}),a(!0),j()))))(),ue(()=>{h=!0,s!==null&&typeof window<"u"&&(window.cancelAnimationFrame(s),s=null),N(),a(!1),I()})}),W(()=>{!i()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),W(()=>{n&&(n.dataset.viewMode=e.viewMode==="split"?"split":"unified")}),W(()=>{var k;if(!i()||!o||!r)return;const h=(k=r.getModifiedEditor)==null?void 0:k.call(r);if(!(h!=null&&h.onDidChangeCursorSelection))return;const w=h.onDidChangeCursorSelection(x=>{var A;const v=x==null?void 0:x.selection;if(!v||(A=v.isEmpty)!=null&&A.call(v)){d(null),j();return}d({startLine:Math.min(v.startLineNumber,v.endLineNumber),endLine:Math.max(v.startLineNumber,v.endLineNumber)}),j()});ue(()=>{var x;try{(x=w==null?void 0:w.dispose)==null||x.call(w)}catch{}})}),W(()=>{var v;if(!i()||!o||!r)return;const h=q();if(!(h!=null&&h.onMouseMove)||!(h!=null&&h.onMouseLeave)||!(h!=null&&h.onMouseDown))return;const w=h.onMouseMove(A=>{var M,R;const S=(R=(M=A==null?void 0:A.target)==null?void 0:M.position)==null?void 0:R.lineNumber;u(typeof S=="number"?S:null),j()}),k=h.onMouseLeave(()=>{g()||u(null),j()}),x=(v=h.onDidScrollChange)==null?void 0:v.call(h,()=>{j()});ue(()=>{var A,S,M;try{(A=w==null?void 0:w.dispose)==null||A.call(w),(S=k==null?void 0:k.dispose)==null||S.call(k),(M=x==null?void 0:x.dispose)==null||M.call(x)}catch{}})}),W(()=>{if(!i()||!o||!r)return;nt()||C(null),j()}),W(()=>{var ge,xe,rt,Be,he,ot;if(!i()||!o||!r)return;const h=e.viewMode==="unified"?"unified":"split",w=e.contextMode==="collapsed"?"collapsed":"expanded",k=e.wordWrap==="on"?"on":"off",{before:x,after:v}=b(),A=h==="unified"?Fc({before:x,after:v}):Dc({before:x,after:v}),{diffEditorLineNumbersMinChars:S,originalLineNumbersMinChars:M,modifiedLineNumbersMinChars:R,lineDecorationsWidth:X}=A;r.updateOptions({renderSideBySide:h==="split",renderSideBySideInlineBreakpoint:0,renderIndicators:!0,lineNumbersMinChars:S,lineDecorationsWidth:X,hideUnchangedRegions:w==="collapsed"?{enabled:!0}:{enabled:!1},wordWrap:k});try{(rt=(xe=(ge=r.getOriginalEditor)==null?void 0:ge.call(r))==null?void 0:xe.updateOptions)==null||rt.call(xe,{wordWrap:k,lineNumbersMinChars:M,lineDecorationsWidth:X})}catch{}try{(ot=(he=(Be=r.getModifiedEditor)==null?void 0:Be.call(r))==null?void 0:he.updateOptions)==null||ot.call(he,{wordWrap:k,lineNumbersMinChars:R,lineDecorationsWidth:X})}catch{}F({viewMode:h,originalLineNumbersMinChars:M,lineDecorationsWidth:X})}),W(()=>{if(!i()||!o||!r)return;const h=eo(o,e.path),{before:w,after:k}=b(),x=`${e.scopeKey}:diff:${e.path}:before`,v=`${e.scopeKey}:diff:${e.path}:after`,A=on({monaco:o,cacheKey:x,value:w}),S=on({monaco:o,cacheKey:v,value:k});r.setModel({original:A,modified:S}),Zr(h).then(()=>{try{o.editor.setModelLanguage(A,h),o.editor.setModelLanguage(S,h)}catch{}})}),(()=>{var h=Pc(),w=h.firstChild,k=n;return typeof k=="function"?an(k,h):n=h,pt(w,de(co,{get when(){return y()},children:x=>(()=>{var v=Lc(),A=v.firstChild;return v.addEventListener("mouseleave",()=>{p(!1),j()}),v.addEventListener("mouseenter",()=>{p(!0),j()}),A.$$click=S=>{var R;S.preventDefault(),S.stopPropagation();const M=nt();M&&((R=e.onRequestInsertContext)==null||R.call(e,M))},A.$$mousedown=S=>{S.preventDefault(),S.stopPropagation()},le(S=>{var M=`${x().top}px`,R=`${x().left}px`,X=e.insertContextLabel??"Add git change context to prompt",ge=e.insertContextLabel??"Add git change context to prompt";return M!==S.e&&wn(v,"top",S.e=M),R!==S.t&&wn(v,"left",S.t=R),X!==S.a&&qe(A,"aria-label",S.a=X),ge!==S.o&&qe(A,"title",S.o=ge),S},{e:void 0,t:void 0,a:void 0,o:void 0}),v})()})),h})()}Xn(["mousedown","click"]);const dl=Object.freeze(Object.defineProperty({__proto__:null,MonacoDiffViewer:Nc},Symbol.toStringTag,{value:"Module"}));export{Rr as $,Ma as A,Lt as B,nl as C,_c as D,Ja as E,ko as F,tl as G,Hc as H,Jr as I,fi as J,Jc as K,Qc as L,mi as M,Ar as N,Gc as O,Vc as P,Xc as Q,Vs as R,Yc as S,qc as T,el as U,Uo as V,Zc as W,Wo as X,_o as Y,Xr as Z,ll as _,vo as a,Nr as a0,rl as a1,Ta as a2,Ia as a3,ua as a4,sl as a5,il as a6,Z as a7,jc as a8,ol as a9,cl as aa,al as ab,mc as ac,ul as ad,dl as ae,Yn as b,Wc as c,qe as d,gr as e,Xn as f,wn as g,Oo as h,pt as i,te as j,Se as k,Wt as l,wo as m,Ha as n,se as o,Kc as p,Ka as q,zc as r,$o as s,sn as t,an as u,B as v,Xi as w,_n as x,oe as y,Aa as z};
@@ -1,59 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-viewer-Dc4-Qlfy.js","assets/monaco-viewer-CavxO_DD.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css","assets/main-CubPCiKs.js","assets/index-BukIsQdK.js","assets/index-rOdMpwo6.css"])))=>i.map(i=>d[i]);
2
- import{t as F,i as w,u as Ue,a as Ie,d as P,m as Ce,f as ot,h as xe,E as os,Z as ls,g as gt,k as as}from"./monaco-viewer-CavxO_DD.js";import{n as T,m as On,b as Se,c as L,F as Mt,S as x,a as z,d as Z,A as cs,z as us,t as fs,o as hn}from"./git-diff-vendor-CSgooKT_.js";import{I as kn,g as ds,a as gs,b as In,P as hs,c as En,u as ms,d as ys,e as Pt,C as Rt,S as bs,M as ps,m as ws,f as Ss,r as vs,h as $s,i as An,j as Cs,k as Os,A as mn,l as ks,n as Is,o as Es,p as As,q as Ts,s as Ns,t as _s,v as js,w as Ls,V as Ms,L as Ps,x as Rs,y as Ds,z as Vs,B as yn,D as Bs,E as Fs,F as Ks,G as Js}from"./main-CubPCiKs.js";import{u as Kt,_ as qs}from"./index-BukIsQdK.js";import{A as Qs}from"./align-justify-Dxvk4j0i.js";import{W as Us}from"./wrap-text-B0kJ9Vff.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const xs=[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]],Ws=e=>T(kn,On(e,{name:"Hourglass",iconNode:xs})),Hs=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ys=e=>T(kn,On(e,{name:"XCircle",iconNode:Hs})),Jt=Symbol.for("yaml.alias"),Dt=Symbol.for("yaml.document"),_e=Symbol.for("yaml.map"),Tn=Symbol.for("yaml.pair"),Ct=Symbol.for("yaml.scalar"),He=Symbol.for("yaml.seq"),ye=Symbol.for("yaml.node.type"),Re=e=>!!e&&typeof e=="object"&&e[ye]===Jt,lt=e=>!!e&&typeof e=="object"&&e[ye]===Dt,at=e=>!!e&&typeof e=="object"&&e[ye]===_e,G=e=>!!e&&typeof e=="object"&&e[ye]===Tn,U=e=>!!e&&typeof e=="object"&&e[ye]===Ct,ct=e=>!!e&&typeof e=="object"&&e[ye]===He;function W(e){if(e&&typeof e=="object")switch(e[ye]){case _e:case He:return!0}return!1}function H(e){if(e&&typeof e=="object")switch(e[ye]){case Jt:case _e:case Ct:case He:return!0}return!1}const Nn=e=>(U(e)||W(e))&&!!e.anchor,Le=Symbol("break visit"),zs=Symbol("skip children"),st=Symbol("remove node");function Ye(e,t){const n=Gs(t);lt(e)?Fe(null,e.contents,n,Object.freeze([e]))===st&&(e.contents=null):Fe(null,e,n,Object.freeze([]))}Ye.BREAK=Le;Ye.SKIP=zs;Ye.REMOVE=st;function Fe(e,t,n,s){const i=Xs(e,t,n,s);if(H(i)||G(i))return Zs(e,s,i),Fe(e,i,n,s);if(typeof i!="symbol"){if(W(t)){s=Object.freeze(s.concat(t));for(let r=0;r<t.items.length;++r){const o=Fe(r,t.items[r],n,s);if(typeof o=="number")r=o-1;else{if(o===Le)return Le;o===st&&(t.items.splice(r,1),r-=1)}}}else if(G(t)){s=Object.freeze(s.concat(t));const r=Fe("key",t.key,n,s);if(r===Le)return Le;r===st&&(t.key=null);const o=Fe("value",t.value,n,s);if(o===Le)return Le;o===st&&(t.value=null)}}return i}function Gs(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Xs(e,t,n,s){var i,r,o,l,a;if(typeof n=="function")return n(e,t,s);if(at(t))return(i=n.Map)==null?void 0:i.call(n,e,t,s);if(ct(t))return(r=n.Seq)==null?void 0:r.call(n,e,t,s);if(G(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(U(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,s);if(Re(t))return(a=n.Alias)==null?void 0:a.call(n,e,t,s)}function Zs(e,t,n){const s=t[t.length-1];if(W(s))s.items[e]=n;else if(G(s))e==="key"?s.key=n:s.value=n;else if(lt(s))s.contents=n;else{const i=Re(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const ei={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ti=e=>e.replace(/[!,[\]{}]/g,t=>ei[t]);class le{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},le.defaultYaml,t),this.tags=Object.assign({},le.defaultTags,n)}clone(){const t=new le(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new le(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:le.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},le.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:le.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},le.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+ti(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(t&&s.length>0&&H(t.contents)){const r={};Ye(t.contents,(o,l)=>{H(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(l=>l.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
3
- `)}}le.defaultYaml={explicit:!1,version:"1.2"};le.defaultTags={"!!":"tag:yaml.org,2002:"};function _n(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function jn(e){const t=new Set;return Ye(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function Ln(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function ni(e,t){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i??(i=jn(e));const o=Ln(t,i);return i.add(o),o},setAnchors:()=>{for(const r of n){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(U(o.node)||W(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:s}}function Ke(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){const o=s[i],l=Ke(e,s,String(i),o);l===void 0?delete s[i]:l!==o&&(s[i]=l)}else if(s instanceof Map)for(const i of Array.from(s.keys())){const r=s.get(i),o=Ke(e,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(const i of Array.from(s)){const r=Ke(e,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(const[i,r]of Object.entries(s)){const o=Ke(e,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return e.call(t,n,s)}function he(e,t,n){if(Array.isArray(e))return e.map((s,i)=>he(s,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!Nn(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class qt{constructor(t){Object.defineProperty(this,ye,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!lt(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=he(this,"",o);if(typeof i=="function")for(const{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?Ke(r,{"":l},"",l):l}}class Mn extends qt{constructor(t){super(Jt),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],Ye(t,{Node:(r,o)=>{(Re(o)||Nn(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,o=this.resolve(i,n);if(!o){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=s.get(o);if(l||(he(o,null,n),l=s.get(o)),(l==null?void 0:l.res)===void 0){const a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=bt(i,o,s)),l.count*l.aliasCount>r)){const a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(t,n,s){const i=`*${this.source}`;if(t){if(_n(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${i} `}return i}}function bt(e,t,n){if(Re(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(W(t)){let s=0;for(const i of t.items){const r=bt(e,i,n);r>s&&(s=r)}return s}else if(G(t)){const s=bt(e,t.key,n),i=bt(e,t.value,n);return Math.max(s,i)}return 1}const Pn=e=>!e||typeof e!="function"&&typeof e!="object";class V extends qt{constructor(t){super(Ct),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:he(this.value,t,n)}toString(){return String(this.value)}}V.BLOCK_FOLDED="BLOCK_FOLDED";V.BLOCK_LITERAL="BLOCK_LITERAL";V.PLAIN="PLAIN";V.QUOTE_DOUBLE="QUOTE_DOUBLE";V.QUOTE_SINGLE="QUOTE_SINGLE";const si="tag:yaml.org,2002:";function ii(e,t,n){if(t){const s=n.filter(r=>r.tag===t),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(s=>{var i;return((i=s.identify)==null?void 0:i.call(s,e))&&!s.format})}function rt(e,t,n){var y,S,v;if(lt(e)&&(e=e.contents),H(e))return e;if(G(e)){const h=(S=(y=n.schema[_e]).createNode)==null?void 0:S.call(y,n.schema,null,n);return h.items.push(e),h}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=n;let a;if(s&&e&&typeof e=="object"){if(a=l.get(e),a)return a.anchor??(a.anchor=i(e)),new Mn(a.anchor);a={anchor:null,node:null},l.set(e,a)}t!=null&&t.startsWith("!!")&&(t=si+t.slice(2));let c=ii(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const h=new V(e);return a&&(a.node=h),h}c=e instanceof Map?o[_e]:Symbol.iterator in Object(e)?o[He]:o[_e]}r&&(r(c),delete n.onTagObj);const m=c!=null&&c.createNode?c.createNode(n.schema,e,n):typeof((v=c==null?void 0:c.nodeClass)==null?void 0:v.from)=="function"?c.nodeClass.from(n.schema,e,n):new V(e);return t?m.tag=t:c.default||(m.tag=c.tag),a&&(a.node=m),m}function St(e,t,n){let s=n;for(let i=t.length-1;i>=0;--i){const r=t[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return rt(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const nt=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Rn extends qt{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>H(s)||G(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(nt(t))this.add(n);else{const[s,...i]=t,r=this.get(s,!0);if(W(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,St(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(W(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...i]=t,r=this.get(s,!0);return i.length===0?!n&&U(r)?r.value:r:W(r)?r.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!G(n))return!1;const s=n.value;return s==null||t&&U(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const i=this.get(n,!0);return W(i)?i.hasIn(s):!1}setIn(t,n){const[s,...i]=t;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(W(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,St(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}}const ri=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ke(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Me=(e,t,n)=>e.endsWith(`
4
- `)?ke(n,t):n.includes(`
5
- `)?`
6
- `+ke(n,t):(e.endsWith(" ")?"":" ")+n,Dn="flow",Vt="block",pt="quoted";function Ot(e,t,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return e;i<r&&(r=0);const a=Math.max(1+r,1+i-t.length);if(e.length<=a)return e;const c=[],m={};let y=i-t.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):y=i-s);let S,v,h=!1,u=-1,f=-1,p=-1;n===Vt&&(u=bn(e,u,t.length),u!==-1&&(y=u+a));for(let $;$=e[u+=1];){if(n===pt&&$==="\\"){switch(f=u,e[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}p=u}if($===`
7
- `)n===Vt&&(u=bn(e,u,t.length)),y=u+t.length+a,S=void 0;else{if($===" "&&v&&v!==" "&&v!==`
8
- `&&v!==" "){const C=e[u+1];C&&C!==" "&&C!==`
9
- `&&C!==" "&&(S=u)}if(u>=y)if(S)c.push(S),y=S+a,S=void 0;else if(n===pt){for(;v===" "||v===" ";)v=$,$=e[u+=1],h=!0;const C=u>p+1?u-2:f-1;if(m[C])return e;c.push(C),m[C]=!0,y=C+a,S=void 0}else h=!0}v=$}if(h&&l&&l(),c.length===0)return e;o&&o();let d=e.slice(0,c[0]);for(let $=0;$<c.length;++$){const C=c[$],k=c[$+1]||e.length;C===0?d=`
10
- ${t}${e.slice(0,k)}`:(n===pt&&m[C]&&(d+=`${e[C]}\\`),d+=`
11
- ${t}${e.slice(C+1,k)}`)}return d}function bn(e,t,n){let s=t,i=t+1,r=e[i];for(;r===" "||r===" ";)if(t<i+n)r=e[++t];else{do r=e[++t];while(r&&r!==`
12
- `);s=t,i=t+1,r=e[i]}return s}const kt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),It=e=>/^(%|---|\.\.\.)/m.test(e);function oi(e,t,n){if(!t||t<0)return!1;const s=t-n,i=e.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(e[r]===`
13
- `){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}function it(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(It(e)?" ":"");let o="",l=0;for(let a=0,c=n[a];c;c=n[++a])if(c===" "&&n[a+1]==="\\"&&n[a+2]==="n"&&(o+=n.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(n[a+1]){case"u":{o+=n.slice(l,a);const m=n.substr(a+2,4);switch(m){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:m.substr(0,2)==="00"?o+="\\x"+m.substr(2):o+=n.substr(a,6)}a+=5,l=a+1}break;case"n":if(s||n[a+2]==='"'||n.length<i)a+=1;else{for(o+=n.slice(l,a)+`
14
-
15
- `;n[a+2]==="\\"&&n[a+3]==="n"&&n[a+4]!=='"';)o+=`
16
- `,a+=2;o+=r,n[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+n.slice(l):n,s?o:Ot(o,r,pt,kt(t,!1))}function Bt(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
17
- `)||/[ \t]\n|\n[ \t]/.test(e))return it(e,t);const n=t.indent||(It(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
18
- ${n}`)+"'";return t.implicitKey?s:Ot(s,n,Dn,kt(t,!1))}function Je(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=it;else{const i=e.includes('"'),r=e.includes("'");i&&!r?s=Bt:r&&!i?s=it:s=n?Bt:it}return s(e,t)}let Ft;try{Ft=new RegExp(`(^|(?<!
19
- ))
20
- +(?!
21
- |$)`,"g")}catch{Ft=/\n+(?!\n|$)/g}function wt({comment:e,type:t,value:n},s,i,r){const{blockQuote:o,commentString:l,lineWidth:a}=s.options;if(!o||/\n[\t ]+$/.test(n))return Je(n,s);const c=s.indent||(s.forceBlockIndent||It(n)?" ":""),m=o==="literal"?!0:o==="folded"||t===V.BLOCK_FOLDED?!1:t===V.BLOCK_LITERAL?!0:!oi(n,a,c.length);if(!n)return m?`|
22
- `:`>
23
- `;let y,S;for(S=n.length;S>0;--S){const k=n[S-1];if(k!==`
24
- `&&k!==" "&&k!==" ")break}let v=n.substring(S);const h=v.indexOf(`
25
- `);h===-1?y="-":n===v||h!==v.length-1?(y="+",r&&r()):y="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
26
- `&&(v=v.slice(0,-1)),v=v.replace(Ft,`$&${c}`));let u=!1,f,p=-1;for(f=0;f<n.length;++f){const k=n[f];if(k===" ")u=!0;else if(k===`
27
- `)p=f;else break}let d=n.substring(0,p<f?p+1:f);d&&(n=n.substring(d.length),d=d.replace(/\n+/g,`$&${c}`));let C=(u?c?"2":"1":"")+y;if(e&&(C+=" "+l(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){const k=n.replace(/\n+/g,`
28
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let R=!1;const I=kt(s,!0);o!=="folded"&&t!==V.BLOCK_FOLDED&&(I.onOverflow=()=>{R=!0});const M=Ot(`${d}${k}${v}`,c,Vt,I);if(!R)return`>${C}
29
- ${c}${M}`}return n=n.replace(/\n+/g,`$&${c}`),`|${C}
30
- ${c}${d}${n}${v}`}function li(e,t,n,s){const{type:i,value:r}=e,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:m}=t;if(l&&r.includes(`
31
- `)||m&&/[[\]{},]/.test(r))return Je(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||m||!r.includes(`
32
- `)?Je(r,t):wt(e,t,n,s);if(!l&&!m&&i!==V.PLAIN&&r.includes(`
33
- `))return wt(e,t,n,s);if(It(r)){if(a==="")return t.forceBlockIndent=!0,wt(e,t,n,s);if(l&&a===c)return Je(r,t)}const y=r.replace(/\n+/g,`$&
34
- ${a}`);if(o){const S=u=>{var f;return u.default&&u.tag!=="tag:yaml.org,2002:str"&&((f=u.test)==null?void 0:f.test(y))},{compat:v,tags:h}=t.doc.schema;if(h.some(S)||v!=null&&v.some(S))return Je(r,t)}return l?y:Ot(y,a,Dn,kt(t,!1))}function Qt(e,t,n,s){const{implicitKey:i,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==V.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=V.QUOTE_DOUBLE);const a=m=>{switch(m){case V.BLOCK_FOLDED:case V.BLOCK_LITERAL:return i||r?Je(o.value,t):wt(o,t,n,s);case V.QUOTE_DOUBLE:return it(o.value,t);case V.QUOTE_SINGLE:return Bt(o.value,t);case V.PLAIN:return li(o,t,n,s);default:return null}};let c=a(l);if(c===null){const{defaultKeyType:m,defaultStringType:y}=t.options,S=i&&m||y;if(c=a(S),c===null)throw new Error(`Unsupported default string type ${S}`)}return c}function Vn(e,t){const n=Object.assign({blockQuote:!0,commentString:ri,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function ai(e,t){var i;if(t.tag){const r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,s;if(U(t)){s=t.value;let r=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,s)});if(r.length>1){const o=r.filter(l=>l.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else s=t,n=e.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){const r=((i=s==null?void 0:s.constructor)==null?void 0:i.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function ci(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(U(e)||W(e))&&e.anchor;r&&_n(r)&&(n.add(r),i.push(`&${r}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}function We(e,t,n,s){var a;if(G(e))return e.toString(t,n,s);if(Re(e)){if(t.doc.directives)return e.toString(t);if((a=t.resolvedAliases)!=null&&a.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const r=H(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=ai(t.doc.schema.tags,r));const o=ci(r,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof i.stringify=="function"?i.stringify(r,t,n,s):U(r)?Qt(r,t,n,s):r.toString(t,n,s);return o?U(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
35
- ${t.indent}${l}`:l}function ui({key:e,value:t},n,s,i){const{allNullValues:r,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:m,simpleKeys:y}}=n;let S=H(e)&&e.comment||null;if(y){if(S)throw new Error("With simple keys, key nodes cannot have comments");if(W(e)||!H(e)&&typeof e=="object"){const I="With simple keys, collection cannot be used as a key value";throw new Error(I)}}let v=!y&&(!e||S&&t==null&&!n.inFlow||W(e)||(U(e)?e.type===V.BLOCK_FOLDED||e.type===V.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(y||!r),indent:l+a});let h=!1,u=!1,f=We(e,n,()=>h=!0,()=>u=!0);if(!v&&!n.inFlow&&f.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(r||t==null)return h&&s&&s(),f===""?"?":v?`? ${f}`:f}else if(r&&!y||t==null&&v)return f=`? ${f}`,S&&!h?f+=Me(f,n.indent,c(S)):u&&i&&i(),f;h&&(S=null),v?(S&&(f+=Me(f,n.indent,c(S))),f=`? ${f}
36
- ${l}:`):(f=`${f}:`,S&&(f+=Me(f,n.indent,c(S))));let p,d,$;H(t)?(p=!!t.spaceBefore,d=t.commentBefore,$=t.comment):(p=!1,d=null,$=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!S&&U(t)&&(n.indentAtStart=f.length+1),u=!1,!m&&a.length>=2&&!n.inFlow&&!v&&ct(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const k=We(t,n,()=>C=!0,()=>u=!0);let R=" ";if(S||p||d){if(R=p?`
37
- `:"",d){const I=c(d);R+=`
38
- ${ke(I,n.indent)}`}k===""&&!n.inFlow?R===`
39
- `&&$&&(R=`
40
-
41
- `):R+=`
42
- ${n.indent}`}else if(!v&&W(t)){const I=k[0],M=k.indexOf(`
43
- `),j=M!==-1,J=n.inFlow??t.flow??t.items.length===0;if(j||!J){let q=!1;if(j&&(I==="&"||I==="!")){let K=k.indexOf(" ");I==="&"&&K!==-1&&K<M&&k[K+1]==="!"&&(K=k.indexOf(" ",K+1)),(K===-1||M<K)&&(q=!0)}q||(R=`
44
- ${n.indent}`)}}else(k===""||k[0]===`
45
- `)&&(R="");return f+=R+k,n.inFlow?C&&s&&s():$&&!C?f+=Me(f,n.indent,c($)):u&&i&&i(),f}function fi(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const ht="<<",Ee={identify:e=>e===ht||typeof e=="symbol"&&e.description===ht,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new V(Symbol(ht)),{addToJSMap:Bn}),stringify:()=>ht},di=(e,t)=>(Ee.identify(t)||U(t)&&(!t.type||t.type===V.PLAIN)&&Ee.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Ee.tag&&n.default));function Bn(e,t,n){if(n=e&&Re(n)?n.resolve(e.doc):n,ct(n))for(const s of n.items)jt(e,t,s);else if(Array.isArray(n))for(const s of n)jt(e,t,s);else jt(e,t,n)}function jt(e,t,n){const s=e&&Re(n)?n.resolve(e.doc):n;if(!at(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,e,Map);for(const[r,o]of i)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Fn(e,t,{key:n,value:s}){if(H(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(di(e,n))Bn(e,t,s);else{const i=he(n,"",e);if(t instanceof Map)t.set(i,he(s,i,e));else if(t instanceof Set)t.add(i);else{const r=gi(n,i,e),o=he(s,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function gi(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(H(e)&&(n!=null&&n.doc)){const s=Vn(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=e.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),fi(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function Ut(e,t,n){const s=rt(e,void 0,n),i=rt(t,void 0,n);return new me(s,i)}class me{constructor(t,n=null){Object.defineProperty(this,ye,{value:Tn}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return H(n)&&(n=n.clone(t)),H(s)&&(s=s.clone(t)),new me(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return Fn(n,s,this)}toString(t,n,s){return t!=null&&t.doc?ui(this,t,n,s):JSON.stringify(this)}}function Kn(e,t,n){return(t.inFlow??e.flow?mi:hi)(e,t,n)}function hi({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){const{indent:a,options:{commentString:c}}=n,m=Object.assign({},n,{indent:r,type:null});let y=!1;const S=[];for(let h=0;h<t.length;++h){const u=t[h];let f=null;if(H(u))!y&&u.spaceBefore&&S.push(""),vt(n,S,u.commentBefore,y),u.comment&&(f=u.comment);else if(G(u)){const d=H(u.key)?u.key:null;d&&(!y&&d.spaceBefore&&S.push(""),vt(n,S,d.commentBefore,y))}y=!1;let p=We(u,m,()=>f=null,()=>y=!0);f&&(p+=Me(p,r,c(f))),y&&f&&(y=!1),S.push(s+p)}let v;if(S.length===0)v=i.start+i.end;else{v=S[0];for(let h=1;h<S.length;++h){const u=S[h];v+=u?`
46
- ${a}${u}`:`
47
- `}}return e?(v+=`
48
- `+ke(c(e),a),l&&l()):y&&o&&o(),v}function mi({items:e},t,{flowChars:n,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=t;s+=r;const a=Object.assign({},t,{indent:s,inFlow:!0,type:null});let c=!1,m=0;const y=[];for(let h=0;h<e.length;++h){const u=e[h];let f=null;if(H(u))u.spaceBefore&&y.push(""),vt(t,y,u.commentBefore,!1),u.comment&&(f=u.comment);else if(G(u)){const d=H(u.key)?u.key:null;d&&(d.spaceBefore&&y.push(""),vt(t,y,d.commentBefore,!1),d.comment&&(c=!0));const $=H(u.value)?u.value:null;$?($.comment&&(f=$.comment),$.commentBefore&&(c=!0)):u.value==null&&(d!=null&&d.comment)&&(f=d.comment)}f&&(c=!0);let p=We(u,a,()=>f=null);c||(c=y.length>m||p.includes(`
49
- `)),h<e.length-1?p+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=y.reduce((d,$)=>d+$.length+2,2)+(p.length+2)>t.options.lineWidth)),c&&(p+=",")),f&&(p+=Me(p,s,l(f))),y.push(p),m=y.length}const{start:S,end:v}=n;if(y.length===0)return S+v;if(!c){const h=y.reduce((u,f)=>u+f.length+2,2);c=t.options.lineWidth>0&&h>t.options.lineWidth}if(c){let h=S;for(const u of y)h+=u?`
50
- ${r}${i}${u}`:`
51
- `;return`${h}
52
- ${i}${v}`}else return`${S}${o}${y.join(" ")}${o}${v}`}function vt({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=ke(t(s),e);n.push(r.trimStart())}}function Pe(e,t){const n=U(t)?t.value:t;for(const s of e)if(G(s)&&(s.key===t||s.key===n||U(s.key)&&s.key.value===n))return s}class Ne extends Rn{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(_e,t),this.items=[]}static from(t,n,s){const{keepUndefined:i,replacer:r}=s,o=new this(t),l=(a,c)=>{if(typeof r=="function")c=r.call(n,a,c);else if(Array.isArray(r)&&!r.includes(a))return;(c!==void 0||i)&&o.items.push(Ut(a,c,s))};if(n instanceof Map)for(const[a,c]of n)l(a,c);else if(n&&typeof n=="object")for(const a of Object.keys(n))l(a,n[a]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;G(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new me(t,t==null?void 0:t.value):s=new me(t.key,t.value);const i=Pe(this.items,s.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);U(i.value)&&Pn(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const l=this.items.findIndex(a=>r(s,a)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=Pe(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=Pe(this.items,t),i=s==null?void 0:s.value;return(!n&&U(i)?i.value:i)??void 0}has(t){return!!Pe(this.items,t)}set(t,n){this.add(new me(t,n),!0)}toJSON(t,n,s){const i=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items)Fn(n,i,r);return i}toString(t,n,s){if(!t)return JSON.stringify(this);for(const i of this.items)if(!G(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Kn(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const ze={collection:"map",default:!0,nodeClass:Ne,tag:"tag:yaml.org,2002:map",resolve(e,t){return at(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ne.from(e,t,n)};class $t extends Rn{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(He,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=mt(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=mt(t);if(typeof s!="number")return;const i=this.items[s];return!n&&U(i)?i.value:i}has(t){const n=mt(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=mt(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[s];U(i)&&Pn(n)?i.value=n:this.items[s]=n}toJSON(t,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let i=0;for(const r of this.items)s.push(he(r,String(i++),n));return s}toString(t,n,s){return t?Kn(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof i=="function"){const a=n instanceof Set?l:String(o++);l=i.call(n,a,l)}r.items.push(rt(l,void 0,s))}}return r}}function mt(e){let t=U(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ge={collection:"seq",default:!0,nodeClass:$t,tag:"tag:yaml.org,2002:seq",resolve(e,t){return ct(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>$t.from(e,t,n)},Et={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),Qt(e,t,n,s)}},At={identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new V(null),stringify:({source:e},t)=>typeof e=="string"&&At.test.test(e)?e:t.options.nullStr},xt={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new V(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&xt.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function ve({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let l=t-(r.length-o-1);for(;l-- >0;)r+="0"}return r}const Jn={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ve},qn={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ve(e)}},Qn={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new V(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ve},Tt=e=>typeof e=="bigint"||Number.isInteger(e),Wt=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Un(e,t,n){const{value:s}=e;return Tt(s)&&s>=0?n+s.toString(t):ve(e)}const xn={identify:e=>Tt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Wt(e,2,8,n),stringify:e=>Un(e,8,"0o")},Wn={identify:Tt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Wt(e,0,10,n),stringify:ve},Hn={identify:e=>Tt(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Wt(e,2,16,n),stringify:e=>Un(e,16,"0x")},yi=[ze,Ge,Et,At,xt,xn,Wn,Hn,Jn,qn,Qn];function pn(e){return typeof e=="bigint"||Number.isInteger(e)}const yt=({value:e})=>JSON.stringify(e),bi=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:yt},{identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:yt},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:yt},{identify:pn,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>pn(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:yt}],pi={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},wi=[ze,Ge].concat(bi,pi),Ht={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i<n.length;++i)s[i]=n.charCodeAt(i);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,i,r){if(!n)return"";const o=n;let l;if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=V.BLOCK_LITERAL),t!==V.QUOTE_DOUBLE){const a=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(l.length/a),m=new Array(c);for(let y=0,S=0;y<c;++y,S+=a)m[y]=l.substr(S,a);l=m.join(t===V.BLOCK_LITERAL?`
53
- `:" ")}return Qt({comment:e,type:t,value:l},s,i,r)}};function Yn(e,t){if(ct(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!G(s)){if(at(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const i=s.items[0]||new me(new V(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
54
- ${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment}
55
- ${r.comment}`:s.comment}s=i}e.items[n]=G(s)?s:new me(s)}}else t("Expected a sequence for this tag");return e}function zn(e,t,n){const{replacer:s}=n,i=new $t(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(r++),o));let l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(Ut(l,a,n))}return i}const Yt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Yn,createNode:zn};class qe extends $t{constructor(){super(),this.add=Ne.prototype.add.bind(this),this.delete=Ne.prototype.delete.bind(this),this.get=Ne.prototype.get.bind(this),this.has=Ne.prototype.has.bind(this),this.set=Ne.prototype.set.bind(this),this.tag=qe.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items){let r,o;if(G(i)?(r=he(i.key,"",n),o=he(i.value,r,n)):r=he(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(t,n,s){const i=zn(t,n,s),r=new this;return r.items=i.items,r}}qe.tag="tag:yaml.org,2002:omap";const zt={collection:"seq",identify:e=>e instanceof Map,nodeClass:qe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Yn(e,t),s=[];for(const{key:i}of n.items)U(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new qe,n)},createNode:(e,t,n)=>qe.from(e,t,n)};function Gn({value:e,source:t},n){return t&&(e?Xn:Zn).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Xn={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new V(!0),stringify:Gn},Zn={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new V(!1),stringify:Gn},Si={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ve},vi={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ve(e)}},$i={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new V(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:ve},ut=e=>typeof e=="bigint"||Number.isInteger(e);function Nt(e,t,n,{intAsBigInt:s}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const r=parseInt(e,n);return i==="-"?-1*r:r}function Gt(e,t,n){const{value:s}=e;if(ut(s)){const i=s.toString(t);return s<0?"-"+n+i.substr(1):n+i}return ve(e)}const Ci={identify:ut,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Nt(e,2,2,n),stringify:e=>Gt(e,2,"0b")},Oi={identify:ut,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Nt(e,1,8,n),stringify:e=>Gt(e,8,"0")},ki={identify:ut,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Nt(e,0,10,n),stringify:ve},Ii={identify:ut,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Nt(e,2,16,n),stringify:e=>Gt(e,16,"0x")};class Qe extends Ne{constructor(t){super(t),this.tag=Qe.tag}add(t){let n;G(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new me(t.key,null):n=new me(t,null),Pe(this.items,n.key)||this.items.push(n)}get(t,n){const s=Pe(this.items,t);return!n&&G(s)?U(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=Pe(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new me(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),r.items.push(Ut(o,null,s));return r}}Qe.tag="tag:yaml.org,2002:set";const Xt={collection:"map",identify:e=>e instanceof Set,nodeClass:Qe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Qe.from(e,t,n),resolve(e,t){if(at(e)){if(e.hasAllNullValues(!0))return Object.assign(new Qe,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Zt(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return n==="-"?i(-1)*r:r}function es(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ve(e);let s="";t<0&&(s="-",t*=n(-1));const i=n(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const ts={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Zt(e,n),stringify:es},ns={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Zt(e,!1),stringify:es},_t={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(_t.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,o,l]=t.map(Number),a=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,s-1,i,r||0,o||0,l||0,a);const m=t[8];if(m&&m!=="Z"){let y=Zt(m,!1);Math.abs(y)<30&&(y*=60),c-=6e4*y}return new Date(c)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},wn=[ze,Ge,Et,At,Xn,Zn,Ci,Oi,ki,Ii,Si,vi,$i,Ht,Ee,zt,Yt,Xt,ts,ns,_t],Sn=new Map([["core",yi],["failsafe",[ze,Ge,Et]],["json",wi],["yaml11",wn],["yaml-1.1",wn]]),vn={binary:Ht,bool:xt,float:Qn,floatExp:qn,floatNaN:Jn,floatTime:ns,int:Wn,intHex:Hn,intOct:xn,intTime:ts,map:ze,merge:Ee,null:At,omap:zt,pairs:Yt,seq:Ge,set:Xt,timestamp:_t},Ei={"tag:yaml.org,2002:binary":Ht,"tag:yaml.org,2002:merge":Ee,"tag:yaml.org,2002:omap":zt,"tag:yaml.org,2002:pairs":Yt,"tag:yaml.org,2002:set":Xt,"tag:yaml.org,2002:timestamp":_t};function Lt(e,t,n){const s=Sn.get(t);if(s&&!e)return n&&!s.includes(Ee)?s.concat(Ee):s.slice();let i=s;if(!i)if(Array.isArray(e))i=[];else{const r=Array.from(Sn.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)i=i.concat(r);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Ee)),i.reduce((r,o)=>{const l=typeof o=="string"?vn[o]:o;if(!l){const a=JSON.stringify(o),c=Object.keys(vn).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return r.includes(l)||r.push(l),r},[])}const Ai=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class en{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Lt(t,"compat"):t?Lt(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Ei:{},this.tags=Lt(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,_e,{value:ze}),Object.defineProperty(this,Ct,{value:Et}),Object.defineProperty(this,He,{value:Ge}),this.sortMapEntries=typeof o=="function"?o:o===!0?Ai:null}clone(){const t=Object.create(en.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Ti(e,t){var a;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const i=Vn(e,t),{commentString:r}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=r(e.commentBefore);n.unshift(ke(c,""))}let o=!1,l=null;if(e.contents){if(H(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const y=r(e.contents.commentBefore);n.push(ke(y,""))}i.forceBlockIndent=!!e.comment,l=e.contents.comment}const c=l?void 0:()=>o=!0;let m=We(e.contents,i,()=>l=null,c);l&&(m+=Me(m,"",r(l))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(We(e.contents,i));if((a=e.directives)!=null&&a.docEnd)if(e.comment){const c=r(e.comment);c.includes(`
56
- `)?(n.push("..."),n.push(ke(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(ke(r(c),"")))}return n.join(`
57
- `)+`
58
- `}class tn{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ye,{value:Dt});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new le({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,i,s)}clone(){const t=Object.create(tn.prototype,{[ye]:{value:Dt}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=H(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Be(this.contents)&&this.contents.add(t)}addIn(t,n){Be(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=jn(this);t.anchor=!n||s.has(n)?Ln(n||"a",s):n}return new Mn(t.anchor)}createNode(t,n,s){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const f=d=>typeof d=="number"||d instanceof String||d instanceof Number,p=n.filter(f).map(String);p.length>0&&(n=n.concat(p)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:m}=s??{},{onAnchor:y,setAnchors:S,sourceObjects:v}=ni(this,o||"a"),h={aliasDuplicateObjects:r??!0,keepUndefined:a??!1,onAnchor:y,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:v},u=rt(t,m,h);return l&&W(u)&&(u.flow=!0),S(),u}createPair(t,n,s={}){const i=this.createNode(t,null,s),r=this.createNode(n,null,s);return new me(i,r)}delete(t){return Be(this.contents)?this.contents.delete(t):!1}deleteIn(t){return nt(t)?this.contents==null?!1:(this.contents=null,!0):Be(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return W(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return nt(t)?!n&&U(this.contents)?this.contents.value:this.contents:W(this.contents)?this.contents.getIn(t,n):void 0}has(t){return W(this.contents)?this.contents.has(t):!1}hasIn(t){return nt(t)?this.contents!==void 0:W(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=St(this.schema,[t],n):Be(this.contents)&&this.contents.set(t,n)}setIn(t,n){nt(t)?this.contents=n:this.contents==null?this.contents=St(this.schema,Array.from(t),n):Be(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new le({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new le({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new en(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=he(this.contents,n??"",l);if(typeof r=="function")for(const{count:c,res:m}of l.anchors.values())r(m,c);return typeof o=="function"?Ke(o,{"":a},"",a):a}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Ti(this,t)}}function Be(e){if(W(e))return!0;throw new Error("Expected a YAML collection as document contents")}new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{}
59
- \r `);function Ni(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:i}={};if(!i)return}return lt(e)&&!s?e.toString(n):new tn(e,s,n).toString(n)}var _i=F("<div class=tool-call-permission-error>"),ji=F('<div class="tool-call-permission-actions px-3 pb-3"><div class=tool-call-permission-buttons><button type=button class=tool-call-permission-button></button><button type=button class=tool-call-permission-button></button></div><div class=tool-call-permission-shortcuts><kbd class=kbd>Enter</kbd><span></span><kbd class=kbd>Esc</kbd><span>'),Li=F('<p class="tool-call-permission-queued-text px-3 pb-3">'),Mi=F('<div><div class=tool-call-permission-body><div class="flex flex-col gap-2">'),Pi=F('<div class="text-xs text-muted">'),Ri=F('<div class="border border-base bg-surface-secondary p-3 text-primary"><div class="flex items-baseline justify-between gap-2"><div class="text-sm text-primary"> <span class=font-semibold></span></div></div><div class="mt-1 text-sm font-medium text-primary"></div><div class="mt-3 flex flex-col gap-1"><label><input class="mt-0.5 accent-[var(--accent-primary)]"><div class="flex flex-1 flex-col gap-2"><div class="text-sm leading-tight text-primary"></div><input class="w-full rounded-md border border-base bg-surface-base px-2 py-1 text-sm text-primary"type=text>'),Di=F('<label><input class="mt-0.5 accent-[var(--accent-primary)]"><div class="flex flex-col"><div class="text-sm leading-tight text-primary"></div><div class="text-xs text-muted leading-tight">');function Vi(e){const{t}=Kt();let n;Se(()=>{e.active()&&n&&n.focus()});const s=L(()=>{var f;const h=e.toolState(),u=e.request();return(u==null?void 0:u.id)??((f=h==null?void 0:h.input)==null?void 0:f.requestID)??`question-${e.toolCallId()}`}),i=L(()=>{var $;const h=e.toolState(),u=e.request(),f=e.toolName()==="question";if(!u&&!f)return[];const p=(u==null?void 0:u.questions)??(($=h==null?void 0:h.input)==null?void 0:$.questions)??[];return Array.isArray(p)?p:[]}),r=L(()=>{const h=e.request(),u=e.toolName()==="question";return!!h||u}),o=L(()=>{var $,C;const h=e.toolState(),u=(h==null?void 0:h.status)==="completed"&&Array.isArray(($=h==null?void 0:h.metadata)==null?void 0:$.answers)?h.metadata.answers:void 0;if(u)return u;const f=e.request(),p=(C=f==null?void 0:f.questions)==null?void 0:C.map(k=>k==null?void 0:k.answer);if(Array.isArray(p)&&p.some(k=>Array.isArray(k)&&k.length>0))return p;const d=e.draftAnswers()[s()]??[];return Array.isArray(d)?d:[]}),l=L(()=>{var p;const h=e.toolState();if((h==null?void 0:h.status)==="completed")return!0;const u=e.request(),f=(p=u==null?void 0:u.questions)==null?void 0:p.map(d=>d==null?void 0:d.answer);return Array.isArray(f)&&f.length>0?f.every(d=>Array.isArray(d)&&d.length>0):!1}),a=(h,u)=>{e.active()&&e.setDraftAnswers(f=>{const d=[...f[s()]??[]];return d[h]=u,{...f,[s()]:d}})},c=(h,u)=>{const f=i()[h],p=(f==null?void 0:f.multiple)===!0,d=o()[h]??[];if(p){const $=d.includes(u)?d.filter(C=>C!==u):[...d,u];a(h,$);return}a(h,[u])},m=()=>!e.active()||e.submitting()?!0:i().some((h,u)=>{var f;return(((f=o()[u])==null?void 0:f.length)??0)===0}),y=(h,u)=>{if(!e.active())return;const p=(u==null?void 0:u.value)??"";if(p.trim().length===0)return;const d=i()[h];if(!((d==null?void 0:d.multiple)===!0)){a(h,[]),c(h,p);return}const C=o()[h]??[];C.includes(p)||a(h,[...C,p])},S=(h,u)=>{if(!e.active()||u.length===0)return;const p=(o()[h]??[]).filter(d=>!u.includes(d));a(h,p)},v=(h,u)=>{if(!e.active())return;const f=u.value,p=f.trim(),d=i()[h];if(!((d==null?void 0:d.multiple)===!0)){a(h,p.length>0?[f]:[]);return}const C=new Set(((d==null?void 0:d.options)??[]).map(M=>M.label)),k=o()[h]??[],R=u.dataset.lastValue??"";let I=k.filter(M=>M!==R);p.length>0?(!C.has(p)&&!I.includes(f)?I=[...I,f]:C.has(p)||I.includes(f)||(I=[...I,f]),u.dataset.lastValue=f):delete u.dataset.lastValue,a(h,I)};return T(x,{get when(){return Ce(()=>!!r())()&&i().length>0},get children(){var h=Mi(),u=h.firstChild,f=u.firstChild;return w(f,T(Mt,{get each(){return i()},children:(p,d)=>{const $=()=>d(),C=()=>(p==null?void 0:p.multiple)===!0,k=()=>o()[$()]??[],R=()=>C()?"checkbox":"radio",I=()=>`question-${s()}-${$()}`,M=()=>new Set(((p==null?void 0:p.options)??[]).map(K=>K.label)),j=()=>k().filter(K=>!M().has(K)),J=()=>j()[0]??"",q=()=>J().length>0;return(()=>{var K=Ri(),ne=K.firstChild,ie=ne.firstChild,re=ie.firstChild,be=re.nextSibling,B=ne.nextSibling,fe=B.nextSibling,de=fe.firstChild,se=de.firstChild,ge=se.nextSibling,ae=ge.firstChild,ee=ae.nextSibling;return w(ie,()=>t("toolCall.question.number",{number:$()+1}),re),w(be,()=>p==null?void 0:p.header),w(ne,T(x,{get when(){return C()},get children(){var O=Pi();return w(O,()=>t("toolCall.question.multiple")),O}}),null),w(B,()=>p==null?void 0:p.question),w(fe,T(Mt,{get each(){return(p==null?void 0:p.options)??[]},children:(O,Q)=>{const te=()=>k().includes(O.label);return(()=>{var oe=Di(),Y=oe.firstChild,b=Y.nextSibling,A=b.firstChild,N=A.nextSibling;return Y.addEventListener("change",()=>c($(),O.label)),Ue(E=>{$()===0&&Q()===0&&(n=E)},Y),w(A,()=>O.label),w(N,()=>O.description),z(E=>{var ce=`flex items-start gap-2 py-1 ${e.active()?"cursor-pointer":e.request()?"opacity-80":""}`,Ae=O.description,ue=R(),De=I(),X=!e.active()||e.submitting();return ce!==E.e&&Ie(oe,E.e=ce),Ae!==E.t&&P(oe,"title",E.t=Ae),ue!==E.a&&P(Y,"type",E.a=ue),De!==E.o&&P(Y,"name",E.o=De),X!==E.i&&(Y.disabled=E.i=X),E},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),z(()=>Y.checked=te()),oe})()}}),de),se.addEventListener("change",O=>{const Q=O.currentTarget.closest("label"),te=Q==null?void 0:Q.querySelector("input[type='text']");if(e.active()){if(q()){S($(),j()),te&&delete te.dataset.lastValue;return}y($(),te)}}),Ue(O=>{var Q;$()===0&&(((Q=p==null?void 0:p.options)==null?void 0:Q.length)??0)===0&&(n=O)},se),w(ae,()=>t("toolCall.question.custom.label")),ee.$$keydown=O=>{O.key==="Enter"&&!O.isComposing&&(m()||e.onSubmit())},ee.$$input=O=>v($(),O.currentTarget),ee.addEventListener("focus",O=>{e.active()&&y($(),O.currentTarget)}),z(O=>{var Q=`mt-2 flex items-start gap-2 py-1 ${e.active()?"cursor-pointer":e.request()?"opacity-80":""}`,te=t("toolCall.question.custom.title"),oe=R(),Y=I(),b=!e.active()||e.submitting(),A=t("toolCall.question.custom.placeholder"),N=!e.active()||e.submitting();return Q!==O.e&&Ie(de,O.e=Q),te!==O.t&&P(de,"title",O.t=te),oe!==O.a&&P(se,"type",O.a=oe),Y!==O.o&&P(se,"name",O.o=Y),b!==O.i&&(se.disabled=O.i=b),A!==O.n&&P(ee,"placeholder",O.n=A),N!==O.s&&(ee.disabled=O.s=N),O},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),z(()=>se.checked=q()),z(()=>ee.value=J()),K})()}}),null),w(f,T(x,{get when(){return e.active()},get children(){var p=ji(),d=p.firstChild,$=d.firstChild,C=$.nextSibling,k=d.nextSibling,R=k.firstChild,I=R.nextSibling,M=I.nextSibling,j=M.nextSibling;return $.$$click=()=>e.onSubmit(),w($,()=>t("toolCall.question.actions.submit")),C.$$click=()=>e.onDismiss(),w(C,()=>t("toolCall.question.actions.dismiss")),w(I,()=>t("toolCall.question.shortcuts.submit")),w(j,()=>t("toolCall.question.shortcuts.dismiss")),w(p,T(x,{get when(){return e.error()},get children(){var J=_i();return w(J,()=>e.error()),J}}),null),z(J=>{var q=m(),K=e.submitting();return q!==J.e&&($.disabled=J.e=q),K!==J.t&&(C.disabled=J.t=K),J},{e:void 0,t:void 0}),p}}),null),w(f,T(x,{get when(){return Ce(()=>!e.active())()&&e.request()},get children(){var p=Li();return w(p,()=>t("toolCall.question.queuedText")),p}}),null),z(()=>Ie(h,`tool-call-permission p-0 gap-2 ${e.active()?"tool-call-permission-active":"tool-call-permission-queued"} ${l()?"tool-call-permission-answered":""}`)),h}})}ot(["click","input","keydown"]);var Bi=F("<p class=tool-call-permission-queued-text>"),Fi=F("<div class=tool-call-permission-reject-reason><label class=tool-call-permission-reject-label></label><textarea class=tool-call-permission-reject-textarea rows=3></textarea><p class=tool-call-permission-reject-hint></p><div class=tool-call-permission-buttons><button type=button class=tool-call-permission-button></button><button type=button class=tool-call-permission-button>"),Ki=F("<div class=tool-call-permission-error>"),Ji=F("<div><div class=tool-call-permission-header><span class=tool-call-permission-label></span><span class=tool-call-permission-type></span></div><div class=tool-call-permission-body><div class=tool-call-permission-title><code>"),qi=F("<div class=tool-call-permission-diff>"),Qi=F("<div class=tool-call-permission-shortcuts><kbd class=kbd>Enter</kbd><span></span><kbd class=kbd>A</kbd><span>"),Ui=F("<div class=tool-call-permission-actions><div class=tool-call-permission-buttons><button type=button class=tool-call-permission-button></button><button type=button class=tool-call-permission-button></button><button type=button class=tool-call-permission-button>");function xi(e){const{t}=Kt(),[n,s]=Z(!1),[i,r]=Z(""),o=m=>{var y;s(m),(y=e.onRejectReasonOpenChange)==null||y.call(e,m)};Se(()=>{var m;(m=e.permission())==null||m.id,o(!1),r("")});const l=()=>{const m=e.permission();if(!m)return null;const y=m.metadata??{},S=typeof y.diff=="string"?y.diff:null,v=(()=>{if(typeof y.filePath=="string")return y.filePath;if(typeof y.path=="string")return y.path})();return!S||S.trim().length===0?null:{diffText:S,filePath:v}},a=(m,y)=>{const S=e.permission();if(!S)return;const v=En(S)||e.fallbackSessionId();e.onRespond(S,v,m,y)},c=()=>{a("reject",i().trim()||void 0)};return T(x,{get when(){return e.permission()},children:m=>(()=>{var y=Ji(),S=y.firstChild,v=S.firstChild,h=v.nextSibling,u=S.nextSibling,f=u.firstChild,p=f.firstChild;return w(v,(()=>{var d=Ce(()=>!!e.active());return()=>d()?t("toolCall.permission.status.required"):t("toolCall.permission.status.queued")})()),w(h,()=>ds(m())),w(p,()=>gs(m())),w(u,T(x,{get when(){return l()},children:d=>(()=>{var $=qi();return w($,()=>e.renderDiff(d(),{variant:"permission-diff",disableScrollTracking:!0,label:d().filePath?t("toolCall.permission.requestedDiff.withPath",{path:In(d().filePath||"")}):t("toolCall.permission.requestedDiff.label")})),$})()}),null),w(u,T(x,{get when(){return!e.active()},get children(){var d=Bi();return w(d,()=>t("toolCall.permission.queuedText")),d}}),null),w(u,T(x,{get when(){return n()},get fallback(){return(()=>{var d=Ui(),$=d.firstChild,C=$.firstChild,k=C.nextSibling,R=k.nextSibling;return C.$$click=()=>a("once"),w(C,()=>t("toolCall.permission.actions.allowOnce")),k.$$click=()=>a("always"),w(k,()=>t("toolCall.permission.actions.alwaysAllow")),R.$$click=()=>o(!0),w(R,()=>t("toolCall.permission.actions.deny")),w(d,T(x,{get when(){return e.active()},get children(){var I=Qi(),M=I.firstChild,j=M.nextSibling,J=j.nextSibling,q=J.nextSibling;return w(j,()=>t("toolCall.permission.shortcuts.allowOnce")),w(q,()=>t("toolCall.permission.shortcuts.alwaysAllow")),I}}),null),z(I=>{var M=e.submitting(),j=e.submitting(),J=e.submitting();return M!==I.e&&(C.disabled=I.e=M),j!==I.t&&(k.disabled=I.t=j),J!==I.a&&(R.disabled=I.a=J),I},{e:void 0,t:void 0,a:void 0}),d})()},get children(){var d=Fi(),$=d.firstChild,C=$.nextSibling,k=C.nextSibling,R=k.nextSibling,I=R.firstChild,M=I.nextSibling;return w($,()=>t("toolCall.permission.rejectReason.label")),C.$$input=j=>r(j.currentTarget.value),P(C,"maxlength",hs),w(k,()=>t("toolCall.permission.rejectReason.hint")),I.$$click=c,w(I,()=>t("toolCall.permission.actions.confirmDeny")),M.$$click=()=>{o(!1),r("")},w(M,()=>t("toolCall.permission.actions.cancel")),z(j=>{var J=`permission-reject-reason-${m().id}`,q=`permission-reject-reason-${m().id}`,K=t("toolCall.permission.rejectReason.placeholder"),ne=e.submitting(),ie=e.submitting(),re=e.submitting();return J!==j.e&&P($,"for",j.e=J),q!==j.t&&P(C,"id",j.t=q),K!==j.a&&P(C,"placeholder",j.a=K),ne!==j.o&&(C.disabled=j.o=ne),ie!==j.i&&(I.disabled=j.i=ie),re!==j.n&&(M.disabled=j.n=re),j},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),z(()=>C.value=i()),d}}),null),w(u,T(x,{get when(){return e.error()},get children(){var d=Ki();return w(d,()=>e.error()),d}}),null),z(()=>Ie(y,`tool-call-permission ${e.active()?"tool-call-permission-active":"tool-call-permission-queued"}`)),y})()})}ot(["input","click"]);var Wi=F("<div class=tool-call-diff-viewer><div>"),Hi=F('<div class="message-text tool-call-markdown tool-call-markdown-large tool-call-diff-shell"><div class=tool-call-diff-toolbar role=group><span class=tool-call-diff-toolbar-label></span><div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>'),Yi=F("<pre class=tool-call-diff-fallback>");const zi=cs(()=>qs(()=>import("./diff-viewer-Dc4-Qlfy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(e=>({default:e.ToolCallDiffViewer})));function Gi(e){return fs(()=>{var t;(t=e.onRendered)==null||t.call(e)}),(()=>{var t=Wi(),n=t.firstChild;return z(()=>n.innerHTML=e.html),t})()}function Xi(e){const t=ms("(max-width: 640px)"),[n,s]=Z(void 0),[i,r]=Z(!0);Se(()=>{t()||s(void 0)});const o=c=>{e.scrollHelpers.registerContainer(c)},l=c=>{e.scrollHelpers.registerContainer(c,{disableTracking:!0})};function a(c,m){const y=c.filePath?In(c.filePath):"",S=(m==null?void 0:m.label)||(y?e.t("toolCall.diff.label.withPath",{path:y}):e.t("toolCall.diff.label")),h=((m==null?void 0:m.variant)==="permission-diff"?"permission-diff":"diff")==="permission-diff"?e.permissionDiffCache:e.diffCache,u=()=>e.preferences().diffViewMode||"split",f=()=>t()?n()||"unified":u(),p=()=>i(),d=e.isDark()?"dark":"light",$=e.toolState(),C=!!(m!=null&&m.disableScrollTracking||($==null?void 0:$.status)!=="running"&&($==null?void 0:$.status)!=="pending"),k=C?l:o,R=h.params(),I=(()=>{const B=typeof(m==null?void 0:m.cacheKey)=="string"?m.cacheKey.trim():"";return B?{...R,cacheId:`${R.cacheId}:${B}`}:R})(),M=L(()=>f()),j=L(()=>p()),J=L(()=>{const B=ys(I);if(B&&B.text===c.diffText&&B.theme===d&&B.mode===M()&&B.wrap===j())return B.html}),q=B=>{t()&&s(B),e.setDiffViewMode(B)},K=()=>M()==="split"?"unified":"split",ne=()=>K()==="split"?e.t("toolCall.diff.switchToSplit"):e.t("toolCall.diff.switchToUnified"),ie=()=>i()?e.t("toolCall.diff.disableWordWrap"):e.t("toolCall.diff.enableWordWrap"),re=()=>e.t("toolCall.diff.copyPatch"),be=()=>{var B;e.handleScrollRendered(),(B=e.onContentRendered)==null||B.call(e)};return(()=>{var B=Hi(),fe=B.firstChild,de=fe.firstChild,se=de.nextSibling,ge=se.firstChild,ae=ge.nextSibling,ee=ae.nextSibling;return xe(B,"scroll",C?void 0:e.scrollHelpers.handleScroll),Ue(k,B),w(de,S),ge.$$click=()=>void Pt(c.diffText),w(ge,T(Rt,{class:"h-4 w-4","aria-hidden":"true"})),ae.$$click=()=>q(K()),w(ae,(()=>{var O=Ce(()=>K()==="split");return()=>O()?T(bs,{class:"h-4 w-4","aria-hidden":"true"}):T(Qs,{class:"h-4 w-4","aria-hidden":"true"})})()),ee.$$click=()=>r(O=>!O),w(ee,T(Us,{class:"h-4 w-4","aria-hidden":"true"})),w(B,(()=>{var O=Ce(()=>!!J());return()=>O()?T(Gi,{get html(){return J()},onRendered:be}):T(us,{get fallback(){return(()=>{var Q=Yi();return w(Q,()=>c.diffText),Q})()},get children(){return T(zi,{get diffText(){return c.diffText},get filePath(){return c.filePath},theme:d,get mode(){return M()},get wrap(){return j()},cacheEntryParams:I,onRendered:be})}})})(),null),w(B,()=>e.scrollHelpers.renderSentinel({disableTracking:C}),null),z(O=>{var Q=M(),te=e.t("toolCall.diff.viewMode.ariaLabel"),oe=re(),Y=re(),b=ne(),A=ne(),N=`file-viewer-toolbar-icon-button${i()?" active":""}`,E=ie(),ce=ie();return Q!==O.e&&P(B,"data-diff-mode",O.e=Q),te!==O.t&&P(fe,"aria-label",O.t=te),oe!==O.a&&P(ge,"aria-label",O.a=oe),Y!==O.o&&P(ge,"title",O.o=Y),b!==O.i&&P(ae,"aria-label",O.i=b),A!==O.n&&P(ae,"title",O.n=A),N!==O.s&&Ie(ee,O.s=N),E!==O.h&&P(ee,"aria-label",O.h=E),ce!==O.r&&P(ee,"title",O.r=ce),O},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),B})()}return{renderDiffContent:a}}ot(["click"]);var Zi=F('<div><pre class="whitespace-pre-wrap break-words text-sm font-mono"dir=auto>'),er=F("<div>");function tr(e){const t=i=>{e.scrollHelpers.registerContainer(i)},n=i=>{e.scrollHelpers.registerContainer(i,{disableTracking:!0})};function s(i){var u;if(!i.content)return null;const r=i.size||"default",o=i.disableHighlight||!1,l=`message-text tool-call-markdown${r==="large"?" tool-call-markdown-large":""}`,a=e.toolState(),c=i.disableScrollTracking||(a==null?void 0:a.status)!=="running"&&(a==null?void 0:a.status)!=="pending",m=c?n:t;if(!!(a&&(a.status==="running"||a.status==="pending")&&o))return(()=>{var f=Zi(),p=f.firstChild;return xe(f,"scroll",c?void 0:e.scrollHelpers.handleScroll),Ue(m,f),Ie(f,l),w(p,()=>i.content),w(f,()=>e.scrollHelpers.renderSentinel({disableTracking:c}),null),f})();const S=typeof i.cacheKey=="string"&&i.cacheKey.length>0?i.cacheKey:void 0,v={id:S?`${e.partId()}:${S}`:e.partId(),type:"text",text:i.content,version:(u=e.partVersion)==null?void 0:u.call(e)},h=()=>{var f;e.handleScrollRendered(),(f=e.onContentRendered)==null||f.call(e)};return(()=>{var f=er();return xe(f,"scroll",c?void 0:e.scrollHelpers.handleScroll),Ue(m,f),Ie(f,l),w(f,T(ps,{part:v,get instanceId(){return e.instanceId},get sessionId(){return e.sessionId},get isDark(){return e.isDark()},disableHighlight:o,onRendered:h}),null),w(f,()=>e.scrollHelpers.renderSentinel({disableTracking:c}),null),f})()}return{renderMarkdownContent:s}}var nr=F("<div class=tool-call-diagnostics role=region><div class=tool-call-diagnostics-body role=list>"),sr=F("<div class=tool-call-diagnostics-wrapper><button type=button class=tool-call-diagnostics-heading><span class=tool-call-icon aria-hidden=true></span><span class=tool-call-emoji aria-hidden=true>🛠</span><span class=tool-call-summary></span><span class=tool-call-diagnostics-file>"),ir=F("<div class=tool-call-diagnostic-row role=listitem><span><span class=tool-call-diagnostic-chip-icon></span><span></span></span><span class=tool-call-diagnostic-path><span class=tool-call-diagnostic-coords>:L<!>:C</span></span><span class=tool-call-diagnostic-message dir=auto>");function rr(e,t,n,s,i){return t.length===0?null:(()=>{var r=sr(),o=r.firstChild,l=o.firstChild,a=l.nextSibling,c=a.nextSibling,m=c.nextSibling;return xe(o,"click",s,!0),P(o,"aria-expanded",n),w(l,n?"▼":"▶"),w(c,()=>e("toolCall.diagnostics.title")),P(m,"title",i),w(m,i),w(r,T(x,{when:n,get children(){var y=nr(),S=y.firstChild;return w(S,T(Mt,{each:t,children:v=>(()=>{var h=ir(),u=h.firstChild,f=u.firstChild,p=f.nextSibling,d=u.nextSibling,$=d.firstChild,C=$.firstChild,k=C.nextSibling;k.nextSibling;var R=d.nextSibling;return w(f,()=>v.icon),w(p,()=>v.label),w(d,()=>v.displayPath,$),w($,()=>v.line||"-",k),w($,()=>v.column||"-",null),w(R,()=>v.message),z(I=>{var M=`tool-call-diagnostic-chip tool-call-diagnostic-${v.tone}`,j=v.filePath;return M!==I.e&&Ie(u,I.e=M),j!==I.t&&P(d,"title",I.t=j),I},{e:void 0,t:void 0}),h})()})),z(()=>P(y,"aria-label",e("toolCall.diagnostics.ariaLabel"))),y}}),null),r})()}ot(["click"]);var or=F("<span class=tool-call-header-status aria-hidden=true><span></span><span></span><span></span><span>"),lr=F("<div class=tool-call-error-content><strong></strong> "),$n=F("<div class=tool-call-io-body>"),Cn=F("<div class=tool-call-pending-message><span class=spinner-small></span><span>"),ar=F("<div class=tool-call-io-sections><div class=tool-call-io-section><button type=button class=tool-call-io-toggle><span class=tool-call-io-title></span></button></div><div class=tool-call-io-section><button type=button class=tool-call-io-toggle><span class=tool-call-io-title>"),cr=F("<div class=tool-call-details>"),ur=F("<button type=button class=tool-call-header-input>"),fr=F("<div data-part-type=tool><div class=tool-call-header><button type=button class=tool-call-header-toggle><span class=tool-call-summary></span></button><button type=button class=tool-call-header-copy>");const tt=as("session"),dr="tool-call",gr=48;function hr(e,t,n,s="default"){return`${t??"unknown-message"}:${n??e??"unknown-tool-call"}:${s}`}function mr(e){const t=n=>e.status()===n;return(()=>{var n=or(),s=n.firstChild,i=s.nextSibling,r=i.nextSibling,o=r.nextSibling;return w(s,T(Ws,{class:"w-4 h-4"})),w(i,T(Ps,{class:"w-4 h-4 animate-spin"})),w(r,T(Rs,{class:"w-4 h-4"})),w(o,T(Ys,{class:"w-4 h-4"})),z(l=>{var a=e.status()||"pending",c=t("pending")?"inline-flex":"none",m=t("running")?"inline-flex":"none",y=t("completed")?"inline-flex":"none",S=t("error")?"inline-flex":"none";return a!==l.e&&P(n,"data-status",l.e=a),c!==l.t&&gt(s,"display",l.t=c),m!==l.a&&gt(i,"display",l.a=m),y!==l.o&&gt(r,"display",l.o=y),S!==l.i&&gt(o,"display",l.i=S),l},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()}function yr(e){const t=L(()=>e.messageVersion),n=L(()=>e.partVersion),s=L(()=>{var b;return{toolCallId:e.toolCallIdentifier(),messageId:e.messageId,partId:((b=e.toolCallMemo())==null?void 0:b.id)??null}}),i=L(()=>typeof e.partVersion=="number"?String(e.partVersion):typeof e.messageVersion=="number"?String(e.messageVersion):"noversion"),r=(b,A)=>Ds({instanceId:()=>e.instanceId,sessionId:()=>e.sessionId,scope:dr,cacheId:()=>{const N=s(),E=typeof b=="function"?b():b;return hr(N.toolCallId||void 0,N.messageId,N.partId,E)},version:()=>A?A():i()}),o=r("diff"),l=r("permission-diff"),a=r("ansi-running",()=>"running"),c=r("ansi-final"),m=L(()=>{var b;return(b=e.pendingPermission())==null?void 0:b.permission}),y=L(()=>{var b;return(b=e.pendingQuestion())==null?void 0:b.request}),S=L(()=>{const b=m();return b&&e.isPermissionActive()?b.id:""}),v=L(()=>{const b=y();return b&&e.isQuestionActive()?b.id:""}),[h,u]=Z(!1),[f,p]=Z(null),[d,$]=Z(!1),C=Vs({getScrollTopSnapshot:e.scrollTopSnapshot,setScrollTopSnapshot:e.setScrollTopSnapshot,sentinelMarginPx:gr,sentinelClassName:"tool-call-scroll-sentinel"}),k={registerContainer:(b,A)=>{C.registerContainer(b,A)},handleScroll:C.handleScroll,renderSentinel:C.renderSentinel,restoreAfterRender:C.restoreAfterRender},R=()=>{k.restoreAfterRender()};Se(()=>{m()||u(!1),p(null)}),Se(()=>{(S()||v())&&requestAnimationFrame(()=>{var A;(A=e.toolCallRootEl())==null||A.scrollIntoView({block:"center",behavior:"smooth"})})});async function I(b,A,N){if(b){u(!0),p(null);try{const E=En(b);if(!E)throw new Error("Permission request is missing sessionID");await Bs(e.instanceId,E,b.id,A,N)}catch(E){tt.error("Failed to send permission response",E),p(E instanceof Error?E.message:e.t("toolCall.permission.errors.unableToUpdate"))}finally{u(!1)}}}Se(()=>{if(!S())return;const A=N=>{if(ie()||d())return;const E=m();!E||!e.isPermissionActive()||(N.key==="Enter"?(N.preventDefault(),I(E,"once")):(N.key==="a"||N.key==="A")&&(N.preventDefault(),I(E,"always")))};document.addEventListener("keydown",A),hn(()=>document.removeEventListener("keydown",A))});const[M,j]=Z(!1),[J,q]=Z(null),[K,ne]=Z({});function ie(){const b=document.activeElement;return(b==null?void 0:b.tagName)==="TEXTAREA"||(b==null?void 0:b.tagName)==="INPUT"||((b==null?void 0:b.hasAttribute("contenteditable"))??!1)}async function re(){const b=y();if(!b||!e.isQuestionActive())return;const A=(K()[b.id]??[]).map(E=>Array.isArray(E)?E:[]),N=b.questions.map((E,ce)=>(A[ce]??[]).map(ue=>ue.trim()).filter(ue=>ue.length>0));if(N.some(E=>((E==null?void 0:E.length)??0)===0)){q(e.t("toolCall.question.validation.answerAll"));return}j(!0),q(null);try{await Fs(e.instanceId,b.sessionID,b.id,N)}catch(E){tt.error("Failed to send question reply",E),q(E instanceof Error?E.message:e.t("toolCall.question.errors.unableToReply"))}finally{j(!1)}}async function be(){const b=y();if(!(!b||!e.isQuestionActive())){j(!0),q(null);try{await Ks(e.instanceId,b.sessionID,b.id)}catch(A){tt.error("Failed to reject question",A),q(A instanceof Error?A.message:e.t("toolCall.question.errors.unableToDismiss"))}finally{j(!1)}}}Se(()=>{if(!v())return;const A=N=>{ie()||(N.key==="Enter"?(N.preventDefault(),re()):N.key==="Escape"&&(N.preventDefault(),be()))};document.addEventListener("keydown",A),hn(()=>document.removeEventListener("keydown",A))}),Se(()=>{const b=y();if(!b){j(!1),q(null);return}q(null);const A=b.id;ne(N=>{if(N[A])return N;const E=b.questions.map(()=>[]);return{...N,[A]:E}})});const B=()=>{var b;return((b=e.toolState())==null?void 0:b.status)||""},fe=L(()=>{const b=e.toolInput();if(!b||Object.keys(b).length===0)return null;try{const A=Ni(b);return yn(A,"yaml",!0)}catch(A){tt.error("Failed to convert tool call input to YAML",A);try{const N=JSON.stringify(b,null,2);return yn(N,"json",!0)}catch(N){return tt.error("Failed to stringify tool call input",N),null}}}),de=L(()=>An(e.toolName())),{renderAnsiContent:se}=Js({ansiRunningCache:a,ansiFinalCache:c,scrollHelpers:k,partVersion:n}),{renderDiffContent:ge}=Xi({toolState:e.toolState,preferences:e.preferences,setDiffViewMode:e.setDiffViewMode,isDark:e.isDark,t:e.t,diffCache:o,permissionDiffCache:l,scrollHelpers:k,handleScrollRendered:R,onContentRendered:e.onContentRendered}),{renderMarkdownContent:ae}=tr({toolState:e.toolState,partId:e.toolCallIdentifier,partVersion:n,instanceId:e.instanceId,sessionId:e.sessionId,isDark:e.isDark,scrollHelpers:k,handleScrollRendered:R,onContentRendered:e.onContentRendered}),ee={toolCall:e.toolCallMemo,toolState:e.toolState,toolName:e.toolName,instanceId:e.instanceId,sessionId:e.sessionId,t:e.t,messageVersion:t,partVersion:n,renderMarkdown:ae,renderAnsi:se,renderDiff:ge,renderToolCall:b=>b!=null&&b.toolCall?T(br,{get toolCall(){return b.toolCall},get toolCallId(){return b.toolCall.id},get messageId(){return b.messageId},get messageVersion(){return b.messageVersion},get partVersion(){return b.partVersion},get instanceId(){return e.instanceId},get sessionId(){return b.sessionId},get onContentRendered(){return e.onContentRendered},get forceCollapsed(){return b.forceCollapsed}}):null,scrollHelpers:k,onContentRendered:e.onContentRendered};let O;Se(()=>{const b=n();b!==void 0&&(O!==void 0&&b===O||(O=b,k.restoreAfterRender()))}),Se(()=>{C.autoScroll()&&k.restoreAfterRender()});const Q=()=>de().renderBody(ee),te=()=>{const b=e.toolState();return(b==null?void 0:b.status)==="error"&&b.error?(()=>{var A=lr(),N=A.firstChild;return N.nextSibling,w(N,()=>e.t("toolCall.error.label")),w(A,()=>b.error,null),A})():null},oe=()=>T(xi,{permission:m,get active(){return e.isPermissionActive},submitting:h,error:f,renderDiff:ge,fallbackSessionId:()=>e.sessionId,onRejectReasonOpenChange:$,onRespond:(b,A,N,E)=>void I(b,N,E)}),Y=()=>T(Vi,{get toolName(){return e.toolName},get toolState(){return e.toolState},get toolCallId(){return e.toolCallIdentifier},request:y,get active(){return e.isQuestionActive},submitting:M,error:J,draftAnswers:K,setDraftAnswers:ne,onSubmit:()=>void re(),onDismiss:()=>void be()});return(()=>{var b=cr();return w(b,T(x,{get when(){return Ce(()=>!!e.isToolInputVisible())()&&e.hasToolInput()},get fallback(){return[Ce(Q),Ce(te),T(x,{get when(){return Ce(()=>B()==="pending")()&&!e.pendingPermission()},get children(){var A=Cn(),N=A.firstChild,E=N.nextSibling;return w(E,()=>e.t("toolCall.pending.waitingToRun")),A}})]},get children(){var A=ar(),N=A.firstChild,E=N.firstChild,ce=E.firstChild,Ae=N.nextSibling,ue=Ae.firstChild,De=ue.firstChild;return xe(E,"click",e.toggleInputSection,!0),w(ce,()=>e.t("toolCall.io.input")),w(N,T(x,{get when(){return e.inputSectionExpanded()},get children(){var X=$n();return w(X,()=>{const $e=fe();return $e?ae({content:$e,cacheKey:"input"}):null}),X}}),null),xe(ue,"click",e.toggleOutputSection,!0),w(De,()=>e.t("toolCall.io.output")),w(Ae,T(x,{get when(){return e.outputSectionExpanded()},get children(){var X=$n();return w(X,Q,null),w(X,te,null),w(X,T(x,{get when(){return Ce(()=>B()==="pending")()&&!e.pendingPermission()},get children(){var $e=Cn(),Ve=$e.firstChild,ft=Ve.nextSibling;return w(ft,()=>e.t("toolCall.pending.waitingToRun")),$e}}),null),X}}),null),z(X=>{var $e=e.inputSectionExpanded(),Ve=e.outputSectionExpanded();return $e!==X.e&&P(E,"aria-expanded",X.e=$e),Ve!==X.t&&P(ue,"aria-expanded",X.t=Ve),X},{e:void 0,t:void 0}),A}}),null),w(b,oe,null),w(b,Y,null),b})()}function br(e){const{preferences:t,setDiffViewMode:n}=os(),{isDark:s}=ls(),{t:i}=Kt(),r=L(()=>e.toolCall),o=L(()=>{var g;return((g=r())==null?void 0:g.tool)||""}),l=L(()=>{var _;const g=(_=r())==null?void 0:_.id;if(!g)throw new Error("Tool call requires a part id");return g}),a=L(()=>{var g;return(g=r())==null?void 0:g.state}),c=L(()=>ws.getOrCreate(e.instanceId)),m=L(()=>Ss().get(e.instanceId)??null),y=L(()=>c().getPermissionState(e.messageId,l())),S=L(()=>{var _;const g=y();return g?{permission:g.entry.permission,active:g.active}:(_=r())==null?void 0:_.pendingPermission}),v=L(()=>c().getQuestionState(e.messageId,l())),h=L(()=>{const g=v();if(g)return{request:g.entry.request,active:g.active}}),u=L(()=>(t().toolOutputExpansion||"expanded")==="expanded"),f=L(()=>(t().diagnosticsExpansion||"expanded")==="expanded"),p=L(()=>{var pe;if(e.forceCollapsed)return!1;const g=u();if((((pe=r())==null?void 0:pe.tool)||"")==="read"){const Oe=a();return(Oe==null?void 0:Oe.status)==="error"}return g}),[d,$]=Z(null),C=L(()=>t().toolInputsVisibility||"collapsed"),[k,R]=Z(null),I=L(()=>k()??C()),M=L(()=>I()!=="hidden"),j=L(()=>I()==="expanded"),[J,q]=Z(null),[K,ne]=Z(null),ie=()=>{const g=J();return g!==null?g:j()},re=()=>{const g=K();return g!==null?g:!0},be=L(()=>{const g=S();if(!(g!=null&&g.permission))return!1;if(g.active)return!0;const _=m();return(_==null?void 0:_.kind)==="permission"&&_.id===g.permission.id}),B=L(()=>{const g=h();if(!(g!=null&&g.request))return!1;if(g.active)return!0;const _=m();return(_==null?void 0:_.kind)==="question"&&_.id===g.request.id}),fe=()=>{if(be()||B())return!0;const g=d();return g!==null?g:p()},de=L(()=>{const g=a();return vs(g).input}),se=L(()=>{const g=de();return g&&Object.keys(g).length>0}),[ge,ae]=Z(),[ee,O]=Z(0),[Q,te]=Z(void 0),oe=()=>{if(be()||B())return!0;const g=Q();return g!==void 0?g:f()},Y=L(()=>{const g=a();return g?$s(g):[]}),b=()=>{q(g=>!(g===null?ie():g))},A=()=>{ne(g=>!(g===null?re():g))},N=()=>{var _;return`tool-call-status-${((_=a())==null?void 0:_.status)||"pending"}`},E=()=>{const g=N();return S()||h()?`${g} tool-call-awaiting-permission`:g};function ce(){const g=S();g!=null&&g.active||$(_=>!(_===null?p():_))}Se(()=>{C(),R(null),q(null),ne(null)});const Ae=g=>{g.preventDefault(),g.stopPropagation(),fe()||ce();const _=M();R(_?"hidden":"expanded")},ue=L(()=>An(o())),De=()=>null,X=()=>null,$e=()=>null,Ve=()=>null,ft={toolCall:r,toolState:a,toolName:o,instanceId:e.instanceId,sessionId:e.sessionId,t:i,messageVersion:()=>e.messageVersion,partVersion:()=>e.partVersion,renderMarkdown:De,renderAnsi:X,renderDiff:$e,renderToolCall:Ve,scrollHelpers:void 0},nn=()=>{var g,_;return((_=(g=ue()).getAction)==null?void 0:_.call(g,ft))??Ns(o())},ss=()=>{var Oe,Te;const g=a(),_=o();if(_!=="task")return Ts({toolName:_,state:g});if(!g||g.status==="pending")return nn();const pe=(Te=(Oe=ue()).getTitle)==null?void 0:Te.call(Oe,ft);return pe||(_s(g)&&g.title||js(g)&&g.title?g.title:Ls(_))},dt=L(()=>ss()),sn=L(()=>Cs({title:dt(),state:a(),t:i})),je=Os({id:()=>`${e.instanceId}:${e.sessionId}:${e.messageId??"message"}:${l()}`,text:sn}),rn=()=>sn().trim().length>0&&je.canUseSpeech(),is=async g=>{g.preventDefault(),g.stopPropagation();const _=dt();_&&await Pt(_)},on=()=>{const g=[];return se()&&g.push({key:"toggle-input",label:M()?i("toolCall.header.hideInputTitle"):i("toolCall.header.showInputTitle"),icon:T(mn,{class:"w-3.5 h-3.5","aria-hidden":"true"}),onSelect:()=>{fe()||ce();const _=M();R(_?"hidden":"expanded")}}),g.push({key:"copy",label:i("toolCall.header.copyTitle"),icon:T(Rt,{class:"w-3.5 h-3.5","aria-hidden":"true"}),onSelect:async()=>{const _=dt();_&&await Pt(_)}}),rn()&&g.push({key:"speak",label:je.buttonTitle(),icon:T(Ms,{class:"w-3.5 h-3.5","aria-hidden":"true"}),onSelect:()=>void je.toggle()}),g},rs=()=>{var g;return((g=a())==null?void 0:g.status)||""};return(()=>{var g=fr(),_=g.firstChild,pe=_.firstChild,Oe=pe.firstChild,Te=pe.nextSibling;return Ue(D=>{ae(D||void 0)},g),pe.$$click=ce,w(Oe,dt),w(_,T(x,{get when(){return se()},get children(){var D=ur();return D.$$click=Ae,w(D,T(mn,{class:"w-3.5 h-3.5"})),z(we=>{var Xe=M(),Ze=M()?i("toolCall.header.hideInputAriaLabel"):i("toolCall.header.showInputAriaLabel"),et=M()?i("toolCall.header.hideInputTitle"):i("toolCall.header.showInputTitle");return Xe!==we.e&&P(D,"aria-pressed",we.e=Xe),Ze!==we.t&&P(D,"aria-label",we.t=Ze),et!==we.a&&P(D,"title",we.a=et),we},{e:void 0,t:void 0,a:void 0}),D}}),Te),Te.$$click=is,w(Te,T(Rt,{class:"w-3.5 h-3.5"})),w(_,T(x,{get when(){return rn()},get children(){return T(ks,{class:"tool-call-header-copy",onClick:()=>void je.toggle(),get title(){return je.buttonTitle()},get isLoading(){return je.isLoading()},get isPlaying(){return je.isPlaying()}})}}),null),w(_,T(Is,{get items(){return on()},get label(){return i("messageItem.actions.more")},triggerClass:"tool-call-header-copy",minItems:2}),null),w(_,T(mr,{status:rs}),null),w(g,T(x,{get when(){return fe()},get children(){return T(yr,{toolCallMemo:r,toolState:a,toolName:o,toolCallIdentifier:l,get instanceId(){return e.instanceId},get sessionId(){return e.sessionId},get messageId(){return e.messageId},get messageVersion(){return e.messageVersion},get partVersion(){return e.partVersion},get onContentRendered(){return e.onContentRendered},preferences:t,setDiffViewMode:n,isDark:s,t:i,store:c,pendingPermission:S,pendingQuestion:h,isPermissionActive:be,isQuestionActive:B,hasToolInput:se,isToolInputVisible:M,toolInput:de,inputSectionExpanded:ie,outputSectionExpanded:re,toggleInputSection:b,toggleOutputSection:A,toolCallRootEl:ge,scrollTopSnapshot:ee,setScrollTopSnapshot:O})}}),null),w(g,T(x,{get when(){return Y().length},get children(){return rr(i,Y(),oe(),()=>te(D=>!(D===void 0?f():D)),Es(Y()))}}),null),z(D=>{var we=`tool-call ${E()}`,Xe=o(),Ze=e.instanceId,et=e.sessionId,ln=e.messageId,an=l(),cn=on().length>1?"true":void 0,un=fe(),fn=As(o()),dn=i("toolCall.header.copyAriaLabel"),gn=i("toolCall.header.copyTitle");return we!==D.e&&Ie(g,D.e=we),Xe!==D.t&&P(g,"data-tool-name",D.t=Xe),Ze!==D.a&&P(g,"data-instance-id",D.a=Ze),et!==D.o&&P(g,"data-session-id",D.o=et),ln!==D.i&&P(g,"data-message-id",D.i=ln),an!==D.n&&P(g,"data-part-id",D.n=an),cn!==D.s&&P(_,"data-action-overflow",D.s=cn),un!==D.h&&P(pe,"aria-expanded",D.h=un),fn!==D.r&&P(Oe,"data-tool-icon",D.r=fn),dn!==D.d&&P(Te,"aria-label",D.d=dn),gn!==D.l&&P(Te,"title",D.l=gn),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),g})()}ot(["click"]);export{br as default};