opencami 1.8.6 → 1.8.8
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 +0 -1
- package/dist/client/assets/{CSPContext-6t3O1emU.js → CSPContext-nHSyQniZ.js} +1 -1
- package/dist/client/assets/{DirectionContext-C6goXEY_.js → DirectionContext-B1cuzwIr.js} +1 -1
- package/dist/client/assets/_sessionKey-CNw4O2rY.js +19 -0
- package/dist/client/assets/agents-C6Ev94B1.js +2 -0
- package/dist/client/assets/agents-screen-DpNSh5Ok.js +1 -0
- package/dist/client/assets/bots-B2_u-OmP.js +2 -0
- package/dist/client/assets/bots-screen-Qh_IK9hC.js +1 -0
- package/dist/client/assets/button-DdG8c-XQ.js +1 -0
- package/dist/client/assets/{composite-feK0c-xF.js → composite-Cx-QHT9o.js} +1 -1
- package/dist/client/assets/{connect-02tmQV_v.js → connect-CSbeSBTn.js} +1 -1
- package/dist/client/assets/{dashboard-DQ0zDQKd.js → dashboard-DA1fTRcH.js} +1 -1
- package/dist/client/assets/event-Dwf9IDxK.js +1 -0
- package/dist/client/assets/file-explorer-screen-DzDX4HcB.js +1 -0
- package/dist/client/assets/files-PsZnGOUx.js +2 -0
- package/dist/client/assets/follow-up-suggestions-BYWq-d8P.js +5 -0
- package/dist/client/assets/{index-lK3yGoTI.js → index-B551ln24.js} +1 -1
- package/dist/client/assets/index-BxsgifDH.js +3 -0
- package/dist/client/assets/keyboard-shortcuts-dialog-BX-hH4Wf.js +1 -0
- package/dist/client/assets/main-DBmooBKx.js +210 -0
- package/dist/client/assets/markdown-Bpat4kTr.js +87 -0
- package/dist/client/assets/memory-Bs8hOoEv.js +2 -0
- package/dist/client/assets/memory-screen-1DgDLyZf.js +1 -0
- package/dist/client/assets/menu-ByR1BVmq.js +1 -0
- package/dist/client/assets/{opencami-logo-zuSBm5Br.js → opencami-logo-BV1uPYe6.js} +1 -1
- package/dist/client/assets/popupStateMapping-CGDLUl5Y.js +1 -0
- package/dist/client/assets/proxy-DYrSkM35.js +9 -0
- package/dist/client/assets/{react-BLyCEWpN.js → react-dSDkXQu6.js} +1 -1
- package/dist/client/assets/search-dialog-B3XJLq-O.js +1 -0
- package/dist/client/assets/search-sources-badge-CTd0gLuz.js +1 -0
- package/dist/client/assets/session-export-dialog-Cib97JLm.js +1 -0
- package/dist/client/assets/settings-dialog-B4NLq1ZS.js +1 -0
- package/dist/client/assets/{skills-panel-BH27r3nC.js → skills-panel-Cj7yHGbX.js} +1 -1
- package/dist/client/assets/skills-pueagQNc.js +2 -0
- package/dist/client/assets/styles-Ce2xZzc4.css +1 -0
- package/dist/client/assets/switch-kXs1I0oW.js +1 -0
- package/dist/client/assets/tabs-B6GW7TBf.js +1 -0
- package/dist/client/assets/thinking-DTP9JDQl.js +1 -0
- package/dist/client/assets/tooltip-CtHpm-sQ.js +1 -0
- package/dist/client/assets/use-file-explorer-state-C-D2CShe.js +12 -0
- package/dist/client/assets/{useBaseUiId-MgM4ouhx.js → useBaseUiId-Ckx_aJky.js} +1 -1
- package/dist/client/assets/useCompositeItem-CkvfeGmG.js +1 -0
- package/dist/client/assets/{useControlled-BQxTgsOd.js → useControlled-8D4PSDAL.js} +1 -1
- package/dist/client/assets/{useMutation-12DyB3Ox.js → useMutation-DckvFKPC.js} +1 -1
- package/dist/client/assets/{useQuery-Ctiljcrr.js → useQuery-CtUiG53w.js} +1 -1
- package/dist/server/assets/{_sessionKey-DzsJfprr.js → _sessionKey-LV6xK9IM.js} +548 -947
- package/dist/server/assets/{_tanstack-start-manifest_v-C5HBDfQB.js → _tanstack-start-manifest_v-qVhiIEVc.js} +1 -1
- package/dist/server/assets/{connect-CbgijWz4.js → connect-BNabuqpW.js} +1 -1
- package/dist/server/assets/follow-up-suggestions-CSSc4PDe.js +336 -0
- package/dist/server/assets/{index-Dl2BOKP7.js → index-BEWnDAH6.js} +24 -5
- package/dist/server/assets/{index-BFHEmXpN.js → index-DMKS4aeI.js} +1 -1
- package/dist/server/assets/{markdown-BFE5y9YH.js → markdown-DoX5Q7qh.js} +50 -26
- package/dist/server/assets/{memory-BqZOoD7Q.js → memory-Cxu7i8ej.js} +1 -1
- package/dist/server/assets/{memory-screen-BK5phS8K.js → memory-screen-B5l1NZRY.js} +2 -2
- package/dist/server/assets/{router-BZPatFG9.js → router-Cr2xCvGA.js} +5 -5
- package/dist/server/assets/{search-dialog-DQRkARXw.js → search-dialog-DR6zBnui.js} +4 -4
- package/dist/server/assets/search-sources-badge-B0rAEDs_.js +106 -0
- package/dist/server/assets/{settings-dialog-Bc1ta26X.js → settings-dialog-DEMlCMCP.js} +4 -4
- package/dist/server/assets/thinking-BpAc3itF.js +92 -0
- package/dist/server/server.js +38 -195
- package/package.json +2 -6
- package/dist/client/assets/_sessionKey-B5Viv43f.js +0 -23
- package/dist/client/assets/agents-BmE6QOwl.js +0 -2
- package/dist/client/assets/agents-screen-pHUzJxX5.js +0 -1
- package/dist/client/assets/bots-BeOkwrXr.js +0 -2
- package/dist/client/assets/bots-screen-B79bAYvf.js +0 -1
- package/dist/client/assets/button-CK8tKQ-Z.js +0 -1
- package/dist/client/assets/event-BsD1rqGT.js +0 -1
- package/dist/client/assets/file-explorer-screen-Ds7LeJTd.js +0 -1
- package/dist/client/assets/files-e40B1zFy.js +0 -2
- package/dist/client/assets/index-rljDU_1M.js +0 -3
- package/dist/client/assets/keyboard-shortcuts-dialog-Bb_GOr9L.js +0 -1
- package/dist/client/assets/main-Dq6jpr6-.js +0 -210
- package/dist/client/assets/markdown-C7_Aipwd.js +0 -87
- package/dist/client/assets/memory-C7UG-1le.js +0 -2
- package/dist/client/assets/memory-screen-CUFBWsq5.js +0 -1
- package/dist/client/assets/menu-n6L--M9R.js +0 -1
- package/dist/client/assets/proxy-BU8Bw1Vt.js +0 -9
- package/dist/client/assets/search-dialog-yB4w5ajo.js +0 -1
- package/dist/client/assets/session-export-dialog-qbZgd2Zo.js +0 -1
- package/dist/client/assets/settings-dialog-CHJbvpgk.js +0 -1
- package/dist/client/assets/skills-DoKPPhNY.js +0 -2
- package/dist/client/assets/styles-CXV5jZiD.css +0 -1
- package/dist/client/assets/switch-BD3a0LRm.js +0 -1
- package/dist/client/assets/tabs-DI1e-kzz.js +0 -1
- package/dist/client/assets/tooltip-BbH3QWvK.js +0 -1
- package/dist/client/assets/use-file-explorer-state-DBfLeAyz.js +0 -12
- package/dist/client/assets/useCompositeItem-OhltNFdZ.js +0 -1
- package/dist/client/assets/useOnFirstRender-7qoaK5sI.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as V,ab as _,ac as Y,ad as j,ae as D}from"./button-DdG8c-XQ.js";import{r as l,v as x}from"./main-DBmooBKx.js";const g=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],G=g&&g!==l.useLayoutEffect?g:e=>e();function k(e){const t=V(J).current;return t.next=e,G(t.effect),t.trampoline}function J(){const e={next:void 0,callback:X,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function X(){}function m(){return typeof window<"u"}function E(e){return I(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){var t;return(t=(I(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I(e){return m()?e instanceof Node||e instanceof d(e).Node:!1}function T(e){return m()?e instanceof Element||e instanceof d(e).Element:!1}function h(e){return m()?e instanceof HTMLElement||e instanceof d(e).HTMLElement:!1}function N(e){return!m()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof d(e).ShadowRoot}const z=new Set(["inline","contents"]);function L(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=O(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!z.has(s)}const Q=new Set(["table","td","th"]);function he(e){return Q.has(E(e))}const Z=[":popover-open",":modal"];function ee(e){return Z.some(t=>{try{return e.matches(t)}catch{return!1}})}const te=["transform","translate","scale","rotate","perspective"],ne=["transform","translate","scale","rotate","perspective","filter"],oe=["paint","layout","strict","content"];function se(e){const t=re(),n=T(e)?O(e):e;return te.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ne.some(r=>(n.willChange||"").includes(r))||oe.some(r=>(n.contain||"").includes(r))}function Ce(e){let t=y(e);for(;h(t)&&!B(t);){if(se(t))return t;if(ee(t))return null;t=y(t)}return null}function re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ae=new Set(["html","body","#document"]);function B(e){return ae.has(E(e))}function O(e){return d(e).getComputedStyle(e)}function De(e){return T(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function y(e){if(E(e)==="html")return e;const t=e.assignedSlot||e.parentNode||N(e)&&e.host||q(e);return N(t)?t.host:t}function R(e){const t=y(e);return B(t)?e.ownerDocument?e.ownerDocument.body:e.body:h(t)&&L(t)?t:R(t)}function S(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=R(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=d(s);if(a){const u=ie(i);return t.concat(i,i.visualViewport||[],L(s)?s:[],u&&n?S(u):[])}return t.concat(s,S(s,[],n))}function ie(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ce=()=>{},le=typeof document<"u"?l.useLayoutEffect:ce,ue={...x};let P=0;function fe(e,t="mui"){const[n,r]=l.useState(e),s=e||n;return l.useEffect(()=>{n==null&&(P+=1,r(`${t}-${P}`))},[n,t]),s}const v=ue.useId;function de(e,t){if(v!==void 0){const n=v();return e??(t?`${t}-${n}`:n)}return fe(e,t)}const ke="none",Ne="trigger-press",Se="trigger-hover",Pe="trigger-focus",ve="outside-press",xe="item-press",Ie="close-press",Te="focus-out",Le="escape-key",Be="list-navigation",Oe="cancel-open",Re="sibling-open",Ke="disabled",Me="imperative-action";function Fe(e,t,n,r){let s=!1,a=!1;const i=r??_;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...i}}const pe=l.createContext(void 0);function be(e=!1){const t=l.useContext(pe);if(t===void 0&&!e)throw new Error(Y(16));return t}function me(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,i=r&&t!==!1,u=r&&t===!1;return{props:l.useMemo(()=>{const f={onKeyDown(b){n&&t&&b.key!=="Tab"&&b.preventDefault()}};return r||(f.tabIndex=s,!a&&n&&(f.tabIndex=t?s:-1)),(a&&(t||i)||!a&&n)&&(f["aria-disabled"]=n),a&&(!t||u)&&(f.disabled=n),f},[r,n,t,i,u,a,s])}}function Ue(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0}=e,a=l.useRef(null),i=be(!0)!==void 0,u=k(()=>{const c=a.current;return!!(c?.tagName==="A"&&c?.href)}),{props:p}=me({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:s}),f=l.useCallback(()=>{const c=a.current;we(c)&&i&&t&&p.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,p.disabled,i]);le(f,[f]);const b=l.useCallback((c={})=>{const{onClick:w,onMouseDown:M,onKeyUp:F,onKeyDown:U,onPointerDown:W,...A}=c;return j({type:s?"button":void 0,onClick(o){if(t){o.preventDefault();return}w?.(o)},onMouseDown(o){t||M?.(o)},onKeyDown(o){if(t||(D(o),U?.(o)),o.baseUIHandlerPrevented)return;const H=o.target===o.currentTarget&&!s&&!u()&&!t,C=o.key==="Enter",$=o.key===" ";H&&(($||C)&&o.preventDefault(),C&&w?.(o))},onKeyUp(o){t||(D(o),F?.(o)),!o.baseUIHandlerPrevented&&o.target===o.currentTarget&&!s&&!t&&o.key===" "&&w?.(o)},onPointerDown(o){if(t){o.preventDefault();return}W?.(o)}},s?void 0:{role:"button"},p,A)},[t,p,s,u]),K=k(c=>{a.current=c,f()});return{getButtonProps:b,buttonRef:K}}function we(e){return h(e)&&e.tagName==="BUTTON"}function We(e){return de(e,"base-ui")}export{L as A,E as B,pe as C,Ie as D,S as E,q as F,ie as G,re as H,ee as I,he as J,se as K,Ce as L,De as M,Ke as N,I as O,k as a,be as b,N as c,We as d,T as e,Ue as f,Fe as g,O as h,h as i,Te as j,xe as k,Be as l,Se as m,ke as n,ve as o,de as p,Pe as q,Le as r,Re as s,Ne as t,le as u,Me as v,B as w,y as x,Oe as y,d as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as S}from"./DirectionContext-B1cuzwIr.js";import{A as j,s as D,a as H,b as y,c as k}from"./event-Dwf9IDxK.js";import{r as R,j as B}from"./main-DBmooBKx.js";import{C as G,E as V}from"./button-DdG8c-XQ.js";import{u as L,a as T,b as I}from"./useBaseUiId-Ckx_aJky.js";function p(e,i,o){return Math.floor(e/i)!==o}function x(e,i){return i<0||i>=e.current.length}function et(e,i){return E(e,{disabledIndices:i})}function nt(e,i){return E(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:i})}function E(e,{startingIndex:i=-1,decrement:o=!1,disabledIndices:s,amount:m=1}={}){let t=i;do t+=o?-m:m;while(t>=0&&t<=e.current.length-1&&z(e,t,s));return t}function rt(e,{event:i,orientation:o,loopFocus:s,rtl:m,cols:t,disabledIndices:a,minIndex:O,maxIndex:g,prevIndex:u,stopEvent:c=!1}){let r=u;const d=[],w={};let C=!1;{let n=null,l=-1;e.current.forEach((h,f)=>{if(h==null)return;const M=h.closest('[role="row"]');M&&(C=!0),(M!==n||l===-1)&&(n=M,l+=1,d[l]=[]),d[l].push(f),w[f]=l})}const N=C&&d.length>0&&d.some(n=>n.length!==t);function b(n){if(!N||u===-1)return;const l=w[u];if(l==null)return;const h=d[l].indexOf(u);let f=n==="up"?l-1:l+1;s&&(f<0?f=d.length-1:f>=d.length&&(f=0));const M=new Set;for(;f>=0&&f<d.length&&!M.has(f);){M.add(f);const _=d[f];if(_.length===0){f=n==="up"?f-1:f+1;continue}const W=Math.min(h,_.length-1);for(let P=W;P>=0;P-=1){const A=_[P];if(!z(e,A,a))return A}f=n==="up"?f-1:f+1,s&&(f<0?f=d.length-1:f>=d.length&&(f=0))}}if(i.key===j){const n=b("up");if(n!==void 0)c&&D(i),r=n;else{if(c&&D(i),u===-1)r=g;else if(r=E(e,{startingIndex:r,amount:t,decrement:!0,disabledIndices:a}),s&&(u-t<O||r<0)){const l=u%t,h=g%t,f=g-(h-l);h===l?r=g:r=h>l?f:f-t}x(e,r)&&(r=u)}}if(i.key===H){const n=b("down");n!==void 0?(c&&D(i),r=n):(c&&D(i),u===-1?r=O:(r=E(e,{startingIndex:u,amount:t,disabledIndices:a}),s&&u+t>g&&(r=E(e,{startingIndex:u%t-t,amount:t,disabledIndices:a}))),x(e,r)&&(r=u))}if(o==="both"){const n=S(u/t);i.key===(m?y:k)&&(c&&D(i),u%t!==t-1?(r=E(e,{startingIndex:u,disabledIndices:a}),s&&p(r,t,n)&&(r=E(e,{startingIndex:u-u%t-1,disabledIndices:a}))):s&&(r=E(e,{startingIndex:u-u%t-1,disabledIndices:a})),p(r,t,n)&&(r=u)),i.key===(m?k:y)&&(c&&D(i),u%t!==0?(r=E(e,{startingIndex:u,decrement:!0,disabledIndices:a}),s&&p(r,t,n)&&(r=E(e,{startingIndex:u+(t-u%t),decrement:!0,disabledIndices:a}))):s&&(r=E(e,{startingIndex:u+(t-u%t),decrement:!0,disabledIndices:a})),p(r,t,n)&&(r=u));const l=S(g/t)===n;x(e,r)&&(s&&l?r=i.key===(m?k:y)?g:E(e,{startingIndex:u-u%t-1,disabledIndices:a}):r=u)}return r}function it(e,i,o){const s=[];let m=0;return e.forEach(({width:t,height:a},O)=>{let g=!1;for(o&&(m=0);!g;){const u=[];for(let c=0;c<t;c+=1)for(let r=0;r<a;r+=1)u.push(m+c+r*i);m%i+t<=i&&u.every(c=>s[c]==null)?(u.forEach(c=>{s[c]=O}),g=!0):m+=1}}),[...s]}function ut(e,i,o,s,m){if(e===-1)return-1;const t=o.indexOf(e),a=i[e];switch(m){case"tl":return t;case"tr":return a?t+a.width-1:t;case"bl":return a?t+(a.height-1)*s:t;case"br":return o.lastIndexOf(e);default:return-1}}function st(e,i){return i.flatMap((o,s)=>e.includes(o)?[s]:[])}function z(e,i,o){if(typeof o=="function")return o(i);if(o)return o.includes(i);const s=e.current[i];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}const U=R.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Y(){return R.useContext(U)}let q=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function J(e={}){const{label:i,metadata:o,textRef:s,indexGuessBehavior:m,index:t}=e,{register:a,unregister:O,subscribeMapChange:g,elementsRef:u,labelsRef:c,nextIndexRef:r}=Y(),d=R.useRef(-1),[w,C]=R.useState(t??(m===q.GuessFromOrder?()=>{if(d.current===-1){const n=r.current;r.current+=1,d.current=n}return d.current}:-1)),N=R.useRef(null),b=R.useCallback(n=>{if(N.current=n,w!==-1&&n!==null&&(u.current[w]=n,c)){const l=i!==void 0;c.current[w]=l?i:s?.current?.textContent??n.textContent}},[w,u,c,i,s]);return L(()=>{if(t!=null)return;const n=N.current;if(n)return a(n,o),()=>{O(n)}},[t,a,O,o]),L(()=>{if(t==null)return g(n=>{const l=N.current?n.get(N.current)?.index:null;l!=null&&C(l)})},[t,g,C]),R.useMemo(()=>({ref:b,index:w}),[w,b])}function ot(e){const{children:i,elementsRef:o,labelsRef:s,onMapChange:m}=e,t=T(m),a=R.useRef(0),O=G(Q).current,g=G(K).current,[u,c]=R.useState(0),r=R.useRef(u),d=T((n,l)=>{g.set(n,l??null),r.current+=1,c(r.current)}),w=T(n=>{g.delete(n),r.current+=1,c(r.current)}),C=R.useMemo(()=>{const n=new Map;return Array.from(g.keys()).filter(h=>h.isConnected).sort(X).forEach((h,f)=>{const M=g.get(h)??{};n.set(h,{...M,index:f})}),n},[g,u]);L(()=>{if(typeof MutationObserver!="function"||C.size===0)return;const n=new MutationObserver(l=>{const h=new Set,f=M=>h.has(M)?h.delete(M):h.add(M);l.forEach(M=>{M.removedNodes.forEach(f),M.addedNodes.forEach(f)}),h.size===0&&(r.current+=1,c(r.current))});return C.forEach((l,h)=>{h.parentElement&&n.observe(h.parentElement,{childList:!0})}),()=>{n.disconnect()}},[C]),L(()=>{r.current===u&&(o.current.length!==C.size&&(o.current.length=C.size),s&&s.current.length!==C.size&&(s.current.length=C.size),a.current=C.size),t(C)},[t,C,o,s,u]),L(()=>()=>{o.current=[]},[o]),L(()=>()=>{s&&(s.current=[])},[s]);const N=T(n=>(O.add(n),()=>{O.delete(n)}));L(()=>{O.forEach(n=>n(C))},[O,C]);const b=R.useMemo(()=>({register:d,unregister:w,subscribeMapChange:N,elementsRef:o,labelsRef:s,nextIndexRef:a}),[d,w,N,o,s,a]);return B.jsx(U.Provider,{value:b,children:i})}function K(){return new Map}function Q(){return new Set}function X(e,i){const o=e.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING||o&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:o&Node.DOCUMENT_POSITION_PRECEDING||o&Node.DOCUMENT_POSITION_CONTAINS?1:0}function ft(e={}){const{highlightItemOnHover:i,highlightedIndex:o,onHighlightedIndexChange:s}=I(),{ref:m,index:t}=J(e),a=o===t,O=R.useRef(null),g=V(m,O);return{compositeProps:R.useMemo(()=>({tabIndex:a?0:-1,onFocus(){s(t)},onMouseMove(){const c=O.current;if(!i||!c)return;const r=c.hasAttribute("disabled")||c.ariaDisabled==="true";!a&&!r&&c.focus()}}),[a,s,t,i]),compositeRef:g,index:t}}export{ot as C,nt as a,rt as b,it as c,ut as d,st as e,E as f,et as g,x as h,z as i,J as j,ft as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./main-
|
|
1
|
+
import{r as e}from"./main-DBmooBKx.js";function d({controlled:t,default:s,name:c,state:f="value"}){const{current:a}=e.useRef(t!==void 0),[o,u]=e.useState(s),l=a?t:o,n=e.useCallback(r=>{a||u(r)},[]);return[l,n]}export{d as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as l,s as d,h as a,g as p,n as h,u as b,r as o,b as m,c as v}from"./main-
|
|
1
|
+
import{S as l,s as d,h as a,g as p,n as h,u as b,r as o,b as m,c as v}from"./main-DBmooBKx.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),d(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??p();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=b(),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as G,p as N,e as l,s as Q,f as g,b as M,i as x,k as B,t as J,l as C,m as X,o as Y,q as A,n as z,r as d,c as V,u as Z}from"./main-
|
|
1
|
+
import{S as G,p as N,e as l,s as Q,f as g,b as M,i as x,k as B,t as J,l as C,m as X,o as Y,q as A,n as z,r as d,c as V,u as Z}from"./main-DBmooBKx.js";var $=class extends G{constructor(t,e){super(),this.options=e,this.#s=t,this.#i=null,this.#r=N(),this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#p=void 0;#e=void 0;#a;#u;#r;#i;#b;#l;#d;#o;#h;#n;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),j(this.#t,this.options)?this.#c():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof l(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!Q(this.options,e)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&H(this.#t,s,this.options,e)&&this.#c(),this.updateResult(),r&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(e.staleTime,this.#t))&&this.#R();const i=this.#v();r&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||i!==this.#n)&&this.#m(i)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),s=this.createResult(e,t);return tt(this,s)&&(this.#e=s,this.#u=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(s,r)=>(this.trackProp(r),e?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#r.status==="pending"&&this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),s=this.#s.getQueryCache().build(this.#s,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(M)),e}#R(){this.#y();const t=g(this.options.staleTime,this.#t);if(x||this.#e.isStale||!B(t))return;const s=J(this.#e.dataUpdatedAt,t)+1;this.#o=C.setTimeout(()=>{this.#e.isStale||this.updateResult()},s)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#S(),this.#n=t,!(x||l(this.options.enabled,this.#t)===!1||!B(this.#n)||this.#n===0)&&(this.#h=C.setInterval(()=>{(this.options.refetchIntervalInBackground||X.isFocused())&&this.#c()},this.#n))}#g(){this.#R(),this.#m(this.#v())}#y(){this.#o&&(C.clearTimeout(this.#o),this.#o=void 0)}#S(){this.#h&&(C.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,r=this.options,i=this.#e,u=this.#a,a=this.#u,R=t!==s?t.state:this.#p,{state:h}=t;let n={...h},v=!1,o;if(e._optimisticResults){const c=this.hasListeners(),m=!c&&j(t,e),S=c&&H(t,s,e,r);(m||S)&&(n={...n,...Y(h.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:y,errorUpdatedAt:U,status:b}=n;o=n.data;let D=!1;if(e.placeholderData!==void 0&&o===void 0&&b==="pending"){let c;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(c=i.data,D=!0):c=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,c!==void 0&&(b="success",o=A(i?.data,c,e),v=!0)}if(e.select&&o!==void 0&&!D)if(i&&o===u?.data&&e.select===this.#b)o=this.#l;else try{this.#b=e.select,o=e.select(o),o=A(i?.data,o,e),this.#l=o,this.#i=null}catch(c){this.#i=c}this.#i&&(y=this.#i,o=this.#l,U=Date.now(),b="error");const I=n.fetchStatus==="fetching",T=b==="pending",w=b==="error",F=T&&I,k=o!==void 0,p={status:b,fetchStatus:n.fetchStatus,isPending:T,isSuccess:b==="success",isError:w,isInitialLoading:F,isLoading:F,data:o,dataUpdatedAt:n.dataUpdatedAt,error:y,errorUpdatedAt:U,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:n.dataUpdateCount>0||n.errorUpdateCount>0,isFetchedAfterMount:n.dataUpdateCount>R.dataUpdateCount||n.errorUpdateCount>R.errorUpdateCount,isFetching:I,isRefetching:I&&!T,isLoadingError:w&&!k,isPaused:n.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:w&&k,isStale:P(t,e),refetch:this.refetch,promise:this.#r,isEnabled:l(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const c=p.data!==void 0,m=p.status==="error"&&!c,S=E=>{m?E.reject(p.error):c&&E.resolve(p.data)},L=()=>{const E=this.#r=p.promise=N();S(E)},O=this.#r;switch(O.status){case"pending":t.queryHash===s.queryHash&&S(O);break;case"fulfilled":(m||p.data!==O.value)&&L();break;case"rejected":(!m||p.error!==O.reason)&&L();break}}return p}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#u=this.options,this.#a.data!==void 0&&(this.#d=this.#t),Q(e,t))return;this.#e=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#f.size)return!0;const u=new Set(i??this.#f);return this.options.throwOnError&&u.add("error"),Object.keys(this.#e).some(a=>{const f=a;return this.#e[f]!==t[f]&&u.has(f)})};this.#E({listeners:s()})}#O(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#E(t){z.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function q(t,e){return l(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function j(t,e){return q(t,e)||t.state.data!==void 0&&_(t,e,e.refetchOnMount)}function _(t,e,s){if(l(e.enabled,t)!==!1&&g(e.staleTime,t)!=="static"){const r=typeof s=="function"?s(t):s;return r==="always"||r!==!1&&P(t,e)}return!1}function H(t,e,s,r){return(t!==e||l(r.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&P(t,s)}function P(t,e){return l(e.enabled,t)!==!1&&t.isStaleByTime(g(e.staleTime,t))}function tt(t,e){return!Q(t.getCurrentResult(),e)}var K=d.createContext(!1),et=()=>d.useContext(K);K.Provider;function st(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var rt=d.createContext(st()),it=()=>d.useContext(rt),nt=(t,e,s)=>{const r=s?.state.error&&typeof t.throwOnError=="function"?V(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},at=t=>{d.useEffect(()=>{t.clearReset()},[t])},ot=({result:t,errorResetBoundary:e,throwOnError:s,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||V(s,[t.error,r])),ht=t=>{if(t.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>s(r(...i)):s(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ct=(t,e)=>t.isLoading&&t.isFetching&&!e,ut=(t,e)=>t?.suspense&&e.isPending,W=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function lt(t,e,s){const r=et(),i=it(),u=Z(),a=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const f=u.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",ht(a),nt(a,i,f),at(i);const R=!u.getQueryCache().get(a.queryHash),[h]=d.useState(()=>new e(u,a)),n=h.getOptimisticResult(a),v=!r&&t.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(o=>{const y=v?h.subscribe(z.batchCalls(o)):M;return h.updateResult(),y},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),d.useEffect(()=>{h.setOptions(a)},[a,h]),ut(a,n))throw W(a,h,i);if(ot({result:n,errorResetBoundary:i,throwOnError:a.throwOnError,query:f,suspense:a.suspense}))throw n.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(a,n),a.experimental_prefetchInRender&&!x&&ct(n,r)&&(R?W(a,h,i):f?.promise)?.catch(M).finally(()=>{h.updateResult()}),a.notifyOnChangeProps?n:h.trackResult(n)}function pt(t,e){return lt(t,$)}export{pt as u};
|