skill-creator 1.5.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +89 -0
- package/LICENSE +21 -0
- package/README.md +248 -345
- package/dist/cli.js +51209 -0
- package/dist/cli.js.map +7 -0
- package/dist/daemon.js +52243 -0
- package/dist/daemon.js.map +7 -0
- package/dist/package.json +5 -0
- package/dist/webui/_app/immutable/assets/0.0XN00VKF.css +2 -0
- package/dist/webui/_app/immutable/assets/ProviderView.DEH95hqa.css +1 -0
- package/dist/webui/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
- package/dist/webui/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
- package/dist/webui/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
- package/dist/webui/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
- package/dist/webui/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
- package/dist/webui/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
- package/dist/webui/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
- package/dist/webui/_app/immutable/assets/shell.U4CQV8re.css +1 -0
- package/dist/webui/_app/immutable/chunks/0umLG1IN.js +1 -0
- package/dist/webui/_app/immutable/chunks/B0pe_B_o.js +1 -0
- package/dist/webui/_app/immutable/chunks/BEPs9Z9s.js +1 -0
- package/dist/webui/_app/immutable/chunks/BEsyQXpe.js +1 -0
- package/dist/webui/_app/immutable/chunks/BIfnT_mK.js +1 -0
- package/dist/webui/_app/immutable/chunks/BQ8kO0xi.js +2 -0
- package/dist/webui/_app/immutable/chunks/BYNWtKcf.js +259 -0
- package/dist/webui/_app/immutable/chunks/BZ2Jwl6O.js +1 -0
- package/dist/webui/_app/immutable/chunks/Bg2k7op5.js +1 -0
- package/dist/webui/_app/immutable/chunks/Bjy-W4x2.js +81 -0
- package/dist/webui/_app/immutable/chunks/BkEnd9_Z.js +1 -0
- package/dist/webui/_app/immutable/chunks/BoMQFGOq.js +52 -0
- package/dist/webui/_app/immutable/chunks/Bs27XW8_.js +1 -0
- package/dist/webui/_app/immutable/chunks/C3mlWJXx.js +1 -0
- package/dist/webui/_app/immutable/chunks/CGrKeCdk.js +8 -0
- package/dist/webui/_app/immutable/chunks/CIFG41pU.js +1 -0
- package/dist/webui/_app/immutable/chunks/CNPsST_i.js +1 -0
- package/dist/webui/_app/immutable/chunks/COoMyR0G.js +1 -0
- package/dist/webui/_app/immutable/chunks/CQD9uzpA.js +1 -0
- package/dist/webui/_app/immutable/chunks/CeR4do8T.js +1 -0
- package/dist/webui/_app/immutable/chunks/Ckw1quWt.js +1 -0
- package/dist/webui/_app/immutable/chunks/CmCJ0SKP.js +3 -0
- package/dist/webui/_app/immutable/chunks/CqzSRtkf.js +1 -0
- package/dist/webui/_app/immutable/chunks/CsaIfA9E.js +1 -0
- package/dist/webui/_app/immutable/chunks/D-Jy42mM.js +1 -0
- package/dist/webui/_app/immutable/chunks/D-V0xBeS.js +1 -0
- package/dist/webui/_app/immutable/chunks/D8Der6oM.js +1 -0
- package/dist/webui/_app/immutable/chunks/DPrjly2t.js +1 -0
- package/dist/webui/_app/immutable/chunks/DZ_Kltd5.js +1 -0
- package/dist/webui/_app/immutable/chunks/DecrR9TK.js +1 -0
- package/dist/webui/_app/immutable/chunks/Dl8eQ129.js +5 -0
- package/dist/webui/_app/immutable/chunks/Dnkino9G.js +1 -0
- package/dist/webui/_app/immutable/chunks/FuwccWbx.js +1 -0
- package/dist/webui/_app/immutable/chunks/HclGiUj8.js +1 -0
- package/dist/webui/_app/immutable/chunks/J36u8XLO.js +1 -0
- package/dist/webui/_app/immutable/chunks/JcDjicYT.js +1 -0
- package/dist/webui/_app/immutable/chunks/O2CEZ91h.js +1 -0
- package/dist/webui/_app/immutable/chunks/UeEccMjN.js +1 -0
- package/dist/webui/_app/immutable/chunks/Y--VMh3y.js +1 -0
- package/dist/webui/_app/immutable/chunks/gkPAnPzC.js +3 -0
- package/dist/webui/_app/immutable/chunks/r1y9r7sj.js +2 -0
- package/dist/webui/_app/immutable/chunks/s48N5eaK.js +67 -0
- package/dist/webui/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/dist/webui/_app/immutable/entry/app.BisiObvX.js +2 -0
- package/dist/webui/_app/immutable/entry/start.uEYh5tXy.js +1 -0
- package/dist/webui/_app/immutable/nodes/0.C8yGM2gr.js +231 -0
- package/dist/webui/_app/immutable/nodes/1.BUJKZ337.js +1 -0
- package/dist/webui/_app/immutable/nodes/2.Db-aM2Oa.js +1 -0
- package/dist/webui/_app/immutable/nodes/3.DCVfhckZ.js +1 -0
- package/dist/webui/_app/version.json +1 -0
- package/dist/webui/icons/app-icon/darwin-dark.icns +0 -0
- package/dist/webui/icons/app-icon/darwin-light.icns +0 -0
- package/dist/webui/icons/app-icon/win32-dark.ico +0 -0
- package/dist/webui/icons/app-icon/win32-light.ico +0 -0
- package/dist/webui/icons/app-icon.icns +0 -0
- package/dist/webui/icons/app-icon.ico +0 -0
- package/dist/webui/icons/app-icon.json +84 -0
- package/dist/webui/icons/app-icon.png +0 -0
- package/dist/webui/icons/flat-symbol.png +0 -0
- package/dist/webui/icons/linux/128x128/app-icon.png +0 -0
- package/dist/webui/icons/linux/16x16/app-icon.png +0 -0
- package/dist/webui/icons/linux/256x256/app-icon.png +0 -0
- package/dist/webui/icons/linux/32x32/app-icon.png +0 -0
- package/dist/webui/icons/linux/48x48/app-icon.png +0 -0
- package/dist/webui/icons/linux/512x512/app-icon.png +0 -0
- package/dist/webui/icons/linux/64x64/app-icon.png +0 -0
- package/dist/webui/icons/monochrome-mini.png +0 -0
- package/dist/webui/index.html +62 -0
- package/dist/webui/robots.txt +3 -0
- package/package.json +99 -73
- package/dist/buildIndex-B_9ABRtx.mjs +0 -2
- package/dist/buildIndex-B_9ABRtx.mjs.map +0 -1
- package/dist/buildIndex-Cea97e0l.mjs +0 -1
- package/dist/cli.d.mts +0 -1016
- package/dist/cli.d.mts.map +0 -1
- package/dist/cli.mjs +0 -20
- package/dist/cli.mjs.map +0 -1
- package/dist/contentManager-CoVTiSDT.mjs +0 -13
- package/dist/contentManager-CoVTiSDT.mjs.map +0 -1
- package/dist/contentManager-CwquwC1s.mjs +0 -1
- package/dist/context7-BejCCqkm.mjs +0 -1
- package/dist/context7-BxMpyQiW.mjs +0 -2
- package/dist/context7-BxMpyQiW.mjs.map +0 -1
- package/dist/index.d.mts +0 -2158
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
- package/dist/listContext7-DHj9AL-z.mjs +0 -2
- package/dist/listContext7-DHj9AL-z.mjs.map +0 -1
- package/dist/package-CFJazwTO.mjs +0 -2
- package/dist/package-CFJazwTO.mjs.map +0 -1
- package/dist/referenceSearchUtils-DZgupMZp.mjs +0 -2
- package/dist/referenceSearchUtils-DZgupMZp.mjs.map +0 -1
- package/dist/removeContext7-BZtL4_CJ.mjs +0 -3
- package/dist/removeContext7-BZtL4_CJ.mjs.map +0 -1
- package/dist/removeSkill-Bat_plVG.mjs +0 -5
- package/dist/removeSkill-Bat_plVG.mjs.map +0 -1
- package/dist/removeSkill-DjDZjhJU.mjs +0 -1
- package/dist/runScript-CSKqb831.mjs +0 -13
- package/dist/runScript-CSKqb831.mjs.map +0 -1
- package/dist/scopeSelection-BWteJQSv.mjs +0 -2
- package/dist/scopeSelection-BWteJQSv.mjs.map +0 -1
- package/dist/searchQuality-DVdHmamh.mjs +0 -2
- package/dist/searchQuality-DVdHmamh.mjs.map +0 -1
- package/dist/search_format-RyjXACJa.mjs +0 -5
- package/dist/search_format-RyjXACJa.mjs.map +0 -1
- package/dist/shared-DsVh4gOV.mjs +0 -2
- package/dist/shared-DsVh4gOV.mjs.map +0 -1
- package/dist/skillCreator-BomXoqdw.mjs +0 -2
- package/dist/skillCreator-BomXoqdw.mjs.map +0 -1
- package/dist/skillMdManager-DGBZ6M5J.mjs +0 -7
- package/dist/skillMdManager-DGBZ6M5J.mjs.map +0 -1
- package/dist/sqliteVectorSearchAdapter-56kZjbUT.mjs +0 -28
- package/dist/sqliteVectorSearchAdapter-56kZjbUT.mjs.map +0 -1
- package/dist/sqliteVectorSearchAdapter-DNkyKuZs.mjs +0 -1
- package/dist/unifiedSearch-CLdazMYU.mjs +0 -4
- package/dist/unifiedSearch-CLdazMYU.mjs.map +0 -1
- package/dist/unifiedSearch-DCFPrtzZ.mjs +0 -1
- package/templates/SKILL.md +0 -56
- package/templates/SKILL.zh-CN.md +0 -339
- package/templates/skill-creator.md +0 -130
- package/templates/skill-creator.zh-CN.md +0 -133
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{$ as e,At as t,B as n,C as r,Ct as i,D as a,F as o,H as s,I as c,L as l,M as u,N as d,O as f,P as p,Q as m,R as h,St as g,U as _,X as v,Y as y,a as b,bt as ee,dt as te,et as x,f as S,ft as C,gt as w,it as ne,jt as T,kt as re,l as ie,lt as E,mt as D,nt as ae,o as O,ot as k,pt as oe,q as A,rt as j,s as M,st as N,tt as se,ut as ce,wt as le,xt as ue,yt as de,z as P}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{t as fe}from"./BkEnd9_Z.js";import{a as pe,i as me,s as F}from"./CNPsST_i.js";import{t as he}from"./BEPs9Z9s.js";import{t as ge}from"./Bs27XW8_.js";function _e(e){return typeof e==`function`}function ve(e){return typeof e==`object`&&!!e}var ye=[`string`,`number`,`bigint`,`boolean`];function be(e){return e==null||ye.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>be(e)):typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype}var I=Symbol(`box`),xe=Symbol(`is-writable`);function L(e,t){let n=w(e);return t?{[I]:!0,[xe]:!0,get current(){return v(n)},set current(e){t(e)}}:{[I]:!0,get current(){return e()}}}function Se(e){return ve(e)&&I in e}function Ce(e){return Se(e)&&xe in e}function we(e){return Se(e)?e:_e(e)?L(e):De(e)}function Te(e){return Object.entries(e).reduce((e,[t,n])=>Se(n)?(Ce(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function Ee(e){return Ce(e)?{[I]:!0,get current(){return e.current}}:e}function De(e){let t=D(ce(e));return{[I]:!0,[xe]:!0,get current(){return v(t)},set current(e){C(t,e,!0)}}}function R(e){let t=D(ce(e));return{[I]:!0,[xe]:!0,get current(){return v(t)},set current(e){C(t,e,!0)}}}R.from=we,R.with=L,R.flatten=Te,R.readonly=Ee,R.isBox=Se,R.isWritableBox=Ce;function Oe(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var ke=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ae=/\n/g,je=/^\s*/,Me=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ne=/^:\s*/,Pe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Fe=/^[;\s]*/,Ie=/^\s+|\s+$/g,Le=`
|
|
2
|
+
`,Re=`/`,ze=`*`,z=``,Be=`comment`,Ve=`declaration`;function He(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Ae);t&&(n+=t.length);var i=e.lastIndexOf(Le);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(je)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Re==e.charAt(0)&&ze==e.charAt(1)){for(var n=2;z!=e.charAt(n)&&(ze!=e.charAt(n)||Re!=e.charAt(n+1));)++n;if(n+=2,z===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Be,comment:o})}}function f(){var e=a(),t=c(Me);if(t){if(d(),!c(Ne))return s(`property missing ':'`);var n=c(Pe),r=e({type:Ve,property:Ue(t[0].replace(ke,z)),value:n?Ue(n[0].replace(ke,z)):z});return c(Fe),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Ue(e){return e?e.replace(Ie,z):z}function We(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=He(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Ge=/\d/,Ke=[`-`,`_`,`/`,`.`];function qe(e=``){if(!Ge.test(e))return e!==e.toLowerCase()}function Je(e){let t=[],n=``,r,i;for(let a of e){let e=Ke.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=qe(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function Ye(e){return e?Je(e).map(e=>Ze(e)).join(``):``}function Xe(e){return Qe(Ye(e||``))}function Ze(e){return e?e[0].toUpperCase()+e.slice(1):``}function Qe(e){return e?e[0].toLowerCase()+e.slice(1):``}function $e(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[Ye(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Xe(e)]=n}return We(e,n),t}function B(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function et(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var tt=et(/[A-Z]/,e=>`-${e.toLowerCase()}`);function nt(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${tt(t)}: ${e[t]};`).join(`
|
|
3
|
+
`)}function rt(e={}){return nt(e).replace(`
|
|
4
|
+
`,` `)}var it=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function at(e){return it.has(e)}function V(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let i=e[n];if(i){for(let e of Object.keys(i)){let n=t[e],a=i[e],o=typeof n==`function`,s=typeof a==`function`;if(o&&typeof s&&at(e))t[e]=Oe(n,a);else if(o&&s)t[e]=B(n,a);else if(e===`class`){let i=be(n),o=be(a);i&&o?t[e]=r(n,a):i?t[e]=r(n):o&&(t[e]=r(a))}else if(e===`style`){let r=typeof n==`object`,i=typeof a==`object`,o=typeof n==`string`,s=typeof a==`string`;if(r&&i)t[e]={...n,...a};else if(r&&s){let r=$e(a);t[e]={...n,...r}}else if(o&&i)t[e]={...$e(n),...a};else if(o&&s){let r=$e(n),i=$e(a);t[e]={...r,...i}}else r?t[e]=n:i?t[e]=a:o?t[e]=n:s&&(t[e]=a)}else t[e]=a===void 0?n:a}for(let e of Object.getOwnPropertySymbols(i)){let n=t[e],r=i[e];t[e]=r===void 0?n:r}}}return typeof t.style==`object`&&(t.style=rt(t.style).replaceAll(`
|
|
5
|
+
`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var ot=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function st(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var ct=class extends Map{#e=new Map;#t=D(0);#n=D(0);#r=x||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return x===this.#r?D(e):oe(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return v(this.#t),!1}return v(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{v(this.#t);return}}return v(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),C(this.#n,super.size),te(o);else if(i!==t){te(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&te(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),C(n,-1)),r&&(C(this.#n,super.size),te(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;C(this.#n,0);for(var t of e.values())C(t,-1);te(this.#t),e.clear()}}#a(){v(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)v(n)}keys(){return v(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return v(this.#n),super.size}};new class{#e;#t;constructor(e={}){let{window:t=ot,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=l(e=>{let n=A(t,`focusin`,e),r=A(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?st(this.#e):null}};function lt(e){return typeof e==`function`}var H=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return ue(this.#t)}get(){let e=ee(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=ee(this.#t);return t===void 0?e:t}set(e){return le(this.#t,e)}};function ut(e,t){switch(e){case`post`:j(t);break;case`pre`:ne(t)}}function dt(t,n,r,i={}){let{lazy:a=!1}=i,o=!a,s=Array.isArray(t)?[]:void 0;ut(n,()=>{let n=Array.isArray(t)?t.map(e=>e()):t();if(!o){o=!0,s=n;return}let i=e(()=>r(n,s));return s=n,i})}function U(e,t,n){dt(e,`post`,t,n)}function ft(e,t,n){dt(e,`pre`,t,n)}U.pre=ft;function pt(e){return lt(e)?e():e}var mt=class{#e={width:0,height:0};#t=!1;#n;#r;#i;#a=w(()=>(v(this.#s)?.(),this.getSize().width));#o=w(()=>(v(this.#s)?.(),this.getSize().height));#s=w(()=>{let e=pt(this.#r);if(e)return l(t=>{if(!this.#i)return;let n=new this.#i.ResizeObserver(e=>{this.#t=!0;for(let t of e){let e=this.#n.box===`content-box`?t.contentBoxSize:t.borderBoxSize,n=Array.isArray(e)?e:[e];this.#e.width=n.reduce((e,t)=>Math.max(e,t.inlineSize),0),this.#e.height=n.reduce((e,t)=>Math.max(e,t.blockSize),0)}t()});return n.observe(e),()=>{this.#t=!1,n.disconnect()}})});constructor(e,t={box:`border-box`}){this.#i=t.window??ot,this.#n=t,this.#r=e,this.#e={width:0,height:0}}calculateSize(){let e=pt(this.#r);if(!e||!this.#i)return;let t=e.offsetWidth,n=e.offsetHeight;if(this.#n.box===`border-box`)return{width:t,height:n};let r=this.#i.getComputedStyle(e),i=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),a=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),o=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth),s=parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth);return{width:t-i-o,height:n-a-s}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return v(this.#s)?.(),this.getSize()}get width(){return v(this.#a)}get height(){return v(this.#o)}};function W(e){j(()=>()=>{e()})}function ht(e,t){return setTimeout(t,e)}function G(e){m().then(e)}var gt=1,_t=9,vt=11;function yt(e){return ve(e)&&e.nodeType===gt&&typeof e.nodeName==`string`}function bt(e){return ve(e)&&e.nodeType===_t}function xt(e){return ve(e)&&e.constructor?.name===`VisualViewport`}function St(e){return ve(e)&&e.nodeType!==void 0}function Ct(e){return St(e)&&e.nodeType===vt&&`host`in e}function wt(e,t){if(!e||!t||!yt(e)||!yt(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&Ct(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Tt(e){return bt(e)?e:xt(e)?e.document:e?.ownerDocument??document}function Et(e){return Ct(e)?Et(e.host):bt(e)?e.defaultView??window:yt(e)?e.ownerDocument?.defaultView??window:window}function Dt(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Ot=class{element;#e=w(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return v(this.#e)}set root(e){C(this.#e,e)}constructor(e){this.element=typeof e==`function`?L(e):e}getDocument=()=>Tt(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Dt(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function K(t,n){return{[y()]:r=>Se(t)?(t.current=r,e(()=>n?.(r)),()=>{`isConnected`in r&&r.isConnected||(t.current=null,n?.(null))}):(t(r),e(()=>n?.(r)),()=>{`isConnected`in r&&r.isConnected||(t(null),n?.(null))})}}function kt(e){return e?`true`:`false`}function q(e){return e?``:void 0}function At(e){return e?`open`:`closed`}function jt(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}var Mt=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function Nt(e){let t=new Mt(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Pt=`ArrowDown`,Ft=`ArrowLeft`,It=`ArrowRight`,Lt=`ArrowUp`,Rt=`Enter`,zt=`Home`,Bt=`PageDown`,Vt=`PageUp`;function Ht(e){return window.getComputedStyle(e).getPropertyValue(`direction`)}var Ut=[Pt,Vt,zt],Wt=[Lt,Bt,`End`];[...Ut,...Wt];function Gt(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Ft:It,vertical:Pt}[t]}function Kt(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?It:Ft,vertical:Lt}[t]}function qt(e=`ltr`,t=`horizontal`){return[`ltr`,`rtl`].includes(e)||(e=`ltr`),[`horizontal`,`vertical`].includes(t)||(t=`horizontal`),{nextKey:Gt(e,t),prevKey:Kt(e,t)}}var Jt=typeof document<`u`,Yt=Xt();function Xt(){return Jt&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function J(e){return e instanceof HTMLElement}function Zt(e){return e instanceof Element}function Qt(e){return e instanceof Element||e instanceof SVGElement}function $t(e){return e!==null}function en(e){return e instanceof HTMLInputElement&&`select`in e}var tn=class{#e;#t=R(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){let e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){let r=this.#e.rootNode.current;if(!r||!e)return;let i=this.getCandidateNodes();if(!i.length)return;let a=i.indexOf(e),{nextKey:o,prevKey:s}=qt(Ht(r),this.#e.orientation.current),c=this.#e.loop.current,l={[o]:a+1,[s]:a-1,[zt]:0,End:i.length-1};if(n){let e=o===`ArrowDown`?It:Pt,t=s===`ArrowUp`?Ft:Lt;l[e]=a+1,l[t]=a-1}let u=l[t.key];if(u===void 0)return;t.preventDefault(),u<0&&c?u=i.length-1:u===i.length&&c&&(u=0);let d=i[u];if(d)return d.focus(),this.#t.current=d.id,this.#e.onCandidateFocus?.(d),d}getTabIndex(e){let t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){let e=this.#t.current;if(!e)return;let t=this.#e.rootNode.current?.querySelector(`#${e}`);t&&J(t)&&t.focus()}},nn=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,W(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?G(t):t()}},rn=class{#e;#t;#n;#r=D(!1);#i=D(void 0);#a=!1;#o=null;constructor(e){this.#e=e,C(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new nn({ref:this.#e.ref,afterTick:this.#e.open}),W(()=>this.#s()),U(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.();return}if(e&&C(this.#r,!0),C(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&C(this.#i,void 0)})),!this.#t){e||C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return v(this.#r)}get transitionStatus(){return v(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function Y(){}function X(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var an=Nt({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Z=new H(`Dialog.Root | AlertDialog.Root`),on=class e{static create(t){let n=Z.getOr(null);return Z.set(new e(t,n))}opts;#e=D(null);get triggerNode(){return v(this.#e)}set triggerNode(e){C(this.#e,e,!0)}#t=D(null);get contentNode(){return v(this.#t)}set contentNode(e){C(this.#t,e,!0)}#n=D(null);get overlayNode(){return v(this.#n)}set overlayNode(e){C(this.#n,e,!0)}#r=D(null);get descriptionNode(){return v(this.#r)}set descriptionNode(e){C(this.#r,e,!0)}#i=D(void 0);get contentId(){return v(this.#i)}set contentId(e){C(this.#i,e,!0)}#a=D(void 0);get titleId(){return v(this.#a)}set titleId(e){C(this.#a,e,!0)}#o=D(void 0);get triggerId(){return v(this.#o)}set triggerId(e){C(this.#o,e,!0)}#s=D(void 0);get descriptionId(){return v(this.#s)}set descriptionId(e){C(this.#s,e,!0)}#c=D(null);get cancelNode(){return v(this.#c)}set cancelNode(e){C(this.#c,e,!0)}#l=D(0);get nestedOpenCount(){return v(this.#l)}set nestedOpenCount(e){C(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new rn({ref:L(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new rn({ref:L(()=>this.overlayNode),open:this.opts.open,enabled:!0}),U(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),W(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>an.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=w(()=>({"data-state":At(this.opts.open.current)}));get sharedProps(){return v(this.#u)}set sharedProps(e){C(this.#u,e)}},sn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return v(this.#e)}set props(e){C(this.#e,e)}},cn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=K(this.opts.ref),U.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=w(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return v(this.#e)}set props(e){C(this.#e,e)}},ln=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=K(this.opts.ref,e=>{this.root.descriptionNode=e}),U.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return v(this.#e)}set props(e){C(this.#e,e)}},un=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=w(()=>({open:this.root.opts.open.current}));get snippetProps(){return v(this.#e)}set snippetProps(e){C(this.#e,e)}#t=w(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":q(this.root.nestedOpenCount>0),"data-nested":q(this.root.parent!==null),...jt(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return v(this.#t)}set props(e){C(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},dn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref,e=>this.root.overlayNode=e)}#e=w(()=>({open:this.root.opts.open.current}));get snippetProps(){return v(this.#e)}set snippetProps(e){C(this.#e,e)}#t=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":q(this.root.nestedOpenCount>0),"data-nested":q(this.root.parent!==null),...jt(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return v(this.#t)}set props(e){C(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},fn=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),pn=n(`<div><!></div>`);function mn(e,n){let r=s();i(n,!0);let a=b(n,`id`,19,()=>X(r)),o=b(n,`ref`,15,null),c=b(n,`level`,3,2),l=O(n,fn),u=cn.create({id:L(()=>a()),level:L(()=>c()),ref:L(()=>o(),e=>o(e))}),p=w(()=>V(l,u.props));var m=P(),_=N(m),y=e=>{var t=P(),r=N(t);f(r,()=>n.child,()=>({props:v(p)})),h(e,t)},ee=e=>{var r=pn();S(r,()=>({...v(p)}));var i=k(r);f(i,()=>n.children??T),t(r),h(e,r)};d(_,e=>{n.child?e(y):e(ee,-1)}),h(e,m),g()}function hn(e,t){var n=P(),r=N(n);u(r,()=>t.children,e=>{var n=P(),r=N(n);f(r,()=>t.children??T),h(e,n)}),h(e,n)}var gn=new H(`BitsConfig`);function _n(){let e=new vn(null,{});return gn.getOr(e).opts}var vn=class{opts;constructor(e,t){let n=yn(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function yn(e,t){return n=>L(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function bn(e,t){return n=>{let r=_n();return L(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var xn=bn(e=>e.defaultPortalTo,`body`);function Sn(e,t){i(t,!0);let n=xn(()=>t.to),r=de(),a=w(o);function o(){if(!Jt||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let s;function l(){s&&=(c(s),null)}U([()=>v(a),()=>t.disabled],([e,n])=>{if(!e||n){l();return}return s=p(hn,{target:e,props:{children:t.children},context:r}),()=>{l()}});var u=P(),m=N(u),_=e=>{var n=P(),r=N(n);f(r,()=>t.children??T),h(e,n)};d(m,e=>{t.disabled&&e(_)}),h(e,u),g()}var Cn=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return A(e,this.eventName,e=>{t(e)},n)}};function wn(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function Tn(e,t){return e===t||e.contains(t)}function En(e){return e?.ownerDocument??document}function Dn(e){if(!e)return null;for(let t of e.childNodes)if(t.nodeType!==Node.COMMENT_NODE)return t;return null}function On(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var kn=[Rt,` `],An=[Pt,Vt,zt],jn=[Lt,Bt,`End`],Mn=[...An,...jn];[...kn],[...kn];function Q(e){return e.pointerType===`mouse`}function Nn(e,{select:t=!1}={}){if(!e||!e.focus)return;let n=Tt(e);if(n.activeElement===e)return;let r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&en(e)&&t&&e.select()}function Pn(e,{select:t=!1}={},n){let r=n();for(let i of e)if(Nn(i,{select:t}),n()!==r)return!0}var Fn=D(!1),In=class e{static _refs=0;static _cleanup;constructor(){j(()=>(e._refs===0&&(e._cleanup=se(()=>{let e=[],t=e=>{C(Fn,!1)};return e.push(A(document,`pointerdown`,t,{capture:!0}),A(document,`pointermove`,t,{capture:!0}),A(document,`keydown`,e=>{C(Fn,!0)},{capture:!0})),B(...e)})),e._refs++,()=>{e._refs--,e._refs===0&&(C(Fn,!1),e._cleanup?.())}))}get current(){return v(Fn)}set current(e){C(Fn,e,!0)}},Ln=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],Rn=Ln.join(`,`),zn=typeof Element>`u`,$=zn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Bn=!zn&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Vn=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Vn(e.parentNode))},Hn=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Un=function(e,t,n){if(Vn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Rn));return t&&$.call(e,Rn)&&r.unshift(e),r=r.filter(n),r},Wn=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Vn(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Wn(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{$.call(a,Rn)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Vn(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Wn(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},Gn=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Kn=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Hn(e))&&!Gn(e)?0:e.tabIndex},qn=function(e,t){var n=Kn(e);return n<0&&t&&!Gn(e)?0:n},Jn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Yn=function(e){return e.tagName===`INPUT`},Xn=function(e){return Yn(e)&&e.type===`hidden`},Zn=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Qn=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},$n=function(e){if(!e.name)return!0;var t=e.form||Bn(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Qn(r,e.form);return!i||i===e},er=function(e){return Yn(e)&&e.type===`radio`},tr=function(e){return er(e)&&!$n(e)},nr=function(e){var t=e&&Bn(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Bn(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},rr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},ir=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=$.call(e,`details>summary:first-of-type`)?e.parentElement:e;if($.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=Bn(e);if(s&&!s.shadowRoot&&r(s)===!0)return rr(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(nr(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return rr(e);return!1},ar=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return $.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},or=function(e,t){return!(t.disabled||Xn(t)||ir(t,e)||Zn(t)||ar(t))},sr=function(e,t){return!(tr(t)||Kn(t)<0||!or(e,t))},cr=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},lr=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=qn(a,i),s=i?lr(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Jn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ur=function(e,t){return t||={},lr(t.getShadowRoot?Wn([e],t.includeContainer,{filter:sr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:cr}):Un(e,t.includeContainer,sr.bind(null,t)))},dr=function(e,t){return t||={},t.getShadowRoot?Wn([e],t.includeContainer,{filter:or.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Un(e,t.includeContainer,or.bind(null,t))},fr=function(e,t){if(t||={},!e)throw Error(`No node provided`);return $.call(e,Rn)!==!1&&sr(t,e)},pr=Ln.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),mr=function(e,t){if(t||={},!e)throw Error(`No node provided`);return $.call(e,pr)!==!1&&or(t,e)};function hr(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`}}function gr(e,t){if(!fr(e,hr()))return _r(e,t);let n=Tt(e),r=ur(n.body,hr());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function _r(e,t){let n=Tt(e);if(!mr(e,hr()))return n.body;let r=dr(n.body,hr());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(e=>fr(e,hr()))??n.body}function vr(e,t,n){let r=t.toLowerCase();if(r.endsWith(` `)){let i=r.slice(0,-1);if(e.filter(e=>e.toLowerCase().startsWith(i)).length<=1)return vr(e,i,n);let a=n?.toLowerCase();if(a&&a.startsWith(i)&&a.charAt(i.length)===` `&&t.trim()===i)return n;let o=e.filter(e=>e.toLowerCase().startsWith(r));if(o.length>0){let t=n?e.indexOf(n):-1;return yr(o,Math.max(t,0)).find(e=>e!==n)||n}}let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=i.toLowerCase(),o=n?e.indexOf(n):-1,s=yr(e,Math.max(o,0));i.length===1&&(s=s.filter(e=>e!==n));let c=s.find(e=>e?.toLowerCase().startsWith(a));return c===n?void 0:c}function yr(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var br={afterMs:1e4,onChange:Y};function xr(e,t){let{afterMs:n,onChange:r,getWindow:i}={...br,...t},a=null,o=D(ce(e));function s(){return i().setTimeout(()=>{C(o,e,!0),r?.(e)},n)}return j(()=>()=>{a&&i().clearTimeout(a)}),L(()=>v(o),e=>{C(o,e,!0),r?.(e),a&&i().clearTimeout(a),a=s()})}var Sr=class{#e;#t;#n=w(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#r=w(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=xr(``,{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;let n=v(this.#r)(),r=t.find(e=>e===n)?.textContent?.trim()??``,i=vr(t.map(e=>e.textContent?.trim()??``),this.#t.current,r),a=t.find(e=>e.textContent?.trim()===i);return a&&v(this.#n)(a),a}resetTypeahead(){this.#t.current=``}get search(){return this.#t.current}},Cr=`data-context-menu-trigger`,wr=`data-context-menu-content`,Tr=new H(`Menu.Root`),Er=new H(`Menu.Root | Menu.Sub`),Dr=new H(`Menu.Content`),Or=new H(`Menu.Group | Menu.RadioGroup`),kr=new H(`Menu.RadioGroup`),Ar=new H(`Menu.CheckboxGroup`),jr=new Cn(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),Mr=Nt({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),Nr=class{#e;#t=null;#n=null;#r=!1;#i=null;#a=null;#o=null;#s=null;constructor(e){this.#e=e,U([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(this.#_(),!e||!t||!n)return;let r=e=>{Q(e)&&(this.#s={x:e.clientX,y:e.clientY},this.#r||this.#d(e,`content`))},i=e=>{Q(e)&&this.#f(e,`content`)},a=e=>{Q(e)&&(this.#r||this.#d(e,`trigger`))},o=e=>{if(Q(e)){if(Zt(e.relatedTarget)){let n=this.#e.subContentSelector(),r=e.relatedTarget.closest(n);if(r&&r!==t&&r.id&&t.querySelector(`[aria-controls="${r.id}"]`))return}this.#f(e,`trigger`)}},s=e=>{Q(e)&&this.#m()},c=e=>{Q(e)&&this.#m()};return e.addEventListener(`pointermove`,r),e.addEventListener(`pointerleave`,i),e.addEventListener(`pointerenter`,s),t.addEventListener(`pointermove`,a),t.addEventListener(`pointerleave`,o),t.addEventListener(`pointerenter`,c),()=>{e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerleave`,i),e.removeEventListener(`pointerenter`,s),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerleave`,o),t.removeEventListener(`pointerenter`,c),this.#_()}}),W(()=>{this.#_()})}#c(){let e=this.#e.parentContentNode();return e?e.getBoundingClientRect():this.#e.triggerNode()?.getBoundingClientRect()??null}#l(e,t){let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return null;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=Lr(i,a),s,c,l;return t===`content`?(s=this.#r?this.#a??e:e,c=a):(s=this.#s??e,c=this.#c()??i,l=a),this.#a=s,{corridor:Rr(i,a,o),intent:zr(s,c,o,t,l),targetRect:c,side:o}}#u(e,t,n){return Pr(e,t)||Pr(e,n)}#d(e,t){let n={x:e.clientX,y:e.clientY};this.#l(n,t)&&(this.#i=t,this.#o=n)}#f(e,t){if(!this.#e.enabled())return;let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return;let i=e.relatedTarget;if(Zt(i)&&(t===`content`&&r.contains(i)||t===`trigger`&&n.contains(i)))return;let a={x:e.clientX,y:e.clientY},o=this.#l(a,t);if(o){if(!Fr(a,o.targetRect)&&!this.#u(a,o.corridor,o.intent)){this.#w();return}this.#r=!0,this.#i=t,this.#o=a,this.#e.setIsPointerInTransit(!0),this.#b(),this.#S()}}#p=null;#m(){if(!this.#r)return;let e=this.#i===`trigger`;this.#x(),this.#C(),this.#r=!1,this.#w(),e?(this.#h(),this.#p=setTimeout(()=>{this.#p=null,this.#e.setIsPointerInTransit(!1)},100)):this.#e.setIsPointerInTransit(!1)}#h(){this.#p!==null&&(clearTimeout(this.#p),this.#p=null)}#g(){let e=this.#o;this.#x(),this.#C(),this.#h(),this.#r=!1,this.#e.setIsPointerInTransit(!1),this.#w(),this.#e.onIntentExit(e)}#_(){this.#x(),this.#C(),this.#h(),this.#r&&this.#e.setIsPointerInTransit(!1),this.#r=!1,this.#i=null,this.#a=null,this.#o=null,this.#s=null}#v(e){let t=this.#e.contentNode();if(!t)return!1;let n=t.ownerDocument.elementFromPoint(e.x,e.y);if(!n)return!1;let r=this.#e.subContentSelector(),i=n.closest(r);return!i||i===t?!1:i.id?!!t.querySelector(`[aria-controls="${i.id}"]`):!1}#y=e=>{if(!this.#r||!this.#i||!Q(e))return;let t=this.#e.triggerNode(),n=this.#e.contentNode();if(!t||!n){this.#g();return}this.#C();let r={x:e.clientX,y:e.clientY};this.#o=r;let i=t.getBoundingClientRect(),a=n.getBoundingClientRect();if(this.#i===`content`&&Fr(r,a)){this.#m();return}if(this.#i===`trigger`&&Ir(r,i,4)){this.#m();return}if(this.#v(r)){this.#S();return}let o=this.#l(r,this.#i);if(!o){this.#g();return}if(this.#u(r,o.corridor,o.intent)){this.#S();return}this.#g()};#b(){if(this.#t)return;let e=Tt(this.#e.triggerNode()??this.#e.contentNode());e&&(e.addEventListener(`pointermove`,this.#y,!0),this.#t=()=>{e.removeEventListener(`pointermove`,this.#y,!0),this.#t=null})}#x(){this.#t?.()}#S(){this.#C(),this.#n=setTimeout(()=>{this.#n=null,this.#r&&this.#g()},500)}#C(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#w(){this.#i=null,this.#a=null,this.#o=null}};function Pr(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Fr(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function Ir(e,t,n){return e.x>=t.left+n&&e.x<=t.right-n&&e.y>=t.top+n&&e.y<=t.bottom-n}function Lr(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}function Rr(e,t,n){switch(n){case`top`:return[{x:Math.min(e.left,t.left)-2,y:e.top},{x:Math.min(e.left,t.left)-2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:e.top}];case`bottom`:return[{x:Math.min(e.left,t.left)-2,y:e.bottom},{x:Math.min(e.left,t.left)-2,y:t.top},{x:Math.max(e.right,t.right)+2,y:t.top},{x:Math.max(e.right,t.right)+2,y:e.bottom}];case`left`:return[{x:e.left,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.max(e.bottom,t.bottom)+2},{x:e.left,y:Math.max(e.bottom,t.bottom)+2}];case`right`:return[{x:e.right,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.max(e.bottom,t.bottom)+2},{x:e.right,y:Math.max(e.bottom,t.bottom)+2}]}}function zr(e,t,n,r,i){let a=r===`trigger`?Br(n):n,o=i?Math.min(t.top,i.top)-8:t.top-8,s=i?Math.max(t.bottom,i.bottom)+8:t.bottom+8,c=i?Math.min(t.left,i.left)-8:t.left-8,l=i?Math.max(t.right,i.right)+8:t.right+8;switch(a){case`right`:return[e,{x:t.left,y:o},{x:t.left,y:s}];case`left`:return[e,{x:t.right,y:o},{x:t.right,y:s}];case`bottom`:return[e,{x:c,y:t.top},{x:l,y:t.top}];case`top`:return[e,{x:c,y:t.bottom},{x:l,y:t.bottom}]}}function Br(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}var Vr=class e{static create(t){let n=new e(t);return Tr.set(n)}opts;isUsingKeyboard=new In;#e=D(!1);get ignoreCloseAutoFocus(){return v(this.#e)}set ignoreCloseAutoFocus(e){C(this.#e,e,!0)}#t=D(!1);get isPointerInTransit(){return v(this.#t)}set isPointerInTransit(e){C(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>Mr.getAttr(e,this.opts.variant.current)},Hr=class e{static create(t,n){return Er.set(new e(t,n,null))}opts;root;parentMenu;contentId=L(()=>``);#e=D(null);get contentNode(){return v(this.#e)}set contentNode(e){C(this.#e,e,!0)}contentPresence;#t=D(null);get triggerNode(){return v(this.#t)}set triggerNode(e){C(this.#t,e,!0)}constructor(e,t,n){this.opts=e,this.root=t,this.parentMenu=n,this.contentPresence=new rn({ref:L(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)},shouldSkipExitAnimation:()=>this.root.opts.variant.current!==`menubar`||this.parentMenu!==null?!1:this.root.opts.shouldSkipExitAnimation?.()??!1}),n&&U(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}},Ur=class e{static create(t){return Dr.set(new e(t,Er.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=D(``);get search(){return v(this.#e)}set search(e){C(this.#e,e,!0)}#t=0;#n;#r=D(!1);get mounted(){return v(this.#r)}set mounted(e){C(this.#r,e,!0)}#i;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new Ot(e.ref),this.attachment=K(this.opts.ref,e=>{this.parentMenu.contentNode!==e&&(this.parentMenu.contentNode=e)}),t.contentId=e.id,this.#i=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Nr({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,parentContentNode:()=>this.parentMenu.parentMenu?.contentNode??null,subContentSelector:()=>`[${this.parentMenu.root.getBitsAttr(`sub-content`)}]`,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`)),onIntentExit:e=>{this.parentMenu.opts.open.current=!1,this.#s(e)},setIsPointerInTransit:e=>{this.parentMenu.root.isPointerInTransit=e}}),this.#n=new Sr({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new tn({rootNode:L(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr(`item`),loop:this.opts.loop,orientation:L(()=>`vertical`)}),U(()=>this.parentMenu.contentNode,e=>e?jr.listen(e,()=>{G(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})}):void 0),j(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#a(){let e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr(`item`)}]:not([data-disabled])`)):[]}#o(){return this.parentMenu.root.isPointerInTransit}#s(e){if(!e)return;let t=this.parentMenu.parentMenu?.contentNode;if(!t)return;let n=this.domContext.getDocument().elementFromPoint(e.x,e.y);if(!Zt(n))return;let r=n.closest(`[${this.parentMenu.root.getBitsAttr(`sub-trigger`)}]`);r&&t.contains(r)&&r!==this.parentMenu.triggerNode&&r.dispatchEvent(new PointerEvent(`pointermove`,{bubbles:!0,cancelable:!0,pointerType:`mouse`,clientX:e.x,clientY:e.y}))}onCloseAutoFocus=e=>{if(this.opts.onCloseAutoFocus.current?.(e),!(e.defaultPrevented||this.#i)){if(this.parentMenu.root.ignoreCloseAutoFocus){e.preventDefault();return}this.parentMenu.triggerNode&&fr(this.parentMenu.triggerNode)&&(e.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();let n=gr(t.triggerNode,e.shiftKey?`prev`:`next`);n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),G(()=>{n.focus(),G(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===`Tab`){this.handleTabKeyDown(e);return}let t=e.target,n=e.currentTarget;if(!J(t)||!J(n))return;let r=t.closest(`[${this.parentMenu.root.getBitsAttr(`content`)}]`)?.id===this.parentMenu.contentId.current,i=e.ctrlKey||e.altKey||e.metaKey,a=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code===`Space`)return;let o=this.#a();r&&!i&&a&&this.#n(e.key,o),e.target?.id===this.parentMenu.contentId.current&&Mn.includes(e.key)&&(e.preventDefault(),jn.includes(e.key)&&o.reverse(),Pn(o,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){Zt(e.currentTarget)&&Zt(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=``))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&G(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#o()}onItemLeave(e){e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`))||this.#o()||this.parentMenu.root.isUsingKeyboard.current||(this.parentMenu.contentNode?.focus({preventScroll:!0}),this.rovingFocusGroup.setCurrentTabStopId(``))}onTriggerLeave(){return!!this.#o()}handleInteractOutside(e){if(!Qt(e.target))return;let t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}if(e.target.closest(`#${t}`)){e.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,G(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#c=w(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return v(this.#c)}set snippetProps(e){C(this.#c,e)}#l=w(()=>({id:this.opts.id.current,role:`menu`,"aria-orientation":`vertical`,[this.parentMenu.root.getBitsAttr(`content`)]:``,"data-state":At(this.parentMenu.opts.open.current),...jt(this.parentMenu.contentPresence.transitionStatus),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:`auto`,contain:`layout style`},...this.attachment}));get props(){return v(this.#l)}set props(e){C(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}},Wr=class{opts;content;attachment;#e=D(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=K(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&Q(e)){if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;let t=e.currentTarget;if(!J(t))return;t.focus({preventScroll:!0})}}}onpointerleave(e){e.defaultPrevented||Q(e)&&this.content.onItemLeave(e)}onfocus(e){G(()=>{e.defaultPrevented||this.opts.disabled.current||C(this.#e,!0)})}onblur(e){G(()=>{e.defaultPrevented||C(this.#e,!1)})}#t=w(()=>({id:this.opts.id.current,tabindex:-1,role:`menuitem`,"aria-disabled":kt(this.opts.disabled.current),"data-disabled":q(this.opts.disabled.current),"data-highlighted":v(this.#e)?``:void 0,[this.content.parentMenu.root.getBitsAttr(`item`)]:``,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return v(this.#t)}set props(e){C(this.#t,e)}},Gr=class e{static create(t){let n=new Wr(t,Dr.get());return new e(t,n)}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;let e=new CustomEvent(`menuitemselect`,{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){let t=this.item.content.search!==``;if(!(this.item.opts.disabled.current||t&&e.key===` `)&&kn.includes(e.key)){if(!J(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!J(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#n=w(()=>V(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return v(this.#n)}set props(e){C(this.#n,e)}},Kr=class e{static create(t){return Or.set(new e(t,Tr.get()))}opts;root;attachment;#e=D(void 0);get groupHeadingId(){return v(this.#e)}set groupHeadingId(e){C(this.#e,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref)}#t=w(()=>({id:this.opts.id.current,role:`group`,"aria-labelledby":this.groupHeadingId,[this.root.getBitsAttr(`group`)]:``,...this.attachment}));get props(){return v(this.#t)}set props(e){C(this.#t,e)}},qr=class e{static create(t){let n=Ar.getOr(null);if(n)return new e(t,n);let r=kr.getOr(null);return r?new e(t,r):new e(t,Or.get())}opts;group;attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=K(this.opts.ref,e=>this.group.groupHeadingId=e?.id)}#e=w(()=>({id:this.opts.id.current,role:`group`,[this.group.root.getBitsAttr(`group-heading`)]:``,...this.attachment}));get props(){return v(this.#e)}set props(e){C(this.#e,e)}},Jr=class e{static create(t){return new e(t,Tr.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref)}#e=w(()=>({id:this.opts.id.current,role:`group`,[this.root.getBitsAttr(`separator`)]:``,...this.attachment}));get props(){return v(this.#e)}set props(e){C(this.#e,e)}},Yr=class e{static create(t){return new e(t,Er.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=K(this.opts.ref,e=>this.parentMenu.triggerNode=e)}onclick=e=>{this.opts.disabled.current||e.detail!==0||(this.parentMenu.toggleOpen(),e.preventDefault())};onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType===`touch`)return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType===`touch`&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===` `||e.key===`Enter`){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===`ArrowDown`&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=w(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=w(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":`menu`,"aria-expanded":kt(this.parentMenu.opts.open.current),"aria-controls":v(this.#e),"data-disabled":q(this.opts.disabled.current),"data-state":At(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr(`trigger`)]:``,onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return v(this.#t)}set props(e){C(this.#t,e)}};globalThis.bitsDismissableLayers??=new Map;var Xr=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=Y;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,j(()=>{this.#a=En(this.opts.ref.current)});let t=Y,n=null,r=!1,i=()=>{n!=null&&(clearTimeout(n),n=null)},a=()=>{i(),this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};U([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(this.opts.enabled.current&&this.opts.ref.current)return i(),n=ht(1,()=>{n=null,!r&&this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),a}),W(()=>{r=!0,i(),this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&G(()=>{this.opts.ref.current&&!this.#h(e.target)&&e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return B(A(this.#a,`pointerdown`,B(this.#f,this.#m),{capture:!0}),A(this.#a,`pointerdown`,B(this.#p,this.#d)),A(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=ei(e)),this.#e.current(e)};#d=wn(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||$r(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=ei(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=A(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=Qr(this.opts.ref.current))};#h=e=>this.opts.ref.current?Tn(this.opts.ref.current,e):!1;#g=wn(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function Zr(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function Qr(e){let t=[...globalThis.bitsDismissableLayers],n=Zr(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function $r(e,t){let n=e.target;if(!Qt(n))return!1;let r=!!n.closest(`[${Cr}]`),i=!!t.closest(`[${wr}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:En(n).documentElement.contains(n)&&!Tn(t,n)&&On(e,t)}function ei(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function ti(e,t){i(t,!0);let n=b(t,`interactOutsideBehavior`,3,`close`),r=b(t,`onInteractOutside`,3,Y),a=b(t,`onFocusOutside`,3,Y),o=b(t,`isValidEvent`,3,()=>!1),s=Xr.create({id:L(()=>t.id),interactOutsideBehavior:L(()=>n()),onInteractOutside:L(()=>r()),enabled:L(()=>t.enabled),onFocusOutside:L(()=>a()),isValidEvent:L(()=>o()),ref:t.ref});var c=P(),l=N(c);f(l,()=>t.children??T,()=>({props:s.props})),h(e,c),g()}globalThis.bitsEscapeLayers??=new Map;var ni=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Ot(this.opts.ref);let t=Y;U(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>A(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!ri(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;(n===`close`||n===`defer-otherwise-close`)&&this.opts.onEscapeKeydown.current(t)}};function ri(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function ii(e,t){i(t,!0);let n=b(t,`escapeKeydownBehavior`,3,`close`),r=b(t,`onEscapeKeydown`,3,Y);ni.create({escapeKeydownBehavior:L(()=>n()),onEscapeKeydown:L(()=>r()),enabled:L(()=>t.enabled),ref:t.ref});var a=P(),o=N(a);f(o,()=>t.children??T),h(e,a),g()}var ai=class e{static instance;#e=De([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},oi=class e{#e=!1;#t=null;#n=ai.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(A(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n){if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&mr(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}}},{capture:!0}),A(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?ur(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?dr(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return U([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),W(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function si(e,t){i(t,!0);let n=b(t,`enabled`,3,!1),r=b(t,`trapFocus`,3,!1),a=b(t,`loop`,3,!1),o=b(t,`onCloseAutoFocus`,3,Y),s=b(t,`onOpenAutoFocus`,3,Y),c=oi.use({enabled:L(()=>n()),trap:L(()=>r()),loop:a(),onCloseAutoFocus:L(()=>o()),onOpenAutoFocus:L(()=>s()),ref:t.ref});var l=P(),u=N(l);f(u,()=>t.focusScope??T,()=>({props:c.props})),h(e,l),g()}var ci=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var li=class e{static create(t){return new e(t)}opts;domContext;#e=Y;#t=!1;#n=ci;#r=ci;constructor(e){this.opts=e,this.domContext=new Ot(e.ref);let t=Y;U(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return B(A(this.domContext.getDocument(),`pointerdown`,this.#o),A(this.domContext.getDocument(),`pointerup`,Oe(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{if(!this.#t)return;let t=this.opts.ref.current,n=e.target;J(t)&&J(n)&&pi(this)&&wt(t,n)&&(this.#n(e),!e.defaultPrevented&&(this.#e=di(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=Y}},ui=e=>e.style.userSelect||e.style.webkitUserSelect;function di(e,t){let n=ui(t),r=ui(e);return fi(t,`none`),fi(e,`text`),()=>{fi(t,n),fi(e,r)}}function fi(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function pi(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function mi(e,t){i(t,!0);let n=b(t,`preventOverflowTextSelection`,3,!0),r=b(t,`onPointerDown`,3,Y),a=b(t,`onPointerUp`,3,Y);li.create({id:L(()=>t.id),onPointerDown:L(()=>r()),onPointerUp:L(()=>a()),enabled:L(()=>t.enabled&&n()),ref:t.ref});var o=P(),s=N(o);f(s,()=>t.children??T),h(e,o),g()}globalThis.bitsIdCounter??={current:0};function hi(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var gi=class{#e;#t=0;#n=D();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),C(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,v(this.#n)===void 0&&(this.#r=se(()=>{C(this.#n,this.#e(...e),!0)})),j(()=>()=>{this.#i()}),v(this.#n)}},_i=new ct,vi=D(null),yi=null,bi=null,xi=!1,Si=L(()=>{for(let e of _i.values())if(e)return!0;return!1}),Ci=null,wi=new gi(()=>{function e(){document.body.setAttribute(`style`,v(vi)??``),document.body.style.removeProperty(`--scrollbar-width`),Yt&&yi?.(),C(vi,null)}function t(){bi!==null&&(window.clearTimeout(bi),bi=null)}function n(e,n){t(),xi=!0,Ci=Date.now();let r=Ci,i=()=>{bi=null,Ci===r&&(Ei(_i)?xi=!1:(xi=!1,n()))},a=e===null?24:e;bi=window.setTimeout(i,a)}function r(){v(vi)===null&&_i.size===0&&!xi&&C(vi,document.body.getAttribute(`style`),!0)}return U(()=>Si.current,()=>{if(!Si.current)return;r(),xi=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,Yt&&(yi=A(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),G(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),W(()=>()=>{yi?.()}),{get lockMap(){return _i},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),Ti=class{#e=hi();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=wi.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=L(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),W(()=>{if(this.#r.lockMap.delete(this.#e),Ei(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function Ei(e){for(let[t,n]of e)if(n)return!0;return!1}function Di(e,t){i(t,!0);let n=b(t,`preventScroll`,3,!0),r=b(t,`restoreScrollDelay`,3,null);n()&&new Ti(n(),()=>r()),g()}var Oi=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),ki=n(`<div><!></div>`);function Ai(e,n){let r=s();i(n,!0);let a=b(n,`id`,19,()=>X(r)),o=b(n,`forceMount`,3,!1),c=b(n,`ref`,15,null),l=O(n,Oi),u=dn.create({id:L(()=>a()),ref:L(()=>c(),e=>c(e))}),p=w(()=>V(l,u.props));var m=P(),_=N(m),y=e=>{var r=P(),i=N(r),a=e=>{var t=P(),r=N(t);{let e=w(()=>({props:V(v(p)),...u.snippetProps}));f(r,()=>n.child,()=>v(e))}h(e,t)},o=e=>{var r=ki();S(r,e=>({...e}),[()=>V(v(p))]);var i=k(r);f(i,()=>n.children??T,()=>u.snippetProps),t(r),h(e,r)};d(i,e=>{n.child?e(a):e(o,-1)}),h(e,r)};d(_,e=>{(u.shouldRender||o())&&e(y)}),h(e,m),g()}var ji=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),Mi=n(`<div><!></div>`);function Ni(e,n){let r=s();i(n,!0);let a=b(n,`id`,19,()=>X(r)),o=b(n,`ref`,15,null),c=O(n,ji),l=ln.create({id:L(()=>a()),ref:L(()=>o(),e=>o(e))}),u=w(()=>V(c,l.props));var p=P(),m=N(p),_=e=>{var t=P(),r=N(t);f(r,()=>n.child,()=>({props:v(u)})),h(e,t)},y=e=>{var r=Mi();S(r,()=>({...v(u)}));var i=k(r);f(i,()=>n.children??T),t(r),h(e,r)};d(m,e=>{n.child?e(_):e(y,-1)}),h(e,p),g()}function Pi(e,t){i(t,!0);let n=b(t,`open`,15,!1),r=b(t,`onOpenChange`,3,Y),a=b(t,`onOpenChangeComplete`,3,Y);on.create({variant:L(()=>`dialog`),open:L(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:L(()=>a())});var o=P(),s=N(o);f(s,()=>t.children??T),h(e,o),g()}var Fi=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Ii=n(`<button><!></button>`);function Li(e,n){let r=s();i(n,!0);let a=b(n,`id`,19,()=>X(r)),o=b(n,`ref`,15,null),c=b(n,`disabled`,3,!1),l=O(n,Fi),u=sn.create({variant:L(()=>`close`),id:L(()=>a()),ref:L(()=>o(),e=>o(e)),disabled:L(()=>!!c())}),p=w(()=>V(l,u.props));var m=P(),_=N(m),y=e=>{var t=P(),r=N(t);f(r,()=>n.child,()=>({props:v(p)})),h(e,t)},ee=e=>{var r=Ii();S(r,()=>({...v(p)}));var i=k(r);f(i,()=>n.children??T),t(r),h(e,r)};d(_,e=>{n.child?e(y):e(ee,-1)}),h(e,m),g()}var Ri=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),zi=n(`<!> <!>`,1),Bi=n(`<!> <div><!></div>`,1);function Vi(e,n){let r=s();i(n,!0);let a=b(n,`id`,19,()=>X(r)),o=b(n,`ref`,15,null),c=b(n,`forceMount`,3,!1),l=b(n,`onCloseAutoFocus`,3,Y),u=b(n,`onOpenAutoFocus`,3,Y),p=b(n,`onEscapeKeydown`,3,Y),m=b(n,`onInteractOutside`,3,Y),_=b(n,`trapFocus`,3,!0),y=b(n,`preventScroll`,3,!0),ee=b(n,`restoreScrollDelay`,3,null),te=O(n,Ri),x=un.create({id:L(()=>a()),ref:L(()=>o(),e=>o(e))}),C=w(()=>V(te,x.props));var ne=P(),re=N(ne),ie=e=>{si(e,{get ref(){return x.opts.ref},loop:!0,get trapFocus(){return _()},get enabled(){return x.root.opts.open.current},get onOpenAutoFocus(){return u()},get onCloseAutoFocus(){return l()},focusScope:(e,r)=>{let i=()=>(r?.()).props;ii(e,M(()=>v(C),{get enabled(){return x.root.opts.open.current},get ref(){return x.opts.ref},onEscapeKeydown:e=>{p()(e),!e.defaultPrevented&&x.root.handleClose()},children:(e,r)=>{ti(e,M(()=>v(C),{get ref(){return x.opts.ref},get enabled(){return x.root.opts.open.current},onInteractOutside:e=>{m()(e),!e.defaultPrevented&&x.root.handleClose()},children:(e,r)=>{mi(e,M(()=>v(C),{get ref(){return x.opts.ref},get enabled(){return x.root.opts.open.current},children:(e,r)=>{var a=P(),o=N(a),s=e=>{var t=zi(),r=N(t),a=e=>{Di(e,{get preventScroll(){return y()},get restoreScrollDelay(){return ee()}})};d(r,e=>{x.root.opts.open.current&&e(a)});var o=E(r,2);{let e=w(()=>({props:V(v(C),i()),...x.snippetProps}));f(o,()=>n.child,()=>v(e))}h(e,t)},c=e=>{var r=Bi(),a=N(r);Di(a,{get preventScroll(){return y()}});var o=E(a,2);S(o,e=>({...e}),[()=>V(v(C),i())]);var s=k(o);f(s,()=>n.children??T),t(o),h(e,r)};d(o,e=>{n.child?e(s):e(c,-1)}),h(e,a)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};d(re,e=>{(x.shouldRender||c())&&e(ie)}),h(e,ne),g()}var Hi=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Ui(e,t){i(t,!0);let n=b(t,`open`,15,!1),r=O(t,Hi);var o=P(),s=N(o);a(s,()=>Pi,(e,t)=>{t(e,M(()=>r,{get open(){return n()},set open(e){n(e)}}))}),h(e,o),g()}var Wi=new Set([`$$slots`,`$$events`,`$$legacy`]);function Gi(e,t){let n=O(t,Wi);var r=P(),i=N(r);a(i,()=>Sn,(e,t)=>{t(e,M(()=>n))}),h(e,r)}var Ki=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function qi(e,t){i(t,!0);let n=b(t,`ref`,15,null),r=O(t,Ki);var o=P(),s=N(o);{let e=w(()=>F(`text-sm font-medium`,t.class));a(s,()=>mn,(t,i)=>{i(t,M({"data-slot":`dialog-title`,get class(){return v(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}h(e,o),g()}var Ji=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`showCloseButton`]),Yi=n(`<div><!> <!></div>`);function Xi(e,n){i(n,!0);let r=b(n,`ref`,15,null),o=b(n,`showCloseButton`,3,!1),s=O(n,Ji);var c=Yi();S(c,e=>({"data-slot":`dialog-footer`,class:e,...s}),[()=>F(`gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n.class)]);var l=k(c);f(l,()=>n.children??T);var u=E(l,2),p=e=>{var t=P(),n=N(t);{let e=(e,t)=>{pe(e,M({variant:`outline`},()=>(t?.()).props,{children:(e,t)=>{re();var n=_(`Close`);h(e,n)},$$slots:{default:!0}}))};a(n,()=>Li,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}h(e,t)};d(u,e=>{o()&&e(p)}),t(c),ie(c,e=>r(e),()=>r()),h(e,c),g()}var Zi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Qi=n(`<div><!></div>`);function $i(e,n){i(n,!0);let r=b(n,`ref`,15,null),a=O(n,Zi);var o=Qi();S(o,e=>({"data-slot":`dialog-header`,class:e,...a}),[()=>F(`gap-1 flex flex-col`,n.class)]);var s=k(o);f(s,()=>n.children??T),t(o),ie(o,e=>r(e),()=>r()),h(e,o),g()}var ea=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function ta(e,t){i(t,!0);let n=b(t,`ref`,15,null),r=O(t,ea);var o=P(),s=N(o);{let e=w(()=>F(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,t.class));a(s,()=>Ai,(t,i)=>{i(t,M({"data-slot":`dialog-overlay`,get class(){return v(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}h(e,o),g()}var na=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`portalProps`,`children`,`showCloseButton`]),ra=n(`<!> <span class="sr-only">Close</span>`,1),ia=n(`<!> <!>`,1);function aa(e,t){i(t,!0);let n=b(t,`ref`,15,null),r=b(t,`showCloseButton`,3,!0),o=O(t,na);Gi(e,M(()=>t.portalProps,{children:(e,i)=>{var s=ia(),c=N(s);a(c,()=>ta,(e,t)=>{t(e,{})});var l=E(c,2);{let e=w(()=>F(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,t.class));a(l,()=>Vi,(i,s)=>{s(i,M({"data-slot":`dialog-content`,get class(){return v(e)}},()=>o,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var i=ia(),o=N(i);f(o,()=>t.children??T);var s=E(o,2),c=e=>{var t=P(),n=N(t);{let e=(e,t)=>{pe(e,M({variant:`ghost`,class:`absolute top-2 right-2`,size:`icon-sm`},()=>(t?.()).props,{children:(e,t)=>{var n=ra(),r=N(n);he(r,{}),re(2),h(e,n)},$$slots:{default:!0}}))};a(n,()=>Li,(t,n)=>{n(t,{"data-slot":`dialog-close`,child:e,$$slots:{child:!0}})})}h(e,t)};d(s,e=>{r()&&e(c)}),h(e,i)},$$slots:{default:!0}}))})}h(e,s)},$$slots:{default:!0}})),g()}var oa=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function sa(e,t){i(t,!0);let n=b(t,`ref`,15,null),r=O(t,oa);var o=P(),s=N(o);{let e=w(()=>F(`text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3`,t.class));a(s,()=>Ni,(t,i)=>{i(t,M({"data-slot":`dialog-description`,get class(){return v(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}h(e,o),g()}var ca=n(`<!> `,1),la=n(`<!> <!>`,1);function ua(e,t){i(t,!0);let n=b(t,`open`,15,!1),r=b(t,`confirmLabel`,3,`Remove`),s=b(t,`busy`,3,!1);var c=P(),l=N(c);a(l,()=>Ui,(e,i)=>{i(e,{get open(){return n()},set open(e){n(e)},children:(e,i)=>{var c=P(),l=N(c);a(l,()=>aa,(e,i)=>{i(e,{class:`sm:max-w-[420px]`,children:(e,i)=>{var c=la(),l=N(c);a(l,()=>$i,(e,n)=>{n(e,{children:(e,n)=>{var r=la(),i=N(r);a(i,()=>qi,(e,n)=>{n(e,{class:`flex items-center gap-2`,children:(e,n)=>{var r=ca(),i=N(r);ge(i,{class:`h-4 w-4 text-destructive`});var a=E(i);ae(()=>o(a,` ${t.title??``}`)),h(e,r)},$$slots:{default:!0}})});var s=E(i,2);a(s,()=>sa,(e,n)=>{n(e,{children:(e,n)=>{re();var r=_();ae(()=>o(r,t.description)),h(e,r)},$$slots:{default:!0}})}),h(e,r)},$$slots:{default:!0}})});var u=E(l,2);a(u,()=>Xi,(e,i)=>{i(e,{children:(e,i)=>{var a=la(),c=N(a);pe(c,{variant:`outline`,get disabled(){return s()},onclick:()=>n(!1),children:(e,t)=>{re();var n=_(`Cancel`);h(e,n)},$$slots:{default:!0}});var l=E(c,2);pe(l,{variant:`destructive`,get disabled(){return s()},onclick:()=>t.onConfirm(),children:(e,t)=>{var n=ca(),i=N(n),a=e=>{me(e,{class:`h-4 w-4 animate-spin`})};d(i,e=>{s()&&e(a)});var c=E(i);ae(()=>o(c,` ${r()??``}`)),h(e,n)},$$slots:{default:!0}}),h(e,a)},$$slots:{default:!0}})}),h(e,c)},$$slots:{default:!0}})}),h(e,c)},$$slots:{default:!0}})}),h(e,c),g()}var da=new Set([`$$slots`,`$$events`,`$$legacy`]);function fa(e,t){let n=O(t,da),r=[[`path`,{d:`M10 11v6`}],[`path`,{d:`M14 11v6`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]];fe(e,M({name:`trash`},()=>n,{get iconNode(){return r}}))}export{Lt as A,W as B,Sn as C,Pt as D,$t as E,Nt as F,rt as G,U as H,K as I,L as J,$e as K,Et as L,zt as M,q as N,Ft as O,kt as P,G as R,Dn as S,Y as T,H as U,mt as V,V as W,De as Y,Kr as _,$i as a,Vr as b,Di as c,si as d,ii as f,qr as g,Ur as h,aa as i,Rt as j,It as k,hi as l,Yr as m,ua as n,qi as o,ti as p,we as q,sa as r,Ui as s,fa as t,mi as u,Gr as v,X as w,Jr as x,Hr as y,ht as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={};throw Error(`Could not resolve "katex/contrib/mhchem" imported by "markstream-svelte". Is it installed?`);export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ut as e}from"./CmCJ0SKP.js";import{_ as t,a as n,o as r,s as i,t as a,y as o}from"./BoMQFGOq.js";function s(e){return e?.code===`UNAVAILABLE`&&e.message.includes(`session expired`)}function c(e){return e instanceof t?{message:e.message,code:String(e.code)}:{message:e instanceof Error?e.message:String(e)}}function l(){let e=a(n);return{issue:()=>({isCurrent:e.issue().isCurrent})}}async function u(e,t){let n=l().issue();try{let r=await i().repository.scan({source:e,ref:t});return n.isCurrent()?{scan:r,error:null}:{scan:null,error:null}}catch(e){return n.isCurrent()?{scan:null,error:c(e)}:{scan:null,error:null}}}async function d(e,t){let n=l().issue();try{let r=await i().repository.preview({sessionId:e,skillId:t});return n.isCurrent()?{preview:r,error:null}:{preview:null,error:null}}catch(e){return n.isCurrent()?{preview:null,error:c(e)}:{preview:null,error:null}}}async function f(e){let t=l().issue();try{let n=await i().repository.install(e);return t.isCurrent()?{result:n,error:null}:{result:null,error:null}}catch(e){return t.isCurrent()?{result:null,error:c(e)}:{result:null,error:null}}}function p(e){let t=[];for(let n of e)if(n.kind===`directory`&&n.available)for(let e of n.providers)e.writable&&t.push({target:{workspaceId:n.id,providerId:e.id},workspace:n,provider:e,label:`${n.label} / ${e.label}`});return t}function m(e){if(e.kind===`directory`&&e.providers.length>0){let t=e.providers[0];return t?`/workspaces/${encodeURIComponent(e.id)}/${encodeURIComponent(t.id)}`:`/workspaces`}return`/workspaces`}var h=a(n),g=a(n),_=e({workspaces:[],activeId:`~`,loading:!0,error:null});async function v(){let e=h.issue(),t=r();if(!t)return e.isLatest()&&(_.loading=!1),`failed`;_.loading=!0,_.error=null;try{let{workspaces:n}=await t.workspace.list({});return e.isCurrent()?(_.workspaces=n,_.activeId=n.find(e=>e.active)?.id??`~`,`loaded`):`superseded`}catch(t){return e.isCurrent()?(_.error=t instanceof Error?t.message:String(t),`failed`):`superseded`}finally{e.isLatest()&&(_.loading=!1)}}async function y(e,t){let n=g.issue(),r;try{({workspace:r}=await i().workspace.add({path:e,label:t}))}catch(e){if(!n.isCurrent())return null;throw e}return n.isCurrent()?(await v(),r):(await v(),null)}async function b(e){let t=o.parse(e),n=g.issue(),r;try{({activeId:r}=await i().workspace.remove({id:t}))}catch(e){if(!n.isCurrent())return!1;throw e}return n.isCurrent()?(_.activeId=r,await v(),n.isCurrent()):!1}function x(){return p(_.workspaces)}export{x as a,s as c,_ as i,d as l,v as n,m as o,b as r,f as s,y as t,u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=function(e,t){return new URL(e,t).href},t={},n=function(n,r,i){let a=Promise.resolve();if(r&&r.length>0){let n=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);function c(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function l(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}a=c(r.map(r=>{if(r=e(r,i),r=l(r),r in t)return;t[r]=!0;let a=r.endsWith(`.css`);for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.href===r&&(!a||t.rel===`stylesheet`))return}let o=document.createElement(`link`);if(o.rel=a?`stylesheet`:`modulepreload`,a||(o.as=`script`),o.crossOrigin=``,o.href=r,s&&o.setAttribute(`nonce`,s),document.head.appendChild(o),a)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}))}function o(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return a.then(e=>{for(let t of e||[])t.status===`rejected`&&o(t.reason);return n().catch(o)})};export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={};throw Error(`Could not resolve "mermaid" imported by "markstream-svelte". Is it installed?`);export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,Q as t,X as n,Z as r,ft as i,mt as a,r as o,t as s,vt as c}from"./CmCJ0SKP.js";var l=class{constructor(e,t){this.status=e,this.body=typeof t==`string`?{message:t}:t||{message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},u=class{constructor(e,t){try{new Headers({location:t})}catch{throw Error(`Invalid redirect location ${JSON.stringify(t)}: this string contains characters that cannot be used in HTTP headers`)}this.status=e,this.location=t}},d=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function f(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function p(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function ee(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(){}function g(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder;function _(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var te=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&v.delete(b(e)),te(e,t));var v=new Map;function y(e,t){let n=b(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=_(e));let i=r.getAttribute(`data-ttl`);return i&&v.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function ne(e,t,n){if(v.size>0){let t=b(e,n),r=v.get(t);if(r){if(performance.now()<r.ttl&&[`default`,`force-cache`,`only-if-cached`,void 0].includes(n?.cache))return new Response(r.body,r.init);v.delete(t)}}return window.fetch(t,n)}function b(e,t){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){let e=[];t.headers&&e.push([...new Headers(t.headers)].join(`,`)),t.body&&(typeof t.body==`string`||ArrayBuffer.isView(t.body))&&e.push(t.body),n+=`[data-hash="${g(...e)}"]`}return n}var re=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,ie=/^\/\((?:[^)]+)\)$/;function ae(e){let t=[];return{pattern:e===`/`||ie.test(e)?/^\/$/:RegExp(`^${se(e).map(e=>{let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return le(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return le(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=re.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return le(e)}).join(``)}).join(``)}/?$`),params:t}}function oe(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function se(e){return e.slice(1).split(`/`).filter(oe)}function ce(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;e<t.length;e+=1){let s=t[e],c=i[e-o];if(s.chained&&s.rest&&o&&(c=i.slice(e-o,e+1).filter(e=>e).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0);continue}if(s.optional&&s.chained){o++;continue}return}if(!o)return r}function le(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}function ue({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=ae(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return ce(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function de(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function fe(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var x=globalThis.__sveltekit_7x2t3p?.base??``,pe=globalThis.__sveltekit_7x2t3p?.assets??x??``,me=`1789407157689`,he=`sveltekit:snapshot`,ge=`sveltekit:scroll`,_e=`sveltekit:states`,ve=`sveltekit:pageurl`,S=`sveltekit:history`,C=`sveltekit:navigation`,w={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},T=location.origin;function ye(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function E(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var be={...w,"":w.hover};function xe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Se(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=xe(e)}}function Ce(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||k(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===T&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function O(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=D(s,`preload-code`)),i===null&&(i=D(s,`preload-data`)),t===null&&(t=D(s,`keepfocus`)),n===null&&(n=D(s,`noscroll`)),a===null&&(a=D(s,`reload`)),o===null&&(o=D(s,`replacestate`)),s=xe(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:be[r??`off`],preload_data:be[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function we(e){let t=c(e),n=!0;function r(){n=!0,t.update(e=>e)}function i(e){n=!1,t.set(e)}function a(e){let r;return t.subscribe(t=>{(r===void 0||n&&t!==r)&&e(r=t)})}return{notify:r,set:i,subscribe:a}}var Te={v:h};function Ee(){let{set:e,subscribe:t}=c(!1),n;async function r(){clearTimeout(n);try{let t=await fetch(`${pe}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let r=(await t.json()).version!==me;return r&&(e(!0),Te.v(),clearTimeout(n)),r}catch{return!1}}return{subscribe:t,check:r}}function k(e,t,n){return e.origin!==T||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function De(e){}var Oe=2**32-1-1,ke=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ae(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getPrototypeOf(t)===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===ke}function je(e){return Object.prototype.toString.call(e).slice(8,-1)}function Me(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}function Ne(e){return!(!Number.isInteger(e)||e<0||e>Oe)}function Pe(e){if(e.length===0||e.length>1&&e.charCodeAt(0)===48)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return Ne(+e)}function Fe(e){for(var t=e.length-1;t>=0&&!Pe(e[t]);t--);return t+1}function Ie(e){let t=Object.keys(e);return t.length=Fe(t),t}Uint8Array.fromBase64,typeof process==`object`&&process.versions?.node;var Le=Object.freeze({kind:`not-plain`}),Re=Object.freeze({kind:`symbol-keys`});Object.freeze({identify:e=>e,typeOf:e=>e===null?`null`:typeof e,toPrimitive:e=>e,tagOf:e=>je(e),isThenable:e=>typeof e.then==`function`,toPromise:e=>Promise.resolve(e),unbox:e=>e.valueOf(),toISOString:e=>isNaN(e.getDate())?``:e.toISOString(),toStringValue:e=>e.toString(),regExpInfo:e=>({source:e.source,flags:e.flags}),valuesOf:e=>e,entriesOf:e=>e,viewInfo:e=>({buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,length:e.length,bufferByteLength:e.buffer.byteLength}),toArrayBuffer:e=>e,lengthOf:e=>e.length,hasOwn:(e,t)=>Object.hasOwn(e,t),indicesOf:e=>Ie(e),shapeOf:e=>Ae(e)?Me(e).length>0?Re:{kind:Object.getPrototypeOf(e)===null?`null-proto`:`plain`,keys:Object.keys(e)}:Le,get:(e,t)=>e[t]}),Object.freeze({fromPrimitive:e=>e,fromISOString:e=>new Date(e),fromStringValue:(e,t)=>e===`URL`?new URL(t):e===`URLSearchParams`?new URLSearchParams(t):Temporal[e.slice(9)].from(t),fromArrayBuffer:e=>e,fromRegExpInfo:(e,t)=>new RegExp(e,t),fromViewInfo:(e,t,n,r)=>{let i=globalThis[e];return n===void 0?new i(t):new i(t,n,r)},box:e=>Object(e),createArray:e=>Array(e),createSparseArray:e=>{let t=[];return t[Oe]=void 0,delete t[Oe],t.length=e,t},createObject:()=>({}),createNullPrototypeObject:()=>Object.create(null),createSet:()=>new Set,createMap:()=>new Map,set:(e,t,n)=>{e[t]=n},addValue:(e,t)=>{e.add(t)},addEntry:(e,t,n)=>{e.set(t,n)}});var ze=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...ze],[...new Set([...ze])];function Be(e){return e.filter(e=>e!=null)}function A(e,t){return e+`/`+t}function Ve(e){return e instanceof l||e instanceof d?e.status:500}function He(e){return e instanceof d?e.text:`Internal Error`}var j,M,Ue,We=o.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(o.toString()),Ge=`a:`;We?(j={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ge)},M={current:null},Ue={current:!1}):(j=new class{#e=a({});get data(){return n(this.#e)}set data(e){i(this.#e,e)}#t=a(null);get form(){return n(this.#t)}set form(e){i(this.#t,e)}#n=a(null);get error(){return n(this.#n)}set error(e){i(this.#n,e)}#r=a({});get params(){return n(this.#r)}set params(e){i(this.#r,e)}#i=a({id:null});get route(){return n(this.#i)}set route(e){i(this.#i,e)}#a=a({});get state(){return n(this.#a)}set state(e){i(this.#a,e)}#o=a(-1);get status(){return n(this.#o)}set status(e){i(this.#o,e)}#s=a(new URL(Ge));get url(){return n(this.#s)}set url(e){i(this.#s,e)}},M=new class{#e=a(null);get current(){return n(this.#e)}set current(e){i(this.#e,e)}},Ue=new class{#e=a(!1);get current(){return n(this.#e)}set current(e){i(this.#e,e)}},Te.v=()=>Ue.current=!0);function Ke(e){Object.assign(j,e)}var{onMount:qe,tick:Je}=s,Ye=e??(e=>e()),Xe=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),N=null,P=de(`sveltekit:scroll`)??{},F=de(`sveltekit:snapshot`)??{},I={url:we({}),page:we({}),navigating:c(null),updated:Ee()};function Ze(e){P[e]=E()}function Qe(e,t){let n=e+1;for(;P[n];)delete P[n],n+=1;for(n=t+1;F[n];)delete F[n],n+=1}function L(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(h)}async function $e(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(x||`/`);e&&await e.update()}}var et,tt,R,z,nt,B,rt={},it={},at=[],ot=[],V=null;function st(){V?.fork?.then(e=>e?.discard()),V=null,Q={element:void 0,href:void 0}}var ct=new Map,lt=new Set,ut=new Set,H=new Set,U={branch:[],error:null,url:null,nav:null},dt=!1,W=!1,ft=!0,G=!1,K=!1,pt=!1,mt=!1,ht,q,J,Y,gt=new Set,_t=new Map,vt=new Map;async function yt(e,t,n){if(globalThis.__sveltekit_7x2t3p.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_7x2t3p.data;for(let t in e)rt[t]=e[t];for(let e in n)rt[e]=n[e];for(let e in r)rt[e]=r[e];for(let e in t)it[e]=t[e]}document.URL!==location.href&&(location.href=location.href),B=e,await e.hooks.init?.(),et=ue(e),z=document.documentElement,nt=t,tt=e.nodes[0],R=e.nodes[1],tt(),R(),q=history.state?.[S],J=history.state?.[C],q||(q=J=Date.now(),history.replaceState({...history.state,[S]:q,[C]:J},``));let r=P[q];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Jt(nt,n)):(await Z({type:`enter`,url:ye(B.hash?en(new URL(location.href)):location.href),replace_state:!0}),i()),qt()}function bt(){at.length=0,mt=!1}function xt(e){ot.some(e=>e?.snapshot)&&(F[e]=ot.map(e=>e?.snapshot?.capture()))}function St(e){F[e]?.forEach((e,t)=>{ot[t]?.snapshot?.restore(e)})}function Ct(){Ze(q),fe(ge,P),xt(J),fe(he,F)}async function wt(e,n,r,i){let a,o;n.invalidateAll&&st(),await Z({type:`goto`,url:ye(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:r,nav_token:i,accept:()=>{if(n.invalidateAll){mt=!0,a=new Set;for(let[e,t]of _t)for(let[n,r]of t)r.resource?.reset(),a.add(A(e,n));o=new Set;for(let[e,t]of vt)for(let n of t.keys())o.add(A(e,n))}n.invalidate&&n.invalidate.forEach(Gt)}}),n.invalidateAll&&t().then(t).then(()=>{for(let[e,t]of _t)for(let[n,{resource:r}]of t)a?.has(A(e,n))&&r.start();for(let[e,t]of vt)for(let[n,{resource:r}]of t)o?.has(A(e,n))&&r.reconnect()})}async function Tt(e){if(e.id!==V?.id){st();let t={};gt.add(t),V={id:e.id,token:t,promise:Ft({...e,preload:t}).then(e=>(gt.delete(t),e.type===`loaded`&&e.state.error&&st(),e)),fork:null}}return V.promise}async function Et(e){let t=(await zt(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function Dt(e,t,n){let r={params:U.params,route:{id:U.route?.id??null},url:new URL(location.href)};if(U={...e.state,nav:r},Ke(e.props.page),ht=new B.root({target:t,props:{...e.props,stores:I,components:ot},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:P[q]??E()},willUnload:!1,type:`enter`,complete:Promise.resolve()};H.forEach(t=>t(e))}St(J),W=!0}async function Ot({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(x&&(e.pathname===x||e.pathname===x+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=f(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:Be(n).map(e=>e.node.component),page:$t(j)}};s!==void 0&&(l.props.form=s);let u={},d=!j,p=0;for(let e=0;e<Math.max(n.length,U.branch.length);e+=1){let t=n[e],r=U.branch[e];t?.data!==r?.data&&(d=!0),t&&(u={...u,...t.data},d&&(l.props[`data_${p}`]=u),p+=1)}return(!U.url||e.href!==U.url.href||U.error!==a||s!==void 0&&s!==j.form||d)&&(l.props.page={error:a,params:t,route:{id:o?.id??null},state:{},status:i,url:new URL(e),form:s??null,data:d?u:j.data}),l}async function kt({loader:e,parent:t,url:n,params:r,route:i,server_data_node:a}){let o={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},s=await e();return{node:s,loader:e,server:a,universal:s.universal?.load?{type:`data`,data:null,uses:o}:null,data:a?.data??null,slash:s.universal?.trailingSlash??a?.slash}}function At(e,t,n){let r=e instanceof Request?e.url:e,i=new URL(r,n);return i.origin===n.origin&&(r=i.href.slice(n.origin.length)),{resolved:i,promise:W?ne(r,i.href,t):y(r,t)}}function jt(e,t,n,r,i,a){if(mt)return!0;if(!i)return!1;if(i.parent&&e||i.route&&t||i.url&&n)return!0;for(let e of i.search_params)if(r.has(e))return!0;for(let e of i.params)if(a[e]!==U.params[e])return!0;for(let e of i.dependencies)if(at.some(t=>t(new URL(e))))return!0;return!1}function Mt(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function Nt(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function Pt({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:$t(j),constructors:[]}}}async function Ft({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(V?.id===e)return gt.delete(V.token),V.promise;let{errors:o,layouts:s,leaf:c}=i,d=[...s,c];o.forEach(e=>e?.().catch(h)),d.forEach(e=>e?.[1]().catch(h));let f=U.url?e!==X(U.url):!1,p=U.route?i.id!==U.route.id:!1,ee=Nt(U.url,n),m=!1,g=d.map(async(e,t)=>{if(!e)return;let a=U.branch[t];return e[1]===a?.loader&&!jt(m,p,f,ee,a.universal?.uses,r)?a:(m=!0,kt({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;n<t;n+=1)Object.assign(e,(await g[n])?.data);return e},server_data_node:Mt(e[0]?{type:`skip`}:null,e[0]?a?.server:void 0)}))});for(let e of g)e.catch(h);let _=[];for(let e=0;e<d.length;e+=1)if(d[e])try{_.push(await g[e])}catch(t){if(t instanceof u)return{type:`redirect`,location:t.location};if(a&>.has(a))return Pt({error:await $(t,{params:r,url:n,route:{id:i.id}}),url:n,params:r,route:i});let s=Ve(t),c;if(t instanceof l)c=t.body;else{if(await I.updated.check())return await $e(),await L(n);c=await $(t,{params:r,url:n,route:{id:i.id}})}let d=await It(e,_,o);return d?Ot({url:n,params:r,branch:_.slice(0,d.idx).concat(d.node),errors:o,status:s,error:c,route:i}):await Ht(n,{id:i.id},c,s)}else _.push(void 0);return Ot({url:n,params:r,branch:_,errors:o,status:200,error:null,route:i,form:t?void 0:null})}async function It(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)--r;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Lt({status:e,error:t,url:n,route:r}){let i={};try{return Ot({url:n,params:i,branch:[await kt({loader:tt,url:n,params:i,route:r,parent:()=>Promise.resolve({}),server_data_node:Mt(null)}),{node:await R(),loader:R,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof u){await wt(new URL(t.location,location.href),{},0);return}let a=await B.get_error_template(),o=await $(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function Rt(e){let t=e.href;if(ct.has(t))return ct.get(t);let n;try{let r=(async()=>{let t=await B.hooks.reroute({url:new URL(e),fetch:async(t,n)=>At(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);B.hash?n.hash=t:n.pathname=t,t=n}return t})();ct.set(t,r),n=await r}catch{ct.delete(t);return}return n}async function zt(e,t){if(e&&!k(e,x,B.hash)){let n=await Rt(e);if(!n)return;let r=Bt(n);for(let n of et){let i=n.exec(r);if(i)return{id:X(e),invalidating:t,route:n,params:ee(i),url:e}}}}function Bt(e){return p(B.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(x.length))||`/`}function X(e){return(B.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Vt({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Qt(U,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return G||lt.forEach(e=>e(c)),o?null:s}async function Z({type:e,url:n,popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c={},redirect_count:l=0,nav_token:u={},accept:f=h,block:p=h,event:ee}){let m=Y;Y=u;let g=await zt(n,!1),_=e===`enter`?Qt(U,g,n,e):Vt({url:n,type:e,delta:i?.delta,intent:g,scroll:i?.scroll,event:ee});if(!_){p(),Y===u&&(Y=m);return}let te=q,v=J;f(),G=!0,W&&_.navigation.type!==`enter`&&I.navigating.set(M.current=_.navigation);let y=g&&await Ft(g);if(!y){if(k(n,x,B.hash))return await L(n,s);y=await Ht(n,{id:null},await $(new d(404,`Not Found`,`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404,s)}if(n=g?.url||n,Y!==u){_.reject(Error(`navigation aborted`));return}if(!y)return;if(y.type===`redirect`){if(l<20){await Z({type:e,url:new URL(y.location,n),popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c,redirect_count:l+1,nav_token:u}),_.fulfil(void 0);return}if(y=await Lt({status:500,error:await $(Error(`Redirect loop`),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}}),!y)return}else if(y.props.page.status>=400&&await I.updated.check())return await $e(),await L(n,s);if(bt(),Ze(te),xt(v),y.props.page.url.pathname!==n.pathname&&(n.pathname=y.props.page.url.pathname),c=i?i.state:c,!i){let e=+!s,t={[S]:q+=e,[C]:J+=e,[_e]:c};(s?history.replaceState:history.pushState).call(history,t,``,n),s||Qe(q,J)}let ne=g&&V?.id===g.id?V.fork:null;V?.fork&&!ne?st():(V=null,Q={element:void 0,href:void 0}),y.props.page.state=c;let b;if(W){let e=(await Promise.all(Array.from(ut,e=>e(_.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{H.delete(e)})}e.push(t),e.forEach(e=>{H.add(e)})}let t=_.navigation.to;U={...y.state,nav:{params:t.params,route:t.route,url:t.url}},y.props.page&&(y.props.page.url=n),!a&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let i=ne&&await ne;i?b=i.commit():(N=null,ht.$set(y.props),N&&Object.assign(y.props.page,N),Ke(y.props.page),b=r?.()),pt=!0}else await Dt(y,nt,!1);let{activeElement:re}=document;if(await b,await t(),await t(),Y!==u){_.reject(Error(`navigation aborted`));return}y.props.page&&N&&Object.assign(y.props.page,N);let ie=null;if(ft){let e=i?i.scroll:o?E():null;e?scrollTo(e.x,e.y):(ie=n.hash&&document.getElementById(tn(n)))?ie.scrollIntoView():scrollTo(0,0)}let ae=document.activeElement!==re&&document.activeElement!==document.body;!a&&!ae&&Zt(n,!ie),ft=!0,G=!1,_.fulfil(void 0),_.navigation.to&&(_.navigation.to.scroll=E()),H.forEach(e=>e(_.navigation)),e===`popstate`&&St(J),I.navigating.set(M.current=null)}async function Ht(e,t,n,r,i){return e.origin===T&&e.pathname===location.pathname&&!dt?await Lt({status:r,error:n,url:e,route:t}):await L(e,i)}var Q={element:void 0,href:void 0};function Ut(){let e,t;z.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,w.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],w.tap)}z.addEventListener(`mousedown`,n),z.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(Et(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=Se(e,z),i=r===Q.element&&r?.href===Q.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=Ce(r,x,B.hash);if(o||s)return;let c=O(r),l=a&&X(U.url)===X(a);if(!(c.reload||l)){if(n<=c.preload_data){Q={element:r,href:r.href},t=w.tap;let e=await zt(a,!1);if(!e)return;Tt(e)}else n<=c.preload_code&&(Q={element:r,href:r.href},t=n,Et(a))}}function a(){r.disconnect();for(let e of z.querySelectorAll(`a`)){let{url:t,external:n,download:i}=Ce(e,x,B.hash);if(n||i)continue;let a=O(e);a.reload||(a.preload_code===w.viewport&&r.observe(e),a.preload_code===w.eager&&Et(t))}}H.add(a),a()}function $(e,t){if(e instanceof l)return e.body;let n=Ve(e),r=He(e);return B.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Wt(e,t={}){return e=new URL(ye(e)),e.origin===T?wt(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function Gt(e){if(typeof e==`function`)at.push(e);else{let{href:t}=new URL(e,location.href);at.push(e=>e.href===t)}}function Kt(e,t){let n={[S]:q,[C]:J,[ve]:j.url.href,[_e]:t};history.replaceState(n,``,ye(e)),j.state=t,ht.$set({page:Ye(()=>$t(j))})}function qt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(Ct(),!G){let e=Qt(U,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};lt.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&Ct()}),navigator.connection?.saveData||Ut(),z.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=Se(t.composedPath()[0],z);if(!n)return;let{url:r,external:i,target:a,download:o}=Ce(n,x,B.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=O(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(B.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l)){Vt({url:r,type:`link`,event:t})?G=!0:t.preventDefault();return}if(l!==void 0&&u){let[,i]=U.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(K=!0,Ze(q),e(r),!s.replace_state)return;K=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Z({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),z.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(k(r,x,!1))return;let i=e.target,a=O(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Z({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!Xt){if(t.state?.[`sveltekit:history`]){let n=t.state[S];if(Y={},n===q)return;let r=P[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[C],s=U.url?m(location)===m(U.url):!1;if(o===J&&(pt||s)){i!==j.state&&(j.state=i),e(a),P[q]=E(),r&&scrollTo(r.x,r.y),q=n;return}let c=n-q;await Z({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{q=n,J=o},block:()=>{history.go(-c)},nav_token:Y,event:t})}else K||(e(new URL(location.href)),B.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{K&&(K=!1,history.replaceState({...history.state,[S]:++q,[C]:J},``,location.href))});for(let e of document.querySelectorAll(`link`))Xe.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&I.navigating.set(M.current=null)});function e(e){U.url=j.url=e,I.page.set($t(j)),I.page.notify()}}async function Jt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){dt=!0;let l=new URL(location.href),d;({params:i={},route:a={id:null}}=await zt(l,!1)||{}),d=et.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Yt(r.uses)),kt({loader:B.nodes[t],url:l,params:i,route:a,parent:async()=>{let t={};for(let r=0;r<n;r+=1)Object.assign(t,(await e[r]).data);return t},server_data_node:Mt(r)})}),o=await Promise.all(e);if(d){let e=d.layouts;for(let t=0;t<e.length;t++)e[t]||o.splice(t,0,void 0)}f=await Ot({url:l,params:i,branch:o,status:t,error:n,errors:d?.errors,form:c,route:d??null})}catch(t){if(t instanceof u)return await L(new URL(t.location,location.href));f=await Lt({status:Ve(t),error:await $(t,{url:l,params:i,route:a}),url:l,route:a}),e.textContent=``,p=!1}f&&(f.props.page&&(f.props.page.state={}),await Dt(f,e,p))}function Yt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}var Xt=!1;function Zt(e,t=!0){let n=document.querySelector(`[autofocus]`);if(n)n.focus();else{let n=tn(e);if(n&&document.getElementById(n)){let{x:r,y:i}=E();setTimeout(()=>{let a=history.state;Xt=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),Xt=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t<r.rangeCount;t+=1)e.push(r.getRangeAt(t));setTimeout(()=>{if(r.rangeCount===e.length){for(let t=0;t<r.rangeCount;t+=1){let n=e[t],i=r.getRangeAt(t);if(n.commonAncestorContainer!==i.commonAncestorContainer||n.startContainer!==i.startContainer||n.endContainer!==i.endContainer||n.startOffset!==i.startOffset||n.endOffset!==i.endOffset)return}r.removeAllRanges()}})}}}function Qt(e,t,n,r,i=null){let a,o,s=new Promise((e,t)=>{a=e,o=t});return s.catch(h),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:E()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function $t(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function en(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function tn(e){let t;if(B.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{j as a,M as i,Kt as n,De as o,yt as r,Wt as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,s as t,ut as n}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{t as r}from"./BkEnd9_Z.js";import{A as i,C as a,E as o,O as s,T as ee,a as c,d as te,h as ne,k as re,m as l,o as u,s as d,t as f}from"./BoMQFGOq.js";import{n as p}from"./CNPsST_i.js";var ie=new Set([`$$slots`,`$$events`,`$$legacy`]);function ae(n,i){let a=e(i,ie),o=[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}],[`path`,{d:`m7 16.5-4.74-2.85`}],[`path`,{d:`m7 16.5 5-3`}],[`path`,{d:`M7 16.5v5.17`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}],[`path`,{d:`m17 16.5-5-3`}],[`path`,{d:`m17 16.5 4.74-2.85`}],[`path`,{d:`M17 16.5v5.17`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}],[`path`,{d:`M12 8 7.26 5.15`}],[`path`,{d:`m12 8 4.74-2.85`}],[`path`,{d:`M12 13.5V8`}]];r(n,t({name:`boxes`},()=>a,{get iconNode(){return o}}))}var m=n({open:!1});function oe(){m.open=!0}var se=new Set([`$$slots`,`$$events`,`$$legacy`]);function ce(n,i){let a=e(i,se),o=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`}],[`path`,{d:`M2 12h20`}]];r(n,t({name:`globe`},()=>a,{get iconNode(){return o}}))}var le=new Set([`$$slots`,`$$events`,`$$legacy`]);function ue(n,i){let a=e(i,le),o=[[`path`,{d:`M12 10v6`}],[`path`,{d:`M9 13h6`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];r(n,t({name:`folder-plus`},()=>a,{get iconNode(){return o}}))}var de=new Set([`$$slots`,`$$events`,`$$legacy`]);function fe(n,i){let a=e(i,de),o=[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}]];r(n,t({name:`message-square`},()=>a,{get iconNode(){return o}}))}var h=`__new__`,g=n({text:``,images:[],files:[],editing:null}),_=new Map,v=h;function y(){return{text:``,images:[],files:[],editing:null}}function pe(){return{text:g.text,images:[...g.images],files:[...g.files],editing:g.editing}}function b(e){g.text=e.text,g.images=e.images,g.files=e.files,g.editing=e.editing}function x(e){if(e===v)return;_.set(v,pe());let t=_.get(e)??y();_.delete(e),v=e,b(t)}function S(e){_.delete(e),e===v&&b(y())}function me(e,t){if(e===t)return;let n=_.get(e);n!==void 0&&(_.delete(e),v===t?b(n):_.has(t)||_.set(t,n))}function he(e){g.editing=e,g.text=e}function ge(){g.editing=null}var _e={"image/png":!0,"image/jpeg":!0,"image/webp":!0,"image/gif":!0};function C(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=String(r.result??``);t(e.slice(e.indexOf(`,`)+1))},r.onerror=()=>n(r.error),r.readAsDataURL(e)})}async function ve(e){for(let t of e){if(t.type.startsWith(`image/`))continue;if(g.files.length>=2){p(`At most 2 file attachments per message.`);return}if(t.size>524288){p(`"${t.name}" exceeds the 512KiB limit.`);continue}let e=await C(t);g.files=[...g.files,{name:t.name,data:e}]}}async function w(e){for(let t of e){if(g.images.length>=4){p(`At most 4 images per message.`);return}if(!(t.type in _e)){p(`Unsupported image type: ${t.type||`unknown`}.`);continue}if(t.size>4194304){p(`"${t.name}" exceeds the 4MiB limit.`);continue}let e=await C(t);g.images=[...g.images,{mediaType:t.type,data:e,...t.name?{name:t.name}:{},preview:`data:${t.type};base64,${e}`}]}}function ye(e){let t=[...e.dataTransfer?.files??[]],n=t.filter(e=>e.type.startsWith(`image/`)),r=t.filter(e=>!e.type.startsWith(`image/`));t.length>0&&e.preventDefault(),n.length>0&&w(n),r.length>0&&ve(r)}function be(e){for(let t of e){if(g.images.length>=4){p(`At most 4 images per message.`);return}g.images=[...g.images,{path:t.path,name:t.name,...t.preview===void 0?{}:{preview:t.preview}}]}}function xe(e){for(let t of e){if(g.files.length>=2){p(`At most 2 file attachments per message.`);return}g.files=[...g.files,{name:t.name,path:t.path}]}}var T=f(c),E=f(c),D=f(c),O=f(c),k=f(c),A=f(c),j=f(c),M=f(c),N=f(c),Se=f(c),P=`skill-creator.agentPanelWidth.v1`;function F(e){return Number.isFinite(e)?Math.min(720,Math.max(320,Math.round(e))):440}function Ce(){try{let e=sessionStorage.getItem(P);return e===null?440:F(Number(e))}catch{return 440}}var I=n({open:!1,seedPrompt:null,width:Ce()}),L=n({sessionId:null,status:`idle`,mode:null,pendingMode:`free`,items:[],todos:[],turnStartedAt:null,cursor:0,sending:!1,error:null,promptError:null,lastUsage:null}),R=n({loaded:!1,loading:!1,sessions:[],error:null}),z=n({view:null,loading:!1,updating:!1,error:null}),B=null,V=[],H=null,U=new Map;function we(e){I.open=e,e&&!R.loaded&&!R.loading&&G(),e&&L.sessionId&&J(),e||Y()}function Te(e){I.width=F(e);try{sessionStorage.setItem(P,String(I.width))}catch{}}var W=0;async function G(){if(u()===null){if(W>=25)return;W+=1,setTimeout(()=>void G(),300);return}W=0;let e=T.issue();R.loading=!0;try{let t=await d().agent.sessions.list({});if(!e.isCurrent())return;R.sessions=t.sessions,R.loaded=!0,R.error=null}catch(t){if(!e.isCurrent())return;R.error=t instanceof Error?t.message:String(t)}finally{e.isCurrent()&&(R.loading=!1)}}async function Ee(e){let t=Se.issue();try{let n=await d().agent.sessions.cleanup(e);if(!t.isCurrent())return null;if(n.kind===`summary`&&L.sessionId!==null){let e=L.sessionId;(n.deletedIds??[]).includes(e)?K():n.deletedIdsTruncated===!0&&(await G(),t.isCurrent()&&!R.sessions.some(t=>t.sessionId===e&&t.hasTranscript!==!1)&&K())}return R.loaded=!1,G(),n}catch(e){return t.isCurrent()?{error:e instanceof Error?e.message:String(e)}:null}}async function De(e,t){let n=E.issue();L.sending=!0;try{let r=await d().agent.session.create({...e?{prompt:e}:{},...t?{mode:t}:{}});if(!n.isCurrent())return;q(r.session.sessionId,r.session.status,r.session.mode),R.loaded=!1,G(),J()}catch(e){if(!n.isCurrent())return;L.error=e instanceof Error?e.message:String(e)}finally{n.isCurrent()&&(L.sending=!1)}}function Oe(e,t){K(),I.open=!0,I.seedPrompt=t??null,L.pendingMode=e}function K(){Y(),L.sessionId=null,L.status=`idle`,L.mode=null,L.pendingMode=`free`,L.items=[],L.todos=[],L.turnStartedAt=null,L.cursor=0,L.error=null,L.promptError=null,L.lastUsage=null,V=[],H=null,U=new Map,x(h),S(h)}function ke(e){L.sessionId!==e&&(q(e,`idle`,R.sessions.find(t=>t.sessionId===e)?.mode??`free`),J())}function q(e,t,n){L.sessionId=e,L.status=t,L.mode=n,L.items=[],L.todos=[],L.turnStartedAt=null,L.cursor=0,L.error=null,L.lastUsage=null,V=[],H=null,U=new Map,x(e)}async function Ae(e){let t=L.sessionId;if(!t||L.mode===e)return!1;if(L.status===`running`)return L.error=`Switch modes after the current turn ends.`,!1;let n=M.issue();try{let r=await d().agent.session.setMode({sessionId:t,mode:e});return!n.isCurrent()||L.sessionId!==t?!1:(L.mode=r.session.mode,L.status=r.session.status,L.error=null,R.loaded=!1,G(),J(),!0)}catch(e){return n.isCurrent()&&(L.error=e instanceof Error?e.message:String(e)),!1}}async function je(e,t=[],n=[]){if(e.trim().length===0&&t.length===0&&n.length===0)return;if(!L.sessionId){if(await De(void 0,L.pendingMode),!L.sessionId)return;me(h,L.sessionId)}let r=L.sessionId,i=O.issue();L.sending=!0;let a=t.filter(e=>e.preview===void 0).map(e=>e.name??`image`);L.items.push({kind:`user`,seq:-Date.now(),text:e,...t.some(e=>e.preview!==void 0)?{images:t.flatMap(e=>e.preview===void 0?[]:[e.preview])}:{},...n.length>0||a.length>0?{files:[...n.map(e=>e.name??`file`),...a]}:{}}),V.push(e);try{if(await d().agent.session.prompt({sessionId:r,text:e,images:t.map(e=>{if(e.path!==void 0)return{path:e.path,...e.name?{name:e.name}:{}};if(e.mediaType===void 0||e.data===void 0)throw Error(`image attachment needs either path or mediaType+data`);return{mediaType:e.mediaType,data:e.data,...e.name?{name:e.name}:{}}}),files:n.map(e=>{if(e.path!==void 0)return{path:e.path};if(e.name===void 0||e.data===void 0)throw Error(`file attachment needs either path or name+data`);return{name:e.name,data:e.data}})}),!i.isCurrent())return;L.promptError=null,S(r)}catch(t){if(!i.isCurrent())return;L.promptError=t instanceof Error?t.message:String(t);let n=V.indexOf(e);n>=0&&V.splice(n,1)}finally{i.isCurrent()&&(L.sending=!1)}J()}async function Me(){let e=L.sessionId;if(e){try{await d().agent.session.cancel({sessionId:e})}catch(e){L.error=e instanceof Error?e.message:String(e)}J()}}async function Ne(e,t){let n=L.sessionId;if(!n)return;let r=k.issue();try{if(await d().agent.session.answer({sessionId:n,requestSeq:e,answers:t}),!r.isCurrent())return;for(let t of L.items)t.kind===`approval`&&t.seq===e&&(t.resolved=!0)}catch(e){if(!r.isCurrent())return;L.error=e instanceof Error?e.message:String(e)}J()}async function J(){let e=L.sessionId;if(!e)return;let t=D.issue();try{let n=await d().agent.session.stream({sessionId:e,afterSeq:L.cursor,limit:100});if(!t.isCurrent()||L.sessionId!==e)return;L.status=n.status;for(let e of n.frames)Ue(e),L.cursor=Math.max(L.cursor,e.seq);L.error=null}catch(e){if(!t.isCurrent())return;L.error=e instanceof Error?e.message:String(e),Y();return}Pe()}function Pe(){Y();let e=L.items.some(e=>e.kind===`approval`&&!e.resolved);if(L.status===`running`||e){L.sessionId;let e=L.status===`running`?450:1200;B=setTimeout(()=>{J()},e)}}function Y(){B!==null&&(clearTimeout(B),B=null)}function X(e,t,n){for(let t=L.items.length-1;t>=0;t--){let r=L.items[t];if(r.kind===`turn`)break;if(r.kind===e){r.streaming&&=(r.text=n,!1);return}}L.items.push({kind:e,seq:t,text:n,streaming:!1})}function Fe(e){let t=e?.usage;if(!t)return null;let n=t.inputTokens??t.promptTokens??t.input_tokens??0,r=t.outputTokens??t.completionTokens??t.output_tokens??0;return n>0||r>0?{inputTokens:n,outputTokens:r}:null}function Z(e,t){for(let n=L.items.length-1;n>=0;n--){let r=L.items[n];if(r.kind===`turn`)return null;if(r.kind===`tool`&&r.result===void 0){if(e!==void 0){if(r.toolCallId===e)return r;continue}if(r.toolName===t)return r}}return null}var Ie=o({isError:ee(!0).optional(),error:re([s().min(1),o()]).optional()}).passthrough();function Q(e){let t=Ie.safeParse(e);return t.success?t.data.isError===!0||t.data.error!==void 0:!1}var Le=o({attachments:a(i()).optional()}).passthrough();function Re(e){let t=Le.safeParse(e),n=t.success?t.data.attachments:void 0;if(!Array.isArray(n)||n.length===0)return null;let r=[],i=[],a=[];for(let e of n){let t=ne.safeParse(e);if(t.success){if(t.data.kind===`image`&&t.data.thumb!==void 0)r.push(t.data.thumb);else{let e=t.data.name??(t.data.kind===`image`?`image`:`file`);i.push(e),t.data.kind===`image`&&a.push(e)}}}return r.length>0||i.length>0?{images:r,files:i,imageChipNames:a}:null}var ze=o({todos:a(i())}),Be=o({content:s(),status:s()}),Ve=o({questions:a(te)}),$=o({from:l,to:l});function He(e){let t=ze.safeParse(e);if(!t.success)return null;let n=[];for(let e of t.data.todos){let t=Be.safeParse(e);t.success&&n.push(t.data)}return n}function Ue(e){switch(e.kind){case`turn-start`:L.turnStartedAt=e.at,U=new Map,L.items.push({kind:`turn`,seq:e.seq,label:`Turn`});break;case`status`:L.items.push({kind:`status`,seq:e.seq,text:JSON.stringify(e.payload??{})});break;case`auto-compact`:typeof e.text==`string`&&e.text.length>0&&L.items.push({kind:`note`,seq:e.seq,text:e.text});break;case`user-text`:if(typeof e.text==`string`&&e.text.length>0){let t=V.indexOf(e.text);if(t>=0){V.splice(t,1);break}let n=Re(e.payload);L.items.push({kind:`user`,seq:e.seq,text:e.text,...n&&n.images.length>0?{images:n.images}:{},...n&&n.files.length>0?{files:n.files}:{},...n&&n.imageChipNames.length>0?{imageChipNames:n.imageChipNames}:{}})}break;case`assistant-delta`:if(typeof e.text==`string`&&e.text.length>0){let t=L.items[L.items.length-1];t?.kind===`assistant`&&t.streaming?t.text+=e.text:L.items.push({kind:`assistant`,seq:e.seq,text:e.text,streaming:!0})}break;case`assistant-reasoning-delta`:if(typeof e.text==`string`&&e.text.length>0){let t=L.items[L.items.length-1];t?.kind===`reasoning`&&t.streaming?t.text+=e.text:L.items.push({kind:`reasoning`,seq:e.seq,text:e.text,streaming:!0})}break;case`assistant-reasoning`:typeof e.text==`string`&&e.text.length>0&&X(`reasoning`,e.seq,e.text);break;case`todo-snapshot`:{let t=He(e.payload);t!==null&&(L.todos=t);break}case`session-title`:{let t=typeof e.text==`string`?e.text.trim():``;if(t.length>0)for(let n of R.sessions)n.sessionId===e.sessionId&&(n.title=t);break}case`assistant-text`:if(typeof e.text==`string`&&e.text.length>0){X(`assistant`,e.seq,e.text);let t=Fe(e.payload);t&&(L.lastUsage=t,H=t)}break;case`tool-args-delta`:if(typeof e.text==`string`&&e.text.length>0&&e.toolCallId){let t=Z(e.toolCallId,e.toolName??``);if(t&&t.toolCallId===e.toolCallId&&t.phase===`calling`)t.argsText=(t.argsText??``)+e.text;else if(!t){let t=U.get(e.toolCallId);U.set(e.toolCallId,{...e.toolName?{name:e.toolName}:{},text:(t?.text??``)+e.text})}}break;case`tool-call`:{let t=e.toolName??`tool`,n=e.toolCallId;if(n!==void 0&&Z(n,t)!==null)break;let r=n===void 0?void 0:U.get(n);n!==void 0&&U.delete(n);let i;e.payload!==void 0&&e.payload!==null&&(i=typeof e.payload==`string`?e.payload:We(e.payload)),(i===void 0||i.length===0)&&r&&(i=r.text),L.items.push({kind:`tool`,seq:e.seq,...n===void 0?{}:{toolCallId:n},toolName:t,...i!==void 0&&i.length>0?{argsText:i}:{},phase:`calling`,startedAt:e.at});break}case`tool-result`:{let t=e.toolName??`tool`,n=Z(e.toolCallId,t);if(n){n.result=e.payload,n.phase=Q(e.payload)?`error`:`done`,n.endedAt=e.at;break}L.items.push({kind:`tool`,seq:e.seq,...e.toolCallId===void 0?{}:{toolCallId:e.toolCallId},toolName:t,result:e.payload,phase:Q(e.payload)?`error`:`done`,startedAt:e.at,endedAt:e.at});break}case`turn-end`:{let t=typeof e.text==`string`&&e.text.length>0?e.text:`completed`,n=H;H=null;let r=L.turnStartedAt,i=r===null||Number.isNaN(Date.parse(r))||Number.isNaN(Date.parse(e.at))?void 0:Math.max(0,Date.parse(e.at)-Date.parse(r));L.items.push({kind:`turn-end`,seq:e.seq,reason:t,...n?{usage:n}:{},...i===void 0?{}:{elapsedMs:i}});break}case`approval-request`:{let t=Ve.safeParse(e.payload);if(!t.success)break;L.items.push({kind:`approval`,seq:e.seq,questions:t.data.questions,resolved:!1});break}case`approval-resolved`:for(let e of L.items)e.kind===`approval`&&(e.resolved=!0);break;case`mode-changed`:{let t=$.safeParse(e.payload);if(!t.success)break;L.items.push({kind:`mode`,seq:e.seq,from:t.data.from,to:t.data.to}),L.mode=t.data.to;break}}L.items.length>500&&L.items.splice(0,L.items.length-500)}function We(e){try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}async function Ge(){let e=A.issue();z.loading=!0;try{let t=await d().agent.settings.get({});return e.isCurrent()?(z.view=t,z.error=null,{view:t,error:null}):{view:null,error:null}}catch(t){if(!e.isCurrent())return{view:null,error:null};let n=t instanceof Error?t.message:String(t);return z.error=n,{view:null,error:n}}finally{e.isCurrent()&&(z.loading=!1)}}async function Ke(e){let t=j.issue();z.updating=!0;try{let n=await d().agent.settings.update(e);return t.isCurrent()?(n.outcome===`updated`&&(z.view=n.view),n):null}catch(e){return t.isCurrent()?{outcome:`error`,message:e instanceof Error?e.message:String(e)}:null}finally{t.isCurrent()&&(z.updating=!1)}}async function qe(e){try{let t=u();return t===null?null:await t.agent.files.pickFiles({mode:e})}catch(e){return p(`File picker failed: ${e instanceof Error?e.message:String(e)}`),null}}async function Je(e,t){let n=N.issue();z.updating=!0;try{let r=await d().agent.credentials.set({provider:e,apiKey:t});return n.isCurrent()?(r.outcome===`stored`&&(z.view=r.view),r):null}catch(e){return n.isCurrent()?{outcome:`rejected`,code:`NETWORK`,detail:e instanceof Error?e.message:String(e)}:null}finally{n.isCurrent()&&(z.updating=!1)}}async function Ye(e){let t=N.issue();z.updating=!0;try{let n=await d().agent.credentials.clear({provider:e});if(!t.isCurrent())return;z.view=n}catch(e){if(!t.isCurrent())return;z.error=e instanceof Error?e.message:String(e)}finally{t.isCurrent()&&(z.updating=!1)}}async function Xe(e){let t=u();if(t===null)return null;try{return await t.agent.settings.testConnection(e)}catch(e){return{outcome:`failed`,detail:e instanceof Error?e.message:String(e)}}}var Ze=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qe(n,i){let a=e(i,Ze),o=[[`path`,{d:`M13 21h8`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}]];r(n,t({name:`pen-line`},()=>a,{get iconNode(){return o}}))}export{fe as A,w as C,he as D,g as E,ae as F,ce as M,m as N,ge as O,oe as P,Ke as S,be as T,we as _,R as a,Oe as b,Me as c,G as d,Ge as f,Je as g,je as h,L as i,ue as j,ye as k,Ee as l,ke as m,I as n,Ne as o,qe as p,z as r,K as s,Qe as t,Ye as u,Te as v,xe as w,Xe as x,Ae as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,s as t}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{t as n}from"./BkEnd9_Z.js";var r=new Set([`$$slots`,`$$events`,`$$legacy`]);function i(i,a){let o=e(a,r),s=[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}],[`path`,{d:`M20 2v4`}],[`path`,{d:`M22 4h-4`}],[`circle`,{cx:`4`,cy:`20`,r:`2`}]];n(i,t({name:`sparkles`},()=>o,{get iconNode(){return s}}))}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={};throw Error(`Could not resolve "@terrastruct/d2" imported by "markstream-svelte". Is it installed?`);export{e as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{A as e,At as t,B as n,Ct as r,D as i,F as a,G as o,Mt as s,N as c,R as l,St as u,U as d,W as f,X as p,_t as m,bt as h,ct as g,d as _,ft as v,gt as y,j as b,k as x,kt as S,lt as C,mt as w,nt as T,o as E,ot as D,rt as O,s as k,st as A,ut as j,wt as M,x as N,xt as P}from"./CmCJ0SKP.js";import{t as F}from"./JcDjicYT.js";import"./xihTtKlq.js";import{t as I}from"./CsaIfA9E.js";import"./BZ2Jwl6O.js";import{t as L}from"./BkEnd9_Z.js";import{i as R,r as z}from"./CqzSRtkf.js";import{_ as B,a as ee,b as V,l as H,s as U,t as W,x as G}from"./BoMQFGOq.js";import{c as te,l as ne,s as re}from"./Bg2k7op5.js";import{n as ie,t as ae}from"./Dl8eQ129.js";import{a as K,i as q,n as J}from"./CNPsST_i.js";import{n as oe,r as se,t as Y}from"./Ckw1quWt.js";import{n as X,r as ce,t as le}from"./CQD9uzpA.js";import{t as ue}from"./BYNWtKcf.js";import{t as de}from"./s48N5eaK.js";import{t as Z}from"./CeR4do8T.js";var fe=new Set([`$$slots`,`$$events`,`$$legacy`]);function pe(e,t){let n=E(t,fe),r=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`}],[`path`,{d:`m9 11 3 3L22 4`}]];L(e,k({name:`circle-check-big`},()=>n,{get iconNode(){return r}}))}var me=new Set([`$$slots`,`$$events`,`$$legacy`]);function he(e,t){let n=E(t,me),r=[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}],[`path`,{d:`M6.453 15h11.094`}],[`path`,{d:`M8.5 2h7`}]];L(e,k({name:`flask-conical`},()=>n,{get iconNode(){return r}}))}var ge=n(`<button><!> </button>`),_e=n(`<div class="flex shrink-0 items-center gap-1 border-b border-border px-2"></div>`);function ve(n,s){r(s,!0);let c=[{id:`file`,label:`File`,icon:oe},{id:`log`,label:`History`,icon:X},{id:`preview`,label:`Preview`,icon:le},{id:`validate`,label:`Validate`,icon:pe},{id:`test`,label:`Test`,icon:he}],d=R(),f=y(()=>d?.()?.subview??`file`);function m(e){let t=new URLSearchParams(I.url.search);t.set(`subview`,e),F(`${I.url.pathname}?${t.toString()}`)}var h=_e();e(h,21,()=>c,e=>e.id,(e,n)=>{var r=ge(),s=D(r);i(s,()=>p(n).icon,(e,t)=>{t(e,{class:`h-3.5 w-3.5`})});var c=C(s);t(r),T(()=>{N(r,1,`flex items-center gap-1.5 px-3 py-2 text-xs font-medium transition-colors ${p(f)===p(n).id?`border-b-2 border-primary text-primary`:`text-muted-foreground hover:text-foreground`}`),a(c,` ${p(n).label??``}`)}),o(`click`,r,()=>m(p(n).id)),l(e,r)}),t(h),l(n,h),u()}f([`click`]);function ye(e,t=``){return{mode:`new`,target:e,skillId:null,name:``,description:``,body:``,revision:null,extraFrontmatter:{},directoryName:t}}var be={workspaceId:G.parse(`~`),providerId:V.parse(`user`)};function xe(){return{mode:`new`,target:be,skillId:null,name:``,description:``,body:``,revision:null,extraFrontmatter:{},directoryName:``}}function Se(e,t){return{mode:`edit`,target:e,skillId:t,name:``,description:``,body:``,revision:null,extraFrontmatter:{},directoryName:``}}function Ce(e){return{...e.extraFrontmatter,name:e.name,description:e.description}}var we=Symbol(`skill-creator:creator-editor`);function Te(e){let t=j(e),n={get draft(){return t},hydrateFromDocument(e){t.skillId=e.skillId,t.name=String(e.frontmatter.name??``),t.description=String(e.frontmatter.description??``),t.body=e.body,t.revision=e.revision,t.directoryName=e.directoryName;let{name:n,description:r,...i}=e.frontmatter;t.extraFrontmatter=i},advanceRevision(e){t.revision=e}};return M(we,n),n}function Q(){if(!P(we))throw Error(`[creator-editor] useCreatorEditor 必须在 <CreatorWorkspace> 内调用`);return h(we)}function $(e,t,n){return e?`${t}:${e.workspaceId}/${e.providerId}${n===null?``:`/${n}`}`:null}var Ee=new Map,De=new Set;function Oe(e){return{...e,target:{...e.target},extraFrontmatter:{...e.extraFrontmatter}}}function ke(e,t){Ee.set(e,Oe(t))}function Ae(e){let t=Ee.get(e);return t===void 0?null:Oe(t)}function je(e){Ee.delete(e)}function Me(e){De.add(e)}function Ne(e){return De.has(e)}function Pe(e){De.delete(e)}var Fe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ie(e,t){let n=E(t,Fe),r=[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`}]];L(e,k({name:`save`},()=>n,{get iconNode(){return r}}))}var Le=new Set([`$$slots`,`$$events`,`$$legacy`]);function Re(e,t){let n=E(t,Le),r=[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}]];L(e,k({name:`rotate-cw`},()=>n,{get iconNode(){return r}}))}var ze=n(`<!> Reload`,1),Be=n(`<!> <span class="hidden sm:inline">Delete</span>`,1),Ve=n(`<!> `,1),He=n(`<div class="flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground"><!> Loading…</div>`),Ue=n(`<div class="flex flex-1 flex-col items-center justify-center gap-2 px-8 text-center"><p class="text-xs text-destructive"> </p> <!></div>`),We=n(`<span class="text-[11px] text-destructive">Use lowercase letters, numbers, and hyphens.</span>`),Ge=n(`<label class="block space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Directory name</span> <!> <!></label>`),Ke=n(`<div class="min-h-0 flex-1 space-y-3 overflow-y-auto p-4"><!> <label class="block space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Name</span> <!></label> <label class="block space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Description</span> <textarea rows="2" class="w-full resize-y rounded-md border border-input bg-input/20 px-2 py-1 text-xs leading-5 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30" placeholder="What this skill does"></textarea></label> <label class="block flex min-h-0 flex-1 flex-col space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Body (Markdown)</span> <textarea rows="16" class="w-full flex-1 resize-y rounded-md border border-input bg-input/20 px-2 py-1.5 font-mono text-xs leading-5 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30" placeholder="## When to Use
|
|
2
|
+
|
|
3
|
+
Describe when this skill should be invoked."></textarea></label></div>`),qe=n(`<div class="flex h-full flex-col"><div class="flex shrink-0 items-center justify-between border-b border-border px-4 py-2"><span class="text-xs font-medium"> </span> <div class="flex items-center gap-1.5"><!> <!> <!></div></div> <!></div> <!>`,1);function Je(e,n){r(n,!0);let i=Q(),o=i.draft,s=W(ee),f=w(!1),h=w(null),b=w(!1);O(()=>{if(o.mode!==`edit`||o.skillId===null)return;let e=$(o.target,`edit`,o.skillId);e!==null&&Ne(e)||x(o.target,o.skillId)});async function x(e,t){let n=s.issue();v(f,!0),v(h,null);try{let r=await re(e,t);if(!n.isCurrent())return;i.hydrateFromDocument(r);let a=$(e,`edit`,t);a!==null&&Me(a)}catch(e){if(!n.isCurrent())return;v(h,e instanceof Error?e.message:String(e),!0)}finally{n.isLatest()&&v(f,!1)}}function E(){if(o.mode===`edit`&&o.skillId){let e=$(o.target,`edit`,o.skillId);e!==null&&Pe(e),x(o.target,o.skillId)}}let k=y(()=>o.mode!==`new`||H.safeParse(o.directoryName).success),j=y(()=>!p(b)&&o.name.trim().length>0&&o.description.trim().length>0&&(o.mode===`edit`||p(k))&&o.revision!==null==(o.mode===`edit`));async function M(){if(o.mode===`edit`){if(o.skillId===null||o.revision===null)return;v(b,!0);try{let e=await ne({mode:`update`,workspaceId:o.target.workspaceId,providerId:o.target.providerId,skillId:o.skillId,expectedRevision:o.revision,frontmatter:Ce(o),body:o.body});i.advanceRevision(e.document.revision),J(`Saved.`)}catch(e){N(e)}finally{v(b,!1)}return}let e=H.safeParse(o.directoryName);if(!e.success){J(`Directory name must be lowercase letters, numbers, and hyphens.`);return}v(b,!0);try{let t=await ne({mode:`create`,workspaceId:o.target.workspaceId,providerId:o.target.providerId,directoryName:e.data,frontmatter:Ce(o),body:o.body});i.hydrateFromDocument(t.document);let n=$(o.target,`edit`,t.document.skillId);n!==null&&Me(n),J(`Skill created.`)}catch(e){N(e)}finally{v(b,!1)}}function N(e){if(e instanceof B&&e.code===`CONFLICT`){J(`This skill changed elsewhere. Reload to view the latest.`,{label:`Reload`,run:E});return}J(e instanceof Error?e.message:String(e))}let P=w(!1),I=w(!1),L=y(()=>o.mode===`edit`&&o.skillId!==null&&o.revision!==null);async function R(){if(!p(L)||p(I))return;let e=o.skillId,t=o.revision;if(e!==null&&t!==null){v(I,!0);try{await te({target:o.target,skillId:e,expectedRevision:t}),v(P,!1),J(`Skill deleted.`);let n=$(o.target,`edit`,e);n!==null&&(je(n),Pe(n)),await F(`/creator`)}catch(e){e instanceof B&&e.code===`CONFLICT`?(v(P,!1),J(`This skill changed elsewhere. Reload before deleting.`,{label:`Reload`,run:E})):J(e instanceof Error?e.message:String(e))}finally{v(I,!1)}}}var z=qe(),V=A(z),U=D(V),G=D(U),oe=g(G,!0),Y=C(G,2),X=D(Y),ce=e=>{K(e,{variant:`outline`,size:`sm`,class:`h-7 gap-1.5`,onclick:E,get disabled(){return p(f)},children:(e,t)=>{var n=ze();Re(A(n),{class:`h-3.5 w-3.5`}),S(),l(e,n)},$$slots:{default:!0}})};c(X,e=>{o.mode===`edit`&&o.skillId&&e(ce)});var le=C(X,2),ue=e=>{{let t=y(()=>!p(L)||p(I));K(e,{variant:`ghost`,size:`sm`,class:`h-7 gap-1.5 px-2 text-destructive hover:text-destructive`,title:`Delete this skill`,get disabled(){return p(t)},onclick:()=>v(P,!0),children:(e,t)=>{var n=Be(),r=A(n);ae(r,{class:`h-3.5 w-3.5`}),S(2),l(e,n)},$$slots:{default:!0}})}};c(le,e=>{o.mode===`edit`&&e(ue)});var de=C(le,2);{let e=y(()=>!p(j));K(de,{size:`sm`,class:`h-7 gap-1.5`,onclick:M,get disabled(){return p(e)},children:(e,t)=>{var n=Ve(),r=A(n),i=e=>{q(e,{class:`h-3.5 w-3.5 animate-spin`})},s=e=>{Ie(e,{class:`h-3.5 w-3.5`})};c(r,e=>{p(b)?e(i):e(s,-1)});var u=C(r);T(()=>a(u,` ${o.mode===`new`?`Create`:`Save`}`)),l(e,n)},$$slots:{default:!0}})}t(Y),t(U);var Z=C(U,2),fe=e=>{var n=He(),r=D(n);q(r,{class:`h-4 w-4 animate-spin`}),S(),t(n),l(e,n)},pe=e=>{var n=Ue(),r=D(n),i=g(r,!0),s=C(r,2),u=e=>{K(e,{variant:`outline`,size:`sm`,onclick:E,children:(e,t)=>{S();var n=d(`Retry`);l(e,n)},$$slots:{default:!0}})};c(s,e=>{o.mode===`edit`&&o.skillId&&e(u)}),t(n),T(()=>a(i,p(h))),l(e,n)},me=e=>{var n=Ke(),r=D(n),i=e=>{var n=Ge(),r=C(D(n),2);se(r,{class:`h-8 font-mono text-xs`,placeholder:`my-skill`,get value(){return o.directoryName},set value(e){o.directoryName=e}});var i=C(r,2),a=e=>{var t=We();l(e,t)};c(i,e=>{p(k)||e(a)}),t(n),l(e,n)};c(r,e=>{o.mode===`new`&&e(i)});var a=C(r,2),s=C(D(a),2);se(s,{class:`h-8 text-sm`,placeholder:`Skill name`,get value(){return o.name},set value(e){o.name=e}}),t(a);var u=C(a,2),d=C(D(u),2);m(d),t(u);var f=C(u,2),h=C(D(f),2);m(h),t(f),t(n),_(d,()=>o.description,e=>o.description=e),_(h,()=>o.body,e=>o.body=e),l(e,n)};c(Z,e=>{p(f)?e(fe):p(h)?e(pe,1):e(me,-1)}),t(V);var he=C(V,2);{let e=y(()=>`Delete this skill from ${o.target.providerId}? Its SKILL.md directory is removed from disk.`);ie(he,{title:`Delete skill`,get description(){return p(e)},confirmLabel:`Delete`,get busy(){return p(I)},onConfirm:()=>void R(),get open(){return p(P)},set open(e){v(P,e,!0)}})}T(()=>a(oe,o.mode===`new`?`New SKILL.md`:`SKILL.md`)),l(e,z),u()}var Ye=n(`<!> Refresh`,1),Xe=n(`<div class="flex flex-1 items-center justify-center px-8 text-center text-xs text-muted-foreground">Save the skill first to see its change history.</div>`),Ze=n(`<div class="flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground"><!> Loading history…</div>`),Qe=n(`<div class="flex flex-1 flex-col items-center justify-center gap-2 px-8 text-center"><p class="text-xs text-destructive"> </p> <!></div>`),$e=n(`<div class="flex flex-1 items-center justify-center px-8 text-center text-xs text-muted-foreground">No revisions recorded yet.</div>`),et=n(`<span class="rounded-sm bg-emerald-500/10 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-300">latest</span>`),tt=n(`<span class="text-[10px] text-muted-foreground/70">snapshot pruned</span>`),nt=n(`<div><p class="mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground">Diff vs previous</p> <pre class="overflow-x-auto rounded-md border border-border bg-muted/30 p-2 font-mono text-[10px] leading-4"> </pre></div>`),rt=n(`<div><p class="mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground">Full snapshot</p> <pre class="max-h-72 overflow-auto rounded-md border border-border bg-muted/30 p-2 font-mono text-[10px] leading-4"> </pre></div>`),it=n(`<p class="text-[10px] text-muted-foreground/70">Initial revision — no diff and no persisted snapshot.</p>`),at=n(`<div class="mt-2 space-y-2 pl-5"><!> <!> <!></div>`),ot=n(`<li class="px-4 py-3"><button type="button" class="flex w-full items-start gap-2 text-left"><!> <div class="min-w-0 flex-1"><div class="flex items-center gap-2"><span class="text-xs font-medium"> </span> <!> <!></div> <p class="mt-0.5 truncate font-mono text-[10px] text-muted-foreground"> </p></div></button> <!></li>`),st=n(`<ol class="min-h-0 flex-1 divide-y divide-border overflow-y-auto"></ol>`),ct=n(`<div class="flex h-full flex-col"><div class="flex shrink-0 items-center justify-between border-b border-border px-4 py-2"><span class="text-xs font-medium">Change history</span> <!></div> <!></div>`);function lt(n,i){r(i,!0);let s=Q().draft,f=W(ee),m=w(!1),h=w(null),_=w(j([])),b=j({});O(()=>{s.mode===`edit`&&s.skillId!==null&&x(s.skillId)});async function x(e){let t=f.issue();v(m,!0),v(h,null);try{let n=await U().creator.revisions({workspaceId:s.target.workspaceId,providerId:s.target.providerId,skillId:e});if(!t.isCurrent())return;v(_,[...n.revisions].sort((e,t)=>t.timestamp-e.timestamp),!0)}catch(e){if(!t.isCurrent())return;v(h,e instanceof Error?e.message:String(e),!0)}finally{t.isLatest()&&v(m,!1)}}function E(e){b[e]=!b[e]}function k(){s.mode===`edit`&&s.skillId&&x(s.skillId)}function M(e){try{return new Date(e).toLocaleString()}catch{return String(e)}}var N=ct(),P=D(N),F=C(D(P),2),I=e=>{K(e,{variant:`outline`,size:`sm`,class:`h-7 gap-1.5`,onclick:k,get disabled(){return p(m)},children:(e,t)=>{var n=Ye();Re(A(n),{class:`h-3.5 w-3.5`}),S(),l(e,n)},$$slots:{default:!0}})};c(F,e=>{s.mode===`edit`&&s.skillId&&e(I)}),t(P);var L=C(P,2),R=e=>{var t=Xe();l(e,t)},z=e=>{var n=Ze(),r=D(n);q(r,{class:`h-4 w-4 animate-spin`}),S(),t(n),l(e,n)},B=e=>{var n=Qe(),r=D(n),i=g(r,!0),o=C(r,2),u=e=>{K(e,{variant:`outline`,size:`sm`,onclick:k,children:(e,t)=>{S();var n=d(`Retry`);l(e,n)},$$slots:{default:!0}})};c(o,e=>{s.skillId&&e(u)}),t(n),T(()=>a(i,p(h))),l(e,n)},V=e=>{var t=$e();l(e,t)},H=n=>{var r=st();e(r,23,()=>p(_),e=>e.revision,(e,n,r)=>{var i=ot(),s=D(i),u=D(s);{let e=y(()=>b[p(n).revision]?`rotate-90`:``);ce(u,{get class(){return`mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${p(e)??``}`}})}var d=C(u,2),f=D(d),m=D(f),h=g(m,!0),_=C(m,2),v=e=>{var t=et();l(e,t)};c(_,e=>{p(r)===0&&e(v)});var x=C(_,2),S=e=>{var t=tt();l(e,t)};c(x,e=>{p(n).content===null&&e(S)}),t(f);var w=C(f,2),O=g(w);t(d),t(s);var k=C(s,2),A=e=>{var r=at(),i=D(r),o=e=>{var r=nt(),i=C(D(r),2),o=g(i,!0);t(r),T(()=>a(o,p(n).diff)),l(e,r)};c(i,e=>{p(n).diff&&e(o)});var s=C(i,2),u=e=>{var r=rt(),i=C(D(r),2),o=g(i,!0);t(r),T(()=>a(o,p(n).content)),l(e,r)};c(s,e=>{p(n).content!==null&&e(u)});var d=C(s,2),f=e=>{var t=it();l(e,t)};c(d,e=>{p(n).diff===null&&p(n).content===null&&e(f)}),t(r),l(e,r)};c(k,e=>{b[p(n).revision]&&e(A)}),t(i),T((e,t)=>{a(h,e),a(O,`${t??``}…`)},[()=>M(p(n).timestamp),()=>p(n).revision.slice(0,16)]),o(`click`,s,()=>E(p(n).revision)),l(e,i)}),t(r),l(n,r)};c(L,e=>{s.mode===`new`?e(R):p(m)?e(z,1):p(h)?e(B,2):p(_).length===0?e(V,3):e(H,-1)}),t(N),l(n,N),u()}f([`click`]);var ut=n(`<p class="text-[11px] text-muted-foreground/70">Only name and description — no additional metadata.</p>`),dt=n(`<div><dt class="bg-muted/40 px-2 py-1 text-[11px] font-medium text-muted-foreground"> </dt> <dd class="break-words px-2 py-1 text-[11px]"> </dd></div>`),ft=n(`<dl class="overflow-x-auto rounded-md border border-border"></dl>`),pt=n(`<p class="text-xs text-muted-foreground/70">Nothing to preview yet.</p>`),mt=n(`<div class="prose prose-sm max-w-none overflow-x-auto"></div>`),ht=n(`<div class="flex h-full flex-col overflow-y-auto p-4"><section class="mb-4"><h1 class="text-base font-semibold"> </h1> <p class="mt-0.5 text-xs leading-5 text-muted-foreground"> </p></section> <section class="mb-4"><h2 class="mb-2 text-[11px] font-medium text-muted-foreground">Frontmatter</h2> <!></section> <section class="min-h-0 flex-1"><h2 class="mb-2 text-[11px] font-medium text-muted-foreground">Body</h2> <!></section></div>`);function gt(n,i){r(i,!0);let o=Q().draft,d=y(()=>Ce(o)),f=y(()=>de(o.body)),m=y(()=>Object.entries(p(d)).filter(([e])=>e!==`name`&&e!==`description`));var h=ht(),_=D(h),v=D(_),b=g(v,!0),S=C(v,2),w=g(S,!0);t(_);var E=C(_,2),O=C(D(E),2),k=e=>{var t=ut();l(e,t)},A=n=>{var r=ft();e(r,23,()=>p(m),([e,t])=>e,(e,n,r)=>{var i=y(()=>s(p(n),2));let o=()=>p(i)[0],c=()=>p(i)[1];var u=dt(),d=D(u),f=g(d,!0),m=C(d,2),h=g(m,!0);t(u),T(e=>{N(u,1,`grid grid-cols-[120px_minmax(0,1fr)] ${p(r)>0?`border-t border-border`:``}`),a(f,o()),a(h,e)},[()=>c()===null?`null`:String(c())]),l(e,u)}),t(r),l(n,r)};c(O,e=>{p(m).length===0?e(k):e(A,-1)}),t(E);var j=C(E,2),M=C(D(j),2),P=e=>{var t=pt();l(e,t)},F=y(()=>o.body.trim().length===0),I=e=>{var n=mt();x(n,()=>p(f),!0),t(n),l(e,n)};c(M,e=>{p(F)?e(P):e(I,-1)}),t(j),t(h),T(()=>{a(b,o.name||`Untitled skill`),a(w,o.description||`No description yet.`)}),l(n,h),u()}var _t=n(`<!> Re-validate`,1),vt=n(`<div class="flex flex-1 items-center justify-center px-8 text-center text-xs text-muted-foreground">Save the skill first to validate it.</div>`),yt=n(`<div class="flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground"><!> Validating…</div>`),bt=n(`<div class="flex flex-1 flex-col items-center justify-center gap-2 px-8 text-center"><p class="text-xs text-destructive"> </p> <!></div>`),xt=n(`<div class="flex items-center gap-2 text-xs text-emerald-700 dark:text-emerald-300"><!> Skill passes all checks.</div>`),St=n(`<li class="flex gap-2 rounded-md bg-destructive/10 px-2 py-1.5 text-xs text-destructive"><!> <span class="break-words"> </span></li>`),Ct=n(`<section><h3 class="mb-1.5 text-[11px] font-medium uppercase tracking-wide text-destructive"> </h3> <ul class="space-y-1"></ul></section>`),wt=n(`<li class="flex gap-2 rounded-md bg-amber-500/10 px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300"><!> <span class="break-words"> </span></li>`),Tt=n(`<section><h3 class="mb-1.5 text-[11px] font-medium uppercase tracking-wide text-amber-700 dark:text-amber-300"> </h3> <ul class="space-y-1"></ul></section>`),Et=n(`<!> <!>`,1),Dt=n(`<div class="min-h-0 flex-1 space-y-3 overflow-y-auto p-4"><!></div>`),Ot=n(`<div class="flex h-full flex-col"><div class="flex shrink-0 items-center justify-between border-b border-border px-4 py-2"><span class="text-xs font-medium">Validation</span> <!></div> <!></div>`);function kt(n,i){r(i,!0);let o=Q().draft,s=W(ee),f=w(!1),m=w(null),h=w(null);O(()=>{o.mode===`edit`&&o.skillId!==null&&_(o.skillId)});async function _(e){let t=s.issue();v(f,!0),v(m,null);try{let n=await U().skills.validate({workspaceId:o.target.workspaceId,providerId:o.target.providerId,skillId:e});if(!t.isCurrent())return;v(h,n,!0)}catch(e){if(!t.isCurrent())return;v(m,e instanceof Error?e.message:String(e),!0),v(h,null)}finally{t.isLatest()&&v(f,!1)}}function y(){o.mode===`edit`&&o.skillId&&_(o.skillId)}var x=Ot(),E=D(x),k=C(D(E),2),j=e=>{K(e,{variant:`outline`,size:`sm`,class:`h-7 gap-1.5`,onclick:y,get disabled(){return p(f)},children:(e,t)=>{var n=_t(),r=A(n),i=e=>{q(e,{class:`h-3.5 w-3.5 animate-spin`})},a=e=>{Z(e,{class:`h-3.5 w-3.5`})};c(r,e=>{p(f)?e(i):e(a,-1)}),S(),l(e,n)},$$slots:{default:!0}})};c(k,e=>{o.mode===`edit`&&o.skillId&&e(j)}),t(E);var M=C(E,2),N=e=>{var t=vt();l(e,t)},P=e=>{var n=yt(),r=D(n);q(r,{class:`h-4 w-4 animate-spin`}),S(),t(n),l(e,n)},F=e=>{var n=bt(),r=D(n),i=g(r,!0),s=C(r,2),u=e=>{K(e,{variant:`outline`,size:`sm`,onclick:y,children:(e,t)=>{S();var n=d(`Retry`);l(e,n)},$$slots:{default:!0}})};c(s,e=>{o.skillId&&e(u)}),t(n),T(()=>a(i,p(m))),l(e,n)},I=n=>{var r=Dt(),i=D(r),o=e=>{var n=xt(),r=D(n);Y(r,{class:`h-4 w-4`}),S(),t(n),l(e,n)},s=n=>{var r=Et(),i=A(r),o=n=>{var r=Ct(),i=D(r),o=g(i),s=C(i,2);e(s,21,()=>p(h).errors,b,(e,n)=>{var r=St(),i=D(r);Z(i,{class:`mt-0.5 h-3.5 w-3.5 shrink-0`});var o=C(i,2),s=g(o,!0);t(r),T(()=>a(s,p(n))),l(e,r)}),t(s),t(r),T(()=>a(o,`Errors (${p(h).errors.length??``})`)),l(n,r)};c(i,e=>{p(h).errors.length>0&&e(o)});var s=C(i,2),u=n=>{var r=Tt(),i=D(r),o=g(i),s=C(i,2);e(s,21,()=>p(h).warnings,b,(e,n)=>{var r=wt(),i=D(r);Z(i,{class:`mt-0.5 h-3.5 w-3.5 shrink-0`});var o=C(i,2),s=g(o,!0);t(r),T(()=>a(s,p(n))),l(e,r)}),t(s),t(r),T(()=>a(o,`Warnings (${p(h).warnings.length??``})`)),l(n,r)};c(s,e=>{p(h).warnings.length>0&&e(u)}),l(n,r)};c(i,e=>{p(h).success&&p(h).errors.length===0&&p(h).warnings.length===0?e(o):e(s,-1)}),t(r),l(n,r)};c(M,e=>{o.mode===`new`?e(N):p(f)&&p(h)===null?e(P,1):p(m)?e(F,2):p(h)&&e(I,3)}),t(x),l(n,x),u()}var At=n(`<div class="flex flex-1 items-center justify-center p-4 text-center text-xs text-muted-foreground">Invalid workspace target.</div>`),jt=n(`<div class="flex h-full items-center justify-center p-6 text-center text-xs text-muted-foreground"><div class="space-y-1"><p class="font-medium text-foreground">Test run</p> <p>Exercising this skill inside the DSH-hosted agent session lands here.</p> <p class="text-muted-foreground/60">(Not yet implemented.)</p></div></div>`),Mt=n(`<!> <div class="min-h-0 flex-1 overflow-hidden"><!></div>`,1),Nt=n(`<div class="flex h-full flex-col overflow-hidden"><header class="flex shrink-0 items-center gap-2 border-b border-border px-4 py-2"><span class="text-sm font-medium"> </span> <span class="text-xs text-muted-foreground"> </span></header> <div class="flex min-h-0 flex-1 flex-col"><!></div></div>`);function Pt(e,n){r(n,!0);let i=z(),o=y(()=>i?.()),s=y(()=>p(o)?.mode),d=y(()=>p(o)?.wsId),f=y(()=>p(o)?.providerId),m=y(()=>p(o)?.skillId),h=R(),_=y(()=>h?.()??{}),v=y(()=>p(_).subview??`file`),b=y(()=>!p(d)||!p(f)?null:{workspaceId:p(d),providerId:p(f)}),x=y(()=>{if(!p(b))return xe();if(p(s)===`edit`&&p(m))return Se(p(b),p(m));let e=p(_).template?ue.find(e=>e.id===p(_).template):void 0,t=ye(p(b),e?e.name:``);return e&&(t.name=e.name,t.description=e.description,t.body=e.body),t}),S=Te(xe()),w=y(()=>$(p(b),p(s)===`edit`?`edit`:`new`,p(m)??null));O(()=>{let e=p(w),t=p(x),n=e===null?null:Ae(e),r=n??t;S.draft.mode=r.mode,S.draft.target=r.target,S.draft.skillId=r.skillId,S.draft.name=r.name,S.draft.description=r.description,S.draft.body=r.body,S.draft.revision=r.revision,S.draft.extraFrontmatter=r.extraFrontmatter,S.draft.directoryName=r.directoryName,n!==null&&e!==null&&Me(e)}),O(()=>()=>{let e=S.draft;if(e.target.workspaceId===`~`)return;let t=$(e.target,e.mode,e.skillId);t!==null&&ke(t,e)});var E=Nt(),k=D(E),j=D(k),M=g(j,!0),N=C(j,2),P=g(N);t(k);var F=C(k,2),I=D(F),L=e=>{var t=At();l(e,t)},B=e=>{var n=Mt(),r=A(n);ve(r,{});var i=C(r,2),a=D(i),o=e=>{Je(e,{})},s=e=>{lt(e,{})},u=e=>{gt(e,{})},d=e=>{kt(e,{})},f=e=>{var t=jt();l(e,t)},m=e=>{Je(e,{})};c(a,e=>{p(v)===`file`?e(o):p(v)===`log`?e(s,1):p(v)===`preview`?e(u,2):p(v)===`validate`?e(d,3):p(v)===`test`?e(f,4):e(m,-1)}),t(i),l(e,n)};c(I,e=>{p(b)?e(B,-1):e(L)}),t(F),t(E),T(e=>{a(M,e),a(P,`${p(d)??``} / ${p(f)??``}`)},[()=>p(s)===`new`?`New skill`:p(m)?`Edit: ${p(m).slice(0,12)}…`:`Editor`]),l(e,E),u()}export{Pt as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as e,At as t,B as n,Ct as r,F as i,G as a,K as o,N as s,R as c,St as l,W as u,X as d,ct as f,d as p,ft as m,gt as h,h as ee,lt as g,m as te,mt as _,nt as v,ot as y,p as b,rt as x,st as S,ut as ne,x as re}from"./CmCJ0SKP.js";import{t as C}from"./JcDjicYT.js";import"./xihTtKlq.js";import{t as w}from"./CsaIfA9E.js";import"./BZ2Jwl6O.js";import{a as ie,i as T,r as E}from"./CqzSRtkf.js";import{a as ae,c as D,l as oe,n as O,s as k,u as A}from"./FuwccWbx.js";import{a as j,r as se,s as ce}from"./D-Jy42mM.js";var M=[{id:`anthropics-skills`,label:`Anthropic Skills`,gitUrl:`https://github.com/anthropics/skills.git`,description:`Anthropic 官方维护的 Agent skills 集合。`,homepage:`https://github.com/anthropics/skills`},{id:`vercel-labs-skills`,label:`Vercel Labs Skills`,gitUrl:`https://github.com/vercel-labs/skills.git`,description:`Vercel Labs 维护的社区 Agent skills 集合。`,homepage:`https://github.com/vercel-labs/skills`}];function N(e){return M.find(t=>t.id===e)}var le=n(`<p class="truncate font-mono text-[11px] text-muted-foreground"> </p>`),ue=n(`<span class="shrink-0 text-[11px] text-muted-foreground"> </span>`),de=n(`<div class="flex shrink-0 items-center gap-3 border-b border-amber-500/40 bg-amber-500/10 px-4 py-2.5 text-xs" role="alert" data-testid="session-expired"><span class="min-w-0 flex-1"><span class="font-medium">Scan session expired.</span> <span class="text-muted-foreground">The pinned commit is no longer held by the daemon. Rescan this repository to continue.</span></span> <button type="button" class="h-7 shrink-0 rounded-md border border-border bg-background px-3 text-[11px] font-medium transition-colors hover:bg-muted/50 disabled:opacity-50">Rescan</button></div>`),fe=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">Scanning…</p>`),pe=n(`<div class="px-4 text-center"><button type="button" class="rounded-md border border-border px-3 py-1 text-xs hover:bg-muted/50">Retry scan</button></div>`),me=n(`<p class="px-4 py-8 text-center text-xs text-destructive"> </p> <!>`,1),he=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">No scan yet.</p>`),ge=n(`<p class="px-4 py-8 text-center text-xs text-muted-foreground">No installable skills found in this repository.</p>`),_e=n(`<button type="button" class="hover:text-foreground">Clear</button>`),ve=n(`<span class="mt-0.5 block text-[10px] text-amber-600 dark:text-amber-400"> </span>`),ye=n(`<button type="button"><input type="checkbox" class="mt-0.5 h-3.5 w-3.5" aria-label="Select skill"/> <span class="min-w-0 flex-1"><span class="block truncate text-[13px] font-medium text-foreground"> </span> <span class="mt-0.5 line-clamp-2 block text-[11px] text-muted-foreground"> </span> <!></span></button>`),be=n(`<p class="mt-2 text-xs text-muted-foreground">Loading…</p>`),xe=n(`<pre class="mt-2 max-h-48 overflow-auto rounded bg-muted/50 p-2 text-[11px] leading-4"> </pre>`),Se=n(`<p class="mt-2 text-xs text-muted-foreground">Select a skill to preview.</p>`),Ce=n(`<p class="mt-2 text-xs text-muted-foreground">No writable workspace providers. Import a directory workspace first.</p>`),we=n(`<li><label class="flex items-center gap-2 text-xs"><input type="checkbox" class="h-3.5 w-3.5"/> <span class="truncate"> </span></label></li>`),Te=n(`<ul class="mt-2 space-y-1"></ul>`),Ee=n(`<p class="mt-2 break-words text-xs text-destructive"> </p>`),De=n(`<div class="p-3 text-xs"><h2 class="font-medium text-muted-foreground">Dry-run preview</h2> <p class="mt-1"> </p></div>`),Oe=n(`<div class="flex items-center justify-between gap-2 rounded border border-border px-2 py-1"><span class="truncate"> </span> <button type="button" class="shrink-0 rounded bg-primary/10 px-2 py-0.5 text-[10px] text-primary hover:bg-primary/20">View in Workspaces</button></div>`),ke=n(`<div class="mt-2 space-y-1"></div>`),Ae=n(`<div class="p-3 text-xs"><h2 class="font-medium text-muted-foreground"> </h2> <!></div>`),je=n(`<div class="flex min-h-0 flex-1"><section class="flex w-1/2 min-w-0 flex-col border-r border-border"><header class="flex shrink-0 items-center justify-between px-3 py-2 text-xs text-muted-foreground"><span> </span> <!></header> <div class="min-h-0 flex-1 overflow-y-auto"></div></section> <section class="flex w-1/2 min-w-0 flex-col overflow-y-auto"><div class="border-b border-border p-3"><h2 class="text-xs font-medium text-muted-foreground">Preview</h2> <!></div> <div class="border-b border-border p-3"><h2 class="text-xs font-medium text-muted-foreground"> </h2> <!> <div class="mt-2 flex gap-2"><button type="button" class="h-7 rounded-md border border-border px-2 text-[11px] hover:bg-muted/50 disabled:opacity-50">Dry-run</button> <button type="button" class="h-7 rounded-md bg-primary px-3 text-[11px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50"> </button></div> <!></div> <!> <!></section></div>`),Me=n(`<div class="flex h-full flex-col overflow-hidden"><header class="flex shrink-0 items-center gap-3 border-b border-border px-4 py-3"><div class="min-w-0 flex-1"><h1 class="truncate text-sm font-semibold"> </h1> <!></div> <!> <form class="flex shrink-0 items-center gap-1"><input placeholder="branch / tag" title="Optional Git ref to scan (defaults to the repository default branch)" aria-label="Git ref for scanning" class="h-7 w-28 rounded-md border border-input bg-input/20 px-2 font-mono text-[11px] outline-none placeholder:text-muted-foreground focus-visible:border-ring"/> <button type="submit" class="h-7 rounded-md border border-border px-2 text-[11px] transition-colors hover:bg-muted/50 disabled:opacity-50"> </button></form> <button type="button" class="shrink-0 rounded-md border border-border px-2 py-1 text-[11px] hover:bg-muted/50">Discover</button></header> <!> <!></div>`);function P(n,u){r(u,!0);let M=E(),P=T(),F=h(()=>M?.()?.sourceId),Ne=h(()=>d(F)?N(d(F)):void 0),Pe=h(()=>d(F)?ce.user.find(e=>e.id===d(F)):void 0),Fe=h(()=>d(Ne)?.label??d(Pe)?.label??d(F)??`Repository`),I=h(()=>d(Ne)?.gitUrl??d(Pe)?.gitUrl),L=_(null),R=_(!1),z=_(null),B=_(null),V=_(!1),H=_(null),U=_(null),W=_(!1),G=_(null),K=_(``),Ie=h(()=>P?.()?.selected??``),q=h(()=>{let e=d(Ie).split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(e)}),Le=h(()=>P?.()?.skill),J=_(ne([]));x(()=>{j()}),x(()=>{O()});let Re=h(ae),ze=_(null);x(()=>{d(F)&&d(I)&&(d(ze)===d(F)&&d(L)||(m(ze,d(F),!0),Y(d(I))))});async function Y(e,t){m(R,!0),m(z,null),m(L,null),m(B,null),m(H,null),m(U,null),m(G,null);let n=t?.trim()||void 0,{scan:r,error:i}=await A(e,n);m(L,r,!0),m(z,i,!0),r&&d(F)&&se(d(F),{skillCount:r.skills.length,commit:r.commit}),m(R,!1)}x(()=>{if(!d(L)||!d(Le)){m(B,null);return}let e=d(Le);if(!d(L).skills.some(t=>t.id===e)){m(B,null);return}Be(d(L).sessionId,e)});async function Be(e,t){m(V,!0),m(H,null);let{preview:n,error:r}=await oe(e,t);m(B,n,!0),m(H,r,!0),m(V,!1)}function Ve(e){let t=new Set(d(q));t.has(e.id)?t.delete(e.id):t.add(e.id),He(t)}function He(e){let t=[...e].join(`,`),n=new URLSearchParams(w.url.search);t?n.set(`selected`,t):n.delete(`selected`);let r=n.toString();C(`/repository/scan/${encodeURIComponent(d(F)??``)}${r?`?${r}`:``}`,{replaceState:!0})}function Ue(e){let t=new URLSearchParams(w.url.search);t.set(`skill`,e.id),C(`/repository/scan/${encodeURIComponent(d(F)??``)}?${t.toString()}`,{replaceState:!0})}function We(e){let t=d(J).some(t=>t.workspaceId===e.workspaceId&&t.providerId===e.providerId);m(J,t?d(J).filter(t=>t.workspaceId!==e.workspaceId||t.providerId!==e.providerId):[...d(J),e],!0)}function Ge(e){return d(J).some(t=>t.workspaceId===e.workspaceId&&t.providerId===e.providerId)}let Ke=h(()=>d(L)?d(L).skills.filter(e=>d(q).has(e.id)):[]),X=h(()=>d(Ke).filter(e=>e.installable));async function qe(e){if(!d(L)||d(X).length===0||d(J).length===0)return;m(W,!0),m(G,null),m(U,null);let t=d(X).map(e=>e.id),{result:n,error:r}=await k({sessionId:d(L).sessionId,skillIds:t,targets:d(J),dryRun:e});m(U,n,!0),m(G,r,!0),m(W,!1),n&&!e&&await O()}let Je=h(()=>D(d(H))||D(d(G))),Z=h(()=>d(U)?.kind===`result`?d(U):null),Ye=h(()=>d(Z)?d(Z).results.filter(e=>e.status===`installed`||e.status===`overwritten`):[]);function Xe(e,t,n){ie(`workspaces.provider`,{wsId:e,providerId:t},{skill:n})}var Ze=Me(),Qe=y(Ze),Q=y(Qe),$e=y(Q),et=f($e,!0),tt=g($e,2),nt=e=>{var t=le(),n=f(t,!0);v(()=>i(n,d(I))),c(e,t)};s(tt,e=>{d(I)&&e(nt)}),t(Q);var rt=g(Q,2),it=e=>{var t=ue(),n=f(t);v(e=>i(n,`${d(L).skills.length??``} skills · commit ${e??``}`),[()=>d(L).commit.slice(0,12)]),c(e,t)};s(rt,e=>{d(L)&&e(it)});var $=g(rt,2),at=y($);b(at);var ot=g(at,2),st=f(ot,!0);t($);var ct=g($,2);t(Qe);var lt=g(Qe,2),ut=e=>{var n=de(),r=g(y(n),2);t(n),v(()=>r.disabled=d(R)||!d(I)),a(`click`,r,()=>d(I)&&void Y(d(I),d(K))),c(e,n)};s(lt,e=>{d(Je)&&e(ut)});var dt=g(lt,2),ft=e=>{var t=fe();c(e,t)},pt=e=>{var t=me(),n=S(t),r=f(n,!0),o=g(n,2),l=e=>{var t=pe(),n=f(t);a(`click`,n,()=>Y(d(I))),c(e,t)};s(o,e=>{d(I)&&e(l)}),v(()=>i(r,d(z).message)),c(e,t)},mt=e=>{var t=he();c(e,t)},ht=e=>{var t=ge();c(e,t)},gt=n=>{var r=je(),o=y(r),l=y(o),u=y(l),p=f(u),m=g(u,2),h=e=>{var t=_e();a(`click`,t,()=>He(new Set)),c(e,t)};s(m,e=>{d(q).size>0&&e(h)}),t(l);var _=g(l,2);e(_,21,()=>d(L).skills,e=>e.id,(e,n)=>{var r=ye(),o=y(r);b(o);var l=g(o,2),u=y(l),p=f(u,!0),m=g(u,2),h=f(m,!0),_=g(m,2),x=e=>{var t=ve(),r=f(t,!0);v(e=>i(r,e),[()=>d(n).issues.join(` `)||`Not installable`]),c(e,t)};s(_,e=>{d(n).installable||e(x)}),t(l),t(r),v((e,t,a)=>{re(r,1,`flex w-full items-start gap-2 border-b border-border/70 px-3 py-2 text-left transition-colors ${e??``}`),te(r,`aria-pressed`,t),ee(o,a),i(p,d(n).name),i(h,d(n).description||`No description`)},[()=>d(q).has(d(n).id)?`bg-accent`:`hover:bg-accent/60`,()=>d(q).has(d(n).id),()=>d(q).has(d(n).id)]),a(`click`,r,()=>Ue(d(n))),a(`click`,o,e=>{e.stopPropagation(),Ve(d(n))}),c(e,r)}),t(_),t(o);var x=g(o,2),S=y(x),ne=g(y(S),2),C=e=>{var t=be();c(e,t)},w=e=>{var t=xe(),n=f(t,!0);v(()=>i(n,d(B).content)),c(e,t)},ie=e=>{var t=Se();c(e,t)};s(ne,e=>{d(V)?e(C):d(B)?e(w,1):e(ie,-1)}),t(S);var T=g(S,2),E=y(T),ae=f(E),D=g(E,2),oe=e=>{var t=Ce();c(e,t)},O=n=>{var r=Te();e(r,21,()=>d(Re),e=>e.target.workspaceId+`:`+e.target.providerId,(e,n)=>{var r=we(),o=y(r),s=y(o);b(s);var l=g(s,2),u=f(l,!0);t(o),t(r),v(e=>{ee(s,e),i(u,d(n).label)},[()=>Ge(d(n).target)]),a(`change`,s,()=>We(d(n).target)),c(e,r)}),t(r),c(n,r)};s(D,e=>{d(Re).length===0?e(oe):e(O,-1)});var k=g(D,2),A=y(k),j=g(A,2),se=f(j,!0);t(k);var ce=g(k,2),M=e=>{var t=Ee(),n=f(t,!0);v(()=>i(n,d(G).message)),c(e,t)};s(ce,e=>{d(G)&&!d(Je)&&e(M)}),t(T);var N=g(T,2),le=e=>{var n=De(),r=g(y(n),2),a=f(r);t(n),v(()=>i(a,`${d(U).totalInstalls??``} install(s) planned across ${d(U).destinations.length??``} destination(s).`)),c(e,n)};s(N,e=>{d(U)?.kind===`preview`&&e(le)});var ue=g(N,2),de=n=>{var r=Ae(),o=y(r),l=f(o),u=g(o,2),p=n=>{var r=ke();e(r,21,()=>d(Ye),e=>e.target.workspaceId+`:`+e.target.providerId+`:`+e.skillId,(e,n)=>{var r=Oe(),o=y(r),s=f(o),l=g(o,2);t(r),v(()=>i(s,`${d(n).skill??``} → ${d(n).target.workspaceId??``}/${d(n).target.providerId??``}`)),a(`click`,l,()=>Xe(d(n).target.workspaceId,d(n).target.providerId,d(n).skillId)),c(e,r)}),t(r),c(n,r)};s(u,e=>{d(Ye).length>0&&e(p)}),t(r),v(()=>i(l,`Installed ${d(Z).installed??``} · overwritten ${d(Z).overwritten??``} · skipped
|
|
2
|
+
${d(Z).skipped??``} · failed ${d(Z).failed??``}`)),c(n,r)};s(ue,e=>{d(Z)&&e(de)}),t(x),t(r),v(()=>{i(p,`${d(q).size??``} selected`),i(ae,`Install targets (${d(J).length??``})`),A.disabled=d(W)||d(X).length===0||d(J).length===0,j.disabled=d(W)||d(X).length===0||d(J).length===0,i(se,d(W)?`Installing…`:`Install`)}),a(`click`,A,()=>qe(!0)),a(`click`,j,()=>qe(!1)),c(n,r)};s(dt,e=>{d(R)?e(ft):d(z)?e(pt,1):d(L)?d(L).skills.length===0?e(ht,3):e(gt,-1):e(mt,2)}),t(Ze),v(()=>{i(et,d(Fe)),ot.disabled=d(R)||!d(I),i(st,d(R)?`Scanning…`:`Rescan`)}),o(`submit`,$,e=>{e.preventDefault(),d(I)&&Y(d(I),d(K))}),p(at,()=>d(K),e=>m(K,e)),a(`click`,ct,()=>C(`/repository`)),c(n,Ze),l()}u([`click`,`change`]);export{P as default};
|