@lovelybunch/api 1.0.77 → 1.0.78-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/api/v1/auth-settings/route.js +57 -0
- package/dist/routes/api/v1/jobs/[id]/route.d.ts +8 -8
- package/dist/routes/api/v1/jobs/route.d.ts +8 -8
- package/dist/routes/api/v1/mail/route.d.ts +3 -3
- package/package.json +4 -4
- package/static/assets/{ActivityPage-Cq-tJtyJ.js → ActivityPage-DiwGC2nD.js} +1 -1
- package/static/assets/{AgentsContextEditPage-JQVZwgYS.js → AgentsContextEditPage-Xh10BIpD.js} +1 -1
- package/static/assets/{AgentsContextPage-D3qs8jm1.js → AgentsContextPage-DYLVgjBy.js} +1 -1
- package/static/assets/{ApiKeysSettingsPage-DV6SHXFl.js → ApiKeysSettingsPage-21Rz7etb.js} +1 -1
- package/static/assets/{AuthSettingsPage-HGl3bv86.js → AuthSettingsPage-CuDQH02c.js} +1 -1
- package/static/assets/{CallbackPage-gTamj-aw.js → CallbackPage-Fok1FSep.js} +1 -1
- package/static/assets/{CoconutCallbackPage-BSsfwmO9.js → CoconutCallbackPage-CJCSsq2v.js} +1 -1
- package/static/assets/{CodePage-BZglHH_Q.js → CodePage-CzEzWmjy.js} +1 -1
- package/static/assets/{CollapsibleSection-wvr0ZutV.js → CollapsibleSection-CAtdqP8-.js} +1 -1
- package/static/assets/{DashboardPage-kHE94CF0.js → DashboardPage-i5uE_kdH.js} +1 -1
- package/static/assets/{GitPage-6RIgBfUa.js → GitPage-Do-L6D0R.js} +1 -1
- package/static/assets/{GitSettingsPage-BsbGiw1j.js → GitSettingsPage-GZ5wAGvy.js} +1 -1
- package/static/assets/{IdentityPage-BNpiVrav.js → IdentityPage-BJe8PLkl.js} +1 -1
- package/static/assets/{ImplementationStepsEditor-0gLMjKu3.js → ImplementationStepsEditor-C5ERpOXx.js} +1 -1
- package/static/assets/{IntegrationsSettingsPage-CrHIVn_B.js → IntegrationsSettingsPage-Bw9hlc_l.js} +1 -1
- package/static/assets/{JobDetailPage-DQf8bRkh.js → JobDetailPage-DvPv3vVS.js} +1 -1
- package/static/assets/{KnowledgeDetailPage-UGz_iyMr.js → KnowledgeDetailPage-BPhauuYL.js} +1 -1
- package/static/assets/{KnowledgeEditPage-CX7nnUHE.js → KnowledgeEditPage-CQUswyeH.js} +1 -1
- package/static/assets/{KnowledgePage-B9vVX08N.js → KnowledgePage-KTCjoesA.js} +1 -1
- package/static/assets/{LoginPage-uctPsP7c.js → LoginPage-BYAGsbfR.js} +1 -1
- package/static/assets/{MailInboxPage-iFOMcWbJ.js → MailInboxPage-DSTys1-R.js} +1 -1
- package/static/assets/{MailProcessingModal-CWZ6NlWD.js → MailProcessingModal-Ctknm_wU.js} +1 -1
- package/static/assets/{MailReadPage-Cm3EGR04.js → MailReadPage-AOANr3XI.js} +1 -1
- package/static/assets/{MailSentPage-B_yCduWu.js → MailSentPage-BnSYoKkQ.js} +1 -1
- package/static/assets/{McpSettingsPage-BIuIEeMa.js → McpSettingsPage-CY3iobWJ.js} +1 -1
- package/static/assets/{MemoryEditPage-UItxPPYu.js → MemoryEditPage-Bh_d-iqV.js} +1 -1
- package/static/assets/{MemoryPage-Bewz284-.js → MemoryPage-CMPTTwSH.js} +1 -1
- package/static/assets/{NewKnowledgePage-CTFD-rPP.js → NewKnowledgePage-B00wknYX.js} +1 -1
- package/static/assets/{NewSkillPage-BUJ5TRTk.js → NewSkillPage-hNhVRNjh.js} +1 -1
- package/static/assets/{NewTaskPage-B34HFZLj.js → NewTaskPage-Dq75MGuc.js} +1 -1
- package/static/assets/{NotFoundPage-BfybYiKU.js → NotFoundPage-CR1-vMeX.js} +1 -1
- package/static/assets/{NotificationsSettingsPage-1ydinio6.js → NotificationsSettingsPage-5aeTZq8-.js} +1 -1
- package/static/assets/{PromptsSettingsPage-DqO7rEba.js → PromptsSettingsPage-Brs1vikj.js} +1 -1
- package/static/assets/{ResourceDetailPage-BFG5kNE4.js → ResourceDetailPage-3r3KPdJy.js} +1 -1
- package/static/assets/{ResourcesPage-B0NtohGC.js → ResourcesPage-CFtSgZva.js} +1 -1
- package/static/assets/{RoleEditPage-CgsWmLJB.js → RoleEditPage-DmSqJEHZ.js} +1 -1
- package/static/assets/{RolePage-CI6GUlGa.js → RolePage-Dm523gez.js} +1 -1
- package/static/assets/{RulesSettingsPage-TUgWSUD5.js → RulesSettingsPage-DewqNsAk.js} +1 -1
- package/static/assets/{RunDetailPage-CXlauF0u.js → RunDetailPage-BDUVebTX.js} +1 -1
- package/static/assets/{SchedulePage-KyktudT3.js → SchedulePage-DFnoNF-X.js} +1 -1
- package/static/assets/{SkillDetailPage-DHxNBkWp.js → SkillDetailPage-DnCPbpIZ.js} +1 -1
- package/static/assets/{SkillEditPage-Lrm4XlCK.js → SkillEditPage-Inn-YsZP.js} +1 -1
- package/static/assets/{SkillsPage-b7uubp-n.js → SkillsPage-CD-eiUnZ.js} +1 -1
- package/static/assets/{SkillsSettingsPage-BRJIpJec.js → SkillsSettingsPage-C1bs2gVd.js} +1 -1
- package/static/assets/{SourceInput-Qv8Dn4Xx.js → SourceInput-CIyYOUd-.js} +1 -1
- package/static/assets/{TagInput-Czvs9lsc.js → TagInput-fSSAsdov.js} +1 -1
- package/static/assets/{TaskDetailPage-CivkpQe2.js → TaskDetailPage-B2AeYerz.js} +1 -1
- package/static/assets/{TaskEditPage-Bc6gS0c6.js → TaskEditPage-B9dA1Nr4.js} +1 -1
- package/static/assets/{TasksPage-DuKgC8KM.js → TasksPage-DJBVDNw1.js} +1 -1
- package/static/assets/{TeamEditPage-m4NJFGUY.js → TeamEditPage-BGHM7C8n.js} +1 -1
- package/static/assets/{TeamPage-DBU-jnVj.js → TeamPage-CGxpXKc4.js} +1 -1
- package/static/assets/{TerminalPage-CI45TuGe.js → TerminalPage-z5NbYWjF.js} +1 -1
- package/static/assets/{TerminalSessionPage-DQkhJQaK.js → TerminalSessionPage-eDZDlEeb.js} +1 -1
- package/static/assets/{UserPreferencesPage-BUY2Lmbx.js → UserPreferencesPage-uTC5S4Ig.js} +1 -1
- package/static/assets/{UserSettingsPage-BcMiPkly.js → UserSettingsPage-D6uxgoz5.js} +1 -1
- package/static/assets/{UtilitiesPage-DMerZZcL.js → UtilitiesPage-BwoS0vin.js} +1 -1
- package/static/assets/{alert-BSl_15w4.js → alert-CKLRmrya.js} +1 -1
- package/static/assets/{arrow-down-_ri289ss.js → arrow-down-B7v_FmC2.js} +1 -1
- package/static/assets/{arrow-left-Fa3x1DU7.js → arrow-left-CrE2UamQ.js} +1 -1
- package/static/assets/{arrow-up-iWDv2UXW.js → arrow-up-DkJyEUv_.js} +1 -1
- package/static/assets/{arrow-up-down-Ckwtzrps.js → arrow-up-down-CyKWLTed.js} +1 -1
- package/static/assets/{badge-YRTRpaJp.js → badge-CEhr50DH.js} +1 -1
- package/static/assets/{browser-modal-U9aSv2St.js → browser-modal-BaiHyGXz.js} +1 -1
- package/static/assets/{card-_08H8QL5.js → card-CEBVsJGA.js} +1 -1
- package/static/assets/{chevron-left-BLnAnQzA.js → chevron-left-Dwnb59xB.js} +1 -1
- package/static/assets/{chevron-up-CrW20eZR.js → chevron-up-CLuT-8K8.js} +1 -1
- package/static/assets/{chevrons-up-BrCIGM2h.js → chevrons-up-DiHFV5Rg.js} +1 -1
- package/static/assets/{circle-alert-CCndfzX8.js → circle-alert-DbwPGG3s.js} +1 -1
- package/static/assets/{circle-check-D2WB1eR8.js → circle-check-DoS8t4b0.js} +1 -1
- package/static/assets/{circle-check-big-B12KqpqV.js → circle-check-big-DW9BPHOx.js} +1 -1
- package/static/assets/{circle-play-D8mTxsnE.js → circle-play-B5pWyVQu.js} +1 -1
- package/static/assets/{circle-x-CPxsFSfb.js → circle-x-D0FfNqWc.js} +1 -1
- package/static/assets/{clipboard-BXUoFzC_.js → clipboard-DesoxJnQ.js} +1 -1
- package/static/assets/{clock-B7qx7N62.js → clock-KMBAqOpw.js} +1 -1
- package/static/assets/{code-B-wgFVBM.js → code-Jj7V1OI-.js} +1 -1
- package/static/assets/{download-CIGVn2po.js → download-bCNOpuix.js} +1 -1
- package/static/assets/{external-link-CD6WP5iK.js → external-link-BbvQVJFO.js} +1 -1
- package/static/assets/{eye-C-lnahtV.js → eye-B3bkY8eg.js} +1 -1
- package/static/assets/{folder-git-2-CkR5A1oS.js → folder-git-2-DK4rLsn4.js} +1 -1
- package/static/assets/{globe-D3Av4xEm.js → globe-bTMV8w2D.js} +1 -1
- package/static/assets/{index-BVG65cBY.js → index--BGsGBNQ.js} +1 -1
- package/static/assets/{index-CpVubLYu.js → index-4_sGNb1Z.js} +1 -1
- package/static/assets/{index-ZcikYUIr.js → index-BQ6iW0x3.js} +1 -1
- package/static/assets/{index-DMMdqgMw.js → index-BbgmwHwE.js} +1 -1
- package/static/assets/{index-BZ-DEXFT.js → index-BcFOHKDW.js} +1 -1
- package/static/assets/{index-BOOVSXG_.js → index-BnXRNrU8.js} +1 -1
- package/static/assets/{index-CdxRNWYK.js → index-Bys9M37r.js} +1 -1
- package/static/assets/{index-C-It-oJ8.js → index-C0uIENKu.js} +3 -3
- package/static/assets/{index-CRfSJN7A.js → index-CZiSycvj.js} +1 -1
- package/static/assets/{index-BiTK53WF.js → index-CpjimEBF.js} +1 -1
- package/static/assets/{index-Dtu42bmK.js → index-D5ZLXUjG.js} +1 -1
- package/static/assets/{index-DZp_7HEX.js → index-D82OGwJi.js} +1 -1
- package/static/assets/{index-BwbLMbrC.js → index-DHFK1JbA.js} +1 -1
- package/static/assets/{index-BBof4w7u.js → index-DUahdX7L.js} +1 -1
- package/static/assets/{index-B5VNtwZQ.js → index-DVczQIDE.js} +1 -1
- package/static/assets/{index-BgtJOhTt.js → index-DtuMv8f8.js} +1 -1
- package/static/assets/{index-Cr9wB9uC.js → index-X-V7B-bx.js} +1 -1
- package/static/assets/{index-CSunDccS.js → index-fkGtFh-U.js} +1 -1
- package/static/assets/{index-B5h_EDHQ.js → index-gnXQirFQ.js} +1 -1
- package/static/assets/{info-D_iUr_LO.js → info-CMb2giNJ.js} +1 -1
- package/static/assets/{label-DpGd2A9i.js → label-DXN216Ba.js} +1 -1
- package/static/assets/{markdown-editor-DsIWl9E6.js → markdown-editor-MQ7X6BHT.js} +3 -3
- package/static/assets/{message-square-CU7CplMV.js → message-square-f1hNpr6b.js} +1 -1
- package/static/assets/{paperclip-BdTSwWBI.js → paperclip-BiwY4VlV.js} +1 -1
- package/static/assets/{pause-VD4MvX1V.js → pause-EbBEDWDr.js} +1 -1
- package/static/assets/{play-CIBDggo3.js → play-BHqUO04d.js} +1 -1
- package/static/assets/{radio-group-BwcltCgD.js → radio-group-CzhYpC89.js} +1 -1
- package/static/assets/{refresh-cw-DjSZHJFs.js → refresh-cw-BPr-EVyC.js} +1 -1
- package/static/assets/{search-DtmFY0AW.js → search-BBw4K5iK.js} +1 -1
- package/static/assets/{select-B3LUgp-0.js → select-BLUGdloJ.js} +1 -1
- package/static/assets/{server-6-FMGHIh.js → server-2mf5MwhW.js} +1 -1
- package/static/assets/{switch-D7Gn9yQA.js → switch-DwGQE3tG.js} +1 -1
- package/static/assets/{tabs-PDBtRsYD.js → tabs-33myWTAS.js} +1 -1
- package/static/assets/{tag-B30iaxwe.js → tag-C-PW20qp.js} +1 -1
- package/static/assets/{terminal-preview-ZpgPQSVP.js → terminal-preview-BHb0aOSR.js} +1 -1
- package/static/assets/{triangle-alert-D2pqhLFw.js → triangle-alert-CNER-68k.js} +1 -1
- package/static/assets/{use-terminal-Cp7abMCW.js → use-terminal-GvBteSXs.js} +1 -1
- package/static/assets/{video-CteJuAKv.js → video-3hk0v1CB.js} +1 -1
- package/static/index.html +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as e,B as w,p as oe,r as a,a7 as Ye,H as Xe,s as Qe,u as et,x as tt,a as rt,T as ve,X as ye,P as je,k as we,l as st,Z as at,G as nt,D as it,b as ct,d as lt,f as ot,a8 as Be,a9 as Oe,n as $e,aa as Ie,ab as _e,ac as ze,ad as Fe,ae as dt,A as de}from"./index-
|
|
1
|
+
import{j as e,B as w,p as oe,r as a,a7 as Ye,H as Xe,s as Qe,u as et,x as tt,a as rt,T as ve,X as ye,P as je,k as we,l as st,Z as at,G as nt,D as it,b as ct,d as lt,f as ot,a8 as Be,a9 as Oe,n as $e,aa as Ie,ab as _e,ac as ze,ad as Fe,ae as dt,A as de}from"./index-C0uIENKu.js";import{C as mt,a as ut}from"./card-CEBVsJGA.js";import{B as De}from"./badge-CEhr50DH.js";import{S as ke,a as Ne,b as Se,c as Ce,d as $}from"./select-BLUGdloJ.js";import{R as xt,a as Ae}from"./radio-group-CzhYpC89.js";import{C as ht}from"./CollapsibleSection-CAtdqP8-.js";import{L as xe}from"./label-DXN216Ba.js";import{u as ft}from"./use-terminal-GvBteSXs.js";import{x as gt,a as pt}from"./xterm-DTxiCjtJ.js";import{A as bt}from"./arrow-down-B7v_FmC2.js";/* empty css */import{b as Je,a as vt,c as yt,d as jt,e as wt}from"./pipeline-builders-DrEjlsbH.js";import{C as Te}from"./code-Jj7V1OI-.js";import{R as kt}from"./refresh-cw-BPr-EVyC.js";import{P as Ee}from"./play-BHqUO04d.js";import{E as Nt}from"./eye-B3bkY8eg.js";import{S as Ge}from"./server-2mf5MwhW.js";import{M as St}from"./message-square-f1hNpr6b.js";import"./index-4_sGNb1Z.js";import"./chevron-up-CLuT-8K8.js";var We={exports:{}},Ue;function Ct(){return Ue||(Ue=1,(function(r,k){(function(I,P){r.exports=P()})(self,(()=>(()=>{var I={6:(o,c)=>{function D(C){try{const n=new URL(C),d=n.password&&n.username?`${n.protocol}//${n.username}:${n.password}@${n.host}`:n.username?`${n.protocol}//${n.username}@${n.host}`:`${n.protocol}//${n.host}`;return C.toLocaleLowerCase().startsWith(d.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(c,"__esModule",{value:!0}),c.LinkComputer=c.WebLinkProvider=void 0,c.WebLinkProvider=class{constructor(C,n,d,u={}){this._terminal=C,this._regex=n,this._handler=d,this._options=u}provideLinks(C,n){const d=g.computeLink(C,this._regex,this._terminal,this._handler);n(this._addCallbacks(d))}_addCallbacks(C){return C.map((n=>(n.leave=this._options.leave,n.hover=(d,u)=>{if(this._options.hover){const{range:p}=n;this._options.hover(d,u,p)}},n)))}};class g{static computeLink(n,d,u,p){const M=new RegExp(d.source,(d.flags||"")+"g"),[f,y]=g._getWindowedLineStrings(n-1,u),x=f.join("");let m;const R=[];for(;m=M.exec(x);){const b=m[0];if(!D(b))continue;const[h,Y]=g._mapStrIdx(u,y,0,m.index),[X,H]=g._mapStrIdx(u,h,Y,b.length);if(h===-1||Y===-1||X===-1||H===-1)continue;const K={start:{x:Y+1,y:h+1},end:{x:H,y:X+1}};R.push({range:K,text:b,activate:p})}return R}static _getWindowedLineStrings(n,d){let u,p=n,M=n,f=0,y="";const x=[];if(u=d.buffer.active.getLine(n)){const m=u.translateToString(!0);if(u.isWrapped&&m[0]!==" "){for(f=0;(u=d.buffer.active.getLine(--p))&&f<2048&&(y=u.translateToString(!0),f+=y.length,x.push(y),u.isWrapped&&y.indexOf(" ")===-1););x.reverse()}for(x.push(m),f=0;(u=d.buffer.active.getLine(++M))&&u.isWrapped&&f<2048&&(y=u.translateToString(!0),f+=y.length,x.push(y),y.indexOf(" ")===-1););}return[x,p]}static _mapStrIdx(n,d,u,p){const M=n.buffer.active,f=M.getNullCell();let y=u;for(;p;){const x=M.getLine(d);if(!x)return[-1,-1];for(let m=y;m<x.length;++m){x.getCell(m,f);const R=f.getChars();if(f.getWidth()&&(p-=R.length||1,m===x.length-1&&R==="")){const b=M.getLine(d+1);b&&b.isWrapped&&(b.getCell(0,f),f.getWidth()===2&&(p+=1))}if(p<0)return[d,m]}d++,y=0}return[d,y]}}c.LinkComputer=g}},P={};function E(o){var c=P[o];if(c!==void 0)return c.exports;var D=P[o]={exports:{}};return I[o](D,D.exports,E),D.exports}var W={};return(()=>{var o=W;Object.defineProperty(o,"__esModule",{value:!0}),o.WebLinksAddon=void 0;const c=E(6),D=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function g(C,n){const d=window.open();if(d){try{d.opener=null}catch{}d.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}o.WebLinksAddon=class{constructor(C=g,n={}){this._handler=C,this._options=n}activate(C){this._terminal=C;const n=this._options,d=n.urlRegex||D;this._linkProvider=this._terminal.registerLinkProvider(new c.WebLinkProvider(this._terminal,d,this._handler,n))}dispose(){this._linkProvider?.dispose()}}})(),W})()))})(We)),We.exports}var At=Ct();function Tt({onJumpToBottom:r,onSendKey:k}){return e.jsxs("div",{className:"w-full border-t border-gray-700/50 bg-[#252525] px-4 py-2.5 flex items-center justify-between gap-3",children:[e.jsx("div",{className:"flex items-center gap-2",children:r&&e.jsxs(w,{variant:"outline",size:"sm",onClick:r,className:"h-8 text-xs bg-[#2d2d2d] border-gray-600 hover:bg-[#3d3d3d] text-gray-200 hover:text-white transition-colors",title:"Jump to bottom and set focus",children:[e.jsx(bt,{className:"h-3.5 w-3.5 sm:mr-1.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Jump to Bottom"})]})}),k&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>k(""),className:"h-8 px-2 flex items-center gap-1 rounded-md bg-[#2d2d2d] border border-gray-600 hover:bg-red-900/40 hover:border-red-700 text-gray-200 hover:text-red-300 transition-colors",title:"Send Ctrl+C (interrupt)",children:[e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"⌃"}),e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"C"})]}),e.jsxs("button",{onClick:()=>k(""),className:"h-8 px-2 flex items-center gap-1 rounded-md bg-[#2d2d2d] border border-gray-600 hover:bg-[#3d3d3d] hover:border-gray-500 text-gray-200 hover:text-white transition-colors",title:"Send Ctrl+Z (suspend)",children:[e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"⌃"}),e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"Z"})]}),e.jsx("button",{onClick:()=>k("\x1B"),className:"h-8 px-2 flex items-center gap-1 rounded-md bg-[#2d2d2d] border border-gray-600 hover:bg-[#3d3d3d] hover:border-gray-500 text-gray-200 hover:text-white transition-colors",title:"Send Escape key",children:e.jsx(oe,{className:"bg-gray-700/50 border-gray-600 text-gray-300",children:"Esc"})})]})]})}function Et({sessionId:r,onResize:k,onDestroy:I,pendingCommand:P,onCommandExecuted:E,showToolbar:W=!0}){const o=a.useRef(null),c=a.useRef(null),D=a.useRef(null),g=a.useRef(null),[C,n]=a.useState(!1),[d,u]=a.useState(null),[p,M]=a.useState(!0),f=a.useRef(0),y=5,x=a.useRef(null),m=a.useRef(null),R=a.useRef(P??null),b=a.useRef(!1),h=a.useRef(null),Y=a.useRef(E),X=a.useRef(I),H=a.useRef(k);a.useEffect(()=>{Y.current=E},[E]),a.useEffect(()=>{X.current=I},[I]),a.useEffect(()=>{H.current=k},[k]);const K=a.useCallback(N=>{!R.current||b.current||(h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{if(!R.current||b.current){h.current=null;return}g.current?.readyState===WebSocket.OPEN&&(g.current.send(JSON.stringify({type:"input",data:R.current+"\r"})),b.current=!0,Y.current?.()),h.current=null},N))},[]);a.useEffect(()=>{if(R.current=P??null,b.current=!1,!R.current){h.current!==null&&(window.clearTimeout(h.current),h.current=null);return}const N=g.current?.readyState===WebSocket.OPEN;return K(N?200:800),()=>{h.current!==null&&(window.clearTimeout(h.current),h.current=null)}},[P,r,K]),a.useEffect(()=>{n(!1),M(!0),u(null)},[r]),a.useEffect(()=>{if(!o.current||!r)return;const N=T=>{const v=T.getBoundingClientRect();return v.width>0&&v.height>0},A=new gt.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"'IBM Plex Mono', 'Source Code Pro', 'Fira Code', ui-monospace, Menlo, Monaco, monospace",lineHeight:1.35,letterSpacing:.5,convertEol:!0,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",cursorAccent:"#1a1b26",selectionBackground:"#33467c",selectionForeground:"#c0caf5",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}}),_=new pt.FitAddon,fe=new At.WebLinksAddon;A.loadAddon(_),A.loadAddon(fe),A.open(o.current),c.current=A,D.current=_;let S=null,B=null;const U=()=>{if(!A||!A.element||!A.element.parentElement)return;const T=A.cols??0,v=A.rows??0;if(T>0&&v>0){g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"resize",cols:T,rows:v}));const O=H.current;O&&O(T,v)}},ae=()=>{const T=o.current;if(T&&N(T)&&!(!A||!A.element||!A.element.parentElement))try{const v=T.getBoundingClientRect();if(v.width<10||v.height<10)return;_.fit(),U()}catch(v){console.warn("xterm fit() failed, will retry if needed:",v)}},j=()=>{S&&cancelAnimationFrame(S),S=requestAnimationFrame(()=>{ae()})},Q=()=>{if(!r)return;x.current&&(window.clearTimeout(x.current),x.current=null);const T=`${Ye}/ws/terminal/${r}`,v=new WebSocket(T);return g.current=v,v.onopen=()=>{n(!0),u(null),f.current=0,console.log("Terminal WebSocket connected"),m.current&&window.clearInterval(m.current),m.current=window.setInterval(()=>{v.readyState===WebSocket.OPEN&&v.send(JSON.stringify({type:"keepalive"}))},120*1e3),j(),setTimeout(()=>{M(!1),j(),setTimeout(()=>j(),50),setTimeout(()=>j(),150)},400),K(1200)},v.onmessage=O=>{try{const L=JSON.parse(O.data);switch(L.type){case"snapshot":if(typeof L.data=="string"&&L.data.length&&c.current){const z=c.current;z.write(L.data,()=>{z.scrollToBottom()})}break;case"data":if(c.current){const z=c.current,V=z.buffer.active.viewportY+z.rows>=z.buffer.active.baseY+z.buffer.active.cursorY;z.write(L.data,()=>{V&&z.scrollToBottom()})}break;case"exit":c.current&&c.current.write(`\r
|
|
2
2
|
\x1B[31mProcess exited with code ${L.exitCode}\x1B[0m\r
|
|
3
3
|
`),X.current?.();break}}catch(L){console.error("Error parsing WebSocket message:",L)}},v.onclose=O=>{if(n(!1),console.log("Terminal WebSocket disconnected",O.code,O.reason),m.current&&(window.clearInterval(m.current),m.current=null),O.code!==1e3&&f.current<y&&r){f.current++;const L=Math.min(1e3*Math.pow(2,f.current-1),1e4);console.log(`Attempting to reconnect (${f.current}/${y}) in ${L}ms`),x.current=window.setTimeout(()=>{Q()},L)}else f.current>=y&&u("Connection lost. Please refresh the page to reconnect.")},v.onerror=O=>{console.error("Terminal WebSocket error:",O),f.current===0&&u("WebSocket connection failed")},v};Q(),A.onData(T=>{g.current?.readyState===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"input",data:T}))});const J=()=>{j()},ne=new ResizeObserver(J);o.current&&ne.observe(o.current),window.addEventListener("resize",J),window.addEventListener("orientationchange",J);const G=()=>{document.visibilityState==="visible"&&(B&&clearTimeout(B),B=window.setTimeout(()=>{j()},50))};document.addEventListener("visibilitychange",G);let ie=0;const ce=20,me=()=>{const T=o.current;if(T){if(N(T)){ae();return}ie+=1,ie<ce?S=requestAnimationFrame(me):B=window.setTimeout(()=>{ae()},100)}};return S=requestAnimationFrame(me),()=>{ne.disconnect(),window.removeEventListener("resize",J),window.removeEventListener("orientationchange",J),document.removeEventListener("visibilitychange",G),S&&cancelAnimationFrame(S),B&&clearTimeout(B),x.current&&(window.clearTimeout(x.current),x.current=null),m.current&&(window.clearInterval(m.current),m.current=null),g.current?.readyState===WebSocket.OPEN&&g.current.close(),h.current!==null&&(window.clearTimeout(h.current),h.current=null),A.dispose()}},[r,K]);const he=a.useCallback(()=>{c.current&&(c.current.scrollToBottom(),c.current.focus())},[]),te=a.useCallback(N=>{g.current?.readyState===WebSocket.OPEN&&(g.current.send(JSON.stringify({type:"input",data:N})),c.current&&c.current.focus())},[]);return d?e.jsx("div",{className:"flex items-center justify-center h-full bg-red-50 border border-red-200 rounded-lg",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-600 font-medium",children:"Terminal Connection Error"}),e.jsx("div",{className:"text-red-500 text-sm mt-1",children:d})]})}):e.jsxs("div",{className:"relative h-full flex flex-col bg-[#1a1b26] overflow-hidden",children:[!C&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#1a1b26] bg-opacity-95 z-10 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto"}),e.jsx("div",{className:"text-gray-300 mt-2",children:"Connecting to terminal..."})]})}),C&&p&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[#1a1b26] bg-opacity-50 z-10 transition-opacity duration-300 backdrop-blur-sm",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-pulse rounded-full h-6 w-6 bg-blue-500 mx-auto"}),e.jsx("div",{className:"text-gray-300 text-sm mt-2",children:"Loading terminal..."})]})}),e.jsx("div",{ref:o,className:"flex-1 w-full overflow-hidden",style:{minHeight:"400px"}}),W&&e.jsx(Tt,{onJumpToBottom:he,onSendKey:te})]})}const Wt=r=>r?Array.isArray(r)?r.filter(k=>typeof k=="string").map(k=>k.trim()).filter(Boolean):typeof r=="string"?r.split(",").map(k=>k.trim()).filter(Boolean):[]:[];function Xt(){const{taskId:r}=Xe(),k=Qe(),I=et(),[P]=tt(),{toast:E}=rt(),W=r?.startsWith("session-"),o=a.useMemo(()=>!!r&&r.startsWith("cp-"),[r]),c=a.useMemo(()=>!!r&&r.startsWith("sk-"),[r]),D=P.get("reviewOnly")==="true",g=P.get("startOnly")==="true",C=o&&!g,n=!D,d=a.useMemo(()=>c&&r?r.replace("sk-",""):null,[c,r]),{sessions:u,loading:p,error:M,createSession:f,destroySession:y,refreshSessions:x}=ft(),[m,R]=a.useState([]),[b,h]=a.useState(null),[Y,X]=a.useState(null),[H,K]=a.useState("claude"),[he,te]=a.useState(!1),[N,A]=a.useState("claude"),[_,fe]=a.useState([]),[S,B]=a.useState([]),[U,ae]=a.useState([]),[j,Q]=a.useState([]),[J,ne]=a.useState(!0),[G,ie]=a.useState(""),[ce,me]=a.useState(!1),[T,v]=a.useState({}),[O,L]=a.useState(null),z=a.useRef([]),[V,Pe]=a.useState("current"),[ue,Ve]=a.useState("main"),ee=a.useMemo(()=>r?`terminal.cp.config.${r}`:null,[r]);a.useEffect(()=>{if(!(!o&&!c||!ee))try{const t=localStorage.getItem(ee);if(t){const s=JSON.parse(t);s.cliAgent&&A(s.cliAgent),Array.isArray(s.selectedMcpServers)&&B(s.selectedMcpServers),Array.isArray(s.selectedSkillIds)&&Q(s.selectedSkillIds),typeof s.automationEnabled=="boolean"&&ne(s.automationEnabled),typeof s.customInstruction=="string"&&ie(s.customInstruction),typeof s.createWorktree=="boolean"&&me(s.createWorktree),s.branchMode&&Pe(s.branchMode)}}catch{console.error("Failed to load config",ee)}},[o,c,ee]);const ge=a.useCallback(()=>{if(!ee)return;const t={cliAgent:N,selectedMcpServers:S,selectedSkillIds:j,automationEnabled:J,customInstruction:G,createWorktree:ce,branchMode:V};try{localStorage.setItem(ee,JSON.stringify(t))}catch{console.error("Failed to persist config",ee)}},[ee,N,S,j,J,G,ce,V]);a.useEffect(()=>{ge()},[G,ge]);const re=t=>`feat/cp-${t.startsWith("cp-")?t.slice(5):t}`,qe=async t=>{try{const s=re(t),l=await(await fetch(`${de}/api/v1/git/branches`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,from:ue})})).json();if(!l.success){const F=l.error?.message||"Unknown error";return E({title:"Branch creation failed",description:F,variant:"destructive"}),!1}return E({title:"Branch created",description:`Created branch: ${s}`}),!0}catch{return E({title:"Branch creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}},Le=async t=>{try{const s=re(t),l=await(await fetch(`${de}/api/v1/git/worktrees`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:s,from:ue})})).json();if(!l.success){const F=l.error?.message||"Unknown error";return E({title:"Worktree creation failed",description:F,variant:"destructive"}),!1}return E({title:"Worktree created",description:`Created branch: ${s}`}),!0}catch{return E({title:"Worktree creation failed",description:"Network error or invalid response",variant:"destructive"}),!1}};a.useEffect(()=>{(o||c)&&r&&(async()=>{try{const s=await fetch(`${de}/api/v1/git/status`);if(s.ok){const l=await s.json();l?.success&&l.data?.branch&&Ve(l.data.branch)}const i=await fetch(`${de}/api/v1/mcp`);if(i.ok){const l=await i.json();l?.success&&Array.isArray(l.servers)&&(fe(l.servers),B(F=>F.filter(q=>l.servers.includes(q))),l.mcpServers&&typeof l.mcpServers=="object"&&v(l.mcpServers))}}catch(s){console.error("Failed to load MCP servers",s)}try{const s=await fetch(`${de}/api/v1/skills`);if(s.ok){const i=await s.json(),F=(Array.isArray(i?.documents)?i.documents:[]).map(q=>({id:q.id,name:q?.metadata?.name||q.id,mcpServers:Wt(q?.metadata?.metadata?.mcpServers)}));ae(F),Q(q=>{const le=q.filter(Z=>F.some(be=>be.id===Z));if(c&&d&&le.length===0){const Z=F.find(be=>be.id===d);if(Z)return[Z.id]}return le})}}catch(s){console.error("Failed to load skills",s)}})()},[o,c,r,d]),a.useEffect(()=>{const t=z.current,s=j.filter(i=>!t.includes(i));s.length>0&&B(i=>{const l=new Set(i),F=_.length>0?new Set(_):void 0;return s.forEach(q=>{const le=U.find(Z=>Z.id===q);le&&le.mcpServers.forEach(Z=>{(!F||F.has(Z))&&l.add(Z)})}),Array.from(l)}),z.current=j},[j,U,_]),a.useEffect(()=>{r&&x(r)},[r,x]),a.useEffect(()=>{if(!r)return;const s=u.filter(i=>i.taskId===r).map(i=>i.id);R(s),!b&&s.length>0&&h(s[0]),b&&!s.includes(b)&&h(s.length>0?s[0]:null)},[u,r,b]);const se=async t=>{if(!r)return;const s=t||void 0,i=await f(r,s);i&&(h(i),!s&&t&&X(t),setTimeout(()=>x(r),100))},Me=(t,s)=>{const l={taskId:r,contextType:s??(o?"change-task":c?"skill":"general"),selectedMcpServers:S,selectedSkillIds:j,automationEnabled:J,customInstruction:G};switch(t){case"claude":return Je(l);case"gemini":return wt(l);case"codex":return jt(l);case"droid":return yt(l);case"kiro":return vt(l);default:return Je(l)}},pe=async()=>{o&&r&&(V==="new-branch"?await qe(r)||console.warn("Branch creation failed, continuing with terminal creation"):V==="new-worktree"&&(await Le(r)||console.warn("Worktree creation failed, continuing with terminal creation"))),o&&ce&&V==="current"&&r&&(await Le(r)||console.warn("Worktree creation failed, continuing with terminal creation"));const s=Me(o||c?N:H);await se(s)},He=async()=>{const s=Me(N,"prepare-task");await se(s)},Re=async t=>{if(await y(t)&&b===t){const i=m.filter(l=>l!==t);i.length>0?h(i[0]):r?.startsWith("session-")?I("/agents"):h(null)}},Ke=t=>{Re(t)},Ze=async()=>{for(const t of m)await y(t);I("/agents")};return r?e.jsxs("div",{className:"flex flex-col h-full",children:[W&&m.length===0&&r&&e.jsx(Pt,{taskId:r,onStart:se,locationSearch:k.search}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-lg",children:o||c?e.jsx(Te,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):e.jsx(ve,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:W?"Terminal":"Agent Session"}),!W&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-mono",children:r}),W&&e.jsxs("span",{className:"text-sm text-gray-500 font-mono",children:["(",r,")"]})]})]})}),e.jsx("div",{className:"flex items-center gap-2 sm:gap-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(w,{variant:"outline",size:"sm",onClick:()=>r&&x(r),disabled:p,className:"bg-white dark:bg-gray-800",children:[e.jsx(kt,{className:`h-4 w-4 sm:mr-2 ${p?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]}),e.jsx(w,{size:"sm",variant:"destructive",onClick:Ze,title:"Close session","aria-label":"Close session",className:"h-9 w-9 p-0",children:e.jsx(ye,{className:"h-4 w-4"})}),!W&&!o&&!c&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ke,{value:H,onValueChange:K,children:[e.jsx(Ne,{className:"w-24",children:e.jsx(Se,{})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]}),e.jsxs(w,{onClick:pe,disabled:p,size:"sm",variant:"default",className:"bg-green-600 hover:bg-green-700",children:[e.jsx(Ee,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Start Agent"})]})]}),!o&&!c&&(!W||m.length===0)&&e.jsxs(w,{onClick:()=>se(),disabled:p,size:"sm",children:[e.jsx(je,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"New Terminal"})]})]})})]}),M&&e.jsx("div",{className:"mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-xl",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-1.5 bg-red-100 dark:bg-red-900/40 rounded-lg flex-shrink-0",children:e.jsx(ye,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),e.jsx("div",{className:"text-red-800 dark:text-red-200 text-sm font-medium",children:M})]})}),m.length>0&&e.jsx("div",{className:"flex items-center gap-1 border-b dark:border-gray-700",children:m.map(t=>{const s=u.find(l=>l.id===t),i=b===t;return e.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 border-b-1 cursor-pointer rounded-t-lg transition-all duration-200 ${i?"border-gray-400 bg-white dark:bg-gray-800 dark:border-gray-500 shadow-sm":"border-transparent hover:bg-gray-50 dark:hover:bg-gray-800 hover:border-gray-300"}`,onClick:()=>h(t),children:[e.jsx("div",{className:`p-1.5 rounded-md ${i?"bg-gray-200 dark:bg-gray-700":"bg-gray-100 dark:bg-gray-700"}`,children:e.jsx(ve,{className:`h-3.5 w-3.5 ${i?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400"}`})}),e.jsxs("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["Terminal ",t.split("-").slice(-1)[0].substring(0,6)]}),e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s?.connected?"bg-green-500":"bg-gray-400"}`}),e.jsx(w,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-red-100 dark:hover:bg-red-900/30 rounded-md opacity-60 hover:opacity-100 transition-opacity",onClick:l=>{l.stopPropagation(),Re(t)},children:e.jsx(ye,{className:"h-3 w-3"})})]},t)})}),e.jsx("div",{className:"flex-1 min-h-0",children:m.length===0?e.jsx(mt,{className:"h-full",children:e.jsx(ut,{className:"flex items-center justify-center h-full p-8",children:e.jsxs("div",{className:"text-center w-full max-w-[33vw] min-w-[400px]",children:[e.jsx("div",{className:"p-2 bg-gray-100 dark:bg-gray-800 rounded-full w-fit mx-auto mb-2",children:o||c?e.jsx(we,{className:"h-8 w-8 text-gray-600 dark:text-gray-400"}):e.jsx(ve,{className:"h-8 w-8 text-gray-600 dark:text-gray-400"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 mb-3",children:"Prepare Agent"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6 leading-relaxed",children:W?"Create a new terminal session":e.jsxs(e.Fragment,{children:["Configure the agent to start working on ",r,"."]})}),e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[!W&&!o&&!c&&e.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:[e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Choose your AI agent"}),e.jsxs(ke,{value:H,onValueChange:K,children:[e.jsx(Ne,{className:"w-full h-11 bg-white dark:bg-gray-800",children:e.jsx(Se,{})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code (default)"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs(w,{onClick:pe,disabled:p,className:"bg-green-600 hover:bg-green-700 w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(Ee,{className:"h-5 w-5 mr-2"}),"Start Agent"]}),e.jsxs("div",{className:"flex items-center gap-3 w-full",children:[e.jsx("div",{className:"flex-1 h-px bg-gray-300 dark:bg-gray-600"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 font-medium",children:"or"}),e.jsx("div",{className:"flex-1 h-px bg-gray-300 dark:bg-gray-600"})]}),e.jsxs(w,{onClick:()=>se(),disabled:p,variant:"outline",className:"w-full h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(je,{className:"h-5 w-5 mr-2"}),"New Terminal"]})]}),!W&&(o||c)&&e.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:[C&&e.jsxs(w,{onClick:He,disabled:p,className:"w-full bg-blue-600 hover:bg-blue-700 h-11 text-base font-medium",size:"lg",children:[e.jsx(Nt,{className:"h-5 w-5 mr-2"}),"Review & Prepare"]}),e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsxs(w,{variant:"outline",onClick:()=>te(!0),className:"flex-1 h-11 bg-white dark:bg-gray-800",size:"lg",children:[e.jsx(st,{className:"h-5 w-5 mr-2"}),"Configure"]}),n&&e.jsxs(w,{onClick:pe,disabled:p,className:"flex-1 bg-green-600 hover:bg-green-700 h-11 text-base font-medium",size:"lg",children:[e.jsx(Ee,{className:"h-5 w-5 mr-2"}),"Start Agent"]})]}),e.jsxs("div",{className:"w-full space-y-3",children:[e.jsx("div",{className:"text-xs uppercase font-semibold text-gray-500 dark:text-gray-400",children:"Agent Configuration"}),e.jsxs("div",{className:"text-left text-sm text-gray-700 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Agent:"}),e.jsx("span",{className:"font-mono text-sm",children:N==="claude"?"Claude Code":N.charAt(0).toUpperCase()+N.slice(1)})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Te,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400 mt-0.5"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Skills:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:j.length?j.map(t=>{const s=U.find(i=>i.id===t);return e.jsx(De,{variant:"secondary",className:"font-mono text-xs",children:s?.name||t},t)}):e.jsx("span",{className:"font-mono text-sm text-gray-500",children:"None"})})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ge,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400 mt-0.5"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"MCP Servers:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:S.length?S.map(t=>e.jsx(De,{variant:"secondary",className:"font-mono text-xs",children:t},t)):e.jsx("span",{className:"font-mono text-sm text-gray-500",children:"None"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(at,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Full Environment Access:"}),e.jsx("span",{className:"font-mono text-sm",children:J?"Enabled":"Disabled"})]}),o&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(nt,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),e.jsx("span",{className:"font-medium text-gray-600 dark:text-gray-400",children:"Branch:"}),e.jsx("span",{className:"font-mono text-sm",children:V==="current"?`Current (${ue})`:V==="new-branch"?`New branch (${re(r||"")})`:`New worktree (${re(r||"")})`})]})]}),e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2 text-gray-700 dark:text-gray-300",children:[e.jsx(St,{className:"h-3.5 w-3.5 text-gray-500 dark:text-gray-400"}),"Additional Instructions"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[G.length,"/500"]})]}),e.jsx("textarea",{className:"w-full min-h-[80px] rounded-md border p-3 text-sm bg-gray-50 dark:bg-gray-900/50 border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 resize-none",placeholder:"Add specific instructions to guide the agent...",value:G,onChange:t=>ie(t.target.value),rows:3}),G.length>500&&e.jsx("div",{className:"text-xs text-red-600 mt-1",children:"Custom instruction is too long (max 500 characters)"})]})]})]}),W&&m.length===0&&e.jsx("div",{className:"p-6 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm bg-gradient-to-br from-white to-gray-50 dark:from-gray-800 dark:to-gray-900 w-full",children:e.jsxs(w,{onClick:()=>se(),disabled:p,className:"w-full h-11 text-base font-medium",size:"lg",children:[e.jsx(je,{className:"h-5 w-5 mr-2"}),"New Terminal"]})})]})]})})}):b?e.jsx("div",{className:"h-full overflow-hidden rounded-b-lg",children:e.jsx(Et,{sessionId:b,onDestroy:()=>Ke(b),pendingCommand:Y,onCommandExecuted:()=>X(null),showToolbar:!0})}):null}),e.jsx(it,{open:he,onOpenChange:te,children:e.jsxs(ct,{className:"max-w-3xl max-h-[85vh] overflow-y-auto",children:[e.jsxs(lt,{children:[e.jsx(ot,{children:"Configure Agent"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Customize the agent's capabilities and configure it's environment."})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4"}),"Agent"]}),e.jsxs(ke,{value:N,onValueChange:t=>A(t),children:[e.jsx(Ne,{className:"w-full",children:e.jsx(Se,{placeholder:"Select agent"})}),e.jsxs(Ce,{children:[e.jsx($,{value:"claude",children:"Claude Code"}),e.jsx($,{value:"gemini",children:"Google Gemini"}),e.jsx($,{value:"codex",children:"OpenAI Codex"}),e.jsx($,{value:"droid",children:"Factory Droid"}),e.jsx($,{value:"kiro",children:"Kiro"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Te,{className:"h-4 w-4"}),"Skills"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[j.length," of ",U.length," selected"]})]}),e.jsxs(Be,{children:[e.jsx(Oe,{asChild:!0,children:e.jsxs(w,{variant:"outline",className:"w-full justify-between",children:[j.length===0?"Select skills...":j.length===U.length?"All skills selected":`${j.length} skill${j.length!==1?"s":""} selected`,e.jsx($e,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(Ie,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(_e,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Skills"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),Q(U.map(s=>s.id))},children:"All"}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),Q([])},children:"None"})]})]}),e.jsx(ze,{}),U.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No skills found"}):U.map(t=>e.jsx(Fe,{checked:j.includes(t.id),onCheckedChange:s=>{Q(i=>s?i.includes(t.id)?i:[...i,t.id]:i.filter(l=>l!==t.id))},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{children:t.name}),t.mcpServers.length>0&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["MCP servers: ",t.mcpServers.join(", ")]}),t.mcpServers.length===0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"Inherits available MCP servers"})]})},t.id))]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Ge,{className:"h-4 w-4"}),"MCP Servers"]}),e.jsxs("div",{className:"text-xs text-gray-500",children:[S.length," of ",_.length," selected"]})]}),e.jsxs(Be,{children:[e.jsx(Oe,{asChild:!0,children:e.jsxs(w,{variant:"outline",className:"w-full justify-between",children:[S.length===0?"Select MCP servers...":S.length===_.length?"All servers selected":`${S.length} server${S.length!==1?"s":""} selected`,e.jsx($e,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(Ie,{className:"w-full min-w-[--radix-dropdown-menu-trigger-width]",children:[e.jsxs(_e,{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Available Servers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),B(_)},children:"All"}),e.jsx(w,{size:"sm",variant:"ghost",className:"h-5 px-1 text-xs",onClick:t=>{t.preventDefault(),B([])},children:"None"})]})]}),e.jsx(ze,{}),_.length===0?e.jsx("div",{className:"px-2 py-1.5 text-sm text-gray-500",children:"No MCP servers found"}):_.map(t=>e.jsx(Fe,{checked:S.includes(t),onCheckedChange:s=>{B(i=>s?i.includes(t)?i:[...i,t]:i.filter(l=>l!==t))},children:t},t))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-md bg-amber-50/50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800",children:[e.jsx(dt,{id:"automation",checked:J,onCheckedChange:t=>ne(t===!0),className:"data-[state=checked]:bg-red-600 data-[state=checked]:border-red-600 data-[state=checked]:text-white border-red-400",disabled:N==="droid"}),e.jsx("label",{htmlFor:"automation",className:"text-sm font-medium text-red-600 dark:text-red-400 cursor-pointer",children:"Full environment access (recommended in secure environments only)"})]}),N==="droid"&&e.jsxs("p",{className:"text-xs text-muted-foreground px-1",children:[e.jsx("span",{className:"font-medium",children:"Droid:"})," Automation level is set in the REPL. Press ",e.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px] font-mono",children:"shift+tab"})," to cycle through Off → Low → Medium → High."]})]}),o&&e.jsx(ht,{title:"Advanced Settings",description:"Configure branch and worktree options",defaultOpen:!1,children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{children:[e.jsx(xe,{className:"text-sm font-medium mb-3 block",children:"Branch Management"}),e.jsxs(xt,{value:V,onValueChange:t=>Pe(t),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"current",id:"branch-current"}),e.jsxs(xe,{htmlFor:"branch-current",className:"cursor-pointer font-normal",children:["Stay on current branch (",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:ue}),")"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"new-branch",id:"branch-new"}),e.jsxs(xe,{htmlFor:"branch-new",className:"cursor-pointer font-normal",children:["Create new branch: ",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:re(r||"")})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Ae,{value:"new-worktree",id:"branch-worktree"}),e.jsxs(xe,{htmlFor:"branch-worktree",className:"cursor-pointer font-normal",children:["Create new worktree: ",e.jsx("code",{className:"text-xs font-mono bg-muted px-1 py-0.5 rounded",children:re(r||"")})]})]})]})]})})}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(w,{variant:"outline",onClick:()=>te(!1),children:"Close"}),e.jsx(w,{onClick:()=>{if(G.length>500){L("Please shorten the custom instruction to 500 characters.");return}L(null),ge(),te(!1)},children:"Save"})]}),O&&e.jsx("div",{className:"text-xs text-red-600 text-right",children:O})]})]})})]}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-600 font-medium",children:"Invalid Task ID"}),e.jsx(w,{onClick:()=>I("/tasks"),className:"mt-4",children:"Back to Tasks"})]})})}function Pt({taskId:r,onStart:k,locationSearch:I}){return a.useEffect(()=>{if(!r)return;const P=new URLSearchParams(I);if(!P.has("autostart"))return;const E=`terminal.autostart.${r}`;if(sessionStorage.getItem(E)==="done")return;sessionStorage.setItem(E,"done");const o=P.get("run")||void 0;k(o||void 0)},[r]),null}export{Xt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,a as k,by as N,A as g,j as e,bB as b,I as P,B as y}from"./index-
|
|
1
|
+
import{r as i,a as k,by as N,A as g,j as e,bB as b,I as P,B as y}from"./index-C0uIENKu.js";import{C as F,b as w,c as T,d as L,a as D}from"./card-CEBVsJGA.js";import{L as o}from"./label-DXN216Ba.js";import{S as h,a as u,b as m,c as f,d as a}from"./select-BLUGdloJ.js";import"./index-4_sGNb1Z.js";import"./chevron-up-CLuT-8K8.js";const r={theme:"coconut",defaultEditor:"cursor",terminalShell:"bash",autoSaveInterval:60,notifications:{email:!1,desktop:!1,slack:!1}};function V(s){return{theme:s?.theme??r.theme,defaultEditor:s?.defaultEditor??r.defaultEditor,terminalShell:s?.terminalShell??r.terminalShell,autoSaveInterval:s?.autoSaveInterval??r.autoSaveInterval,notifications:{email:s?.notifications?.email??r.notifications.email,desktop:s?.notifications?.desktop??r.notifications.desktop,slack:s?.notifications?.slack??r.notifications.slack}}}function $(){const[s,v]=i.useState(r),[C,E]=i.useState(!0),[c,x]=i.useState(!1),{toast:d}=k(),{theme:j,setTheme:p}=N();i.useEffect(()=>{S()},[]),i.useEffect(()=>{s.theme!==j&&p(s.theme)},[s.theme,j,p]);const S=async()=>{try{const l=await(await fetch(`${g}/api/v1/user/settings`)).json();l.success&&v(V(l.data.preferences))}catch(t){console.error("Failed to load preferences:",t),d({title:"Error",description:"Failed to load user preferences",variant:"destructive"})}finally{E(!1)}},I=async()=>{x(!0);try{const l=await(await fetch(`${g}/api/v1/user/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:s})})).json();if(l.success)d({title:"Preferences saved",description:"Your personal preferences have been updated."});else throw new Error(l.error)}catch(t){console.error("Failed to save preferences:",t),d({title:"Error",description:"Failed to save preferences",variant:"destructive"})}finally{x(!1)}},n=t=>{v(l=>({...l,...t,notifications:{...l.notifications,...t.notifications}}))};return C?e.jsx("div",{children:"Loading..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"User Preferences"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure defaults for editors, shells, themes, and notifications."})]}),e.jsx(b,{}),e.jsxs(F,{children:[e.jsxs(w,{children:[e.jsx(T,{children:"Workspace Defaults"}),e.jsx(L,{children:"Set the defaults Coconut uses when creating sessions and surfaces."})]}),e.jsxs(D,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"theme",children:"Theme"}),e.jsxs(h,{value:s.theme,onValueChange:t=>n({theme:t}),children:[e.jsx(u,{id:"theme",children:e.jsx(m,{placeholder:"Select theme"})}),e.jsxs(f,{children:[e.jsx(a,{value:"coconut",children:"Coconut"}),e.jsx(a,{value:"system",children:"System"}),e.jsx(a,{value:"light",children:"Light"}),e.jsx(a,{value:"dark",children:"Dark"})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"System follows your OS preference. Coconut is the default branded theme."})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"defaultEditor",children:"Default Editor"}),e.jsxs(h,{value:s.defaultEditor,onValueChange:t=>n({defaultEditor:t}),children:[e.jsx(u,{id:"defaultEditor",children:e.jsx(m,{placeholder:"Select editor"})}),e.jsxs(f,{children:[e.jsx(a,{value:"cursor",children:"Cursor"}),e.jsx(a,{value:"vscode",children:"VS Code"}),e.jsx(a,{value:"vim",children:"Vim"}),e.jsx(a,{value:"emacs",children:"Emacs"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"terminalShell",children:"Preferred Shell"}),e.jsxs(h,{value:s.terminalShell,onValueChange:t=>n({terminalShell:t}),children:[e.jsx(u,{id:"terminalShell",children:e.jsx(m,{placeholder:"Select shell"})}),e.jsxs(f,{children:[e.jsx(a,{value:"bash",children:"Bash"}),e.jsx(a,{value:"zsh",children:"Zsh"}),e.jsx(a,{value:"fish",children:"Fish"}),e.jsx(a,{value:"sh",children:"sh"}),e.jsx(a,{value:"system",children:"System Default"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"autoSaveInterval",children:"Auto-save Interval (seconds)"}),e.jsx(P,{id:"autoSaveInterval",type:"number",min:10,max:600,value:s.autoSaveInterval,onChange:t=>n({autoSaveInterval:Number.parseInt(t.target.value,10)||r.autoSaveInterval})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Controls how often Coconut persists draft work to disk."})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(y,{variant:"outline",onClick:S,disabled:c,children:"Reset"}),e.jsx(y,{onClick:I,disabled:c,children:c?"Saving...":"Save Preferences"})]})]})}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,a as S,A as x,j as e,bB as b,B as g,I as d,L as w}from"./index-
|
|
1
|
+
import{r as i,a as S,A as x,j as e,bB as b,B as g,I as d,L as w}from"./index-C0uIENKu.js";import{C as E,b as I,c as F,d as L,a as D}from"./card-CEBVsJGA.js";import{L as m}from"./label-DXN216Ba.js";import{C as P,a as T}from"./clipboard-DesoxJnQ.js";function R(){const[r,c]=i.useState({}),[o,l]=i.useState(null),[u,h]=i.useState(!1),[j,v]=i.useState(!0),[f,p]=i.useState(!1),{toast:n}=S();i.useEffect(()=>{C()},[]);const C=async()=>{try{try{const t=await fetch(`${x}/api/v1/config`),s=await t.json();if(t.ok&&s?.success){const a=s.data?.coconut||{};l(a.id??null),(a.firstName||a.lastName||a.email)&&c({firstName:a.firstName,lastName:a.lastName,email:a.email})}else l(null)}catch(t){console.error("Failed to load coconut config:",t),l(null)}}catch(t){console.error("Failed to load settings:",t),n({title:"Error",description:"Failed to load user settings",variant:"destructive"})}finally{v(!1)}},N=async()=>{p(!0);try{const s=await(await fetch(`${x}/api/v1/config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({coconut:{...r,id:o||void 0}})})).json();if(s.success)window.dispatchEvent(new CustomEvent("config-updated")),n({title:"Success",description:"Settings saved successfully"});else throw new Error(s.error||"Failed to save settings")}catch(t){console.error("Failed to save settings:",t),n({title:"Error",description:"Failed to save settings",variant:"destructive"})}finally{p(!1)}},y=async()=>{if(o)try{await navigator.clipboard.writeText(o),h(!0),n({title:"Copied",description:"Coconut ID copied to clipboard."}),setTimeout(()=>h(!1),1500)}catch(t){console.error("Failed to copy coconut ID:",t),n({title:"Copy failed",description:"Unable to copy the Coconut ID to the clipboard.",variant:"destructive"})}};return j?e.jsx("div",{children:"Loading..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Coconut Settings"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage the Coconut's profile information."})]}),e.jsx(b,{}),e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/40 p-4",children:o?e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"Coconut ID"}),e.jsx("p",{className:"mt-1 font-mono text-sm",children:o})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:y,children:[u?e.jsx(P,{className:"h-4 w-4"}):e.jsx(T,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-2",children:u?"Copied":"Copy"})]})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"text-sm font-medium text-muted-foreground",children:"Coconut ID not configured"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Add an `id` under the `coconut` section in `.nut/config.json` to register this Coconut instance."})]})}),e.jsxs(E,{children:[e.jsxs(I,{children:[e.jsx(F,{children:"Coconut Profile"}),e.jsx(L,{children:"Update the Coconut's identifying details."})]}),e.jsxs(D,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(m,{htmlFor:"firstName",children:"First Name"}),e.jsx(d,{id:"firstName",value:r.firstName||"",onChange:t=>c(s=>({...s,firstName:t.target.value})),placeholder:"Enter first name"})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"lastName",children:"Last Name"}),e.jsx(d,{id:"lastName",value:r.lastName||"",onChange:t=>c(s=>({...s,lastName:t.target.value})),placeholder:"Enter last name"})]})]}),e.jsxs("div",{children:[e.jsx(m,{htmlFor:"email",children:"Email"}),e.jsx(d,{id:"email",type:"email",value:r.email||"",onChange:t=>c(s=>({...s,email:t.target.value})),placeholder:"Enter email address"})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can also manage the Coconut's identity to other agents on the"," ",e.jsx(w,{to:"/identity",className:"underline underline-offset-4 hover:text-primary",children:"Identity page"}),"."]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{onClick:N,disabled:f,children:f?"Saving...":"Save Changes"})})]})}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as L,a as F,r as n,A as C,j as s,B as m,v as b,a5 as M,I,Q,P as R,af as W,a6 as q}from"./index-
|
|
1
|
+
import{u as L,a as F,r as n,A as C,j as s,B as m,v as b,a5 as M,I,Q,P as R,af as W,a6 as q}from"./index-C0uIENKu.js";import{C as G,a as K}from"./card-CEBVsJGA.js";import{u as V}from"./use-terminal-GvBteSXs.js";import{C as X}from"./circle-play-B5pWyVQu.js";import{P as Y}from"./play-BHqUO04d.js";function A(){return`script-${Date.now()}-${Math.floor(Math.random()*1e3)}`}function T(o){return Object.entries(o).map(([l,r])=>({id:A(),name:l,command:r}))}function $(o){const l={};for(const r of o){const f=r.name.trim();f&&(l[f]=r.command)}return l}function ns(){const o=L(),{loading:l,createSession:r,refreshSessions:f}=V(),{toast:c}=F(),[O,h]=n.useState(!1),[P,p]=n.useState(!1),[g,j]=n.useState(!1),[B,D]=n.useState(!0),[d,u]=n.useState([]),[E,v]=n.useState({}),[,N]=n.useState([]),_=JSON.stringify($(d))!==JSON.stringify(E);n.useEffect(()=>{try{const e=localStorage.getItem("terminal.commandHistory");e&&N(JSON.parse(e))}catch{}},[]),n.useEffect(()=>{(async()=>{try{const t=await fetch(`${C}/api/v1/config`);if(!t.ok)return;const i=(await t.json())?.data?.scripts||{};v(i),u(T(i))}catch{}finally{D(!1)}})()},[]);const y=e=>{e&&N(t=>{const a=[e,...t.filter(i=>i!==e)].slice(0,5);try{localStorage.setItem("terminal.commandHistory",JSON.stringify(a))}catch{}return a})},z=n.useCallback(async()=>{const e=$(d),t=d.filter(a=>!a.name.trim()&&!a.command.trim()).length;j(!0);try{if(!(await fetch(`${C}/api/v1/config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scripts:e})})).ok)throw new Error("Save failed");v(e),u(T(e)),c({title:"Scripts saved",description:t>0?`${t} blank row${t>1?"s":""} removed`:void 0})}catch{c({title:"Failed to save scripts",variant:"destructive"})}finally{j(!1)}},[d,c]),S=()=>{u(e=>[...e,{id:A(),name:"",command:""}])},k=(e,t,a)=>{u(i=>i.map(x=>x.id===e?{...x,[t]:a}:x))},J=e=>{u(t=>t.filter(a=>a.id!==e))},U=async e=>{const t=(e||"").trim();if(!t)return;const a=`session-${Date.now()}`;h(!0);try{await r(a,t)?(y(t),c({title:"Session started",description:a}),o(`/terminal/${a}`)):c({title:"Failed to start",variant:"destructive"})}finally{h(!1)}},H=async e=>{const t=(e||"").trim();if(!t)return;const a=`session-${Date.now()}`;p(!0);try{await r(a,t)?(y(t),setTimeout(()=>f(),150),c({title:"Started in background",description:a,action:s.jsx(q,{altText:"Open session",onClick:()=>o(`/terminal/${a}`),children:"Open"})})):c({title:"Failed to start",variant:"destructive"})}finally{p(!1)}},w=l||O||P;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Utilities"}),s.jsx("p",{className:"text-muted-foreground",children:"Quick commands and shortcuts"})]}),s.jsx("div",{className:"flex items-center gap-2",children:_&&s.jsxs(m,{onClick:z,disabled:g,size:"sm",children:[g?s.jsx(b,{className:"h-4 w-4 mr-1 animate-spin"}):s.jsx(M,{className:"h-4 w-4 mr-1"}),"Save"]})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Scripts"}),s.jsx(G,{children:s.jsx(K,{className:"pt-6",children:B?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(b,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d.length>0?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"hidden sm:grid sm:grid-cols-[1fr_2fr_auto] gap-2 px-2 pb-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Name"}),s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Command"}),s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide w-[200px]",children:"Actions"})]}),s.jsx("div",{className:"rounded-md border divide-y",children:d.map(e=>s.jsxs("div",{className:"flex flex-col sm:grid sm:grid-cols-[1fr_2fr_auto] gap-2 p-2 items-start sm:items-center",children:[s.jsx(I,{value:e.name,onChange:t=>k(e.id,"name",t.target.value),placeholder:"script name",className:"h-8 text-sm font-medium"}),s.jsx(I,{value:e.command,onChange:t=>k(e.id,"command",t.target.value),placeholder:"command to run",className:"h-8 text-sm font-mono"}),s.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s.jsxs(m,{onClick:()=>H(e.command),variant:"secondary",size:"sm",disabled:w||!e.command.trim(),title:"Run in background",children:[s.jsx(X,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Background"})]}),s.jsxs(m,{onClick:()=>U(e.command),size:"sm",disabled:w||!e.command.trim(),title:"Run",children:[s.jsx(Y,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Run"})]}),s.jsx(m,{onClick:()=>J(e.id),variant:"ghost",size:"sm",title:"Remove script",children:s.jsx(Q,{className:"h-4 w-4"})})]})]},e.id))}),s.jsxs(m,{variant:"outline",size:"sm",onClick:S,className:"mt-2",children:[s.jsx(R,{className:"h-4 w-4 mr-1"}),"Add Script"]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3 py-8",children:[s.jsx(W,{className:"h-12 w-12 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No scripts configured"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-md leading-relaxed",children:"Scripts let you run common tasks with one click, like starting your development server or running build commands."})]}),s.jsxs(m,{variant:"outline",onClick:S,children:[s.jsx(R,{className:"h-4 w-4 mr-1"}),"Add Script"]})]})})})]})]})}export{ns as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as a,e as o}from"./index-
|
|
1
|
+
import{r,j as a,e as o}from"./index-C0uIENKu.js";const v=r.forwardRef(({className:e,variant:t="default",...s},d)=>{const l="relative w-full rounded-lg border px-4 py-3 text-sm [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",i=t==="destructive"?"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive":"bg-background text-foreground";return a.jsx("div",{ref:d,role:"alert",className:o(l,i,e),...s})});v.displayName="Alert";const c=r.forwardRef(({className:e,...t},s)=>a.jsx("div",{ref:s,className:o("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription";export{v as A,c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bC as o,j as n,e as a}from"./index-
|
|
1
|
+
import{bC as o,j as n,e as a}from"./index-C0uIENKu.js";const s=o("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i({className:r,variant:e,...t}){return n.jsx("div",{className:a(s({variant:e}),r),...t})}export{i as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as z,r,j as e,D as G,b as J,d as K,f as Q,I as V,v as M,S as W,e as X,a1 as Y,B}from"./index-
|
|
1
|
+
import{c as z,r,j as e,D as G,b as J,d as K,f as Q,I as V,v as M,S as W,e as X,a1 as Y,B}from"./index-C0uIENKu.js";import{B as v}from"./badge-CEhr50DH.js";import{a as Z}from"./registry-ANRa5WBi.js";import{S as O}from"./search-BBw4K5iK.js";/**
|
|
2
2
|
* @license lucide-react v0.542.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as d,e as t}from"./index-
|
|
1
|
+
import{r,j as d,e as t}from"./index-C0uIENKu.js";const o=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("rounded-xl border bg-card text-card-foreground shadow",a),...e}));o.displayName="Card";const c=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("flex flex-col space-y-1.5 p-6",a),...e}));c.displayName="CardHeader";const i=r.forwardRef(({className:a,...e},s)=>d.jsx("h3",{ref:s,className:t("font-semibold leading-none tracking-tight",a),...e}));i.displayName="CardTitle";const n=r.forwardRef(({className:a,...e},s)=>d.jsx("p",{ref:s,className:t("text-sm text-muted-foreground",a),...e}));n.displayName="CardDescription";const l=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("p-6 pt-0",a),...e}));l.displayName="CardContent";const f=r.forwardRef(({className:a,...e},s)=>d.jsx("div",{ref:s,className:t("flex items-center p-6 pt-0",a),...e}));f.displayName="CardFooter";export{o as C,l as a,c as b,i as c,n as d,f as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as W,E as i,s as U,C as B,t as n,L as C,b,q as E,i as u,f as M,j as v,l as N}from"./markdown-editor-DsIWl9E6.js";import"./index-C-It-oJ8.js";import"./index-CpVubLYu.js";const c=63,D=64,j=1,A=2,y=3,H=4,Z=5,F=6,I=7,z=65,K=66,J=8,OO=9,eO=10,aO=11,rO=12,V=13,tO=19,nO=20,oO=29,PO=33,QO=34,sO=47,lO=0,T=1,g=2,d=3,m=4;class s{constructor(e,a,r){this.parent=e,this.depth=a,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+a+(a<<4)+r}}s.top=new s(null,-1,lO);function X(O,e){for(let a=0,r=e-O.pos-1;;r--,a++){let o=O.peek(r);if(P(o)||o==-1)return a}}function x(O){return O==32||O==9}function P(O){return O==10||O==13}function _(O){return x(O)||P(O)}function l(O){return O<0||_(O)}const cO=new B({start:s.top,reduce(O,e){return O.type==d&&(e==nO||e==QO)?O.parent:O},shift(O,e,a,r){if(e==y)return new s(O,X(r,r.pos),T);if(e==z||e==Z)return new s(O,X(r,r.pos),g);if(e==c)return O.parent;if(e==tO||e==PO)return new s(O,0,d);if(e==V&&O.type==m)return O.parent;if(e==sO){let o=/[1-9]/.exec(r.read(r.pos,a.pos));if(o)return new s(O,O.depth+ +o[0],m)}return O},hash(O){return O.hash}});function f(O,e,a=0){return O.peek(a)==e&&O.peek(a+1)==e&&O.peek(a+2)==e&&l(O.peek(a+3))}const fO=new i((O,e)=>{if(O.next==-1&&e.canShift(D))return O.acceptToken(D);let a=O.peek(-1);if((P(a)||a<0)&&e.context.type!=d){if(f(O,45))if(e.canShift(c))O.acceptToken(c);else return O.acceptToken(j,3);if(f(O,46))if(e.canShift(c))O.acceptToken(c);else return O.acceptToken(A,3);let r=0;for(;O.next==32;)r++,O.advance();(r<e.context.depth||r==e.context.depth&&e.context.type==T&&(O.next!=45||!l(O.peek(1))))&&O.next!=-1&&!P(O.next)&&O.next!=35&&O.acceptToken(c,-r)}},{contextual:!0}),XO=new i((O,e)=>{if(e.context.type==d){O.next==63&&(O.advance(),l(O.next)&&O.acceptToken(I));return}if(O.next==45)O.advance(),l(O.next)&&O.acceptToken(e.context.type==T&&e.context.depth==X(O,O.pos-1)?H:y);else if(O.next==63)O.advance(),l(O.next)&&O.acceptToken(e.context.type==g&&e.context.depth==X(O,O.pos-1)?F:Z);else{let a=O.pos;for(;;)if(x(O.next)){if(O.pos==a)return;O.advance()}else if(O.next==33)G(O);else if(O.next==38)$(O);else if(O.next==42){$(O);break}else if(O.next==39||O.next==34){if(p(O,!0))break;return}else if(O.next==91||O.next==123){if(!RO(O))return;break}else{w(O,!0,!1,0);break}for(;x(O.next);)O.advance();if(O.next==58){if(O.pos==a&&e.canShift(oO))return;let r=O.peek(1);l(r)&&O.acceptTokenTo(e.context.type==g&&e.context.depth==X(O,a)?K:z,a)}}},{contextual:!0});function dO(O){return O>32&&O<127&&O!=34&&O!=37&&O!=44&&O!=60&&O!=62&&O!=92&&O!=94&&O!=96&&O!=123&&O!=124&&O!=125}function q(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function Y(O,e){return O.next==37?(O.advance(),q(O.next)&&O.advance(),q(O.next)&&O.advance(),!0):dO(O.next)||e&&O.next==44?(O.advance(),!0):!1}function G(O){if(O.advance(),O.next==60){for(O.advance();;)if(!Y(O,!0)){O.next==62&&O.advance();break}}else for(;Y(O,!1););}function $(O){for(O.advance();!l(O.next)&&S(O.next)!="f";)O.advance()}function p(O,e){let a=O.next,r=!1,o=O.pos;for(O.advance();;){let t=O.next;if(t<0)break;if(O.advance(),t==a)if(t==39)if(O.next==39)O.advance();else break;else break;else if(t==92&&a==34)O.next>=0&&O.advance();else if(P(t)){if(e)return!1;r=!0}else if(e&&O.pos>=o+1024)return!1}return!r}function RO(O){for(let e=[],a=O.pos+1024;;)if(O.next==91||O.next==123)e.push(O.next),O.advance();else if(O.next==39||O.next==34){if(!p(O,!0))return!1}else if(O.next==93||O.next==125){if(e[e.length-1]!=O.next-2)return!1;if(e.pop(),O.advance(),!e.length)return!0}else{if(O.next<0||O.pos>a||P(O.next))return!1;O.advance()}}const SO="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function S(O){return O<33?"u":O>125?"s":SO[O-33]}function k(O,e){let a=S(O);return a!="u"&&!(e&&a=="f")}function w(O,e,a,r){if(S(O.next)=="s"||(O.next==63||O.next==58||O.next==45)&&k(O.peek(1),a))O.advance();else return!1;let o=O.pos;for(;;){let t=O.next,Q=0,R=r+1;for(;_(t);){if(P(t)){if(e)return!1;R=0}else R++;t=O.peek(++Q)}if(!(t>=0&&(t==58?k(O.peek(Q+1),a):t==35?O.peek(Q-1)!=32:k(t,a)))||!a&&R<=r||R==0&&!a&&(f(O,45,Q)||f(O,46,Q)))break;if(e&&S(t)=="f")return!1;for(let h=Q;h>=0;h--)O.advance();if(e&&O.pos>o+1024)return!1}return!0}const iO=new i((O,e)=>{if(O.next==33)G(O),O.acceptToken(rO);else if(O.next==38||O.next==42){let a=O.next==38?eO:aO;$(O),O.acceptToken(a)}else O.next==39||O.next==34?(p(O,!1),O.acceptToken(OO)):w(O,!1,e.context.type==d,e.context.depth)&&O.acceptToken(J)}),kO=new i((O,e)=>{let a=e.context.type==m?e.context.depth:-1,r=O.pos;O:for(;;){let o=0,t=O.next;for(;t==32;)t=O.peek(++o);if(!o&&(f(O,45,o)||f(O,46,o))||!P(t)&&(a<0&&(a=Math.max(e.context.depth+1,o)),o<a))break;for(;;){if(O.next<0)break O;let Q=P(O.next);if(O.advance(),Q)continue O;r=O.pos}}O.acceptTokenTo(V,r)}),bO=U({DirectiveName:n.keyword,DirectiveContent:n.attributeValue,"DirectiveEnd DocEnd":n.meta,QuotedLiteral:n.string,BlockLiteralHeader:n.special(n.string),BlockLiteralContent:n.content,Literal:n.content,"Key/Literal Key/QuotedLiteral":n.definition(n.propertyName),"Anchor Alias":n.labelName,Tag:n.typeName,Comment:n.lineComment,": , -":n.separator,"?":n.punctuation,"[ ]":n.squareBracket,"{ }":n.brace}),gO=W.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:cO,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[bO],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[fO,XO,iO,kO,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),mO=W.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"⚠ Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),L=C.define({name:"yaml",parser:gO.configure({props:[u.add({Stream:O=>{for(let e=O.node.resolve(O.pos,-1);e&&e.to>=O.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return O.baseIndentFor(e);if(e.name=="BlockLiteral")return O.baseIndentFor(e)+O.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return O.column(e.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let a=O.column(e.from,1);if(a==O.lineIndent(e.from,1))return a;if(e.to>O.pos)return null}}return null},FlowMapping:v({closing:"}"}),FlowSequence:v({closing:"]"})}),M.add({"FlowMapping FlowSequence":N,"Item Pair BlockLiteral":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function vO(){return new b(L)}const xO=C.define({name:"yaml-frontmatter",parser:mO.configure({props:[U({DashLine:n.meta})]})});function DO(O){let{language:e,support:a}=O.content instanceof b?O.content:{language:O.content,support:[]};return new b(xO.configure({wrap:E(r=>r.name=="FrontmatterContent"?{parser:L.parser}:r.name=="Body"?{parser:e.parser}:null)}),a)}export{vO as yaml,DO as yamlFrontmatter,L as yamlLanguage};
|
|
1
|
+
import{a as W,E as i,s as U,C as B,t as n,L as C,b,q as E,i as u,f as M,j as v,l as N}from"./markdown-editor-MQ7X6BHT.js";import"./index-C0uIENKu.js";import"./index-4_sGNb1Z.js";const c=63,D=64,j=1,A=2,y=3,H=4,Z=5,F=6,I=7,z=65,K=66,J=8,OO=9,eO=10,aO=11,rO=12,V=13,tO=19,nO=20,oO=29,PO=33,QO=34,sO=47,lO=0,T=1,g=2,d=3,m=4;class s{constructor(e,a,r){this.parent=e,this.depth=a,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+a+(a<<4)+r}}s.top=new s(null,-1,lO);function X(O,e){for(let a=0,r=e-O.pos-1;;r--,a++){let o=O.peek(r);if(P(o)||o==-1)return a}}function x(O){return O==32||O==9}function P(O){return O==10||O==13}function _(O){return x(O)||P(O)}function l(O){return O<0||_(O)}const cO=new B({start:s.top,reduce(O,e){return O.type==d&&(e==nO||e==QO)?O.parent:O},shift(O,e,a,r){if(e==y)return new s(O,X(r,r.pos),T);if(e==z||e==Z)return new s(O,X(r,r.pos),g);if(e==c)return O.parent;if(e==tO||e==PO)return new s(O,0,d);if(e==V&&O.type==m)return O.parent;if(e==sO){let o=/[1-9]/.exec(r.read(r.pos,a.pos));if(o)return new s(O,O.depth+ +o[0],m)}return O},hash(O){return O.hash}});function f(O,e,a=0){return O.peek(a)==e&&O.peek(a+1)==e&&O.peek(a+2)==e&&l(O.peek(a+3))}const fO=new i((O,e)=>{if(O.next==-1&&e.canShift(D))return O.acceptToken(D);let a=O.peek(-1);if((P(a)||a<0)&&e.context.type!=d){if(f(O,45))if(e.canShift(c))O.acceptToken(c);else return O.acceptToken(j,3);if(f(O,46))if(e.canShift(c))O.acceptToken(c);else return O.acceptToken(A,3);let r=0;for(;O.next==32;)r++,O.advance();(r<e.context.depth||r==e.context.depth&&e.context.type==T&&(O.next!=45||!l(O.peek(1))))&&O.next!=-1&&!P(O.next)&&O.next!=35&&O.acceptToken(c,-r)}},{contextual:!0}),XO=new i((O,e)=>{if(e.context.type==d){O.next==63&&(O.advance(),l(O.next)&&O.acceptToken(I));return}if(O.next==45)O.advance(),l(O.next)&&O.acceptToken(e.context.type==T&&e.context.depth==X(O,O.pos-1)?H:y);else if(O.next==63)O.advance(),l(O.next)&&O.acceptToken(e.context.type==g&&e.context.depth==X(O,O.pos-1)?F:Z);else{let a=O.pos;for(;;)if(x(O.next)){if(O.pos==a)return;O.advance()}else if(O.next==33)G(O);else if(O.next==38)$(O);else if(O.next==42){$(O);break}else if(O.next==39||O.next==34){if(p(O,!0))break;return}else if(O.next==91||O.next==123){if(!RO(O))return;break}else{w(O,!0,!1,0);break}for(;x(O.next);)O.advance();if(O.next==58){if(O.pos==a&&e.canShift(oO))return;let r=O.peek(1);l(r)&&O.acceptTokenTo(e.context.type==g&&e.context.depth==X(O,a)?K:z,a)}}},{contextual:!0});function dO(O){return O>32&&O<127&&O!=34&&O!=37&&O!=44&&O!=60&&O!=62&&O!=92&&O!=94&&O!=96&&O!=123&&O!=124&&O!=125}function q(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function Y(O,e){return O.next==37?(O.advance(),q(O.next)&&O.advance(),q(O.next)&&O.advance(),!0):dO(O.next)||e&&O.next==44?(O.advance(),!0):!1}function G(O){if(O.advance(),O.next==60){for(O.advance();;)if(!Y(O,!0)){O.next==62&&O.advance();break}}else for(;Y(O,!1););}function $(O){for(O.advance();!l(O.next)&&S(O.next)!="f";)O.advance()}function p(O,e){let a=O.next,r=!1,o=O.pos;for(O.advance();;){let t=O.next;if(t<0)break;if(O.advance(),t==a)if(t==39)if(O.next==39)O.advance();else break;else break;else if(t==92&&a==34)O.next>=0&&O.advance();else if(P(t)){if(e)return!1;r=!0}else if(e&&O.pos>=o+1024)return!1}return!r}function RO(O){for(let e=[],a=O.pos+1024;;)if(O.next==91||O.next==123)e.push(O.next),O.advance();else if(O.next==39||O.next==34){if(!p(O,!0))return!1}else if(O.next==93||O.next==125){if(e[e.length-1]!=O.next-2)return!1;if(e.pop(),O.advance(),!e.length)return!0}else{if(O.next<0||O.pos>a||P(O.next))return!1;O.advance()}}const SO="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function S(O){return O<33?"u":O>125?"s":SO[O-33]}function k(O,e){let a=S(O);return a!="u"&&!(e&&a=="f")}function w(O,e,a,r){if(S(O.next)=="s"||(O.next==63||O.next==58||O.next==45)&&k(O.peek(1),a))O.advance();else return!1;let o=O.pos;for(;;){let t=O.next,Q=0,R=r+1;for(;_(t);){if(P(t)){if(e)return!1;R=0}else R++;t=O.peek(++Q)}if(!(t>=0&&(t==58?k(O.peek(Q+1),a):t==35?O.peek(Q-1)!=32:k(t,a)))||!a&&R<=r||R==0&&!a&&(f(O,45,Q)||f(O,46,Q)))break;if(e&&S(t)=="f")return!1;for(let h=Q;h>=0;h--)O.advance();if(e&&O.pos>o+1024)return!1}return!0}const iO=new i((O,e)=>{if(O.next==33)G(O),O.acceptToken(rO);else if(O.next==38||O.next==42){let a=O.next==38?eO:aO;$(O),O.acceptToken(a)}else O.next==39||O.next==34?(p(O,!1),O.acceptToken(OO)):w(O,!1,e.context.type==d,e.context.depth)&&O.acceptToken(J)}),kO=new i((O,e)=>{let a=e.context.type==m?e.context.depth:-1,r=O.pos;O:for(;;){let o=0,t=O.next;for(;t==32;)t=O.peek(++o);if(!o&&(f(O,45,o)||f(O,46,o))||!P(t)&&(a<0&&(a=Math.max(e.context.depth+1,o)),o<a))break;for(;;){if(O.next<0)break O;let Q=P(O.next);if(O.advance(),Q)continue O;r=O.pos}}O.acceptTokenTo(V,r)}),bO=U({DirectiveName:n.keyword,DirectiveContent:n.attributeValue,"DirectiveEnd DocEnd":n.meta,QuotedLiteral:n.string,BlockLiteralHeader:n.special(n.string),BlockLiteralContent:n.content,Literal:n.content,"Key/Literal Key/QuotedLiteral":n.definition(n.propertyName),"Anchor Alias":n.labelName,Tag:n.typeName,Comment:n.lineComment,": , -":n.separator,"?":n.punctuation,"[ ]":n.squareBracket,"{ }":n.brace}),gO=W.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:cO,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[bO],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[fO,XO,iO,kO,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),mO=W.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"⚠ Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),L=C.define({name:"yaml",parser:gO.configure({props:[u.add({Stream:O=>{for(let e=O.node.resolve(O.pos,-1);e&&e.to>=O.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return O.baseIndentFor(e);if(e.name=="BlockLiteral")return O.baseIndentFor(e)+O.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return O.column(e.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let a=O.column(e.from,1);if(a==O.lineIndent(e.from,1))return a;if(e.to>O.pos)return null}}return null},FlowMapping:v({closing:"}"}),FlowSequence:v({closing:"]"})}),M.add({"FlowMapping FlowSequence":N,"Item Pair BlockLiteral":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function vO(){return new b(L)}const xO=C.define({name:"yaml-frontmatter",parser:mO.configure({props:[U({DashLine:n.meta})]})});function DO(O){let{language:e,support:a}=O.content instanceof b?O.content:{language:O.content,support:[]};return new b(xO.configure({wrap:E(r=>r.name=="FrontmatterContent"?{parser:L.parser}:r.name=="Body"?{parser:e.parser}:null)}),a)}export{vO as yaml,DO as yamlFrontmatter,L as yamlLanguage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,b4 as Pe,ap as ot,aj as Te,j as d,b5 as nt,ak as rt,b6 as ye,al as st,ao as j,bD as z,an as M,as as lt,bE as ct,b7 as at,am as P,b9 as it,a$ as Ee,bF as dt,bb as ut,be as pt,bc as ft,bd as ht,bf as mt,bg as vt,bh as gt,aq as be,ba as St}from"./index-C-It-oJ8.js";var xt=[" ","Enter","ArrowUp","ArrowDown"],wt=[" ","Enter"],J="Select",[ae,ie,Ct]=st(J),[te,Ft]=rt(J,[Ct,Pe]),de=Pe(),[yt,Y]=te(J),[It,Tt]=te(J),Re=o=>{const{__scopeSelect:c,children:e,open:a,defaultOpen:s,onOpenChange:u,value:n,defaultValue:r,onValueChange:l,dir:f,name:g,autoComplete:w,disabled:E,required:T,form:y}=o,i=de(c),[m,S]=t.useState(null),[h,v]=t.useState(null),[U,A]=t.useState(!1),oe=ot(f),[R,D]=Te({prop:a,defaultProp:s??!1,onChange:u,caller:J}),[W,$]=Te({prop:n,defaultProp:r,onChange:l,caller:J}),k=t.useRef(null),B=m?y||!!m.closest("form"):!0,[K,V]=t.useState(new Set),H=Array.from(K).map(_=>_.props.value).join(";");return d.jsx(nt,{...i,children:d.jsxs(yt,{required:T,scope:c,trigger:m,onTriggerChange:S,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:U,onValueNodeHasChildrenChange:A,contentId:ye(),value:W,onValueChange:$,open:R,onOpenChange:D,dir:oe,triggerPointerDownPosRef:k,disabled:E,children:[d.jsx(ae.Provider,{scope:c,children:d.jsx(It,{scope:o.__scopeSelect,onNativeOptionAdd:t.useCallback(_=>{V(L=>new Set(L).add(_))},[]),onNativeOptionRemove:t.useCallback(_=>{V(L=>{const F=new Set(L);return F.delete(_),F})},[]),children:e})}),B?d.jsxs(Je,{"aria-hidden":!0,required:T,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:_=>$(_.target.value),disabled:E,form:y,children:[W===void 0?d.jsx("option",{value:""}):null,Array.from(K)]},H):null]})})};Re.displayName=J;var _e="SelectTrigger",Ne=t.forwardRef((o,c)=>{const{__scopeSelect:e,disabled:a=!1,...s}=o,u=de(e),n=Y(_e,e),r=n.disabled||a,l=j(c,n.onTriggerChange),f=ie(e),g=t.useRef("touch"),[w,E,T]=et(i=>{const m=f().filter(v=>!v.disabled),S=m.find(v=>v.value===n.value),h=tt(m,i,S);h!==void 0&&n.onValueChange(h.value)}),y=i=>{r||(n.onOpenChange(!0),T()),i&&(n.triggerPointerDownPosRef.current={x:Math.round(i.pageX),y:Math.round(i.pageY)})};return d.jsx(at,{asChild:!0,...u,children:d.jsx(M.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:r,"data-disabled":r?"":void 0,"data-placeholder":Qe(n.value)?"":void 0,...s,ref:l,onClick:P(s.onClick,i=>{i.currentTarget.focus(),g.current!=="mouse"&&y(i)}),onPointerDown:P(s.onPointerDown,i=>{g.current=i.pointerType;const m=i.target;m.hasPointerCapture(i.pointerId)&&m.releasePointerCapture(i.pointerId),i.button===0&&i.ctrlKey===!1&&i.pointerType==="mouse"&&(y(i),i.preventDefault())}),onKeyDown:P(s.onKeyDown,i=>{const m=w.current!=="";!(i.ctrlKey||i.altKey||i.metaKey)&&i.key.length===1&&E(i.key),!(m&&i.key===" ")&&xt.includes(i.key)&&(y(),i.preventDefault())})})})});Ne.displayName=_e;var Me="SelectValue",Ae=t.forwardRef((o,c)=>{const{__scopeSelect:e,className:a,style:s,children:u,placeholder:n="",...r}=o,l=Y(Me,e),{onValueNodeHasChildrenChange:f}=l,g=u!==void 0,w=j(c,l.onValueNodeChange);return z(()=>{f(g)},[f,g]),d.jsx(M.span,{...r,ref:w,style:{pointerEvents:"none"},children:Qe(l.value)?d.jsx(d.Fragment,{children:n}):u})});Ae.displayName=Me;var bt="SelectIcon",Oe=t.forwardRef((o,c)=>{const{__scopeSelect:e,children:a,...s}=o;return d.jsx(M.span,{"aria-hidden":!0,...s,ref:c,children:a||"▼"})});Oe.displayName=bt;var Pt="SelectPortal",De=o=>d.jsx(it,{asChild:!0,...o});De.displayName=Pt;var Q="SelectContent",Le=t.forwardRef((o,c)=>{const e=Y(Q,o.__scopeSelect),[a,s]=t.useState();if(z(()=>{s(new DocumentFragment)},[]),!e.open){const u=a;return u?Ee.createPortal(d.jsx(je,{scope:o.__scopeSelect,children:d.jsx(ae.Slot,{scope:o.__scopeSelect,children:d.jsx("div",{children:o.children})})}),u):null}return d.jsx(ke,{...o,ref:c})});Le.displayName=Q;var O=10,[je,q]=te(Q),Et="SelectContentImpl",Rt=ht("SelectContent.RemoveScroll"),ke=t.forwardRef((o,c)=>{const{__scopeSelect:e,position:a="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:u,onPointerDownOutside:n,side:r,sideOffset:l,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:E,collisionPadding:T,sticky:y,hideWhenDetached:i,avoidCollisions:m,...S}=o,h=Y(Q,e),[v,U]=t.useState(null),[A,oe]=t.useState(null),R=j(c,p=>U(p)),[D,W]=t.useState(null),[$,k]=t.useState(null),B=ie(e),[K,V]=t.useState(!1),H=t.useRef(!1);t.useEffect(()=>{if(v)return ut(v)},[v]),pt();const _=t.useCallback(p=>{const[I,...N]=B().map(b=>b.ref.current),[x]=N.slice(-1),C=document.activeElement;for(const b of p)if(b===C||(b?.scrollIntoView({block:"nearest"}),b===I&&A&&(A.scrollTop=0),b===x&&A&&(A.scrollTop=A.scrollHeight),b?.focus(),document.activeElement!==C))return},[B,A]),L=t.useCallback(()=>_([D,v]),[_,D,v]);t.useEffect(()=>{K&&L()},[K,L]);const{onOpenChange:F,triggerPointerDownPosRef:G}=h;t.useEffect(()=>{if(v){let p={x:0,y:0};const I=x=>{p={x:Math.abs(Math.round(x.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(x.pageY)-(G.current?.y??0))}},N=x=>{p.x<=10&&p.y<=10?x.preventDefault():v.contains(x.target)||F(!1),document.removeEventListener("pointermove",I),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",N,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",N,{capture:!0})}}},[v,F,G]),t.useEffect(()=>{const p=()=>F(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[F]);const[ue,se]=et(p=>{const I=B().filter(C=>!C.disabled),N=I.find(C=>C.ref.current===document.activeElement),x=tt(I,p,N);x&&setTimeout(()=>x.ref.current.focus())}),pe=t.useCallback((p,I,N)=>{const x=!H.current&&!N;(h.value!==void 0&&h.value===I||x)&&(W(p),x&&(H.current=!0))},[h.value]),fe=t.useCallback(()=>v?.focus(),[v]),ee=t.useCallback((p,I,N)=>{const x=!H.current&&!N;(h.value!==void 0&&h.value===I||x)&&k(p)},[h.value]),le=a==="popper"?ge:Be,ne=le===ge?{side:r,sideOffset:l,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:E,collisionPadding:T,sticky:y,hideWhenDetached:i,avoidCollisions:m}:{};return d.jsx(je,{scope:e,content:v,viewport:A,onViewportChange:oe,itemRefCallback:pe,selectedItem:D,onItemLeave:fe,itemTextRefCallback:ee,focusSelectedItem:L,selectedItemText:$,position:a,isPositioned:K,searchRef:ue,children:d.jsx(ft,{as:Rt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:h.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:P(s,p=>{h.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:d.jsx(vt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:n,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:d.jsx(le,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:p=>p.preventDefault(),...S,...ne,onPlaced:()=>V(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:P(S.onKeyDown,p=>{const I=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!I&&p.key.length===1&&se(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let x=B().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(p.key)&&(x=x.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const C=p.target,b=x.indexOf(C);x=x.slice(b+1)}setTimeout(()=>_(x)),p.preventDefault()}})})})})})})});ke.displayName=Et;var _t="SelectItemAlignedPosition",Be=t.forwardRef((o,c)=>{const{__scopeSelect:e,onPlaced:a,...s}=o,u=Y(Q,e),n=q(Q,e),[r,l]=t.useState(null),[f,g]=t.useState(null),w=j(c,R=>g(R)),E=ie(e),T=t.useRef(!1),y=t.useRef(!0),{viewport:i,selectedItem:m,selectedItemText:S,focusSelectedItem:h}=n,v=t.useCallback(()=>{if(u.trigger&&u.valueNode&&r&&f&&i&&m&&S){const R=u.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),$=S.getBoundingClientRect();if(u.dir!=="rtl"){const C=$.left-D.left,b=W.left-C,X=R.left-b,Z=R.width+X,he=Math.max(Z,D.width),me=window.innerWidth-O,ve=be(b,[O,Math.max(O,me-he)]);r.style.minWidth=Z+"px",r.style.left=ve+"px"}else{const C=D.right-$.right,b=window.innerWidth-W.right-C,X=window.innerWidth-R.right-b,Z=R.width+X,he=Math.max(Z,D.width),me=window.innerWidth-O,ve=be(b,[O,Math.max(O,me-he)]);r.style.minWidth=Z+"px",r.style.right=ve+"px"}const k=E(),B=window.innerHeight-O*2,K=i.scrollHeight,V=window.getComputedStyle(f),H=parseInt(V.borderTopWidth,10),_=parseInt(V.paddingTop,10),L=parseInt(V.borderBottomWidth,10),F=parseInt(V.paddingBottom,10),G=H+_+K+F+L,ue=Math.min(m.offsetHeight*5,G),se=window.getComputedStyle(i),pe=parseInt(se.paddingTop,10),fe=parseInt(se.paddingBottom,10),ee=R.top+R.height/2-O,le=B-ee,ne=m.offsetHeight/2,p=m.offsetTop+ne,I=H+_+p,N=G-I;if(I<=ee){const C=k.length>0&&m===k[k.length-1].ref.current;r.style.bottom="0px";const b=f.clientHeight-i.offsetTop-i.offsetHeight,X=Math.max(le,ne+(C?fe:0)+b+L),Z=I+X;r.style.height=Z+"px"}else{const C=k.length>0&&m===k[0].ref.current;r.style.top="0px";const X=Math.max(ee,H+i.offsetTop+(C?pe:0)+ne)+N;r.style.height=X+"px",i.scrollTop=I-ee+i.offsetTop}r.style.margin=`${O}px 0`,r.style.minHeight=ue+"px",r.style.maxHeight=B+"px",a?.(),requestAnimationFrame(()=>T.current=!0)}},[E,u.trigger,u.valueNode,r,f,i,m,S,u.dir,a]);z(()=>v(),[v]);const[U,A]=t.useState();z(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const oe=t.useCallback(R=>{R&&y.current===!0&&(v(),h?.(),y.current=!1)},[v,h]);return d.jsx(Mt,{scope:e,contentWrapper:r,shouldExpandOnScrollRef:T,onScrollButtonChange:oe,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(M.div,{...s,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Be.displayName=_t;var Nt="SelectPopperPosition",ge=t.forwardRef((o,c)=>{const{__scopeSelect:e,align:a="start",collisionPadding:s=O,...u}=o,n=de(e);return d.jsx(gt,{...n,...u,ref:c,align:a,collisionPadding:s,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ge.displayName=Nt;var[Mt,Ie]=te(Q,{}),Se="SelectViewport",Ve=t.forwardRef((o,c)=>{const{__scopeSelect:e,nonce:a,...s}=o,u=q(Se,e),n=Ie(Se,e),r=j(c,u.onViewportChange),l=t.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),d.jsx(ae.Slot,{scope:e,children:d.jsx(M.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:r,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:P(s.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:E}=n;if(E?.current&&w){const T=Math.abs(l.current-g.scrollTop);if(T>0){const y=window.innerHeight-O*2,i=parseFloat(w.style.minHeight),m=parseFloat(w.style.height),S=Math.max(i,m);if(S<y){const h=S+T,v=Math.min(y,h),U=h-v;w.style.height=v+"px",w.style.bottom==="0px"&&(g.scrollTop=U>0?U:0,w.style.justifyContent="flex-end")}}}l.current=g.scrollTop})})})]})});Ve.displayName=Se;var He="SelectGroup",[At,Ot]=te(He),Dt=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o,s=ye();return d.jsx(At,{scope:e,id:s,children:d.jsx(M.div,{role:"group","aria-labelledby":s,...a,ref:c})})});Dt.displayName=He;var Fe="SelectLabel",Ue=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o,s=Ot(Fe,e);return d.jsx(M.div,{id:s.id,...a,ref:c})});Ue.displayName=Fe;var ce="SelectItem",[Lt,We]=te(ce),Ke=t.forwardRef((o,c)=>{const{__scopeSelect:e,value:a,disabled:s=!1,textValue:u,...n}=o,r=Y(ce,e),l=q(ce,e),f=r.value===a,[g,w]=t.useState(u??""),[E,T]=t.useState(!1),y=j(c,h=>l.itemRefCallback?.(h,a,s)),i=ye(),m=t.useRef("touch"),S=()=>{s||(r.onValueChange(a),r.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Lt,{scope:e,value:a,disabled:s,textId:i,isSelected:f,onItemTextChange:t.useCallback(h=>{w(v=>v||(h?.textContent??"").trim())},[]),children:d.jsx(ae.ItemSlot,{scope:e,value:a,disabled:s,textValue:g,children:d.jsx(M.div,{role:"option","aria-labelledby":i,"data-highlighted":E?"":void 0,"aria-selected":f&&E,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...n,ref:y,onFocus:P(n.onFocus,()=>T(!0)),onBlur:P(n.onBlur,()=>T(!1)),onClick:P(n.onClick,()=>{m.current!=="mouse"&&S()}),onPointerUp:P(n.onPointerUp,()=>{m.current==="mouse"&&S()}),onPointerDown:P(n.onPointerDown,h=>{m.current=h.pointerType}),onPointerMove:P(n.onPointerMove,h=>{m.current=h.pointerType,s?l.onItemLeave?.():m.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(n.onPointerLeave,h=>{h.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:P(n.onKeyDown,h=>{l.searchRef?.current!==""&&h.key===" "||(wt.includes(h.key)&&S(),h.key===" "&&h.preventDefault())})})})})});Ke.displayName=ce;var re="SelectItemText",Ge=t.forwardRef((o,c)=>{const{__scopeSelect:e,className:a,style:s,...u}=o,n=Y(re,e),r=q(re,e),l=We(re,e),f=Tt(re,e),[g,w]=t.useState(null),E=j(c,S=>w(S),l.onItemTextChange,S=>r.itemTextRefCallback?.(S,l.value,l.disabled)),T=g?.textContent,y=t.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:T},l.value),[l.disabled,l.value,T]),{onNativeOptionAdd:i,onNativeOptionRemove:m}=f;return z(()=>(i(y),()=>m(y)),[i,m,y]),d.jsxs(d.Fragment,{children:[d.jsx(M.span,{id:l.textId,...u,ref:E}),l.isSelected&&n.valueNode&&!n.valueNodeHasChildren?Ee.createPortal(u.children,n.valueNode):null]})});Ge.displayName=re;var ze="SelectItemIndicator",Ye=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o;return We(ze,e).isSelected?d.jsx(M.span,{"aria-hidden":!0,...a,ref:c}):null});Ye.displayName=ze;var xe="SelectScrollUpButton",qe=t.forwardRef((o,c)=>{const e=q(xe,o.__scopeSelect),a=Ie(xe,o.__scopeSelect),[s,u]=t.useState(!1),n=j(c,a.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let r=function(){const f=l.scrollTop>0;u(f)};const l=e.viewport;return r(),l.addEventListener("scroll",r),()=>l.removeEventListener("scroll",r)}},[e.viewport,e.isPositioned]),s?d.jsx(Xe,{...o,ref:n,onAutoScroll:()=>{const{viewport:r,selectedItem:l}=e;r&&l&&(r.scrollTop=r.scrollTop-l.offsetHeight)}}):null});qe.displayName=xe;var we="SelectScrollDownButton",$e=t.forwardRef((o,c)=>{const e=q(we,o.__scopeSelect),a=Ie(we,o.__scopeSelect),[s,u]=t.useState(!1),n=j(c,a.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let r=function(){const f=l.scrollHeight-l.clientHeight,g=Math.ceil(l.scrollTop)<f;u(g)};const l=e.viewport;return r(),l.addEventListener("scroll",r),()=>l.removeEventListener("scroll",r)}},[e.viewport,e.isPositioned]),s?d.jsx(Xe,{...o,ref:n,onAutoScroll:()=>{const{viewport:r,selectedItem:l}=e;r&&l&&(r.scrollTop=r.scrollTop+l.offsetHeight)}}):null});$e.displayName=we;var Xe=t.forwardRef((o,c)=>{const{__scopeSelect:e,onAutoScroll:a,...s}=o,u=q("SelectScrollButton",e),n=t.useRef(null),r=ie(e),l=t.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return t.useEffect(()=>()=>l(),[l]),z(()=>{r().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[r]),d.jsx(M.div,{"aria-hidden":!0,...s,ref:c,style:{flexShrink:0,...s.style},onPointerDown:P(s.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(a,50))}),onPointerMove:P(s.onPointerMove,()=>{u.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(a,50))}),onPointerLeave:P(s.onPointerLeave,()=>{l()})})}),jt="SelectSeparator",Ze=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o;return d.jsx(M.div,{"aria-hidden":!0,...a,ref:c})});Ze.displayName=jt;var Ce="SelectArrow",kt=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o,s=de(e),u=Y(Ce,e),n=q(Ce,e);return u.open&&n.position==="popper"?d.jsx(St,{...s,...a,ref:c}):null});kt.displayName=Ce;var Bt="SelectBubbleInput",Je=t.forwardRef(({__scopeSelect:o,value:c,...e},a)=>{const s=t.useRef(null),u=j(a,s),n=lt(c);return t.useEffect(()=>{const r=s.current;if(!r)return;const l=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(l,"value").set;if(n!==c&&g){const w=new Event("change",{bubbles:!0});g.call(r,c),r.dispatchEvent(w)}},[n,c]),d.jsx(M.select,{...e,style:{...ct,...e.style},ref:u,defaultValue:c})});Je.displayName=Bt;function Qe(o){return o===""||o===void 0}function et(o){const c=dt(o),e=t.useRef(""),a=t.useRef(0),s=t.useCallback(n=>{const r=e.current+n;c(r),(function l(f){e.current=f,window.clearTimeout(a.current),f!==""&&(a.current=window.setTimeout(()=>l(""),1e3))})(r)},[c]),u=t.useCallback(()=>{e.current="",window.clearTimeout(a.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(a.current),[]),[e,s,u]}function tt(o,c,e){const s=c.length>1&&Array.from(c).every(f=>f===c[0])?c[0]:c,u=e?o.indexOf(e):-1;let n=Vt(o,Math.max(u,0));s.length===1&&(n=n.filter(f=>f!==e));const l=n.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==e?l:void 0}function Vt(o,c){return o.map((e,a)=>o[(c+a)%o.length])}var Ut=Re,Wt=Ne,Kt=Ae,Gt=Oe,zt=De,Yt=Le,qt=Ve,$t=Ue,Xt=Ke,Zt=Ge,Jt=Ye,Qt=qe,eo=$e,to=Ze;export{Yt as C,Gt as I,$t as L,zt as P,Ut as R,to as S,Wt as T,Kt as V,qt as a,Xt as b,Zt as c,Jt as d,Qt as e,eo as f};
|
|
1
|
+
import{r as t,b4 as Pe,ap as ot,aj as Te,j as d,b5 as nt,ak as rt,b6 as ye,al as st,ao as j,bD as z,an as M,as as lt,bE as ct,b7 as at,am as P,b9 as it,a$ as Ee,bF as dt,bb as ut,be as pt,bc as ft,bd as ht,bf as mt,bg as vt,bh as gt,aq as be,ba as St}from"./index-C0uIENKu.js";var xt=[" ","Enter","ArrowUp","ArrowDown"],wt=[" ","Enter"],J="Select",[ae,ie,Ct]=st(J),[te,Ft]=rt(J,[Ct,Pe]),de=Pe(),[yt,Y]=te(J),[It,Tt]=te(J),Re=o=>{const{__scopeSelect:c,children:e,open:a,defaultOpen:s,onOpenChange:u,value:n,defaultValue:r,onValueChange:l,dir:f,name:g,autoComplete:w,disabled:E,required:T,form:y}=o,i=de(c),[m,S]=t.useState(null),[h,v]=t.useState(null),[U,A]=t.useState(!1),oe=ot(f),[R,D]=Te({prop:a,defaultProp:s??!1,onChange:u,caller:J}),[W,$]=Te({prop:n,defaultProp:r,onChange:l,caller:J}),k=t.useRef(null),B=m?y||!!m.closest("form"):!0,[K,V]=t.useState(new Set),H=Array.from(K).map(_=>_.props.value).join(";");return d.jsx(nt,{...i,children:d.jsxs(yt,{required:T,scope:c,trigger:m,onTriggerChange:S,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:U,onValueNodeHasChildrenChange:A,contentId:ye(),value:W,onValueChange:$,open:R,onOpenChange:D,dir:oe,triggerPointerDownPosRef:k,disabled:E,children:[d.jsx(ae.Provider,{scope:c,children:d.jsx(It,{scope:o.__scopeSelect,onNativeOptionAdd:t.useCallback(_=>{V(L=>new Set(L).add(_))},[]),onNativeOptionRemove:t.useCallback(_=>{V(L=>{const F=new Set(L);return F.delete(_),F})},[]),children:e})}),B?d.jsxs(Je,{"aria-hidden":!0,required:T,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:_=>$(_.target.value),disabled:E,form:y,children:[W===void 0?d.jsx("option",{value:""}):null,Array.from(K)]},H):null]})})};Re.displayName=J;var _e="SelectTrigger",Ne=t.forwardRef((o,c)=>{const{__scopeSelect:e,disabled:a=!1,...s}=o,u=de(e),n=Y(_e,e),r=n.disabled||a,l=j(c,n.onTriggerChange),f=ie(e),g=t.useRef("touch"),[w,E,T]=et(i=>{const m=f().filter(v=>!v.disabled),S=m.find(v=>v.value===n.value),h=tt(m,i,S);h!==void 0&&n.onValueChange(h.value)}),y=i=>{r||(n.onOpenChange(!0),T()),i&&(n.triggerPointerDownPosRef.current={x:Math.round(i.pageX),y:Math.round(i.pageY)})};return d.jsx(at,{asChild:!0,...u,children:d.jsx(M.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:r,"data-disabled":r?"":void 0,"data-placeholder":Qe(n.value)?"":void 0,...s,ref:l,onClick:P(s.onClick,i=>{i.currentTarget.focus(),g.current!=="mouse"&&y(i)}),onPointerDown:P(s.onPointerDown,i=>{g.current=i.pointerType;const m=i.target;m.hasPointerCapture(i.pointerId)&&m.releasePointerCapture(i.pointerId),i.button===0&&i.ctrlKey===!1&&i.pointerType==="mouse"&&(y(i),i.preventDefault())}),onKeyDown:P(s.onKeyDown,i=>{const m=w.current!=="";!(i.ctrlKey||i.altKey||i.metaKey)&&i.key.length===1&&E(i.key),!(m&&i.key===" ")&&xt.includes(i.key)&&(y(),i.preventDefault())})})})});Ne.displayName=_e;var Me="SelectValue",Ae=t.forwardRef((o,c)=>{const{__scopeSelect:e,className:a,style:s,children:u,placeholder:n="",...r}=o,l=Y(Me,e),{onValueNodeHasChildrenChange:f}=l,g=u!==void 0,w=j(c,l.onValueNodeChange);return z(()=>{f(g)},[f,g]),d.jsx(M.span,{...r,ref:w,style:{pointerEvents:"none"},children:Qe(l.value)?d.jsx(d.Fragment,{children:n}):u})});Ae.displayName=Me;var bt="SelectIcon",Oe=t.forwardRef((o,c)=>{const{__scopeSelect:e,children:a,...s}=o;return d.jsx(M.span,{"aria-hidden":!0,...s,ref:c,children:a||"▼"})});Oe.displayName=bt;var Pt="SelectPortal",De=o=>d.jsx(it,{asChild:!0,...o});De.displayName=Pt;var Q="SelectContent",Le=t.forwardRef((o,c)=>{const e=Y(Q,o.__scopeSelect),[a,s]=t.useState();if(z(()=>{s(new DocumentFragment)},[]),!e.open){const u=a;return u?Ee.createPortal(d.jsx(je,{scope:o.__scopeSelect,children:d.jsx(ae.Slot,{scope:o.__scopeSelect,children:d.jsx("div",{children:o.children})})}),u):null}return d.jsx(ke,{...o,ref:c})});Le.displayName=Q;var O=10,[je,q]=te(Q),Et="SelectContentImpl",Rt=ht("SelectContent.RemoveScroll"),ke=t.forwardRef((o,c)=>{const{__scopeSelect:e,position:a="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:u,onPointerDownOutside:n,side:r,sideOffset:l,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:E,collisionPadding:T,sticky:y,hideWhenDetached:i,avoidCollisions:m,...S}=o,h=Y(Q,e),[v,U]=t.useState(null),[A,oe]=t.useState(null),R=j(c,p=>U(p)),[D,W]=t.useState(null),[$,k]=t.useState(null),B=ie(e),[K,V]=t.useState(!1),H=t.useRef(!1);t.useEffect(()=>{if(v)return ut(v)},[v]),pt();const _=t.useCallback(p=>{const[I,...N]=B().map(b=>b.ref.current),[x]=N.slice(-1),C=document.activeElement;for(const b of p)if(b===C||(b?.scrollIntoView({block:"nearest"}),b===I&&A&&(A.scrollTop=0),b===x&&A&&(A.scrollTop=A.scrollHeight),b?.focus(),document.activeElement!==C))return},[B,A]),L=t.useCallback(()=>_([D,v]),[_,D,v]);t.useEffect(()=>{K&&L()},[K,L]);const{onOpenChange:F,triggerPointerDownPosRef:G}=h;t.useEffect(()=>{if(v){let p={x:0,y:0};const I=x=>{p={x:Math.abs(Math.round(x.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(x.pageY)-(G.current?.y??0))}},N=x=>{p.x<=10&&p.y<=10?x.preventDefault():v.contains(x.target)||F(!1),document.removeEventListener("pointermove",I),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",N,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",N,{capture:!0})}}},[v,F,G]),t.useEffect(()=>{const p=()=>F(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[F]);const[ue,se]=et(p=>{const I=B().filter(C=>!C.disabled),N=I.find(C=>C.ref.current===document.activeElement),x=tt(I,p,N);x&&setTimeout(()=>x.ref.current.focus())}),pe=t.useCallback((p,I,N)=>{const x=!H.current&&!N;(h.value!==void 0&&h.value===I||x)&&(W(p),x&&(H.current=!0))},[h.value]),fe=t.useCallback(()=>v?.focus(),[v]),ee=t.useCallback((p,I,N)=>{const x=!H.current&&!N;(h.value!==void 0&&h.value===I||x)&&k(p)},[h.value]),le=a==="popper"?ge:Be,ne=le===ge?{side:r,sideOffset:l,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:E,collisionPadding:T,sticky:y,hideWhenDetached:i,avoidCollisions:m}:{};return d.jsx(je,{scope:e,content:v,viewport:A,onViewportChange:oe,itemRefCallback:pe,selectedItem:D,onItemLeave:fe,itemTextRefCallback:ee,focusSelectedItem:L,selectedItemText:$,position:a,isPositioned:K,searchRef:ue,children:d.jsx(ft,{as:Rt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:h.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:P(s,p=>{h.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:d.jsx(vt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:n,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:d.jsx(le,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:p=>p.preventDefault(),...S,...ne,onPlaced:()=>V(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:P(S.onKeyDown,p=>{const I=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!I&&p.key.length===1&&se(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let x=B().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(p.key)&&(x=x.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const C=p.target,b=x.indexOf(C);x=x.slice(b+1)}setTimeout(()=>_(x)),p.preventDefault()}})})})})})})});ke.displayName=Et;var _t="SelectItemAlignedPosition",Be=t.forwardRef((o,c)=>{const{__scopeSelect:e,onPlaced:a,...s}=o,u=Y(Q,e),n=q(Q,e),[r,l]=t.useState(null),[f,g]=t.useState(null),w=j(c,R=>g(R)),E=ie(e),T=t.useRef(!1),y=t.useRef(!0),{viewport:i,selectedItem:m,selectedItemText:S,focusSelectedItem:h}=n,v=t.useCallback(()=>{if(u.trigger&&u.valueNode&&r&&f&&i&&m&&S){const R=u.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),$=S.getBoundingClientRect();if(u.dir!=="rtl"){const C=$.left-D.left,b=W.left-C,X=R.left-b,Z=R.width+X,he=Math.max(Z,D.width),me=window.innerWidth-O,ve=be(b,[O,Math.max(O,me-he)]);r.style.minWidth=Z+"px",r.style.left=ve+"px"}else{const C=D.right-$.right,b=window.innerWidth-W.right-C,X=window.innerWidth-R.right-b,Z=R.width+X,he=Math.max(Z,D.width),me=window.innerWidth-O,ve=be(b,[O,Math.max(O,me-he)]);r.style.minWidth=Z+"px",r.style.right=ve+"px"}const k=E(),B=window.innerHeight-O*2,K=i.scrollHeight,V=window.getComputedStyle(f),H=parseInt(V.borderTopWidth,10),_=parseInt(V.paddingTop,10),L=parseInt(V.borderBottomWidth,10),F=parseInt(V.paddingBottom,10),G=H+_+K+F+L,ue=Math.min(m.offsetHeight*5,G),se=window.getComputedStyle(i),pe=parseInt(se.paddingTop,10),fe=parseInt(se.paddingBottom,10),ee=R.top+R.height/2-O,le=B-ee,ne=m.offsetHeight/2,p=m.offsetTop+ne,I=H+_+p,N=G-I;if(I<=ee){const C=k.length>0&&m===k[k.length-1].ref.current;r.style.bottom="0px";const b=f.clientHeight-i.offsetTop-i.offsetHeight,X=Math.max(le,ne+(C?fe:0)+b+L),Z=I+X;r.style.height=Z+"px"}else{const C=k.length>0&&m===k[0].ref.current;r.style.top="0px";const X=Math.max(ee,H+i.offsetTop+(C?pe:0)+ne)+N;r.style.height=X+"px",i.scrollTop=I-ee+i.offsetTop}r.style.margin=`${O}px 0`,r.style.minHeight=ue+"px",r.style.maxHeight=B+"px",a?.(),requestAnimationFrame(()=>T.current=!0)}},[E,u.trigger,u.valueNode,r,f,i,m,S,u.dir,a]);z(()=>v(),[v]);const[U,A]=t.useState();z(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const oe=t.useCallback(R=>{R&&y.current===!0&&(v(),h?.(),y.current=!1)},[v,h]);return d.jsx(Mt,{scope:e,contentWrapper:r,shouldExpandOnScrollRef:T,onScrollButtonChange:oe,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(M.div,{...s,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Be.displayName=_t;var Nt="SelectPopperPosition",ge=t.forwardRef((o,c)=>{const{__scopeSelect:e,align:a="start",collisionPadding:s=O,...u}=o,n=de(e);return d.jsx(gt,{...n,...u,ref:c,align:a,collisionPadding:s,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ge.displayName=Nt;var[Mt,Ie]=te(Q,{}),Se="SelectViewport",Ve=t.forwardRef((o,c)=>{const{__scopeSelect:e,nonce:a,...s}=o,u=q(Se,e),n=Ie(Se,e),r=j(c,u.onViewportChange),l=t.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),d.jsx(ae.Slot,{scope:e,children:d.jsx(M.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:r,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:P(s.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:E}=n;if(E?.current&&w){const T=Math.abs(l.current-g.scrollTop);if(T>0){const y=window.innerHeight-O*2,i=parseFloat(w.style.minHeight),m=parseFloat(w.style.height),S=Math.max(i,m);if(S<y){const h=S+T,v=Math.min(y,h),U=h-v;w.style.height=v+"px",w.style.bottom==="0px"&&(g.scrollTop=U>0?U:0,w.style.justifyContent="flex-end")}}}l.current=g.scrollTop})})})]})});Ve.displayName=Se;var He="SelectGroup",[At,Ot]=te(He),Dt=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o,s=ye();return d.jsx(At,{scope:e,id:s,children:d.jsx(M.div,{role:"group","aria-labelledby":s,...a,ref:c})})});Dt.displayName=He;var Fe="SelectLabel",Ue=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o,s=Ot(Fe,e);return d.jsx(M.div,{id:s.id,...a,ref:c})});Ue.displayName=Fe;var ce="SelectItem",[Lt,We]=te(ce),Ke=t.forwardRef((o,c)=>{const{__scopeSelect:e,value:a,disabled:s=!1,textValue:u,...n}=o,r=Y(ce,e),l=q(ce,e),f=r.value===a,[g,w]=t.useState(u??""),[E,T]=t.useState(!1),y=j(c,h=>l.itemRefCallback?.(h,a,s)),i=ye(),m=t.useRef("touch"),S=()=>{s||(r.onValueChange(a),r.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Lt,{scope:e,value:a,disabled:s,textId:i,isSelected:f,onItemTextChange:t.useCallback(h=>{w(v=>v||(h?.textContent??"").trim())},[]),children:d.jsx(ae.ItemSlot,{scope:e,value:a,disabled:s,textValue:g,children:d.jsx(M.div,{role:"option","aria-labelledby":i,"data-highlighted":E?"":void 0,"aria-selected":f&&E,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...n,ref:y,onFocus:P(n.onFocus,()=>T(!0)),onBlur:P(n.onBlur,()=>T(!1)),onClick:P(n.onClick,()=>{m.current!=="mouse"&&S()}),onPointerUp:P(n.onPointerUp,()=>{m.current==="mouse"&&S()}),onPointerDown:P(n.onPointerDown,h=>{m.current=h.pointerType}),onPointerMove:P(n.onPointerMove,h=>{m.current=h.pointerType,s?l.onItemLeave?.():m.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(n.onPointerLeave,h=>{h.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:P(n.onKeyDown,h=>{l.searchRef?.current!==""&&h.key===" "||(wt.includes(h.key)&&S(),h.key===" "&&h.preventDefault())})})})})});Ke.displayName=ce;var re="SelectItemText",Ge=t.forwardRef((o,c)=>{const{__scopeSelect:e,className:a,style:s,...u}=o,n=Y(re,e),r=q(re,e),l=We(re,e),f=Tt(re,e),[g,w]=t.useState(null),E=j(c,S=>w(S),l.onItemTextChange,S=>r.itemTextRefCallback?.(S,l.value,l.disabled)),T=g?.textContent,y=t.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:T},l.value),[l.disabled,l.value,T]),{onNativeOptionAdd:i,onNativeOptionRemove:m}=f;return z(()=>(i(y),()=>m(y)),[i,m,y]),d.jsxs(d.Fragment,{children:[d.jsx(M.span,{id:l.textId,...u,ref:E}),l.isSelected&&n.valueNode&&!n.valueNodeHasChildren?Ee.createPortal(u.children,n.valueNode):null]})});Ge.displayName=re;var ze="SelectItemIndicator",Ye=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o;return We(ze,e).isSelected?d.jsx(M.span,{"aria-hidden":!0,...a,ref:c}):null});Ye.displayName=ze;var xe="SelectScrollUpButton",qe=t.forwardRef((o,c)=>{const e=q(xe,o.__scopeSelect),a=Ie(xe,o.__scopeSelect),[s,u]=t.useState(!1),n=j(c,a.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let r=function(){const f=l.scrollTop>0;u(f)};const l=e.viewport;return r(),l.addEventListener("scroll",r),()=>l.removeEventListener("scroll",r)}},[e.viewport,e.isPositioned]),s?d.jsx(Xe,{...o,ref:n,onAutoScroll:()=>{const{viewport:r,selectedItem:l}=e;r&&l&&(r.scrollTop=r.scrollTop-l.offsetHeight)}}):null});qe.displayName=xe;var we="SelectScrollDownButton",$e=t.forwardRef((o,c)=>{const e=q(we,o.__scopeSelect),a=Ie(we,o.__scopeSelect),[s,u]=t.useState(!1),n=j(c,a.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let r=function(){const f=l.scrollHeight-l.clientHeight,g=Math.ceil(l.scrollTop)<f;u(g)};const l=e.viewport;return r(),l.addEventListener("scroll",r),()=>l.removeEventListener("scroll",r)}},[e.viewport,e.isPositioned]),s?d.jsx(Xe,{...o,ref:n,onAutoScroll:()=>{const{viewport:r,selectedItem:l}=e;r&&l&&(r.scrollTop=r.scrollTop+l.offsetHeight)}}):null});$e.displayName=we;var Xe=t.forwardRef((o,c)=>{const{__scopeSelect:e,onAutoScroll:a,...s}=o,u=q("SelectScrollButton",e),n=t.useRef(null),r=ie(e),l=t.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return t.useEffect(()=>()=>l(),[l]),z(()=>{r().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[r]),d.jsx(M.div,{"aria-hidden":!0,...s,ref:c,style:{flexShrink:0,...s.style},onPointerDown:P(s.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(a,50))}),onPointerMove:P(s.onPointerMove,()=>{u.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(a,50))}),onPointerLeave:P(s.onPointerLeave,()=>{l()})})}),jt="SelectSeparator",Ze=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o;return d.jsx(M.div,{"aria-hidden":!0,...a,ref:c})});Ze.displayName=jt;var Ce="SelectArrow",kt=t.forwardRef((o,c)=>{const{__scopeSelect:e,...a}=o,s=de(e),u=Y(Ce,e),n=q(Ce,e);return u.open&&n.position==="popper"?d.jsx(St,{...s,...a,ref:c}):null});kt.displayName=Ce;var Bt="SelectBubbleInput",Je=t.forwardRef(({__scopeSelect:o,value:c,...e},a)=>{const s=t.useRef(null),u=j(a,s),n=lt(c);return t.useEffect(()=>{const r=s.current;if(!r)return;const l=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(l,"value").set;if(n!==c&&g){const w=new Event("change",{bubbles:!0});g.call(r,c),r.dispatchEvent(w)}},[n,c]),d.jsx(M.select,{...e,style:{...ct,...e.style},ref:u,defaultValue:c})});Je.displayName=Bt;function Qe(o){return o===""||o===void 0}function et(o){const c=dt(o),e=t.useRef(""),a=t.useRef(0),s=t.useCallback(n=>{const r=e.current+n;c(r),(function l(f){e.current=f,window.clearTimeout(a.current),f!==""&&(a.current=window.setTimeout(()=>l(""),1e3))})(r)},[c]),u=t.useCallback(()=>{e.current="",window.clearTimeout(a.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(a.current),[]),[e,s,u]}function tt(o,c,e){const s=c.length>1&&Array.from(c).every(f=>f===c[0])?c[0]:c,u=e?o.indexOf(e):-1;let n=Vt(o,Math.max(u,0));s.length===1&&(n=n.filter(f=>f!==e));const l=n.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==e?l:void 0}function Vt(o,c){return o.map((e,a)=>o[(c+a)%o.length])}var Ut=Re,Wt=Ne,Kt=Ae,Gt=Oe,zt=De,Yt=Le,qt=Ve,$t=Ue,Xt=Ke,Zt=Ge,Jt=Ye,Qt=qe,eo=$e,to=Ze;export{Yt as C,Gt as I,$t as L,zt as P,Ut as R,to as S,Wt as T,Kt as V,qt as a,Xt as b,Zt as c,Jt as d,Qt as e,eo as f};
|