@deepseekcode/cli 1.0.29 → 1.0.30
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/README.md +159 -99
- package/dist/cli.js +1480 -1477
- package/package.json +1 -1
- package/web/dist/assets/AutomationView-Y4qkPsrX.js +1 -0
- package/web/dist/assets/{ChannelConfigView-DG4_15oh.js → ChannelConfigView-BqEclPUB.js} +3 -3
- package/web/dist/assets/{ConnectorsView-ByedXSa-.js → ConnectorsView-Cz4uqSmh.js} +1 -1
- package/web/dist/assets/{FileTreeView-DPA2dhx_.js → FileTreeView-BWPOqGPh.js} +1 -1
- package/web/dist/assets/{HookConfigView-BJnvqm3N.js → HookConfigView-japq3zFX.js} +1 -1
- package/web/dist/assets/{ModelsView-BBbmRxwR.js → ModelsView-Dbo4GErV.js} +1 -1
- package/web/dist/assets/{PluginsView-DxIWxsB-.js → PluginsView-C1BPNAQx.js} +1 -1
- package/web/dist/assets/SessionGrid-BGpz0-op.css +1 -0
- package/web/dist/assets/SessionGrid-F23LrdJ2.js +42 -0
- package/web/dist/assets/{SettingsPanel-ivpxRR6O.js → SettingsPanel-CGJbV37j.js} +3 -3
- package/web/dist/assets/{SkillsView-Cpr_kpor.js → SkillsView-CecX9sxV.js} +1 -1
- package/web/dist/assets/{TemplatesTab-Cvyxqayr.js → TemplatesTab-BtbjQDQk.js} +1 -1
- package/web/dist/assets/{TerminalView-DTN8hmcS.js → TerminalView-6U_87hSL.js} +1 -1
- package/web/dist/assets/{ThreeScene-CukEnQe-.js → ThreeScene-Zhjwe9nT.js} +1 -1
- package/web/dist/assets/{ToolsView-D_FET-NB.js → ToolsView-DO0_61eJ.js} +1 -1
- package/web/dist/assets/{icons-Cu8fYt4q.js → icons-Di-qMB6n.js} +124 -109
- package/web/dist/assets/index-BbLAiXis.css +1 -0
- package/web/dist/assets/index-Dkxsd1Rx.js +484 -0
- package/web/dist/assets/{markdown-Bym7wmT0.js → markdown-D-c9V8Xq.js} +1 -1
- package/web/dist/assets/{panels-BEKHl5l-.js → panels-CpHTincc.js} +1 -1
- package/web/dist/assets/{react-vendor-D76F8wnc.js → react-vendor-DU8XgZt2.js} +1 -1
- package/web/dist/assets/{state-CZakZ3-m.js → state-D2vcUGVk.js} +1 -1
- package/web/dist/index.html +7 -7
- package/web/dist/assets/AutomationView-BJSLQ2Ka.js +0 -1
- package/web/dist/assets/SessionGrid-D-1XpCZg.js +0 -39
- package/web/dist/assets/index-C7rIgpwO.js +0 -484
- package/web/dist/assets/index-CYAcRfnc.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,R as hn}from"./icons-Cu8fYt4q.js";const we=f.createContext(null);we.displayName="PanelGroupContext";const k={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},$e=10,ne=f.useLayoutEffect,Fe=hn.useId,zn=typeof Fe=="function"?Fe:()=>null;let yn=0;function Ne(e=null){const n=zn(),t=f.useRef(e||n||null);return t.current===null&&(t.current=""+yn++),e??t.current}function Je({children:e,className:n="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:s,minSize:a,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(we);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:L,getPanelSize:M,getPanelStyle:$,groupId:O,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:K,resizePanel:J,unregisterPanel:F}=E,G=Ne(l),D=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:s,minSize:a},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:N}=D.current,B={...N};D.current.id=G,D.current.idIsFromProps=l!==void 0,D.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,N.collapsedSize=t,N.collapsible=r,N.defaultSize=i,N.maxSize=s,N.minSize=a,(B.collapsedSize!==N.collapsedSize||B.collapsible!==N.collapsible||B.maxSize!==N.maxSize||B.minSize!==N.minSize)&&P(D.current,B)}),ne(()=>{const _=D.current;return K(_),()=>{F(_)}},[u,G,K,F]),f.useImperativeHandle(o,()=>({collapse:()=>{b(D.current)},expand:_=>{L(D.current,_)},getId(){return G},getSize(){return M(D.current)},isCollapsed(){return R(D.current)},isExpanded(){return!R(D.current)},resize:_=>{J(D.current,_)}}),[b,L,M,R,G,J]);const Z=$(D.current,i);return f.createElement(z,{...C,children:e,className:n,id:G,style:{...Z,...v},[k.groupId]:O,[k.panel]:"",[k.panelCollapsible]:r||void 0,[k.panelId]:G,[k.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const xn=f.forwardRef((e,n)=>f.createElement(Je,{...e,forwardedRef:n}));Je.displayName="Panel";xn.displayName="forwardRef(Panel)";let He=null,Se=-1,Y=null;function vn(e,n){if(n){const t=(n&en)!==0,r=(n&nn)!==0,i=(n&tn)!==0,o=(n&rn)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Sn(){Y!==null&&(document.head.removeChild(Y),He=null,Y=null,Se=-1)}function Le(e,n){var t,r;const i=vn(e,n);if(He!==i){if(He=i,Y===null&&(Y=document.createElement("style"),document.head.appendChild(Y)),Se>=0){var o;(o=Y.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=Y.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function je(e){return e.type==="keydown"}function Ye(e){return e.type.startsWith("pointer")}function Ze(e){return e.type.startsWith("mouse")}function Ee(e){if(Ye(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Ze(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function bn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Pn(e,n,t){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function wn(e,n){if(e===n)throw new Error("Cannot compare node with itself");const t={a:Ue(e),b:Ue(n)};let r;for(;t.a.at(-1)===t.b.at(-1);)e=t.a.pop(),n=t.b.pop(),r=e;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ke(We(t.a)),b:Ke(We(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let s=o.length;for(;s--;){const a=o[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const En=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Cn(e){var n;const t=getComputedStyle((n=Qe(e))!==null&&n!==void 0?n:e).display;return t==="flex"||t==="inline-flex"}function In(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||Cn(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||En.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function We(e){let n=e.length;for(;n--;){const t=e[n];if(x(t,"Missing node"),In(t))return t}return null}function Ke(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ue(e){const n=[];for(;e;)n.push(e),e=Qe(e);return n}function Qe(e){const{parentNode:n}=e;return n&&n instanceof ShadowRoot?n.host:n}const en=1,nn=2,tn=4,rn=8,Rn=bn()==="coarse";let V=[],se=!1,ee=new Map,Ce=new Map;const he=new Set;function Ln(e,n,t,r,i){var o;const{ownerDocument:l}=n,s={direction:t,element:n,hitAreaMargins:r,setResizeHandlerState:i},a=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,a+1),he.add(s),be(),function(){var w;Ce.delete(e),he.delete(s);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),be(),p===1&&ee.delete(l),V.includes(s)){const u=V.indexOf(s);u>=0&&V.splice(u,1),Ge(),i("up",!0,null)}}}function An(e){const{target:n}=e,{x:t,y:r}=Ee(e);se=!0,_e({target:n,x:t,y:r}),be(),V.length>0&&(Pe("down",e),e.preventDefault(),on(n)||e.stopImmediatePropagation())}function Ae(e){const{x:n,y:t}=Ee(e);if(se&&e.buttons===0&&(se=!1,Pe("up",e)),!se){const{target:r}=e;_e({target:r,x:n,y:t})}Pe("move",e),Ge(),V.length>0&&e.preventDefault()}function ke(e){const{target:n}=e,{x:t,y:r}=Ee(e);Ce.clear(),se=!1,V.length>0&&(e.preventDefault(),on(n)||e.stopImmediatePropagation()),Pe("up",e),_e({target:n,x:t,y:r}),Ge(),be()}function on(e){let n=e;for(;n;){if(n.hasAttribute(k.resizeHandle))return!0;n=n.parentElement}return!1}function _e({target:e,x:n,y:t}){V.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),he.forEach(i=>{const{element:o,hitAreaMargins:l}=i,s=o.getBoundingClientRect(),{bottom:a,left:h,right:w,top:p}=s,u=Rn?l.coarse:l.fine;if(n>=h-u&&n<=w+u&&t>=p-u&&t<=a+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&wn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Pn(z.getBoundingClientRect(),s)){C=!0;break}z=z.parentElement}if(C)return}V.push(i)}})}function De(e,n){Ce.set(e,n)}function Ge(){let e=!1,n=!1;V.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:n=!0});let t=0;Ce.forEach(r=>{t|=r}),e&&n?Le("intersection",t):e?Le("horizontal",t):n?Le("vertical",t):Sn()}let Me=new AbortController;function be(){Me.abort(),Me=new AbortController;const e={capture:!0,signal:Me.signal};he.size&&(se?(V.length>0&&ee.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("contextmenu",ke,e),r.addEventListener("pointerleave",Ae,e),r.addEventListener("pointermove",Ae,e))}),window.addEventListener("pointerup",ke,e),window.addEventListener("pointercancel",ke,e)):ee.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("pointerdown",An,e),r.addEventListener("pointermove",Ae,e))}))}function Pe(e,n){he.forEach(t=>{const{setResizeHandlerState:r}=t,i=V.includes(t);r(e,i,n)})}function kn(){const[e,n]=f.useState(0);return f.useCallback(()=>n(t=>t+1),[])}function x(e,n){if(!e)throw console.error(n),Error(n)}function te(e,n,t=$e){return e.toFixed(t)===n.toFixed(t)?0:e>n?1:-1}function j(e,n,t=$e){return te(e,n,t)===0}function W(e,n,t){return te(e,n,t)===0}function Dn(e,n,t){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=n[r];if(!W(i,o,t))return!1}return!0}function le({panelConstraints:e,panelIndex:n,size:t}){const r=e[n];x(r!=null,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:s=0}=r;if(te(t,s)<0)if(o){const a=(i+s)/2;te(t,a)<0?t=i:t=s}else t=s;return t=Math.min(l,t),t=parseFloat(t.toFixed($e)),t}function ge({delta:e,initialLayout:n,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(W(e,0))return n;const l=[...n],[s,a]=r;x(s!=null,"Invalid first pivot index"),x(a!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=e<0?a:s,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=n[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),W(E,v)){const b=C-E;te(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}{const p=e<0?s:a,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=n[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),W(E,C)){const b=E-v;te(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}}{const p=e<0?1:-1;let u=e<0?a:s,v=0;for(;;){const C=n[u];x(C!=null,`Previous layout not found for panel index ${u}`);const b=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=b,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-z:z}{let u=e<0?s:a;for(;u>=0&&u<t.length;){const v=Math.abs(e)-Math.abs(h),z=n[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!W(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?u--:u++}}if(Dn(i,l))return i;{const p=e<0?a:s,u=n[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!W(z,v)){let C=v-z,b=e<0?a:s;for(;b>=0&&b<t.length;){const L=l[b];x(L!=null,`Previous layout not found for panel index ${b}`);const M=L+C,$=le({panelConstraints:t,panelIndex:b,size:M});if(W(L,$)||(C-=$-L,l[b]=$),W(C,0))break;e>0?b--:b++}}}const w=l.reduce((p,u)=>u+p,0);return W(w,100)?l:i}function Mn({layout:e,panelsArray:n,pivotIndices:t}){let r=0,i=100,o=0,l=0;const s=t[0];x(s!=null,"No pivot index found"),n.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===s?(r=C,i=z):(o+=C,l+=z)});const a=Math.min(i,100-o),h=Math.max(r,100-l),w=e[s];return{valueMax:a,valueMin:h,valueNow:w}}function ze(e,n=document){return Array.from(n.querySelectorAll(`[${k.resizeHandleId}][data-panel-group-id="${e}"]`))}function ln(e,n,t=document){const i=ze(e,t).findIndex(o=>o.getAttribute(k.resizeHandleId)===n);return i??null}function sn(e,n,t){const r=ln(e,n,t);return r!=null?[r,r+1]:[-1,-1]}function an(e,n=document){var t;if(n instanceof HTMLElement&&(n==null||(t=n.dataset)===null||t===void 0?void 0:t.panelGroupId)==e)return n;const r=n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Ie(e,n=document){const t=n.querySelector(`[${k.resizeHandleId}="${e}"]`);return t||null}function Hn(e,n,t,r=document){var i,o,l,s;const a=Ie(n,r),h=ze(e,r),w=a?h.indexOf(a):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(s=t[w+1])===null||s===void 0?void 0:s.id)!==null&&l!==void 0?l:null;return[p,u]}function $n({committedValuesRef:e,eagerValuesRef:n,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const s=ze(t,o);for(let a=0;a<i.length-1;a++){const{valueMax:h,valueMin:w,valueNow:p}=Mn({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),u=s[a];if(u!=null){const v=i[a];x(v,`No panel data found for index "${a}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{s.forEach((a,h)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const s=n.current;x(s,"Eager values not found");const{panelDataArray:a}=s,h=an(t,o);x(h!=null,`No group found for id "${t}"`);const w=ze(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(k.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Hn(t,v,a,o);if(z==null||C==null)return()=>{};const E=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const L=a.findIndex(M=>M.id===z);if(L>=0){const M=a[L];x(M,`No panel data found for index ${L}`);const $=r[L],{collapsedSize:O=0,collapsible:R,minSize:P=0}=M.constraints;if($!=null&&R){const K=ge({delta:W($,O)?P-O:O-$,initialLayout:r,panelConstraints:a.map(J=>J.constraints),pivotIndices:sn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==K&&l(K)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,e,n,t,r,i,l])}function Ve(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function un(e,n){const t=e==="horizontal",{x:r,y:i}=Ee(n);return t?r:i}function Nn(e,n,t,r,i){const o=t==="horizontal",l=Ie(n,i);x(l,`No resize handle element found for id "${n}"`);const s=l.getAttribute(k.groupId);x(s,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=r;const h=un(t,e),w=an(s,i);x(w,`No group element found for id "${s}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-a)/u*100}function _n(e,n,t,r,i,o){if(je(e)){const l=t==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=l?0:s;break;case"ArrowLeft":a=l?-s:0;break;case"ArrowRight":a=l?s:0;break;case"ArrowUp":a=l?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Nn(e,n,t,r,o)}function Gn({panelDataArray:e}){const n=Array(e.length),t=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;s!=null&&(r++,n[o]=s,i-=s)}for(let o=0;o<e.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;if(s!=null)continue;const a=e.length-r,h=i/a;r++,n[o]=h,i-=h}return n}function oe(e,n,t){n.forEach((r,i)=>{const o=e[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:s,id:a}=o,{collapsedSize:h=0,collapsible:w}=s,p=t[a];if(p==null||r!==p){t[a]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||j(p,h))&&!j(r,h)&&v(),u&&(p==null||!j(p,h))&&j(r,h)&&u())}})}function ve(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!=n[t])return!1;return!0}function Bn({defaultSize:e,dragState:n,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let s;return l==null?s=e!=null?e.toPrecision(o):"1":r.length===1?s="1":s=l.toPrecision(o),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:n!==null?"none":void 0}}function Tn(e,n=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{e(...i)},n)}}function Oe(e){try{if(typeof localStorage<"u")e.getItem=n=>localStorage.getItem(n),e.setItem=(n,t)=>{localStorage.setItem(n,t)};else throw new Error("localStorage not supported in this environment")}catch(n){console.error(n),e.getItem=()=>null,e.setItem=()=>{}}}function cn(e){return`react-resizable-panels:${e}`}function fn(e){return e.map(n=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=n;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((n,t)=>n.localeCompare(t)).join(",")}function dn(e,n){try{const t=cn(e),r=n.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Fn(e,n,t){var r,i;const o=(r=dn(e,t))!==null&&r!==void 0?r:{},l=fn(n);return(i=o[l])!==null&&i!==void 0?i:null}function Wn(e,n,t,r,i){var o;const l=cn(e),s=fn(n),a=(o=dn(e,i))!==null&&o!==void 0?o:{};a[s]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(a))}catch(h){console.error(h)}}function qe({layout:e,panelConstraints:n}){const t=[...e],r=t.reduce((o,l)=>o+l,0);if(t.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!W(r,100)&&t.length>0)for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const s=100/r*l;t[o]=s}let i=0;for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const s=le({panelConstraints:n,panelIndex:o,size:l});l!=s&&(i+=l-s,t[o]=s)}if(!W(i,0))for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const s=l+i,a=le({panelConstraints:n,panelIndex:o,size:s});if(l!==a&&(i-=a-l,t[o]=a,W(i,0)))break}return t}const Kn=100,me={getItem:e=>(Oe(me),me.getItem(e)),setItem:(e,n)=>{Oe(me),me.setItem(e,n)}},Xe={};function pn({autoSaveId:e=null,children:n,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:s=null,storage:a=me,style:h,tagName:w="div",...p}){const u=Ne(o),v=f.useRef(null),[z,C]=f.useState(null),[E,b]=f.useState([]),L=kn(),M=f.useRef({}),$=f.useRef(new Map),O=f.useRef(0),R=f.useRef({autoSaveId:e,direction:r,dragState:z,id:u,keyboardResizeBy:s,onLayout:l,storage:a}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:S,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ve(S,d)||(b(d),P.current.layout=d,m&&m(d),oe(g,d,M.current))}}),[]),ne(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=a}),$n({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:b,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(e){if(E.length===0||E.length!==c.length)return;let m=Xe[e];m==null&&(m=Tn(Wn,Kn),Xe[e]=m);const S=[...c],g=new Map($.current);m(e,S,g,E,a)}},[e,E,a]),f.useEffect(()=>{});const K=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:S,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(q=>q.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:H}=Q(g,c,S);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!j(I,y)){$.current.set(c.id,I);const X=ie(g,c)===g.length-1?I-y:y-I,A=ge({delta:X,initialLayout:S,panelConstraints:d,pivotIndices:H,prevLayout:S,trigger:"imperative-api"});ve(S,A)||(b(A),P.current.layout=A,m&&m(A),oe(g,A,M.current))}}},[]),J=f.useCallback((c,m)=>{const{onLayout:S}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(U=>U.constraints),{collapsedSize:I=0,panelSize:H=0,minSize:q=0,pivotIndices:X}=Q(d,c,g),A=m??q;if(j(H,I)){const U=$.current.get(c.id),de=U!=null&&U>=A?U:A,Re=ie(d,c)===d.length-1?H-de:de-H,T=ge({delta:Re,initialLayout:g,panelConstraints:y,pivotIndices:X,prevLayout:g,trigger:"imperative-api"});ve(g,T)||(b(T),P.current.layout=T,S&&S(T),oe(d,T,M.current))}}},[]),F=f.useCallback(c=>{const{layout:m,panelDataArray:S}=P.current,{panelSize:g}=Q(S,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:S}=P.current,g=ie(S,c);return Bn({defaultSize:m,dragState:z,layout:E,panelData:S,panelIndex:g})},[z,E]),D=f.useCallback(c=>{const{layout:m,panelDataArray:S}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(S,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&j(y,g)},[]),Z=f.useCallback(c=>{const{layout:m,panelDataArray:S}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(S,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((S,g)=>{const d=S.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:S}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const H=Fn(c,d,S);H&&($.current=new Map(Object.entries(H.expandToSizes)),y=H.layout)}y==null&&(y=Gn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map(H=>H.constraints)});Ve(g,I)||(b(I),P.current.layout=I,m&&m(I),oe(d,I,M.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const N=f.useCallback(c=>{let m=!1;const S=v.current;return S&&window.getComputedStyle(S,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:H,id:q,keyboardResizeBy:X,onLayout:A}=R.current,{layout:U,panelDataArray:de}=P.current,{initialLayout:xe}=H??{},Re=sn(q,c,y);let T=_n(d,c,I,H,X,y);const Be=I==="horizontal";Be&&m&&(T=-T);const gn=de.map(mn=>mn.constraints),pe=ge({delta:T,initialLayout:xe??U,panelConstraints:gn,pivotIndices:Re,prevLayout:U,trigger:je(d)?"keyboard":"mouse-or-touch"}),Te=!ve(U,pe);(Ye(d)||Ze(d))&&O.current!=T&&(O.current=T,!Te&&T!==0?Be?De(c,T<0?en:nn):De(c,T<0?tn:rn):De(c,0)),Te&&(b(pe),P.current.layout=pe,A&&A(pe),oe(de,pe,M.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:S}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(U=>U.constraints),{panelSize:I,pivotIndices:H}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const X=ie(d,c)===d.length-1?I-m:m-I,A=ge({delta:X,initialLayout:g,panelConstraints:y,pivotIndices:H,prevLayout:g,trigger:"imperative-api"});ve(g,A)||(b(A),P.current.layout=A,S&&S(A),oe(d,A,M.current))},[]),ae=f.useCallback((c,m)=>{const{layout:S,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:H,maxSize:q=100,minSize:X=0}=c.constraints,{panelSize:A}=Q(g,c,S);A!=null&&(y&&H&&j(A,d)?j(d,I)||B(c,I):A<X?B(c,X):A>q&&B(c,q))},[B]),ue=f.useCallback((c,m)=>{const{direction:S}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Ie(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=un(S,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),ye=f.useCallback(c=>{const{panelDataArray:m}=P.current,S=ie(m,c);S>=0&&(m.splice(S,1),delete M.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:K,direction:r,dragState:z,expandPanel:J,getPanelSize:F,getPanelStyle:G,groupId:u,isPanelCollapsed:D,isPanelExpanded:Z,reevaluatePanelConstraints:ae,registerPanel:_,registerResizeHandle:N,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:ye,panelGroupElement:v.current}),[K,z,r,J,F,G,u,D,Z,ae,_,N,B,ue,ce,ye]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(we.Provider,{value:re},f.createElement(w,{...p,children:n,className:t,id:o,ref:v,style:{...fe,...h},[k.group]:"",[k.groupDirection]:r,[k.groupId]:u}))}const Un=f.forwardRef((e,n)=>f.createElement(pn,{...e,forwardedRef:n}));pn.displayName="PanelGroup";Un.displayName="forwardRef(PanelGroup)";function ie(e,n){return e.findIndex(t=>t===n||t.id===n.id)}function Q(e,n,t){const r=ie(e,n),o=r===e.length-1?[r-1,r]:[r,r+1],l=t[r];return{...n.constraints,panelSize:l,pivotIndices:o}}function Vn({disabled:e,handleId:n,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(e||t==null||r==null)return;const i=Ie(n,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const s=i.getAttribute(k.groupId);x(s,`No group element found for id "${s}"`);const a=ze(s,r),h=ln(s,n,r);x(h!==null,`No resize element found for id "${n}"`);const w=l.shiftKey?h>0?h-1:a.length-1:h+1<a.length?h+1:0;a[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,n,t])}function On({children:e=null,className:n="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:s,onFocus:a,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const b=f.useRef(null),L=f.useRef({onClick:l,onDragging:s,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=s,L.current.onPointerDown=h,L.current.onPointerUp=w});const M=f.useContext(we);if(M===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:$,groupId:O,registerResizeHandle:R,startDragging:P,stopDragging:K,panelGroupElement:J}=M,F=Ne(i),[G,D]=f.useState("inactive"),[Z,_]=f.useState(!1),[N,B]=f.useState(null),ae=f.useRef({state:G});ne(()=>{ae.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(F);B(()=>re)}},[t,F,R]);const ue=(C=r==null?void 0:r.coarse)!==null&&C!==void 0?C:15,ce=(E=r==null?void 0:r.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||N==null)return;const re=b.current;x(re,"Element ref not attached");let fe=!1;return Ln(F,re,$,{coarse:ue,fine:ce},(m,S,g)=>{if(!S){D("inactive");return}switch(m){case"down":{D("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(F,g);const{onDragging:d,onPointerDown:y}=L.current;d==null||d(!0),y==null||y();break}case"move":{const{state:d}=ae.current;fe=!0,d!=="drag"&&D("hover"),x(g,'Expected event to be defined for "move" action'),N(g);break}case"up":{D("hover"),K();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y==null||y(!1),I==null||I(),fe||d==null||d();break}}})},[ue,$,t,ce,R,F,N,P,K]),Vn({disabled:t,handleId:F,resizeHandler:N,panelGroupElement:J});const ye={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:e,className:n,id:i,onBlur:()=>{_(!1),o==null||o()},onFocus:()=>{_(!0),a==null||a()},ref:b,role:"separator",style:{...ye,...p},tabIndex:u,[k.groupDirection]:$,[k.groupId]:O,[k.resizeHandle]:"",[k.resizeHandleActive]:G==="drag"?"pointer":Z?"keyboard":void 0,[k.resizeHandleEnabled]:!t,[k.resizeHandleId]:F,[k.resizeHandleState]:G})}On.displayName="PanelResizeHandle";export{Un as P,xn as a,On as b};
|
|
1
|
+
import{a as f,R as hn}from"./icons-Di-qMB6n.js";const we=f.createContext(null);we.displayName="PanelGroupContext";const k={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},$e=10,ne=f.useLayoutEffect,Fe=hn.useId,zn=typeof Fe=="function"?Fe:()=>null;let yn=0;function Ne(e=null){const n=zn(),t=f.useRef(e||n||null);return t.current===null&&(t.current=""+yn++),e??t.current}function Je({children:e,className:n="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:s,minSize:a,onCollapse:h,onExpand:w,onResize:p,order:u,style:v,tagName:z="div",...C}){const E=f.useContext(we);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:L,getPanelSize:M,getPanelStyle:$,groupId:O,isPanelCollapsed:R,reevaluatePanelConstraints:P,registerPanel:K,resizePanel:J,unregisterPanel:F}=E,G=Ne(l),D=f.useRef({callbacks:{onCollapse:h,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:s,minSize:a},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:N}=D.current,B={...N};D.current.id=G,D.current.idIsFromProps=l!==void 0,D.current.order=u,_.onCollapse=h,_.onExpand=w,_.onResize=p,N.collapsedSize=t,N.collapsible=r,N.defaultSize=i,N.maxSize=s,N.minSize=a,(B.collapsedSize!==N.collapsedSize||B.collapsible!==N.collapsible||B.maxSize!==N.maxSize||B.minSize!==N.minSize)&&P(D.current,B)}),ne(()=>{const _=D.current;return K(_),()=>{F(_)}},[u,G,K,F]),f.useImperativeHandle(o,()=>({collapse:()=>{b(D.current)},expand:_=>{L(D.current,_)},getId(){return G},getSize(){return M(D.current)},isCollapsed(){return R(D.current)},isExpanded(){return!R(D.current)},resize:_=>{J(D.current,_)}}),[b,L,M,R,G,J]);const Z=$(D.current,i);return f.createElement(z,{...C,children:e,className:n,id:G,style:{...Z,...v},[k.groupId]:O,[k.panel]:"",[k.panelCollapsible]:r||void 0,[k.panelId]:G,[k.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const xn=f.forwardRef((e,n)=>f.createElement(Je,{...e,forwardedRef:n}));Je.displayName="Panel";xn.displayName="forwardRef(Panel)";let He=null,Se=-1,Y=null;function vn(e,n){if(n){const t=(n&en)!==0,r=(n&nn)!==0,i=(n&tn)!==0,o=(n&rn)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Sn(){Y!==null&&(document.head.removeChild(Y),He=null,Y=null,Se=-1)}function Le(e,n){var t,r;const i=vn(e,n);if(He!==i){if(He=i,Y===null&&(Y=document.createElement("style"),document.head.appendChild(Y)),Se>=0){var o;(o=Y.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=Y.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function je(e){return e.type==="keydown"}function Ye(e){return e.type.startsWith("pointer")}function Ze(e){return e.type.startsWith("mouse")}function Ee(e){if(Ye(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Ze(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function bn(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Pn(e,n,t){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function wn(e,n){if(e===n)throw new Error("Cannot compare node with itself");const t={a:Ue(e),b:Ue(n)};let r;for(;t.a.at(-1)===t.b.at(-1);)e=t.a.pop(),n=t.b.pop(),r=e;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ke(We(t.a)),b:Ke(We(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let s=o.length;for(;s--;){const a=o[s];if(a===l.a)return 1;if(a===l.b)return-1}}return Math.sign(i.a-i.b)}const En=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Cn(e){var n;const t=getComputedStyle((n=Qe(e))!==null&&n!==void 0?n:e).display;return t==="flex"||t==="inline-flex"}function In(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||Cn(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||En.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function We(e){let n=e.length;for(;n--;){const t=e[n];if(x(t,"Missing node"),In(t))return t}return null}function Ke(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ue(e){const n=[];for(;e;)n.push(e),e=Qe(e);return n}function Qe(e){const{parentNode:n}=e;return n&&n instanceof ShadowRoot?n.host:n}const en=1,nn=2,tn=4,rn=8,Rn=bn()==="coarse";let V=[],se=!1,ee=new Map,Ce=new Map;const he=new Set;function Ln(e,n,t,r,i){var o;const{ownerDocument:l}=n,s={direction:t,element:n,hitAreaMargins:r,setResizeHandlerState:i},a=(o=ee.get(l))!==null&&o!==void 0?o:0;return ee.set(l,a+1),he.add(s),be(),function(){var w;Ce.delete(e),he.delete(s);const p=(w=ee.get(l))!==null&&w!==void 0?w:1;if(ee.set(l,p-1),be(),p===1&&ee.delete(l),V.includes(s)){const u=V.indexOf(s);u>=0&&V.splice(u,1),Ge(),i("up",!0,null)}}}function An(e){const{target:n}=e,{x:t,y:r}=Ee(e);se=!0,_e({target:n,x:t,y:r}),be(),V.length>0&&(Pe("down",e),e.preventDefault(),on(n)||e.stopImmediatePropagation())}function Ae(e){const{x:n,y:t}=Ee(e);if(se&&e.buttons===0&&(se=!1,Pe("up",e)),!se){const{target:r}=e;_e({target:r,x:n,y:t})}Pe("move",e),Ge(),V.length>0&&e.preventDefault()}function ke(e){const{target:n}=e,{x:t,y:r}=Ee(e);Ce.clear(),se=!1,V.length>0&&(e.preventDefault(),on(n)||e.stopImmediatePropagation()),Pe("up",e),_e({target:n,x:t,y:r}),Ge(),be()}function on(e){let n=e;for(;n;){if(n.hasAttribute(k.resizeHandle))return!0;n=n.parentElement}return!1}function _e({target:e,x:n,y:t}){V.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),he.forEach(i=>{const{element:o,hitAreaMargins:l}=i,s=o.getBoundingClientRect(),{bottom:a,left:h,right:w,top:p}=s,u=Rn?l.coarse:l.fine;if(n>=h-u&&n<=w+u&&t>=p-u&&t<=a+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&wn(r,o)>0){let z=r,C=!1;for(;z&&!z.contains(o);){if(Pn(z.getBoundingClientRect(),s)){C=!0;break}z=z.parentElement}if(C)return}V.push(i)}})}function De(e,n){Ce.set(e,n)}function Ge(){let e=!1,n=!1;V.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:n=!0});let t=0;Ce.forEach(r=>{t|=r}),e&&n?Le("intersection",t):e?Le("horizontal",t):n?Le("vertical",t):Sn()}let Me=new AbortController;function be(){Me.abort(),Me=new AbortController;const e={capture:!0,signal:Me.signal};he.size&&(se?(V.length>0&&ee.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("contextmenu",ke,e),r.addEventListener("pointerleave",Ae,e),r.addEventListener("pointermove",Ae,e))}),window.addEventListener("pointerup",ke,e),window.addEventListener("pointercancel",ke,e)):ee.forEach((n,t)=>{const{body:r}=t;n>0&&(r.addEventListener("pointerdown",An,e),r.addEventListener("pointermove",Ae,e))}))}function Pe(e,n){he.forEach(t=>{const{setResizeHandlerState:r}=t,i=V.includes(t);r(e,i,n)})}function kn(){const[e,n]=f.useState(0);return f.useCallback(()=>n(t=>t+1),[])}function x(e,n){if(!e)throw console.error(n),Error(n)}function te(e,n,t=$e){return e.toFixed(t)===n.toFixed(t)?0:e>n?1:-1}function j(e,n,t=$e){return te(e,n,t)===0}function W(e,n,t){return te(e,n,t)===0}function Dn(e,n,t){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=n[r];if(!W(i,o,t))return!1}return!0}function le({panelConstraints:e,panelIndex:n,size:t}){const r=e[n];x(r!=null,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:s=0}=r;if(te(t,s)<0)if(o){const a=(i+s)/2;te(t,a)<0?t=i:t=s}else t=s;return t=Math.min(l,t),t=parseFloat(t.toFixed($e)),t}function ge({delta:e,initialLayout:n,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(W(e,0))return n;const l=[...n],[s,a]=r;x(s!=null,"Invalid first pivot index"),x(a!=null,"Invalid second pivot index");let h=0;if(o==="keyboard"){{const p=e<0?a:s,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=n[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),W(E,v)){const b=C-E;te(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}{const p=e<0?s:a,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:z,minSize:C=0}=u;if(z){const E=n[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),W(E,C)){const b=E-v;te(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}}{const p=e<0?1:-1;let u=e<0?a:s,v=0;for(;;){const C=n[u];x(C!=null,`Previous layout not found for panel index ${u}`);const b=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=b,u+=p,u<0||u>=t.length)break}const z=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-z:z}{let u=e<0?s:a;for(;u>=0&&u<t.length;){const v=Math.abs(e)-Math.abs(h),z=n[u];x(z!=null,`Previous layout not found for panel index ${u}`);const C=z-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!W(z,E)&&(h+=z-E,l[u]=E,h.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?u--:u++}}if(Dn(i,l))return i;{const p=e<0?a:s,u=n[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+h,z=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=z,!W(z,v)){let C=v-z,b=e<0?a:s;for(;b>=0&&b<t.length;){const L=l[b];x(L!=null,`Previous layout not found for panel index ${b}`);const M=L+C,$=le({panelConstraints:t,panelIndex:b,size:M});if(W(L,$)||(C-=$-L,l[b]=$),W(C,0))break;e>0?b--:b++}}}const w=l.reduce((p,u)=>u+p,0);return W(w,100)?l:i}function Mn({layout:e,panelsArray:n,pivotIndices:t}){let r=0,i=100,o=0,l=0;const s=t[0];x(s!=null,"No pivot index found"),n.forEach((p,u)=>{const{constraints:v}=p,{maxSize:z=100,minSize:C=0}=v;u===s?(r=C,i=z):(o+=C,l+=z)});const a=Math.min(i,100-o),h=Math.max(r,100-l),w=e[s];return{valueMax:a,valueMin:h,valueNow:w}}function ze(e,n=document){return Array.from(n.querySelectorAll(`[${k.resizeHandleId}][data-panel-group-id="${e}"]`))}function ln(e,n,t=document){const i=ze(e,t).findIndex(o=>o.getAttribute(k.resizeHandleId)===n);return i??null}function sn(e,n,t){const r=ln(e,n,t);return r!=null?[r,r+1]:[-1,-1]}function an(e,n=document){var t;if(n instanceof HTMLElement&&(n==null||(t=n.dataset)===null||t===void 0?void 0:t.panelGroupId)==e)return n;const r=n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Ie(e,n=document){const t=n.querySelector(`[${k.resizeHandleId}="${e}"]`);return t||null}function Hn(e,n,t,r=document){var i,o,l,s;const a=Ie(n,r),h=ze(e,r),w=a?h.indexOf(a):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(s=t[w+1])===null||s===void 0?void 0:s.id)!==null&&l!==void 0?l:null;return[p,u]}function $n({committedValuesRef:e,eagerValuesRef:n,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const s=ze(t,o);for(let a=0;a<i.length-1;a++){const{valueMax:h,valueMin:w,valueNow:p}=Mn({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),u=s[a];if(u!=null){const v=i[a];x(v,`No panel data found for index "${a}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(h)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{s.forEach((a,h)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const s=n.current;x(s,"Eager values not found");const{panelDataArray:a}=s,h=an(t,o);x(h!=null,`No group found for id "${t}"`);const w=ze(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(k.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[z,C]=Hn(t,v,a,o);if(z==null||C==null)return()=>{};const E=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const L=a.findIndex(M=>M.id===z);if(L>=0){const M=a[L];x(M,`No panel data found for index ${L}`);const $=r[L],{collapsedSize:O=0,collapsible:R,minSize:P=0}=M.constraints;if($!=null&&R){const K=ge({delta:W($,O)?P-O:O-$,initialLayout:r,panelConstraints:a.map(J=>J.constraints),pivotIndices:sn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==K&&l(K)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,e,n,t,r,i,l])}function Ve(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function un(e,n){const t=e==="horizontal",{x:r,y:i}=Ee(n);return t?r:i}function Nn(e,n,t,r,i){const o=t==="horizontal",l=Ie(n,i);x(l,`No resize handle element found for id "${n}"`);const s=l.getAttribute(k.groupId);x(s,"Resize handle element has no group id attribute");let{initialCursorPosition:a}=r;const h=un(t,e),w=an(s,i);x(w,`No group element found for id "${s}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(h-a)/u*100}function _n(e,n,t,r,i,o){if(je(e)){const l=t==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=l?0:s;break;case"ArrowLeft":a=l?-s:0;break;case"ArrowRight":a=l?s:0;break;case"ArrowUp":a=l?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:Nn(e,n,t,r,o)}function Gn({panelDataArray:e}){const n=Array(e.length),t=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;s!=null&&(r++,n[o]=s,i-=s)}for(let o=0;o<e.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:s}=l;if(s!=null)continue;const a=e.length-r,h=i/a;r++,n[o]=h,i-=h}return n}function oe(e,n,t){n.forEach((r,i)=>{const o=e[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:s,id:a}=o,{collapsedSize:h=0,collapsible:w}=s,p=t[a];if(p==null||r!==p){t[a]=r;const{onCollapse:u,onExpand:v,onResize:z}=l;z&&z(r,p),w&&(u||v)&&(v&&(p==null||j(p,h))&&!j(r,h)&&v(),u&&(p==null||!j(p,h))&&j(r,h)&&u())}})}function ve(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!=n[t])return!1;return!0}function Bn({defaultSize:e,dragState:n,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let s;return l==null?s=e!=null?e.toPrecision(o):"1":r.length===1?s="1":s=l.toPrecision(o),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:n!==null?"none":void 0}}function Tn(e,n=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{e(...i)},n)}}function Oe(e){try{if(typeof localStorage<"u")e.getItem=n=>localStorage.getItem(n),e.setItem=(n,t)=>{localStorage.setItem(n,t)};else throw new Error("localStorage not supported in this environment")}catch(n){console.error(n),e.getItem=()=>null,e.setItem=()=>{}}}function cn(e){return`react-resizable-panels:${e}`}function fn(e){return e.map(n=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=n;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((n,t)=>n.localeCompare(t)).join(",")}function dn(e,n){try{const t=cn(e),r=n.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Fn(e,n,t){var r,i;const o=(r=dn(e,t))!==null&&r!==void 0?r:{},l=fn(n);return(i=o[l])!==null&&i!==void 0?i:null}function Wn(e,n,t,r,i){var o;const l=cn(e),s=fn(n),a=(o=dn(e,i))!==null&&o!==void 0?o:{};a[s]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(a))}catch(h){console.error(h)}}function qe({layout:e,panelConstraints:n}){const t=[...e],r=t.reduce((o,l)=>o+l,0);if(t.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!W(r,100)&&t.length>0)for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const s=100/r*l;t[o]=s}let i=0;for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const s=le({panelConstraints:n,panelIndex:o,size:l});l!=s&&(i+=l-s,t[o]=s)}if(!W(i,0))for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const s=l+i,a=le({panelConstraints:n,panelIndex:o,size:s});if(l!==a&&(i-=a-l,t[o]=a,W(i,0)))break}return t}const Kn=100,me={getItem:e=>(Oe(me),me.getItem(e)),setItem:(e,n)=>{Oe(me),me.setItem(e,n)}},Xe={};function pn({autoSaveId:e=null,children:n,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:s=null,storage:a=me,style:h,tagName:w="div",...p}){const u=Ne(o),v=f.useRef(null),[z,C]=f.useState(null),[E,b]=f.useState([]),L=kn(),M=f.useRef({}),$=f.useRef(new Map),O=f.useRef(0),R=f.useRef({autoSaveId:e,direction:r,dragState:z,id:u,keyboardResizeBy:s,onLayout:l,storage:a}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=R.current,{layout:S,panelDataArray:g}=P.current,d=qe({layout:c,panelConstraints:g.map(y=>y.constraints)});Ve(S,d)||(b(d),P.current.layout=d,m&&m(d),oe(g,d,M.current))}}),[]),ne(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=z,R.current.id=u,R.current.onLayout=l,R.current.storage=a}),$n({committedValuesRef:R,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:b,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(e){if(E.length===0||E.length!==c.length)return;let m=Xe[e];m==null&&(m=Tn(Wn,Kn),Xe[e]=m);const S=[...c],g=new Map($.current);m(e,S,g,E,a)}},[e,E,a]),f.useEffect(()=>{});const K=f.useCallback(c=>{const{onLayout:m}=R.current,{layout:S,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(q=>q.constraints),{collapsedSize:y=0,panelSize:I,pivotIndices:H}=Q(g,c,S);if(x(I!=null,`Panel size not found for panel "${c.id}"`),!j(I,y)){$.current.set(c.id,I);const X=ie(g,c)===g.length-1?I-y:y-I,A=ge({delta:X,initialLayout:S,panelConstraints:d,pivotIndices:H,prevLayout:S,trigger:"imperative-api"});ve(S,A)||(b(A),P.current.layout=A,m&&m(A),oe(g,A,M.current))}}},[]),J=f.useCallback((c,m)=>{const{onLayout:S}=R.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(U=>U.constraints),{collapsedSize:I=0,panelSize:H=0,minSize:q=0,pivotIndices:X}=Q(d,c,g),A=m??q;if(j(H,I)){const U=$.current.get(c.id),de=U!=null&&U>=A?U:A,Re=ie(d,c)===d.length-1?H-de:de-H,T=ge({delta:Re,initialLayout:g,panelConstraints:y,pivotIndices:X,prevLayout:g,trigger:"imperative-api"});ve(g,T)||(b(T),P.current.layout=T,S&&S(T),oe(d,T,M.current))}}},[]),F=f.useCallback(c=>{const{layout:m,panelDataArray:S}=P.current,{panelSize:g}=Q(S,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:S}=P.current,g=ie(S,c);return Bn({defaultSize:m,dragState:z,layout:E,panelData:S,panelIndex:g})},[z,E]),D=f.useCallback(c=>{const{layout:m,panelDataArray:S}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(S,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&j(y,g)},[]),Z=f.useCallback(c=>{const{layout:m,panelDataArray:S}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=Q(S,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((S,g)=>{const d=S.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:S}=R.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const H=Fn(c,d,S);H&&($.current=new Map(Object.entries(H.expandToSizes)),y=H.layout)}y==null&&(y=Gn({panelDataArray:d}));const I=qe({layout:y,panelConstraints:d.map(H=>H.constraints)});Ve(g,I)||(b(I),P.current.layout=I,m&&m(I),oe(d,I,M.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const N=f.useCallback(c=>{let m=!1;const S=v.current;return S&&window.getComputedStyle(S,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:I,dragState:H,id:q,keyboardResizeBy:X,onLayout:A}=R.current,{layout:U,panelDataArray:de}=P.current,{initialLayout:xe}=H??{},Re=sn(q,c,y);let T=_n(d,c,I,H,X,y);const Be=I==="horizontal";Be&&m&&(T=-T);const gn=de.map(mn=>mn.constraints),pe=ge({delta:T,initialLayout:xe??U,panelConstraints:gn,pivotIndices:Re,prevLayout:U,trigger:je(d)?"keyboard":"mouse-or-touch"}),Te=!ve(U,pe);(Ye(d)||Ze(d))&&O.current!=T&&(O.current=T,!Te&&T!==0?Be?De(c,T<0?en:nn):De(c,T<0?tn:rn):De(c,0)),Te&&(b(pe),P.current.layout=pe,A&&A(pe),oe(de,pe,M.current))}},[]),B=f.useCallback((c,m)=>{const{onLayout:S}=R.current,{layout:g,panelDataArray:d}=P.current,y=d.map(U=>U.constraints),{panelSize:I,pivotIndices:H}=Q(d,c,g);x(I!=null,`Panel size not found for panel "${c.id}"`);const X=ie(d,c)===d.length-1?I-m:m-I,A=ge({delta:X,initialLayout:g,panelConstraints:y,pivotIndices:H,prevLayout:g,trigger:"imperative-api"});ve(g,A)||(b(A),P.current.layout=A,S&&S(A),oe(d,A,M.current))},[]),ae=f.useCallback((c,m)=>{const{layout:S,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:I=0,collapsible:H,maxSize:q=100,minSize:X=0}=c.constraints,{panelSize:A}=Q(g,c,S);A!=null&&(y&&H&&j(A,d)?j(d,I)||B(c,I):A<X?B(c,X):A>q&&B(c,q))},[B]),ue=f.useCallback((c,m)=>{const{direction:S}=R.current,{layout:g}=P.current;if(!v.current)return;const d=Ie(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=un(S,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),ye=f.useCallback(c=>{const{panelDataArray:m}=P.current,S=ie(m,c);S>=0&&(m.splice(S,1),delete M.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:K,direction:r,dragState:z,expandPanel:J,getPanelSize:F,getPanelStyle:G,groupId:u,isPanelCollapsed:D,isPanelExpanded:Z,reevaluatePanelConstraints:ae,registerPanel:_,registerResizeHandle:N,resizePanel:B,startDragging:ue,stopDragging:ce,unregisterPanel:ye,panelGroupElement:v.current}),[K,z,r,J,F,G,u,D,Z,ae,_,N,B,ue,ce,ye]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(we.Provider,{value:re},f.createElement(w,{...p,children:n,className:t,id:o,ref:v,style:{...fe,...h},[k.group]:"",[k.groupDirection]:r,[k.groupId]:u}))}const Un=f.forwardRef((e,n)=>f.createElement(pn,{...e,forwardedRef:n}));pn.displayName="PanelGroup";Un.displayName="forwardRef(PanelGroup)";function ie(e,n){return e.findIndex(t=>t===n||t.id===n.id)}function Q(e,n,t){const r=ie(e,n),o=r===e.length-1?[r-1,r]:[r,r+1],l=t[r];return{...n.constraints,panelSize:l,pivotIndices:o}}function Vn({disabled:e,handleId:n,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(e||t==null||r==null)return;const i=Ie(n,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const s=i.getAttribute(k.groupId);x(s,`No group element found for id "${s}"`);const a=ze(s,r),h=ln(s,n,r);x(h!==null,`No resize element found for id "${n}"`);const w=l.shiftKey?h>0?h-1:a.length-1:h+1<a.length?h+1:0;a[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,n,t])}function On({children:e=null,className:n="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:s,onFocus:a,onPointerDown:h,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...z}){var C,E;const b=f.useRef(null),L=f.useRef({onClick:l,onDragging:s,onPointerDown:h,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=s,L.current.onPointerDown=h,L.current.onPointerUp=w});const M=f.useContext(we);if(M===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:$,groupId:O,registerResizeHandle:R,startDragging:P,stopDragging:K,panelGroupElement:J}=M,F=Ne(i),[G,D]=f.useState("inactive"),[Z,_]=f.useState(!1),[N,B]=f.useState(null),ae=f.useRef({state:G});ne(()=>{ae.current.state=G}),f.useEffect(()=>{if(t)B(null);else{const re=R(F);B(()=>re)}},[t,F,R]);const ue=(C=r==null?void 0:r.coarse)!==null&&C!==void 0?C:15,ce=(E=r==null?void 0:r.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||N==null)return;const re=b.current;x(re,"Element ref not attached");let fe=!1;return Ln(F,re,$,{coarse:ue,fine:ce},(m,S,g)=>{if(!S){D("inactive");return}switch(m){case"down":{D("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(F,g);const{onDragging:d,onPointerDown:y}=L.current;d==null||d(!0),y==null||y();break}case"move":{const{state:d}=ae.current;fe=!0,d!=="drag"&&D("hover"),x(g,'Expected event to be defined for "move" action'),N(g);break}case"up":{D("hover"),K();const{onClick:d,onDragging:y,onPointerUp:I}=L.current;y==null||y(!1),I==null||I(),fe||d==null||d();break}}})},[ue,$,t,ce,R,F,N,P,K]),Vn({disabled:t,handleId:F,resizeHandler:N,panelGroupElement:J});const ye={touchAction:"none",userSelect:"none"};return f.createElement(v,{...z,children:e,className:n,id:i,onBlur:()=>{_(!1),o==null||o()},onFocus:()=>{_(!0),a==null||a()},ref:b,role:"separator",style:{...ye,...p},tabIndex:u,[k.groupDirection]:$,[k.groupId]:O,[k.resizeHandle]:"",[k.resizeHandleActive]:G==="drag"?"pointer":Z?"keyboard":void 0,[k.resizeHandleEnabled]:!t,[k.resizeHandleId]:F,[k.resizeHandleState]:G})}On.displayName="PanelResizeHandle";export{Un as P,xn as a,On as b};
|
package/web/dist/index.html
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
<meta name="theme-color" content="#0d1117" />
|
|
13
13
|
<meta name="color-scheme" content="dark light" />
|
|
14
14
|
<title>DeepSeekCode Web</title>
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/icons-
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/markdown-
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/react-vendor-
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/state-
|
|
20
|
-
<link rel="modulepreload" crossorigin href="/assets/panels-
|
|
21
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-Dkxsd1Rx.js"></script>
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-Di-qMB6n.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/markdown-D-c9V8Xq.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/react-vendor-DU8XgZt2.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/state-D2vcUGVk.js">
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/panels-CpHTincc.js">
|
|
21
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BbLAiXis.css">
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
24
24
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./markdown-Bym7wmT0.js";import{a as n,ak as v,h as $,z as D,$ as O,bf as I,f as L,aq as J,aO as U,X}from"./icons-Cu8fYt4q.js";import{u as q,X as B}from"./index-C7rIgpwO.js";import"./react-vendor-D76F8wnc.js";import"./state-CZakZ3-m.js";import"./panels-BEKHl5l-.js";function Q(){const{t:a}=q(),{automations:r,runsByAutomation:d,fetchAutomations:o,createAutomation:N,deleteAutomation:y,toggleAutomation:w,runAutomation:C,fetchRuns:A,error:l}=B(),[S,x]=n.useState(!1),[m,z]=n.useState(null),[u,p]=n.useState(""),[h,b]=n.useState(""),[i,g]=n.useState("0 9 * * *"),[f,j]=n.useState("");n.useEffect(()=>{o()},[o]);const P=async t=>{const s=f.trim();if(!s)return;const[c,...T]=s.split(/\s+/),k=T.join(" ");c&&k&&(await fetch(`/api/automations/${encodeURIComponent(t)}/permissions`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tool:c,target:k})})).ok&&(j(""),await o())},E=async(t,s)=>{(await fetch(`/api/automations/${encodeURIComponent(t)}/permissions`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({entry:s})})).ok&&await o()},R=async t=>{const s=m===t?null:t;z(s),s&&await A(t)};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[e.jsx(v,{size:20,className:"text-accent-blue"}),a("automation.title"),e.jsxs("span",{className:"text-xs text-dark-muted font-normal",children:["(",r.length,")"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>void o(),className:"p-2 rounded-lg hover:bg-dark-hover text-dark-muted",title:a("automation.refresh"),children:e.jsx($,{size:16})}),e.jsxs("button",{onClick:()=>x(t=>!t),className:"flex items-center gap-1 px-3 py-1.5 rounded-lg bg-accent-blue/20 text-accent-blue hover:bg-accent-blue/30 text-sm font-medium",children:[e.jsx(D,{size:16})," ",a("automation.new")]})]})]}),l&&e.jsxs("div",{className:"mb-3 p-3 rounded-lg bg-accent-red/10 text-accent-red text-sm flex items-center gap-2",children:[e.jsx(O,{size:16})," ",l]}),S&&e.jsxs("div",{className:"mb-4 rounded-lg border border-dark-border bg-dark-surface p-4 space-y-3",children:[e.jsx("input",{value:u,onChange:t=>p(t.target.value),placeholder:a("automation.namePlaceholder"),className:"w-full px-3 py-2 rounded-lg bg-dark-bg border border-dark-border text-sm focus:outline-none focus:border-accent-blue"}),e.jsx("textarea",{value:h,onChange:t=>b(t.target.value),placeholder:a("automation.instructionsPlaceholder"),rows:3,className:"w-full px-3 py-2 rounded-lg bg-dark-bg border border-dark-border text-sm focus:outline-none focus:border-accent-blue resize-none"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:i,onChange:t=>g(t.target.value),placeholder:a("automation.cronPlaceholder"),className:"flex-1 px-3 py-2 rounded-lg bg-dark-bg border border-dark-border text-sm focus:outline-none focus:border-accent-blue"}),e.jsx("button",{onClick:async()=>{await N({name:u,instructions:h,schedule:{kind:"cron",cron:i}})&&(p(""),b(""),x(!1))},className:"px-4 py-2 rounded-lg bg-accent-blue text-white text-sm font-medium hover:bg-accent-blue/80",children:a("automation.create")})]}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:[["0 9 * * *",a("automation.cronDaily9")],["0 9 * * 1-5",a("automation.cronWeekday9")],["*/30 * * * *",a("automation.cronEvery30Min")]].map(([t,s])=>e.jsxs("button",{onClick:()=>g(t),className:`px-2 py-1 rounded text-xs ${i===t?"bg-accent-blue/20 text-accent-blue":"bg-dark-hover text-dark-muted hover:text-dark-text"}`,children:[s," (",t,")"]},t))})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto space-y-2",children:[r.length===0&&e.jsx("p",{className:"text-dark-muted text-center py-8",children:a("automation.empty")}),r.map(t=>e.jsxs("div",{className:"rounded-lg border border-dark-border bg-dark-surface",children:[e.jsxs("div",{className:"flex items-center justify-between p-3",children:[e.jsxs("button",{onClick:()=>void R(t.id),className:"flex items-center gap-2 min-w-0 text-left",children:[e.jsx(v,{size:16,className:"text-accent-blue shrink-0"}),e.jsx("span",{className:"font-medium text-sm truncate",children:t.name}),e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded shrink-0 ${t.status==="enabled"?"bg-accent-green/20 text-accent-green":"bg-dark-hover text-dark-muted"}`,children:t.status})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsxs("span",{className:"text-xs text-dark-muted hidden lg:inline mr-1",children:[t.schedule.kind==="cron"?t.schedule.cron:t.schedule.fireAt,t.nextRunAt?` · ${new Date(t.nextRunAt).toLocaleString()}`:""]}),e.jsx("button",{onClick:()=>void w(t.id,t.status!=="enabled"),className:"p-1.5 rounded-lg hover:bg-dark-hover text-dark-muted",title:t.status==="enabled"?a("automation.disable"):a("automation.enable"),children:e.jsx(I,{size:15})}),e.jsx("button",{onClick:()=>void C(t.id),className:"p-1.5 rounded-lg hover:bg-dark-hover text-accent-green",title:a("automation.runNow"),children:e.jsx(L,{size:15})}),e.jsx("button",{onClick:()=>void y(t.id),className:"p-1.5 rounded-lg hover:bg-dark-hover text-accent-red",title:a("automation.delete"),children:e.jsx(J,{size:15})})]})]}),m===t.id&&e.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-dark-border pt-3",children:[e.jsx("p",{className:"text-xs text-dark-muted whitespace-pre-wrap",children:t.instructions}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs font-semibold text-dark-muted mb-1 flex items-center gap-1",children:[e.jsx(U,{size:12})," ",a("automation.historyTitle")]}),(d[t.id]||[]).length===0&&e.jsx("p",{className:"text-xs text-dark-muted",children:a("automation.noRuns")}),(d[t.id]||[]).slice(0,10).map(s=>e.jsxs("div",{className:"flex items-center gap-2 text-xs py-1",children:[e.jsx("span",{className:`px-1.5 py-0.5 rounded ${s.status==="ok"?"bg-accent-green/20 text-accent-green":s.status==="error"?"bg-accent-red/20 text-accent-red":"bg-accent-yellow/20 text-accent-yellow"}`,children:s.status}),e.jsx("span",{className:"text-dark-muted",children:new Date(s.startedAt).toLocaleString()}),e.jsxs("span",{className:"text-dark-muted truncate flex-1",children:["#",s.id.slice(0,8)," · ",s.trigger]})]},s.id))]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-dark-muted mb-1",children:a("automation.permissionsTitle")}),t.permissions.length===0&&e.jsx("p",{className:"text-xs text-dark-muted",children:a("automation.permissionsEmpty")}),e.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:t.permissions.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded bg-accent-blue/10 text-accent-blue text-xs",children:[s,e.jsx("button",{onClick:()=>void E(t.id,s),className:"hover:text-accent-red",children:e.jsx(X,{size:12})})]},s))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:f,onChange:s=>j(s.target.value),placeholder:a("automation.permissionPlaceholder"),className:"flex-1 px-2 py-1.5 rounded-lg bg-dark-bg border border-dark-border text-xs focus:outline-none focus:border-accent-blue"}),e.jsx("button",{onClick:()=>void P(t.id),className:"px-3 py-1.5 rounded-lg bg-dark-hover text-dark-muted hover:text-dark-text text-xs",children:a("automation.add")})]})]})]})]},t.id))]})]})}export{Q as AutomationView};
|