tinybase 5.0.1 → 5.0.3
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/@types/synchronizers/synchronizer-ws-server/index.d.cts +32 -27
- package/@types/synchronizers/synchronizer-ws-server/index.d.ts +32 -27
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.cts +32 -27
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +32 -27
- package/@types/ui-react/index.d.cts +62 -45
- package/@types/ui-react/index.d.ts +62 -45
- package/@types/ui-react/with-schemas/index.d.cts +83 -59
- package/@types/ui-react/with-schemas/index.d.ts +83 -59
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/index.cjs +1 -1
- package/cjs/es6/min/ui-react/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/synchronizers/synchronizer-ws-server/index.cjs +4 -6
- package/cjs/es6/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +4 -6
- package/cjs/es6/ui-react/index.cjs +13 -6
- package/cjs/es6/ui-react/with-schemas/index.cjs +13 -6
- package/cjs/min/synchronizers/synchronizer-ws-server/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react/index.cjs +1 -1
- package/cjs/min/ui-react/index.cjs.gz +0 -0
- package/cjs/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/synchronizers/synchronizer-ws-server/index.cjs +4 -4
- package/cjs/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +4 -4
- package/cjs/ui-react/index.cjs +11 -6
- package/cjs/ui-react/with-schemas/index.cjs +11 -6
- package/es6/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react/index.js +1 -1
- package/es6/min/ui-react/index.js.gz +0 -0
- package/es6/min/ui-react/with-schemas/index.js +1 -1
- package/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/es6/synchronizers/synchronizer-ws-server/index.js +4 -6
- package/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -6
- package/es6/ui-react/index.js +13 -6
- package/es6/ui-react/with-schemas/index.js +13 -6
- package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/min/ui-react/index.js +1 -1
- package/min/ui-react/index.js.gz +0 -0
- package/min/ui-react/with-schemas/index.js +1 -1
- package/min/ui-react/with-schemas/index.js.gz +0 -0
- package/package.json +1 -1
- package/readme.md +2 -2
- package/synchronizers/synchronizer-ws-server/index.js +4 -4
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -4
- package/ui-react/index.js +11 -6
- package/ui-react/with-schemas/index.js +11 -6
- package/umd/es6/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react/index.js +1 -1
- package/umd/es6/min/ui-react/index.js.gz +0 -0
- package/umd/es6/min/ui-react/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/es6/synchronizers/synchronizer-ws-server/index.js +4 -6
- package/umd/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -6
- package/umd/es6/ui-react/index.js +16 -6
- package/umd/es6/ui-react/with-schemas/index.js +16 -6
- package/umd/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react/index.js +1 -1
- package/umd/min/ui-react/index.js.gz +0 -0
- package/umd/min/ui-react/with-schemas/index.js +1 -1
- package/umd/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/synchronizers/synchronizer-ws-server/index.js +4 -6
- package/umd/synchronizers/synchronizer-ws-server/with-schemas/index.js +4 -6
- package/umd/ui-react/index.js +12 -6
- package/umd/ui-react/with-schemas/index.js +12 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=n=>null==n,e=(e,l,t)=>n(e)?null==t?void 0:t():l(e),l=(n,e,l)=>n.slice(e,l),t=n=>n.length,r=(n,e)=>n.forEach(e),s=(n,...e)=>n.push(...e),u=Object.freeze,o=n=>{var e;return null!=(e=null==n?void 0:n.size)?e:0},d=(a=o,n=>{return e=(n,e)=>n+a(e),i(n).reduce(e,0);var e});var a;const c=e=>n(e)||0==o(e),i=n=>{var e;return[...null!=(e=null==n?void 0:n.values())?e:[]]},v=(n,e)=>null==n?void 0:n.forEach(e),h=(n,e)=>null==n?void 0:n.delete(e),f=n=>new Map(n),g=n=>{var e;return[...null!=(e=null==n?void 0:n.keys())?e:[]]},S=(n,e)=>null==n?void 0:n.get(e),y=(e,l,t)=>n(t)?(h(e,l),e):null==e?void 0:e.set(l,t),k=(n,e,l,t)=>{var r,s,u;return s=e,null!=(u=null==(r=n)?void 0:r.has(s))&&u?null==t||t(S(n,e)):y(n,e,l()),S(n,e)},p=(n,l,r,s,u=0)=>e((r?k:S)(n,l[u],u>t(l)-2?r:f),(e=>{if(u>t(l)-2)return(null==s?void 0:s(e))&&y(n,l[u]),e;const o=p(e,l,r,s,u+1);return c(e)&&y(n,l[u]),o})),I=e=>new Set(Array.isArray(e)||n(e)?e:[e]),b=/^\d+$/,w=/\/([^?]*)/;exports.createWsServer=a=>{const i=f(),z=f(),L=f(),[m,x,A]=(l=>{let u;const[o,d]=(()=>{const n=[];let e=0;return[l=>{var t;return null!=(t=l?n.shift():null)?t:""+e++},e=>{b.test(e)&&t(n)<1e3&&s(n,e)}]})(),a=f();return[(n,e,l,t=[],r=(()=>[]))=>{null!=u||(u=C);const s=o(1);var d,c;return y(a,s,[n,e,l,t,r]),c=s,null==(d=p(e,null!=l?l:[""],I))||d.add(c),s},(n,e,...l)=>r(((n,e=[""])=>{const l=[],u=(n,o)=>o==t(e)?s(l,n):null===e[o]?v(n,(n=>u(n,o+1))):r([e[o],null],(e=>u(S(n,e),o+1)));return u(n,0),l})(n,e),(n=>v(n,(n=>S(a,n)[0](u,...null!=e?e:[],...l))))),n=>e(S(a,n),(([,e,l])=>(p(e,null!=l?l:[""],void 0,(e=>(h(e,n),c(e)?1:0))),y(a,n),d(n),l))),l=>e(S(a,l),(([e,,l=[],s,o])=>{const d=(...a)=>{var c,i;const v=t(a);v==t(l)?e(u,...a,...o(a)):n(l[v])?r(null!=(i=null==(c=s[v])?void 0:c.call(s,...a))?i:[],(n=>d(...a,n))):d(...a,l[v])};d()}))]})();a.on("connection",((n,t)=>{var r;return e(null==(r=t.url)?void 0:r.match(w),(([,r])=>e(t.headers["sec-websocket-key"],(e=>{const t=k(L,r,f);y(t,e,n),1==t.size&&x(i,void 0,
|
|
1
|
+
"use strict";const n=n=>null==n,e=(e,l,t)=>n(e)?null==t?void 0:t():l(e),l=(n,e,l)=>n.slice(e,l),t=n=>n.length,r=(n,e)=>n.forEach(e),s=(n,...e)=>n.push(...e),u=Object.freeze,o=n=>{var e;return null!=(e=null==n?void 0:n.size)?e:0},d=(a=o,n=>{return e=(n,e)=>n+a(e),i(n).reduce(e,0);var e});var a;const c=e=>n(e)||0==o(e),i=n=>{var e;return[...null!=(e=null==n?void 0:n.values())?e:[]]},v=(n,e)=>null==n?void 0:n.forEach(e),h=(n,e)=>null==n?void 0:n.delete(e),f=n=>new Map(n),g=n=>{var e;return[...null!=(e=null==n?void 0:n.keys())?e:[]]},S=(n,e)=>null==n?void 0:n.get(e),y=(e,l,t)=>n(t)?(h(e,l),e):null==e?void 0:e.set(l,t),k=(n,e,l,t)=>{var r,s,u;return s=e,null!=(u=null==(r=n)?void 0:r.has(s))&&u?null==t||t(S(n,e)):y(n,e,l()),S(n,e)},p=(n,l,r,s,u=0)=>e((r?k:S)(n,l[u],u>t(l)-2?r:f),(e=>{if(u>t(l)-2)return(null==s?void 0:s(e))&&y(n,l[u]),e;const o=p(e,l,r,s,u+1);return c(e)&&y(n,l[u]),o})),I=e=>new Set(Array.isArray(e)||n(e)?e:[e]),b=/^\d+$/,w=/\/([^?]*)/;exports.createWsServer=a=>{const i=f(),z=f(),L=f(),[m,x,A]=(l=>{let u;const[o,d]=(()=>{const n=[];let e=0;return[l=>{var t;return null!=(t=l?n.shift():null)?t:""+e++},e=>{b.test(e)&&t(n)<1e3&&s(n,e)}]})(),a=f();return[(n,e,l,t=[],r=(()=>[]))=>{null!=u||(u=C);const s=o(1);var d,c;return y(a,s,[n,e,l,t,r]),c=s,null==(d=p(e,null!=l?l:[""],I))||d.add(c),s},(n,e,...l)=>r(((n,e=[""])=>{const l=[],u=(n,o)=>o==t(e)?s(l,n):null===e[o]?v(n,(n=>u(n,o+1))):r([e[o],null],(e=>u(S(n,e),o+1)));return u(n,0),l})(n,e),(n=>v(n,(n=>S(a,n)[0](u,...null!=e?e:[],...l))))),n=>e(S(a,n),(([,e,l])=>(p(e,null!=l?l:[""],void 0,(e=>(h(e,n),c(e)?1:0))),y(a,n),d(n),l))),l=>e(S(a,l),(([e,,l=[],s,o])=>{const d=(...a)=>{var c,i;const v=t(a);v==t(l)?e(u,...a,...o(a)):n(l[v])?r(null!=(i=null==(c=s[v])?void 0:c.call(s,...a))?i:[],(n=>d(...a,n))):d(...a,l[v])};d()}))]})();a.on("connection",((n,t)=>{var r;return e(null==(r=t.url)?void 0:r.match(w),(([,r])=>e(t.headers["sec-websocket-key"],(e=>{const t=k(L,r,f);y(t,e,n),1==t.size&&x(i,void 0,r,1),x(z,[r],e,1),n.on("message",(n=>{var r;const s=n.toString("utf8"),u=s.indexOf("\n");if(-1!==u){const n=l(s,0,u),d=l(s,u+1);""===n?(o=(n,l)=>n!=e?l.send(e+"\n"+d):0,v(t,((n,e)=>o(e,n)))):null==(r=S(t,n))||r.send(e+"\n"+d)}var o})),n.on("close",(()=>{h(t,e),x(z,[r],e,-1),c(t)&&(h(L,r),x(i,void 0,r,-1))}))}))))}));const C={getWebSocketServer:()=>a,getPathIds:()=>g(L),getClientIds:n=>g(S(L,n)),addPathIdsListener:n=>m(n,i),addClientIdsListener:(n,e)=>m(e,z,[n]),delListener:n=>(A(n),C),getStats:()=>({paths:o(L),clients:d(L)}),destroy:()=>{a.close(),L.clear()}};return u(C)};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",d="Ids",i="Table",a=i+"s",p=i+d,c="Row",x=c+"Count",I=c+d,C="Sorted"+c+d,b="Cell",w=b+d,R="Value",k=R+"s",v=R+d,g=e=>null==e,y=(e,s,t)=>g(e)?null==t?void 0:t():s(e),h=e=>s(e)==r,L=e=>s(e)==o,m=e=>e.length,S=()=>{},V=(e,s)=>e.every(s),f=(e,s)=>m(e)===m(s)&&V(e,((e,t)=>s[t]===e)),T=(e,s)=>e.map(s),P=Object,O=e=>P.getPrototypeOf(e),q=P.entries,B=e=>!g(e)&&y(O(e),(e=>e==P.prototype||g(O(e))),(()=>!0)),H=P.keys,M=(e,s)=>y(e,(e=>e[s])),D=(e,s)=>{const t=q(e);return m(t)===m(H(s))&&V(t,(([e,t])=>B(t)?!!B(s[e])&&D(s[e],t):s[e]===t))},{createContext:F,useContext:j,useEffect:E}=e,Q=F([]),A=(e,s)=>{var t;const r=j(Q);return g(e)?r[s]:h(e)?M(null!=(t=r[s+1])?t:{},e):e},G=(e,s)=>{const t=A(e,s);return g(e)||h(e)?t:e},W=e=>{var s;return H(null!=(s=j(Q)[e])?s:{})},z=e=>G(e,0),U=e=>G(e,2),J=e=>G(e,4),K=e=>G(e,6),N=e=>G(e,8),X=e=>G(e,10),Y=e=>e.toLowerCase();Y(l);const Z="Transaction";Y(Z);var $=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:re,useState:oe,useSyncExternalStore:le}=e,ue=[],ne=[{},[],[ue,void 0,ue],void 0,!1,0],de=[D,f,([e,s,t],[r,o,l])=>s===o&&f(e,r)&&f(t,l)],ie=(e,s)=>e===s,ae=(e,s,t=ue)=>{const[,r]=oe(),[o,l]=oe();return ee((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},pe=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ce=(e,s,r,o=ue)=>{const l=re(ne[r]),u=_((()=>{var t,u,n;const d=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:ne[r];return(null!=(n=de[r])?n:ie)(d,l.current)?l.current:l.current=d}),[s,r,e,...o]),d=_((l=>pe(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return le(d,u)},xe=(e,s,t,r=ue,o=ue,...l)=>te((()=>pe(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Ie=(e,s,t,r=ue,o=S,l=ue,...u)=>{const n=z(e);return _((e=>y(n,(r=>y(t(e,r),(t=>o(r["set"+s](...T(u,(s=>L(s)?s(e,r):s)),t),t)))))),[n,s,...r,...l,...u])},Ce=(e,s,t=S,r=ue,...o)=>{const l=z(e);return _((()=>t(null==l?void 0:l["del"+s](...o))),[l,s,...r,...o])},be=(e,s,t)=>{const r=X(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},we=e=>ce(p,z(e),1),Re=(e,s)=>ce(I,z(s),1,[e]),ke=(e,s,t,r=0,o,l)=>ce(C,z(l),1,[e,s,t,r,o]),ve=(e,s,t)=>ce(w,z(t),1,[e,s]),ge=(e,s,t,r)=>ce(b,z(r),3,[e,s,t]),ye=e=>ce(v,z(e),1),he=(e,s)=>ce(R,z(s),3,[e]),Le=(e,s)=>ce("Metric",U(s),3,[e]),me=(e,s)=>ce("SliceIds",J(s),1,[e]),Se=(e,s,t)=>ce("Slice"+I,J(t),1,[e,s]),Ve=(e,s,t)=>ce("RemoteRowId",K(t),3,[e,s]),fe=(e,s,t)=>ce("Local"+I,K(t),1,[e,s]),Te=(e,s,t)=>ce("Linked"+I,K(t),1,[e,s]),Pe=(e,s)=>ce(u+I,N(s),1,[e]),Oe=(e,s,t,r=0,o,l)=>ce(u+C,N(l),1,[e,s,t,r,o]),qe=(e,s,t)=>ce(u+w,N(t),1,[e,s]),Be=(e,s,t,r)=>ce(u+b,N(r),3,[e,s,t]),He=e=>ce("CheckpointIds",X(e),2),Me=(e,s)=>ce("Checkpoint",X(s),3,[e]),De=e=>be(e,"goBackward"),Fe=e=>be(e,"goForward"),{PureComponent:je,Fragment:Ee,createElement:Qe,useCallback:Ae,useLayoutEffect:Ge,useRef:We,useState:ze}=e,Ue=(e,...s)=>g(e)?{}:e(...s),Je=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var Ke=Object.defineProperty,Ne=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,_e=(e,s,t)=>s in e?Ke(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,es=(e,s)=>{for(var t in s||(s={}))Ze.call(s,t)&&_e(e,t,s[t]);if(Ye)for(var t of Ye(s))$e.call(s,t)&&_e(e,t,s[t]);return e},ss=(e,s)=>Ne(e,Xe(s)),ts=(e,s)=>{var t={};for(var r in e)Ze.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&Ye)for(var r of Ye(e))s.indexOf(r)<0&&$e.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:rs,useContext:os,useMemo:ls,useState:us}=e,ns=({tableId:e,store:s,rowComponent:t=xs,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>ps(T(n,(l=>Qe(t,ss(es({},Ue(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),ds=({queryId:e,queries:s,resultRowComponent:t=Rs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>ps(T(u,(o=>Qe(t,ss(es({},Ue(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),is=({relationshipId:e,relationships:s,rowComponent:t=xs,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Je(K(s),e),p=u(e,n,d);return ps(T(p,(e=>Qe(t,ss(es({},Ue(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},as=e=>({checkpoints:s,checkpointComponent:t=ks,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=X(s);return ps(T(e(He(u)),(e=>Qe(t,ss(es({},Ue(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},ps=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:T(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},cs=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return ps(t+(null!=(u=ge(e,s,r,o))?u:t),void 0,l,r)},xs=({tableId:e,rowId:s,store:t,cellComponent:r=cs,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>ps(T(((e,s,t,r)=>{const o=ve(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Qe(r,ss(es({},Ue(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),Is=e=>ns(e,Re(e.tableId,e.store)),Cs=({valueId:e,store:s,debugIds:r})=>{var o;return ps(t+(null!=(o=he(e,s))?o:t),void 0,r,e)},bs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=xs,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,d,i]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(J(t),e),a=Se(e,s,n);return ps(T(a,(e=>Qe(r,ss(es({},Ue(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},ws=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return ps(t+(null!=(u=Be(e,s,r,o))?u:t),void 0,l,r)},Rs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=ws,getResultCellComponentProps:o,separator:l,debugIds:u})=>ps(T(qe(e,s,t),(l=>Qe(r,ss(es({},Ue(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),ks=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return ps(null!=(o=Me(s,e))?o:t,void 0,r,s)},vs=as((e=>e[0])),gs=as((e=>g(e[1])?[]:[e[1]])),ys=as((e=>e[2]));exports.BackwardCheckpointsView=vs,exports.CellView=cs,exports.CheckpointView=ks,exports.CurrentCheckpointView=gs,exports.ForwardCheckpointsView=ys,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=bs,getSliceComponentProps:r,separator:o,debugIds:l})=>ps(T(me(e,s),(o=>Qe(t,ss(es({},Ue(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>is(e,Te,e.firstRowId),exports.LocalRowsView=e=>is(e,fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return ps(null!=(o=Le(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:d,queriesById:i,checkpoints:a,checkpointsById:p,children:c})=>{const x=os(Q),[I,C]=us({}),b=rs(((e,s)=>C((t=>M(t,e)==s?t:ss(es({},t),{[e]:s})))),[]),w=rs((e=>C((s=>es({},((e,s)=>(delete e[s],e))(s,e))))),[]);return Qe(Q.Provider,{value:ls((()=>[null!=e?e:x[0],es(es(es({},x[1]),s),I),null!=t?t:x[2],es(es({},x[3]),r),null!=o?o:x[4],es(es({},x[5]),l),null!=u?u:x[6],es(es({},x[7]),n),null!=d?d:x[8],es(es({},x[9]),i),null!=a?a:x[10],es(es({},x[11]),p),b,w]),[e,s,I,t,r,o,l,u,n,d,i,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=xs,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Je(K(t),e),i=Ve(e,s,u);return ps(g(d)||g(i)?null:Qe(r,ss(es({},Ue(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=ws,exports.ResultRowView=Rs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ts(s,["cellId","descending","offset","limit"]);return ds(u,Oe(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>ds(e,Pe(e.queryId,e.queries)),exports.RowView=xs,exports.SliceView=bs,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ts(s,["cellId","descending","offset","limit"]);return ns(u,ke(u.tableId,t,r,o,l,u.store))},exports.TableView=Is,exports.TablesView=({store:e,tableComponent:s=Is,getTableComponentProps:t,separator:r,debugIds:o})=>ps(T(we(e),(r=>Qe(s,ss(es({},Ue(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=Cs,exports.ValuesView=({store:e,valueComponent:s=Cs,getValueComponentProps:t,separator:r,debugIds:o})=>ps(T(ye(e),(r=>Qe(s,ss(es({},Ue(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=ue,r,o=S,l=ue,u=!0)=>{const n=z(r);return _((t=>y(n,(r=>y(s(t,r),(s=>o(r.addRow(L(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=ge,exports.useCellIds=ve,exports.useCellIdsListener=(e,s,t,r,o,l)=>xe(w,z(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>xe(b,z(u),r,o,[e,s,t],l),exports.useCheckpoint=Me,exports.useCheckpointIds=He,exports.useCheckpointIdsListener=(e,s,t)=>xe("CheckpointIds",X(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>xe("Checkpoint",X(r),s,t,[e]),exports.useCheckpoints=e=>A(e,10),exports.useCheckpointsIds=()=>W(11),exports.useCheckpointsOrCheckpointsById=X,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=ue)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=ue,r,o=ue,l,u=ue)=>{const[,n]=oe(),[d,i]=oe();return ee((()=>{const t=e?s(e):void 0;i(t),t&&r&&$(void 0,null,(function*(){yield r(t),n([])}))}),[e,...t,...o]),ee((()=>()=>{d&&(d.destroy(),null==l||l(d))}),[d,...u]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=ue)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=ue,r,o=ue)=>{const[l,u]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ee((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>Ce(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Ce(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Ce(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Ce(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>Ce(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Ce(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>xe("DidFinish"+Z,z(t),e,s),exports.useGoBackwardCallback=De,exports.useGoForwardCallback=Fe,exports.useGoToCallback=(e,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>y(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ce(b,z(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>xe(n+b,z(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ce(c,z(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>xe(n+c,z(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ce(i,z(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ce(i+b,z(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>xe(n+i+b,z(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>xe(n+i,z(o),s,t,[e],r),exports.useHasTables=e=>ce(a,z(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>xe(n+a,z(r),e,s,[],t),exports.useHasValue=(e,s)=>ce(R,z(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>xe(n+R,z(o),s,t,[e],r),exports.useHasValues=e=>ce(k,z(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>xe(n+k,z(r),e,s,[],t),exports.useIndexIds=e=>ce("IndexIds",J(e),1),exports.useIndexes=e=>A(e,4),exports.useIndexesIds=()=>W(5),exports.useIndexesOrIndexesById=J,exports.useLinkedRowIds=Te,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>xe("Linked"+I,K(o),t,r,[e,s]),exports.useLocalRowIds=fe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>xe("Local"+I,K(o),t,r,[e,s]),exports.useMetric=Le,exports.useMetricIds=e=>ce("MetricIds",U(e),1),exports.useMetricListener=(e,s,t,r)=>xe("Metric",U(r),s,t,[e]),exports.useMetrics=e=>A(e,2),exports.useMetricsIds=()=>W(3),exports.useMetricsOrMetricsById=U,exports.useProvideStore=(e,s)=>{const{12:t,13:r}=j(Q);E((()=>(null==t||t(e,s),()=>null==r?void 0:r(e))),[t,e,s,r])},exports.useQueries=e=>A(e,8),exports.useQueriesIds=()=>W(9),exports.useQueriesOrQueriesById=N,exports.useQueryIds=e=>ce("QueryIds",N(e),1),exports.useRedoInformation=e=>{var s;const r=X(e),[,,[o]]=He(r);return[!g(o),Fe(r),o,null!=(s=y(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ce("RelationshipIds",K(e),1),exports.useRelationships=e=>A(e,6),exports.useRelationshipsIds=()=>W(7),exports.useRelationshipsOrRelationshipsById=K,exports.useRemoteRowId=Ve,exports.useRemoteRowIdListener=(e,s,t,r,o)=>xe("RemoteRowId",K(o),t,r,[e,s]),exports.useResultCell=Be,exports.useResultCellIds=qe,exports.useResultCellIdsListener=(e,s,t,r,o)=>xe(u+w,N(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>xe(u+b,N(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ce(u+c,N(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ce(u+x,N(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>xe(u+x,N(r),s,t,[e]),exports.useResultRowIds=Pe,exports.useResultRowIdsListener=(e,s,t,r)=>xe(u+I,N(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>xe(u+c,N(o),t,r,[e,s]),exports.useResultSortedRowIds=Oe,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,d)=>xe(u+C,N(d),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ce(u+i,N(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ce(u+i+w,N(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>xe(u+i+w,N(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>xe(u+i,N(r),s,t,[e]),exports.useRow=(e,s,t)=>ce(c,z(t),0,[e,s]),exports.useRowCount=(e,s)=>ce(x,z(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>xe(x,z(o),s,t,[e],r),exports.useRowIds=Re,exports.useRowIdsListener=(e,s,t,r,o)=>xe(I,z(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>xe(c,z(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Ie(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=S,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Ie(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>Ie(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>Ie(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>Ie(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>Ie(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>Ie(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>Ie(t,k,e,s,r,o),exports.useSliceIds=me,exports.useSliceIdsListener=(e,s,t,r)=>xe("SliceIds",J(r),s,t,[e]),exports.useSliceRowIds=Se,exports.useSliceRowIdsListener=(e,s,t,r,o)=>xe("Slice"+I,J(o),t,r,[e,s]),exports.useSortedRowIds=ke,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>xe(C,z(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>xe("Start"+Z,z(t),e,s),exports.useStore=e=>A(e,0),exports.useStoreIds=()=>W(1),exports.useStoreOrStoreById=z,exports.useTable=(e,s)=>ce(i,z(s),0,[e]),exports.useTableCellIds=(e,s)=>ce(i+w,z(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>xe(i+w,z(o),s,t,[e],r),exports.useTableIds=we,exports.useTableIdsListener=(e,s,t,r)=>xe(p,z(r),e,s,ue,t),exports.useTableListener=(e,s,t,r,o)=>xe(i,z(o),s,t,[e],r),exports.useTables=e=>ce(a,z(e),0),exports.useTablesListener=(e,s,t,r)=>xe(a,z(r),e,s,ue,t),exports.useUndoInformation=e=>{var s;const r=X(e),[o,l]=He(r);return[(u=o,!(0==m(u))),De(r),l,null!=(s=y(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=he,exports.useValueIds=ye,exports.useValueIdsListener=(e,s,t,r)=>xe(v,z(r),e,s,ue,t),exports.useValueListener=(e,s,t,r,o)=>xe(R,z(o),s,t,[e],r),exports.useValues=e=>ce(k,z(e),0),exports.useValuesListener=(e,s,t,r)=>xe(k,z(r),e,s,ue,t),exports.useWillFinishTransactionListener=(e,s,t)=>xe("WillFinish"+Z,z(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",d="Ids",i="Table",a=i+"s",p=i+d,c="Row",x=c+"Count",I=c+d,C="Sorted"+c+d,b="Cell",w=b+d,R="Value",k=R+"s",v=R+d,g=e=>null==e,y=(e,s,t)=>g(e)?null==t?void 0:t():s(e),h=e=>s(e)==r,L=e=>s(e)==o,m=e=>e.length,S=()=>{},V=(e,s)=>e.every(s),f=(e,s)=>m(e)===m(s)&&V(e,((e,t)=>s[t]===e)),T=(e,s)=>e.map(s),P=Object,O=e=>P.getPrototypeOf(e),q=P.entries,B=e=>!g(e)&&y(O(e),(e=>e==P.prototype||g(O(e))),(()=>!0)),H=P.keys,M=(e,s)=>y(e,(e=>e[s])),D=(e,s)=>{const t=q(e);return m(t)===m(H(s))&&V(t,(([e,t])=>B(t)?!!B(s[e])&&D(s[e],t):s[e]===t))},{createContext:F,useContext:j,useEffect:E}=e,Q=F([]),A=(e,s)=>{var t;const r=j(Q);return g(e)?r[s]:h(e)?M(null!=(t=r[s+1])?t:{},e):e},G=(e,s)=>{const t=A(e,s);return g(e)||h(e)?t:e},W=e=>{var s;return H(null!=(s=j(Q)[e])?s:{})},z=e=>G(e,0),U=e=>G(e,2),J=e=>G(e,4),K=e=>G(e,6),N=e=>G(e,8),X=e=>G(e,10),Y=e=>e.toLowerCase();Y(l);const Z="Transaction";Y(Z);var $=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:re,useState:oe,useSyncExternalStore:le}=e,ue=[],ne=[{},[],[ue,void 0,ue],void 0,!1,0],de=[D,f,([e,s,t],[r,o,l])=>s===o&&f(e,r)&&f(t,l)],ie=(e,s)=>e===s,ae=(e,s,t=ue)=>{const[,r]=oe(),[o,l]=oe();return ee((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},pe=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ce=(e,s,r,o=ue)=>{const l=re(ne[r]),u=_((()=>{var t,u,n;const d=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:ne[r];return(null!=(n=de[r])?n:ie)(d,l.current)?l.current:l.current=d}),[s,r,e,...o]),d=_((l=>pe(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return le(d,u)},xe=(e,s,t,r=ue,o=ue,...l)=>te((()=>pe(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Ie=(e,s,t,r=ue,o=S,l=ue,...u)=>{const n=z(e);return _((e=>y(n,(r=>y(t(e,r),(t=>o(r["set"+s](...Ce(u,r,e),t),t)))))),[n,s,...r,...l,...be(u)])},Ce=(e,s,t)=>T(e,(e=>L(e)?e(t,s):e)),be=e=>{return s=e=>!L(e),e.filter(s);var s},we=(e,s,t=S,r=ue,...o)=>{const l=z(e);return _((e=>t(null==l?void 0:l["del"+s](...Ce(o,l,e)))),[l,s,...r,...be(o)])},Re=(e,s,t)=>{const r=X(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},ke=e=>ce(p,z(e),1),ve=(e,s)=>ce(I,z(s),1,[e]),ge=(e,s,t,r=0,o,l)=>ce(C,z(l),1,[e,s,t,r,o]),ye=(e,s,t)=>ce(w,z(t),1,[e,s]),he=(e,s,t,r)=>ce(b,z(r),3,[e,s,t]),Le=e=>ce(v,z(e),1),me=(e,s)=>ce(R,z(s),3,[e]),Se=(e,s)=>ce("Metric",U(s),3,[e]),Ve=(e,s)=>ce("SliceIds",J(s),1,[e]),fe=(e,s,t)=>ce("Slice"+I,J(t),1,[e,s]),Te=(e,s,t)=>ce("RemoteRowId",K(t),3,[e,s]),Pe=(e,s,t)=>ce("Local"+I,K(t),1,[e,s]),Oe=(e,s,t)=>ce("Linked"+I,K(t),1,[e,s]),qe=(e,s)=>ce(u+I,N(s),1,[e]),Be=(e,s,t,r=0,o,l)=>ce(u+C,N(l),1,[e,s,t,r,o]),He=(e,s,t)=>ce(u+w,N(t),1,[e,s]),Me=(e,s,t,r)=>ce(u+b,N(r),3,[e,s,t]),De=e=>ce("CheckpointIds",X(e),2),Fe=(e,s)=>ce("Checkpoint",X(s),3,[e]),je=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Qe,Fragment:Ae,createElement:Ge,useCallback:We,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>g(e)?{}:e(...s),Ne=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var Xe=Object.defineProperty,Ye=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable,ss=(e,s,t)=>s in e?Xe(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ts=(e,s)=>{for(var t in s||(s={}))_e.call(s,t)&&ss(e,t,s[t]);if($e)for(var t of $e(s))es.call(s,t)&&ss(e,t,s[t]);return e},rs=(e,s)=>Ye(e,Ze(s)),os=(e,s)=>{var t={};for(var r in e)_e.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&$e)for(var r of $e(e))s.indexOf(r)<0&&es.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:ls,useContext:us,useMemo:ns,useState:ds}=e,is=({tableId:e,store:s,rowComponent:t=Cs,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>xs(T(n,(l=>Ge(t,rs(ts({},Ke(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),as=({queryId:e,queries:s,resultRowComponent:t=vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>xs(T(u,(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),ps=({relationshipId:e,relationships:s,rowComponent:t=Cs,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Ne(K(s),e),p=u(e,n,d);return xs(T(p,(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},cs=e=>({checkpoints:s,checkpointComponent:t=gs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=X(s);return xs(T(e(De(u)),(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},xs=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:T(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},Is=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return xs(t+(null!=(u=he(e,s,r,o))?u:t),void 0,l,r)},Cs=({tableId:e,rowId:s,store:t,cellComponent:r=Is,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>xs(T(((e,s,t,r)=>{const o=ye(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),bs=e=>is(e,ve(e.tableId,e.store)),ws=({valueId:e,store:s,debugIds:r})=>{var o;return xs(t+(null!=(o=me(e,s))?o:t),void 0,r,e)},Rs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Cs,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,d,i]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(J(t),e),a=fe(e,s,n);return xs(T(a,(e=>Ge(r,rs(ts({},Ke(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},ks=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return xs(t+(null!=(u=Me(e,s,r,o))?u:t),void 0,l,r)},vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=ks,getResultCellComponentProps:o,separator:l,debugIds:u})=>xs(T(He(e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),gs=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return xs(null!=(o=Fe(s,e))?o:t,void 0,r,s)},ys=cs((e=>e[0])),hs=cs((e=>g(e[1])?[]:[e[1]])),Ls=cs((e=>e[2]));exports.BackwardCheckpointsView=ys,exports.CellView=Is,exports.CheckpointView=gs,exports.CurrentCheckpointView=hs,exports.ForwardCheckpointsView=Ls,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Rs,getSliceComponentProps:r,separator:o,debugIds:l})=>xs(T(Ve(e,s),(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>ps(e,Oe,e.firstRowId),exports.LocalRowsView=e=>ps(e,Pe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return xs(null!=(o=Se(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:d,queriesById:i,checkpoints:a,checkpointsById:p,children:c})=>{const x=us(Q),[I,C]=ds({}),b=ls(((e,s)=>C((t=>M(t,e)==s?t:rs(ts({},t),{[e]:s})))),[]),w=ls((e=>C((s=>ts({},((e,s)=>(delete e[s],e))(s,e))))),[]);return Ge(Q.Provider,{value:ns((()=>[null!=e?e:x[0],ts(ts(ts({},x[1]),s),I),null!=t?t:x[2],ts(ts({},x[3]),r),null!=o?o:x[4],ts(ts({},x[5]),l),null!=u?u:x[6],ts(ts({},x[7]),n),null!=d?d:x[8],ts(ts({},x[9]),i),null!=a?a:x[10],ts(ts({},x[11]),p),b,w]),[e,s,I,t,r,o,l,u,n,d,i,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Cs,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Ne(K(t),e),i=Te(e,s,u);return xs(g(d)||g(i)?null:Ge(r,rs(ts({},Ke(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=ks,exports.ResultRowView=vs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return as(u,Be(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>as(e,qe(e.queryId,e.queries)),exports.RowView=Cs,exports.SliceView=Rs,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return is(u,ge(u.tableId,t,r,o,l,u.store))},exports.TableView=bs,exports.TablesView=({store:e,tableComponent:s=bs,getTableComponentProps:t,separator:r,debugIds:o})=>xs(T(ke(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=ws,exports.ValuesView=({store:e,valueComponent:s=ws,getValueComponentProps:t,separator:r,debugIds:o})=>xs(T(Le(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=ue,r,o=S,l=ue,u=!0)=>{const n=z(r);return _((t=>y(n,(r=>y(s(t,r),(s=>o(r.addRow(L(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=he,exports.useCellIds=ye,exports.useCellIdsListener=(e,s,t,r,o,l)=>xe(w,z(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>xe(b,z(u),r,o,[e,s,t],l),exports.useCheckpoint=Fe,exports.useCheckpointIds=De,exports.useCheckpointIdsListener=(e,s,t)=>xe("CheckpointIds",X(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>xe("Checkpoint",X(r),s,t,[e]),exports.useCheckpoints=e=>A(e,10),exports.useCheckpointsIds=()=>W(11),exports.useCheckpointsOrCheckpointsById=X,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=ue)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=ue,r,o=ue,l,u=ue)=>{const[,n]=oe(),[d,i]=oe();return ee((()=>{const t=e?s(e):void 0;i(t),t&&r&&$(void 0,null,(function*(){yield r(t),n([])}))}),[e,...t,...o]),ee((()=>()=>{d&&(d.destroy(),null==l||l(d))}),[d,...u]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=ue)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=ue,r,o=ue)=>{const[l,u]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ee((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>we(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>we(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>we(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>we(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>xe("DidFinish"+Z,z(t),e,s),exports.useGoBackwardCallback=je,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>y(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ce(b,z(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>xe(n+b,z(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ce(c,z(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>xe(n+c,z(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ce(i,z(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ce(i+b,z(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>xe(n+i+b,z(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>xe(n+i,z(o),s,t,[e],r),exports.useHasTables=e=>ce(a,z(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>xe(n+a,z(r),e,s,[],t),exports.useHasValue=(e,s)=>ce(R,z(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>xe(n+R,z(o),s,t,[e],r),exports.useHasValues=e=>ce(k,z(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>xe(n+k,z(r),e,s,[],t),exports.useIndexIds=e=>ce("IndexIds",J(e),1),exports.useIndexes=e=>A(e,4),exports.useIndexesIds=()=>W(5),exports.useIndexesOrIndexesById=J,exports.useLinkedRowIds=Oe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>xe("Linked"+I,K(o),t,r,[e,s]),exports.useLocalRowIds=Pe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>xe("Local"+I,K(o),t,r,[e,s]),exports.useMetric=Se,exports.useMetricIds=e=>ce("MetricIds",U(e),1),exports.useMetricListener=(e,s,t,r)=>xe("Metric",U(r),s,t,[e]),exports.useMetrics=e=>A(e,2),exports.useMetricsIds=()=>W(3),exports.useMetricsOrMetricsById=U,exports.useProvideStore=(e,s)=>{const{12:t,13:r}=j(Q);E((()=>(null==t||t(e,s),()=>null==r?void 0:r(e))),[t,e,s,r])},exports.useQueries=e=>A(e,8),exports.useQueriesIds=()=>W(9),exports.useQueriesOrQueriesById=N,exports.useQueryIds=e=>ce("QueryIds",N(e),1),exports.useRedoInformation=e=>{var s;const r=X(e),[,,[o]]=De(r);return[!g(o),Ee(r),o,null!=(s=y(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ce("RelationshipIds",K(e),1),exports.useRelationships=e=>A(e,6),exports.useRelationshipsIds=()=>W(7),exports.useRelationshipsOrRelationshipsById=K,exports.useRemoteRowId=Te,exports.useRemoteRowIdListener=(e,s,t,r,o)=>xe("RemoteRowId",K(o),t,r,[e,s]),exports.useResultCell=Me,exports.useResultCellIds=He,exports.useResultCellIdsListener=(e,s,t,r,o)=>xe(u+w,N(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>xe(u+b,N(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ce(u+c,N(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ce(u+x,N(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>xe(u+x,N(r),s,t,[e]),exports.useResultRowIds=qe,exports.useResultRowIdsListener=(e,s,t,r)=>xe(u+I,N(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>xe(u+c,N(o),t,r,[e,s]),exports.useResultSortedRowIds=Be,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,d)=>xe(u+C,N(d),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ce(u+i,N(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ce(u+i+w,N(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>xe(u+i+w,N(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>xe(u+i,N(r),s,t,[e]),exports.useRow=(e,s,t)=>ce(c,z(t),0,[e,s]),exports.useRowCount=(e,s)=>ce(x,z(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>xe(x,z(o),s,t,[e],r),exports.useRowIds=ve,exports.useRowIdsListener=(e,s,t,r,o)=>xe(I,z(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>xe(c,z(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Ie(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=S,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Ie(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>Ie(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>Ie(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>Ie(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>Ie(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>Ie(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>Ie(t,k,e,s,r,o),exports.useSliceIds=Ve,exports.useSliceIdsListener=(e,s,t,r)=>xe("SliceIds",J(r),s,t,[e]),exports.useSliceRowIds=fe,exports.useSliceRowIdsListener=(e,s,t,r,o)=>xe("Slice"+I,J(o),t,r,[e,s]),exports.useSortedRowIds=ge,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>xe(C,z(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>xe("Start"+Z,z(t),e,s),exports.useStore=e=>A(e,0),exports.useStoreIds=()=>W(1),exports.useStoreOrStoreById=z,exports.useTable=(e,s)=>ce(i,z(s),0,[e]),exports.useTableCellIds=(e,s)=>ce(i+w,z(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>xe(i+w,z(o),s,t,[e],r),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,r)=>xe(p,z(r),e,s,ue,t),exports.useTableListener=(e,s,t,r,o)=>xe(i,z(o),s,t,[e],r),exports.useTables=e=>ce(a,z(e),0),exports.useTablesListener=(e,s,t,r)=>xe(a,z(r),e,s,ue,t),exports.useUndoInformation=e=>{var s;const r=X(e),[o,l]=De(r);return[(u=o,!(0==m(u))),je(r),l,null!=(s=y(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=me,exports.useValueIds=Le,exports.useValueIdsListener=(e,s,t,r)=>xe(v,z(r),e,s,ue,t),exports.useValueListener=(e,s,t,r,o)=>xe(R,z(o),s,t,[e],r),exports.useValues=e=>ce(k,z(e),0),exports.useValuesListener=(e,s,t,r)=>xe(k,z(r),e,s,ue,t),exports.useWillFinishTransactionListener=(e,s,t)=>xe("WillFinish"+Z,z(t),e,s);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",d="Ids",i="Table",a=i+"s",p=i+d,c="Row",x=c+"Count",I=c+d,C="Sorted"+c+d,b="Cell",w=b+d,R="Value",k=R+"s",v=R+d,g=e=>null==e,y=(e,s,t)=>g(e)?null==t?void 0:t():s(e),h=e=>s(e)==r,L=e=>s(e)==o,m=e=>e.length,S=()=>{},V=(e,s)=>e.every(s),f=(e,s)=>m(e)===m(s)&&V(e,((e,t)=>s[t]===e)),T=(e,s)=>e.map(s),P=Object,O=e=>P.getPrototypeOf(e),q=P.entries,B=e=>!g(e)&&y(O(e),(e=>e==P.prototype||g(O(e))),(()=>!0)),H=P.keys,M=(e,s)=>y(e,(e=>e[s])),D=(e,s)=>{const t=q(e);return m(t)===m(H(s))&&V(t,(([e,t])=>B(t)?!!B(s[e])&&D(s[e],t):s[e]===t))},{createContext:F,useContext:j,useEffect:E}=e,Q=F([]),A=(e,s)=>{var t;const r=j(Q);return g(e)?r[s]:h(e)?M(null!=(t=r[s+1])?t:{},e):e},G=(e,s)=>{const t=A(e,s);return g(e)||h(e)?t:e},W=e=>{var s;return H(null!=(s=j(Q)[e])?s:{})},z=e=>G(e,0),U=e=>G(e,2),J=e=>G(e,4),K=e=>G(e,6),N=e=>G(e,8),X=e=>G(e,10),Y=e=>e.toLowerCase();Y(l);const Z="Transaction";Y(Z);var $=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:re,useState:oe,useSyncExternalStore:le}=e,ue=[],ne=[{},[],[ue,void 0,ue],void 0,!1,0],de=[D,f,([e,s,t],[r,o,l])=>s===o&&f(e,r)&&f(t,l)],ie=(e,s)=>e===s,ae=(e,s,t=ue)=>{const[,r]=oe(),[o,l]=oe();return ee((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},pe=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ce=(e,s,r,o=ue)=>{const l=re(ne[r]),u=_((()=>{var t,u,n;const d=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:ne[r];return(null!=(n=de[r])?n:ie)(d,l.current)?l.current:l.current=d}),[s,r,e,...o]),d=_((l=>pe(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return le(d,u)},xe=(e,s,t,r=ue,o=ue,...l)=>te((()=>pe(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Ie=(e,s,t,r=ue,o=S,l=ue,...u)=>{const n=z(e);return _((e=>y(n,(r=>y(t(e,r),(t=>o(r["set"+s](...T(u,(s=>L(s)?s(e,r):s)),t),t)))))),[n,s,...r,...l,...u])},Ce=(e,s,t=S,r=ue,...o)=>{const l=z(e);return _((()=>t(null==l?void 0:l["del"+s](...o))),[l,s,...r,...o])},be=(e,s,t)=>{const r=X(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},we=e=>ce(p,z(e),1),Re=(e,s)=>ce(I,z(s),1,[e]),ke=(e,s,t,r=0,o,l)=>ce(C,z(l),1,[e,s,t,r,o]),ve=(e,s,t)=>ce(w,z(t),1,[e,s]),ge=(e,s,t,r)=>ce(b,z(r),3,[e,s,t]),ye=e=>ce(v,z(e),1),he=(e,s)=>ce(R,z(s),3,[e]),Le=(e,s)=>ce("Metric",U(s),3,[e]),me=(e,s)=>ce("SliceIds",J(s),1,[e]),Se=(e,s,t)=>ce("Slice"+I,J(t),1,[e,s]),Ve=(e,s,t)=>ce("RemoteRowId",K(t),3,[e,s]),fe=(e,s,t)=>ce("Local"+I,K(t),1,[e,s]),Te=(e,s,t)=>ce("Linked"+I,K(t),1,[e,s]),Pe=(e,s)=>ce(u+I,N(s),1,[e]),Oe=(e,s,t,r=0,o,l)=>ce(u+C,N(l),1,[e,s,t,r,o]),qe=(e,s,t)=>ce(u+w,N(t),1,[e,s]),Be=(e,s,t,r)=>ce(u+b,N(r),3,[e,s,t]),He=e=>ce("CheckpointIds",X(e),2),Me=(e,s)=>ce("Checkpoint",X(s),3,[e]),De=e=>be(e,"goBackward"),Fe=e=>be(e,"goForward"),{PureComponent:je,Fragment:Ee,createElement:Qe,useCallback:Ae,useLayoutEffect:Ge,useRef:We,useState:ze}=e,Ue=(e,...s)=>g(e)?{}:e(...s),Je=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var Ke=Object.defineProperty,Ne=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,Ze=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,_e=(e,s,t)=>s in e?Ke(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,es=(e,s)=>{for(var t in s||(s={}))Ze.call(s,t)&&_e(e,t,s[t]);if(Ye)for(var t of Ye(s))$e.call(s,t)&&_e(e,t,s[t]);return e},ss=(e,s)=>Ne(e,Xe(s)),ts=(e,s)=>{var t={};for(var r in e)Ze.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&Ye)for(var r of Ye(e))s.indexOf(r)<0&&$e.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:rs,useContext:os,useMemo:ls,useState:us}=e,ns=({tableId:e,store:s,rowComponent:t=xs,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>ps(T(n,(l=>Qe(t,ss(es({},Ue(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),ds=({queryId:e,queries:s,resultRowComponent:t=Rs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>ps(T(u,(o=>Qe(t,ss(es({},Ue(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),is=({relationshipId:e,relationships:s,rowComponent:t=xs,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Je(K(s),e),p=u(e,n,d);return ps(T(p,(e=>Qe(t,ss(es({},Ue(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},as=e=>({checkpoints:s,checkpointComponent:t=ks,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=X(s);return ps(T(e(He(u)),(e=>Qe(t,ss(es({},Ue(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},ps=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:T(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},cs=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return ps(t+(null!=(u=ge(e,s,r,o))?u:t),void 0,l,r)},xs=({tableId:e,rowId:s,store:t,cellComponent:r=cs,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>ps(T(((e,s,t,r)=>{const o=ve(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Qe(r,ss(es({},Ue(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),Is=e=>ns(e,Re(e.tableId,e.store)),Cs=({valueId:e,store:s,debugIds:r})=>{var o;return ps(t+(null!=(o=he(e,s))?o:t),void 0,r,e)},bs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=xs,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,d,i]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(J(t),e),a=Se(e,s,n);return ps(T(a,(e=>Qe(r,ss(es({},Ue(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},ws=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return ps(t+(null!=(u=Be(e,s,r,o))?u:t),void 0,l,r)},Rs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=ws,getResultCellComponentProps:o,separator:l,debugIds:u})=>ps(T(qe(e,s,t),(l=>Qe(r,ss(es({},Ue(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),ks=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return ps(null!=(o=Me(s,e))?o:t,void 0,r,s)},vs=as((e=>e[0])),gs=as((e=>g(e[1])?[]:[e[1]])),ys=as((e=>e[2]));exports.BackwardCheckpointsView=vs,exports.CellView=cs,exports.CheckpointView=ks,exports.CurrentCheckpointView=gs,exports.ForwardCheckpointsView=ys,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=bs,getSliceComponentProps:r,separator:o,debugIds:l})=>ps(T(me(e,s),(o=>Qe(t,ss(es({},Ue(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>is(e,Te,e.firstRowId),exports.LocalRowsView=e=>is(e,fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return ps(null!=(o=Le(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:d,queriesById:i,checkpoints:a,checkpointsById:p,children:c})=>{const x=os(Q),[I,C]=us({}),b=rs(((e,s)=>C((t=>M(t,e)==s?t:ss(es({},t),{[e]:s})))),[]),w=rs((e=>C((s=>es({},((e,s)=>(delete e[s],e))(s,e))))),[]);return Qe(Q.Provider,{value:ls((()=>[null!=e?e:x[0],es(es(es({},x[1]),s),I),null!=t?t:x[2],es(es({},x[3]),r),null!=o?o:x[4],es(es({},x[5]),l),null!=u?u:x[6],es(es({},x[7]),n),null!=d?d:x[8],es(es({},x[9]),i),null!=a?a:x[10],es(es({},x[11]),p),b,w]),[e,s,I,t,r,o,l,u,n,d,i,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=xs,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Je(K(t),e),i=Ve(e,s,u);return ps(g(d)||g(i)?null:Qe(r,ss(es({},Ue(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=ws,exports.ResultRowView=Rs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ts(s,["cellId","descending","offset","limit"]);return ds(u,Oe(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>ds(e,Pe(e.queryId,e.queries)),exports.RowView=xs,exports.SliceView=bs,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ts(s,["cellId","descending","offset","limit"]);return ns(u,ke(u.tableId,t,r,o,l,u.store))},exports.TableView=Is,exports.TablesView=({store:e,tableComponent:s=Is,getTableComponentProps:t,separator:r,debugIds:o})=>ps(T(we(e),(r=>Qe(s,ss(es({},Ue(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=Cs,exports.ValuesView=({store:e,valueComponent:s=Cs,getValueComponentProps:t,separator:r,debugIds:o})=>ps(T(ye(e),(r=>Qe(s,ss(es({},Ue(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=ue,r,o=S,l=ue,u=!0)=>{const n=z(r);return _((t=>y(n,(r=>y(s(t,r),(s=>o(r.addRow(L(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=ge,exports.useCellIds=ve,exports.useCellIdsListener=(e,s,t,r,o,l)=>xe(w,z(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>xe(b,z(u),r,o,[e,s,t],l),exports.useCheckpoint=Me,exports.useCheckpointIds=He,exports.useCheckpointIdsListener=(e,s,t)=>xe("CheckpointIds",X(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>xe("Checkpoint",X(r),s,t,[e]),exports.useCheckpoints=e=>A(e,10),exports.useCheckpointsIds=()=>W(11),exports.useCheckpointsOrCheckpointsById=X,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=ue)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=ue,r,o=ue,l,u=ue)=>{const[,n]=oe(),[d,i]=oe();return ee((()=>{const t=e?s(e):void 0;i(t),t&&r&&$(void 0,null,(function*(){yield r(t),n([])}))}),[e,...t,...o]),ee((()=>()=>{d&&(d.destroy(),null==l||l(d))}),[d,...u]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=ue)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=ue,r,o=ue)=>{const[l,u]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ee((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>Ce(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Ce(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Ce(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Ce(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>Ce(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Ce(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>xe("DidFinish"+Z,z(t),e,s),exports.useGoBackwardCallback=De,exports.useGoForwardCallback=Fe,exports.useGoToCallback=(e,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>y(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ce(b,z(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>xe(n+b,z(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ce(c,z(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>xe(n+c,z(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ce(i,z(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ce(i+b,z(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>xe(n+i+b,z(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>xe(n+i,z(o),s,t,[e],r),exports.useHasTables=e=>ce(a,z(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>xe(n+a,z(r),e,s,[],t),exports.useHasValue=(e,s)=>ce(R,z(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>xe(n+R,z(o),s,t,[e],r),exports.useHasValues=e=>ce(k,z(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>xe(n+k,z(r),e,s,[],t),exports.useIndexIds=e=>ce("IndexIds",J(e),1),exports.useIndexes=e=>A(e,4),exports.useIndexesIds=()=>W(5),exports.useIndexesOrIndexesById=J,exports.useLinkedRowIds=Te,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>xe("Linked"+I,K(o),t,r,[e,s]),exports.useLocalRowIds=fe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>xe("Local"+I,K(o),t,r,[e,s]),exports.useMetric=Le,exports.useMetricIds=e=>ce("MetricIds",U(e),1),exports.useMetricListener=(e,s,t,r)=>xe("Metric",U(r),s,t,[e]),exports.useMetrics=e=>A(e,2),exports.useMetricsIds=()=>W(3),exports.useMetricsOrMetricsById=U,exports.useProvideStore=(e,s)=>{const{12:t,13:r}=j(Q);E((()=>(null==t||t(e,s),()=>null==r?void 0:r(e))),[t,e,s,r])},exports.useQueries=e=>A(e,8),exports.useQueriesIds=()=>W(9),exports.useQueriesOrQueriesById=N,exports.useQueryIds=e=>ce("QueryIds",N(e),1),exports.useRedoInformation=e=>{var s;const r=X(e),[,,[o]]=He(r);return[!g(o),Fe(r),o,null!=(s=y(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ce("RelationshipIds",K(e),1),exports.useRelationships=e=>A(e,6),exports.useRelationshipsIds=()=>W(7),exports.useRelationshipsOrRelationshipsById=K,exports.useRemoteRowId=Ve,exports.useRemoteRowIdListener=(e,s,t,r,o)=>xe("RemoteRowId",K(o),t,r,[e,s]),exports.useResultCell=Be,exports.useResultCellIds=qe,exports.useResultCellIdsListener=(e,s,t,r,o)=>xe(u+w,N(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>xe(u+b,N(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ce(u+c,N(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ce(u+x,N(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>xe(u+x,N(r),s,t,[e]),exports.useResultRowIds=Pe,exports.useResultRowIdsListener=(e,s,t,r)=>xe(u+I,N(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>xe(u+c,N(o),t,r,[e,s]),exports.useResultSortedRowIds=Oe,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,d)=>xe(u+C,N(d),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ce(u+i,N(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ce(u+i+w,N(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>xe(u+i+w,N(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>xe(u+i,N(r),s,t,[e]),exports.useRow=(e,s,t)=>ce(c,z(t),0,[e,s]),exports.useRowCount=(e,s)=>ce(x,z(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>xe(x,z(o),s,t,[e],r),exports.useRowIds=Re,exports.useRowIdsListener=(e,s,t,r,o)=>xe(I,z(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>xe(c,z(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Ie(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=S,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Ie(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>Ie(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>Ie(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>Ie(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>Ie(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>Ie(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>Ie(t,k,e,s,r,o),exports.useSliceIds=me,exports.useSliceIdsListener=(e,s,t,r)=>xe("SliceIds",J(r),s,t,[e]),exports.useSliceRowIds=Se,exports.useSliceRowIdsListener=(e,s,t,r,o)=>xe("Slice"+I,J(o),t,r,[e,s]),exports.useSortedRowIds=ke,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>xe(C,z(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>xe("Start"+Z,z(t),e,s),exports.useStore=e=>A(e,0),exports.useStoreIds=()=>W(1),exports.useStoreOrStoreById=z,exports.useTable=(e,s)=>ce(i,z(s),0,[e]),exports.useTableCellIds=(e,s)=>ce(i+w,z(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>xe(i+w,z(o),s,t,[e],r),exports.useTableIds=we,exports.useTableIdsListener=(e,s,t,r)=>xe(p,z(r),e,s,ue,t),exports.useTableListener=(e,s,t,r,o)=>xe(i,z(o),s,t,[e],r),exports.useTables=e=>ce(a,z(e),0),exports.useTablesListener=(e,s,t,r)=>xe(a,z(r),e,s,ue,t),exports.useUndoInformation=e=>{var s;const r=X(e),[o,l]=He(r);return[(u=o,!(0==m(u))),De(r),l,null!=(s=y(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=he,exports.useValueIds=ye,exports.useValueIdsListener=(e,s,t,r)=>xe(v,z(r),e,s,ue,t),exports.useValueListener=(e,s,t,r,o)=>xe(R,z(o),s,t,[e],r),exports.useValues=e=>ce(k,z(e),0),exports.useValuesListener=(e,s,t,r)=>xe(k,z(r),e,s,ue,t),exports.useWillFinishTransactionListener=(e,s,t)=>xe("WillFinish"+Z,z(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),l="Listener",u="Result",n="Has",d="Ids",i="Table",a=i+"s",p=i+d,c="Row",x=c+"Count",I=c+d,C="Sorted"+c+d,b="Cell",w=b+d,R="Value",k=R+"s",v=R+d,g=e=>null==e,y=(e,s,t)=>g(e)?null==t?void 0:t():s(e),h=e=>s(e)==r,L=e=>s(e)==o,m=e=>e.length,S=()=>{},V=(e,s)=>e.every(s),f=(e,s)=>m(e)===m(s)&&V(e,((e,t)=>s[t]===e)),T=(e,s)=>e.map(s),P=Object,O=e=>P.getPrototypeOf(e),q=P.entries,B=e=>!g(e)&&y(O(e),(e=>e==P.prototype||g(O(e))),(()=>!0)),H=P.keys,M=(e,s)=>y(e,(e=>e[s])),D=(e,s)=>{const t=q(e);return m(t)===m(H(s))&&V(t,(([e,t])=>B(t)?!!B(s[e])&&D(s[e],t):s[e]===t))},{createContext:F,useContext:j,useEffect:E}=e,Q=F([]),A=(e,s)=>{var t;const r=j(Q);return g(e)?r[s]:h(e)?M(null!=(t=r[s+1])?t:{},e):e},G=(e,s)=>{const t=A(e,s);return g(e)||h(e)?t:e},W=e=>{var s;return H(null!=(s=j(Q)[e])?s:{})},z=e=>G(e,0),U=e=>G(e,2),J=e=>G(e,4),K=e=>G(e,6),N=e=>G(e,8),X=e=>G(e,10),Y=e=>e.toLowerCase();Y(l);const Z="Transaction";Y(Z);var $=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:re,useState:oe,useSyncExternalStore:le}=e,ue=[],ne=[{},[],[ue,void 0,ue],void 0,!1,0],de=[D,f,([e,s,t],[r,o,l])=>s===o&&f(e,r)&&f(t,l)],ie=(e,s)=>e===s,ae=(e,s,t=ue)=>{const[,r]=oe(),[o,l]=oe();return ee((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},pe=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+l])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},ce=(e,s,r,o=ue)=>{const l=re(ne[r]),u=_((()=>{var t,u,n;const d=null!=(u=null==(t=null==s?void 0:s[(4==r?"has":"get")+e])?void 0:t.call(s,...o))?u:ne[r];return(null!=(n=de[r])?n:ie)(d,l.current)?l.current:l.current=d}),[s,r,e,...o]),d=_((l=>pe(s,(4==r?n:t)+e,...o,l)),[s,r,e,...o]);return le(d,u)},xe=(e,s,t,r=ue,o=ue,...l)=>te((()=>pe(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Ie=(e,s,t,r=ue,o=S,l=ue,...u)=>{const n=z(e);return _((e=>y(n,(r=>y(t(e,r),(t=>o(r["set"+s](...Ce(u,r,e),t),t)))))),[n,s,...r,...l,...be(u)])},Ce=(e,s,t)=>T(e,(e=>L(e)?e(t,s):e)),be=e=>{return s=e=>!L(e),e.filter(s);var s},we=(e,s,t=S,r=ue,...o)=>{const l=z(e);return _((e=>t(null==l?void 0:l["del"+s](...Ce(o,l,e)))),[l,s,...r,...be(o)])},Re=(e,s,t)=>{const r=X(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},ke=e=>ce(p,z(e),1),ve=(e,s)=>ce(I,z(s),1,[e]),ge=(e,s,t,r=0,o,l)=>ce(C,z(l),1,[e,s,t,r,o]),ye=(e,s,t)=>ce(w,z(t),1,[e,s]),he=(e,s,t,r)=>ce(b,z(r),3,[e,s,t]),Le=e=>ce(v,z(e),1),me=(e,s)=>ce(R,z(s),3,[e]),Se=(e,s)=>ce("Metric",U(s),3,[e]),Ve=(e,s)=>ce("SliceIds",J(s),1,[e]),fe=(e,s,t)=>ce("Slice"+I,J(t),1,[e,s]),Te=(e,s,t)=>ce("RemoteRowId",K(t),3,[e,s]),Pe=(e,s,t)=>ce("Local"+I,K(t),1,[e,s]),Oe=(e,s,t)=>ce("Linked"+I,K(t),1,[e,s]),qe=(e,s)=>ce(u+I,N(s),1,[e]),Be=(e,s,t,r=0,o,l)=>ce(u+C,N(l),1,[e,s,t,r,o]),He=(e,s,t)=>ce(u+w,N(t),1,[e,s]),Me=(e,s,t,r)=>ce(u+b,N(r),3,[e,s,t]),De=e=>ce("CheckpointIds",X(e),2),Fe=(e,s)=>ce("Checkpoint",X(s),3,[e]),je=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Qe,Fragment:Ae,createElement:Ge,useCallback:We,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>g(e)?{}:e(...s),Ne=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var Xe=Object.defineProperty,Ye=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable,ss=(e,s,t)=>s in e?Xe(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ts=(e,s)=>{for(var t in s||(s={}))_e.call(s,t)&&ss(e,t,s[t]);if($e)for(var t of $e(s))es.call(s,t)&&ss(e,t,s[t]);return e},rs=(e,s)=>Ye(e,Ze(s)),os=(e,s)=>{var t={};for(var r in e)_e.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&$e)for(var r of $e(e))s.indexOf(r)<0&&es.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:ls,useContext:us,useMemo:ns,useState:ds}=e,is=({tableId:e,store:s,rowComponent:t=Cs,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>xs(T(n,(l=>Ge(t,rs(ts({},Ke(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),as=({queryId:e,queries:s,resultRowComponent:t=vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>xs(T(u,(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),ps=({relationshipId:e,relationships:s,rowComponent:t=Cs,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Ne(K(s),e),p=u(e,n,d);return xs(T(p,(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},cs=e=>({checkpoints:s,checkpointComponent:t=gs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=X(s);return xs(T(e(De(u)),(e=>Ge(t,rs(ts({},Ke(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},xs=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:T(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},Is=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return xs(t+(null!=(u=he(e,s,r,o))?u:t),void 0,l,r)},Cs=({tableId:e,rowId:s,store:t,cellComponent:r=Is,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>xs(T(((e,s,t,r)=>{const o=ye(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),bs=e=>is(e,ve(e.tableId,e.store)),ws=({valueId:e,store:s,debugIds:r})=>{var o;return xs(t+(null!=(o=me(e,s))?o:t),void 0,r,e)},Rs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Cs,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,d,i]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(J(t),e),a=fe(e,s,n);return xs(T(a,(e=>Ge(r,rs(ts({},Ke(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},ks=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return xs(t+(null!=(u=Me(e,s,r,o))?u:t),void 0,l,r)},vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=ks,getResultCellComponentProps:o,separator:l,debugIds:u})=>xs(T(He(e,s,t),(l=>Ge(r,rs(ts({},Ke(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),gs=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return xs(null!=(o=Fe(s,e))?o:t,void 0,r,s)},ys=cs((e=>e[0])),hs=cs((e=>g(e[1])?[]:[e[1]])),Ls=cs((e=>e[2]));exports.BackwardCheckpointsView=ys,exports.CellView=Is,exports.CheckpointView=gs,exports.CurrentCheckpointView=hs,exports.ForwardCheckpointsView=Ls,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Rs,getSliceComponentProps:r,separator:o,debugIds:l})=>xs(T(Ve(e,s),(o=>Ge(t,rs(ts({},Ke(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>ps(e,Oe,e.firstRowId),exports.LocalRowsView=e=>ps(e,Pe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return xs(null!=(o=Se(e,s))?o:t,void 0,r,e)},exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:d,queriesById:i,checkpoints:a,checkpointsById:p,children:c})=>{const x=us(Q),[I,C]=ds({}),b=ls(((e,s)=>C((t=>M(t,e)==s?t:rs(ts({},t),{[e]:s})))),[]),w=ls((e=>C((s=>ts({},((e,s)=>(delete e[s],e))(s,e))))),[]);return Ge(Q.Provider,{value:ns((()=>[null!=e?e:x[0],ts(ts(ts({},x[1]),s),I),null!=t?t:x[2],ts(ts({},x[3]),r),null!=o?o:x[4],ts(ts({},x[5]),l),null!=u?u:x[6],ts(ts({},x[7]),n),null!=d?d:x[8],ts(ts({},x[9]),i),null!=a?a:x[10],ts(ts({},x[11]),p),b,w]),[e,s,I,t,r,o,l,u,n,d,i,a,p,x,b,w])},c)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Cs,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Ne(K(t),e),i=Te(e,s,u);return xs(g(d)||g(i)?null:Ge(r,rs(ts({},Ke(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=ks,exports.ResultRowView=vs,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return as(u,Be(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>as(e,qe(e.queryId,e.queries)),exports.RowView=Cs,exports.SliceView=Rs,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=os(s,["cellId","descending","offset","limit"]);return is(u,ge(u.tableId,t,r,o,l,u.store))},exports.TableView=bs,exports.TablesView=({store:e,tableComponent:s=bs,getTableComponentProps:t,separator:r,debugIds:o})=>xs(T(ke(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=ws,exports.ValuesView=({store:e,valueComponent:s=ws,getValueComponentProps:t,separator:r,debugIds:o})=>xs(T(Le(e),(r=>Ge(s,rs(ts({},Ke(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=ue,r,o=S,l=ue,u=!0)=>{const n=z(r);return _((t=>y(n,(r=>y(s(t,r),(s=>o(r.addRow(L(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=he,exports.useCellIds=ye,exports.useCellIdsListener=(e,s,t,r,o,l)=>xe(w,z(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>xe(b,z(u),r,o,[e,s,t],l),exports.useCheckpoint=Fe,exports.useCheckpointIds=De,exports.useCheckpointIdsListener=(e,s,t)=>xe("CheckpointIds",X(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>xe("Checkpoint",X(r),s,t,[e]),exports.useCheckpoints=e=>A(e,10),exports.useCheckpointsIds=()=>W(11),exports.useCheckpointsOrCheckpointsById=X,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=ue)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=ue,r,o=ue,l,u=ue)=>{const[,n]=oe(),[d,i]=oe();return ee((()=>{const t=e?s(e):void 0;i(t),t&&r&&$(void 0,null,(function*(){yield r(t),n([])}))}),[e,...t,...o]),ee((()=>()=>{d&&(d.destroy(),null==l||l(d))}),[d,...u]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=ue)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=ue,r,o=ue)=>{const[l,u]=oe();return ee((()=>{$(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),ee((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},exports.useDelCellCallback=(e,s,t,r,o,l,u)=>we(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>we(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>we(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>we(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>xe("DidFinish"+Z,z(t),e,s),exports.useGoBackwardCallback=je,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>y(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>ce(b,z(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,l,u)=>xe(n+b,z(u),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>ce(c,z(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,l)=>xe(n+c,z(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>ce(i,z(s),4,[e]),exports.useHasTableCell=(e,s,t)=>ce(i+b,z(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,l)=>xe(n+i+b,z(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>xe(n+i,z(o),s,t,[e],r),exports.useHasTables=e=>ce(a,z(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>xe(n+a,z(r),e,s,[],t),exports.useHasValue=(e,s)=>ce(R,z(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>xe(n+R,z(o),s,t,[e],r),exports.useHasValues=e=>ce(k,z(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>xe(n+k,z(r),e,s,[],t),exports.useIndexIds=e=>ce("IndexIds",J(e),1),exports.useIndexes=e=>A(e,4),exports.useIndexesIds=()=>W(5),exports.useIndexesOrIndexesById=J,exports.useLinkedRowIds=Oe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>xe("Linked"+I,K(o),t,r,[e,s]),exports.useLocalRowIds=Pe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>xe("Local"+I,K(o),t,r,[e,s]),exports.useMetric=Se,exports.useMetricIds=e=>ce("MetricIds",U(e),1),exports.useMetricListener=(e,s,t,r)=>xe("Metric",U(r),s,t,[e]),exports.useMetrics=e=>A(e,2),exports.useMetricsIds=()=>W(3),exports.useMetricsOrMetricsById=U,exports.useProvideStore=(e,s)=>{const{12:t,13:r}=j(Q);E((()=>(null==t||t(e,s),()=>null==r?void 0:r(e))),[t,e,s,r])},exports.useQueries=e=>A(e,8),exports.useQueriesIds=()=>W(9),exports.useQueriesOrQueriesById=N,exports.useQueryIds=e=>ce("QueryIds",N(e),1),exports.useRedoInformation=e=>{var s;const r=X(e),[,,[o]]=De(r);return[!g(o),Ee(r),o,null!=(s=y(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>ce("RelationshipIds",K(e),1),exports.useRelationships=e=>A(e,6),exports.useRelationshipsIds=()=>W(7),exports.useRelationshipsOrRelationshipsById=K,exports.useRemoteRowId=Te,exports.useRemoteRowIdListener=(e,s,t,r,o)=>xe("RemoteRowId",K(o),t,r,[e,s]),exports.useResultCell=Me,exports.useResultCellIds=He,exports.useResultCellIdsListener=(e,s,t,r,o)=>xe(u+w,N(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,l)=>xe(u+b,N(l),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>ce(u+c,N(t),0,[e,s]),exports.useResultRowCount=(e,s)=>ce(u+x,N(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>xe(u+x,N(r),s,t,[e]),exports.useResultRowIds=qe,exports.useResultRowIdsListener=(e,s,t,r)=>xe(u+I,N(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>xe(u+c,N(o),t,r,[e,s]),exports.useResultSortedRowIds=Be,exports.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,d)=>xe(u+C,N(d),l,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>ce(u+i,N(s),0,[e]),exports.useResultTableCellIds=(e,s)=>ce(u+i+w,N(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>xe(u+i+w,N(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>xe(u+i,N(r),s,t,[e]),exports.useRow=(e,s,t)=>ce(c,z(t),0,[e,s]),exports.useRowCount=(e,s)=>ce(x,z(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>xe(x,z(o),s,t,[e],r),exports.useRowIds=ve,exports.useRowIdsListener=(e,s,t,r,o)=>xe(I,z(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>xe(c,z(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Ie(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=S,s=ue,t,r=S,o=ue)=>{const l=X(t);return _((s=>y(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Ie(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>Ie(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>Ie(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>Ie(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>Ie(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>Ie(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>Ie(t,k,e,s,r,o),exports.useSliceIds=Ve,exports.useSliceIdsListener=(e,s,t,r)=>xe("SliceIds",J(r),s,t,[e]),exports.useSliceRowIds=fe,exports.useSliceRowIdsListener=(e,s,t,r,o)=>xe("Slice"+I,J(o),t,r,[e,s]),exports.useSortedRowIds=ge,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>xe(C,z(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>xe("Start"+Z,z(t),e,s),exports.useStore=e=>A(e,0),exports.useStoreIds=()=>W(1),exports.useStoreOrStoreById=z,exports.useTable=(e,s)=>ce(i,z(s),0,[e]),exports.useTableCellIds=(e,s)=>ce(i+w,z(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>xe(i+w,z(o),s,t,[e],r),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,r)=>xe(p,z(r),e,s,ue,t),exports.useTableListener=(e,s,t,r,o)=>xe(i,z(o),s,t,[e],r),exports.useTables=e=>ce(a,z(e),0),exports.useTablesListener=(e,s,t,r)=>xe(a,z(r),e,s,ue,t),exports.useUndoInformation=e=>{var s;const r=X(e),[o,l]=De(r);return[(u=o,!(0==m(u))),je(r),l,null!=(s=y(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=me,exports.useValueIds=Le,exports.useValueIdsListener=(e,s,t,r)=>xe(v,z(r),e,s,ue,t),exports.useValueListener=(e,s,t,r,o)=>xe(R,z(o),s,t,[e],r),exports.useValues=e=>ce(k,z(e),0),exports.useValuesListener=(e,s,t,r)=>xe(k,z(r),e,s,ue,t),exports.useWillFinishTransactionListener=(e,s,t)=>xe("WillFinish"+Z,z(t),e,s);
|
|
Binary file
|
|
@@ -221,9 +221,9 @@ const createWsServer = (webSocketServer) => {
|
|
|
221
221
|
const clients = mapEnsure(clientsByPath, pathId, mapNew);
|
|
222
222
|
mapSet(clients, clientId, webSocket);
|
|
223
223
|
if (clients.size == 1) {
|
|
224
|
-
callListeners(pathIdListeners, void 0,
|
|
224
|
+
callListeners(pathIdListeners, void 0, pathId, 1);
|
|
225
225
|
}
|
|
226
|
-
callListeners(clientIdListeners, [pathId],
|
|
226
|
+
callListeners(clientIdListeners, [pathId], clientId, 1);
|
|
227
227
|
webSocket.on('message', (data) => {
|
|
228
228
|
var _a2;
|
|
229
229
|
const payload = data.toString(UTF8);
|
|
@@ -246,12 +246,10 @@ const createWsServer = (webSocketServer) => {
|
|
|
246
246
|
});
|
|
247
247
|
webSocket.on('close', () => {
|
|
248
248
|
collDel(clients, clientId);
|
|
249
|
-
callListeners(clientIdListeners, [pathId],
|
|
250
|
-
[clientId]: -1,
|
|
251
|
-
}));
|
|
249
|
+
callListeners(clientIdListeners, [pathId], clientId, -1);
|
|
252
250
|
if (collIsEmpty(clients)) {
|
|
253
251
|
collDel(clientsByPath, pathId);
|
|
254
|
-
callListeners(pathIdListeners, void 0,
|
|
252
|
+
callListeners(pathIdListeners, void 0, pathId, -1);
|
|
255
253
|
}
|
|
256
254
|
});
|
|
257
255
|
}),
|
|
@@ -221,9 +221,9 @@ const createWsServer = (webSocketServer) => {
|
|
|
221
221
|
const clients = mapEnsure(clientsByPath, pathId, mapNew);
|
|
222
222
|
mapSet(clients, clientId, webSocket);
|
|
223
223
|
if (clients.size == 1) {
|
|
224
|
-
callListeners(pathIdListeners, void 0,
|
|
224
|
+
callListeners(pathIdListeners, void 0, pathId, 1);
|
|
225
225
|
}
|
|
226
|
-
callListeners(clientIdListeners, [pathId],
|
|
226
|
+
callListeners(clientIdListeners, [pathId], clientId, 1);
|
|
227
227
|
webSocket.on('message', (data) => {
|
|
228
228
|
var _a2;
|
|
229
229
|
const payload = data.toString(UTF8);
|
|
@@ -246,12 +246,10 @@ const createWsServer = (webSocketServer) => {
|
|
|
246
246
|
});
|
|
247
247
|
webSocket.on('close', () => {
|
|
248
248
|
collDel(clients, clientId);
|
|
249
|
-
callListeners(clientIdListeners, [pathId],
|
|
250
|
-
[clientId]: -1,
|
|
251
|
-
}));
|
|
249
|
+
callListeners(clientIdListeners, [pathId], clientId, -1);
|
|
252
250
|
if (collIsEmpty(clients)) {
|
|
253
251
|
collDel(clientsByPath, pathId);
|
|
254
|
-
callListeners(pathIdListeners, void 0,
|
|
252
|
+
callListeners(pathIdListeners, void 0, pathId, -1);
|
|
255
253
|
}
|
|
256
254
|
});
|
|
257
255
|
}),
|
|
@@ -41,6 +41,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
41
41
|
arrayEvery(array1, (value1, index) => array2[index] === value1);
|
|
42
42
|
const arrayMap = (array, cb) => array.map(cb);
|
|
43
43
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
44
|
+
const arrayFilter = (array, cb) => array.filter(cb);
|
|
44
45
|
|
|
45
46
|
const object = Object;
|
|
46
47
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -268,9 +269,7 @@ const useSetCallback = (
|
|
|
268
269
|
ifNotUndefined(get(parameter, store2), (thing) =>
|
|
269
270
|
then(
|
|
270
271
|
store2['set' + settable](
|
|
271
|
-
...
|
|
272
|
-
isFunction(arg) ? arg(parameter, store2) : arg,
|
|
273
|
-
),
|
|
272
|
+
...argsOrGetArgs(args, store2, parameter),
|
|
274
273
|
thing,
|
|
275
274
|
),
|
|
276
275
|
thing,
|
|
@@ -278,9 +277,12 @@ const useSetCallback = (
|
|
|
278
277
|
),
|
|
279
278
|
),
|
|
280
279
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
|
-
[store, settable, ...getDeps, ...thenDeps, ...args],
|
|
280
|
+
[store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
|
|
282
281
|
);
|
|
283
282
|
};
|
|
283
|
+
const argsOrGetArgs = (args, store, parameter) =>
|
|
284
|
+
arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
|
|
285
|
+
const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
|
|
284
286
|
const useDel = (
|
|
285
287
|
storeOrStoreId,
|
|
286
288
|
deletable,
|
|
@@ -290,9 +292,14 @@ const useDel = (
|
|
|
290
292
|
) => {
|
|
291
293
|
const store = useStoreOrStoreById(storeOrStoreId);
|
|
292
294
|
return useCallback$2(
|
|
293
|
-
() =>
|
|
295
|
+
(parameter) =>
|
|
296
|
+
then(
|
|
297
|
+
store == null
|
|
298
|
+
? void 0
|
|
299
|
+
: store['del' + deletable](...argsOrGetArgs(args, store, parameter)),
|
|
300
|
+
),
|
|
294
301
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
295
|
-
[store, deletable, ...thenDeps, ...args],
|
|
302
|
+
[store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
|
|
296
303
|
);
|
|
297
304
|
};
|
|
298
305
|
const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
@@ -41,6 +41,7 @@ const arrayIsEqual = (array1, array2) =>
|
|
|
41
41
|
arrayEvery(array1, (value1, index) => array2[index] === value1);
|
|
42
42
|
const arrayMap = (array, cb) => array.map(cb);
|
|
43
43
|
const arrayIsEmpty = (array) => size(array) == 0;
|
|
44
|
+
const arrayFilter = (array, cb) => array.filter(cb);
|
|
44
45
|
|
|
45
46
|
const object = Object;
|
|
46
47
|
const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
|
|
@@ -268,9 +269,7 @@ const useSetCallback = (
|
|
|
268
269
|
ifNotUndefined(get(parameter, store2), (thing) =>
|
|
269
270
|
then(
|
|
270
271
|
store2['set' + settable](
|
|
271
|
-
...
|
|
272
|
-
isFunction(arg) ? arg(parameter, store2) : arg,
|
|
273
|
-
),
|
|
272
|
+
...argsOrGetArgs(args, store2, parameter),
|
|
274
273
|
thing,
|
|
275
274
|
),
|
|
276
275
|
thing,
|
|
@@ -278,9 +277,12 @@ const useSetCallback = (
|
|
|
278
277
|
),
|
|
279
278
|
),
|
|
280
279
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
|
-
[store, settable, ...getDeps, ...thenDeps, ...args],
|
|
280
|
+
[store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
|
|
282
281
|
);
|
|
283
282
|
};
|
|
283
|
+
const argsOrGetArgs = (args, store, parameter) =>
|
|
284
|
+
arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
|
|
285
|
+
const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
|
|
284
286
|
const useDel = (
|
|
285
287
|
storeOrStoreId,
|
|
286
288
|
deletable,
|
|
@@ -290,9 +292,14 @@ const useDel = (
|
|
|
290
292
|
) => {
|
|
291
293
|
const store = useStoreOrStoreById(storeOrStoreId);
|
|
292
294
|
return useCallback$2(
|
|
293
|
-
() =>
|
|
295
|
+
(parameter) =>
|
|
296
|
+
then(
|
|
297
|
+
store == null
|
|
298
|
+
? void 0
|
|
299
|
+
: store['del' + deletable](...argsOrGetArgs(args, store, parameter)),
|
|
300
|
+
),
|
|
294
301
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
295
|
-
[store, deletable, ...thenDeps, ...args],
|
|
302
|
+
[store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
|
|
296
303
|
);
|
|
297
304
|
};
|
|
298
305
|
const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),c=(e,...t)=>e.push(...t),o=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],S=(e,t)=>e?.get(t),y=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,c;return r=e,c=t,r?.has(c)?s?.(S(e,t)):y(e,t,n()),S(e,t)},p=(e,n,r,c,o=0)=>t((r?k:S)(e,n[o],o>s(n)-2?r:f),(t=>{if(o>s(n)-2)return c?.(t)&&y(e,n[o]),t;const a=p(t,n,r,c,o+1);return i(t)&&y(e,n[o]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/;exports.createWsServer=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let o;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&c(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{o??=C;const c=a(1);var d,i;return y(l,c,[e,t,n,s,r]),d=p(t,n??[""],I),i=c,d?.add(i),c},(e,t,...n)=>r(((e,t=[""])=>{const n=[],o=(e,a)=>a==s(t)?c(n,e):null===t[a]?h(e,(e=>o(e,a+1))):r([t[a],null],(t=>o(S(e,t),a+1)));return o(e,0),n})(e,t),(e=>h(e,(e=>S(l,e)[0](o,...t??[],...n))))),e=>t(S(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),y(l,e),d(e),n))),n=>t(S(l,n),(([t,,n=[],c,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(o,...l,...a(l)):e(n[i])?r(c[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);y(s,t,e),1==s.size&&x(u,void 0,
|
|
1
|
+
"use strict";const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),c=(e,...t)=>e.push(...t),o=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],S=(e,t)=>e?.get(t),y=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,c;return r=e,c=t,r?.has(c)?s?.(S(e,t)):y(e,t,n()),S(e,t)},p=(e,n,r,c,o=0)=>t((r?k:S)(e,n[o],o>s(n)-2?r:f),(t=>{if(o>s(n)-2)return c?.(t)&&y(e,n[o]),t;const a=p(t,n,r,c,o+1);return i(t)&&y(e,n[o]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/;exports.createWsServer=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let o;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&c(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{o??=C;const c=a(1);var d,i;return y(l,c,[e,t,n,s,r]),d=p(t,n??[""],I),i=c,d?.add(i),c},(e,t,...n)=>r(((e,t=[""])=>{const n=[],o=(e,a)=>a==s(t)?c(n,e):null===t[a]?h(e,(e=>o(e,a+1))):r([t[a],null],(t=>o(S(e,t),a+1)));return o(e,0),n})(e,t),(e=>h(e,(e=>S(l,e)[0](o,...t??[],...n))))),e=>t(S(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),y(l,e),d(e),n))),n=>t(S(l,n),(([t,,n=[],c,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(o,...l,...a(l)):e(n[i])?r(c[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);y(s,t,e),1==s.size&&x(u,void 0,r,1),x(z,[r],t,1),e.on("message",(e=>{const r=e.toString("utf8"),c=r.indexOf("\n");if(-1!==c){const e=n(r,0,c),a=n(r,c+1);""===e?(o=(e,n)=>e!=t?n.send(t+"\n"+a):0,h(s,((e,t)=>o(t,e)))):S(s,e)?.send(t+"\n"+a)}var o})),e.on("close",(()=>{v(s,t),x(z,[r],t,-1),i(s)&&(v(L,r),x(u,void 0,r,-1))}))}))))));const C={getWebSocketServer:()=>l,getPathIds:()=>g(L),getClientIds:e=>g(S(L,e)),addPathIdsListener:e=>m(e,u),addClientIdsListener:(e,t)=>m(t,z,[e]),delListener:e=>(A(e),C),getStats:()=>({paths:a(L),clients:d(L)}),destroy:()=>{l.close(),L.clear()}};return o(C)};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),c=(e,...t)=>e.push(...t),o=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],S=(e,t)=>e?.get(t),y=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,c;return r=e,c=t,r?.has(c)?s?.(S(e,t)):y(e,t,n()),S(e,t)},p=(e,n,r,c,o=0)=>t((r?k:S)(e,n[o],o>s(n)-2?r:f),(t=>{if(o>s(n)-2)return c?.(t)&&y(e,n[o]),t;const a=p(t,n,r,c,o+1);return i(t)&&y(e,n[o]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/;exports.createWsServer=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let o;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&c(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{o??=C;const c=a(1);var d,i;return y(l,c,[e,t,n,s,r]),d=p(t,n??[""],I),i=c,d?.add(i),c},(e,t,...n)=>r(((e,t=[""])=>{const n=[],o=(e,a)=>a==s(t)?c(n,e):null===t[a]?h(e,(e=>o(e,a+1))):r([t[a],null],(t=>o(S(e,t),a+1)));return o(e,0),n})(e,t),(e=>h(e,(e=>S(l,e)[0](o,...t??[],...n))))),e=>t(S(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),y(l,e),d(e),n))),n=>t(S(l,n),(([t,,n=[],c,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(o,...l,...a(l)):e(n[i])?r(c[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);y(s,t,e),1==s.size&&x(u,void 0,
|
|
1
|
+
"use strict";const e=e=>null==e,t=(t,n,s)=>e(t)?s?.():n(t),n=(e,t,n)=>e.slice(t,n),s=e=>e.length,r=(e,t)=>e.forEach(t),c=(e,...t)=>e.push(...t),o=Object.freeze,a=e=>e?.size??0,d=(l=a,e=>{return t=(e,t)=>e+l(t),u(e).reduce(t,0);var t});var l;const i=t=>e(t)||0==a(t),u=e=>[...e?.values()??[]],h=(e,t)=>e?.forEach(t),v=(e,t)=>e?.delete(t),f=e=>new Map(e),g=e=>[...e?.keys()??[]],S=(e,t)=>e?.get(t),y=(t,n,s)=>e(s)?(v(t,n),t):t?.set(n,s),k=(e,t,n,s)=>{var r,c;return r=e,c=t,r?.has(c)?s?.(S(e,t)):y(e,t,n()),S(e,t)},p=(e,n,r,c,o=0)=>t((r?k:S)(e,n[o],o>s(n)-2?r:f),(t=>{if(o>s(n)-2)return c?.(t)&&y(e,n[o]),t;const a=p(t,n,r,c,o+1);return i(t)&&y(e,n[o]),a})),I=t=>new Set(Array.isArray(t)||e(t)?t:[t]),b=/^\d+$/,w=/\/([^?]*)/;exports.createWsServer=l=>{const u=f(),z=f(),L=f(),[m,x,A]=(n=>{let o;const[a,d]=(()=>{const e=[];let t=0;return[n=>(n?e.shift():null)??""+t++,t=>{b.test(t)&&s(e)<1e3&&c(e,t)}]})(),l=f();return[(e,t,n,s=[],r=(()=>[]))=>{o??=C;const c=a(1);var d,i;return y(l,c,[e,t,n,s,r]),d=p(t,n??[""],I),i=c,d?.add(i),c},(e,t,...n)=>r(((e,t=[""])=>{const n=[],o=(e,a)=>a==s(t)?c(n,e):null===t[a]?h(e,(e=>o(e,a+1))):r([t[a],null],(t=>o(S(e,t),a+1)));return o(e,0),n})(e,t),(e=>h(e,(e=>S(l,e)[0](o,...t??[],...n))))),e=>t(S(l,e),(([,t,n])=>(p(t,n??[""],void 0,(t=>(v(t,e),i(t)?1:0))),y(l,e),d(e),n))),n=>t(S(l,n),(([t,,n=[],c,a])=>{const d=(...l)=>{const i=s(l);i==s(n)?t(o,...l,...a(l)):e(n[i])?r(c[i]?.(...l)??[],(e=>d(...l,e))):d(...l,n[i])};d()}))]})();l.on("connection",((e,s)=>t(s.url?.match(w),(([,r])=>t(s.headers["sec-websocket-key"],(t=>{const s=k(L,r,f);y(s,t,e),1==s.size&&x(u,void 0,r,1),x(z,[r],t,1),e.on("message",(e=>{const r=e.toString("utf8"),c=r.indexOf("\n");if(-1!==c){const e=n(r,0,c),a=n(r,c+1);""===e?(o=(e,n)=>e!=t?n.send(t+"\n"+a):0,h(s,((e,t)=>o(t,e)))):S(s,e)?.send(t+"\n"+a)}var o})),e.on("close",(()=>{v(s,t),x(z,[r],t,-1),i(s)&&(v(L,r),x(u,void 0,r,-1))}))}))))));const C={getWebSocketServer:()=>l,getPathIds:()=>g(L),getClientIds:e=>g(S(L,e)),addPathIdsListener:e=>m(e,u),addClientIdsListener:(e,t)=>m(t,z,[e]),delListener:e=>(A(e),C),getStats:()=>({paths:a(L),clients:d(L)}),destroy:()=>{l.close(),L.clear()}};return o(C)};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",a=p+"s",i=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,L=e=>null==e,h=(e,s,t)=>L(e)?t?.():s(e),y=e=>s(e)==o,m=e=>s(e)==r,S=e=>e.length,V=()=>{},T=(e,s)=>e.every(s),v=(e,s)=>S(e)===S(s)&&T(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),f=Object,q=e=>f.getPrototypeOf(e),B=f.entries,H=e=>!L(e)&&h(q(e),(e=>e==f.prototype||L(q(e))),(()=>!0)),M=f.keys,D=(e,s)=>h(e,(e=>e[s])),F=(e,s)=>(delete e[s],e),O=(e,s)=>{const t=B(e);return S(t)===S(M(s))&&T(t,(([e,t])=>H(t)?!!H(s[e])&&O(s[e],t):s[e]===t))},{createContext:Q,useContext:E,useEffect:A}=e,G=Q([]),W=(e,s)=>{const t=E(G);return L(e)?t[s]:y(e)?D(t[s+1]??{},e):e},j=(e,s)=>{const t=W(e,s);return L(e)||y(e)?t:e},z=e=>M(E(G)[e]??{}),U=e=>j(e,0),J=e=>j(e,2),K=e=>j(e,4),N=e=>j(e,6),X=e=>j(e,8),Y=e=>j(e,10),Z=e=>e.toLowerCase();Z(u);const $="Transaction";Z($);const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:oe,useState:re,useSyncExternalStore:ue}=e,le=[],ne=[{},[],[le,void 0,le],void 0,!1,0],de=[O,v,([e,s,t],[o,r,u])=>s===r&&v(e,o)&&v(t,u)],pe=(e,s)=>e===s,ae=(e,s,t=le)=>{const[,o]=re(),[r,u]=re();return ee((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},ie=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},xe=(e,s,o,r=le)=>{const u=oe(ne[o]),l=_((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ne[o];return(de[o]??pe)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=_((u=>ie(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ue(d,l)},ce=(e,s,t,o=le,r=le,...u)=>te((()=>ie(s,e,...r,t,...u)),[s,e,...r,...o,...u]),Ie=(e,s,t,o=le,r=V,u=le,...l)=>{const n=U(e);return _((e=>h(n,(o=>h(t(e,o),(t=>r(o["set"+s](...P(l,(s=>m(s)?s(e,o):s)),t),t)))))),[n,s,...o,...u,...l])},Ce=(e,s,t=V,o=le,...r)=>{const u=U(e);return _((()=>t(u?.["del"+s](...r))),[u,s,...o,...r])},be=(e,s,t)=>{const o=Y(e);return _((()=>o?.[s](t)),[o,s,t])},we=e=>xe(i,U(e),1),Re=(e,s)=>xe(I,U(s),1,[e]),ke=(e,s,t,o=0,r,u)=>xe(C,U(u),1,[e,s,t,o,r]),ge=(e,s,t)=>xe(w,U(t),1,[e,s]),Le=(e,s,t,o)=>xe(b,U(o),3,[e,s,t]),he=e=>xe(g,U(e),1),ye=(e,s)=>xe(R,U(s),3,[e]),me=(e,s)=>xe("Metric",J(s),3,[e]),Se=(e,s)=>xe("SliceIds",K(s),1,[e]),Ve=(e,s,t)=>xe("Slice"+I,K(t),1,[e,s]),Te=(e,s,t)=>xe("RemoteRowId",N(t),3,[e,s]),ve=(e,s,t)=>xe("Local"+I,N(t),1,[e,s]),Pe=(e,s,t)=>xe("Linked"+I,N(t),1,[e,s]),fe=(e,s)=>xe(l+I,X(s),1,[e]),qe=(e,s,t,o=0,r,u)=>xe(l+C,X(u),1,[e,s,t,o,r]),Be=(e,s,t)=>xe(l+w,X(t),1,[e,s]),He=(e,s,t,o)=>xe(l+b,X(o),3,[e,s,t]),Me=e=>xe("CheckpointIds",Y(e),2),De=(e,s)=>xe("Checkpoint",Y(s),3,[e]),Fe=e=>be(e,"goBackward"),Oe=e=>be(e,"goForward"),{PureComponent:Qe,Fragment:Ee,createElement:Ae,useCallback:Ge,useLayoutEffect:We,useRef:je,useState:ze}=e,Ue=(e,...s)=>L(e)?{}:e(...s),Je=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:Ke,useContext:Ne,useMemo:Xe,useState:Ye}=e,Ze=({tableId:e,store:s,rowComponent:t=os,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>ss(P(n,(u=>Ae(t,{...Ue(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),$e=({queryId:e,queries:s,resultRowComponent:t=ds,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>ss(P(l,(r=>Ae(t,{...Ue(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),_e=({relationshipId:e,relationships:s,rowComponent:t=os,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,a]=Je(N(s),e),i=l(e,n,d);return ss(P(i,(e=>Ae(t,{...Ue(o,e),key:e,tableId:a,rowId:e,store:p,debugIds:u}))),r,u,n)},es=e=>({checkpoints:s,checkpointComponent:t=ps,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=Y(s);return ss(P(e(Me(l)),(e=>Ae(t,{...Ue(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},ss=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},ts=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>ss(t+(Le(e,s,o,r)??t),void 0,u,o),os=({tableId:e,rowId:s,store:t,cellComponent:o=ts,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>ss(P(((e,s,t,o)=>{const r=ge(s,t,o);return e??r})(u,e,s,t),(u=>Ae(o,{...Ue(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),rs=e=>Ze(e,Re(e.tableId,e.store)),us=({valueId:e,store:s,debugIds:o})=>ss(t+(ye(e,s)??t),void 0,o,e),ls=({indexId:e,sliceId:s,indexes:t,rowComponent:o=os,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(K(t),e),a=Ve(e,s,n);return ss(P(a,(e=>Ae(o,{...Ue(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},ns=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>ss(t+(He(e,s,o,r)??t),void 0,u,o),ds=({queryId:e,rowId:s,queries:t,resultCellComponent:o=ns,getResultCellComponentProps:r,separator:u,debugIds:l})=>ss(P(Be(e,s,t),(u=>Ae(o,{...Ue(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),ps=({checkpoints:e,checkpointId:s,debugIds:o})=>ss(De(s,e)??t,void 0,o,s),as=es((e=>e[0])),is=es((e=>L(e[1])?[]:[e[1]])),xs=es((e=>e[2]));exports.BackwardCheckpointsView=as,exports.CellView=ts,exports.CheckpointView=ps,exports.CurrentCheckpointView=is,exports.ForwardCheckpointsView=xs,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ls,getSliceComponentProps:o,separator:r,debugIds:u})=>ss(P(Se(e,s),(r=>Ae(t,{...Ue(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>_e(e,Pe,e.firstRowId),exports.LocalRowsView=e=>_e(e,ve,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>ss(me(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:a,checkpointsById:i,children:x})=>{const c=Ne(G),[I,C]=Ye({}),b=Ke(((e,s)=>C((t=>D(t,e)==s?t:{...t,[e]:s}))),[]),w=Ke((e=>C((s=>({...F(s,e)})))),[]);return Ae(G.Provider,{value:Xe((()=>[e??c[0],{...c[1],...s,...I},t??c[2],{...c[3],...o},r??c[4],{...c[5],...u},l??c[6],{...c[7],...n},d??c[8],{...c[9],...p},a??c[10],{...c[11],...i},b,w]),[e,s,I,t,o,r,u,l,n,d,p,a,i,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=os,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=Je(N(t),e),p=Te(e,s,l);return ss(L(d)||L(p)?null:Ae(o,{...Ue(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=ns,exports.ResultRowView=ds,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>$e(r,qe(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>$e(e,fe(e.queryId,e.queries)),exports.RowView=os,exports.SliceView=ls,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>Ze(r,ke(r.tableId,e,s,t,o,r.store)),exports.TableView=rs,exports.TablesView=({store:e,tableComponent:s=rs,getTableComponentProps:t,separator:o,debugIds:r})=>ss(P(we(e),(o=>Ae(s,{...Ue(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=us,exports.ValuesView=({store:e,valueComponent:s=us,getValueComponentProps:t,separator:o,debugIds:r})=>ss(P(he(e),(o=>Ae(s,{...Ue(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=le,o,r=V,u=le,l=!0)=>{const n=U(o);return _((t=>h(n,(o=>h(s(t,o),(s=>r(o.addRow(m(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=Le,exports.useCellIds=ge,exports.useCellIdsListener=(e,s,t,o,r,u)=>ce(w,U(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ce(b,U(l),o,r,[e,s,t],u),exports.useCheckpoint=De,exports.useCheckpointIds=Me,exports.useCheckpointIdsListener=(e,s,t)=>ce("CheckpointIds",Y(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ce("Checkpoint",Y(o),s,t,[e]),exports.useCheckpoints=e=>W(e,10),exports.useCheckpointsIds=()=>z(11),exports.useCheckpointsOrCheckpointsById=Y,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=le)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=le,o,r=le,u,l=le)=>{const[,n]=re(),[d,p]=re();return ee((()=>{const t=e?s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()}),[e,...t,...r]),ee((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=le)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=le,o,r=le)=>{const[u,l]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),ee((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>Ce(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>Ce(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>Ce(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>Ce(e,a,s,t),exports.useDelValueCallback=(e,s,t,o)=>Ce(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>Ce(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ce("DidFinish"+$,U(t),e,s),exports.useGoBackwardCallback=Fe,exports.useGoForwardCallback=Oe,exports.useGoToCallback=(e,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>xe(b,U(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ce(n+b,U(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>xe(x,U(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ce(n+x,U(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>xe(p,U(s),4,[e]),exports.useHasTableCell=(e,s,t)=>xe(p+b,U(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ce(n+p+b,U(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ce(n+p,U(r),s,t,[e],o),exports.useHasTables=e=>xe(a,U(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ce(n+a,U(o),e,s,[],t),exports.useHasValue=(e,s)=>xe(R,U(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ce(n+R,U(r),s,t,[e],o),exports.useHasValues=e=>xe(k,U(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ce(n+k,U(o),e,s,[],t),exports.useIndexIds=e=>xe("IndexIds",K(e),1),exports.useIndexes=e=>W(e,4),exports.useIndexesIds=()=>z(5),exports.useIndexesOrIndexesById=K,exports.useLinkedRowIds=Pe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ce("Linked"+I,N(r),t,o,[e,s]),exports.useLocalRowIds=ve,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ce("Local"+I,N(r),t,o,[e,s]),exports.useMetric=me,exports.useMetricIds=e=>xe("MetricIds",J(e),1),exports.useMetricListener=(e,s,t,o)=>ce("Metric",J(o),s,t,[e]),exports.useMetrics=e=>W(e,2),exports.useMetricsIds=()=>z(3),exports.useMetricsOrMetricsById=J,exports.useProvideStore=(e,s)=>{const{12:t,13:o}=E(G);A((()=>(t?.(e,s),()=>o?.(e))),[t,e,s,o])},exports.useQueries=e=>W(e,8),exports.useQueriesIds=()=>z(9),exports.useQueriesOrQueriesById=X,exports.useQueryIds=e=>xe("QueryIds",X(e),1),exports.useRedoInformation=e=>{const s=Y(e),[,,[o]]=Me(s);return[!L(o),Oe(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>xe("RelationshipIds",N(e),1),exports.useRelationships=e=>W(e,6),exports.useRelationshipsIds=()=>z(7),exports.useRelationshipsOrRelationshipsById=N,exports.useRemoteRowId=Te,exports.useRemoteRowIdListener=(e,s,t,o,r)=>ce("RemoteRowId",N(r),t,o,[e,s]),exports.useResultCell=He,exports.useResultCellIds=Be,exports.useResultCellIdsListener=(e,s,t,o,r)=>ce(l+w,X(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ce(l+b,X(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>xe(l+x,X(t),0,[e,s]),exports.useResultRowCount=(e,s)=>xe(l+c,X(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ce(l+c,X(o),s,t,[e]),exports.useResultRowIds=fe,exports.useResultRowIdsListener=(e,s,t,o)=>ce(l+I,X(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ce(l+x,X(r),t,o,[e,s]),exports.useResultSortedRowIds=qe,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ce(l+C,X(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>xe(l+p,X(s),0,[e]),exports.useResultTableCellIds=(e,s)=>xe(l+p+w,X(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ce(l+p+w,X(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ce(l+p,X(o),s,t,[e]),exports.useRow=(e,s,t)=>xe(x,U(t),0,[e,s]),exports.useRowCount=(e,s)=>xe(c,U(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ce(c,U(r),s,t,[e],o),exports.useRowIds=Re,exports.useRowIdsListener=(e,s,t,o,r)=>ce(I,U(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ce(x,U(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>Ie(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>Ie(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>Ie(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>Ie(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>Ie(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>Ie(t,a,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>Ie(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>Ie(t,k,e,s,o,r),exports.useSliceIds=Se,exports.useSliceIdsListener=(e,s,t,o)=>ce("SliceIds",K(o),s,t,[e]),exports.useSliceRowIds=Ve,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ce("Slice"+I,K(r),t,o,[e,s]),exports.useSortedRowIds=ke,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ce(C,U(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ce("Start"+$,U(t),e,s),exports.useStore=e=>W(e,0),exports.useStoreIds=()=>z(1),exports.useStoreOrStoreById=U,exports.useTable=(e,s)=>xe(p,U(s),0,[e]),exports.useTableCellIds=(e,s)=>xe(p+w,U(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ce(p+w,U(r),s,t,[e],o),exports.useTableIds=we,exports.useTableIdsListener=(e,s,t,o)=>ce(i,U(o),e,s,le,t),exports.useTableListener=(e,s,t,o,r)=>ce(p,U(r),s,t,[e],o),exports.useTables=e=>xe(a,U(e),0),exports.useTablesListener=(e,s,t,o)=>ce(a,U(o),e,s,le,t),exports.useUndoInformation=e=>{const s=Y(e),[o,r]=Me(s);return[(u=o,!(0==S(u))),Fe(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=ye,exports.useValueIds=he,exports.useValueIdsListener=(e,s,t,o)=>ce(g,U(o),e,s,le,t),exports.useValueListener=(e,s,t,o,r)=>ce(R,U(r),s,t,[e],o),exports.useValues=e=>xe(k,U(e),0),exports.useValuesListener=(e,s,t,o)=>ce(k,U(o),e,s,le,t),exports.useWillFinishTransactionListener=(e,s,t)=>ce("WillFinish"+$,U(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",a=p+"s",i=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,L=e=>null==e,h=(e,s,t)=>L(e)?t?.():s(e),y=e=>s(e)==o,m=e=>s(e)==r,S=e=>e.length,V=()=>{},T=(e,s)=>e.every(s),v=(e,s)=>S(e)===S(s)&&T(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),f=Object,q=e=>f.getPrototypeOf(e),B=f.entries,H=e=>!L(e)&&h(q(e),(e=>e==f.prototype||L(q(e))),(()=>!0)),M=f.keys,D=(e,s)=>h(e,(e=>e[s])),F=(e,s)=>(delete e[s],e),O=(e,s)=>{const t=B(e);return S(t)===S(M(s))&&T(t,(([e,t])=>H(t)?!!H(s[e])&&O(s[e],t):s[e]===t))},{createContext:Q,useContext:E,useEffect:A}=e,G=Q([]),W=(e,s)=>{const t=E(G);return L(e)?t[s]:y(e)?D(t[s+1]??{},e):e},j=(e,s)=>{const t=W(e,s);return L(e)||y(e)?t:e},z=e=>M(E(G)[e]??{}),U=e=>j(e,0),J=e=>j(e,2),K=e=>j(e,4),N=e=>j(e,6),X=e=>j(e,8),Y=e=>j(e,10),Z=e=>e.toLowerCase();Z(u);const $="Transaction";Z($);const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:oe,useState:re,useSyncExternalStore:ue}=e,le=[],ne=[{},[],[le,void 0,le],void 0,!1,0],de=[O,v,([e,s,t],[o,r,u])=>s===r&&v(e,o)&&v(t,u)],pe=(e,s)=>e===s,ae=(e,s,t=le)=>{const[,o]=re(),[r,u]=re();return ee((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},ie=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},xe=(e,s,o,r=le)=>{const u=oe(ne[o]),l=_((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ne[o];return(de[o]??pe)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=_((u=>ie(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ue(d,l)},ce=(e,s,t,o=le,r=le,...u)=>te((()=>ie(s,e,...r,t,...u)),[s,e,...r,...o,...u]),Ie=(e,s,t,o=le,r=V,u=le,...l)=>{const n=U(e);return _((e=>h(n,(o=>h(t(e,o),(t=>r(o["set"+s](...Ce(l,o,e),t),t)))))),[n,s,...o,...u,...be(l)])},Ce=(e,s,t)=>P(e,(e=>m(e)?e(t,s):e)),be=e=>{return s=e=>!m(e),e.filter(s);var s},we=(e,s,t=V,o=le,...r)=>{const u=U(e);return _((e=>t(u?.["del"+s](...Ce(r,u,e)))),[u,s,...o,...be(r)])},Re=(e,s,t)=>{const o=Y(e);return _((()=>o?.[s](t)),[o,s,t])},ke=e=>xe(i,U(e),1),ge=(e,s)=>xe(I,U(s),1,[e]),Le=(e,s,t,o=0,r,u)=>xe(C,U(u),1,[e,s,t,o,r]),he=(e,s,t)=>xe(w,U(t),1,[e,s]),ye=(e,s,t,o)=>xe(b,U(o),3,[e,s,t]),me=e=>xe(g,U(e),1),Se=(e,s)=>xe(R,U(s),3,[e]),Ve=(e,s)=>xe("Metric",J(s),3,[e]),Te=(e,s)=>xe("SliceIds",K(s),1,[e]),ve=(e,s,t)=>xe("Slice"+I,K(t),1,[e,s]),Pe=(e,s,t)=>xe("RemoteRowId",N(t),3,[e,s]),fe=(e,s,t)=>xe("Local"+I,N(t),1,[e,s]),qe=(e,s,t)=>xe("Linked"+I,N(t),1,[e,s]),Be=(e,s)=>xe(l+I,X(s),1,[e]),He=(e,s,t,o=0,r,u)=>xe(l+C,X(u),1,[e,s,t,o,r]),Me=(e,s,t)=>xe(l+w,X(t),1,[e,s]),De=(e,s,t,o)=>xe(l+b,X(o),3,[e,s,t]),Fe=e=>xe("CheckpointIds",Y(e),2),Oe=(e,s)=>xe("Checkpoint",Y(s),3,[e]),Qe=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Ae,Fragment:Ge,createElement:We,useCallback:je,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>L(e)?{}:e(...s),Ne=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:Xe,useContext:Ye,useMemo:Ze,useState:$e}=e,_e=({tableId:e,store:s,rowComponent:t=us,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>os(P(n,(u=>We(t,{...Ke(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),es=({queryId:e,queries:s,resultRowComponent:t=as,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>os(P(l,(r=>We(t,{...Ke(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),ss=({relationshipId:e,relationships:s,rowComponent:t=us,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,a]=Ne(N(s),e),i=l(e,n,d);return os(P(i,(e=>We(t,{...Ke(o,e),key:e,tableId:a,rowId:e,store:p,debugIds:u}))),r,u,n)},ts=e=>({checkpoints:s,checkpointComponent:t=is,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=Y(s);return os(P(e(Fe(l)),(e=>We(t,{...Ke(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},os=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},rs=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>os(t+(ye(e,s,o,r)??t),void 0,u,o),us=({tableId:e,rowId:s,store:t,cellComponent:o=rs,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>os(P(((e,s,t,o)=>{const r=he(s,t,o);return e??r})(u,e,s,t),(u=>We(o,{...Ke(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),ls=e=>_e(e,ge(e.tableId,e.store)),ns=({valueId:e,store:s,debugIds:o})=>os(t+(Se(e,s)??t),void 0,o,e),ds=({indexId:e,sliceId:s,indexes:t,rowComponent:o=us,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(K(t),e),a=ve(e,s,n);return os(P(a,(e=>We(o,{...Ke(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},ps=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>os(t+(De(e,s,o,r)??t),void 0,u,o),as=({queryId:e,rowId:s,queries:t,resultCellComponent:o=ps,getResultCellComponentProps:r,separator:u,debugIds:l})=>os(P(Me(e,s,t),(u=>We(o,{...Ke(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),is=({checkpoints:e,checkpointId:s,debugIds:o})=>os(Oe(s,e)??t,void 0,o,s),xs=ts((e=>e[0])),cs=ts((e=>L(e[1])?[]:[e[1]])),Is=ts((e=>e[2]));exports.BackwardCheckpointsView=xs,exports.CellView=rs,exports.CheckpointView=is,exports.CurrentCheckpointView=cs,exports.ForwardCheckpointsView=Is,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ds,getSliceComponentProps:o,separator:r,debugIds:u})=>os(P(Te(e,s),(r=>We(t,{...Ke(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>ss(e,qe,e.firstRowId),exports.LocalRowsView=e=>ss(e,fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>os(Ve(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:a,checkpointsById:i,children:x})=>{const c=Ye(G),[I,C]=$e({}),b=Xe(((e,s)=>C((t=>D(t,e)==s?t:{...t,[e]:s}))),[]),w=Xe((e=>C((s=>({...F(s,e)})))),[]);return We(G.Provider,{value:Ze((()=>[e??c[0],{...c[1],...s,...I},t??c[2],{...c[3],...o},r??c[4],{...c[5],...u},l??c[6],{...c[7],...n},d??c[8],{...c[9],...p},a??c[10],{...c[11],...i},b,w]),[e,s,I,t,o,r,u,l,n,d,p,a,i,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=us,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=Ne(N(t),e),p=Pe(e,s,l);return os(L(d)||L(p)?null:We(o,{...Ke(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=ps,exports.ResultRowView=as,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>es(r,He(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>es(e,Be(e.queryId,e.queries)),exports.RowView=us,exports.SliceView=ds,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>_e(r,Le(r.tableId,e,s,t,o,r.store)),exports.TableView=ls,exports.TablesView=({store:e,tableComponent:s=ls,getTableComponentProps:t,separator:o,debugIds:r})=>os(P(ke(e),(o=>We(s,{...Ke(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=ns,exports.ValuesView=({store:e,valueComponent:s=ns,getValueComponentProps:t,separator:o,debugIds:r})=>os(P(me(e),(o=>We(s,{...Ke(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=le,o,r=V,u=le,l=!0)=>{const n=U(o);return _((t=>h(n,(o=>h(s(t,o),(s=>r(o.addRow(m(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=ye,exports.useCellIds=he,exports.useCellIdsListener=(e,s,t,o,r,u)=>ce(w,U(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ce(b,U(l),o,r,[e,s,t],u),exports.useCheckpoint=Oe,exports.useCheckpointIds=Fe,exports.useCheckpointIdsListener=(e,s,t)=>ce("CheckpointIds",Y(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ce("Checkpoint",Y(o),s,t,[e]),exports.useCheckpoints=e=>W(e,10),exports.useCheckpointsIds=()=>z(11),exports.useCheckpointsOrCheckpointsById=Y,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=le)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=le,o,r=le,u,l=le)=>{const[,n]=re(),[d,p]=re();return ee((()=>{const t=e?s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()}),[e,...t,...r]),ee((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=le)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=le,o,r=le)=>{const[u,l]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),ee((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>we(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>we(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>we(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,o)=>we(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ce("DidFinish"+$,U(t),e,s),exports.useGoBackwardCallback=Qe,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>xe(b,U(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ce(n+b,U(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>xe(x,U(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ce(n+x,U(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>xe(p,U(s),4,[e]),exports.useHasTableCell=(e,s,t)=>xe(p+b,U(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ce(n+p+b,U(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ce(n+p,U(r),s,t,[e],o),exports.useHasTables=e=>xe(a,U(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ce(n+a,U(o),e,s,[],t),exports.useHasValue=(e,s)=>xe(R,U(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ce(n+R,U(r),s,t,[e],o),exports.useHasValues=e=>xe(k,U(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ce(n+k,U(o),e,s,[],t),exports.useIndexIds=e=>xe("IndexIds",K(e),1),exports.useIndexes=e=>W(e,4),exports.useIndexesIds=()=>z(5),exports.useIndexesOrIndexesById=K,exports.useLinkedRowIds=qe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ce("Linked"+I,N(r),t,o,[e,s]),exports.useLocalRowIds=fe,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ce("Local"+I,N(r),t,o,[e,s]),exports.useMetric=Ve,exports.useMetricIds=e=>xe("MetricIds",J(e),1),exports.useMetricListener=(e,s,t,o)=>ce("Metric",J(o),s,t,[e]),exports.useMetrics=e=>W(e,2),exports.useMetricsIds=()=>z(3),exports.useMetricsOrMetricsById=J,exports.useProvideStore=(e,s)=>{const{12:t,13:o}=E(G);A((()=>(t?.(e,s),()=>o?.(e))),[t,e,s,o])},exports.useQueries=e=>W(e,8),exports.useQueriesIds=()=>z(9),exports.useQueriesOrQueriesById=X,exports.useQueryIds=e=>xe("QueryIds",X(e),1),exports.useRedoInformation=e=>{const s=Y(e),[,,[o]]=Fe(s);return[!L(o),Ee(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>xe("RelationshipIds",N(e),1),exports.useRelationships=e=>W(e,6),exports.useRelationshipsIds=()=>z(7),exports.useRelationshipsOrRelationshipsById=N,exports.useRemoteRowId=Pe,exports.useRemoteRowIdListener=(e,s,t,o,r)=>ce("RemoteRowId",N(r),t,o,[e,s]),exports.useResultCell=De,exports.useResultCellIds=Me,exports.useResultCellIdsListener=(e,s,t,o,r)=>ce(l+w,X(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ce(l+b,X(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>xe(l+x,X(t),0,[e,s]),exports.useResultRowCount=(e,s)=>xe(l+c,X(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ce(l+c,X(o),s,t,[e]),exports.useResultRowIds=Be,exports.useResultRowIdsListener=(e,s,t,o)=>ce(l+I,X(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ce(l+x,X(r),t,o,[e,s]),exports.useResultSortedRowIds=He,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ce(l+C,X(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>xe(l+p,X(s),0,[e]),exports.useResultTableCellIds=(e,s)=>xe(l+p+w,X(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ce(l+p+w,X(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ce(l+p,X(o),s,t,[e]),exports.useRow=(e,s,t)=>xe(x,U(t),0,[e,s]),exports.useRowCount=(e,s)=>xe(c,U(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ce(c,U(r),s,t,[e],o),exports.useRowIds=ge,exports.useRowIdsListener=(e,s,t,o,r)=>ce(I,U(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ce(x,U(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>Ie(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>Ie(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>Ie(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>Ie(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>Ie(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>Ie(t,a,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>Ie(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>Ie(t,k,e,s,o,r),exports.useSliceIds=Te,exports.useSliceIdsListener=(e,s,t,o)=>ce("SliceIds",K(o),s,t,[e]),exports.useSliceRowIds=ve,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ce("Slice"+I,K(r),t,o,[e,s]),exports.useSortedRowIds=Le,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ce(C,U(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ce("Start"+$,U(t),e,s),exports.useStore=e=>W(e,0),exports.useStoreIds=()=>z(1),exports.useStoreOrStoreById=U,exports.useTable=(e,s)=>xe(p,U(s),0,[e]),exports.useTableCellIds=(e,s)=>xe(p+w,U(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ce(p+w,U(r),s,t,[e],o),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,o)=>ce(i,U(o),e,s,le,t),exports.useTableListener=(e,s,t,o,r)=>ce(p,U(r),s,t,[e],o),exports.useTables=e=>xe(a,U(e),0),exports.useTablesListener=(e,s,t,o)=>ce(a,U(o),e,s,le,t),exports.useUndoInformation=e=>{const s=Y(e),[o,r]=Fe(s);return[(u=o,!(0==S(u))),Qe(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=Se,exports.useValueIds=me,exports.useValueIdsListener=(e,s,t,o)=>ce(g,U(o),e,s,le,t),exports.useValueListener=(e,s,t,o,r)=>ce(R,U(r),s,t,[e],o),exports.useValues=e=>xe(k,U(e),0),exports.useValuesListener=(e,s,t,o)=>ce(k,U(o),e,s,le,t),exports.useWillFinishTransactionListener=(e,s,t)=>ce("WillFinish"+$,U(t),e,s);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",a=p+"s",i=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,L=e=>null==e,h=(e,s,t)=>L(e)?t?.():s(e),y=e=>s(e)==o,m=e=>s(e)==r,S=e=>e.length,V=()=>{},T=(e,s)=>e.every(s),v=(e,s)=>S(e)===S(s)&&T(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),f=Object,q=e=>f.getPrototypeOf(e),B=f.entries,H=e=>!L(e)&&h(q(e),(e=>e==f.prototype||L(q(e))),(()=>!0)),M=f.keys,D=(e,s)=>h(e,(e=>e[s])),F=(e,s)=>(delete e[s],e),O=(e,s)=>{const t=B(e);return S(t)===S(M(s))&&T(t,(([e,t])=>H(t)?!!H(s[e])&&O(s[e],t):s[e]===t))},{createContext:Q,useContext:E,useEffect:A}=e,G=Q([]),W=(e,s)=>{const t=E(G);return L(e)?t[s]:y(e)?D(t[s+1]??{},e):e},j=(e,s)=>{const t=W(e,s);return L(e)||y(e)?t:e},z=e=>M(E(G)[e]??{}),U=e=>j(e,0),J=e=>j(e,2),K=e=>j(e,4),N=e=>j(e,6),X=e=>j(e,8),Y=e=>j(e,10),Z=e=>e.toLowerCase();Z(u);const $="Transaction";Z($);const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:oe,useState:re,useSyncExternalStore:ue}=e,le=[],ne=[{},[],[le,void 0,le],void 0,!1,0],de=[O,v,([e,s,t],[o,r,u])=>s===r&&v(e,o)&&v(t,u)],pe=(e,s)=>e===s,ae=(e,s,t=le)=>{const[,o]=re(),[r,u]=re();return ee((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},ie=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},xe=(e,s,o,r=le)=>{const u=oe(ne[o]),l=_((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ne[o];return(de[o]??pe)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=_((u=>ie(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ue(d,l)},ce=(e,s,t,o=le,r=le,...u)=>te((()=>ie(s,e,...r,t,...u)),[s,e,...r,...o,...u]),Ie=(e,s,t,o=le,r=V,u=le,...l)=>{const n=U(e);return _((e=>h(n,(o=>h(t(e,o),(t=>r(o["set"+s](...P(l,(s=>m(s)?s(e,o):s)),t),t)))))),[n,s,...o,...u,...l])},Ce=(e,s,t=V,o=le,...r)=>{const u=U(e);return _((()=>t(u?.["del"+s](...r))),[u,s,...o,...r])},be=(e,s,t)=>{const o=Y(e);return _((()=>o?.[s](t)),[o,s,t])},we=e=>xe(i,U(e),1),Re=(e,s)=>xe(I,U(s),1,[e]),ke=(e,s,t,o=0,r,u)=>xe(C,U(u),1,[e,s,t,o,r]),ge=(e,s,t)=>xe(w,U(t),1,[e,s]),Le=(e,s,t,o)=>xe(b,U(o),3,[e,s,t]),he=e=>xe(g,U(e),1),ye=(e,s)=>xe(R,U(s),3,[e]),me=(e,s)=>xe("Metric",J(s),3,[e]),Se=(e,s)=>xe("SliceIds",K(s),1,[e]),Ve=(e,s,t)=>xe("Slice"+I,K(t),1,[e,s]),Te=(e,s,t)=>xe("RemoteRowId",N(t),3,[e,s]),ve=(e,s,t)=>xe("Local"+I,N(t),1,[e,s]),Pe=(e,s,t)=>xe("Linked"+I,N(t),1,[e,s]),fe=(e,s)=>xe(l+I,X(s),1,[e]),qe=(e,s,t,o=0,r,u)=>xe(l+C,X(u),1,[e,s,t,o,r]),Be=(e,s,t)=>xe(l+w,X(t),1,[e,s]),He=(e,s,t,o)=>xe(l+b,X(o),3,[e,s,t]),Me=e=>xe("CheckpointIds",Y(e),2),De=(e,s)=>xe("Checkpoint",Y(s),3,[e]),Fe=e=>be(e,"goBackward"),Oe=e=>be(e,"goForward"),{PureComponent:Qe,Fragment:Ee,createElement:Ae,useCallback:Ge,useLayoutEffect:We,useRef:je,useState:ze}=e,Ue=(e,...s)=>L(e)?{}:e(...s),Je=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:Ke,useContext:Ne,useMemo:Xe,useState:Ye}=e,Ze=({tableId:e,store:s,rowComponent:t=os,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>ss(P(n,(u=>Ae(t,{...Ue(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),$e=({queryId:e,queries:s,resultRowComponent:t=ds,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>ss(P(l,(r=>Ae(t,{...Ue(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),_e=({relationshipId:e,relationships:s,rowComponent:t=os,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,a]=Je(N(s),e),i=l(e,n,d);return ss(P(i,(e=>Ae(t,{...Ue(o,e),key:e,tableId:a,rowId:e,store:p,debugIds:u}))),r,u,n)},es=e=>({checkpoints:s,checkpointComponent:t=ps,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=Y(s);return ss(P(e(Me(l)),(e=>Ae(t,{...Ue(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},ss=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},ts=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>ss(t+(Le(e,s,o,r)??t),void 0,u,o),os=({tableId:e,rowId:s,store:t,cellComponent:o=ts,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>ss(P(((e,s,t,o)=>{const r=ge(s,t,o);return e??r})(u,e,s,t),(u=>Ae(o,{...Ue(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),rs=e=>Ze(e,Re(e.tableId,e.store)),us=({valueId:e,store:s,debugIds:o})=>ss(t+(ye(e,s)??t),void 0,o,e),ls=({indexId:e,sliceId:s,indexes:t,rowComponent:o=os,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(K(t),e),a=Ve(e,s,n);return ss(P(a,(e=>Ae(o,{...Ue(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},ns=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>ss(t+(He(e,s,o,r)??t),void 0,u,o),ds=({queryId:e,rowId:s,queries:t,resultCellComponent:o=ns,getResultCellComponentProps:r,separator:u,debugIds:l})=>ss(P(Be(e,s,t),(u=>Ae(o,{...Ue(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),ps=({checkpoints:e,checkpointId:s,debugIds:o})=>ss(De(s,e)??t,void 0,o,s),as=es((e=>e[0])),is=es((e=>L(e[1])?[]:[e[1]])),xs=es((e=>e[2]));exports.BackwardCheckpointsView=as,exports.CellView=ts,exports.CheckpointView=ps,exports.CurrentCheckpointView=is,exports.ForwardCheckpointsView=xs,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ls,getSliceComponentProps:o,separator:r,debugIds:u})=>ss(P(Se(e,s),(r=>Ae(t,{...Ue(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>_e(e,Pe,e.firstRowId),exports.LocalRowsView=e=>_e(e,ve,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>ss(me(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:a,checkpointsById:i,children:x})=>{const c=Ne(G),[I,C]=Ye({}),b=Ke(((e,s)=>C((t=>D(t,e)==s?t:{...t,[e]:s}))),[]),w=Ke((e=>C((s=>({...F(s,e)})))),[]);return Ae(G.Provider,{value:Xe((()=>[e??c[0],{...c[1],...s,...I},t??c[2],{...c[3],...o},r??c[4],{...c[5],...u},l??c[6],{...c[7],...n},d??c[8],{...c[9],...p},a??c[10],{...c[11],...i},b,w]),[e,s,I,t,o,r,u,l,n,d,p,a,i,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=os,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=Je(N(t),e),p=Te(e,s,l);return ss(L(d)||L(p)?null:Ae(o,{...Ue(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=ns,exports.ResultRowView=ds,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>$e(r,qe(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>$e(e,fe(e.queryId,e.queries)),exports.RowView=os,exports.SliceView=ls,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>Ze(r,ke(r.tableId,e,s,t,o,r.store)),exports.TableView=rs,exports.TablesView=({store:e,tableComponent:s=rs,getTableComponentProps:t,separator:o,debugIds:r})=>ss(P(we(e),(o=>Ae(s,{...Ue(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=us,exports.ValuesView=({store:e,valueComponent:s=us,getValueComponentProps:t,separator:o,debugIds:r})=>ss(P(he(e),(o=>Ae(s,{...Ue(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=le,o,r=V,u=le,l=!0)=>{const n=U(o);return _((t=>h(n,(o=>h(s(t,o),(s=>r(o.addRow(m(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=Le,exports.useCellIds=ge,exports.useCellIdsListener=(e,s,t,o,r,u)=>ce(w,U(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ce(b,U(l),o,r,[e,s,t],u),exports.useCheckpoint=De,exports.useCheckpointIds=Me,exports.useCheckpointIdsListener=(e,s,t)=>ce("CheckpointIds",Y(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ce("Checkpoint",Y(o),s,t,[e]),exports.useCheckpoints=e=>W(e,10),exports.useCheckpointsIds=()=>z(11),exports.useCheckpointsOrCheckpointsById=Y,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=le)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=le,o,r=le,u,l=le)=>{const[,n]=re(),[d,p]=re();return ee((()=>{const t=e?s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()}),[e,...t,...r]),ee((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=le)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=le,o,r=le)=>{const[u,l]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),ee((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>Ce(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>Ce(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>Ce(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>Ce(e,a,s,t),exports.useDelValueCallback=(e,s,t,o)=>Ce(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>Ce(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ce("DidFinish"+$,U(t),e,s),exports.useGoBackwardCallback=Fe,exports.useGoForwardCallback=Oe,exports.useGoToCallback=(e,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>xe(b,U(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ce(n+b,U(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>xe(x,U(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ce(n+x,U(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>xe(p,U(s),4,[e]),exports.useHasTableCell=(e,s,t)=>xe(p+b,U(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ce(n+p+b,U(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ce(n+p,U(r),s,t,[e],o),exports.useHasTables=e=>xe(a,U(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ce(n+a,U(o),e,s,[],t),exports.useHasValue=(e,s)=>xe(R,U(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ce(n+R,U(r),s,t,[e],o),exports.useHasValues=e=>xe(k,U(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ce(n+k,U(o),e,s,[],t),exports.useIndexIds=e=>xe("IndexIds",K(e),1),exports.useIndexes=e=>W(e,4),exports.useIndexesIds=()=>z(5),exports.useIndexesOrIndexesById=K,exports.useLinkedRowIds=Pe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ce("Linked"+I,N(r),t,o,[e,s]),exports.useLocalRowIds=ve,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ce("Local"+I,N(r),t,o,[e,s]),exports.useMetric=me,exports.useMetricIds=e=>xe("MetricIds",J(e),1),exports.useMetricListener=(e,s,t,o)=>ce("Metric",J(o),s,t,[e]),exports.useMetrics=e=>W(e,2),exports.useMetricsIds=()=>z(3),exports.useMetricsOrMetricsById=J,exports.useProvideStore=(e,s)=>{const{12:t,13:o}=E(G);A((()=>(t?.(e,s),()=>o?.(e))),[t,e,s,o])},exports.useQueries=e=>W(e,8),exports.useQueriesIds=()=>z(9),exports.useQueriesOrQueriesById=X,exports.useQueryIds=e=>xe("QueryIds",X(e),1),exports.useRedoInformation=e=>{const s=Y(e),[,,[o]]=Me(s);return[!L(o),Oe(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>xe("RelationshipIds",N(e),1),exports.useRelationships=e=>W(e,6),exports.useRelationshipsIds=()=>z(7),exports.useRelationshipsOrRelationshipsById=N,exports.useRemoteRowId=Te,exports.useRemoteRowIdListener=(e,s,t,o,r)=>ce("RemoteRowId",N(r),t,o,[e,s]),exports.useResultCell=He,exports.useResultCellIds=Be,exports.useResultCellIdsListener=(e,s,t,o,r)=>ce(l+w,X(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ce(l+b,X(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>xe(l+x,X(t),0,[e,s]),exports.useResultRowCount=(e,s)=>xe(l+c,X(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ce(l+c,X(o),s,t,[e]),exports.useResultRowIds=fe,exports.useResultRowIdsListener=(e,s,t,o)=>ce(l+I,X(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ce(l+x,X(r),t,o,[e,s]),exports.useResultSortedRowIds=qe,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ce(l+C,X(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>xe(l+p,X(s),0,[e]),exports.useResultTableCellIds=(e,s)=>xe(l+p+w,X(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ce(l+p+w,X(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ce(l+p,X(o),s,t,[e]),exports.useRow=(e,s,t)=>xe(x,U(t),0,[e,s]),exports.useRowCount=(e,s)=>xe(c,U(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ce(c,U(r),s,t,[e],o),exports.useRowIds=Re,exports.useRowIdsListener=(e,s,t,o,r)=>ce(I,U(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ce(x,U(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>Ie(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>Ie(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>Ie(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>Ie(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>Ie(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>Ie(t,a,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>Ie(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>Ie(t,k,e,s,o,r),exports.useSliceIds=Se,exports.useSliceIdsListener=(e,s,t,o)=>ce("SliceIds",K(o),s,t,[e]),exports.useSliceRowIds=Ve,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ce("Slice"+I,K(r),t,o,[e,s]),exports.useSortedRowIds=ke,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ce(C,U(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ce("Start"+$,U(t),e,s),exports.useStore=e=>W(e,0),exports.useStoreIds=()=>z(1),exports.useStoreOrStoreById=U,exports.useTable=(e,s)=>xe(p,U(s),0,[e]),exports.useTableCellIds=(e,s)=>xe(p+w,U(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ce(p+w,U(r),s,t,[e],o),exports.useTableIds=we,exports.useTableIdsListener=(e,s,t,o)=>ce(i,U(o),e,s,le,t),exports.useTableListener=(e,s,t,o,r)=>ce(p,U(r),s,t,[e],o),exports.useTables=e=>xe(a,U(e),0),exports.useTablesListener=(e,s,t,o)=>ce(a,U(o),e,s,le,t),exports.useUndoInformation=e=>{const s=Y(e),[o,r]=Me(s);return[(u=o,!(0==S(u))),Fe(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=ye,exports.useValueIds=he,exports.useValueIdsListener=(e,s,t,o)=>ce(g,U(o),e,s,le,t),exports.useValueListener=(e,s,t,o,r)=>ce(R,U(r),s,t,[e],o),exports.useValues=e=>xe(k,U(e),0),exports.useValuesListener=(e,s,t,o)=>ce(k,U(o),e,s,le,t),exports.useWillFinishTransactionListener=(e,s,t)=>ce("WillFinish"+$,U(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r=s(s),u="Listener",l="Result",n="Has",d="Ids",p="Table",a=p+"s",i=p+d,x="Row",c=x+"Count",I=x+d,C="Sorted"+x+d,b="Cell",w=b+d,R="Value",k=R+"s",g=R+d,L=e=>null==e,h=(e,s,t)=>L(e)?t?.():s(e),y=e=>s(e)==o,m=e=>s(e)==r,S=e=>e.length,V=()=>{},T=(e,s)=>e.every(s),v=(e,s)=>S(e)===S(s)&&T(e,((e,t)=>s[t]===e)),P=(e,s)=>e.map(s),f=Object,q=e=>f.getPrototypeOf(e),B=f.entries,H=e=>!L(e)&&h(q(e),(e=>e==f.prototype||L(q(e))),(()=>!0)),M=f.keys,D=(e,s)=>h(e,(e=>e[s])),F=(e,s)=>(delete e[s],e),O=(e,s)=>{const t=B(e);return S(t)===S(M(s))&&T(t,(([e,t])=>H(t)?!!H(s[e])&&O(s[e],t):s[e]===t))},{createContext:Q,useContext:E,useEffect:A}=e,G=Q([]),W=(e,s)=>{const t=E(G);return L(e)?t[s]:y(e)?D(t[s+1]??{},e):e},j=(e,s)=>{const t=W(e,s);return L(e)||y(e)?t:e},z=e=>M(E(G)[e]??{}),U=e=>j(e,0),J=e=>j(e,2),K=e=>j(e,4),N=e=>j(e,6),X=e=>j(e,8),Y=e=>j(e,10),Z=e=>e.toLowerCase();Z(u);const $="Transaction";Z($);const{useCallback:_,useEffect:ee,useMemo:se,useLayoutEffect:te,useRef:oe,useState:re,useSyncExternalStore:ue}=e,le=[],ne=[{},[],[le,void 0,le],void 0,!1,0],de=[O,v,([e,s,t],[o,r,u])=>s===r&&v(e,o)&&v(t,u)],pe=(e,s)=>e===s,ae=(e,s,t=le)=>{const[,o]=re(),[r,u]=re();return ee((()=>{const t=e?s(e):void 0;return u(t),o([]),t?.destroy}),[e,...t]),r},ie=(e,s,...t)=>{const o=e?.["add"+s+u]?.(...t);return()=>e?.delListener(o)},xe=(e,s,o,r=le)=>{const u=oe(ne[o]),l=_((()=>{const t=s?.[(4==o?"has":"get")+e]?.(...r)??ne[o];return(de[o]??pe)(t,u.current)?u.current:u.current=t}),[s,o,e,...r]),d=_((u=>ie(s,(4==o?n:t)+e,...r,u)),[s,o,e,...r]);return ue(d,l)},ce=(e,s,t,o=le,r=le,...u)=>te((()=>ie(s,e,...r,t,...u)),[s,e,...r,...o,...u]),Ie=(e,s,t,o=le,r=V,u=le,...l)=>{const n=U(e);return _((e=>h(n,(o=>h(t(e,o),(t=>r(o["set"+s](...Ce(l,o,e),t),t)))))),[n,s,...o,...u,...be(l)])},Ce=(e,s,t)=>P(e,(e=>m(e)?e(t,s):e)),be=e=>{return s=e=>!m(e),e.filter(s);var s},we=(e,s,t=V,o=le,...r)=>{const u=U(e);return _((e=>t(u?.["del"+s](...Ce(r,u,e)))),[u,s,...o,...be(r)])},Re=(e,s,t)=>{const o=Y(e);return _((()=>o?.[s](t)),[o,s,t])},ke=e=>xe(i,U(e),1),ge=(e,s)=>xe(I,U(s),1,[e]),Le=(e,s,t,o=0,r,u)=>xe(C,U(u),1,[e,s,t,o,r]),he=(e,s,t)=>xe(w,U(t),1,[e,s]),ye=(e,s,t,o)=>xe(b,U(o),3,[e,s,t]),me=e=>xe(g,U(e),1),Se=(e,s)=>xe(R,U(s),3,[e]),Ve=(e,s)=>xe("Metric",J(s),3,[e]),Te=(e,s)=>xe("SliceIds",K(s),1,[e]),ve=(e,s,t)=>xe("Slice"+I,K(t),1,[e,s]),Pe=(e,s,t)=>xe("RemoteRowId",N(t),3,[e,s]),fe=(e,s,t)=>xe("Local"+I,N(t),1,[e,s]),qe=(e,s,t)=>xe("Linked"+I,N(t),1,[e,s]),Be=(e,s)=>xe(l+I,X(s),1,[e]),He=(e,s,t,o=0,r,u)=>xe(l+C,X(u),1,[e,s,t,o,r]),Me=(e,s,t)=>xe(l+w,X(t),1,[e,s]),De=(e,s,t,o)=>xe(l+b,X(o),3,[e,s,t]),Fe=e=>xe("CheckpointIds",Y(e),2),Oe=(e,s)=>xe("Checkpoint",Y(s),3,[e]),Qe=e=>Re(e,"goBackward"),Ee=e=>Re(e,"goForward"),{PureComponent:Ae,Fragment:Ge,createElement:We,useCallback:je,useLayoutEffect:ze,useRef:Ue,useState:Je}=e,Ke=(e,...s)=>L(e)?{}:e(...s),Ne=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:Xe,useContext:Ye,useMemo:Ze,useState:$e}=e,_e=({tableId:e,store:s,rowComponent:t=us,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},n)=>os(P(n,(u=>We(t,{...Ke(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),es=({queryId:e,queries:s,resultRowComponent:t=as,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>os(P(l,(r=>We(t,{...Ke(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),ss=({relationshipId:e,relationships:s,rowComponent:t=us,getRowComponentProps:o,separator:r,debugIds:u},l,n)=>{const[d,p,a]=Ne(N(s),e),i=l(e,n,d);return os(P(i,(e=>We(t,{...Ke(o,e),key:e,tableId:a,rowId:e,store:p,debugIds:u}))),r,u,n)},ts=e=>({checkpoints:s,checkpointComponent:t=is,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=Y(s);return os(P(e(Fe(l)),(e=>We(t,{...Ke(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},os=(e,s,t,o)=>{const r=L(s)||!Array.isArray(e)?e:P(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},rs=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>os(t+(ye(e,s,o,r)??t),void 0,u,o),us=({tableId:e,rowId:s,store:t,cellComponent:o=rs,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:n})=>os(P(((e,s,t,o)=>{const r=he(s,t,o);return e??r})(u,e,s,t),(u=>We(o,{...Ke(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:n}))),l,n,s),ls=e=>_e(e,ge(e.tableId,e.store)),ns=({valueId:e,store:s,debugIds:o})=>os(t+(Se(e,s)??t),void 0,o,e),ds=({indexId:e,sliceId:s,indexes:t,rowComponent:o=us,getRowComponentProps:r,separator:u,debugIds:l})=>{const[n,d,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(K(t),e),a=ve(e,s,n);return os(P(a,(e=>We(o,{...Ke(r,e),key:e,tableId:p,rowId:e,store:d,debugIds:l}))),u,l,s)},ps=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>os(t+(De(e,s,o,r)??t),void 0,u,o),as=({queryId:e,rowId:s,queries:t,resultCellComponent:o=ps,getResultCellComponentProps:r,separator:u,debugIds:l})=>os(P(Me(e,s,t),(u=>We(o,{...Ke(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),is=({checkpoints:e,checkpointId:s,debugIds:o})=>os(Oe(s,e)??t,void 0,o,s),xs=ts((e=>e[0])),cs=ts((e=>L(e[1])?[]:[e[1]])),Is=ts((e=>e[2]));exports.BackwardCheckpointsView=xs,exports.CellView=rs,exports.CheckpointView=is,exports.CurrentCheckpointView=cs,exports.ForwardCheckpointsView=Is,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ds,getSliceComponentProps:o,separator:r,debugIds:u})=>os(P(Te(e,s),(r=>We(t,{...Ke(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>ss(e,qe,e.firstRowId),exports.LocalRowsView=e=>ss(e,fe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>os(Ve(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:n,queries:d,queriesById:p,checkpoints:a,checkpointsById:i,children:x})=>{const c=Ye(G),[I,C]=$e({}),b=Xe(((e,s)=>C((t=>D(t,e)==s?t:{...t,[e]:s}))),[]),w=Xe((e=>C((s=>({...F(s,e)})))),[]);return We(G.Provider,{value:Ze((()=>[e??c[0],{...c[1],...s,...I},t??c[2],{...c[3],...o},r??c[4],{...c[5],...u},l??c[6],{...c[7],...n},d??c[8],{...c[9],...p},a??c[10],{...c[11],...i},b,w]),[e,s,I,t,o,r,u,l,n,d,p,a,i,c,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=us,getRowComponentProps:r,debugIds:u})=>{const[l,n,,d]=Ne(N(t),e),p=Pe(e,s,l);return os(L(d)||L(p)?null:We(o,{...Ke(r,p),key:p,tableId:d,rowId:p,store:n,debugIds:u}),void 0,u,s)},exports.ResultCellView=ps,exports.ResultRowView=as,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>es(r,He(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>es(e,Be(e.queryId,e.queries)),exports.RowView=us,exports.SliceView=ds,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>_e(r,Le(r.tableId,e,s,t,o,r.store)),exports.TableView=ls,exports.TablesView=({store:e,tableComponent:s=ls,getTableComponentProps:t,separator:o,debugIds:r})=>os(P(ke(e),(o=>We(s,{...Ke(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=ns,exports.ValuesView=({store:e,valueComponent:s=ns,getValueComponentProps:t,separator:o,debugIds:r})=>os(P(me(e),(o=>We(s,{...Ke(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=le,o,r=V,u=le,l=!0)=>{const n=U(o);return _((t=>h(n,(o=>h(s(t,o),(s=>r(o.addRow(m(e)?e(t,o):e,s,l),o,s)))))),[n,e,...t,...u,l])},exports.useCell=ye,exports.useCellIds=he,exports.useCellIdsListener=(e,s,t,o,r,u)=>ce(w,U(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>ce(b,U(l),o,r,[e,s,t],u),exports.useCheckpoint=Oe,exports.useCheckpointIds=Fe,exports.useCheckpointIdsListener=(e,s,t)=>ce("CheckpointIds",Y(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>ce("Checkpoint",Y(o),s,t,[e]),exports.useCheckpoints=e=>W(e,10),exports.useCheckpointsIds=()=>z(11),exports.useCheckpointsOrCheckpointsById=Y,exports.useCreateCheckpoints=(e,s,t)=>ae(e,s,t),exports.useCreateIndexes=(e,s,t)=>ae(e,s,t),exports.useCreateMergeableStore=(e,s=le)=>se(e,s),exports.useCreateMetrics=(e,s,t)=>ae(e,s,t),exports.useCreatePersister=(e,s,t=le,o,r=le,u,l=le)=>{const[,n]=re(),[d,p]=re();return ee((()=>{const t=e?s(e):void 0;p(t),t&&o&&(async()=>{await o(t),n([])})()}),[e,...t,...r]),ee((()=>()=>{d&&(d.destroy(),u?.(d))}),[d,...l]),d},exports.useCreateQueries=(e,s,t)=>ae(e,s,t),exports.useCreateRelationships=(e,s,t)=>ae(e,s,t),exports.useCreateStore=(e,s=le)=>se(e,s),exports.useCreateSynchronizer=(e,s,t=le,o,r=le)=>{const[u,l]=re();return ee((()=>{(async()=>{const t=e?await s(e):void 0;l(t)})()}),[e,...t]),ee((()=>()=>{u&&(u.destroy(),o?.(u))}),[u,...r]),u},exports.useDelCellCallback=(e,s,t,o,r,u,l)=>we(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>we(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>we(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>we(e,a,s,t),exports.useDelValueCallback=(e,s,t,o)=>we(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>we(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ce("DidFinish"+$,U(t),e,s),exports.useGoBackwardCallback=Qe,exports.useGoForwardCallback=Ee,exports.useGoToCallback=(e,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>xe(b,U(o),4,[e,s,t]),exports.useHasCellListener=(e,s,t,o,r,u,l)=>ce(n+b,U(l),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>xe(x,U(t),4,[e,s]),exports.useHasRowListener=(e,s,t,o,r,u)=>ce(n+x,U(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>xe(p,U(s),4,[e]),exports.useHasTableCell=(e,s,t)=>xe(p+b,U(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,o,r,u)=>ce(n+p+b,U(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>ce(n+p,U(r),s,t,[e],o),exports.useHasTables=e=>xe(a,U(e),4,[]),exports.useHasTablesListener=(e,s,t,o)=>ce(n+a,U(o),e,s,[],t),exports.useHasValue=(e,s)=>xe(R,U(s),4,[e]),exports.useHasValueListener=(e,s,t,o,r)=>ce(n+R,U(r),s,t,[e],o),exports.useHasValues=e=>xe(k,U(e),4,[]),exports.useHasValuesListener=(e,s,t,o)=>ce(n+k,U(o),e,s,[],t),exports.useIndexIds=e=>xe("IndexIds",K(e),1),exports.useIndexes=e=>W(e,4),exports.useIndexesIds=()=>z(5),exports.useIndexesOrIndexesById=K,exports.useLinkedRowIds=qe,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>ce("Linked"+I,N(r),t,o,[e,s]),exports.useLocalRowIds=fe,exports.useLocalRowIdsListener=(e,s,t,o,r)=>ce("Local"+I,N(r),t,o,[e,s]),exports.useMetric=Ve,exports.useMetricIds=e=>xe("MetricIds",J(e),1),exports.useMetricListener=(e,s,t,o)=>ce("Metric",J(o),s,t,[e]),exports.useMetrics=e=>W(e,2),exports.useMetricsIds=()=>z(3),exports.useMetricsOrMetricsById=J,exports.useProvideStore=(e,s)=>{const{12:t,13:o}=E(G);A((()=>(t?.(e,s),()=>o?.(e))),[t,e,s,o])},exports.useQueries=e=>W(e,8),exports.useQueriesIds=()=>z(9),exports.useQueriesOrQueriesById=X,exports.useQueryIds=e=>xe("QueryIds",X(e),1),exports.useRedoInformation=e=>{const s=Y(e),[,,[o]]=Fe(s);return[!L(o),Ee(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>xe("RelationshipIds",N(e),1),exports.useRelationships=e=>W(e,6),exports.useRelationshipsIds=()=>z(7),exports.useRelationshipsOrRelationshipsById=N,exports.useRemoteRowId=Pe,exports.useRemoteRowIdListener=(e,s,t,o,r)=>ce("RemoteRowId",N(r),t,o,[e,s]),exports.useResultCell=De,exports.useResultCellIds=Me,exports.useResultCellIdsListener=(e,s,t,o,r)=>ce(l+w,X(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,u)=>ce(l+b,X(u),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>xe(l+x,X(t),0,[e,s]),exports.useResultRowCount=(e,s)=>xe(l+c,X(s),5,[e]),exports.useResultRowCountListener=(e,s,t,o)=>ce(l+c,X(o),s,t,[e]),exports.useResultRowIds=Be,exports.useResultRowIdsListener=(e,s,t,o)=>ce(l+I,X(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>ce(l+x,X(r),t,o,[e,s]),exports.useResultSortedRowIds=He,exports.useResultSortedRowIdsListener=(e,s,t,o,r,u,n,d)=>ce(l+C,X(d),u,n,[e,s,t,o,r]),exports.useResultTable=(e,s)=>xe(l+p,X(s),0,[e]),exports.useResultTableCellIds=(e,s)=>xe(l+p+w,X(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>ce(l+p+w,X(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>ce(l+p,X(o),s,t,[e]),exports.useRow=(e,s,t)=>xe(x,U(t),0,[e,s]),exports.useRowCount=(e,s)=>xe(c,U(s),5,[e]),exports.useRowCountListener=(e,s,t,o,r)=>ce(c,U(r),s,t,[e],o),exports.useRowIds=ge,exports.useRowIdsListener=(e,s,t,o,r)=>ce(I,U(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>ce(x,U(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,n)=>Ie(u,b,o,r,l,n,e,s,t),exports.useSetCheckpointCallback=(e=V,s=le,t,o=V,r=le)=>{const u=Y(t);return _((s=>h(u,(t=>{const r=e(s);o(t.addCheckpoint(r),t,r)}))),[u,...s,...r])},exports.useSetPartialRowCallback=(e,s,t,o,r,u,l)=>Ie(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>Ie(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>Ie(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>Ie(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>Ie(t,a,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>Ie(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>Ie(t,k,e,s,o,r),exports.useSliceIds=Te,exports.useSliceIdsListener=(e,s,t,o)=>ce("SliceIds",K(o),s,t,[e]),exports.useSliceRowIds=ve,exports.useSliceRowIdsListener=(e,s,t,o,r)=>ce("Slice"+I,K(r),t,o,[e,s]),exports.useSortedRowIds=Le,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,n,d)=>ce(C,U(d),u,l,[e,s,t,o,r],n),exports.useStartTransactionListener=(e,s,t)=>ce("Start"+$,U(t),e,s),exports.useStore=e=>W(e,0),exports.useStoreIds=()=>z(1),exports.useStoreOrStoreById=U,exports.useTable=(e,s)=>xe(p,U(s),0,[e]),exports.useTableCellIds=(e,s)=>xe(p+w,U(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>ce(p+w,U(r),s,t,[e],o),exports.useTableIds=ke,exports.useTableIdsListener=(e,s,t,o)=>ce(i,U(o),e,s,le,t),exports.useTableListener=(e,s,t,o,r)=>ce(p,U(r),s,t,[e],o),exports.useTables=e=>xe(a,U(e),0),exports.useTablesListener=(e,s,t,o)=>ce(a,U(o),e,s,le,t),exports.useUndoInformation=e=>{const s=Y(e),[o,r]=Fe(s);return[(u=o,!(0==S(u))),Qe(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=Se,exports.useValueIds=me,exports.useValueIdsListener=(e,s,t,o)=>ce(g,U(o),e,s,le,t),exports.useValueListener=(e,s,t,o,r)=>ce(R,U(r),s,t,[e],o),exports.useValues=e=>xe(k,U(e),0),exports.useValuesListener=(e,s,t,o)=>ce(k,U(o),e,s,le,t),exports.useWillFinishTransactionListener=(e,s,t)=>ce("WillFinish"+$,U(t),e,s);
|
|
Binary file
|
|
@@ -175,9 +175,9 @@ const createWsServer = (webSocketServer) => {
|
|
|
175
175
|
const clients = mapEnsure(clientsByPath, pathId, mapNew);
|
|
176
176
|
mapSet(clients, clientId, webSocket);
|
|
177
177
|
if (clients.size == 1) {
|
|
178
|
-
callListeners(pathIdListeners, void 0,
|
|
178
|
+
callListeners(pathIdListeners, void 0, pathId, 1);
|
|
179
179
|
}
|
|
180
|
-
callListeners(clientIdListeners, [pathId],
|
|
180
|
+
callListeners(clientIdListeners, [pathId], clientId, 1);
|
|
181
181
|
webSocket.on('message', (data) => {
|
|
182
182
|
const payload = data.toString(UTF8);
|
|
183
183
|
const splitAt = payload.indexOf(MESSAGE_SEPARATOR);
|
|
@@ -199,10 +199,10 @@ const createWsServer = (webSocketServer) => {
|
|
|
199
199
|
});
|
|
200
200
|
webSocket.on('close', () => {
|
|
201
201
|
collDel(clients, clientId);
|
|
202
|
-
callListeners(clientIdListeners, [pathId],
|
|
202
|
+
callListeners(clientIdListeners, [pathId], clientId, -1);
|
|
203
203
|
if (collIsEmpty(clients)) {
|
|
204
204
|
collDel(clientsByPath, pathId);
|
|
205
|
-
callListeners(pathIdListeners, void 0,
|
|
205
|
+
callListeners(pathIdListeners, void 0, pathId, -1);
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
}),
|
|
@@ -175,9 +175,9 @@ const createWsServer = (webSocketServer) => {
|
|
|
175
175
|
const clients = mapEnsure(clientsByPath, pathId, mapNew);
|
|
176
176
|
mapSet(clients, clientId, webSocket);
|
|
177
177
|
if (clients.size == 1) {
|
|
178
|
-
callListeners(pathIdListeners, void 0,
|
|
178
|
+
callListeners(pathIdListeners, void 0, pathId, 1);
|
|
179
179
|
}
|
|
180
|
-
callListeners(clientIdListeners, [pathId],
|
|
180
|
+
callListeners(clientIdListeners, [pathId], clientId, 1);
|
|
181
181
|
webSocket.on('message', (data) => {
|
|
182
182
|
const payload = data.toString(UTF8);
|
|
183
183
|
const splitAt = payload.indexOf(MESSAGE_SEPARATOR);
|
|
@@ -199,10 +199,10 @@ const createWsServer = (webSocketServer) => {
|
|
|
199
199
|
});
|
|
200
200
|
webSocket.on('close', () => {
|
|
201
201
|
collDel(clients, clientId);
|
|
202
|
-
callListeners(clientIdListeners, [pathId],
|
|
202
|
+
callListeners(clientIdListeners, [pathId], clientId, -1);
|
|
203
203
|
if (collIsEmpty(clients)) {
|
|
204
204
|
collDel(clientsByPath, pathId);
|
|
205
|
-
callListeners(pathIdListeners, void 0,
|
|
205
|
+
callListeners(pathIdListeners, void 0, pathId, -1);
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
}),
|