moi-computer 0.5.2-next.0 → 0.6.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/client/AGENTS.md +9 -0
- package/client/api/app-ui-keys.ts +4 -0
- package/client/api/workspace-keys.ts +2 -2
- package/client/app/routes/WorkspaceRoute.tsx +8 -28
- package/client/app/shell/SidebarLayout.tsx +1 -1
- package/client/components/shared/Composer.tsx +15 -9
- package/client/components/shared/IconGhost.tsx +130 -0
- package/client/components/ui/dropdown-menu.tsx +2 -5
- package/client/components/ui/popover.tsx +11 -4
- package/client/components/ui/slider.tsx +70 -0
- package/client/components/ui/spinner.tsx +18 -0
- package/client/components/ui/toast.tsx +220 -0
- package/client/components/ui/tooltip.tsx +1 -1
- package/client/features/chat/ChatComposer.tsx +11 -14
- package/client/features/chat/ChatPanel.tsx +15 -14
- package/client/features/chat/ChatPopup.tsx +10 -4
- package/client/features/chat/ChatSelector.tsx +263 -48
- package/client/features/chat/ModelPicker.tsx +295 -121
- package/client/features/chat/TurnView.tsx +1 -1
- package/client/features/chat/api.ts +36 -9
- package/client/features/chat/chat-frames.ts +35 -6
- package/client/features/chat/chat-send.ts +40 -6
- package/client/features/chat/chat-store.ts +52 -40
- package/client/features/chat/model-order.ts +50 -28
- package/client/features/chat/useChat.ts +71 -60
- package/client/features/chat/useSelectedSession.ts +151 -0
- package/client/features/chat/useStickToBottom.ts +3 -3
- package/client/features/home/api.ts +0 -2
- package/client/features/scratchpad/ScratchpadControls.tsx +2 -2
- package/client/features/settings/IconPicker.tsx +2 -2
- package/client/features/settings/WorkspaceSettings.tsx +6 -6
- package/client/features/views/ViewBuilderTab.tsx +3 -4
- package/client/features/views/api.ts +1 -0
- package/client/features/views/useViewBuilderActions.ts +7 -3
- package/client/features/workspace/WorkspaceScreen.tsx +40 -19
- package/client/features/workspace/WorkspaceSkillUpdateBanner.tsx +2 -2
- package/client/features/workspace/WorkspaceTabs.tsx +10 -1
- package/client/index.css +5 -3
- package/client/main.tsx +2 -0
- package/client/runtime/useWorkspaceEvents.ts +1 -0
- package/client/store/ui.ts +13 -3
- package/dist/{chunk-m9qja0nx.js → chunk-0pcdwjkp.js} +1 -1
- package/dist/chunk-55sh4dty.js +2 -0
- package/dist/{chunk-h3evrtyp.js → chunk-9y2zbzqz.js} +1 -1
- package/dist/{chunk-7bzpmtxp.js → chunk-afgbg75t.js} +1 -1
- package/dist/chunk-agtetn7n.css +1 -0
- package/dist/chunk-bv6vrvqf.js +27 -0
- package/dist/chunk-dfs36zgc.js +1 -0
- package/dist/chunk-exj6hr30.js +9 -0
- package/dist/{chunk-v797g6ap.js → chunk-m11ckkxd.js} +1 -1
- package/dist/chunk-n6t40enm.js +1 -0
- package/dist/{chunk-jg6ezptn.js → chunk-rxvx4ta9.js} +3 -3
- package/dist/index.html +1 -1
- package/lib/attachment-note.ts +18 -0
- package/lib/chat-title.ts +6 -0
- package/lib/types.ts +33 -10
- package/package.json +1 -1
- package/server/api.ts +100 -10
- package/server/app-settings.ts +1 -1
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +6 -0
- package/server/harness/claude-code/adapter.ts +2 -2
- package/server/harness/claude-code/index.ts +7 -1
- package/server/harness/claude-code/models.ts +25 -2
- package/server/harness/claude-code/session-title.ts +106 -0
- package/server/harness/claude-code/session.ts +114 -17
- package/server/harness/claude-code/sessions.ts +35 -4
- package/server/harness/codex/adapter.ts +27 -2
- package/server/harness/codex/client.ts +56 -9
- package/server/harness/codex/index.ts +2 -0
- package/server/harness/codex/session-title.ts +149 -0
- package/server/harness/codex/session.ts +96 -14
- package/server/harness/openclaw/adapter.ts +4 -2
- package/server/harness/openclaw/discovery.ts +2 -0
- package/server/harness/openclaw/session.ts +15 -7
- package/server/harness/session-title.ts +96 -0
- package/server/harness/types.ts +5 -2
- package/server/selected-session.ts +132 -0
- package/server/session-config.ts +146 -0
- package/server/web.ts +15 -1
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +54 -68
- package/workspace/.claude/skills/moi-workspace/SKILL.md +8 -2
- package/dist/chunk-5vaevt8z.js +0 -2
- package/dist/chunk-fhhv99bd.js +0 -1
- package/dist/chunk-h0hk61pm.js +0 -9
- package/dist/chunk-k5sjx9s5.js +0 -1
- package/dist/chunk-rs9nb0fr.js +0 -27
- package/dist/chunk-s7za1qsv.css +0 -1
- package/server/thread-config.ts +0 -124
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"/chunk-
|
|
1
|
+
import"/chunk-9y2zbzqz.js";function t(z,Q){return z[13]=1,z[14]=Q>>8,z[15]=Q&255,z[16]=Q>>8,z[17]=Q&255,z}var e=112,zz=72,Qz=89,Zz=115,p;function Nz(){let z=new Int32Array(256);for(let Q=0;Q<256;Q++){let Z=Q;for(let $=0;$<8;$++)Z=Z&1?3988292384^Z>>>1:Z>>>1;z[Q]=Z}return z}function Iz(z){let Q=-1;if(!p)p=Nz();for(let Z=0;Z<z.length;Z++)Q=p[(Q^z[Z])&255]^Q>>>8;return Q^-1}function Uz(z){let Q=z.length-1;for(let Z=Q;Z>=4;Z--)if(z[Z-4]===9&&z[Z-3]===e&&z[Z-2]===zz&&z[Z-1]===Qz&&z[Z]===Zz)return Z-3;return 0}function $z(z,Q,Z=!1){let $=new Uint8Array(13);Q*=39.3701,$[0]=e,$[1]=zz,$[2]=Qz,$[3]=Zz,$[4]=Q>>>24,$[5]=Q>>>16,$[6]=Q>>>8,$[7]=Q&255,$[8]=$[4],$[9]=$[5],$[10]=$[6],$[11]=$[7],$[12]=1;let Y=Iz($),K=new Uint8Array(4);if(K[0]=Y>>>24,K[1]=Y>>>16,K[2]=Y>>>8,K[3]=Y&255,Z){let X=Uz(z);return z.set($,X),z.set(K,X+13),z}else{let X=new Uint8Array(4);X[0]=0,X[1]=0,X[2]=0,X[3]=9;let J=new Uint8Array(54);return J.set(z,0),J.set(X,33),J.set($,37),J.set(K,50),J}}var Dz="AAlwSFlz",Fz="AAAJcEhZ",Rz="AAAACXBI";function wz(z){let Q=z.indexOf(Dz);if(Q===-1)Q=z.indexOf(Fz);if(Q===-1)Q=z.indexOf(Rz);return Q}var Jz="[modern-screenshot]",D=typeof window<"u",Ez=D&&"Worker"in window,Kz=D&&"atob"in window,Cz=D&&"btoa"in window,x=D?window.navigator?.userAgent:"",Yz=x.includes("Chrome"),S=x.includes("AppleWebKit")&&!Yz,u=x.includes("Firefox"),fz=(z)=>z&&("__CONTEXT__"in z),Tz=(z)=>z.constructor.name==="CSSFontFaceRule",bz=(z)=>z.constructor.name==="CSSImportRule",Sz=(z)=>z.constructor.name==="CSSLayerBlockRule",k=(z)=>z.nodeType===1,f=(z)=>typeof z.className==="object",Xz=(z)=>z.tagName==="image",hz=(z)=>z.tagName==="use",w=(z)=>k(z)&&typeof z.style<"u"&&!f(z),gz=(z)=>z.nodeType===8,vz=(z)=>z.nodeType===3,R=(z)=>z.tagName==="IMG",h=(z)=>z.tagName==="VIDEO",pz=(z)=>z.tagName==="CANVAS",yz=(z)=>z.tagName==="TEXTAREA",mz=(z)=>z.tagName==="INPUT",xz=(z)=>z.tagName==="STYLE",uz=(z)=>z.tagName==="SCRIPT",iz=(z)=>z.tagName==="SELECT",cz=(z)=>z.tagName==="SLOT",dz=(z)=>z.tagName==="IFRAME",az=(...z)=>console.warn(Jz,...z);function lz(z){let Q=z?.createElement?.("canvas");if(Q)Q.height=Q.width=1;return Boolean(Q)&&"toDataURL"in Q&&Boolean(Q.toDataURL("image/webp").includes("image/webp"))}var y=(z)=>z.startsWith("data:");function Gz(z,Q){if(z.match(/^[a-z]+:\/\//i))return z;if(D&&z.match(/^\/\//))return window.location.protocol+z;if(z.match(/^[a-z]+:/i))return z;if(!D)return z;let Z=g().implementation.createHTMLDocument(),$=Z.createElement("base"),Y=Z.createElement("a");if(Z.head.appendChild($),Z.body.appendChild(Y),Q)$.href=Q;return Y.href=z,Y.href}function g(z){return(z&&k(z)?z?.ownerDocument:z)??window.document}var v="http://www.w3.org/2000/svg";function jz(z,Q,Z){let $=g(Z).createElementNS(v,"svg");return $.setAttributeNS(null,"width",z.toString()),$.setAttributeNS(null,"height",Q.toString()),$.setAttributeNS(null,"viewBox",`0 0 ${z} ${Q}`),$}function Vz(z,Q){let Z=new XMLSerializer().serializeToString(z);if(Q)Z=Z.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"");return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Z)}`}async function sz(z,Q="image/png",Z=1){try{return await new Promise(($,Y)=>{z.toBlob((K)=>{if(K)$(K);else Y(Error("Blob is null"))},Q,Z)})}catch($){if(Kz)return rz(z.toDataURL(Q,Z));throw $}}function rz(z){let[Q,Z]=z.split(","),$=Q.match(/data:(.+);/)?.[1]??void 0,Y=window.atob(Z),K=Y.length,X=new Uint8Array(K);for(let J=0;J<K;J+=1)X[J]=Y.charCodeAt(J);return new Blob([X],{type:$})}function Hz(z,Q){return new Promise((Z,$)=>{let Y=new FileReader;if(Y.onload=()=>Z(Y.result),Y.onerror=()=>$(Y.error),Y.onabort=()=>$(Error(`Failed read blob to ${Q}`)),Q==="dataUrl")Y.readAsDataURL(z);else if(Q==="arrayBuffer")Y.readAsArrayBuffer(z)})}var nz=(z)=>Hz(z,"dataUrl"),oz=(z)=>Hz(z,"arrayBuffer");function F(z,Q){let Z=g(Q).createElement("img");return Z.decoding="sync",Z.loading="eager",Z.src=z,Z}function E(z,Q){return new Promise((Z)=>{let{timeout:$,ownerDocument:Y,onError:K,onWarn:X}=Q??{},J=typeof z==="string"?F(z,g(Y)):z,V=null,j=null;function G(){Z(J),V&&clearTimeout(V),j?.()}if($)V=setTimeout(G,$);if(h(J)){let M=J.currentSrc||J.src;if(!M){if(J.poster)return E(J.poster,Q).then(Z);return G()}if(J.readyState>=2)return G();let B=G,q=(W)=>{X?.("Failed video load",M,W),K?.(W),G()};j=()=>{J.removeEventListener("loadeddata",B),J.removeEventListener("error",q)},J.addEventListener("loadeddata",B,{once:!0}),J.addEventListener("error",q,{once:!0})}else{let M=Xz(J)?J.href.baseVal:J.currentSrc||J.src;if(!M)return G();let B=async()=>{if(R(J)&&"decode"in J)try{await J.decode()}catch(W){X?.("Failed to decode image, trying to render anyway",J.dataset.originalSrc||M,W)}G()},q=(W)=>{X?.("Failed image load",J.dataset.originalSrc||M,W),G()};if(R(J)&&J.complete)return B();j=()=>{J.removeEventListener("load",B),J.removeEventListener("error",q)},J.addEventListener("load",B,{once:!0}),J.addEventListener("error",q,{once:!0})}})}async function tz(z,Q){if(w(z))if(R(z)||h(z))await E(z,Q);else await Promise.all(["img","video"].flatMap((Z)=>{return Array.from(z.querySelectorAll(Z)).map(($)=>E($,Q))}))}var Bz=function(){let Q=0,Z=()=>`0000${(Math.random()*1679616<<0).toString(36)}`.slice(-4);return()=>{return Q+=1,`u${Z()}${Q}`}}();function Mz(z){return z?.split(",").map((Q)=>Q.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var a=0;function ez(z){let Q=`${Jz}[#${a}]`;return a++,{time:(Z)=>z&&console.time(`${Q} ${Z}`),timeEnd:(Z)=>z&&console.timeEnd(`${Q} ${Z}`),warn:(...Z)=>z&&az(...Z)}}function zQ(z){return{cache:z?"no-cache":"force-cache"}}async function N(z,Q){return fz(z)?z:QQ(z,{...Q,autoDestruct:!0})}async function QQ(z,Q){let{scale:Z=1,workerUrl:$,workerNumber:Y=1}=Q||{},K=Boolean(Q?.debug),X=Q?.features??!0,J=z.ownerDocument??(D?window.document:void 0),V=z.ownerDocument?.defaultView??(D?window:void 0),j=new Map,G={width:0,height:0,quality:1,type:"image/png",scale:Z,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:30000,progress:null,debug:K,fetch:{requestInit:zQ(Q?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...Q?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:Y,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...Q,__CONTEXT__:!0,log:ez(K),node:z,ownerDocument:J,ownerWindow:V,dpi:Z===1?null:96*Z,svgStyleElement:qz(J),svgDefsElement:J?.createElementNS(v,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Ez&&$&&Y?Y:0})].map(()=>{try{let q=new Worker($);return q.onmessage=async(W)=>{let{url:H,result:L}=W.data;if(L)j.get(H)?.resolve?.(L);else j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q.onmessageerror=(W)=>{let{url:H}=W.data;j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q}catch(q){return G.log.warn("Failed to new Worker",q),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[lz(J)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:j,drawImageCount:0,tasks:[],features:X,isEnable:(q)=>{if(q==="restoreScrollPosition")return typeof X==="boolean"?!1:X[q]??!1;if(typeof X==="boolean")return X;return X[q]??!0},shadowRoots:[]};G.log.time("wait until load"),await tz(z,{timeout:G.timeout,onWarn:G.log.warn}),G.log.timeEnd("wait until load");let{width:M,height:B}=ZQ(z,G);return G.width=M,G.height=B,G}function qz(z){if(!z)return;let Q=z.createElement("style"),Z=Q.ownerDocument.createTextNode(`
|
|
2
2
|
.______background-clip--text {
|
|
3
3
|
background-clip: text;
|
|
4
4
|
-webkit-background-clip: text;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Nc as v0,O as _0,Y as L0,Z as o,_ as r,aa as c,ba as n,da as I0,ea as N1,fa as z0,ga as b0,ha as H1,ia as y0,ja as U0,ka as f,la as N0,ma as G0,na as J0,oa as D0}from"/chunk-exj6hr30.js";import{Uc as X0,Vc as A0}from"/chunk-9y2zbzqz.js";var D1=A0((t1,h0)=>{h0.exports=globalThis.__esm["react-dom/client"]});var w0=A0((qG,x0)=>{x0.exports=globalThis.__esm["react-dom"]});var E0=new Map;function e1(G,J){if(J)E0.set(G,J);else E0.delete(G)}function GG(G){return E0.get(G)}var V0=X0(_0(),1);var K0=new Set,t=null,H0=!1;function u0(){if(t||H0)return;H0=!0;let G=new WebSocket(v0("/api/workspaces/ws"));G.onopen=()=>{t=G,H0=!1},G.onmessage=(J)=>{try{let K=JSON.parse(J.data);for(let Q of K0)Q(K)}catch{}},G.onclose=()=>{if(t=null,H0=!1,K0.size>0)setTimeout(u0,2000)},G.onerror=()=>{G.close()}}function QG(G){let J=V0.useRef(G);J.current=G,V0.useEffect(()=>{let K=(Q)=>J.current(Q);return K0.add(K),u0(),()=>{if(K0.delete(K),K0.size===0&&t)t.close(),t=null}},[])}var m0=["top","right","bottom","left"];var{min:p,max:S,round:Z0,floor:q0}=Math,x=(G)=>({x:G,y:G}),b1={left:"right",right:"left",bottom:"top",top:"bottom"};function j0(G,J,K){return S(G,p(J,K))}function m(G,J){return typeof G==="function"?G(J):G}function d(G){return G.split("-")[0]}function i(G){return G.split("-")[1]}function Y0(G){return G==="x"?"y":"x"}function T0(G){return G==="y"?"height":"width"}function w(G){let J=G[0];return J==="t"||J==="b"?"y":"x"}function B0(G){return Y0(w(G))}function d0(G,J,K){if(K===void 0)K=!1;let Q=i(G),Z=B0(G),q=T0(Z),U=Z==="x"?Q===(K?"end":"start")?"right":"left":Q==="start"?"bottom":"top";if(J.reference[q]>J.floating[q])U=Q0(U);return[U,Q0(U)]}function c0(G){let J=Q0(G);return[W0(G),J,W0(J)]}function W0(G){return G.includes("start")?G.replace("start","end"):G.replace("end","start")}var g0=["left","right"],p0=["right","left"],y1=["top","bottom"],S1=["bottom","top"];function O1(G,J,K){switch(G){case"top":case"bottom":if(K)return J?p0:g0;return J?g0:p0;case"left":case"right":return J?y1:S1;default:return[]}}function f0(G,J,K,Q){let Z=i(G),q=O1(d(G),K==="start",Q);if(Z){if(q=q.map((U)=>U+"-"+Z),J)q=q.concat(q.map(W0))}return q}function Q0(G){let J=d(G);return b1[J]+G.slice(J.length)}function P1(G){return{top:0,right:0,bottom:0,left:0,...G}}function $0(G){return typeof G!=="number"?P1(G):{top:G,right:G,bottom:G,left:G}}function s(G){let{x:J,y:K,width:Q,height:Z}=G;return{width:Q,height:Z,top:K,left:J,right:J+Q,bottom:K+Z,x:J,y:K}}function r0(G,J,K){let{reference:Q,floating:Z}=G,q=w(J),U=B0(J),N=T0(U),V=d(J),j=q==="y",H=Q.x+Q.width/2-Z.width/2,W=Q.y+Q.height/2-Z.height/2,Y=Q[N]/2-Z[N]/2,X;switch(V){case"top":X={x:H,y:Q.y-Z.height};break;case"bottom":X={x:H,y:Q.y+Q.height};break;case"right":X={x:Q.x+Q.width,y:W};break;case"left":X={x:Q.x-Z.width,y:W};break;default:X={x:Q.x,y:Q.y}}switch(i(J)){case"start":X[U]-=Y*(K&&j?-1:1);break;case"end":X[U]+=Y*(K&&j?-1:1);break}return X}async function n0(G,J){var K;if(J===void 0)J={};let{x:Q,y:Z,platform:q,rects:U,elements:N,strategy:V}=G,{boundary:j="clippingAncestors",rootBoundary:H="viewport",elementContext:W="floating",altBoundary:Y=!1,padding:X=0}=m(J,G),T=$0(X),I=N[Y?W==="floating"?"reference":"floating":W],L=s(await q.getClippingRect({element:((K=await(q.isElement==null?void 0:q.isElement(I)))!=null?K:!0)?I:I.contextElement||await(q.getDocumentElement==null?void 0:q.getDocumentElement(N.floating)),boundary:j,rootBoundary:H,strategy:V})),M=W==="floating"?{x:Q,y:Z,width:U.floating.width,height:U.floating.height}:U.reference,F=await(q.getOffsetParent==null?void 0:q.getOffsetParent(N.floating)),z=await(q.isElement==null?void 0:q.isElement(F))?await(q.getScale==null?void 0:q.getScale(F))||{x:1,y:1}:{x:1,y:1},k=s(q.convertOffsetParentRelativeRectToViewportRelativeRect?await q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:N,rect:M,offsetParent:F,strategy:V}):M);return{top:(L.top-k.top+T.top)/z.y,bottom:(k.bottom-L.bottom+T.bottom)/z.y,left:(L.left-k.left+T.left)/z.x,right:(k.right-L.right+T.right)/z.x}}var R1=50,i0=async(G,J,K)=>{let{placement:Q="bottom",strategy:Z="absolute",middleware:q=[],platform:U}=K,N=U.detectOverflow?U:{...U,detectOverflow:n0},V=await(U.isRTL==null?void 0:U.isRTL(J)),j=await U.getElementRects({reference:G,floating:J,strategy:Z}),{x:H,y:W}=r0(j,Q,V),Y=Q,X=0,T={};for(let B=0;B<q.length;B++){let I=q[B];if(!I)continue;let{name:L,fn:M}=I,{x:F,y:z,data:k,reset:E}=await M({x:H,y:W,initialPlacement:Q,placement:Y,strategy:Z,middlewareData:T,rects:j,platform:N,elements:{reference:G,floating:J}});if(H=F!=null?F:H,W=z!=null?z:W,T[L]={...T[L],...k},E&&X<R1){if(X++,typeof E==="object"){if(E.placement)Y=E.placement;if(E.rects)j=E.rects===!0?await U.getElementRects({reference:G,floating:J,strategy:Z}):E.rects;({x:H,y:W}=r0(j,Y,V))}B=-1}}return{x:H,y:W,placement:Y,strategy:Z,middlewareData:T}},s0=(G)=>({name:"arrow",options:G,async fn(J){let{x:K,y:Q,placement:Z,rects:q,platform:U,elements:N,middlewareData:V}=J,{element:j,padding:H=0}=m(G,J)||{};if(j==null)return{};let W=$0(H),Y={x:K,y:Q},X=B0(Z),T=T0(X),B=await U.getDimensions(j),I=X==="y",L=I?"top":"left",M=I?"bottom":"right",F=I?"clientHeight":"clientWidth",z=q.reference[T]+q.reference[X]-Y[X]-q.floating[T],k=Y[X]-q.reference[X],E=await(U.getOffsetParent==null?void 0:U.getOffsetParent(j)),$=E?E[F]:0;if(!$||!await(U.isElement==null?void 0:U.isElement(E)))$=N.floating[F]||q.floating[T];let O=z/2-k/2,v=$/2-B[T]/2-1,y=p(W[L],v),u=p(W[M],v),A=y,P=$-B[T]-u,D=$/2-B[T]/2+O,g=j0(A,D,P),b=!V.arrow&&i(Z)!=null&&D!==g&&q.reference[T]/2-(D<A?y:u)-B[T]/2<0,R=b?D<A?D-A:D-P:0;return{[X]:Y[X]+R,data:{[X]:g,centerOffset:D-g-R,...b&&{alignmentOffset:R}},reset:b}}});var a0=function(G){if(G===void 0)G={};return{name:"flip",options:G,async fn(J){var K,Q;let{placement:Z,middlewareData:q,rects:U,initialPlacement:N,platform:V,elements:j}=J,{mainAxis:H=!0,crossAxis:W=!0,fallbackPlacements:Y,fallbackStrategy:X="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:B=!0,...I}=m(G,J);if((K=q.arrow)!=null&&K.alignmentOffset)return{};let L=d(Z),M=w(N),F=d(N)===N,z=await(V.isRTL==null?void 0:V.isRTL(j.floating)),k=Y||(F||!B?[Q0(N)]:c0(N)),E=T!=="none";if(!Y&&E)k.push(...f0(N,B,T,z));let $=[N,...k],O=await V.detectOverflow(J,I),v=[],y=((Q=q.flip)==null?void 0:Q.overflows)||[];if(H)v.push(O[L]);if(W){let D=d0(Z,U,z);v.push(O[D[0]],O[D[1]])}if(y=[...y,{placement:Z,overflows:v}],!v.every((D)=>D<=0)){var u,A;let D=(((u=q.flip)==null?void 0:u.index)||0)+1,g=$[D];if(g){if(!(W==="alignment"?M!==w(g):!1)||y.every((_)=>w(_.placement)===M?_.overflows[0]>0:!0))return{data:{index:D,overflows:y},reset:{placement:g}}}let b=(A=y.filter((R)=>R.overflows[0]<=0).sort((R,_)=>R.overflows[1]-_.overflows[1])[0])==null?void 0:A.placement;if(!b)switch(X){case"bestFit":{var P;let R=(P=y.filter((_)=>{if(E){let h=w(_.placement);return h===M||h==="y"}return!0}).map((_)=>[_.placement,_.overflows.filter((h)=>h>0).reduce((h,l)=>h+l,0)]).sort((_,h)=>_[1]-h[1])[0])==null?void 0:P[0];if(R)b=R;break}case"initialPlacement":b=N;break}if(Z!==b)return{reset:{placement:b}}}return{}}}};function l0(G,J){return{top:G.top-J.height,right:G.right-J.width,bottom:G.bottom-J.height,left:G.left-J.width}}function o0(G){return m0.some((J)=>G[J]>=0)}var t0=function(G){if(G===void 0)G={};return{name:"hide",options:G,async fn(J){let{rects:K,platform:Q}=J,{strategy:Z="referenceHidden",...q}=m(G,J);switch(Z){case"referenceHidden":{let U=await Q.detectOverflow(J,{...q,elementContext:"reference"}),N=l0(U,K.reference);return{data:{referenceHiddenOffsets:N,referenceHidden:o0(N)}}}case"escaped":{let U=await Q.detectOverflow(J,{...q,altBoundary:!0}),N=l0(U,K.floating);return{data:{escapedOffsets:N,escaped:o0(N)}}}default:return{}}}}};var e0=new Set(["left","top"]);async function A1(G,J){let{placement:K,platform:Q,elements:Z}=G,q=await(Q.isRTL==null?void 0:Q.isRTL(Z.floating)),U=d(K),N=i(K),V=w(K)==="y",j=e0.has(U)?-1:1,H=q&&V?-1:1,W=m(J,G),{mainAxis:Y,crossAxis:X,alignmentAxis:T}=typeof W==="number"?{mainAxis:W,crossAxis:0,alignmentAxis:null}:{mainAxis:W.mainAxis||0,crossAxis:W.crossAxis||0,alignmentAxis:W.alignmentAxis};if(N&&typeof T==="number")X=N==="end"?T*-1:T;return V?{x:X*H,y:Y*j}:{x:Y*j,y:X*H}}var G1=function(G){if(G===void 0)G=0;return{name:"offset",options:G,async fn(J){var K,Q;let{x:Z,y:q,placement:U,middlewareData:N}=J,V=await A1(J,G);if(U===((K=N.offset)==null?void 0:K.placement)&&(Q=N.arrow)!=null&&Q.alignmentOffset)return{};return{x:Z+V.x,y:q+V.y,data:{...V,placement:U}}}}},J1=function(G){if(G===void 0)G={};return{name:"shift",options:G,async fn(J){let{x:K,y:Q,placement:Z,platform:q}=J,{mainAxis:U=!0,crossAxis:N=!1,limiter:V={fn:(L)=>{let{x:M,y:F}=L;return{x:M,y:F}}},...j}=m(G,J),H={x:K,y:Q},W=await q.detectOverflow(J,j),Y=w(d(Z)),X=Y0(Y),T=H[X],B=H[Y];if(U){let L=X==="y"?"top":"left",M=X==="y"?"bottom":"right",F=T+W[L],z=T-W[M];T=j0(F,T,z)}if(N){let L=Y==="y"?"top":"left",M=Y==="y"?"bottom":"right",F=B+W[L],z=B-W[M];B=j0(F,B,z)}let I=V.fn({...J,[X]:T,[Y]:B});return{...I,data:{x:I.x-K,y:I.y-Q,enabled:{[X]:U,[Y]:N}}}}}},K1=function(G){if(G===void 0)G={};return{options:G,fn(J){let{x:K,y:Q,placement:Z,rects:q,middlewareData:U}=J,{offset:N=0,mainAxis:V=!0,crossAxis:j=!0}=m(G,J),H={x:K,y:Q},W=w(Z),Y=Y0(W),X=H[Y],T=H[W],B=m(N,J),I=typeof B==="number"?{mainAxis:B,crossAxis:0}:{mainAxis:0,crossAxis:0,...B};if(V){let F=Y==="y"?"height":"width",z=q.reference[Y]-q.floating[F]+I.mainAxis,k=q.reference[Y]+q.reference[F]-I.mainAxis;if(X<z)X=z;else if(X>k)X=k}if(j){var L,M;let F=Y==="y"?"width":"height",z=e0.has(d(Z)),k=q.reference[W]-q.floating[F]+(z?((L=U.offset)==null?void 0:L[W])||0:0)+(z?0:I.crossAxis),E=q.reference[W]+q.reference[F]+(z?0:((M=U.offset)==null?void 0:M[W])||0)-(z?I.crossAxis:0);if(T<k)T=k;else if(T>E)T=E}return{[Y]:X,[W]:T}}}},Q1=function(G){if(G===void 0)G={};return{name:"size",options:G,async fn(J){var K,Q;let{placement:Z,rects:q,platform:U,elements:N}=J,{apply:V=()=>{},...j}=m(G,J),H=await U.detectOverflow(J,j),W=d(Z),Y=i(Z),X=w(Z)==="y",{width:T,height:B}=q.floating,I,L;if(W==="top"||W==="bottom")I=W,L=Y===(await(U.isRTL==null?void 0:U.isRTL(N.floating))?"start":"end")?"left":"right";else L=W,I=Y==="end"?"top":"bottom";let M=B-H.top-H.bottom,F=T-H.left-H.right,z=p(B-H[I],M),k=p(T-H[L],F),E=!J.middlewareData.shift,$=z,O=k;if((K=J.middlewareData.shift)!=null&&K.enabled.x)O=F;if((Q=J.middlewareData.shift)!=null&&Q.enabled.y)$=M;if(E&&!Y){let y=S(H.left,0),u=S(H.right,0),A=S(H.top,0),P=S(H.bottom,0);if(X)O=T-2*(y!==0||u!==0?y+u:S(H.left,H.right));else $=B-2*(A!==0||P!==0?A+P:S(H.top,H.bottom))}await V({...J,availableWidth:O,availableHeight:$});let v=await U.getDimensions(N.floating);if(T!==v.width||B!==v.height)return{reset:{rects:!0}};return{}}}};function X1(G){let J=f(G),K=parseFloat(J.width)||0,Q=parseFloat(J.height)||0,Z=n(G),q=Z?G.offsetWidth:K,U=Z?G.offsetHeight:Q,N=Z0(K)!==q||Z0(Q)!==U;if(N)K=q,Q=U;return{width:K,height:Q,$:N}}function S0(G){return!c(G)?G.contextElement:G}function e(G){let J=S0(G);if(!n(J))return x(1);let K=J.getBoundingClientRect(),{width:Q,height:Z,$:q}=X1(J),U=(q?Z0(K.width):K.width)/Q,N=(q?Z0(K.height):K.height)/Z;if(!U||!Number.isFinite(U))U=1;if(!N||!Number.isFinite(N))N=1;return{x:U,y:N}}var h1=x(0);function V1(G){let J=o(G);if(!y0()||!J.visualViewport)return h1;return{x:J.visualViewport.offsetLeft,y:J.visualViewport.offsetTop}}function v1(G,J,K){if(J===void 0)J=!1;if(!K||J&&K!==o(G))return!1;return J}function a(G,J,K,Q){if(J===void 0)J=!1;if(K===void 0)K=!1;let Z=G.getBoundingClientRect(),q=S0(G),U=x(1);if(J)if(Q){if(c(Q))U=e(Q)}else U=e(G);let N=v1(q,K,Q)?V1(q):x(0),V=(Z.left+N.x)/U.x,j=(Z.top+N.y)/U.y,H=Z.width/U.x,W=Z.height/U.y;if(q){let Y=o(q),X=Q&&c(Q)?o(Q):Q,T=Y,B=D0(T);while(B&&Q&&X!==T){let I=e(B),L=B.getBoundingClientRect(),M=f(B),F=L.left+(B.clientLeft+parseFloat(M.paddingLeft))*I.x,z=L.top+(B.clientTop+parseFloat(M.paddingTop))*I.y;V*=I.x,j*=I.y,H*=I.x,W*=I.y,V+=F,j+=z,T=o(B),B=D0(T)}}return s({width:H,height:W,x:V,y:j})}function F0(G,J){let K=N0(G).scrollLeft;if(!J)return a(r(G)).left+K;return J.left+K}function W1(G,J){let K=G.getBoundingClientRect(),Q=K.left+J.scrollLeft-F0(G,K),Z=K.top+J.scrollTop;return{x:Q,y:Z}}function u1(G){let{elements:J,rect:K,offsetParent:Q,strategy:Z}=G,q=Z==="fixed",U=r(Q),N=J?z0(J.floating):!1;if(Q===U||N&&q)return K;let V={scrollLeft:0,scrollTop:0},j=x(1),H=x(0),W=n(Q);if(W||!W&&!q){if(L0(Q)!=="body"||I0(U))V=N0(Q);if(W){let X=a(Q);j=e(Q),H.x=X.x+Q.clientLeft,H.y=X.y+Q.clientTop}}let Y=U&&!W&&!q?W1(U,V):x(0);return{width:K.width*j.x,height:K.height*j.y,x:K.x*j.x-V.scrollLeft*j.x+H.x+Y.x,y:K.y*j.y-V.scrollTop*j.y+H.y+Y.y}}function x1(G){return Array.from(G.getClientRects())}function w1(G){let J=r(G),K=N0(G),Q=G.ownerDocument.body,Z=S(J.scrollWidth,J.clientWidth,Q.scrollWidth,Q.clientWidth),q=S(J.scrollHeight,J.clientHeight,Q.scrollHeight,Q.clientHeight),U=-K.scrollLeft+F0(G),N=-K.scrollTop;if(f(Q).direction==="rtl")U+=S(J.clientWidth,Q.clientWidth)-Z;return{width:Z,height:q,x:U,y:N}}var Z1=25;function g1(G,J){let K=o(G),Q=r(G),Z=K.visualViewport,q=Q.clientWidth,U=Q.clientHeight,N=0,V=0;if(Z){q=Z.width,U=Z.height;let H=y0();if(!H||H&&J==="fixed")N=Z.offsetLeft,V=Z.offsetTop}let j=F0(Q);if(j<=0){let H=Q.ownerDocument,W=H.body,Y=getComputedStyle(W),X=H.compatMode==="CSS1Compat"?parseFloat(Y.marginLeft)+parseFloat(Y.marginRight)||0:0,T=Math.abs(Q.clientWidth-W.clientWidth-X);if(T<=Z1)q-=T}else if(j<=Z1)q+=j;return{width:q,height:U,x:N,y:V}}function p1(G,J){let K=a(G,!0,J==="fixed"),Q=K.top+G.clientTop,Z=K.left+G.clientLeft,q=n(G)?e(G):x(1),U=G.clientWidth*q.x,N=G.clientHeight*q.y,V=Z*q.x,j=Q*q.y;return{width:U,height:N,x:V,y:j}}function q1(G,J,K){let Q;if(J==="viewport")Q=g1(G,K);else if(J==="document")Q=w1(r(G));else if(c(J))Q=p1(J,K);else{let Z=V1(G);Q={x:J.x-Z.x,y:J.y-Z.y,width:J.width,height:J.height}}return s(Q)}function j1(G,J){let K=G0(G);if(K===J||!c(K)||U0(K))return!1;return f(K).position==="fixed"||j1(K,J)}function m1(G,J){let K=J.get(G);if(K)return K;let Q=J0(G,[],!1).filter((N)=>c(N)&&L0(N)!=="body"),Z=null,q=f(G).position==="fixed",U=q?G0(G):G;while(c(U)&&!U0(U)){let N=f(U),V=b0(U);if(!V&&N.position==="fixed")Z=null;if(q?!V&&!Z:!V&&N.position==="static"&&!!Z&&(Z.position==="absolute"||Z.position==="fixed")||I0(U)&&!V&&j1(G,U))Q=Q.filter((H)=>H!==U);else Z=N;U=G0(U)}return J.set(G,Q),Q}function d1(G){let{element:J,boundary:K,rootBoundary:Q,strategy:Z}=G,U=[...K==="clippingAncestors"?z0(J)?[]:m1(J,this._c):[].concat(K),Q],N=q1(J,U[0],Z),V=N.top,j=N.right,H=N.bottom,W=N.left;for(let Y=1;Y<U.length;Y++){let X=q1(J,U[Y],Z);V=S(X.top,V),j=p(X.right,j),H=p(X.bottom,H),W=S(X.left,W)}return{width:j-W,height:H-V,x:W,y:V}}function c1(G){let{width:J,height:K}=X1(G);return{width:J,height:K}}function f1(G,J,K){let Q=n(J),Z=r(J),q=K==="fixed",U=a(G,!0,q,J),N={scrollLeft:0,scrollTop:0},V=x(0);function j(){V.x=F0(Z)}if(Q||!Q&&!q){if(L0(J)!=="body"||I0(Z))N=N0(J);if(Q){let X=a(J,!0,q,J);V.x=X.x+J.clientLeft,V.y=X.y+J.clientTop}else if(Z)j()}if(q&&!Q&&Z)j();let H=Z&&!Q&&!q?W1(Z,N):x(0),W=U.left+N.scrollLeft-V.x-H.x,Y=U.top+N.scrollTop-V.y-H.y;return{x:W,y:Y,width:U.width,height:U.height}}function C0(G){return f(G).position==="static"}function U1(G,J){if(!n(G)||f(G).position==="fixed")return null;if(J)return J(G);let K=G.offsetParent;if(r(G)===K)K=K.ownerDocument.body;return K}function Y1(G,J){let K=o(G);if(z0(G))return K;if(!n(G)){let Z=G0(G);while(Z&&!U0(Z)){if(c(Z)&&!C0(Z))return Z;Z=G0(Z)}return K}let Q=U1(G,J);while(Q&&N1(Q)&&C0(Q))Q=U1(Q,J);if(Q&&U0(Q)&&C0(Q)&&!b0(Q))return K;return Q||H1(G)||K}var r1=async function(G){let J=this.getOffsetParent||Y1,K=this.getDimensions,Q=await K(G.floating);return{reference:f1(G.reference,await J(G.floating),G.strategy),floating:{x:0,y:0,width:Q.width,height:Q.height}}};function l1(G){return f(G).direction==="rtl"}var T1={convertOffsetParentRelativeRectToViewportRelativeRect:u1,getDocumentElement:r,getClippingRect:d1,getOffsetParent:Y1,getElementRects:r1,getClientRects:x1,getDimensions:c1,getScale:e,isElement:c,isRTL:l1};function B1(G,J){return G.x===J.x&&G.y===J.y&&G.width===J.width&&G.height===J.height}function o1(G,J){let K=null,Q,Z=r(G);function q(){var N;clearTimeout(Q),(N=K)==null||N.disconnect(),K=null}function U(N,V){if(N===void 0)N=!1;if(V===void 0)V=1;q();let j=G.getBoundingClientRect(),{left:H,top:W,width:Y,height:X}=j;if(!N)J();if(!Y||!X)return;let T=q0(W),B=q0(Z.clientWidth-(H+Y)),I=q0(Z.clientHeight-(W+X)),L=q0(H),F={rootMargin:-T+"px "+-B+"px "+-I+"px "+-L+"px",threshold:S(0,p(1,V))||1},z=!0;function k(E){let $=E[0].intersectionRatio;if($!==V){if(!z)return U();if(!$)Q=setTimeout(()=>{U(!1,0.0000001)},1000);else U(!1,$)}if($===1&&!B1(j,G.getBoundingClientRect()))U();z=!1}try{K=new IntersectionObserver(k,{...F,root:Z.ownerDocument})}catch(E){K=new IntersectionObserver(k,F)}K.observe(G)}return U(!0),q}function n1(G,J,K,Q){if(Q===void 0)Q={};let{ancestorScroll:Z=!0,ancestorResize:q=!0,elementResize:U=typeof ResizeObserver==="function",layoutShift:N=typeof IntersectionObserver==="function",animationFrame:V=!1}=Q,j=S0(G),H=Z||q?[...j?J0(j):[],...J?J0(J):[]]:[];H.forEach((L)=>{Z&&L.addEventListener("scroll",K,{passive:!0}),q&&L.addEventListener("resize",K)});let W=j&&N?o1(j,K):null,Y=-1,X=null;if(U){if(X=new ResizeObserver((L)=>{let[M]=L;if(M&&M.target===j&&X&&J)X.unobserve(J),cancelAnimationFrame(Y),Y=requestAnimationFrame(()=>{var F;(F=X)==null||F.observe(J)});K()}),j&&!V)X.observe(j);if(J)X.observe(J)}let T,B=V?a(G):null;if(V)I();function I(){let L=a(G);if(B&&!B1(B,L))K();B=L,T=requestAnimationFrame(I)}return K(),()=>{var L;if(H.forEach((M)=>{Z&&M.removeEventListener("scroll",K),q&&M.removeEventListener("resize",K)}),W==null||W(),(L=X)==null||L.disconnect(),X=null,V)cancelAnimationFrame(T)}}var L1=G1;var I1=J1,z1=a0,F1=Q1,M1=t0,O0=s0;var k1=K1,P0=(G,J,K)=>{let Q=new Map,Z={platform:T1,...K},q={...Z.platform,_c:Q};return i0(G,J,{...Z,platform:q})};var C=X0(_0(),1),_1=X0(_0(),1),$1=X0(w0(),1),i1=typeof document<"u",s1=function(){},M0=i1?_1.useLayoutEffect:s1;function k0(G,J){if(G===J)return!0;if(typeof G!==typeof J)return!1;if(typeof G==="function"&&G.toString()===J.toString())return!0;let K,Q,Z;if(G&&J&&typeof G==="object"){if(Array.isArray(G)){if(K=G.length,K!==J.length)return!1;for(Q=K;Q--!==0;)if(!k0(G[Q],J[Q]))return!1;return!0}if(Z=Object.keys(G),K=Z.length,K!==Object.keys(J).length)return!1;for(Q=K;Q--!==0;)if(!{}.hasOwnProperty.call(J,Z[Q]))return!1;for(Q=K;Q--!==0;){let q=Z[Q];if(q==="_owner"&&G.$$typeof)continue;if(!k0(G[q],J[q]))return!1}return!0}return G!==G&&J!==J}function C1(G){if(typeof window>"u")return 1;return(G.ownerDocument.defaultView||window).devicePixelRatio||1}function E1(G,J){let K=C1(G);return Math.round(J*K)/K}function R0(G){let J=C.useRef(G);return M0(()=>{J.current=G}),J}function EG(G){if(G===void 0)G={};let{placement:J="bottom",strategy:K="absolute",middleware:Q=[],platform:Z,elements:{reference:q,floating:U}={},transform:N=!0,whileElementsMounted:V,open:j}=G,[H,W]=C.useState({x:0,y:0,strategy:K,placement:J,middlewareData:{},isPositioned:!1}),[Y,X]=C.useState(Q);if(!k0(Y,Q))X(Q);let[T,B]=C.useState(null),[I,L]=C.useState(null),M=C.useCallback((_)=>{if(_!==E.current)E.current=_,B(_)},[]),F=C.useCallback((_)=>{if(_!==$.current)$.current=_,L(_)},[]),z=q||T,k=U||I,E=C.useRef(null),$=C.useRef(null),O=C.useRef(H),v=V!=null,y=R0(V),u=R0(Z),A=R0(j),P=C.useCallback(()=>{if(!E.current||!$.current)return;let _={placement:J,strategy:K,middleware:Y};if(u.current)_.platform=u.current;P0(E.current,$.current,_).then((h)=>{let l={...h,isPositioned:A.current!==!1};if(D.current&&!k0(O.current,l))O.current=l,$1.flushSync(()=>{W(l)})})},[Y,J,K,u,A]);M0(()=>{if(j===!1&&O.current.isPositioned)O.current.isPositioned=!1,W((_)=>({..._,isPositioned:!1}))},[j]);let D=C.useRef(!1);M0(()=>{return D.current=!0,()=>{D.current=!1}},[]),M0(()=>{if(z)E.current=z;if(k)$.current=k;if(z&&k){if(y.current)return y.current(z,k,P);P()}},[z,k,P,y,v]);let g=C.useMemo(()=>({reference:E,floating:$,setReference:M,setFloating:F}),[M,F]),b=C.useMemo(()=>({reference:z,floating:k}),[z,k]),R=C.useMemo(()=>{let _={position:K,left:0,top:0};if(!b.floating)return _;let h=E1(b.floating,H.x),l=E1(b.floating,H.y);if(N)return{..._,transform:"translate("+h+"px, "+l+"px)",...C1(b.floating)>=1.5&&{willChange:"transform"}};return{position:K,left:h,top:l}},[K,N,b.floating,H.x,H.y]);return C.useMemo(()=>({...H,update:P,refs:g,elements:b,floatingStyles:R}),[H,P,g,b,R])}var a1=(G)=>{function J(K){return{}.hasOwnProperty.call(K,"current")}return{name:"arrow",options:G,fn(K){let{element:Q,padding:Z}=typeof G==="function"?G(K):G;if(Q&&J(Q)){if(Q.current!=null)return O0({element:Q.current,padding:Z}).fn(K);return{}}if(Q)return O0({element:Q,padding:Z}).fn(K);return{}}}},_G=(G,J)=>{let K=L1(G);return{name:K.name,fn:K.fn,options:[G,J]}},$G=(G,J)=>{let K=I1(G);return{name:K.name,fn:K.fn,options:[G,J]}},CG=(G,J)=>{return{fn:k1(G).fn,options:[G,J]}},DG=(G,J)=>{let K=z1(G);return{name:K.name,fn:K.fn,options:[G,J]}},bG=(G,J)=>{let K=F1(G);return{name:K.name,fn:K.fn,options:[G,J]}};var yG=(G,J)=>{let K=M1(G);return{name:K.name,fn:K.fn,options:[G,J]}};var SG=(G,J)=>{let K=a1(G);return{name:K.name,fn:K.fn,options:[G,J]}};
|
|
2
|
+
export{w0 as b,D1 as c,Z0 as d,q0 as e,j0 as f,m as g,d as h,i,T0 as j,w as k,B0 as l,$0 as m,n1 as n,EG as o,_G as p,$G as q,CG as r,DG as s,bG as t,yG as u,SG as v,e1 as w,GG as x,QG as y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
|
|
2
|
-
export{s as
|
|
2
|
+
export{s as Uc,t as Vc,u as Wc,v as Xc};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as Vz,F as j,H as Sz,I as yz,N as Xz}from"/chunk-
|
|
1
|
+
import{E as Vz,F as j,H as Sz,I as yz,N as Xz}from"/chunk-m11ckkxd.js";import{Da as P,Ga as A,Nc as Nz,O as w,P as W,bb as Mz,kb as Dz}from"/chunk-exj6hr30.js";import{Uc as G}from"/chunk-9y2zbzqz.js";var Q=G(w(),1);var K=G(W(),1),nz=[{label:"Trivial",prompt:"Reply with exactly: pong"},{label:"Reasoning",prompt:"Think carefully: a farmer has 17 sheep, all but 9 run away, then he buys twice as many as remain. How many sheep now? Reason it out before answering."},{label:"Command",prompt:"Run `ls -la` and summarize what you see in one sentence."},{label:"File edit",prompt:"Create or overwrite scratch.txt with three random words, one per line."},{label:"Plan",prompt:"Make a 3-step plan (use your plan tool) for adding a README to this folder, then execute it."},{label:"Subagent",prompt:"Spawn a subagent (collab/agent tool) to count the files in this directory and report back its answer."},{label:"Web search",prompt:"Search the web for the current Bun version and tell me what you find."},{label:"Slow (interrupt me)",prompt:"Run this exact command: sleep 30 && echo done. Nothing else."}];function iz(Z,Y=110){let _=JSON.stringify(Z);if(!_)return"";return _.length>Y?_.slice(0,Y)+"…":_}function p(Z){let Y=Z;if(typeof Y?.method==="string")return"id"in Y?`${Y.method} #${Y.id}`:Y.method;if("id"in(Y??{}))return`response #${Y.id}`;if(typeof Y?.kind==="string")return`${Y.kind}`;if(typeof Y?.type==="string")return`${Y.type}`;return"?"}function e(Z){return new Date(Z).toLocaleTimeString("en-GB",{hour12:!1})+"."+String(Z%1000).padStart(3,"0")}function s({time:Z,badge:Y,badgeClass:_,label:q,body:$}){return K.jsxs("details",{className:"group border-b border-border/40 px-2 py-1 text-[11px] leading-tight",children:[K.jsxs("summary",{className:"flex cursor-pointer items-baseline gap-2 font-mono whitespace-nowrap",children:[K.jsx("span",{className:"text-muted-foreground/60 tabular-nums",children:e(Z)}),K.jsx("span",{className:P("rounded px-1 font-semibold",_),children:Y}),K.jsx("span",{className:"shrink-0 font-semibold",children:q}),K.jsx("span",{className:"truncate text-muted-foreground",children:iz($)})]}),K.jsx("pre",{className:"mt-1 max-h-80 overflow-auto rounded bg-muted p-2 font-mono text-[10px] whitespace-pre-wrap",children:JSON.stringify($,null,2)})]})}function Oz({title:Z,hint:Y,controls:_,onCopy:q,onClear:$,children:I}){let O=Q.useRef(null),[F,N]=Q.useState(!0),[C,B]=Q.useState(!1),S=Q.useCallback(()=>{q?.(),B(!0),setTimeout(()=>B(!1),1500)},[q]);return Q.useEffect(()=>{if(F&&O.current)O.current.scrollTop=O.current.scrollHeight}),K.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col rounded-xl border border-border bg-background",children:[K.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-2 py-1",children:[typeof Z==="string"?K.jsx("span",{className:"text-xs font-semibold",children:Z}):Z,Y&&K.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:Y}),K.jsx("span",{className:"grow"}),_,K.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[K.jsx("input",{type:"checkbox",checked:F,onChange:(J)=>N(J.target.checked)}),"follow"]}),q&&K.jsx(A,{type:"button",variant:"ghost",size:"icon-sm",onClick:S,"aria-label":"Copy log",title:"Copy log",children:C?K.jsx(Mz,{stroke:1.75,className:"text-muted-foreground"}):K.jsx(Dz,{stroke:1.75})}),$&&K.jsx(A,{type:"button",variant:"ghost",size:"sm",onClick:$,children:"Clear"})]}),K.jsx("div",{ref:O,className:"min-h-0 flex-1 overflow-y-auto",children:I})]})}function Bz(){let[Z,Y]=Vz(),[_,q]=Q.useState([]),[$,I]=Q.useState(()=>Z.get("workspace")??""),[O,F]=Q.useState([]),[N,C]=Q.useState(""),[B,S]=Q.useState(""),[J,U]=Q.useState(!0),[V,M]=Q.useState(()=>crypto.randomUUID()),[b,R]=Q.useState(!0),[qz,Hz]=Q.useState(""),[x,bz]=Q.useState(null),[d,u]=Q.useState([]),[f,Uz]=Q.useState([]),[g,c]=Q.useState(null),[l,hz]=Q.useState(!1),[E,Az]=Q.useState("frames"),[gz,mz]=Q.useState(60),n=Q.useRef(null),i=Q.useRef(0),k=Q.useRef(null),pz=Q.useRef(0),h=Q.useRef(V);h.current=V,Q.useEffect(()=>{fetch("/api/workspaces").then((z)=>z.json()).then((z)=>{q(z),I((X)=>X&&z.some((H)=>H.id===X)?X:z[0]?.id??"")}).catch(()=>{})},[]);let wz=Q.useCallback((z)=>{I(z),Y((X)=>{return X.set("workspace",z),X},{replace:!0})},[Y]),m=_.find((z)=>z.id===$)?.type??"claude-code";Q.useEffect(()=>{if(!$)return;fetch(`/api/workspaces/${$}/models`).then((z)=>z.json()).then((z)=>F(z.models)).catch(()=>F([]))},[$]),Q.useEffect(()=>{M(crypto.randomUUID()),R(!0),c(null)},[$]),Q.useEffect(()=>{if(!$)return;i.current=0,u([]);let z=setInterval(async()=>{try{let X=await fetch(`/api/workspaces/${$}/harness/debug?sinceWire=${i.current}&sinceBroadcast=-1`);if(!X.ok)return;let H=await X.json();if(bz(H.process),H.wire.length)i.current=H.wire[H.wire.length-1].seq,u((t)=>[...t,...H.wire].slice(-1000))}catch{}},1000);return()=>clearInterval(z)},[$]),Q.useEffect(()=>{if(!$)return;let z=new WebSocket(Nz("/ws"));return k.current=z,z.onmessage=(X)=>{try{let H=JSON.parse(String(X.data));if(H.workspaceId&&H.workspaceId!==$)return;if(H.type==="session_renamed"&&H.from===h.current)M(H.to),R(!1);Uz((t)=>[...t,{seq:++pz.current,ts:Date.now(),frame:H}].slice(-1000))}catch{}},()=>{k.current=null,z.close()}},[$]);let Gz=Q.useCallback((z)=>{if(!z.trim()||!k.current||k.current.readyState!==WebSocket.OPEN)return;k.current.send(JSON.stringify({type:"chat",workspaceId:$,sessionId:h.current,isNew:b,content:z,optimisticId:crypto.randomUUID(),...N?{model:N}:{},...B?{effort:B}:{},stream:J})),R(!1)},[$,b,N,B,J]),jz=Q.useCallback(()=>{k.current?.send(JSON.stringify({type:"stop",workspaceId:$,sessionId:h.current}))},[$]),xz=Q.useCallback(()=>{M(crypto.randomUUID()),R(!0),c(null)},[]),dz=Q.useCallback(async()=>{let z=await fetch(`/api/workspaces/${$}/sessions/${h.current}/events`);c(z.ok?await z.json():[])},[$]),uz=Q.useMemo(()=>O.find((z)=>z.value===N)?.supportedEffortLevels??[],[O,N]),[a,fz]=Q.useState(""),r=Q.useMemo(()=>{let z=a.trim().toLowerCase();return z?d.filter((X)=>p(X.frame).toLowerCase().includes(z)):d},[d,a]),o=Q.useMemo(()=>l?f.filter((z)=>z.frame.type!=="preview"):f,[f,l]),cz=Q.useCallback(()=>{navigator.clipboard.writeText(r.map((z)=>`${e(z.ts)} ${z.dir==="send"?"→":"←"} ${JSON.stringify(z.frame)}`).join(`
|
|
2
2
|
`))},[r]),lz=Q.useCallback(()=>{navigator.clipboard.writeText(E==="frames"?o.map((z)=>`${e(z.ts)} ws ${JSON.stringify(z.frame)}`).join(`
|
|
3
3
|
`):JSON.stringify(g??[],null,2))},[E,o,g]);return K.jsxs("div",{className:"flex h-dvh flex-col gap-2 bg-muted p-2",children:[K.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-border bg-background px-2 py-1.5 text-xs",children:[K.jsx("span",{className:"font-semibold tracking-widest text-muted-foreground uppercase",children:"Harness debug"}),K.jsxs("select",{className:"rounded border border-border bg-background px-1 py-0.5",value:$,onChange:(z)=>wz(z.target.value),children:[_.length===0&&K.jsx("option",{value:"",children:"no workspaces"}),_.map((z)=>K.jsx("option",{value:z.id,children:`${z.name??z.displayPath??z.path} · ${z.type??"claude-code"}`},z.id))]}),K.jsxs("select",{className:"rounded border border-border bg-background px-1 py-0.5",value:N,onChange:(z)=>C(z.target.value),children:[K.jsx("option",{value:"",children:"default model"}),O.map((z)=>K.jsx("option",{value:z.value,children:z.displayName},z.value))]}),K.jsxs("select",{className:"rounded border border-border bg-background px-1 py-0.5",value:B,onChange:(z)=>S(z.target.value),children:[K.jsx("option",{value:"",children:"default effort"}),uz.map((z)=>K.jsx("option",{value:z,children:z},z))]}),K.jsxs("label",{className:"flex items-center gap-1",children:[K.jsx("input",{type:"checkbox",checked:J,onChange:(z)=>U(z.target.checked)}),"stream"]}),K.jsx("span",{className:"grow"}),m==="codex"&&K.jsx("span",{className:P("rounded px-1.5 py-0.5 font-mono text-[10px]",x?.running?"bg-green-500/15 text-green-600":"bg-muted text-muted-foreground"),children:x?.running?`app-server pid ${x.pid}`:"app-server not running"}),K.jsxs("span",{className:"max-w-56 truncate font-mono text-[10px] text-muted-foreground",children:["thread ",V]}),K.jsx(A,{type:"button",size:"sm",variant:"outline",onClick:xz,children:"New thread"}),K.jsx(A,{type:"button",size:"sm",variant:"outline",onClick:jz,children:"Stop"})]}),K.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 rounded-xl border border-border bg-background px-2 py-1.5",children:[nz.map((z)=>K.jsx(A,{type:"button",size:"sm",variant:"secondary",onClick:()=>Gz(z.prompt),children:z.label},z.label)),K.jsx("input",{className:"min-w-48 grow rounded border border-border bg-background px-2 py-1 text-xs",placeholder:"or type a custom prompt and hit Enter…",value:qz,onChange:(z)=>Hz(z.target.value),onKeyDown:(z)=>{if(z.key==="Enter")Gz(qz),Hz("")}})]}),K.jsxs("div",{ref:n,className:"flex min-h-0 flex-1 gap-1",children:[K.jsx("div",{className:"flex min-w-0",style:{width:`${gz}%`},children:K.jsx(Oz,{title:m==="codex"?"App-server wire":"Harness wire",hint:m==="codex"?"raw JSON-RPC, both directions":m==="openclaw"?"no wire tap for OpenClaw yet":"raw Agent SDK messages + enqueued inputs",controls:K.jsx("input",{className:"w-36 rounded border border-border bg-background px-1.5 py-0.5 font-mono text-[10px]",placeholder:"filter types…",value:a,onChange:(z)=>fz(z.target.value)}),onCopy:cz,onClear:()=>u([]),children:r.map((z)=>K.jsx(s,{time:z.ts,badge:z.dir==="send"?"→":"←",badgeClass:z.dir==="send"?"bg-blue-500/15 text-blue-600":"bg-amber-500/15 text-amber-600",label:p(z.frame),body:z.frame},z.seq))})}),K.jsx("div",{className:"w-1.5 shrink-0 cursor-col-resize touch-none rounded-full hover:bg-border active:bg-border",onPointerDown:(z)=>{z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId)},onPointerMove:(z)=>{if(!z.currentTarget.hasPointerCapture(z.pointerId)||!n.current)return;let X=n.current.getBoundingClientRect(),H=(z.clientX-X.left)/X.width*100;mz(Math.min(80,Math.max(20,H)))}}),K.jsx(Oz,{title:K.jsxs("span",{className:"flex items-center gap-1",children:[K.jsx("button",{type:"button",className:P("rounded px-1.5 py-0.5 text-xs",E==="frames"?"bg-muted font-medium":"text-muted-foreground"),onClick:()=>Az("frames"),children:"Client frames"}),K.jsx("button",{type:"button",className:P("rounded px-1.5 py-0.5 text-xs",E==="events"?"bg-muted font-medium":"text-muted-foreground"),onClick:()=>Az("events"),children:"Durable events"})]}),hint:E==="frames"?"what the browser receives on /ws":"GET /sessions/:id/events replay",onCopy:lz,onClear:E==="frames"?()=>Uz([]):void 0,children:E==="frames"?K.jsxs(K.Fragment,{children:[K.jsx("div",{className:"border-b border-border/40 px-2 py-1",children:K.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[K.jsx("input",{type:"checkbox",checked:l,onChange:(z)=>hz(z.target.checked)}),"hide preview frames"]})}),o.map((z)=>K.jsx(s,{time:z.ts,badge:"ws",badgeClass:"bg-purple-500/15 text-purple-600",label:p(z.frame),body:z.frame},z.seq))]}):K.jsxs(K.Fragment,{children:[K.jsx("div",{className:"border-b border-border/40 px-2 py-1",children:K.jsx(A,{type:"button",size:"sm",variant:"secondary",onClick:dz,children:"Fetch events"})}),g?.map((z,X)=>K.jsx(s,{time:Date.now(),badge:"ev",badgeClass:"bg-teal-500/15 text-teal-600",label:p(z),body:z},X)),g?.length===0&&K.jsx("div",{className:"p-2 text-[11px] text-muted-foreground",children:"no events"})]})})]})]})}var zz=G(w(),1);var y=G(w(),1);var L=G(W(),1),az=5,rz=5,Wz=[".....","####.","#.#.#","#.#.#","#.#.#"];function Lz(Z){return Z.map((Y)=>[...Y].map((_)=>_==="#"))}function oz(){return Array.from({length:rz},()=>Array.from({length:az},()=>!1))}function Tz(){let[Z,Y]=y.useState(()=>Lz(Wz)),[_,q]=y.useState(!1),$=y.useRef(!0),[I,O]=y.useState(!1);y.useEffect(()=>{let J=()=>q(!1);return window.addEventListener("mouseup",J),()=>window.removeEventListener("mouseup",J)},[]);function F(J,U,V){Y((M)=>{if(M[J][U]===V)return M;let b=M.map((R)=>R.slice());return b[J][U]=V,b})}function N(J,U){let V=!Z[J][U];$.current=V,q(!0),F(J,U,V)}function C(J,U){if(_)F(J,U,$.current)}let B=Z.map((J)=>J.map((U)=>U?"#":".").join("")).join(`
|
|
4
4
|
`);async function S(){await navigator.clipboard.writeText(B),O(!0),setTimeout(()=>O(!1),1200)}return L.jsxs("div",{className:"flex flex-col items-center gap-4",children:[L.jsx("div",{className:"grid w-fit grid-cols-[repeat(5,28px)] gap-px bg-border p-px select-none",children:Z.map((J,U)=>J.map((V,M)=>L.jsx("div",{onMouseDown:()=>N(U,M),onMouseEnter:()=>C(U,M),className:P("size-7 cursor-pointer",V?"bg-foreground":"bg-background")},`${U}-${M}`)))}),L.jsx("pre",{className:"rounded-lg border border-border bg-card px-3 py-2 text-center font-mono text-sm leading-snug text-card-foreground",children:B}),L.jsxs("div",{className:"flex gap-2",children:[L.jsx(A,{type:"button",size:"sm",onClick:S,children:I?"Copied!":"Copy"}),L.jsx(A,{type:"button",variant:"secondary",size:"sm",onClick:()=>Y(oz()),children:"Clear"}),L.jsx(A,{type:"button",variant:"secondary",size:"sm",onClick:()=>Y(Lz(Wz)),children:"Reset"})]})]})}var D=G(W(),1),tz=[{value:"moi",label:"M"},{value:"moi-full",label:"moi"}],sz=[{value:"none",label:"None"},{value:"wave",label:"Wave"},{value:"chaos",label:"Random"}];function Fz({options:Z,value:Y,onChange:_}){return D.jsx("div",{className:"flex gap-1 rounded-xl bg-accent p-1",children:Z.map((q)=>D.jsx(A,{type:"button",variant:Y===q.value?"default":"ghost",size:"sm",onClick:()=>_(q.value),children:q.label},String(q.value)))})}function Ez(){let[Z,Y]=zz.useState("moi"),[_,q]=zz.useState("none");return D.jsxs("div",{className:"relative flex min-h-dvh flex-col items-center justify-center gap-8 bg-muted",children:[D.jsx("span",{className:"absolute top-5 left-5 text-[11px] font-medium tracking-widest text-muted-foreground uppercase",children:"Playground"}),D.jsx(Tz,{}),D.jsx(yz,{sprite:Z,effect:_==="none"?void 0:_,pixelSize:3,gap:0.5}),D.jsxs("div",{className:"flex flex-col items-center gap-2",children:[D.jsx(Fz,{options:tz,value:Z,onChange:Y}),D.jsx(Fz,{options:sz,value:_,onChange:q})]})]})}var vz=G(w(),1);var Qz="/Users/kim/git/confetti",Pz={toolCallId:"toolu_fixture_tool_search",name:"ToolSearch",caller:"model",provider:"claude-code",state:"success",input:{query:"select:mcp__notion__notion-search,mcp__notion__notion-get-teams,mcp__notion__notion-get-users",max_results:3},output:`mcp__notion__notion-search
|