@puddle-code/cli 0.4.13 → 0.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +2 -16
  2. package/dist/index.js +5 -3
  3. package/dist/public/assets/App-Dlrlhlup.js +9 -0
  4. package/dist/public/assets/{Dashboard-DyNOxwSR.js → Dashboard-B2o7orBK.js} +1 -1
  5. package/dist/public/assets/{LazyTerminal-BjT3haSN.js → LazyTerminal-D4QV7VEc.js} +2 -2
  6. package/dist/public/assets/{NotebookWidget-CPhHup1W.js → NotebookWidget-CH5zoEVV.js} +1 -1
  7. package/dist/public/assets/{PaneEditorBody-DCGP8CyB.js → PaneEditorBody-DESTR4r3.js} +7 -7
  8. package/dist/public/assets/{ReleaseNotesDialog-BD0uYU6B.js → ReleaseNotesDialog-jEU0I1rq.js} +1 -1
  9. package/dist/public/assets/Ripple-BM7RYwkx.css +1 -0
  10. package/dist/public/assets/Ripple-DxqgViCr.js +12 -0
  11. package/dist/public/assets/SettingsDialog-BcWnMD7A.js +8 -0
  12. package/dist/public/assets/Terminal-Gq862tY-.js +65 -0
  13. package/dist/public/assets/{Workspace-CjOdyZwS.js → Workspace-DVji-hSU.js} +6 -6
  14. package/dist/public/assets/{_virtual_notebook-widget-runtime-BDEYw1H-.js → _virtual_notebook-widget-runtime-RX_hqyhn.js} +1 -1
  15. package/dist/public/assets/{expanding-content-xApnlOBO.js → expanding-content-CKyt4o9s.js} +1 -1
  16. package/dist/public/assets/forward-link-BfAPpjGN.js +1 -0
  17. package/dist/public/assets/{index-MjsHIzAR.js → index-Cg9SFK_d.js} +2 -2
  18. package/dist/public/assets/{index-BfQvnKtf.css → index-D_XpA70m.css} +1 -1
  19. package/dist/public/assets/{markdown-BaCjN652.js → markdown-Cseepnv3.js} +1 -1
  20. package/dist/public/assets/notification-delivery-B-zt57w8.js +1 -0
  21. package/dist/public/assets/preferences-xuDDL7Pm.js +1 -0
  22. package/dist/public/assets/render-rich-content-DAJtX81B.js +4 -0
  23. package/dist/public/assets/selection-actions-DMOj1EOB.js +1 -0
  24. package/dist/public/assets/use-ui-state-TZnzSo9V.js +1 -0
  25. package/dist/public/assets/ws-DjQ6OZLM.js +1 -0
  26. package/dist/public/index.html +2 -2
  27. package/package.json +1 -1
  28. package/dist/public/assets/App-BOGDHWlW.js +0 -23
  29. package/dist/public/assets/Ripple-B-wG6_Xj.js +0 -7
  30. package/dist/public/assets/Ripple-V2kU3kad.css +0 -1
  31. package/dist/public/assets/SettingsDialog-DwWcTOGl.js +0 -8
  32. package/dist/public/assets/Terminal-DzImIFH4.js +0 -65
  33. package/dist/public/assets/desktop-Bl69_YmL.js +0 -1
  34. package/dist/public/assets/forward-link-CAXhnLYS.js +0 -1
  35. package/dist/public/assets/link-buffer-DcFk9vqt.js +0 -1
  36. package/dist/public/assets/notification-delivery-14yN_sWJ.js +0 -1
  37. package/dist/public/assets/preferences-DC7PJ3Go.js +0 -1
  38. package/dist/public/assets/render-rich-content-Dvum-lQy.js +0 -4
  39. package/dist/public/assets/use-ui-state-CyfRHVgg.js +0 -1
  40. package/dist/public/assets/ws-CS9chtfK.js +0 -1
@@ -6960,7 +6960,7 @@ l0,-\`+(t+144)+\`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
6960
6960
  \`}function I1e(){return\`</ol>
6961
6961
  </section>
6962
6962
  \`}function D1e(i,e,t,r,n){let s=n.rules.footnote_anchor_name(i,e,t,r,n);return i[e].meta.subId>0&&(s+=\`:\${i[e].meta.subId}\`),\`<li id="fn\${s}" class="footnote-item">\`}function M1e(){return\`</li>
6963
- \`}function R1e(i,e,t,r,n){let s=n.rules.footnote_anchor_name(i,e,t,r,n);return i[e].meta.subId>0&&(s+=\`:\${i[e].meta.subId}\`),\` <a href="#fnref\${s}" class="footnote-backref">\\u21A9\\uFE0E</a>\`}function aS(i){let e=i.helpers.parseLinkLabel,t=i.utils.isSpace;i.renderer.rules.footnote_ref=k1e,i.renderer.rules.footnote_block_open=T1e,i.renderer.rules.footnote_block_close=I1e,i.renderer.rules.footnote_open=D1e,i.renderer.rules.footnote_close=M1e,i.renderer.rules.footnote_anchor=R1e,i.renderer.rules.footnote_caption=S1e,i.renderer.rules.footnote_anchor_name=_1e;function r(o,l,u,d){let c=o.bMarks[l]+o.tShift[l],m=o.eMarks[l];if(c+4>m||o.src.charCodeAt(c)!==91||o.src.charCodeAt(c+1)!==94)return!1;let f;for(f=c+2;f<m;f++){if(o.src.charCodeAt(f)===32)return!1;if(o.src.charCodeAt(f)===93)break}if(f===c+2||f+1>=m||o.src.charCodeAt(++f)!==58)return!1;if(d)return!0;f++,o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.refs||(o.env.footnotes.refs={});let b=o.src.slice(c+2,f-2);o.env.footnotes.refs[\`:\${b}\`]=-1;let w=new o.Token("footnote_reference_open","",1);w.meta={label:b},w.level=o.level++,o.tokens.push(w);let A=o.bMarks[l],M=o.tShift[l],j=o.sCount[l],k=o.parentType,T=f,L=o.sCount[l]+f-(o.bMarks[l]+o.tShift[l]),v=L;for(;f<m;){let V=o.src.charCodeAt(f);if(t(V))V===9?v+=4-v%4:v++;else break;f++}o.tShift[l]=f-T,o.sCount[l]=v-L,o.bMarks[l]=T,o.blkIndent+=4,o.parentType="footnote",o.sCount[l]<o.blkIndent&&(o.sCount[l]+=o.blkIndent),o.md.block.tokenize(o,l,u,!0),o.parentType=k,o.blkIndent-=4,o.tShift[l]=M,o.sCount[l]=j,o.bMarks[l]=A;let X=new o.Token("footnote_reference_close","",-1);return X.level=--o.level,o.tokens.push(X),!0}function n(o,l){let u=o.posMax,d=o.pos;if(d+2>=u||o.src.charCodeAt(d)!==94||o.src.charCodeAt(d+1)!==91)return!1;let c=d+2,m=e(o,d+1);if(m<0)return!1;if(!l){o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.list||(o.env.footnotes.list=[]);let f=o.env.footnotes.list.length,b=[];o.md.inline.parse(o.src.slice(c,m),o.md,o.env,b);let w=o.push("footnote_ref","",0);w.meta={id:f},o.env.footnotes.list[f]={content:o.src.slice(c,m),tokens:b}}return o.pos=m+1,o.posMax=u,!0}function s(o,l){let u=o.posMax,d=o.pos;if(d+3>u||!o.env.footnotes||!o.env.footnotes.refs||o.src.charCodeAt(d)!==91||o.src.charCodeAt(d+1)!==94)return!1;let c;for(c=d+2;c<u;c++){if(o.src.charCodeAt(c)===32||o.src.charCodeAt(c)===10)return!1;if(o.src.charCodeAt(c)===93)break}if(c===d+2||c>=u)return!1;c++;let m=o.src.slice(d+2,c-1);if(typeof o.env.footnotes.refs[\`:\${m}\`]>"u")return!1;if(!l){o.env.footnotes.list||(o.env.footnotes.list=[]);let f;o.env.footnotes.refs[\`:\${m}\`]<0?(f=o.env.footnotes.list.length,o.env.footnotes.list[f]={label:m,count:0},o.env.footnotes.refs[\`:\${m}\`]=f):f=o.env.footnotes.refs[\`:\${m}\`];let b=o.env.footnotes.list[f].count;o.env.footnotes.list[f].count++;let w=o.push("footnote_ref","",0);w.meta={id:f,subId:b,label:m}}return o.pos=c,o.posMax=u,!0}function a(o){let l,u,d,c=!1,m={};if(!o.env.footnotes||(o.tokens=o.tokens.filter(function(b){return b.type==="footnote_reference_open"?(c=!0,u=[],d=b.meta.label,!1):b.type==="footnote_reference_close"?(c=!1,m[":"+d]=u,!1):(c&&u.push(b),!c)}),!o.env.footnotes.list))return;let f=o.env.footnotes.list;o.tokens.push(new o.Token("footnote_block_open","",1));for(let b=0,w=f.length;b<w;b++){let A=new o.Token("footnote_open","",1);if(A.meta={id:b,label:f[b].label},o.tokens.push(A),f[b].tokens){l=[];let k=new o.Token("paragraph_open","p",1);k.block=!0,l.push(k);let T=new o.Token("inline","",0);T.children=f[b].tokens,T.content=f[b].content,l.push(T);let L=new o.Token("paragraph_close","p",-1);L.block=!0,l.push(L)}else f[b].label&&(l=m[\`:\${f[b].label}\`]);l&&(o.tokens=o.tokens.concat(l));let M;o.tokens[o.tokens.length-1].type==="paragraph_close"?M=o.tokens.pop():M=null;let j=f[b].count>0?f[b].count:1;for(let k=0;k<j;k++){let T=new o.Token("footnote_anchor","",0);T.meta={id:b,subId:k,label:f[b].label},o.tokens.push(T)}M&&o.tokens.push(M),o.tokens.push(new o.Token("footnote_close","",-1))}o.tokens.push(new o.Token("footnote_block_close","",-1))}i.block.ruler.before("reference","footnote_def",r,{alt:["paragraph","reference"]}),i.inline.ruler.after("image","footnote_inline",n),i.inline.ruler.after("footnote_inline","footnote_ref",s),i.core.ruler.after("inline","footnote_tail",a)}var O1e={note:'<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>',tip:'<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>',important:'<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>',warning:'<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>',caution:'<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'},GV=(i,e={})=>{let{markers:t=["TIP","NOTE","IMPORTANT","WARNING","CAUTION"],icons:r=O1e,matchCaseSensitive:n=!1,titles:s={},classPrefix:a="markdown-alert"}=e,o=t==="*"?"\\\\w+":t.join("|"),l=new RegExp(\`^\\\\\\\\?\\\\[\\\\!(\${o})\\\\]([^\\\\n\\\\r]*)\`,n?"":"i");i.core.ruler.after("block","github-alerts",u=>{let d=u.tokens;for(let c=0;c<d.length;c++)if(d[c].type==="blockquote_open"){let m=d[c],f=c;for(;d[c]?.type!=="blockquote_close"&&c<=d.length;)c+=1;let b=d[c],w=c,A=d.slice(f,w+1).find(L=>L.type==="inline");if(!A)continue;let M=A.content.match(l);if(!M)continue;let j=M[1].toLowerCase(),k=M[2].trim()||(s[j]??B1e(j)),T=r[j]??"";A.content=A.content.slice(M[0].length).trimStart(),m.type="alert_open",m.tag="div",m.meta={title:k,type:j,icon:T},b.type="alert_close",b.tag="div"}}),i.renderer.rules.alert_open=function(u,d){let{title:c,type:m,icon:f}=u[d].meta;return\`<div class="\${a} \${a}-\${m}"><p class="\${a}-title">\${f}\${c}</p>\`}};function B1e(i){return i.charAt(0).toUpperCase()+i.slice(1)}function oS(i){function e(r,n){let s=r.pos,a=r.src.charCodeAt(s);if(n||a!==61)return!1;let o=r.scanDelims(r.pos,!0),l=o.length,u=String.fromCharCode(a);if(l<2)return!1;if(l%2){let d=r.push("text","",0);d.content=u,l--}for(let d=0;d<l;d+=2){let c=r.push("text","",0);c.content=u+u,!(!o.can_open&&!o.can_close)&&r.delimiters.push({marker:a,length:0,jump:d/2,token:r.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return r.pos+=o.length,!0}function t(r,n){let s=[],a=n.length;for(let o=0;o<a;o++){let l=n[o];if(l.marker!==61||l.end===-1)continue;let u=n[l.end],d=r.tokens[l.token];d.type="mark_open",d.tag="mark",d.nesting=1,d.markup="==",d.content="";let c=r.tokens[u.token];c.type="mark_close",c.tag="mark",c.nesting=-1,c.markup="==",c.content="",r.tokens[u.token-1].type==="text"&&r.tokens[u.token-1].content==="="&&s.push(u.token-1)}for(;s.length;){let o=s.pop(),l=o+1;for(;l<r.tokens.length&&r.tokens[l].type==="mark_close";)l++;if(l--,o!==l){let u=r.tokens[l];r.tokens[l]=r.tokens[o],r.tokens[o]=u}}}i.inline.ruler.before("emphasis","mark",e),i.inline.ruler2.before("emphasis","mark",function(r){let n,s=r.tokens_meta,a=(r.tokens_meta||[]).length;for(t(r,r.delimiters),n=0;n<a;n++)s[n]&&s[n].delimiters&&t(r,s[n].delimiters)})}function j1e(i,e){if(e||i.src.charCodeAt(i.pos)!==126)return!1;let t=i.scanDelims(i.pos,!0),r=i.push("text","",0);return r.content="~".repeat(t.length),i.pos+=t.length,t.length>2||i.delimiters.push({marker:t.length===1?65662:126,length:0,token:i.tokens.length-1,end:-1,open:t.can_open,close:t.can_close}),!0}function VV(i,e){for(let t of e){if(t.marker!==126&&t.marker!==65662||t.end===-1)continue;let r=e[t.end];if(!r)continue;let n=t.marker===126?"~~":"~",s=i.tokens[t.token],a=i.tokens[r.token];!s||!a||(s.type="s_open",s.tag="s",s.nesting=1,s.markup=n,s.content="",a.type="s_close",a.tag="s",a.nesting=-1,a.markup=n,a.content="")}}function z1e(i){VV(i,i.delimiters);for(let e of i.tokens_meta)e?.delimiters&&VV(i,e.delimiters)}function KV(i){i.inline.ruler.at("strikethrough",j1e),i.inline.ruler2.at("strikethrough",z1e)}var YV="data-puddle-source-line",QV="data-puddle-source-end-line";function JV(i){return i&&"mathMacros"in i?i:{mathMacros:{}}}function L1e(i,e){let t=vw(i.src,i.pos);if(!t||i.pos+t.length>i.posMax)return!1;if(!e){let r=i.push("math","",0);r.content=t.tex,r.meta={display:t.display}}return i.pos+=t.length,!0}function P1e(i){return typeof i.meta=="object"&&i.meta!==null&&"display"in i.meta&&i.meta.display===!0}function N1e(i=!1){let e=new WV({breaks:i,html:!i,linkify:!0,typographer:!1});i&&(e.disable("image"),e.validateLink=a=>/^https?:\\/\\//i.test(a)),e.use(aS),e.inline.ruler.disable("footnote_inline"),e.renderer.rules.footnote_caption=(a,o)=>{let l=a[o]?.meta?.id;return String((typeof l=="number"?l:0)+1)};let t=e.renderer.rules.footnote_ref;e.renderer.rules.footnote_ref=(a,o,l,u,d)=>(t?.(a,o,l,u,d)??"").replace("<a ","<a data-footnote-ref ");let r=e.renderer.rules.footnote_anchor;e.renderer.rules.footnote_anchor=(a,o,l,u,d)=>{let c=a[o],m=c?.meta?.id,f=c?.meta?.subId,b=(typeof m=="number"?m:0)+1,w=(typeof f=="number"?f:0)+1;return(r?.(a,o,l,u,d)??"").replace("<a ",\`<a data-footnote-backref data-footnote-backref-idx="\${w}" aria-label="Back to reference \${b}" \`)},e.use(GV,{matchCaseSensitive:!0}),e.use(oS),KV(e),e.inline.ruler.before("escape","puddle_math",L1e),e.renderer.rules.math=(a,o,l,u)=>{let d=a[o];return Rm(d.content,P1e(d),JV(u).mathMacros)};let n=e.renderer.rules.fence;e.renderer.rules.fence=(a,o,l,u,d)=>{let c=a[o],m=c.info.trim().split(/\\s+/)[0]?.toLowerCase();return m==="mermaid"?(c.attrJoin("class","mermaid-diagram"),c.attrSet("data-puddle-mermaid",""),\`<div\${d.renderAttrs(c)}><pre><code>\${e.utils.escapeHtml(c.content)}</code></pre></div>
6963
+ \`}function R1e(i,e,t,r,n){let s=n.rules.footnote_anchor_name(i,e,t,r,n);return i[e].meta.subId>0&&(s+=\`:\${i[e].meta.subId}\`),\` <a href="#fnref\${s}" class="footnote-backref">\\u21A9\\uFE0E</a>\`}function aS(i){let e=i.helpers.parseLinkLabel,t=i.utils.isSpace;i.renderer.rules.footnote_ref=k1e,i.renderer.rules.footnote_block_open=T1e,i.renderer.rules.footnote_block_close=I1e,i.renderer.rules.footnote_open=D1e,i.renderer.rules.footnote_close=M1e,i.renderer.rules.footnote_anchor=R1e,i.renderer.rules.footnote_caption=S1e,i.renderer.rules.footnote_anchor_name=_1e;function r(o,l,u,d){let c=o.bMarks[l]+o.tShift[l],m=o.eMarks[l];if(c+4>m||o.src.charCodeAt(c)!==91||o.src.charCodeAt(c+1)!==94)return!1;let f;for(f=c+2;f<m;f++){if(o.src.charCodeAt(f)===32)return!1;if(o.src.charCodeAt(f)===93)break}if(f===c+2||f+1>=m||o.src.charCodeAt(++f)!==58)return!1;if(d)return!0;f++,o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.refs||(o.env.footnotes.refs={});let b=o.src.slice(c+2,f-2);o.env.footnotes.refs[\`:\${b}\`]=-1;let w=new o.Token("footnote_reference_open","",1);w.meta={label:b},w.level=o.level++,o.tokens.push(w);let A=o.bMarks[l],M=o.tShift[l],j=o.sCount[l],k=o.parentType,T=f,L=o.sCount[l]+f-(o.bMarks[l]+o.tShift[l]),v=L;for(;f<m;){let V=o.src.charCodeAt(f);if(t(V))V===9?v+=4-v%4:v++;else break;f++}o.tShift[l]=f-T,o.sCount[l]=v-L,o.bMarks[l]=T,o.blkIndent+=4,o.parentType="footnote",o.sCount[l]<o.blkIndent&&(o.sCount[l]+=o.blkIndent),o.md.block.tokenize(o,l,u,!0),o.parentType=k,o.blkIndent-=4,o.tShift[l]=M,o.sCount[l]=j,o.bMarks[l]=A;let X=new o.Token("footnote_reference_close","",-1);return X.level=--o.level,o.tokens.push(X),!0}function n(o,l){let u=o.posMax,d=o.pos;if(d+2>=u||o.src.charCodeAt(d)!==94||o.src.charCodeAt(d+1)!==91)return!1;let c=d+2,m=e(o,d+1);if(m<0)return!1;if(!l){o.env.footnotes||(o.env.footnotes={}),o.env.footnotes.list||(o.env.footnotes.list=[]);let f=o.env.footnotes.list.length,b=[];o.md.inline.parse(o.src.slice(c,m),o.md,o.env,b);let w=o.push("footnote_ref","",0);w.meta={id:f},o.env.footnotes.list[f]={content:o.src.slice(c,m),tokens:b}}return o.pos=m+1,o.posMax=u,!0}function s(o,l){let u=o.posMax,d=o.pos;if(d+3>u||!o.env.footnotes||!o.env.footnotes.refs||o.src.charCodeAt(d)!==91||o.src.charCodeAt(d+1)!==94)return!1;let c;for(c=d+2;c<u;c++){if(o.src.charCodeAt(c)===32||o.src.charCodeAt(c)===10)return!1;if(o.src.charCodeAt(c)===93)break}if(c===d+2||c>=u)return!1;c++;let m=o.src.slice(d+2,c-1);if(typeof o.env.footnotes.refs[\`:\${m}\`]>"u")return!1;if(!l){o.env.footnotes.list||(o.env.footnotes.list=[]);let f;o.env.footnotes.refs[\`:\${m}\`]<0?(f=o.env.footnotes.list.length,o.env.footnotes.list[f]={label:m,count:0},o.env.footnotes.refs[\`:\${m}\`]=f):f=o.env.footnotes.refs[\`:\${m}\`];let b=o.env.footnotes.list[f].count;o.env.footnotes.list[f].count++;let w=o.push("footnote_ref","",0);w.meta={id:f,subId:b,label:m}}return o.pos=c,o.posMax=u,!0}function a(o){let l,u,d,c=!1,m={};if(!o.env.footnotes||(o.tokens=o.tokens.filter(function(b){return b.type==="footnote_reference_open"?(c=!0,u=[],d=b.meta.label,!1):b.type==="footnote_reference_close"?(c=!1,m[":"+d]=u,!1):(c&&u.push(b),!c)}),!o.env.footnotes.list))return;let f=o.env.footnotes.list;o.tokens.push(new o.Token("footnote_block_open","",1));for(let b=0,w=f.length;b<w;b++){let A=new o.Token("footnote_open","",1);if(A.meta={id:b,label:f[b].label},o.tokens.push(A),f[b].tokens){l=[];let k=new o.Token("paragraph_open","p",1);k.block=!0,l.push(k);let T=new o.Token("inline","",0);T.children=f[b].tokens,T.content=f[b].content,l.push(T);let L=new o.Token("paragraph_close","p",-1);L.block=!0,l.push(L)}else f[b].label&&(l=m[\`:\${f[b].label}\`]);l&&(o.tokens=o.tokens.concat(l));let M;o.tokens[o.tokens.length-1].type==="paragraph_close"?M=o.tokens.pop():M=null;let j=f[b].count>0?f[b].count:1;for(let k=0;k<j;k++){let T=new o.Token("footnote_anchor","",0);T.meta={id:b,subId:k,label:f[b].label},o.tokens.push(T)}M&&o.tokens.push(M),o.tokens.push(new o.Token("footnote_close","",-1))}o.tokens.push(new o.Token("footnote_block_close","",-1))}i.block.ruler.before("reference","footnote_def",r,{alt:["paragraph","reference"]}),i.inline.ruler.after("image","footnote_inline",n),i.inline.ruler.after("footnote_inline","footnote_ref",s),i.core.ruler.after("inline","footnote_tail",a)}var O1e={note:'<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>',tip:'<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>',important:'<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>',warning:'<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>',caution:'<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>'},GV=(i,e={})=>{let{markers:t=["TIP","NOTE","IMPORTANT","WARNING","CAUTION"],icons:r=O1e,matchCaseSensitive:n=!1,titles:s={},classPrefix:a="markdown-alert"}=e,o=t==="*"?"\\\\w+":t.join("|"),l=new RegExp(\`^\\\\\\\\?\\\\[\\\\!(\${o})\\\\]([^\\\\n\\\\r]*)\`,n?"":"i");i.core.ruler.after("block","github-alerts",u=>{let d=u.tokens;for(let c=0;c<d.length;c++)if(d[c].type==="blockquote_open"){let m=d[c],f=c;for(;d[c]?.type!=="blockquote_close"&&c<=d.length;)c+=1;let b=d[c],w=c,A=d.slice(f,w+1).find(L=>L.type==="inline");if(!A)continue;let M=A.content.match(l);if(!M)continue;let j=M[1].toLowerCase(),k=M[2].trim()||(s[j]??B1e(j)),T=r[j]??"";A.content=A.content.slice(M[0].length).trimStart(),m.type="alert_open",m.tag="div",m.meta={title:k,type:j,icon:T},b.type="alert_close",b.tag="div"}}),i.renderer.rules.alert_open=function(u,d){let{title:c,type:m,icon:f}=u[d].meta;return\`<div class="\${a} \${a}-\${m}"><p class="\${a}-title">\${f}\${c}</p>\`}};function B1e(i){return i.charAt(0).toUpperCase()+i.slice(1)}function oS(i){function e(r,n){let s=r.pos,a=r.src.charCodeAt(s);if(n||a!==61)return!1;let o=r.scanDelims(r.pos,!0),l=o.length,u=String.fromCharCode(a);if(l<2)return!1;if(l%2){let d=r.push("text","",0);d.content=u,l--}for(let d=0;d<l;d+=2){let c=r.push("text","",0);c.content=u+u,!(!o.can_open&&!o.can_close)&&r.delimiters.push({marker:a,length:0,jump:d/2,token:r.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return r.pos+=o.length,!0}function t(r,n){let s=[],a=n.length;for(let o=0;o<a;o++){let l=n[o];if(l.marker!==61||l.end===-1)continue;let u=n[l.end],d=r.tokens[l.token];d.type="mark_open",d.tag="mark",d.nesting=1,d.markup="==",d.content="";let c=r.tokens[u.token];c.type="mark_close",c.tag="mark",c.nesting=-1,c.markup="==",c.content="",r.tokens[u.token-1].type==="text"&&r.tokens[u.token-1].content==="="&&s.push(u.token-1)}for(;s.length;){let o=s.pop(),l=o+1;for(;l<r.tokens.length&&r.tokens[l].type==="mark_close";)l++;if(l--,o!==l){let u=r.tokens[l];r.tokens[l]=r.tokens[o],r.tokens[o]=u}}}i.inline.ruler.before("emphasis","mark",e),i.inline.ruler2.before("emphasis","mark",function(r){let n,s=r.tokens_meta,a=(r.tokens_meta||[]).length;for(t(r,r.delimiters),n=0;n<a;n++)s[n]&&s[n].delimiters&&t(r,s[n].delimiters)})}function j1e(i,e){if(e||i.src.charCodeAt(i.pos)!==126)return!1;let t=i.scanDelims(i.pos,!0),r=i.push("text","",0);return r.content="~".repeat(t.length),i.pos+=t.length,t.length>2||i.delimiters.push({marker:t.length===1?65662:126,length:0,token:i.tokens.length-1,end:-1,open:t.can_open,close:t.can_close}),!0}function VV(i,e){for(let t of e){if(t.marker!==126&&t.marker!==65662||t.end===-1)continue;let r=e[t.end];if(!r)continue;let n=t.marker===126?"~~":"~",s=i.tokens[t.token],a=i.tokens[r.token];!s||!a||(s.type="s_open",s.tag="s",s.nesting=1,s.markup=n,s.content="",a.type="s_close",a.tag="s",a.nesting=-1,a.markup=n,a.content="")}}function z1e(i){VV(i,i.delimiters);for(let e of i.tokens_meta)e?.delimiters&&VV(i,e.delimiters)}function KV(i){i.inline.ruler.at("strikethrough",j1e),i.inline.ruler2.at("strikethrough",z1e)}var YV="data-puddle-source-line",QV="data-puddle-source-end-line";function JV(i){return i&&"mathMacros"in i?i:{mathMacros:{}}}function L1e(i,e){let t=vw(i.src,i.pos);if(!t||i.pos+t.length>i.posMax)return!1;if(!e){let r=i.push("math","",0);r.content=t.tex,r.meta={display:t.display}}return i.pos+=t.length,!0}function P1e(i){return typeof i.meta=="object"&&i.meta!==null&&"display"in i.meta&&i.meta.display===!0}function N1e(i=!1){let e=new WV({breaks:!1,html:!i,linkify:!i,typographer:!1});i&&(e.disable("image"),e.validateLink=a=>/^https?:\\/\\//i.test(a)),e.use(aS),e.inline.ruler.disable("footnote_inline"),e.renderer.rules.footnote_caption=(a,o)=>{let l=a[o]?.meta?.id;return String((typeof l=="number"?l:0)+1)};let t=e.renderer.rules.footnote_ref;e.renderer.rules.footnote_ref=(a,o,l,u,d)=>(t?.(a,o,l,u,d)??"").replace("<a ","<a data-footnote-ref ");let r=e.renderer.rules.footnote_anchor;e.renderer.rules.footnote_anchor=(a,o,l,u,d)=>{let c=a[o],m=c?.meta?.id,f=c?.meta?.subId,b=(typeof m=="number"?m:0)+1,w=(typeof f=="number"?f:0)+1;return(r?.(a,o,l,u,d)??"").replace("<a ",\`<a data-footnote-backref data-footnote-backref-idx="\${w}" aria-label="Back to reference \${b}" \`)},e.use(GV,{matchCaseSensitive:!0}),e.use(oS),KV(e),e.inline.ruler.before("escape","puddle_math",L1e),e.renderer.rules.math=(a,o,l,u)=>{let d=a[o];return Rm(d.content,P1e(d),JV(u).mathMacros)};let n=e.renderer.rules.fence;e.renderer.rules.fence=(a,o,l,u,d)=>{let c=a[o],m=c.info.trim().split(/\\s+/)[0]?.toLowerCase();return m==="mermaid"?(c.attrJoin("class","mermaid-diagram"),c.attrSet("data-puddle-mermaid",""),\`<div\${d.renderAttrs(c)}><pre><code>\${e.utils.escapeHtml(c.content)}</code></pre></div>
6964
6964
  \`):m!=="math"?n?n(a,o,l,u,d):d.renderToken(a,o,l):\`<div\${d.renderAttrs(c)}>\${Rm(c.content,!0,JV(u).mathMacros)}</div>
6965
6965
  \`},e.core.ruler.after("github-alerts","puddle_source_lines",a=>{if(!i)for(let o of a.tokens)!o.map||o.hidden||o.tag===""||o.nesting<0||(o.attrSet(YV,String(o.map[0]+1)),o.attrSet(QV,String(o.map[1]+1)))});let s=e.renderer.rules.alert_open;return e.renderer.rules.alert_open=(a,o,l,u,d)=>(s?.(a,o,l,u,d)??"").replace("<div",\`<div\${d.renderAttrs(a[o])}\`),e.core.ruler.after("inline","puddle_task_lists",a=>{let o=0;for(let l of a.tokens)if(l.type==="list_item_open")o+=1;else if(l.type==="list_item_close")o-=1;else if(l.type==="inline"&&o>0){let u=l.children?.[0],d=u?.type==="text"?/^\\[([ xX])\\]\\s+/.exec(u.content):null;if(!u||!d)continue;u.content=u.content.slice(d[0].length);let c=new a.Token("html_inline","",0);c.content=\`<input type="checkbox" disabled\${d[1].toLowerCase()==="x"?" checked":""}> \`,l.children.unshift(c)}}),e}var F1e=N1e();function ZV(i,e){return F1e.render(i,{mathMacros:{},...e?{docId:e}:{}})}define("@jupyter-widgets/base",[],()=>Dc);define("@jupyter-widgets/controls",[],()=>Hy);define("@jupyter-widgets/output",[],()=>np);var Um,Uo,Tw=!1,eK=!1,lS="",XV=!1,uS=new Map,Hm=new Map,Iw=document.createElement("div");document.body.append(Iw);var Gm=i=>Um?.postMessage(i),cS=i=>Gm({type:"error",error:String(i).slice(0,1024)});function kw(i){return{header:{msg_id:i.msg_id,msg_type:i.msg_type,session:"",username:"",version:"5.3",date:new Date().toISOString()},parent_header:{msg_id:i.parent_id},metadata:i.metadata,content:i.content,channel:"iopub",buffers:i.buffers.map(e=>new DataView(Uint8Array.from(atob(e),t=>t.charCodeAt(0)).buffer))}}var Wm=class{constructor(e){this.comm_id=e;uS.set(e,this)}target_name="jupyter.widget";message;closed;on_msg(e){this.message=e}on_close(e){this.closed=e}open(...e){return this.dispatch("comm_open",...e)}send(...e){return this.dispatch("comm_msg",...e)}close(...e){return this.dispatch("comm_close",...e)}dispatch(e,t={},r,n={},s=[]){let a=crypto.randomUUID();return Tw?Hm.size>=256?(cS("Too many pending widget actions"),a):(r&&Hm.set(a,r),Gm({type:"comm",message:{msg_id:a,parent_id:"",msg_type:e,metadata:n,content:{comm_id:this.comm_id,...e==="comm_open"?{target_name:this.target_name}:{},data:t},buffers:s.map(o=>{let l=o instanceof ArrayBuffer?new Uint8Array(o):new Uint8Array(o.buffer,o.byteOffset,o.byteLength),u="";for(let d=0;d<l.length;d+=8192)u+=String.fromCharCode(...l.subarray(d,d+8192));return btoa(u)})}}),a):a}},dS=class extends Wy{_rendermime;constructor(){super({loader:(e,t)=>!/^(?:@[a-z0-9_-]+\\/)?[a-z0-9_.-]+$/i.test(e)||!/^[\\w.^~<>=| *+-]+$/.test(t)?Promise.reject(new Error("Invalid widget extension name or version")):eK?(requirejs.config({paths:{[e]:\`https://cdn.jsdelivr.net/npm/\${e}@\${encodeURIComponent(t)}/dist/index\`},waitSeconds:20}),new Promise((r,n)=>requirejs([e],r,n))):(Gm({type:"extension",name:e}),Promise.reject(new Error(\`Load the \${e} widget extension to display this saved widget\`)))}),this.renderMime=this.renderMime.clone({markdownParser:{render:async e=>ZV(e)},latexTypesetter:{typeset(e){eV(e)}}}),this._rendermime=this.renderMime}new_model(e,t={}){return Tw&&!e.comm&&e.model_id&&(e={...e,comm:new Wm(e.model_id)}),super.new_model(e,t)}_create_comm(e,t,r,n,s){if(e!=="jupyter.widget")return Promise.reject(new Error("Unsupported widget comm target"));let a=new Wm(t);return r!==void 0&&a.open(r,void 0,n,s),Promise.resolve(a)}};async function $V(){if(XV||!Uo.has_model(lS))return;XV=!0;let i=await Uo.get_model(lS),e=await Uo.create_view(i);await Uo.display_view(e,Iw),Gm({type:"displayed"})}async function q1e(i){if(i.theme)for(let[e,t]of Object.entries(i.theme))document.documentElement.style.setProperty(e,t);if(i.type==="init")Tw=!!i.live,eK=!!i.extensions,lS=i.modelId,Uo=new dS,await Uo.set_state(i.snapshot),await $V();else if(i.type==="events"){let e=(i.events??[]).filter(t=>t.msg_type==="comm_open");await Promise.all(e.map(t=>Uo.has_model(String(t.content.comm_id))?Promise.resolve():Uo.handle_comm_open(new Wm(String(t.content.comm_id)),kw(t))));for(let t of i.events??[]){let r=uS.get(String(t.content.comm_id));if(t.msg_type==="comm_msg"&&await r?.message?.(kw(t)),t.msg_type==="comm_close"&&(r?.closed?.(kw(t)),uS.delete(String(t.content.comm_id))),t.msg_type==="status"){let n=Hm.get(t.parent_id)?.iopub?.status;n?.(kw(t)),t.content.execution_state==="idle"&&Hm.delete(t.parent_id)}}await $V()}else i.type==="error"&&(i.msg_id&&Hm.delete(i.msg_id),Tw=!1,Uo.disconnect(),cS(i.error))}window.addEventListener("message",i=>{if(i.source!==parent||i.data?.type!=="puddle-widget-connect"||Um||!i.ports[0])return;Um=i.ports[0];let e=Promise.resolve();Um.onmessage=t=>{e=e.then(()=>q1e(t.data)).catch(cS)},Um.start()});new ResizeObserver(()=>Gm({type:"height",height:Math.ceil(Iw.getBoundingClientRect().height)})).observe(Iw);parent.postMessage({type:"puddle-widget-ready"},"*");})();
6966
6966
  `;export{e as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{H as n,J as r,R as i,Z as a,_t as ee,s as te,u as o,y as s,z as c}from"./protocol-support-BwRR1kRO.js";import{a as ne,d as l,f as u,i as d,l as f,o as re,r as p,u as m}from"./LazyTerminal-BjT3haSN.js";import{t as h}from"./jsx-runtime-By8HlURe.js";import{C as ie,h as g,m as _}from"./session-order-iVRWTB-C.js";import{n as v}from"./motion-Bd_MB9cH.js";import{t as y}from"./createLucideIcon-C9A1vLE-.js";import{a as ae,i as oe,o as b,r as x,s as S,t as C}from"./dialog-DtvE8ATK.js";import{i as w}from"./dist-Dac0re_p.js";import{t as T}from"./button-DtByPSFL.js";import{t as se}from"./use-debounced-value-C86N-mOK.js";var E=y(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),D=y(`folder`,[[`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`,key:`1kt360`}]]),O=e(t(),1),k=h();function A(e){let t=e.trim().replace(/\/+$/,``);return t===``?`/`:t}function j(e){return e.startsWith(`/`)||e.startsWith(`~`)}function M(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function ce({dir:e,onNavigate:t,onChoose:n}){let i=r(e.endsWith(`/`)?e:`${e}/`);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>t(M(e)),disabled:e===`/`,title:`Parent directory`,className:`shrink-0 rounded-sm p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg disabled:pointer-events-none disabled:opacity-40`,children:[(0,k.jsx)(_,{className:`size-3.5`}),(0,k.jsx)(`span`,{className:`sr-only`,children:`Parent directory`})]}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`ml-auto shrink-0 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose this folder`})]}),(0,k.jsxs)(`div`,{className:`max-h-48 overflow-y-auto`,children:[(i.data?.entries??[]).map(e=>(0,k.jsxs)(`div`,{className:`flex items-center rounded-md transition-colors hover:bg-elevated`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left`,children:[e.is_git?(0,k.jsx)(f,{className:`size-3.5 shrink-0 text-success`}):(0,k.jsx)(D,{className:`size-3.5 shrink-0 text-fg-gold`}),(0,k.jsx)(`span`,{className:`truncate text-xs text-fg`,children:e.name})]}),e.is_git&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>n(e.path),className:`shrink-0 px-2 py-1 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose`})]},e.path)),i.data!==void 0&&i.data.entries.length===0&&(0,k.jsx)(`p`,{className:`px-2 py-1 text-xs text-fg-muted`,children:`No subdirectories.`})]})]})}function N({profileId:e,open:t,onOpenChange:f}){let h=ee(),g=n().data?.protocol,_=o(g),v=s(g),y=c(),E=i(),D=ie(),M=a(),[N,P]=(0,O.useState)(``),[F,I]=(0,O.useState)(``),[L,R]=(0,O.useState)(!1),[z,B]=(0,O.useState)(``),[V,H]=(0,O.useState)(null),[U,W]=(0,O.useState)(!1),[G,K]=(0,O.useState)(null),[q,J]=(0,O.useState)(null),Y=M.data?.home,le=()=>{let e=N.trim(),t=j(e)&&Y!==void 0?A(e.replace(/^~(?=\/|$)/,Y)):j(e)&&e.startsWith(`/`)?A(e):Y??`/`;Z(t)},X=e=>{I(e),U||B(l(e))},Z=e=>{J(e),P(e)},ue=e=>{P(e),J(null),X(e.split(`/`).filter(Boolean).pop()??``),R(!0)},Q=r(se(N,150)),de=(0,O.useMemo)(()=>{if(!j(N))return(h.data??[]).map(e=>({value:e.path,badge:`registered`,is_git:!0}));let e=new Set((h.data??[]).map(e=>e.path));return(Q.data?.entries??[]).map(t=>({value:t.path,label:t.name,badge:e.has(t.path)?`registered`:t.is_git?`git`:void 0,is_git:t.is_git}))},[N,h.data,Q.data]),fe=async()=>{K(null);try{let t=A(N),n=h.data?.find(e=>e.path===t)?.id??(await y.mutateAsync({path:t,..._?{default_base_branch:``}:{}})).id,r=await E.mutateAsync({profile_id:e,repo_id:n,name:F.trim(),...v?{colour:V}:{},...u(z)?{abbrev:u(z)}:{}});f(!1),D(`/project/${r.id}`)}catch(e){K(e instanceof Error?e.message:String(e))}},$=F.trim()!==``&&j(N.trim());return(0,k.jsx)(C,{open:t,onOpenChange:f,children:(0,k.jsxs)(x,{children:[(0,k.jsxs)(b,{children:[(0,k.jsx)(S,{children:`New project`}),(0,k.jsx)(oe,{children:`Point at a git repository on the daemon host — known repositories are reused.`})]}),(0,k.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),$&&fe()},children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(m,{htmlFor:`repo-path`,children:`Repository path`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>q===null?le():J(null),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:q===null?`browse…`:`hide browser`})]}),(0,k.jsx)(p,{id:`repo-path`,placeholder:`~/src/my-repo`,value:N,onValueChange:P,onChoose:e=>{!L&&e.is_git&&X(e.value.split(`/`).filter(Boolean).pop()??``)},hints:de}),q!==null&&(0,k.jsx)(ce,{dir:q,onNavigate:Z,onChoose:ue})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(m,{htmlFor:`project-name`,children:`Project name`}),(0,k.jsx)(w,{id:`project-name`,placeholder:`e.g. checkout-rework`,value:F,className:ne(V),style:re(V),onChange:e=>{X(e.target.value),R(!0)}})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(m,{htmlFor:`project-abbrev`,children:`Abbreviation`}),(0,k.jsx)(w,{id:`project-abbrev`,placeholder:F.trim()?l(F):`ABBRV`,maxLength:5,value:z,onChange:e=>{B(u(e.target.value)),W(!0)},className:`w-24 uppercase`}),(0,k.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the project's label on the collapsed sidebar rail.`]})]}),v&&(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs text-fg-secondary`,children:`Colour`}),(0,k.jsx)(d,{value:V,onChange:H,onCustomChange:te(g)?H:void 0,label:`Project colour`})]}),G&&(0,k.jsx)(`p`,{className:`text-xs text-danger`,children:G}),(0,k.jsxs)(ae,{children:[(0,k.jsx)(T,{type:`button`,variant:`ghost`,onClick:()=>f(!1),children:`Cancel`}),(0,k.jsx)(T,{type:`submit`,disabled:!$||y.isPending||E.isPending,children:`Create project`})]})]})]})})}var P=class extends O.Component{element=(0,O.createRef)();animation=null;getSnapshotBeforeUpdate(e){return e.expanded===this.props.expanded||this.props.reduced?null:this.element.current?.getBoundingClientRect().height??null}componentDidUpdate(e,t,n){if(this.props.reduced){this.animation?.cancel(),this.animation=null;return}if(e.expanded===this.props.expanded)return;this.animation?.cancel();let r=this.element.current;if(!r||n===null)return;let i=r.getBoundingClientRect().height;if(n===i)return;let a=r.animate([{height:`${n}px`,overflow:`clip`},{height:`${i}px`,overflow:`clip`}],{duration:180,easing:`ease-out`});this.animation=a,a.finished.then(()=>{this.animation===a&&(this.animation=null)},()=>{})}componentWillUnmount(){this.animation?.cancel()}render(){return(0,k.jsx)(`div`,{ref:this.element,"data-expanding-content":!0,children:(0,k.jsx)(g,{motionKey:String(this.props.expanded),children:this.props.children})})}};function F(e){return(0,k.jsx)(P,{...e,reduced:v()})}export{N as n,E as r,F as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{H as n,J as r,R as i,Z as a,_t as ee,s as te,u as o,y as s,z as c}from"./protocol-support-BwRR1kRO.js";import{a as ne,d as l,f as u,i as d,l as f,o as re,r as p,u as m}from"./LazyTerminal-D4QV7VEc.js";import{t as h}from"./jsx-runtime-By8HlURe.js";import{C as ie,h as g,m as _}from"./session-order-iVRWTB-C.js";import{n as v}from"./motion-Bd_MB9cH.js";import{t as y}from"./createLucideIcon-C9A1vLE-.js";import{a as ae,i as oe,o as b,r as x,s as S,t as C}from"./dialog-DtvE8ATK.js";import{i as w}from"./dist-Dac0re_p.js";import{t as T}from"./button-DtByPSFL.js";import{t as se}from"./use-debounced-value-C86N-mOK.js";var E=y(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),D=y(`folder`,[[`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`,key:`1kt360`}]]),O=e(t(),1),k=h();function A(e){let t=e.trim().replace(/\/+$/,``);return t===``?`/`:t}function j(e){return e.startsWith(`/`)||e.startsWith(`~`)}function M(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function ce({dir:e,onNavigate:t,onChoose:n}){let i=r(e.endsWith(`/`)?e:`${e}/`);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>t(M(e)),disabled:e===`/`,title:`Parent directory`,className:`shrink-0 rounded-sm p-1 text-fg-gold transition-colors hover:bg-elevated hover:text-fg disabled:pointer-events-none disabled:opacity-40`,children:[(0,k.jsx)(_,{className:`size-3.5`}),(0,k.jsx)(`span`,{className:`sr-only`,children:`Parent directory`})]}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`ml-auto shrink-0 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose this folder`})]}),(0,k.jsxs)(`div`,{className:`max-h-48 overflow-y-auto`,children:[(i.data?.entries??[]).map(e=>(0,k.jsxs)(`div`,{className:`flex items-center rounded-md transition-colors hover:bg-elevated`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),className:`flex min-w-0 flex-1 items-center gap-2 px-2 py-1 text-left`,children:[e.is_git?(0,k.jsx)(f,{className:`size-3.5 shrink-0 text-success`}):(0,k.jsx)(D,{className:`size-3.5 shrink-0 text-fg-gold`}),(0,k.jsx)(`span`,{className:`truncate text-xs text-fg`,children:e.name})]}),e.is_git&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>n(e.path),className:`shrink-0 px-2 py-1 text-2xs text-fg-muted transition-colors hover:text-fg`,children:`choose`})]},e.path)),i.data!==void 0&&i.data.entries.length===0&&(0,k.jsx)(`p`,{className:`px-2 py-1 text-xs text-fg-muted`,children:`No subdirectories.`})]})]})}function N({profileId:e,open:t,onOpenChange:f}){let h=ee(),g=n().data?.protocol,_=o(g),v=s(g),y=c(),E=i(),D=ie(),M=a(),[N,P]=(0,O.useState)(``),[F,I]=(0,O.useState)(``),[L,R]=(0,O.useState)(!1),[z,B]=(0,O.useState)(``),[V,H]=(0,O.useState)(null),[U,W]=(0,O.useState)(!1),[G,K]=(0,O.useState)(null),[q,J]=(0,O.useState)(null),Y=M.data?.home,le=()=>{let e=N.trim(),t=j(e)&&Y!==void 0?A(e.replace(/^~(?=\/|$)/,Y)):j(e)&&e.startsWith(`/`)?A(e):Y??`/`;Z(t)},X=e=>{I(e),U||B(l(e))},Z=e=>{J(e),P(e)},ue=e=>{P(e),J(null),X(e.split(`/`).filter(Boolean).pop()??``),R(!0)},Q=r(se(N,150)),de=(0,O.useMemo)(()=>{if(!j(N))return(h.data??[]).map(e=>({value:e.path,badge:`registered`,is_git:!0}));let e=new Set((h.data??[]).map(e=>e.path));return(Q.data?.entries??[]).map(t=>({value:t.path,label:t.name,badge:e.has(t.path)?`registered`:t.is_git?`git`:void 0,is_git:t.is_git}))},[N,h.data,Q.data]),fe=async()=>{K(null);try{let t=A(N),n=h.data?.find(e=>e.path===t)?.id??(await y.mutateAsync({path:t,..._?{default_base_branch:``}:{}})).id,r=await E.mutateAsync({profile_id:e,repo_id:n,name:F.trim(),...v?{colour:V}:{},...u(z)?{abbrev:u(z)}:{}});f(!1),D(`/project/${r.id}`)}catch(e){K(e instanceof Error?e.message:String(e))}},$=F.trim()!==``&&j(N.trim());return(0,k.jsx)(C,{open:t,onOpenChange:f,children:(0,k.jsxs)(x,{children:[(0,k.jsxs)(b,{children:[(0,k.jsx)(S,{children:`New project`}),(0,k.jsx)(oe,{children:`Point at a git repository on the daemon host — known repositories are reused.`})]}),(0,k.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),$&&fe()},children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(m,{htmlFor:`repo-path`,children:`Repository path`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>q===null?le():J(null),className:`text-2xs text-fg-muted transition-colors hover:text-fg`,children:q===null?`browse…`:`hide browser`})]}),(0,k.jsx)(p,{id:`repo-path`,placeholder:`~/src/my-repo`,value:N,onValueChange:P,onChoose:e=>{!L&&e.is_git&&X(e.value.split(`/`).filter(Boolean).pop()??``)},hints:de}),q!==null&&(0,k.jsx)(ce,{dir:q,onNavigate:Z,onChoose:ue})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(m,{htmlFor:`project-name`,children:`Project name`}),(0,k.jsx)(w,{id:`project-name`,placeholder:`e.g. checkout-rework`,value:F,className:ne(V),style:re(V),onChange:e=>{X(e.target.value),R(!0)}})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(m,{htmlFor:`project-abbrev`,children:`Abbreviation`}),(0,k.jsx)(w,{id:`project-abbrev`,placeholder:F.trim()?l(F):`ABBRV`,maxLength:5,value:z,onChange:e=>{B(u(e.target.value)),W(!0)},className:`w-24 uppercase`}),(0,k.jsxs)(`p`,{className:`text-2xs text-fg-muted`,children:[`Up to `,5,` characters — the project's label on the collapsed sidebar rail.`]})]}),v&&(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs text-fg-secondary`,children:`Colour`}),(0,k.jsx)(d,{value:V,onChange:H,onCustomChange:te(g)?H:void 0,label:`Project colour`})]}),G&&(0,k.jsx)(`p`,{className:`text-xs text-danger`,children:G}),(0,k.jsxs)(ae,{children:[(0,k.jsx)(T,{type:`button`,variant:`ghost`,onClick:()=>f(!1),children:`Cancel`}),(0,k.jsx)(T,{type:`submit`,disabled:!$||y.isPending||E.isPending,children:`Create project`})]})]})]})})}var P=class extends O.Component{element=(0,O.createRef)();animation=null;getSnapshotBeforeUpdate(e){return e.expanded===this.props.expanded||this.props.reduced?null:this.element.current?.getBoundingClientRect().height??null}componentDidUpdate(e,t,n){if(this.props.reduced){this.animation?.cancel(),this.animation=null;return}if(e.expanded===this.props.expanded)return;this.animation?.cancel();let r=this.element.current;if(!r||n===null)return;let i=r.getBoundingClientRect().height;if(n===i)return;let a=r.animate([{height:`${n}px`,overflow:`clip`},{height:`${i}px`,overflow:`clip`}],{duration:180,easing:`ease-out`});this.animation=a,a.finished.then(()=>{this.animation===a&&(this.animation=null)},()=>{})}componentWillUnmount(){this.animation?.cancel()}render(){return(0,k.jsx)(`div`,{ref:this.element,"data-expanding-content":!0,children:(0,k.jsx)(g,{motionKey:String(this.props.expanded),children:this.props.children})})}};function F(e){return(0,k.jsx)(P,{...e,reduced:v()})}export{N as n,E as r,F as t};
@@ -0,0 +1 @@
1
+ import{m as e}from"./auth-C3ruG3fE.js";import{n as t}from"./api-CULxlzTe.js";import{b as n}from"./ws-DjQ6OZLM.js";async function r(n){let r=/^\/forward\/([^/]+)\/(\d+)$/.exec(n.pathname);if(!r)throw Error(`This forwarding link is invalid.`);let i=await t(`POST`,`/cockpit/proxy-grant`,{session:r[1],port:Number(r[2]),path:n.searchParams.get(`path`)??`/`});return e.parse(i).url}async function i(e){let t=e,i=new URL(e,window.location.href);n()&&i.origin===window.location.origin&&i.pathname.startsWith(`/forward/`)&&(t=await r(i)),window.open(t,`_blank`,`noopener,noreferrer`)}export{i as n,r as t};