tinybase 4.4.1 → 4.4.2

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.
@@ -1 +1 @@
1
- "use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r="Listener",u="Result",l="Has",d="has",n="Ids",p="Table",i=p+"s",a=p+n,x="Row",I=x+"Count",c=x+n,C="Sorted"+x+n,b="Cell",w=b+n,R="Value",k=R+"s",L=R+n,g=e=>null==e,h=(e,s,t)=>g(e)?t?.():s(e),m=e=>s(e)==o,y=()=>{},V=(e,s)=>e.map(s),T=Object.keys,{createContext:S,useContext:v}=e,P=S([]),q=(e,s)=>{const t=v(P);return g(e)?t[s]:m(e)?((e,s)=>h(e,(e=>e[s])))(t[s+1]??{},e):e},f=(e,s)=>{const t=q(e,s);return g(e)||m(e)?t:e},B=e=>T(v(P)[e]??{}),H=e=>f(e,0),M=e=>f(e,2),D=e=>f(e,4),F=e=>f(e,6),O=e=>f(e,8),Q=e=>f(e,10),E=e=>e.toLowerCase();E(r);const A="Transaction";E(A);const{useCallback:G,useEffect:W,useMemo:j,useLayoutEffect:U,useRef:z,useState:J}=e,K=[],N={},X=[[],void 0,[]],Y=(e,s,t=K)=>{const o=j((()=>s(e)),[e,...t]);return W((()=>()=>o.destroy()),[o]),o},Z=(e,s,t,o=K,r,u="get",l="")=>{const[,d]=J(),n=G((()=>s?.[u+e]?.(...o)??t),[s,e,...o,t]),p=z();return j((()=>p.current=n()),[n]),$(l+e,s,((...e)=>{p.current=g(r)?n():e[r],d([])}),[n,r],o),p.current},$=(e,s,t,o=K,u=K,...l)=>U((()=>{const o=s?.["add"+e+r]?.(...u,t,...l);return()=>s?.delListener(o)}),[s,e,...u,...o,...l]),_=(e,s,t,o=K,r=y,u=K,...l)=>{const d=H(e);return G((e=>h(d,(o=>h(t(e,o),(e=>r(o["set"+s](...l,e),e)))))),[d,s,...o,...u,...l])},ee=(e,s,t=y,o=K,...r)=>{const u=H(e);return G((()=>t(u?.["del"+s](...r))),[u,s,...o,...r])},se=(e,s,t)=>{const o=Q(e);return G((()=>o?.[s](t)),[o,s,t])},te=e=>Z(a,H(e),K),oe=(e,s)=>Z(c,H(s),K,[e]),re=(e,s,t,o=0,r,u)=>Z(C,H(u),K,[e,s,t,o,r],6),ue=(e,s,t)=>Z(w,H(t),K,[e,s]),le=(e,s,t,o)=>Z(b,H(o),void 0,[e,s,t],4),de=e=>Z(L,H(e),K),ne=(e,s)=>Z(R,H(s),void 0,[e]),pe=(e,s)=>Z("Metric",M(s),void 0,[e]),ie=(e,s)=>Z("SliceIds",D(s),K,[e]),ae=(e,s,t)=>Z("Slice"+c,D(t),K,[e,s]),xe=(e,s,t)=>Z("RemoteRowId",F(t),void 0,[e,s]),Ie=(e,s,t)=>Z("Local"+c,F(t),K,[e,s]),ce=(e,s,t)=>Z("Linked"+c,F(t),K,[e,s]),Ce=(e,s)=>Z(u+c,O(s),K,[e]),be=(e,s,t,o=0,r,l)=>Z(u+C,O(l),K,[e,s,t,o,r],6),we=(e,s,t)=>Z(u+w,O(t),K,[e,s]),Re=(e,s,t,o)=>Z(u+b,O(o),void 0,[e,s,t]),ke=e=>Z("CheckpointIds",Q(e),X),Le=(e,s)=>Z("Checkpoint",Q(s),void 0,[e]),ge=e=>se(e,"goBackward"),he=e=>se(e,"goForward"),{PureComponent:me,Fragment:ye,createElement:Ve,useCallback:Te,useLayoutEffect:Se,useRef:ve,useState:Pe}=e,qe=(e,...s)=>g(e)?{}:e(...s),fe=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useMemo:Be}=e,He=({tableId:e,store:s,rowComponent:t=Ee,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},d)=>Oe(V(d,(u=>Ve(t,{...qe(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),Me=({queryId:e,queries:s,resultRowComponent:t=Ue,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>Oe(V(l,(r=>Ve(t,{...qe(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),De=({relationshipId:e,relationships:s,rowComponent:t=Ee,getRowComponentProps:o,separator:r,debugIds:u},l,d)=>{const[n,p,i]=fe(F(s),e),a=l(e,d,n);return Oe(V(a,(e=>Ve(t,{...qe(o,e),key:e,tableId:i,rowId:e,store:p,debugIds:u}))),r,u,d)},Fe=e=>({checkpoints:s,checkpointComponent:t=ze,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=Q(s);return Oe(V(e(ke(l)),(e=>Ve(t,{...qe(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},Oe=(e,s,t,o)=>{const r=g(s)||!Array.isArray(e)?e:V(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},Qe=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>Oe(t+(le(e,s,o,r)??t),void 0,u,o),Ee=({tableId:e,rowId:s,store:t,cellComponent:o=Qe,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:d})=>Oe(V(((e,s,t,o)=>{const r=ue(s,t,o);return e??r})(u,e,s,t),(u=>Ve(o,{...qe(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:d}))),l,d,s),Ae=e=>He(e,oe(e.tableId,e.store)),Ge=({valueId:e,store:s,debugIds:o})=>Oe(t+(ne(e,s)??t),void 0,o,e),We=({indexId:e,sliceId:s,indexes:t,rowComponent:o=Ee,getRowComponentProps:r,separator:u,debugIds:l})=>{const[d,n,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(D(t),e),i=ae(e,s,d);return Oe(V(i,(e=>Ve(o,{...qe(r,e),key:e,tableId:p,rowId:e,store:n,debugIds:l}))),u,l,s)},je=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>Oe(t+(Re(e,s,o,r)??t),void 0,u,o),Ue=({queryId:e,rowId:s,queries:t,resultCellComponent:o=je,getResultCellComponentProps:r,separator:u,debugIds:l})=>Oe(V(we(e,s,t),(u=>Ve(o,{...qe(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),ze=({checkpoints:e,checkpointId:s,debugIds:o})=>Oe(Le(s,e)??t,void 0,o,s),Je=Fe((e=>e[0])),Ke=Fe((e=>g(e[1])?[]:[e[1]])),Ne=Fe((e=>e[2]));exports.BackwardCheckpointsView=Je,exports.CellView=Qe,exports.CheckpointView=ze,exports.CurrentCheckpointView=Ke,exports.ForwardCheckpointsView=Ne,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=We,getSliceComponentProps:o,separator:r,debugIds:u})=>Oe(V(ie(e,s),(r=>Ve(t,{...qe(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>De(e,ce,e.firstRowId),exports.LocalRowsView=e=>De(e,Ie,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>Oe(pe(e,s)??t,void 0,o,e),exports.Provider=({store:s,storesById:t,metrics:o,metricsById:r,indexes:u,indexesById:l,relationships:d,relationshipsById:n,queries:p,queriesById:i,checkpoints:a,checkpointsById:x,children:I})=>{const c=e.useContext(P);return Ve(P.Provider,{value:Be((()=>[s??c[0],{...c[1],...t},o??c[2],{...c[3],...r},u??c[4],{...c[5],...l},d??c[6],{...c[7],...n},p??c[8],{...c[9],...i},a??c[10],{...c[11],...x}]),[s,t,o,r,u,l,d,n,p,i,a,x,c])},I)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=Ee,getRowComponentProps:r,debugIds:u})=>{const[l,d,,n]=fe(F(t),e),p=xe(e,s,l);return Oe(g(n)||g(p)?null:Ve(o,{...qe(r,p),key:p,tableId:n,rowId:p,store:d,debugIds:u}),void 0,u,s)},exports.ResultCellView=je,exports.ResultRowView=Ue,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>Me(r,be(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>Me(e,Ce(e.queryId,e.queries)),exports.RowView=Ee,exports.SliceView=We,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>He(r,re(r.tableId,e,s,t,o,r.store)),exports.TableView=Ae,exports.TablesView=({store:e,tableComponent:s=Ae,getTableComponentProps:t,separator:o,debugIds:r})=>Oe(V(te(e),(o=>Ve(s,{...qe(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=Ge,exports.ValuesView=({store:e,valueComponent:s=Ge,getValueComponentProps:t,separator:o,debugIds:r})=>Oe(V(de(e),(o=>Ve(s,{...qe(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=K,o,r=y,u=K,l=!0)=>{const d=H(o);return G((t=>h(d,(o=>h(s(t,o),(s=>r(o.addRow(e,s,l),o,s)))))),[d,e,...t,...u,l])},exports.useCell=le,exports.useCellIds=ue,exports.useCellIdsListener=(e,s,t,o,r,u)=>$(w,H(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>$(b,H(l),o,r,[e,s,t],u),exports.useCheckpoint=Le,exports.useCheckpointIds=ke,exports.useCheckpointIdsListener=(e,s,t)=>$("CheckpointIds",Q(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>$("Checkpoint",Q(o),s,t,[e]),exports.useCheckpoints=e=>q(e,10),exports.useCheckpointsIds=()=>B(11),exports.useCheckpointsOrCheckpointsById=Q,exports.useCreateCheckpoints=(e,s,t)=>Y(e,s,t),exports.useCreateIndexes=(e,s,t)=>Y(e,s,t),exports.useCreateMetrics=(e,s,t)=>Y(e,s,t),exports.useCreatePersister=(e,s,t=K,o,r=K,u,l=K)=>{const[,d]=J(),n=j((()=>s(e)),[e,...t]);return W((()=>((async()=>{o&&(await o(n),d([]))})(),()=>{n?.destroy(),u?.(n)})),[n,...r,...l]),n},exports.useCreateQueries=(e,s,t)=>Y(e,s,t),exports.useCreateRelationships=(e,s,t)=>Y(e,s,t),exports.useCreateStore=(e,s=K)=>j(e,s),exports.useDelCellCallback=(e,s,t,o,r,u,l)=>ee(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>ee(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>ee(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>ee(e,i,s,t),exports.useDelValueCallback=(e,s,t,o)=>ee(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>ee(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>$("DidFinish"+A,H(t),e,s),exports.useGoBackwardCallback=ge,exports.useGoForwardCallback=he,exports.useGoToCallback=(e,s=K,t,o=y,r=K)=>{const u=Q(t);return G((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>Z(b,H(o),!1,[e,s,t],4,d,l),exports.useHasCellListener=(e,s,t,o,r,u,d)=>$(l+b,H(d),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>Z(x,H(t),!1,[e,s],3,d,l),exports.useHasRowListener=(e,s,t,o,r,u)=>$(l+x,H(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>Z(p,H(s),!1,[e],2,d,l),exports.useHasTableCell=(e,s,t)=>Z(p+b,H(t),!1,[e,s],3,d,l),exports.useHasTableCellListener=(e,s,t,o,r,u)=>$(l+p+b,H(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>$(l+p,H(r),s,t,[e],o),exports.useHasTables=e=>Z(i,H(e),!1,[],1,d,l),exports.useHasTablesListener=(e,s,t,o)=>$(l+i,H(o),e,s,[],t),exports.useHasValue=(e,s)=>Z(R,H(s),!1,[e],2,d,l),exports.useHasValueListener=(e,s,t,o,r)=>$(l+R,H(r),s,t,[e],o),exports.useHasValues=e=>Z(k,H(e),!1,[],1,d,l),exports.useHasValuesListener=(e,s,t,o)=>$(l+k,H(o),e,s,[],t),exports.useIndexIds=e=>Z("IndexIds",D(e),K),exports.useIndexes=e=>q(e,4),exports.useIndexesIds=()=>B(5),exports.useIndexesOrIndexesById=D,exports.useLinkedRowIds=ce,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>$("Linked"+c,F(r),t,o,[e,s]),exports.useLocalRowIds=Ie,exports.useLocalRowIdsListener=(e,s,t,o,r)=>$("Local"+c,F(r),t,o,[e,s]),exports.useMetric=pe,exports.useMetricIds=e=>Z("MetricIds",M(e),K),exports.useMetricListener=(e,s,t,o)=>$("Metric",M(o),s,t,[e]),exports.useMetrics=e=>q(e,2),exports.useMetricsIds=()=>B(3),exports.useMetricsOrMetricsById=M,exports.useQueries=e=>q(e,8),exports.useQueriesIds=()=>B(9),exports.useQueriesOrQueriesById=O,exports.useQueryIds=e=>Z("QueryIds",O(e),K),exports.useRedoInformation=e=>{const s=Q(e),[,,[o]]=ke(s);return[!g(o),he(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>Z("RelationshipIds",F(e),K),exports.useRelationships=e=>q(e,6),exports.useRelationshipsIds=()=>B(7),exports.useRelationshipsOrRelationshipsById=F,exports.useRemoteRowId=xe,exports.useRemoteRowIdListener=(e,s,t,o,r)=>$("RemoteRowId",F(r),t,o,[e,s]),exports.useResultCell=Re,exports.useResultCellIds=we,exports.useResultCellIdsListener=(e,s,t,o,r)=>$(u+w,O(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,l)=>$(u+b,O(l),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>Z(u+x,O(t),N,[e,s]),exports.useResultRowCount=(e,s)=>Z(u+I,O(s),0,[e]),exports.useResultRowCountListener=(e,s,t,o)=>$(u+I,O(o),s,t,[e]),exports.useResultRowIds=Ce,exports.useResultRowIdsListener=(e,s,t,o)=>$(u+c,O(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>$(u+x,O(r),t,o,[e,s]),exports.useResultSortedRowIds=be,exports.useResultSortedRowIdsListener=(e,s,t,o,r,l,d,n)=>$(u+C,O(n),l,d,[e,s,t,o,r]),exports.useResultTable=(e,s)=>Z(u+p,O(s),N,[e]),exports.useResultTableCellIds=(e,s)=>Z(u+p+w,O(s),K,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>$(u+p+w,O(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>$(u+p,O(o),s,t,[e]),exports.useRow=(e,s,t)=>Z(x,H(t),N,[e,s]),exports.useRowCount=(e,s)=>Z(I,H(s),0,[e]),exports.useRowCountListener=(e,s,t,o,r)=>$(I,H(r),s,t,[e],o),exports.useRowIds=oe,exports.useRowIdsListener=(e,s,t,o,r)=>$(c,H(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>$(x,H(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,d)=>_(u,b,o,r,l,d,e,s,t),exports.useSetCheckpointCallback=(e=y,s=K,t,o=y,r=K)=>{const u=Q(t);return G((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)=>_(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>_(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>_(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>_(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>_(t,i,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>_(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>_(t,k,e,s,o,r),exports.useSliceIds=ie,exports.useSliceIdsListener=(e,s,t,o)=>$("SliceIds",D(o),s,t,[e]),exports.useSliceRowIds=ae,exports.useSliceRowIdsListener=(e,s,t,o,r)=>$("Slice"+c,D(r),t,o,[e,s]),exports.useSortedRowIds=re,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,d,n)=>$(C,H(n),u,l,[e,s,t,o,r],d),exports.useStartTransactionListener=(e,s,t)=>$("Start"+A,H(t),e,s),exports.useStore=e=>q(e,0),exports.useStoreIds=()=>B(1),exports.useStoreOrStoreById=H,exports.useTable=(e,s)=>Z(p,H(s),N,[e]),exports.useTableCellIds=(e,s)=>Z(p+w,H(s),K,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>$(p+w,H(r),s,t,[e],o),exports.useTableIds=te,exports.useTableIdsListener=(e,s,t,o)=>$(a,H(o),e,s,K,t),exports.useTableListener=(e,s,t,o,r)=>$(p,H(r),s,t,[e],o),exports.useTables=e=>Z(i,H(e),N),exports.useTablesListener=(e,s,t,o)=>$(i,H(o),e,s,K,t),exports.useUndoInformation=e=>{const s=Q(e),[o,r]=ke(s);return[(u=o,!(0==u.length)),ge(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=ne,exports.useValueIds=de,exports.useValueIdsListener=(e,s,t,o)=>$(L,H(o),e,s,K,t),exports.useValueListener=(e,s,t,o,r)=>$(R,H(r),s,t,[e],o),exports.useValues=e=>Z(k,H(e),N),exports.useValuesListener=(e,s,t,o)=>$(k,H(o),e,s,K,t),exports.useWillFinishTransactionListener=(e,s,t)=>$("WillFinish"+A,H(t),e,s);
1
+ "use strict";var e=require("react");const s=e=>typeof e,t="",o=s(t),r="Listener",u="Result",l="Has",d="has",n="Ids",p="Table",a=p+"s",i=p+n,x="Row",I=x+"Count",c=x+n,C="Sorted"+x+n,b="Cell",w=b+n,R="Value",k=R+"s",L=R+n,g=e=>null==e,h=(e,s,t)=>g(e)?t?.():s(e),m=e=>s(e)==o,y=()=>{},V=(e,s)=>e.map(s),S=Object.keys,T=(e,s)=>h(e,(e=>e[s])),v=(e,s)=>(delete e[s],e),{createContext:P,useContext:f,useEffect:q}=e,B=P([]),H=(e,s)=>{const t=f(B);return g(e)?t[s]:m(e)?T(t[s+1]??{},e):e},M=(e,s)=>{const t=H(e,s);return g(e)||m(e)?t:e},D=e=>S(f(B)[e]??{}),F=e=>M(e,0),O=e=>M(e,2),Q=e=>M(e,4),E=e=>M(e,6),A=e=>M(e,8),G=e=>M(e,10),W=e=>e.toLowerCase();W(r);const j="Transaction";W(j);const{useCallback:U,useEffect:z,useMemo:J,useLayoutEffect:K,useRef:N,useState:X}=e,Y=[],Z={},$=[[],void 0,[]],_=(e,s,t=Y)=>{const o=J((()=>s(e)),[e,...t]);return z((()=>()=>o.destroy()),[o]),o},ee=(e,s,t,o=Y,r,u="get",l="")=>{const[,d]=X(),n=U((()=>s?.[u+e]?.(...o)??t),[s,e,...o,t]),p=N();return J((()=>p.current=n()),[n]),se(l+e,s,((...e)=>{p.current=g(r)?n():e[r],d([])}),[n,r],o),p.current},se=(e,s,t,o=Y,u=Y,...l)=>K((()=>{const o=s?.["add"+e+r]?.(...u,t,...l);return()=>s?.delListener(o)}),[s,e,...u,...o,...l]),te=(e,s,t,o=Y,r=y,u=Y,...l)=>{const d=F(e);return U((e=>h(d,(o=>h(t(e,o),(e=>r(o["set"+s](...l,e),e)))))),[d,s,...o,...u,...l])},oe=(e,s,t=y,o=Y,...r)=>{const u=F(e);return U((()=>t(u?.["del"+s](...r))),[u,s,...o,...r])},re=(e,s,t)=>{const o=G(e);return U((()=>o?.[s](t)),[o,s,t])},ue=e=>ee(i,F(e),Y),le=(e,s)=>ee(c,F(s),Y,[e]),de=(e,s,t,o=0,r,u)=>ee(C,F(u),Y,[e,s,t,o,r],6),ne=(e,s,t)=>ee(w,F(t),Y,[e,s]),pe=(e,s,t,o)=>ee(b,F(o),void 0,[e,s,t],4),ae=e=>ee(L,F(e),Y),ie=(e,s)=>ee(R,F(s),void 0,[e]),xe=(e,s)=>ee("Metric",O(s),void 0,[e]),Ie=(e,s)=>ee("SliceIds",Q(s),Y,[e]),ce=(e,s,t)=>ee("Slice"+c,Q(t),Y,[e,s]),Ce=(e,s,t)=>ee("RemoteRowId",E(t),void 0,[e,s]),be=(e,s,t)=>ee("Local"+c,E(t),Y,[e,s]),we=(e,s,t)=>ee("Linked"+c,E(t),Y,[e,s]),Re=(e,s)=>ee(u+c,A(s),Y,[e]),ke=(e,s,t,o=0,r,l)=>ee(u+C,A(l),Y,[e,s,t,o,r],6),Le=(e,s,t)=>ee(u+w,A(t),Y,[e,s]),ge=(e,s,t,o)=>ee(u+b,A(o),void 0,[e,s,t]),he=e=>ee("CheckpointIds",G(e),$),me=(e,s)=>ee("Checkpoint",G(s),void 0,[e]),ye=e=>re(e,"goBackward"),Ve=e=>re(e,"goForward"),{PureComponent:Se,Fragment:Te,createElement:ve,useCallback:Pe,useLayoutEffect:fe,useRef:qe,useState:Be}=e,He=(e,...s)=>g(e)?{}:e(...s),Me=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:De,useContext:Fe,useMemo:Oe,useState:Qe}=e,Ee=({tableId:e,store:s,rowComponent:t=ze,getRowComponentProps:o,customCellIds:r,separator:u,debugIds:l},d)=>je(V(d,(u=>ve(t,{...He(o,u),key:u,tableId:e,rowId:u,customCellIds:r,store:s,debugIds:l}))),u,l,e),Ae=({queryId:e,queries:s,resultRowComponent:t=Ye,getResultRowComponentProps:o,separator:r,debugIds:u},l)=>je(V(l,(r=>ve(t,{...He(o,r),key:r,queryId:e,rowId:r,queries:s,debugIds:u}))),r,u,e),Ge=({relationshipId:e,relationships:s,rowComponent:t=ze,getRowComponentProps:o,separator:r,debugIds:u},l,d)=>{const[n,p,a]=Me(E(s),e),i=l(e,d,n);return je(V(i,(e=>ve(t,{...He(o,e),key:e,tableId:a,rowId:e,store:p,debugIds:u}))),r,u,d)},We=e=>({checkpoints:s,checkpointComponent:t=Ze,getCheckpointComponentProps:o,separator:r,debugIds:u})=>{const l=G(s);return je(V(e(he(l)),(e=>ve(t,{...He(o,e),key:e,checkpoints:l,checkpointId:e,debugIds:u}))),r)},je=(e,s,t,o)=>{const r=g(s)||!Array.isArray(e)?e:V(e,((e,t)=>t>0?[s,e]:e));return t?[o,":{",r,"}"]:r},Ue=({tableId:e,rowId:s,cellId:o,store:r,debugIds:u})=>je(t+(pe(e,s,o,r)??t),void 0,u,o),ze=({tableId:e,rowId:s,store:t,cellComponent:o=Ue,getCellComponentProps:r,customCellIds:u,separator:l,debugIds:d})=>je(V(((e,s,t,o)=>{const r=ne(s,t,o);return e??r})(u,e,s,t),(u=>ve(o,{...He(r,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:d}))),l,d,s),Je=e=>Ee(e,le(e.tableId,e.store)),Ke=({valueId:e,store:s,debugIds:o})=>je(t+(ie(e,s)??t),void 0,o,e),Ne=({indexId:e,sliceId:s,indexes:t,rowComponent:o=ze,getRowComponentProps:r,separator:u,debugIds:l})=>{const[d,n,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(Q(t),e),a=ce(e,s,d);return je(V(a,(e=>ve(o,{...He(r,e),key:e,tableId:p,rowId:e,store:n,debugIds:l}))),u,l,s)},Xe=({queryId:e,rowId:s,cellId:o,queries:r,debugIds:u})=>je(t+(ge(e,s,o,r)??t),void 0,u,o),Ye=({queryId:e,rowId:s,queries:t,resultCellComponent:o=Xe,getResultCellComponentProps:r,separator:u,debugIds:l})=>je(V(Le(e,s,t),(u=>ve(o,{...He(r,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:l}))),u,l,s),Ze=({checkpoints:e,checkpointId:s,debugIds:o})=>je(me(s,e)??t,void 0,o,s),$e=We((e=>e[0])),_e=We((e=>g(e[1])?[]:[e[1]])),es=We((e=>e[2]));exports.BackwardCheckpointsView=$e,exports.CellView=Ue,exports.CheckpointView=Ze,exports.CurrentCheckpointView=_e,exports.ForwardCheckpointsView=es,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Ne,getSliceComponentProps:o,separator:r,debugIds:u})=>je(V(Ie(e,s),(r=>ve(t,{...He(o,r),key:r,indexId:e,sliceId:r,indexes:s,debugIds:u}))),r,u,e),exports.LinkedRowsView=e=>Ge(e,we,e.firstRowId),exports.LocalRowsView=e=>Ge(e,be,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:o})=>je(xe(e,s)??t,void 0,o,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:o,indexes:r,indexesById:u,relationships:l,relationshipsById:d,queries:n,queriesById:p,checkpoints:a,checkpointsById:i,children:x})=>{const I=Fe(B),[c,C]=Qe({}),b=De(((e,s)=>C((t=>T(t,e)==s?t:{...t,[e]:s}))),[]),w=De((e=>C((s=>({...v(s,e)})))),[]);return ve(B.Provider,{value:Oe((()=>[e??I[0],{...I[1],...s,...c},t??I[2],{...I[3],...o},r??I[4],{...I[5],...u},l??I[6],{...I[7],...d},n??I[8],{...I[9],...p},a??I[10],{...I[11],...i},b,w]),[e,s,c,t,o,r,u,l,d,n,p,a,i,I,b,w])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:o=ze,getRowComponentProps:r,debugIds:u})=>{const[l,d,,n]=Me(E(t),e),p=Ce(e,s,l);return je(g(n)||g(p)?null:ve(o,{...He(r,p),key:p,tableId:n,rowId:p,store:d,debugIds:u}),void 0,u,s)},exports.ResultCellView=Xe,exports.ResultRowView=Ye,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>Ae(r,ke(r.queryId,e,s,t,o,r.queries)),exports.ResultTableView=e=>Ae(e,Re(e.queryId,e.queries)),exports.RowView=ze,exports.SliceView=Ne,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:o,...r})=>Ee(r,de(r.tableId,e,s,t,o,r.store)),exports.TableView=Je,exports.TablesView=({store:e,tableComponent:s=Je,getTableComponentProps:t,separator:o,debugIds:r})=>je(V(ue(e),(o=>ve(s,{...He(t,o),key:o,tableId:o,store:e,debugIds:r}))),o),exports.ValueView=Ke,exports.ValuesView=({store:e,valueComponent:s=Ke,getValueComponentProps:t,separator:o,debugIds:r})=>je(V(ae(e),(o=>ve(s,{...He(t,o),key:o,valueId:o,store:e,debugIds:r}))),o),exports.useAddRowCallback=(e,s,t=Y,o,r=y,u=Y,l=!0)=>{const d=F(o);return U((t=>h(d,(o=>h(s(t,o),(s=>r(o.addRow(e,s,l),o,s)))))),[d,e,...t,...u,l])},exports.useCell=pe,exports.useCellIds=ne,exports.useCellIdsListener=(e,s,t,o,r,u)=>se(w,F(u),t,o,[e,s],r),exports.useCellListener=(e,s,t,o,r,u,l)=>se(b,F(l),o,r,[e,s,t],u),exports.useCheckpoint=me,exports.useCheckpointIds=he,exports.useCheckpointIdsListener=(e,s,t)=>se("CheckpointIds",G(t),e,s),exports.useCheckpointListener=(e,s,t,o)=>se("Checkpoint",G(o),s,t,[e]),exports.useCheckpoints=e=>H(e,10),exports.useCheckpointsIds=()=>D(11),exports.useCheckpointsOrCheckpointsById=G,exports.useCreateCheckpoints=(e,s,t)=>_(e,s,t),exports.useCreateIndexes=(e,s,t)=>_(e,s,t),exports.useCreateMetrics=(e,s,t)=>_(e,s,t),exports.useCreatePersister=(e,s,t=Y,o,r=Y,u,l=Y)=>{const[,d]=X(),n=J((()=>s(e)),[e,...t]);return z((()=>((async()=>{o&&(await o(n),d([]))})(),()=>{n?.destroy(),u?.(n)})),[n,...r,...l]),n},exports.useCreateQueries=(e,s,t)=>_(e,s,t),exports.useCreateRelationships=(e,s,t)=>_(e,s,t),exports.useCreateStore=(e,s=Y)=>J(e,s),exports.useDelCellCallback=(e,s,t,o,r,u,l)=>oe(r,b,u,l,e,s,t,o),exports.useDelRowCallback=(e,s,t,o,r)=>oe(t,x,o,r,e,s),exports.useDelTableCallback=(e,s,t,o)=>oe(s,p,t,o,e),exports.useDelTablesCallback=(e,s,t)=>oe(e,a,s,t),exports.useDelValueCallback=(e,s,t,o)=>oe(s,R,t,o,e),exports.useDelValuesCallback=(e,s,t)=>oe(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>se("DidFinish"+j,F(t),e,s),exports.useGoBackwardCallback=ye,exports.useGoForwardCallback=Ve,exports.useGoToCallback=(e,s=Y,t,o=y,r=Y)=>{const u=G(t);return U((s=>h(u,(t=>h(e(s),(e=>o(t.goTo(e),e)))))),[u,...s,...r])},exports.useHasCell=(e,s,t,o)=>ee(b,F(o),!1,[e,s,t],4,d,l),exports.useHasCellListener=(e,s,t,o,r,u,d)=>se(l+b,F(d),o,r,[e,s,t],u),exports.useHasRow=(e,s,t)=>ee(x,F(t),!1,[e,s],3,d,l),exports.useHasRowListener=(e,s,t,o,r,u)=>se(l+x,F(u),t,o,[e,s],r),exports.useHasTable=(e,s)=>ee(p,F(s),!1,[e],2,d,l),exports.useHasTableCell=(e,s,t)=>ee(p+b,F(t),!1,[e,s],3,d,l),exports.useHasTableCellListener=(e,s,t,o,r,u)=>se(l+p+b,F(u),t,o,[e,s],r),exports.useHasTableListener=(e,s,t,o,r)=>se(l+p,F(r),s,t,[e],o),exports.useHasTables=e=>ee(a,F(e),!1,[],1,d,l),exports.useHasTablesListener=(e,s,t,o)=>se(l+a,F(o),e,s,[],t),exports.useHasValue=(e,s)=>ee(R,F(s),!1,[e],2,d,l),exports.useHasValueListener=(e,s,t,o,r)=>se(l+R,F(r),s,t,[e],o),exports.useHasValues=e=>ee(k,F(e),!1,[],1,d,l),exports.useHasValuesListener=(e,s,t,o)=>se(l+k,F(o),e,s,[],t),exports.useIndexIds=e=>ee("IndexIds",Q(e),Y),exports.useIndexes=e=>H(e,4),exports.useIndexesIds=()=>D(5),exports.useIndexesOrIndexesById=Q,exports.useLinkedRowIds=we,exports.useLinkedRowIdsListener=(e,s,t,o,r)=>se("Linked"+c,E(r),t,o,[e,s]),exports.useLocalRowIds=be,exports.useLocalRowIdsListener=(e,s,t,o,r)=>se("Local"+c,E(r),t,o,[e,s]),exports.useMetric=xe,exports.useMetricIds=e=>ee("MetricIds",O(e),Y),exports.useMetricListener=(e,s,t,o)=>se("Metric",O(o),s,t,[e]),exports.useMetrics=e=>H(e,2),exports.useMetricsIds=()=>D(3),exports.useMetricsOrMetricsById=O,exports.useProvideStore=(e,s)=>{const{12:t,13:o}=f(B);q((()=>(t?.(e,s),()=>o?.(e))),[t,e,s,o])},exports.useQueries=e=>H(e,8),exports.useQueriesIds=()=>D(9),exports.useQueriesOrQueriesById=A,exports.useQueryIds=e=>ee("QueryIds",A(e),Y),exports.useRedoInformation=e=>{const s=G(e),[,,[o]]=he(s);return[!g(o),Ve(s),o,h(o,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>ee("RelationshipIds",E(e),Y),exports.useRelationships=e=>H(e,6),exports.useRelationshipsIds=()=>D(7),exports.useRelationshipsOrRelationshipsById=E,exports.useRemoteRowId=Ce,exports.useRemoteRowIdListener=(e,s,t,o,r)=>se("RemoteRowId",E(r),t,o,[e,s]),exports.useResultCell=ge,exports.useResultCellIds=Le,exports.useResultCellIdsListener=(e,s,t,o,r)=>se(u+w,A(r),t,o,[e,s]),exports.useResultCellListener=(e,s,t,o,r,l)=>se(u+b,A(l),o,r,[e,s,t]),exports.useResultRow=(e,s,t)=>ee(u+x,A(t),Z,[e,s]),exports.useResultRowCount=(e,s)=>ee(u+I,A(s),0,[e]),exports.useResultRowCountListener=(e,s,t,o)=>se(u+I,A(o),s,t,[e]),exports.useResultRowIds=Re,exports.useResultRowIdsListener=(e,s,t,o)=>se(u+c,A(o),s,t,[e]),exports.useResultRowListener=(e,s,t,o,r)=>se(u+x,A(r),t,o,[e,s]),exports.useResultSortedRowIds=ke,exports.useResultSortedRowIdsListener=(e,s,t,o,r,l,d,n)=>se(u+C,A(n),l,d,[e,s,t,o,r]),exports.useResultTable=(e,s)=>ee(u+p,A(s),Z,[e]),exports.useResultTableCellIds=(e,s)=>ee(u+p+w,A(s),Y,[e]),exports.useResultTableCellIdsListener=(e,s,t,o)=>se(u+p+w,A(o),s,t,[e]),exports.useResultTableListener=(e,s,t,o)=>se(u+p,A(o),s,t,[e]),exports.useRow=(e,s,t)=>ee(x,F(t),Z,[e,s]),exports.useRowCount=(e,s)=>ee(I,F(s),0,[e]),exports.useRowCountListener=(e,s,t,o,r)=>se(I,F(r),s,t,[e],o),exports.useRowIds=le,exports.useRowIdsListener=(e,s,t,o,r)=>se(c,F(r),s,t,[e],o),exports.useRowListener=(e,s,t,o,r,u)=>se(x,F(u),t,o,[e,s],r),exports.useSetCellCallback=(e,s,t,o,r,u,l,d)=>te(u,b,o,r,l,d,e,s,t),exports.useSetCheckpointCallback=(e=y,s=Y,t,o=y,r=Y)=>{const u=G(t);return U((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)=>te(r,"PartialRow",t,o,u,l,e,s),exports.useSetPartialValuesCallback=(e,s,t,o,r)=>te(t,"PartialValues",e,s,o,r),exports.useSetRowCallback=(e,s,t,o,r,u,l)=>te(r,x,t,o,u,l,e,s),exports.useSetTableCallback=(e,s,t,o,r,u)=>te(o,p,s,t,r,u,e),exports.useSetTablesCallback=(e,s,t,o,r)=>te(t,a,e,s,o,r),exports.useSetValueCallback=(e,s,t,o,r,u)=>te(o,R,s,t,r,u,e),exports.useSetValuesCallback=(e,s,t,o,r)=>te(t,k,e,s,o,r),exports.useSliceIds=Ie,exports.useSliceIdsListener=(e,s,t,o)=>se("SliceIds",Q(o),s,t,[e]),exports.useSliceRowIds=ce,exports.useSliceRowIdsListener=(e,s,t,o,r)=>se("Slice"+c,Q(r),t,o,[e,s]),exports.useSortedRowIds=de,exports.useSortedRowIdsListener=(e,s,t,o,r,u,l,d,n)=>se(C,F(n),u,l,[e,s,t,o,r],d),exports.useStartTransactionListener=(e,s,t)=>se("Start"+j,F(t),e,s),exports.useStore=e=>H(e,0),exports.useStoreIds=()=>D(1),exports.useStoreOrStoreById=F,exports.useTable=(e,s)=>ee(p,F(s),Z,[e]),exports.useTableCellIds=(e,s)=>ee(p+w,F(s),Y,[e]),exports.useTableCellIdsListener=(e,s,t,o,r)=>se(p+w,F(r),s,t,[e],o),exports.useTableIds=ue,exports.useTableIdsListener=(e,s,t,o)=>se(i,F(o),e,s,Y,t),exports.useTableListener=(e,s,t,o,r)=>se(p,F(r),s,t,[e],o),exports.useTables=e=>ee(a,F(e),Z),exports.useTablesListener=(e,s,t,o)=>se(a,F(o),e,s,Y,t),exports.useUndoInformation=e=>{const s=G(e),[o,r]=he(s);return[(u=o,!(0==u.length)),ye(s),r,h(r,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=ie,exports.useValueIds=ae,exports.useValueIdsListener=(e,s,t,o)=>se(L,F(o),e,s,Y,t),exports.useValueListener=(e,s,t,o,r)=>se(R,F(r),s,t,[e],o),exports.useValues=e=>ee(k,F(e),Z),exports.useValuesListener=(e,s,t,o)=>se(k,F(o),e,s,Y,t),exports.useWillFinishTransactionListener=(e,s,t)=>se("WillFinish"+j,F(t),e,s);
Binary file
@@ -1 +1 @@
1
- "use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o="Listener",l="Result",u="Has",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,h=(e,s,t)=>g(e)?null==t?void 0:t():s(e),L=e=>s(e)==r,m=()=>{},y=(e,s)=>e.map(s),V=Object.keys,{createContext:S,useContext:T}=e,f=S([]),P=(e,s)=>{var t;const r=T(f);return g(e)?r[s]:L(e)?((e,s)=>h(e,(e=>e[s])))(null!=(t=r[s+1])?t:{},e):e},O=(e,s)=>{const t=P(e,s);return g(e)||L(e)?t:e},q=e=>{var s;return V(null!=(s=T(f)[e])?s:{})},B=e=>O(e,0),H=e=>O(e,2),M=e=>O(e,4),D=e=>O(e,6),F=e=>O(e,8),j=e=>O(e,10),Q=e=>e.toLowerCase();Q(o);const E="Transaction";Q(E);const{useCallback:A,useEffect:G,useMemo:W,useLayoutEffect:U,useRef:z,useState:J}=e,K=[],N={},X=[[],void 0,[]],Y=(e,s,t=K)=>{const r=W((()=>s(e)),[e,...t]);return G((()=>()=>r.destroy()),[r]),r},Z=(e,s,t,r=K,o,l="get",u="")=>{const[,n]=J(),d=A((()=>{var o,u;return null!=(u=null==(o=null==s?void 0:s[l+e])?void 0:o.call(s,...r))?u:t}),[s,e,...r,t]),i=z();return W((()=>i.current=d()),[d]),$(u+e,s,((...e)=>{i.current=g(o)?d():e[o],n([])}),[d,o],r),i.current},$=(e,s,t,r=K,l=K,...u)=>U((()=>{var r;const n=null==(r=null==s?void 0:s["add"+e+o])?void 0:r.call(s,...l,t,...u);return()=>null==s?void 0:s.delListener(n)}),[s,e,...l,...r,...u]),_=(e,s,t,r=K,o=m,l=K,...u)=>{const n=B(e);return A((e=>h(n,(r=>h(t(e,r),(e=>o(r["set"+s](...u,e),e)))))),[n,s,...r,...l,...u])},ee=(e,s,t=m,r=K,...o)=>{const l=B(e);return A((()=>t(null==l?void 0:l["del"+s](...o))),[l,s,...r,...o])},se=(e,s,t)=>{const r=j(e);return A((()=>null==r?void 0:r[s](t)),[r,s,t])},te=e=>Z(p,B(e),K),re=(e,s)=>Z(I,B(s),K,[e]),oe=(e,s,t,r=0,o,l)=>Z(C,B(l),K,[e,s,t,r,o],6),le=(e,s,t)=>Z(w,B(t),K,[e,s]),ue=(e,s,t,r)=>Z(b,B(r),void 0,[e,s,t],4),ne=e=>Z(v,B(e),K),de=(e,s)=>Z(R,B(s),void 0,[e]),ie=(e,s)=>Z("Metric",H(s),void 0,[e]),ae=(e,s)=>Z("SliceIds",M(s),K,[e]),pe=(e,s,t)=>Z("Slice"+I,M(t),K,[e,s]),ce=(e,s,t)=>Z("RemoteRowId",D(t),void 0,[e,s]),xe=(e,s,t)=>Z("Local"+I,D(t),K,[e,s]),Ie=(e,s,t)=>Z("Linked"+I,D(t),K,[e,s]),Ce=(e,s)=>Z(l+I,F(s),K,[e]),be=(e,s,t,r=0,o,u)=>Z(l+C,F(u),K,[e,s,t,r,o],6),we=(e,s,t)=>Z(l+w,F(t),K,[e,s]),Re=(e,s,t,r)=>Z(l+b,F(r),void 0,[e,s,t]),ke=e=>Z("CheckpointIds",j(e),X),ve=(e,s)=>Z("Checkpoint",j(s),void 0,[e]),ge=e=>se(e,"goBackward"),he=e=>se(e,"goForward"),{PureComponent:Le,Fragment:me,createElement:ye,useCallback:Ve,useLayoutEffect:Se,useRef:Te,useState:fe}=e,Pe=(e,...s)=>g(e)?{}:e(...s),Oe=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var qe=Object.defineProperty,Be=Object.defineProperties,He=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,je=(e,s,t)=>s in e?qe(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,Qe=(e,s)=>{for(var t in s||(s={}))De.call(s,t)&&je(e,t,s[t]);if(Me)for(var t of Me(s))Fe.call(s,t)&&je(e,t,s[t]);return e},Ee=(e,s)=>Be(e,He(s)),Ae=(e,s)=>{var t={};for(var r in e)De.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&Me)for(var r of Me(e))s.indexOf(r)<0&&Fe.call(e,r)&&(t[r]=e[r]);return t};const{useMemo:Ge}=e,We=({tableId:e,store:s,rowComponent:t=Xe,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>Ke(y(n,(l=>ye(t,Ee(Qe({},Pe(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),Ue=({queryId:e,queries:s,resultRowComponent:t=es,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>Ke(y(u,(o=>ye(t,Ee(Qe({},Pe(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),ze=({relationshipId:e,relationships:s,rowComponent:t=Xe,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Oe(D(s),e),p=u(e,n,d);return Ke(y(p,(e=>ye(t,Ee(Qe({},Pe(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},Je=e=>({checkpoints:s,checkpointComponent:t=ss,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=j(s);return Ke(y(e(ke(u)),(e=>ye(t,Ee(Qe({},Pe(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},Ke=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:y(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},Ne=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return Ke(t+(null!=(u=ue(e,s,r,o))?u:t),void 0,l,r)},Xe=({tableId:e,rowId:s,store:t,cellComponent:r=Ne,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>Ke(y(((e,s,t,r)=>{const o=le(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>ye(r,Ee(Qe({},Pe(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),Ye=e=>We(e,re(e.tableId,e.store)),Ze=({valueId:e,store:s,debugIds:r})=>{var o;return Ke(t+(null!=(o=de(e,s))?o:t),void 0,r,e)},$e=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Xe,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)])(M(t),e),a=pe(e,s,n);return Ke(y(a,(e=>ye(r,Ee(Qe({},Pe(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},_e=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return Ke(t+(null!=(u=Re(e,s,r,o))?u:t),void 0,l,r)},es=({queryId:e,rowId:s,queries:t,resultCellComponent:r=_e,getResultCellComponentProps:o,separator:l,debugIds:u})=>Ke(y(we(e,s,t),(l=>ye(r,Ee(Qe({},Pe(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),ss=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return Ke(null!=(o=ve(s,e))?o:t,void 0,r,s)},ts=Je((e=>e[0])),rs=Je((e=>g(e[1])?[]:[e[1]])),os=Je((e=>e[2]));exports.BackwardCheckpointsView=ts,exports.CellView=Ne,exports.CheckpointView=ss,exports.CurrentCheckpointView=rs,exports.ForwardCheckpointsView=os,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=$e,getSliceComponentProps:r,separator:o,debugIds:l})=>Ke(y(ae(e,s),(o=>ye(t,Ee(Qe({},Pe(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>ze(e,Ie,e.firstRowId),exports.LocalRowsView=e=>ze(e,xe,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return Ke(null!=(o=ie(e,s))?o:t,void 0,r,e)},exports.Provider=({store:s,storesById:t,metrics:r,metricsById:o,indexes:l,indexesById:u,relationships:n,relationshipsById:d,queries:i,queriesById:a,checkpoints:p,checkpointsById:c,children:x})=>{const I=e.useContext(f);return ye(f.Provider,{value:Ge((()=>[null!=s?s:I[0],Qe(Qe({},I[1]),t),null!=r?r:I[2],Qe(Qe({},I[3]),o),null!=l?l:I[4],Qe(Qe({},I[5]),u),null!=n?n:I[6],Qe(Qe({},I[7]),d),null!=i?i:I[8],Qe(Qe({},I[9]),a),null!=p?p:I[10],Qe(Qe({},I[11]),c)]),[s,t,r,o,l,u,n,d,i,a,p,c,I])},x)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Xe,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Oe(D(t),e),i=ce(e,s,u);return Ke(g(d)||g(i)?null:ye(r,Ee(Qe({},Pe(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=_e,exports.ResultRowView=es,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=Ae(s,["cellId","descending","offset","limit"]);return Ue(u,be(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>Ue(e,Ce(e.queryId,e.queries)),exports.RowView=Xe,exports.SliceView=$e,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=Ae(s,["cellId","descending","offset","limit"]);return We(u,oe(u.tableId,t,r,o,l,u.store))},exports.TableView=Ye,exports.TablesView=({store:e,tableComponent:s=Ye,getTableComponentProps:t,separator:r,debugIds:o})=>Ke(y(te(e),(r=>ye(s,Ee(Qe({},Pe(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=Ze,exports.ValuesView=({store:e,valueComponent:s=Ze,getValueComponentProps:t,separator:r,debugIds:o})=>Ke(y(ne(e),(r=>ye(s,Ee(Qe({},Pe(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=K,r,o=m,l=K,u=!0)=>{const n=B(r);return A((t=>h(n,(r=>h(s(t,r),(s=>o(r.addRow(e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=ue,exports.useCellIds=le,exports.useCellIdsListener=(e,s,t,r,o,l)=>$(w,B(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>$(b,B(u),r,o,[e,s,t],l),exports.useCheckpoint=ve,exports.useCheckpointIds=ke,exports.useCheckpointIdsListener=(e,s,t)=>$("CheckpointIds",j(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>$("Checkpoint",j(r),s,t,[e]),exports.useCheckpoints=e=>P(e,10),exports.useCheckpointsIds=()=>q(11),exports.useCheckpointsOrCheckpointsById=j,exports.useCreateCheckpoints=(e,s,t)=>Y(e,s,t),exports.useCreateIndexes=(e,s,t)=>Y(e,s,t),exports.useCreateMetrics=(e,s,t)=>Y(e,s,t),exports.useCreatePersister=(e,s,t=K,r,o=K,l,u=K)=>{const[,n]=J(),d=W((()=>s(e)),[e,...t]);return G((()=>{var e;return e=function*(){r&&(yield r(d),n([]))},new Promise(((s,t)=>{var r=s=>{try{l(e.next(s))}catch(e){t(e)}},o=s=>{try{l(e.throw(s))}catch(e){t(e)}},l=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,o);l((e=e.apply(void 0,null)).next())})),()=>{null==d||d.destroy(),null==l||l(d)}}),[d,...o,...u]),d},exports.useCreateQueries=(e,s,t)=>Y(e,s,t),exports.useCreateRelationships=(e,s,t)=>Y(e,s,t),exports.useCreateStore=(e,s=K)=>W(e,s),exports.useDelCellCallback=(e,s,t,r,o,l,u)=>ee(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>ee(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>ee(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>ee(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>ee(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>ee(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>$("DidFinish"+E,B(t),e,s),exports.useGoBackwardCallback=ge,exports.useGoForwardCallback=he,exports.useGoToCallback=(e,s=K,t,r=m,o=K)=>{const l=j(t);return A((s=>h(l,(t=>h(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>Z(b,B(r),!1,[e,s,t],4,n,u),exports.useHasCellListener=(e,s,t,r,o,l,n)=>$(u+b,B(n),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>Z(c,B(t),!1,[e,s],3,n,u),exports.useHasRowListener=(e,s,t,r,o,l)=>$(u+c,B(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>Z(i,B(s),!1,[e],2,n,u),exports.useHasTableCell=(e,s,t)=>Z(i+b,B(t),!1,[e,s],3,n,u),exports.useHasTableCellListener=(e,s,t,r,o,l)=>$(u+i+b,B(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>$(u+i,B(o),s,t,[e],r),exports.useHasTables=e=>Z(a,B(e),!1,[],1,n,u),exports.useHasTablesListener=(e,s,t,r)=>$(u+a,B(r),e,s,[],t),exports.useHasValue=(e,s)=>Z(R,B(s),!1,[e],2,n,u),exports.useHasValueListener=(e,s,t,r,o)=>$(u+R,B(o),s,t,[e],r),exports.useHasValues=e=>Z(k,B(e),!1,[],1,n,u),exports.useHasValuesListener=(e,s,t,r)=>$(u+k,B(r),e,s,[],t),exports.useIndexIds=e=>Z("IndexIds",M(e),K),exports.useIndexes=e=>P(e,4),exports.useIndexesIds=()=>q(5),exports.useIndexesOrIndexesById=M,exports.useLinkedRowIds=Ie,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>$("Linked"+I,D(o),t,r,[e,s]),exports.useLocalRowIds=xe,exports.useLocalRowIdsListener=(e,s,t,r,o)=>$("Local"+I,D(o),t,r,[e,s]),exports.useMetric=ie,exports.useMetricIds=e=>Z("MetricIds",H(e),K),exports.useMetricListener=(e,s,t,r)=>$("Metric",H(r),s,t,[e]),exports.useMetrics=e=>P(e,2),exports.useMetricsIds=()=>q(3),exports.useMetricsOrMetricsById=H,exports.useQueries=e=>P(e,8),exports.useQueriesIds=()=>q(9),exports.useQueriesOrQueriesById=F,exports.useQueryIds=e=>Z("QueryIds",F(e),K),exports.useRedoInformation=e=>{var s;const r=j(e),[,,[o]]=ke(r);return[!g(o),he(r),o,null!=(s=h(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>Z("RelationshipIds",D(e),K),exports.useRelationships=e=>P(e,6),exports.useRelationshipsIds=()=>q(7),exports.useRelationshipsOrRelationshipsById=D,exports.useRemoteRowId=ce,exports.useRemoteRowIdListener=(e,s,t,r,o)=>$("RemoteRowId",D(o),t,r,[e,s]),exports.useResultCell=Re,exports.useResultCellIds=we,exports.useResultCellIdsListener=(e,s,t,r,o)=>$(l+w,F(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,u)=>$(l+b,F(u),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>Z(l+c,F(t),N,[e,s]),exports.useResultRowCount=(e,s)=>Z(l+x,F(s),0,[e]),exports.useResultRowCountListener=(e,s,t,r)=>$(l+x,F(r),s,t,[e]),exports.useResultRowIds=Ce,exports.useResultRowIdsListener=(e,s,t,r)=>$(l+I,F(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>$(l+c,F(o),t,r,[e,s]),exports.useResultSortedRowIds=be,exports.useResultSortedRowIdsListener=(e,s,t,r,o,u,n,d)=>$(l+C,F(d),u,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>Z(l+i,F(s),N,[e]),exports.useResultTableCellIds=(e,s)=>Z(l+i+w,F(s),K,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>$(l+i+w,F(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>$(l+i,F(r),s,t,[e]),exports.useRow=(e,s,t)=>Z(c,B(t),N,[e,s]),exports.useRowCount=(e,s)=>Z(x,B(s),0,[e]),exports.useRowCountListener=(e,s,t,r,o)=>$(x,B(o),s,t,[e],r),exports.useRowIds=re,exports.useRowIdsListener=(e,s,t,r,o)=>$(I,B(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>$(c,B(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>_(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=m,s=K,t,r=m,o=K)=>{const l=j(t);return A((s=>h(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>_(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>_(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>_(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>_(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>_(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>_(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>_(t,k,e,s,r,o),exports.useSliceIds=ae,exports.useSliceIdsListener=(e,s,t,r)=>$("SliceIds",M(r),s,t,[e]),exports.useSliceRowIds=pe,exports.useSliceRowIdsListener=(e,s,t,r,o)=>$("Slice"+I,M(o),t,r,[e,s]),exports.useSortedRowIds=oe,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>$(C,B(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>$("Start"+E,B(t),e,s),exports.useStore=e=>P(e,0),exports.useStoreIds=()=>q(1),exports.useStoreOrStoreById=B,exports.useTable=(e,s)=>Z(i,B(s),N,[e]),exports.useTableCellIds=(e,s)=>Z(i+w,B(s),K,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>$(i+w,B(o),s,t,[e],r),exports.useTableIds=te,exports.useTableIdsListener=(e,s,t,r)=>$(p,B(r),e,s,K,t),exports.useTableListener=(e,s,t,r,o)=>$(i,B(o),s,t,[e],r),exports.useTables=e=>Z(a,B(e),N),exports.useTablesListener=(e,s,t,r)=>$(a,B(r),e,s,K,t),exports.useUndoInformation=e=>{var s;const r=j(e),[o,l]=ke(r);return[(u=o,!(0==u.length)),ge(r),l,null!=(s=h(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=de,exports.useValueIds=ne,exports.useValueIdsListener=(e,s,t,r)=>$(v,B(r),e,s,K,t),exports.useValueListener=(e,s,t,r,o)=>$(R,B(o),s,t,[e],r),exports.useValues=e=>Z(k,B(e),N),exports.useValuesListener=(e,s,t,r)=>$(k,B(r),e,s,K,t),exports.useWillFinishTransactionListener=(e,s,t)=>$("WillFinish"+E,B(t),e,s);
1
+ "use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o="Listener",l="Result",u="Has",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,h=(e,s,t)=>g(e)?null==t?void 0:t():s(e),L=e=>s(e)==r,m=()=>{},y=(e,s)=>e.map(s),V=Object.keys,S=(e,s)=>h(e,(e=>e[s])),{createContext:T,useContext:f,useEffect:P}=e,O=T([]),q=(e,s)=>{var t;const r=f(O);return g(e)?r[s]:L(e)?S(null!=(t=r[s+1])?t:{},e):e},B=(e,s)=>{const t=q(e,s);return g(e)||L(e)?t:e},H=e=>{var s;return V(null!=(s=f(O)[e])?s:{})},M=e=>B(e,0),D=e=>B(e,2),F=e=>B(e,4),j=e=>B(e,6),Q=e=>B(e,8),E=e=>B(e,10),A=e=>e.toLowerCase();A(o);const G="Transaction";A(G);const{useCallback:W,useEffect:U,useMemo:z,useLayoutEffect:J,useRef:K,useState:N}=e,X=[],Y={},Z=[[],void 0,[]],$=(e,s,t=X)=>{const r=z((()=>s(e)),[e,...t]);return U((()=>()=>r.destroy()),[r]),r},_=(e,s,t,r=X,o,l="get",u="")=>{const[,n]=N(),d=W((()=>{var o,u;return null!=(u=null==(o=null==s?void 0:s[l+e])?void 0:o.call(s,...r))?u:t}),[s,e,...r,t]),i=K();return z((()=>i.current=d()),[d]),ee(u+e,s,((...e)=>{i.current=g(o)?d():e[o],n([])}),[d,o],r),i.current},ee=(e,s,t,r=X,l=X,...u)=>J((()=>{var r;const n=null==(r=null==s?void 0:s["add"+e+o])?void 0:r.call(s,...l,t,...u);return()=>null==s?void 0:s.delListener(n)}),[s,e,...l,...r,...u]),se=(e,s,t,r=X,o=m,l=X,...u)=>{const n=M(e);return W((e=>h(n,(r=>h(t(e,r),(e=>o(r["set"+s](...u,e),e)))))),[n,s,...r,...l,...u])},te=(e,s,t=m,r=X,...o)=>{const l=M(e);return W((()=>t(null==l?void 0:l["del"+s](...o))),[l,s,...r,...o])},re=(e,s,t)=>{const r=E(e);return W((()=>null==r?void 0:r[s](t)),[r,s,t])},oe=e=>_(p,M(e),X),le=(e,s)=>_(I,M(s),X,[e]),ue=(e,s,t,r=0,o,l)=>_(C,M(l),X,[e,s,t,r,o],6),ne=(e,s,t)=>_(w,M(t),X,[e,s]),de=(e,s,t,r)=>_(b,M(r),void 0,[e,s,t],4),ie=e=>_(v,M(e),X),ae=(e,s)=>_(R,M(s),void 0,[e]),pe=(e,s)=>_("Metric",D(s),void 0,[e]),ce=(e,s)=>_("SliceIds",F(s),X,[e]),xe=(e,s,t)=>_("Slice"+I,F(t),X,[e,s]),Ie=(e,s,t)=>_("RemoteRowId",j(t),void 0,[e,s]),Ce=(e,s,t)=>_("Local"+I,j(t),X,[e,s]),be=(e,s,t)=>_("Linked"+I,j(t),X,[e,s]),we=(e,s)=>_(l+I,Q(s),X,[e]),Re=(e,s,t,r=0,o,u)=>_(l+C,Q(u),X,[e,s,t,r,o],6),ke=(e,s,t)=>_(l+w,Q(t),X,[e,s]),ve=(e,s,t,r)=>_(l+b,Q(r),void 0,[e,s,t]),ge=e=>_("CheckpointIds",E(e),Z),he=(e,s)=>_("Checkpoint",E(s),void 0,[e]),Le=e=>re(e,"goBackward"),me=e=>re(e,"goForward"),{PureComponent:ye,Fragment:Ve,createElement:Se,useCallback:Te,useLayoutEffect:fe,useRef:Pe,useState:Oe}=e,qe=(e,...s)=>g(e)?{}:e(...s),Be=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var He=Object.defineProperty,Me=Object.defineProperties,De=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Ee=(e,s,t)=>s in e?He(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,Ae=(e,s)=>{for(var t in s||(s={}))je.call(s,t)&&Ee(e,t,s[t]);if(Fe)for(var t of Fe(s))Qe.call(s,t)&&Ee(e,t,s[t]);return e},Ge=(e,s)=>Me(e,De(s)),We=(e,s)=>{var t={};for(var r in e)je.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&Fe)for(var r of Fe(e))s.indexOf(r)<0&&Qe.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:Ue,useContext:ze,useMemo:Je,useState:Ke}=e,Ne=({tableId:e,store:s,rowComponent:t=es,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>$e(y(n,(l=>Se(t,Ge(Ae({},qe(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),Xe=({queryId:e,queries:s,resultRowComponent:t=ls,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>$e(y(u,(o=>Se(t,Ge(Ae({},qe(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),Ye=({relationshipId:e,relationships:s,rowComponent:t=es,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[d,i,a]=Be(j(s),e),p=u(e,n,d);return $e(y(p,(e=>Se(t,Ge(Ae({},qe(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),o,l,n)},Ze=e=>({checkpoints:s,checkpointComponent:t=us,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=E(s);return $e(y(e(ge(u)),(e=>Se(t,Ge(Ae({},qe(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},$e=(e,s,t,r)=>{const o=g(s)||!Array.isArray(e)?e:y(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},_e=({tableId:e,rowId:s,cellId:r,store:o,debugIds:l})=>{var u;return $e(t+(null!=(u=de(e,s,r,o))?u:t),void 0,l,r)},es=({tableId:e,rowId:s,store:t,cellComponent:r=_e,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>$e(y(((e,s,t,r)=>{const o=ne(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>Se(r,Ge(Ae({},qe(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),ss=e=>Ne(e,le(e.tableId,e.store)),ts=({valueId:e,store:s,debugIds:r})=>{var o;return $e(t+(null!=(o=ae(e,s))?o:t),void 0,r,e)},rs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=es,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)])(F(t),e),a=xe(e,s,n);return $e(y(a,(e=>Se(r,Ge(Ae({},qe(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),l,u,s)},os=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:l})=>{var u;return $e(t+(null!=(u=ve(e,s,r,o))?u:t),void 0,l,r)},ls=({queryId:e,rowId:s,queries:t,resultCellComponent:r=os,getResultCellComponentProps:o,separator:l,debugIds:u})=>$e(y(ke(e,s,t),(l=>Se(r,Ge(Ae({},qe(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),us=({checkpoints:e,checkpointId:s,debugIds:r})=>{var o;return $e(null!=(o=he(s,e))?o:t,void 0,r,s)},ns=Ze((e=>e[0])),ds=Ze((e=>g(e[1])?[]:[e[1]])),is=Ze((e=>e[2]));exports.BackwardCheckpointsView=ns,exports.CellView=_e,exports.CheckpointView=us,exports.CurrentCheckpointView=ds,exports.ForwardCheckpointsView=is,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=rs,getSliceComponentProps:r,separator:o,debugIds:l})=>$e(y(ce(e,s),(o=>Se(t,Ge(Ae({},qe(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),exports.LinkedRowsView=e=>Ye(e,be,e.firstRowId),exports.LocalRowsView=e=>Ye(e,Ce,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>{var o;return $e(null!=(o=pe(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=ze(O),[I,C]=Ke({}),b=Ue(((e,s)=>C((t=>S(t,e)==s?t:Ge(Ae({},t),{[e]:s})))),[]),w=Ue((e=>C((s=>Ae({},((e,s)=>(delete e[s],e))(s,e))))),[]);return Se(O.Provider,{value:Je((()=>[null!=e?e:x[0],Ae(Ae(Ae({},x[1]),s),I),null!=t?t:x[2],Ae(Ae({},x[3]),r),null!=o?o:x[4],Ae(Ae({},x[5]),l),null!=u?u:x[6],Ae(Ae({},x[7]),n),null!=d?d:x[8],Ae(Ae({},x[9]),i),null!=a?a:x[10],Ae(Ae({},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=es,getRowComponentProps:o,debugIds:l})=>{const[u,n,,d]=Be(j(t),e),i=Ie(e,s,u);return $e(g(d)||g(i)?null:Se(r,Ge(Ae({},qe(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:l})),void 0,l,s)},exports.ResultCellView=os,exports.ResultRowView=ls,exports.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=We(s,["cellId","descending","offset","limit"]);return Xe(u,Re(u.queryId,t,r,o,l,u.queries))},exports.ResultTableView=e=>Xe(e,we(e.queryId,e.queries)),exports.RowView=es,exports.SliceView=rs,exports.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=We(s,["cellId","descending","offset","limit"]);return Ne(u,ue(u.tableId,t,r,o,l,u.store))},exports.TableView=ss,exports.TablesView=({store:e,tableComponent:s=ss,getTableComponentProps:t,separator:r,debugIds:o})=>$e(y(oe(e),(r=>Se(s,Ge(Ae({},qe(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),exports.ValueView=ts,exports.ValuesView=({store:e,valueComponent:s=ts,getValueComponentProps:t,separator:r,debugIds:o})=>$e(y(ie(e),(r=>Se(s,Ge(Ae({},qe(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),exports.useAddRowCallback=(e,s,t=X,r,o=m,l=X,u=!0)=>{const n=M(r);return W((t=>h(n,(r=>h(s(t,r),(s=>o(r.addRow(e,s,u),r,s)))))),[n,e,...t,...l,u])},exports.useCell=de,exports.useCellIds=ne,exports.useCellIdsListener=(e,s,t,r,o,l)=>ee(w,M(l),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,l,u)=>ee(b,M(u),r,o,[e,s,t],l),exports.useCheckpoint=he,exports.useCheckpointIds=ge,exports.useCheckpointIdsListener=(e,s,t)=>ee("CheckpointIds",E(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>ee("Checkpoint",E(r),s,t,[e]),exports.useCheckpoints=e=>q(e,10),exports.useCheckpointsIds=()=>H(11),exports.useCheckpointsOrCheckpointsById=E,exports.useCreateCheckpoints=(e,s,t)=>$(e,s,t),exports.useCreateIndexes=(e,s,t)=>$(e,s,t),exports.useCreateMetrics=(e,s,t)=>$(e,s,t),exports.useCreatePersister=(e,s,t=X,r,o=X,l,u=X)=>{const[,n]=N(),d=z((()=>s(e)),[e,...t]);return U((()=>{var e;return e=function*(){r&&(yield r(d),n([]))},new Promise(((s,t)=>{var r=s=>{try{l(e.next(s))}catch(e){t(e)}},o=s=>{try{l(e.throw(s))}catch(e){t(e)}},l=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,o);l((e=e.apply(void 0,null)).next())})),()=>{null==d||d.destroy(),null==l||l(d)}}),[d,...o,...u]),d},exports.useCreateQueries=(e,s,t)=>$(e,s,t),exports.useCreateRelationships=(e,s,t)=>$(e,s,t),exports.useCreateStore=(e,s=X)=>z(e,s),exports.useDelCellCallback=(e,s,t,r,o,l,u)=>te(o,b,l,u,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>te(t,c,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>te(s,i,t,r,e),exports.useDelTablesCallback=(e,s,t)=>te(e,a,s,t),exports.useDelValueCallback=(e,s,t,r)=>te(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>te(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>ee("DidFinish"+G,M(t),e,s),exports.useGoBackwardCallback=Le,exports.useGoForwardCallback=me,exports.useGoToCallback=(e,s=X,t,r=m,o=X)=>{const l=E(t);return W((s=>h(l,(t=>h(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},exports.useHasCell=(e,s,t,r)=>_(b,M(r),!1,[e,s,t],4,n,u),exports.useHasCellListener=(e,s,t,r,o,l,n)=>ee(u+b,M(n),r,o,[e,s,t],l),exports.useHasRow=(e,s,t)=>_(c,M(t),!1,[e,s],3,n,u),exports.useHasRowListener=(e,s,t,r,o,l)=>ee(u+c,M(l),t,r,[e,s],o),exports.useHasTable=(e,s)=>_(i,M(s),!1,[e],2,n,u),exports.useHasTableCell=(e,s,t)=>_(i+b,M(t),!1,[e,s],3,n,u),exports.useHasTableCellListener=(e,s,t,r,o,l)=>ee(u+i+b,M(l),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>ee(u+i,M(o),s,t,[e],r),exports.useHasTables=e=>_(a,M(e),!1,[],1,n,u),exports.useHasTablesListener=(e,s,t,r)=>ee(u+a,M(r),e,s,[],t),exports.useHasValue=(e,s)=>_(R,M(s),!1,[e],2,n,u),exports.useHasValueListener=(e,s,t,r,o)=>ee(u+R,M(o),s,t,[e],r),exports.useHasValues=e=>_(k,M(e),!1,[],1,n,u),exports.useHasValuesListener=(e,s,t,r)=>ee(u+k,M(r),e,s,[],t),exports.useIndexIds=e=>_("IndexIds",F(e),X),exports.useIndexes=e=>q(e,4),exports.useIndexesIds=()=>H(5),exports.useIndexesOrIndexesById=F,exports.useLinkedRowIds=be,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>ee("Linked"+I,j(o),t,r,[e,s]),exports.useLocalRowIds=Ce,exports.useLocalRowIdsListener=(e,s,t,r,o)=>ee("Local"+I,j(o),t,r,[e,s]),exports.useMetric=pe,exports.useMetricIds=e=>_("MetricIds",D(e),X),exports.useMetricListener=(e,s,t,r)=>ee("Metric",D(r),s,t,[e]),exports.useMetrics=e=>q(e,2),exports.useMetricsIds=()=>H(3),exports.useMetricsOrMetricsById=D,exports.useProvideStore=(e,s)=>{const{12:t,13:r}=f(O);P((()=>(null==t||t(e,s),()=>null==r?void 0:r(e))),[t,e,s,r])},exports.useQueries=e=>q(e,8),exports.useQueriesIds=()=>H(9),exports.useQueriesOrQueriesById=Q,exports.useQueryIds=e=>_("QueryIds",Q(e),X),exports.useRedoInformation=e=>{var s;const r=E(e),[,,[o]]=ge(r);return[!g(o),me(r),o,null!=(s=h(o,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t]},exports.useRelationshipIds=e=>_("RelationshipIds",j(e),X),exports.useRelationships=e=>q(e,6),exports.useRelationshipsIds=()=>H(7),exports.useRelationshipsOrRelationshipsById=j,exports.useRemoteRowId=Ie,exports.useRemoteRowIdListener=(e,s,t,r,o)=>ee("RemoteRowId",j(o),t,r,[e,s]),exports.useResultCell=ve,exports.useResultCellIds=ke,exports.useResultCellIdsListener=(e,s,t,r,o)=>ee(l+w,Q(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,u)=>ee(l+b,Q(u),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>_(l+c,Q(t),Y,[e,s]),exports.useResultRowCount=(e,s)=>_(l+x,Q(s),0,[e]),exports.useResultRowCountListener=(e,s,t,r)=>ee(l+x,Q(r),s,t,[e]),exports.useResultRowIds=we,exports.useResultRowIdsListener=(e,s,t,r)=>ee(l+I,Q(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>ee(l+c,Q(o),t,r,[e,s]),exports.useResultSortedRowIds=Re,exports.useResultSortedRowIdsListener=(e,s,t,r,o,u,n,d)=>ee(l+C,Q(d),u,n,[e,s,t,r,o]),exports.useResultTable=(e,s)=>_(l+i,Q(s),Y,[e]),exports.useResultTableCellIds=(e,s)=>_(l+i+w,Q(s),X,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>ee(l+i+w,Q(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>ee(l+i,Q(r),s,t,[e]),exports.useRow=(e,s,t)=>_(c,M(t),Y,[e,s]),exports.useRowCount=(e,s)=>_(x,M(s),0,[e]),exports.useRowCountListener=(e,s,t,r,o)=>ee(x,M(o),s,t,[e],r),exports.useRowIds=le,exports.useRowIdsListener=(e,s,t,r,o)=>ee(I,M(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,l)=>ee(c,M(l),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,l,u,n)=>se(l,b,r,o,u,n,e,s,t),exports.useSetCheckpointCallback=(e=m,s=X,t,r=m,o=X)=>{const l=E(t);return W((s=>h(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>se(o,"PartialRow",t,r,l,u,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>se(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,l,u)=>se(o,c,t,r,l,u,e,s),exports.useSetTableCallback=(e,s,t,r,o,l)=>se(r,i,s,t,o,l,e),exports.useSetTablesCallback=(e,s,t,r,o)=>se(t,a,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,l)=>se(r,R,s,t,o,l,e),exports.useSetValuesCallback=(e,s,t,r,o)=>se(t,k,e,s,r,o),exports.useSliceIds=ce,exports.useSliceIdsListener=(e,s,t,r)=>ee("SliceIds",F(r),s,t,[e]),exports.useSliceRowIds=xe,exports.useSliceRowIdsListener=(e,s,t,r,o)=>ee("Slice"+I,F(o),t,r,[e,s]),exports.useSortedRowIds=ue,exports.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,d)=>ee(C,M(d),l,u,[e,s,t,r,o],n),exports.useStartTransactionListener=(e,s,t)=>ee("Start"+G,M(t),e,s),exports.useStore=e=>q(e,0),exports.useStoreIds=()=>H(1),exports.useStoreOrStoreById=M,exports.useTable=(e,s)=>_(i,M(s),Y,[e]),exports.useTableCellIds=(e,s)=>_(i+w,M(s),X,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>ee(i+w,M(o),s,t,[e],r),exports.useTableIds=oe,exports.useTableIdsListener=(e,s,t,r)=>ee(p,M(r),e,s,X,t),exports.useTableListener=(e,s,t,r,o)=>ee(i,M(o),s,t,[e],r),exports.useTables=e=>_(a,M(e),Y),exports.useTablesListener=(e,s,t,r)=>ee(a,M(r),e,s,X,t),exports.useUndoInformation=e=>{var s;const r=E(e),[o,l]=ge(r);return[(u=o,!(0==u.length)),Le(r),l,null!=(s=h(l,(e=>null==r?void 0:r.getCheckpoint(e))))?s:t];var u},exports.useValue=ae,exports.useValueIds=ie,exports.useValueIdsListener=(e,s,t,r)=>ee(v,M(r),e,s,X,t),exports.useValueListener=(e,s,t,r,o)=>ee(R,M(o),s,t,[e],r),exports.useValues=e=>_(k,M(e),Y),exports.useValuesListener=(e,s,t,r)=>ee(k,M(r),e,s,X,t),exports.useWillFinishTransactionListener=(e,s,t)=>ee("WillFinish"+G,M(t),e,s);
Binary file
@@ -109,8 +109,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
109
109
  p == size(path)
110
110
  ? arrayPush(leaves, node)
111
111
  : path[p] === null
112
- ? collForEach(node, (node2) => deep(node2, p + 1))
113
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
112
+ ? collForEach(node, (node2) => deep(node2, p + 1))
113
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
114
114
  deep(deepIdSet, 0);
115
115
  return leaves;
116
116
  };
@@ -162,10 +162,10 @@ const getListenerFunctions = (getThing) => {
162
162
  index == size(path)
163
163
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
164
164
  : isUndefined(path[index])
165
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
166
- callWithIds(...ids, id2),
167
- )
168
- : callWithIds(...ids, path[index]);
165
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
166
+ callWithIds(...ids, id2),
167
+ )
168
+ : callWithIds(...ids, path[index]);
169
169
  };
170
170
  callWithIds();
171
171
  },
@@ -344,8 +344,8 @@ const createCheckpoints = getCreateFunction((store) => {
344
344
  const action = arrayHas(backwardIds, checkpointId)
345
345
  ? goBackwardImpl
346
346
  : arrayHas(forwardIds, checkpointId)
347
- ? goForwardImpl
348
- : null;
347
+ ? goForwardImpl
348
+ : null;
349
349
  while (!isUndefined(action) && checkpointId != currentId) {
350
350
  action();
351
351
  }
@@ -279,8 +279,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
279
279
  p == size(path)
280
280
  ? arrayPush(leaves, node)
281
281
  : path[p] === null
282
- ? collForEach(node, (node2) => deep(node2, p + 1))
283
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
282
+ ? collForEach(node, (node2) => deep(node2, p + 1))
283
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
284
284
  deep(deepIdSet, 0);
285
285
  return leaves;
286
286
  };
@@ -332,10 +332,10 @@ const getListenerFunctions = (getThing) => {
332
332
  index == size(path)
333
333
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
334
334
  : isUndefined(path[index])
335
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
336
- callWithIds(...ids, id2),
337
- )
338
- : callWithIds(...ids, path[index]);
335
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
336
+ callWithIds(...ids, id2),
337
+ )
338
+ : callWithIds(...ids, path[index]);
339
339
  };
340
340
  callWithIds();
341
341
  },
@@ -369,8 +369,8 @@ const createIndexes = getCreateFunction((store) => {
369
369
  isUndefined(value)
370
370
  ? EMPTY_STRING
371
371
  : isArray(value)
372
- ? arrayMap(value, id)
373
- : id(value),
372
+ ? arrayMap(value, id)
373
+ : id(value),
374
374
  addListener,
375
375
  callListeners,
376
376
  );
@@ -139,8 +139,8 @@ const getAggregateValue = (
139
139
  aggregateValue = isUndefined(oldValue)
140
140
  ? aggregateAdd?.(aggregateValue, newValue, oldLength++)
141
141
  : isUndefined(newValue)
142
- ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
143
- : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
142
+ ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
143
+ : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
144
144
  force ||= isUndefined(aggregateValue);
145
145
  }
146
146
  });
@@ -347,8 +347,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
347
347
  p == size(path)
348
348
  ? arrayPush(leaves, node)
349
349
  : path[p] === null
350
- ? collForEach(node, (node2) => deep(node2, p + 1))
351
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
350
+ ? collForEach(node, (node2) => deep(node2, p + 1))
351
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
352
352
  deep(deepIdSet, 0);
353
353
  return leaves;
354
354
  };
@@ -400,10 +400,10 @@ const getListenerFunctions = (getThing) => {
400
400
  index == size(path)
401
401
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
402
402
  : isUndefined(path[index])
403
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
404
- callWithIds(...ids, id2),
405
- )
406
- : callWithIds(...ids, path[index]);
403
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
404
+ callWithIds(...ids, id2),
405
+ )
406
+ : callWithIds(...ids, path[index]);
407
407
  };
408
408
  callWithIds();
409
409
  },
@@ -224,35 +224,35 @@ const setTransactionChangesToDoc = (
224
224
  transactionChangesFailed
225
225
  ? 0
226
226
  : isUndefined(table)
227
- ? objDel(docTables, tableId)
228
- : ifNotUndefined(
229
- docTables[tableId],
230
- (docTable) =>
231
- objMap(table, (row, rowId) =>
232
- transactionChangesFailed
233
- ? 0
234
- : isUndefined(row)
235
- ? objDel(docTable, rowId)
236
- : ifNotUndefined(
237
- objGet(docTable, rowId),
238
- (docRow) =>
239
- objMap(row, (cell, cellId) =>
240
- isUndefined(cell)
241
- ? objDel(docRow, cellId)
242
- : (docRow[cellId] = cell),
227
+ ? objDel(docTables, tableId)
228
+ : ifNotUndefined(
229
+ docTables[tableId],
230
+ (docTable) =>
231
+ objMap(table, (row, rowId) =>
232
+ transactionChangesFailed
233
+ ? 0
234
+ : isUndefined(row)
235
+ ? objDel(docTable, rowId)
236
+ : ifNotUndefined(
237
+ objGet(docTable, rowId),
238
+ (docRow) =>
239
+ objMap(row, (cell, cellId) =>
240
+ isUndefined(cell)
241
+ ? objDel(docRow, cellId)
242
+ : (docRow[cellId] = cell),
243
+ ),
244
+ transactionChangesDidFail,
243
245
  ),
244
- transactionChangesDidFail,
245
- ),
246
- ),
247
- transactionChangesDidFail,
248
- ),
246
+ ),
247
+ transactionChangesDidFail,
248
+ ),
249
249
  );
250
250
  objMap(valueChanges, (value, valueId) =>
251
251
  transactionChangesFailed
252
252
  ? 0
253
253
  : isUndefined(value)
254
- ? objDel(docValues, valueId)
255
- : (docValues[valueId] = value),
254
+ ? objDel(docValues, valueId)
255
+ : (docValues[valueId] = value),
256
256
  );
257
257
  });
258
258
  if (transactionChangesFailed) {
@@ -275,35 +275,35 @@ const setTransactionChangesToYDoc = (
275
275
  transactionChangesFailed
276
276
  ? 0
277
277
  : isUndefined(table)
278
- ? yTables.delete(tableId)
279
- : ifNotUndefined(
280
- yTables.get(tableId),
281
- (yTable) =>
282
- objMap(table, (row, rowId) =>
283
- transactionChangesFailed
284
- ? 0
285
- : isUndefined(row)
286
- ? yTable.delete(rowId)
287
- : ifNotUndefined(
288
- yTable.get(rowId),
289
- (yRow) =>
290
- objMap(row, (cell, cellId) =>
291
- isUndefined(cell)
292
- ? yRow.delete(cellId)
293
- : yRow.set(cellId, cell),
278
+ ? yTables.delete(tableId)
279
+ : ifNotUndefined(
280
+ yTables.get(tableId),
281
+ (yTable) =>
282
+ objMap(table, (row, rowId) =>
283
+ transactionChangesFailed
284
+ ? 0
285
+ : isUndefined(row)
286
+ ? yTable.delete(rowId)
287
+ : ifNotUndefined(
288
+ yTable.get(rowId),
289
+ (yRow) =>
290
+ objMap(row, (cell, cellId) =>
291
+ isUndefined(cell)
292
+ ? yRow.delete(cellId)
293
+ : yRow.set(cellId, cell),
294
+ ),
295
+ transactionChangesDidFail,
294
296
  ),
295
- transactionChangesDidFail,
296
- ),
297
- ),
298
- transactionChangesDidFail,
299
- ),
297
+ ),
298
+ transactionChangesDidFail,
299
+ ),
300
300
  );
301
301
  objMap(valueChanges, (value, valueId) =>
302
302
  transactionChangesFailed
303
303
  ? 0
304
304
  : isUndefined(value)
305
- ? yValues.delete(valueId)
306
- : yValues.set(valueId, value),
305
+ ? yValues.delete(valueId)
306
+ : yValues.set(valueId, value),
307
307
  );
308
308
  });
309
309
  if (transactionChangesFailed) {
@@ -160,8 +160,8 @@ const getAggregateValue = (
160
160
  aggregateValue = isUndefined(oldValue)
161
161
  ? aggregateAdd?.(aggregateValue, newValue, oldLength++)
162
162
  : isUndefined(newValue)
163
- ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
164
- : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
163
+ ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
164
+ : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
165
165
  force ||= isUndefined(aggregateValue);
166
166
  }
167
167
  });
@@ -454,8 +454,8 @@ const createQueries = getCreateFunction((store) => {
454
454
  isFunction(arg1)
455
455
  ? arg1
456
456
  : isUndefined(arg3)
457
- ? (getTableCell) => getTableCell(arg1) === arg2
458
- : (getTableCell) => getTableCell(arg1, arg2) === arg3,
457
+ ? (getTableCell) => getTableCell(arg1) === arg2
458
+ : (getTableCell) => getTableCell(arg1, arg2) === arg3,
459
459
  );
460
460
  const group = (
461
461
  selectedCellId,
@@ -658,12 +658,12 @@ const createQueries = getCreateFunction((store) => {
658
658
  ...(isUndefined(arg2)
659
659
  ? [tableId, rootRowId, arg1]
660
660
  : arg1 === tableId
661
- ? [tableId, rootRowId, arg2]
662
- : [
663
- mapGet(joins, arg1)?.[0],
664
- mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
665
- arg2,
666
- ]),
661
+ ? [tableId, rootRowId, arg2]
662
+ : [
663
+ mapGet(joins, arg1)?.[0],
664
+ mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
665
+ arg2,
666
+ ]),
667
667
  );
668
668
  selectJoinWhereStore.transaction(() =>
669
669
  arrayEvery(wheres, (where2) => where2(getTableCell))
@@ -268,8 +268,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
268
268
  p == size(path)
269
269
  ? arrayPush(leaves, node)
270
270
  : path[p] === null
271
- ? collForEach(node, (node2) => deep(node2, p + 1))
272
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
271
+ ? collForEach(node, (node2) => deep(node2, p + 1))
272
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
273
273
  deep(deepIdSet, 0);
274
274
  return leaves;
275
275
  };
@@ -321,10 +321,10 @@ const getListenerFunctions = (getThing) => {
321
321
  index == size(path)
322
322
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
323
323
  : isUndefined(path[index])
324
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
325
- callWithIds(...ids, id2),
326
- )
327
- : callWithIds(...ids, path[index]);
324
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
325
+ callWithIds(...ids, id2),
326
+ )
327
+ : callWithIds(...ids, path[index]);
328
328
  };
329
329
  callWithIds();
330
330
  },
@@ -182,8 +182,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
182
182
  p == size(path)
183
183
  ? arrayPush(leaves, node)
184
184
  : path[p] === null
185
- ? collForEach(node, (node2) => deep(node2, p + 1))
186
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
185
+ ? collForEach(node, (node2) => deep(node2, p + 1))
186
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
187
187
  deep(deepIdSet, 0);
188
188
  return leaves;
189
189
  };
@@ -235,10 +235,10 @@ const getListenerFunctions = (getThing) => {
235
235
  index == size(path)
236
236
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
237
237
  : isUndefined(path[index])
238
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
239
- callWithIds(...ids, id2),
240
- )
241
- : callWithIds(...ids, path[index]);
238
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
239
+ callWithIds(...ids, id2),
240
+ )
241
+ : callWithIds(...ids, path[index]);
242
242
  };
243
243
  callWithIds();
244
244
  },
@@ -400,8 +400,8 @@ const createStore = () => {
400
400
  () => cellInvalid(tableId, rowId, cellId, cell),
401
401
  )
402
402
  : isUndefined(getCellOrValueType(cell))
403
- ? cellInvalid(tableId, rowId, cellId, cell)
404
- : cell;
403
+ ? cellInvalid(tableId, rowId, cellId, cell)
404
+ : cell;
405
405
  const validateValues = (values, skipDefaults) =>
406
406
  validate(
407
407
  skipDefaults ? values : addDefaultsToValues(values),
@@ -427,8 +427,8 @@ const createStore = () => {
427
427
  () => valueInvalid(valueId, value),
428
428
  )
429
429
  : isUndefined(getCellOrValueType(value))
430
- ? valueInvalid(valueId, value)
431
- : value;
430
+ ? valueInvalid(valueId, value)
431
+ : value;
432
432
  const addDefaultsToRow = (row, tableId, rowId) => {
433
433
  ifNotUndefined(
434
434
  mapGet(tablesSchemaRowCache, tableId),
@@ -386,8 +386,8 @@ const getWildcardedLeaves = (deepIdSet, path = [EMPTY_STRING]) => {
386
386
  p == size(path)
387
387
  ? arrayPush(leaves, node)
388
388
  : path[p] === null
389
- ? collForEach(node, (node2) => deep(node2, p + 1))
390
- : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
389
+ ? collForEach(node, (node2) => deep(node2, p + 1))
390
+ : arrayForEach([path[p], null], (id) => deep(mapGet(node, id), p + 1));
391
391
  deep(deepIdSet, 0);
392
392
  return leaves;
393
393
  };
@@ -439,10 +439,10 @@ const getListenerFunctions = (getThing) => {
439
439
  index == size(path)
440
440
  ? listener(thing, ...ids, ...extraArgsGetter(ids))
441
441
  : isUndefined(path[index])
442
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
443
- callWithIds(...ids, id2),
444
- )
445
- : callWithIds(...ids, path[index]);
442
+ ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
443
+ callWithIds(...ids, id2),
444
+ )
445
+ : callWithIds(...ids, path[index]);
446
446
  };
447
447
  callWithIds();
448
448
  },
@@ -621,8 +621,8 @@ const createCheckpoints = getCreateFunction((store) => {
621
621
  const action = arrayHas(backwardIds, checkpointId)
622
622
  ? goBackwardImpl
623
623
  : arrayHas(forwardIds, checkpointId)
624
- ? goForwardImpl
625
- : null;
624
+ ? goForwardImpl
625
+ : null;
626
626
  while (!isUndefined(action) && checkpointId != currentId) {
627
627
  action();
628
628
  }
@@ -707,8 +707,8 @@ const createIndexes = getCreateFunction((store) => {
707
707
  isUndefined(value)
708
708
  ? EMPTY_STRING
709
709
  : isArray(value)
710
- ? arrayMap(value, id)
711
- : id(value),
710
+ ? arrayMap(value, id)
711
+ : id(value),
712
712
  addListener,
713
713
  callListeners,
714
714
  );
@@ -938,8 +938,8 @@ const getAggregateValue = (
938
938
  aggregateValue = isUndefined(oldValue)
939
939
  ? aggregateAdd?.(aggregateValue, newValue, oldLength++)
940
940
  : isUndefined(newValue)
941
- ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
942
- : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
941
+ ? aggregateRemove?.(aggregateValue, oldValue, oldLength--)
942
+ : aggregateReplace?.(aggregateValue, newValue, oldValue, oldLength);
943
943
  force ||= isUndefined(aggregateValue);
944
944
  }
945
945
  });
@@ -1301,8 +1301,8 @@ const createQueries = getCreateFunction((store) => {
1301
1301
  isFunction(arg1)
1302
1302
  ? arg1
1303
1303
  : isUndefined(arg3)
1304
- ? (getTableCell) => getTableCell(arg1) === arg2
1305
- : (getTableCell) => getTableCell(arg1, arg2) === arg3,
1304
+ ? (getTableCell) => getTableCell(arg1) === arg2
1305
+ : (getTableCell) => getTableCell(arg1, arg2) === arg3,
1306
1306
  );
1307
1307
  const group = (
1308
1308
  selectedCellId,
@@ -1505,12 +1505,12 @@ const createQueries = getCreateFunction((store) => {
1505
1505
  ...(isUndefined(arg2)
1506
1506
  ? [tableId, rootRowId, arg1]
1507
1507
  : arg1 === tableId
1508
- ? [tableId, rootRowId, arg2]
1509
- : [
1510
- mapGet(joins, arg1)?.[0],
1511
- mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
1512
- arg2,
1513
- ]),
1508
+ ? [tableId, rootRowId, arg2]
1509
+ : [
1510
+ mapGet(joins, arg1)?.[0],
1511
+ mapGet(mapGet(joins, arg1)?.[4], rootRowId)?.[0],
1512
+ arg2,
1513
+ ]),
1514
1514
  );
1515
1515
  selectJoinWhereStore.transaction(() =>
1516
1516
  arrayEvery(wheres, (where2) => where2(getTableCell))
@@ -1980,8 +1980,8 @@ const createStore = () => {
1980
1980
  () => cellInvalid(tableId, rowId, cellId, cell),
1981
1981
  )
1982
1982
  : isUndefined(getCellOrValueType(cell))
1983
- ? cellInvalid(tableId, rowId, cellId, cell)
1984
- : cell;
1983
+ ? cellInvalid(tableId, rowId, cellId, cell)
1984
+ : cell;
1985
1985
  const validateValues = (values, skipDefaults) =>
1986
1986
  validate(
1987
1987
  skipDefaults ? values : addDefaultsToValues(values),
@@ -2007,8 +2007,8 @@ const createStore = () => {
2007
2007
  () => valueInvalid(valueId, value),
2008
2008
  )
2009
2009
  : isUndefined(getCellOrValueType(value))
2010
- ? valueInvalid(valueId, value)
2011
- : value;
2010
+ ? valueInvalid(valueId, value)
2011
+ : value;
2012
2012
  const addDefaultsToRow = (row, tableId, rowId) => {
2013
2013
  ifNotUndefined(
2014
2014
  mapGet(tablesSchemaRowCache, tableId),
@@ -361,8 +361,8 @@ const getCodeFunctions = () => {
361
361
  ? -1
362
362
  : 1
363
363
  : import1 > import2
364
- ? 1
365
- : -1,
364
+ ? 1
365
+ : -1,
366
366
  ),
367
367
  EMPTY_STRING,
368
368
  ],