tinybase 8.3.0-beta.0 → 8.3.0-beta.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.
Files changed (74) hide show
  1. package/@types/_internal/ui-solid/index.d.ts +0 -0
  2. package/@types/_internal/ui-solid/with-schemas/index.d.ts +1104 -0
  3. package/@types/persisters/index.d.ts +2 -2
  4. package/@types/persisters/with-schemas/index.d.ts +2 -2
  5. package/@types/queries/index.d.ts +141 -0
  6. package/@types/queries/with-schemas/index.d.ts +184 -0
  7. package/@types/ui-react/index.d.ts +6 -6
  8. package/@types/ui-react/with-schemas/index.d.ts +6 -6
  9. package/@types/ui-solid/index.d.ts +16336 -0
  10. package/@types/ui-solid/with-schemas/index.d.ts +16951 -0
  11. package/@types/ui-svelte/index.d.ts +6123 -80
  12. package/@types/ui-svelte/with-schemas/index.d.ts +7348 -89
  13. package/agents.md +3 -3
  14. package/index.js +594 -418
  15. package/indexes/index.js +8 -22
  16. package/indexes/with-schemas/index.js +8 -22
  17. package/metrics/index.js +8 -22
  18. package/metrics/with-schemas/index.js +8 -22
  19. package/min/index.js +1 -1
  20. package/min/index.js.gz +0 -0
  21. package/min/indexes/index.js +1 -1
  22. package/min/indexes/index.js.gz +0 -0
  23. package/min/indexes/with-schemas/index.js +1 -1
  24. package/min/indexes/with-schemas/index.js.gz +0 -0
  25. package/min/metrics/index.js +1 -1
  26. package/min/metrics/index.js.gz +0 -0
  27. package/min/metrics/with-schemas/index.js +1 -1
  28. package/min/metrics/with-schemas/index.js.gz +0 -0
  29. package/min/omni/index.js +1 -1
  30. package/min/omni/index.js.gz +0 -0
  31. package/min/omni/with-schemas/index.js +1 -1
  32. package/min/omni/with-schemas/index.js.gz +0 -0
  33. package/min/queries/index.js +1 -1
  34. package/min/queries/index.js.gz +0 -0
  35. package/min/queries/with-schemas/index.js +1 -1
  36. package/min/queries/with-schemas/index.js.gz +0 -0
  37. package/min/relationships/index.js +1 -1
  38. package/min/relationships/index.js.gz +0 -0
  39. package/min/relationships/with-schemas/index.js +1 -1
  40. package/min/relationships/with-schemas/index.js.gz +0 -0
  41. package/min/ui-react/index.js +1 -1
  42. package/min/ui-react/index.js.gz +0 -0
  43. package/min/ui-react/with-schemas/index.js +1 -1
  44. package/min/ui-react/with-schemas/index.js.gz +0 -0
  45. package/min/ui-solid/index.js +1 -0
  46. package/min/ui-solid/index.js.gz +0 -0
  47. package/min/ui-solid/with-schemas/index.js +1 -0
  48. package/min/ui-solid/with-schemas/index.js.gz +0 -0
  49. package/min/ui-svelte/index.js +1 -1
  50. package/min/ui-svelte/index.js.gz +0 -0
  51. package/min/ui-svelte/with-schemas/index.js +1 -1
  52. package/min/ui-svelte/with-schemas/index.js.gz +0 -0
  53. package/min/with-schemas/index.js +1 -1
  54. package/min/with-schemas/index.js.gz +0 -0
  55. package/omni/index.js +594 -418
  56. package/omni/with-schemas/index.js +594 -418
  57. package/package.json +53 -13
  58. package/queries/index.js +596 -454
  59. package/queries/with-schemas/index.js +596 -454
  60. package/readme.md +14 -14
  61. package/relationships/index.js +8 -22
  62. package/relationships/with-schemas/index.js +8 -22
  63. package/releases.md +51 -51
  64. package/ui-react/index.js +1 -1
  65. package/ui-react/with-schemas/index.js +1 -1
  66. package/ui-solid/index.js +2154 -0
  67. package/ui-solid/with-schemas/index.js +2154 -0
  68. package/ui-svelte/index.js +12 -5
  69. package/ui-svelte/with-schemas/index.js +12 -5
  70. package/ui-svelte-dom/index.js +2 -2
  71. package/ui-svelte-dom/with-schemas/index.js +2 -2
  72. package/ui-svelte-inspector/index.js +2 -2
  73. package/ui-svelte-inspector/with-schemas/index.js +2 -2
  74. package/with-schemas/index.js +594 -418
@@ -1 +1 @@
1
- import e from"react";import{jsx as t}from"react/jsx-runtime";const r=e=>typeof e,d="",o=r(d),s=r(r),n="Result",i="Has",a="Ids",l="Table",u=l+"s",c=l+a,I="Row",p=I+"Count",g=I+a,b="Sorted"+I+a,m="Cell",h=m+a,C="Value",y=C+"s",w=C+a,f="Transaction",P="Partial",R="Finish",k="Status",q="Metric",v="Slice",x="RemoteRowId",S="Local",B="Linked",T="Checkpoint",V=e=>(t,r,d)=>e(t)?d?.():r(t),L=globalThis,E=e=>null==e,O=e=>void 0===e,j=V(E),z=V(O),A=e=>r(e)==o,F=e=>r(e)==s,M=e=>Array.isArray(e),D=e=>e.length,H=()=>{},J=e=>e,N=(e,t)=>e.every(t),Q=(e,t)=>D(e)===D(t)&&N(e,(e,r)=>t[r]===e),W=(e,t)=>M(e)&&M(t)?Q(e,t):e===t,_=(e,t)=>e.map(t),G=(e,t,r)=>e.with(t,r),K=Object,U=e=>K.getPrototypeOf(e),X=K.entries,Y=e=>!E(e)&&j(U(e),e=>e==K.prototype||E(U(e)),()=>!0),Z=K.keys,$=(e,t)=>z(e,e=>e[t]),ee=(e,t,r=(e,t)=>e===t)=>{const d=X(e);return D(d)===D(Z(t))&&N(d,([e,d])=>Y(d)?!!Y(t[e])&&ee(t[e],d,r):r(d,t[e]))},te=JSON.stringify,{PureComponent:re,createContext:de,useCallback:oe,useContext:se,useEffect:ne,useLayoutEffect:ie,useMemo:ae,useRef:le,useState:ue,useSyncExternalStore:ce}=e,Ie=(e,...t)=>O(e)?{}:e(...t),pe=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],ge="tinybase_uirc",be=L[ge]?L[ge]:L[ge]=de([]),me=(e,t)=>{const r=se(be);return O(e)?r[2*t]:A(e)?$(r[2*t+1],e):e},he=(e,t)=>{const r=me(e,t);return O(e)||A(e)?r:e},Ce=(e,t,r)=>{const{16:d,17:o}=se(be);ne(()=>(d?.(r,e,t),()=>o?.(r,e)),[d,e,t,r,o])},ye=e=>Z(se(be)[2*e+1]??{}),we=0,fe=1,Pe=2,Re=3,ke=4,qe=5,ve=6,xe=7,Se=(e,t,r,d,o)=>[r??t[2*e],{...t[2*e+1],...d,...o[e]}],Be=({store:e,storesById:r,metrics:d,metricsById:o,indexes:s,indexesById:n,relationships:i,relationshipsById:a,queries:l,queriesById:u,checkpoints:c,checkpointsById:I,persister:p,persistersById:g,synchronizer:b,synchronizersById:m,children:h})=>{const C=se(be),[y,w]=ue(()=>_([,,,,,,,,].fill(0),(e,t)=>({}))),f=oe((e,t,r)=>w(d=>$(d[e],t)==r?d:G(d,e,{...d[e],[t]:r})),[]),P=oe((e,t)=>w(r=>((e,t)=>t in e)(r[e],t)?G(r,e,((e,t)=>(delete e[t],e))(r[e],t)):r),[]);return t(be.Provider,{value:ae(()=>[...Se(0,C,e,r,y),...Se(1,C,d,o,y),...Se(2,C,s,n,y),...Se(3,C,i,a,y),...Se(4,C,l,u,y),...Se(5,C,c,I,y),...Se(6,C,p,g,y),...Se(7,C,b,m,y),f,P],[y,e,r,d,o,s,n,i,a,l,u,c,I,p,g,b,m,C,f,P]),children:h})},Te=[],Ve=[{},[],[Te,void 0,Te],{},void 0,void 0,!1,0],Le=(e,t)=>e===t||(Y(e)||M(e))&&te(e)===te(t),Ee=[(e,t)=>ee(e,t,Le),Q,([e,t,r],[d,o,s])=>t===o&&Q(e,d)&&Q(r,s),(e,t)=>ee(e,t,W),W,Le],Oe=(e,t)=>e===t,je=(e,t,r=Te)=>{const[,d]=ue(),[o,s]=ue();return ne(()=>{const r=e?t(e):void 0;return s(r),d([]),r?.destroy},[e,...r]),o},ze=(e,t,...r)=>{const d=e?.["add"+t+"Listener"]?.(...r);return()=>e?.delListener?.(d)},Ae=(e,t,r,o=Te)=>{const s=le(Ve[r]),n=oe(()=>{const d=t?.[(6==r?"has":"get")+e]?.(...o)??Ve[r];return(Ee[r]??Oe)(d,s.current)?s.current:s.current=d},[t,r,e,...o]),a=oe(s=>ze(t,(6==r?i:d)+e,...o,s),[t,r,e,...o]);return ce(a,n,n)},Fe=(e,t,r,d=Te,o=Te,...s)=>ie(()=>ze(t,e,...o,r,...s),[t,e,...o,...d,...s]),Me=(e,t,r,d=Te,o=H,s=Te,n,...i)=>oe(d=>z(e,e=>z(r(d,e),r=>o(e[n+t](...Je(i,e,d),r),r))),[e,t,...d,...s,n,...Ne(i)]),De=(e,t,r,d,o,s,...n)=>Me(Ye(e),t,r,d,o,s,"set",...n),He=(e,t,r,o,s,n,...i)=>Me(Nr(e),t,r,o,s,n,d,...i),Je=(e,t,r)=>_(e,e=>F(e)?e(r,t):e),Ne=e=>{return t=e=>!F(e),e.filter(t);var t},Qe=(e,t,r=H,d=Te,...o)=>{const s=Ye(e);return oe(e=>r(s?.["del"+t](...Je(o,s,e))),[s,t,...d,...Ne(o)])},We=(e,t,r)=>{const d=yd(e);return oe(()=>d?.[t](r),[d,t,r])},_e=(e,t,r,d,o,s,n,i,a)=>Fe(b,Ye(a),s,n,[e,t,r,d,o],i),Ge=(e,t=Te)=>ae(e,t),Ke=()=>ye(0),Ue=e=>me(e,0),Xe=()=>({...se(be)[1]}),Ye=e=>he(e,0),Ze=(e,t)=>Ce(e,t,0),$e=(e,t=Te)=>ae(e,t),et=e=>Ae(u,Ye(e),6,[]),tt=e=>Ae(u,Ye(e),0),rt=e=>[tt(e),vt(J,[],e)],dt=e=>Ae(c,Ye(e),1),ot=(e,t)=>Ae(l,Ye(t),6,[e]),st=(e,t)=>Ae(l,Ye(t),0,[e]),nt=(e,t)=>[st(e,t),xt(e,J,[],t)],it=(e,t)=>Ae(l+h,Ye(t),1,[e]),at=(e,t,r)=>Ae(l+m,Ye(r),6,[e,t]),lt=(e,t)=>Ae(p,Ye(t),7,[e]),ut=(e,t)=>Ae(g,Ye(t),1,[e]),ct=(e,t,r,d,o,s)=>((e,t,r,d,o,s)=>Ae(b,Ye(s),1,[e,t,r,d,o]))(...Y(e)?[e.tableId,e.cellId,e.descending??!1,e.offset??0,e.limit,t]:[e,t,r,d,o,s]),It=(e,t,r)=>Ae(I,Ye(r),6,[e,t]),pt=(e,t,r)=>Ae(I,Ye(r),0,[e,t]),gt=(e,t,r)=>[pt(e,t,r),St(e,t,J,[],r)],bt=(e,t,r)=>Ae(h,Ye(r),1,[e,t]),mt=(e,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>Fe(n+b,Nr(a),s,i,[e,t,r,d,o]),sd=(e,t,r,d,o)=>Fe(n+I,Nr(o),r,d,[e,t]),nd=(e,t,r,d,o)=>Fe(n+h,Nr(o),r,d,[e,t]),id=(e,t,r,d,o,s)=>Fe(n+m,Nr(s),d,o,[e,t,r]),ad=(e,t)=>Ae("ParamValues",Nr(t),3,[e]),ld=(e,t)=>[ad(e,t),bd(e,J,[],t)],ud=(e,t,r)=>Ae("ParamValue",Nr(r),4,[e,t]),cd=(e,t,r)=>[ud(e,t,r),gd(e,t,J,[],r)],Id=(e,t,r,d)=>Fe("ParamValues",Nr(d),t,r,[e]),pd=(e,t,r,d,o)=>Fe("ParamValue",Nr(o),r,d,[e,t]),gd=(e,t,r,d,o,s,n)=>He(o,"setParamValue",r,d,s,n,e,t),bd=(e,t,r,d,o,s)=>He(d,"setParamValues",t,r,o,s,e),md=(e,t,r)=>je(e,t,r),hd=()=>ye(5),Cd=e=>me(e,5),yd=e=>he(e,5),wd=(e,t)=>Ce(e,t,5),fd=e=>Ae(T+a,yd(e),2),Pd=(e,t)=>Ae(T,yd(t),5,[e]),Rd=(e=H,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>{const o=e(t);d(r.addCheckpoint(o),r,o)}),[s,...t,...o])},kd=e=>We(e,"goBackward"),qd=e=>We(e,"goForward"),vd=(e,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>z(e(t),e=>d(r.goTo(e),e))),[s,...t,...o])},xd=e=>{const t=yd(e),[r,o]=fd(t);return[(s=r,!(0==D(s))),kd(t),o,z(o,e=>t?.getCheckpoint(e))??d];var s},Sd=e=>{const t=yd(e),[,,[r]]=fd(t);return[!O(r),qd(t),r,z(r,e=>t?.getCheckpoint(e))??d]},Bd=(e,t,r)=>Fe(T+a,yd(r),e,t),Td=(e,t,r,d)=>Fe(T,yd(d),t,r,[e]),Vd=(e,t,r=Te,d,o=Te,s,n=Te)=>{const[,i]=ue(),[a,l]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;l(r),r&&d&&(async()=>{await d(r),i([])})()})()},[e,...r,...o]),ne(()=>()=>{a&&(a.destroy(),s?.(a))},[a,...n]),a},Ld=()=>ye(6),Ed=e=>me(e,6),Od=e=>he(e,6),jd=(e,t)=>Ce(e,t,6),zd=e=>Ae(k,Od(e),7,[]),Ad=(e,t,r)=>Fe(k,Od(r),e,t,[]),Fd=(e,t,r=Te,d,o=Te)=>{const[s,n]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;n(r)})()},[e,...r]),ne(()=>()=>{s&&(s.destroy(),d?.(s))},[s,...o]),s},Md=()=>ye(7),Dd=e=>me(e,7),Hd=e=>he(e,7),Jd=(e,t)=>Ce(e,t,7),Nd=e=>Ae(k,Hd(e),7,[]),Qd=(e,t,r)=>Fe(k,Hd(r),e,t,[]),Wd=({children:e,separator:t,debugIds:r,id:d})=>{const o=O(t)||!M(e)?e:_(e,(e,r)=>r>0?[t,e]:e);return r&&!O(d)?[d,":{",o,"}"]:o},_d=({checkpoints:e,checkpointId:r,debugIds:o})=>t(Wd,{debugIds:o,id:r,children:Pd(r,e)??d}),Gd=({queryId:e,rowId:r,cellId:o,queries:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+($r(e,r,o,s)??d)}),Kd=({queryId:e,rowId:r,queries:d,resultCellComponent:o=Gd,getResultCellComponentProps:s,separator:n,debugIds:i})=>t(Wd,{separator:n,debugIds:i,id:r,children:_(Zr(e,r,d),n=>t(o,{...Ie(s,n),queryId:e,rowId:r,cellId:n,queries:d,debugIds:i},n))}),Ud=({tableId:e,rowId:r,cellId:o,store:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+(ht(e,r,o,s)??d)}),Xd=(e,t,r,d)=>{const o=bt(t,r,d);return e??o},Yd=({tableId:e,rowId:r,store:d,cellComponent:o=Ud,getCellComponentProps:s,customCellIds:n,separator:i,debugIds:a})=>t(Wd,{separator:i,debugIds:a,id:r,children:_(Xd(n,e,r,d),n=>t(o,{...Ie(s,n),tableId:e,rowId:r,cellId:n,store:d,debugIds:a},n))}),Zd=({tableId:e,store:r,rowComponent:d=Yd,getRowComponentProps:o,customCellIds:s,separator:n,debugIds:i},a)=>t(Wd,{separator:n,debugIds:i,id:e,children:_(a,n=>t(d,{...Ie(o,n),tableId:e,rowId:n,customCellIds:s,store:r,debugIds:i},n))}),$d=({queryId:e,queries:r,resultRowComponent:d=Kd,getResultRowComponentProps:o,separator:s,debugIds:n},i)=>t(Wd,{separator:s,debugIds:n,id:e,children:_(i,s=>t(d,{...Ie(o,s),queryId:e,rowId:s,queries:r,debugIds:n},s))}),eo=({relationshipId:e,relationships:r,rowComponent:d=Yd,getRowComponentProps:o,separator:s,debugIds:n},i,a)=>{const[l,u,c]=pe(Vr(r),e),I=i(e,a,l);return t(Wd,{separator:s,debugIds:n,id:a,children:_(I,e=>t(d,{...Ie(o,e),tableId:c,rowId:e,store:u,debugIds:n},e))})},to=e=>({checkpoints:r,checkpointComponent:d=_d,getCheckpointComponentProps:o,separator:s,debugIds:n})=>{const i=yd(r);return t(Wd,{separator:s,children:_(e(fd(i)),e=>t(d,{...Ie(o,e),checkpoints:i,checkpointId:e,debugIds:n},e))})},ro=to(e=>e[0]),oo=to(e=>O(e[1])?[]:[e[1]]),so=to(e=>e[2]),no=({indexId:e,sliceId:r,indexes:d,rowComponent:o=Yd,getRowComponentProps:s,separator:n,debugIds:i})=>{const[a,l,u]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(fr(d),e),c=qr(e,r,a);return t(Wd,{separator:n,debugIds:i,id:r,children:_(c,e=>t(o,{...Ie(s,e),tableId:u,rowId:e,store:l,debugIds:i},e))})},io=({indexId:e,indexes:r,sliceComponent:d=no,getSliceComponentProps:o,separator:s,debugIds:n})=>t(Wd,{separator:s,debugIds:n,id:e,children:_(Rr(e,r),s=>t(d,{...Ie(o,s),indexId:e,sliceId:s,indexes:r,debugIds:n},s))}),ao=e=>eo(e,zr,e.firstRowId),lo=e=>eo(e,jr,e.remoteRowId),uo=({metricId:e,metrics:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:mr(e,r)??d}),co=({relationshipId:e,localRowId:r,relationships:d,rowComponent:o=Yd,getRowComponentProps:s,debugIds:n})=>{const[i,a,,l]=pe(Vr(d),e),u=Or(e,r,i);return t(Wd,{debugIds:n,id:r,children:O(l)||O(u)?null:t(o,{...Ie(s,u),tableId:l,rowId:u,store:a,debugIds:n},u)})},Io=({cellId:e,descending:t,offset:r,limit:d,...o})=>$d(o,Xr(o.queryId,e,t,r,d,o.queries)),po=e=>$d(e,Ur(e.queryId,e.queries)),go=({cellId:e,descending:t,offset:r,limit:d,...o})=>Zd(o,ct(o.tableId,e,t,r,d,o.store)),bo=e=>Zd(e,ut(e.tableId,e.store)),mo=({store:e,tableComponent:r=bo,getTableComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(dt(e),o=>t(r,{...Ie(d,o),tableId:o,store:e,debugIds:s},o))}),ho=({valueId:e,store:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:d+(kt(e,r)??d)}),Co=({store:e,valueComponent:r=ho,getValueComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(Pt(e),o=>t(r,{...Ie(d,o),valueId:o,store:e,debugIds:s},o))});export{ro as BackwardCheckpointsView,Ud as CellView,_d as CheckpointView,oo as CurrentCheckpointView,so as ForwardCheckpointsView,io as IndexView,ao as LinkedRowsView,lo as LocalRowsView,uo as MetricView,qe as OFFSET_CHECKPOINTS,Pe as OFFSET_INDEXES,fe as OFFSET_METRICS,ve as OFFSET_PERSISTER,ke as OFFSET_QUERIES,Re as OFFSET_RELATIONSHIPS,we as OFFSET_STORE,xe as OFFSET_SYNCHRONIZER,Be as Provider,co as RemoteRowView,Gd as ResultCellView,Kd as ResultRowView,Io as ResultSortedTableView,po as ResultTableView,Yd as RowView,no as SliceView,go as SortedTableView,bo as TableView,mo as TablesView,ho as ValueView,Co as ValuesView,Bt as useAddRowCallback,ht as useCell,bt as useCellIds,$t as useCellIdsListener,tr as useCellListener,Ct as useCellState,Pd as useCheckpoint,fd as useCheckpointIds,Bd as useCheckpointIdsListener,Td as useCheckpointListener,Cd as useCheckpoints,hd as useCheckpointsIds,yd as useCheckpointsOrCheckpointsById,md as useCreateCheckpoints,Cr as useCreateIndexes,$e as useCreateMergeableStore,ur as useCreateMetrics,Vd as useCreatePersister,Dr as useCreateQueries,Sr as useCreateRelationships,Ge as useCreateStore,Fd as useCreateSynchronizer,Ft as useDelCellCallback,At as useDelRowCallback,zt as useDelTableCallback,jt as useDelTablesCallback,Dt as useDelValueCallback,Mt as useDelValuesCallback,lr as useDidFinishTransactionListener,kd as useGoBackwardCallback,qd as useGoForwardCallback,vd as useGoToCallback,mt as useHasCell,er as useHasCellListener,It as useHasRow,Yt as useHasRowListener,ot as useHasTable,at as useHasTableCell,Gt as useHasTableCellListener,Qt as useHasTableListener,et as useHasTables,Ht as useHasTablesListener,Rt as useHasValue,sr as useHasValueListener,yt as useHasValues,rr as useHasValuesListener,kr as useIndexIds,wr as useIndexes,yr as useIndexesIds,fr as useIndexesOrIndexesById,zr as useLinkedRowIds,Mr as useLinkedRowIdsListener,jr as useLocalRowIds,Fr as useLocalRowIdsListener,mr as useMetric,br as useMetricIds,hr as useMetricListener,Ir as useMetrics,cr as useMetricsIds,pr as useMetricsOrMetricsById,ud as useParamValue,pd as useParamValueListener,cd as useParamValueState,ad as useParamValues,Id as useParamValuesListener,ld as useParamValuesState,Ed as usePersister,Ld as usePersisterIds,Od as usePersisterOrPersisterById,zd as usePersisterStatus,Ad as usePersisterStatusListener,wd as useProvideCheckpoints,Pr as useProvideIndexes,gr as useProvideMetrics,jd as useProvidePersister,Qr as useProvideQueries,Lr as useProvideRelationships,Ze as useProvideStore,Jd as useProvideSynchronizer,Jr as useQueries,Hr as useQueriesIds,Nr as useQueriesOrQueriesById,Wr as useQueryIds,Sd as useRedoInformation,Er as useRelationshipIds,Tr as useRelationships,Br as useRelationshipsIds,Vr as useRelationshipsOrRelationshipsById,Or as useRemoteRowId,Ar as useRemoteRowIdListener,$r as useResultCell,Zr as useResultCellIds,nd as useResultCellIdsListener,id as useResultCellListener,Yr as useResultRow,Kr as useResultRowCount,rd as useResultRowCountListener,Ur as useResultRowIds,dd as useResultRowIdsListener,sd as useResultRowListener,Xr as useResultSortedRowIds,od as useResultSortedRowIdsListener,_r as useResultTable,Gr as useResultTableCellIds,td as useResultTableCellIdsListener,ed as useResultTableListener,pt as useRow,lt as useRowCount,Kt as useRowCountListener,ut as useRowIds,Ut as useRowIdsListener,Zt as useRowListener,gt as useRowState,Vt as useSetCellCallback,Rd as useSetCheckpointCallback,gd as useSetParamValueCallback,bd as useSetParamValuesCallback,Tt as useSetPartialRowCallback,Et as useSetPartialValuesCallback,St as useSetRowCallback,xt as useSetTableCallback,vt as useSetTablesCallback,Ot as useSetValueCallback,Lt as useSetValuesCallback,Rr as useSliceIds,vr as useSliceIdsListener,qr as useSliceRowIds,xr as useSliceRowIdsListener,ct as useSortedRowIds,Xt as useSortedRowIdsListener,_e as useSortedRowIdsListenerImpl,ir as useStartTransactionListener,Ue as useStore,Ke as useStoreIds,Ye as useStoreOrStoreById,Xe as useStores,Dd as useSynchronizer,Md as useSynchronizerIds,Hd as useSynchronizerOrSynchronizerById,Nd as useSynchronizerStatus,Qd as useSynchronizerStatusListener,st as useTable,it as useTableCellIds,_t as useTableCellIdsListener,dt as useTableIds,Nt as useTableIdsListener,Wt as useTableListener,nt as useTableState,tt as useTables,Jt as useTablesListener,rt as useTablesState,xd as useUndoInformation,kt as useValue,Pt as useValueIds,or as useValueIdsListener,nr as useValueListener,qt as useValueState,wt as useValues,dr as useValuesListener,ft as useValuesState,ar as useWillFinishTransactionListener};
1
+ import e from"react";import{jsx as t}from"react/jsx-runtime";const r=e=>typeof e,d="",o=r(d),s=r(r),n="Result",i="Has",a="Ids",l="Table",u=l+"s",c=l+a,I="Row",p=I+"Count",g=I+a,b="Sorted"+I+a,m="Cell",h=m+a,C="Value",y=C+"s",w=C+a,f="Transaction",P="Partial",R="Finish",k="Status",q="Metric",v="Slice",x="RemoteRowId",S="Local",B="Linked",T="Checkpoint",V=e=>(t,r,d)=>e(t)?d?.():r(t),L=globalThis,E=e=>null==e,O=e=>void 0===e,j=V(E),z=V(O),A=e=>r(e)==o,F=e=>r(e)==s,M=e=>Array.isArray(e),D=e=>e.length,H=()=>{},J=e=>e,N=(e,t)=>e.every(t),Q=(e,t)=>D(e)===D(t)&&N(e,(e,r)=>t[r]===e),W=(e,t)=>M(e)&&M(t)?Q(e,t):e===t,_=(e,t)=>e.map(t),G=(e,t,r)=>e.with(t,r),K=Object,U=e=>K.getPrototypeOf(e),X=K.entries,Y=e=>!E(e)&&j(U(e),e=>e==K.prototype||E(U(e)),()=>!0),Z=K.keys,$=(e,t)=>z(e,e=>e[t]),ee=(e,t,r=(e,t)=>e===t)=>{const d=X(e);return D(d)===D(Z(t))&&N(d,([e,d])=>Y(d)?!!Y(t[e])&&ee(t[e],d,r):r(d,t[e]))},te=JSON.stringify,{PureComponent:re,createContext:de,useCallback:oe,useContext:se,useEffect:ne,useLayoutEffect:ie,useMemo:ae,useRef:le,useState:ue,useSyncExternalStore:ce}=e,Ie=(e,...t)=>O(e)?{}:e(...t),pe=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],ge="tinybase_uirc",be=L[ge]?L[ge]:L[ge]=de([]),me=(e,t)=>{const r=se(be);return O(e)?r[2*t]:A(e)?$(r[2*t+1],e):e},he=(e,t)=>{const r=me(e,t);return O(e)||A(e)?r:e},Ce=(e,t,r)=>{const{16:d,17:o}=se(be);ne(()=>(d?.(r,e,t),()=>o?.(r,e)),[d,e,t,r,o])},ye=e=>Z(se(be)[2*e+1]??{}),we=0,fe=1,Pe=2,Re=3,ke=4,qe=5,ve=6,xe=7,Se=(e,t,r,d,o)=>[r??t[2*e],{...t[2*e+1],...d,...o[e]}],Be=({store:e,storesById:r,metrics:d,metricsById:o,indexes:s,indexesById:n,relationships:i,relationshipsById:a,queries:l,queriesById:u,checkpoints:c,checkpointsById:I,persister:p,persistersById:g,synchronizer:b,synchronizersById:m,children:h})=>{const C=se(be),[y,w]=ue(()=>_([,,,,,,,,].fill(0),(e,t)=>({}))),f=oe((e,t,r)=>w(d=>$(d[e],t)==r?d:G(d,e,{...d[e],[t]:r})),[]),P=oe((e,t)=>w(r=>((e,t)=>t in e)(r[e],t)?G(r,e,((e,t)=>(delete e[t],e))(r[e],t)):r),[]);return t(be.Provider,{value:ae(()=>[...Se(0,C,e,r,y),...Se(1,C,d,o,y),...Se(2,C,s,n,y),...Se(3,C,i,a,y),...Se(4,C,l,u,y),...Se(5,C,c,I,y),...Se(6,C,p,g,y),...Se(7,C,b,m,y),f,P],[y,e,r,d,o,s,n,i,a,l,u,c,I,p,g,b,m,C,f,P]),children:h})},Te=[],Ve=[{},[],[Te,void 0,Te],{},void 0,void 0,!1,0],Le=(e,t)=>e===t||(Y(e)||M(e))&&te(e)===te(t),Ee=[(e,t)=>ee(e,t,Le),Q,([e,t,r],[d,o,s])=>t===o&&Q(e,d)&&Q(r,s),(e,t)=>ee(e,t,W),W,Le],Oe=(e,t)=>e===t,je=(e,t,r=Te)=>{const[,d]=ue(),[o,s]=ue();return ne(()=>{const r=e?t(e):void 0;return s(r),d([]),r?.destroy},[e,...r]),o},ze=(e,t,...r)=>{const d=e?.["add"+t+"Listener"]?.(...r);return()=>e?.delListener?.(d)},Ae=(e,t,r,o=Te)=>{const s=le(Ve[r]),n=oe(()=>{const d=t?.[(6==r?"has":"get")+e]?.(...o)??Ve[r];return(Ee[r]??Oe)(d,s.current)?s.current:s.current=d},[t,r,e,...o]),a=oe(s=>ze(t,(6==r?i:d)+e,...o,s),[t,r,e,...o]);return ce(a,n,n)},Fe=(e,t,r,d=Te,o=Te,...s)=>ie(()=>ze(t,e,...o,r,...s),[t,e,...o,...d,...s]),Me=(e,t,r,d=Te,o=H,s=Te,n,...i)=>oe(d=>z(e,e=>z(r(d,e),r=>o(e[n+t](...Je(i,e,d),r),r))),[e,t,...d,...s,n,...Ne(i)]),De=(e,t,r,d,o,s,...n)=>Me(Ye(e),t,r,d,o,s,"set",...n),He=(e,t,r,o,s,n,...i)=>Me(Nr(e),t,r,o,s,n,d,...i),Je=(e,t,r)=>_(e,e=>F(e)?e(r,t):e),Ne=e=>{return t=e=>!F(e),e.filter(t);var t},Qe=(e,t,r=H,d=Te,...o)=>{const s=Ye(e);return oe(e=>r(s?.["del"+t](...Je(o,s,e))),[s,t,...d,...Ne(o)])},We=(e,t,r)=>{const d=yd(e);return oe(()=>d?.[t](r),[d,t,r])},_e=(e,t,r,d,o,s,n,i,a)=>Fe(b,Ye(a),s,n,[e,t,r,d,o],i),Ge=(e,t=Te)=>ae(e,t),Ke=()=>ye(0),Ue=e=>me(e,0),Xe=()=>({...se(be)[1]}),Ye=e=>he(e,0),Ze=(e,t)=>Ce(e,t,0),$e=(e,t=Te)=>ae(e,t),et=e=>Ae(u,Ye(e),6,[]),tt=e=>Ae(u,Ye(e),0),rt=e=>[tt(e),vt(J,[],e)],dt=e=>Ae(c,Ye(e),1),ot=(e,t)=>Ae(l,Ye(t),6,[e]),st=(e,t)=>Ae(l,Ye(t),0,[e]),nt=(e,t)=>[st(e,t),xt(e,J,[],t)],it=(e,t)=>Ae(l+h,Ye(t),1,[e]),at=(e,t,r)=>Ae(l+m,Ye(r),6,[e,t]),lt=(e,t)=>Ae(p,Ye(t),7,[e]),ut=(e,t)=>Ae(g,Ye(t),1,[e]),ct=(e,t,r,d,o,s)=>((e,t,r,d,o,s)=>Ae(b,Ye(s),1,[e,t,r,d,o]))(...Y(e)?[e.tableId,e.cellId,e.descending??!1,e.offset??0,e.limit,t]:[e,t,r,d,o,s]),It=(e,t,r)=>Ae(I,Ye(r),6,[e,t]),pt=(e,t,r)=>Ae(I,Ye(r),0,[e,t]),gt=(e,t,r)=>[pt(e,t,r),St(e,t,J,[],r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e(n+g,Nr(d),t,r,[e]),od=(e,t,r,d,o,s,i,a)=>Fe(n+b,Nr(a),s,i,[e,t,r,d,o]),sd=(e,t,r,d,o)=>Fe(n+I,Nr(o),r,d,[e,t]),nd=(e,t,r,d,o)=>Fe(n+h,Nr(o),r,d,[e,t]),id=(e,t,r,d,o,s)=>Fe(n+m,Nr(s),d,o,[e,t,r]),ad=(e,t)=>Ae("ParamValues",Nr(t),3,[e]),ld=(e,t)=>[ad(e,t),bd(e,J,[],t)],ud=(e,t,r)=>Ae("ParamValue",Nr(r),4,[e,t]),cd=(e,t,r)=>[ud(e,t,r),gd(e,t,J,[],r)],Id=(e,t,r,d)=>Fe("ParamValues",Nr(d),t,r,[e]),pd=(e,t,r,d,o)=>Fe("ParamValue",Nr(o),r,d,[e,t]),gd=(e,t,r,d,o,s,n)=>He(o,"setParamValue",r,d,s,n,e,t),bd=(e,t,r,d,o,s)=>He(d,"setParamValues",t,r,o,s,e),md=(e,t,r)=>je(e,t,r),hd=()=>ye(5),Cd=e=>me(e,5),yd=e=>he(e,5),wd=(e,t)=>Ce(e,t,5),fd=e=>Ae(T+a,yd(e),2),Pd=(e,t)=>Ae(T,yd(t),5,[e]),Rd=(e=H,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>{const o=e(t);d(r.addCheckpoint(o),r,o)}),[s,...t,...o])},kd=e=>We(e,"goBackward"),qd=e=>We(e,"goForward"),vd=(e,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>z(e(t),e=>d(r.goTo(e),e))),[s,...t,...o])},xd=e=>{const t=yd(e),[r,o]=fd(t);return[(s=r,!(0==D(s))),kd(t),o,z(o,e=>t?.getCheckpoint(e))??d];var s},Sd=e=>{const t=yd(e),[,,[r]]=fd(t);return[!O(r),qd(t),r,z(r,e=>t?.getCheckpoint(e))??d]},Bd=(e,t,r)=>Fe(T+a,yd(r),e,t),Td=(e,t,r,d)=>Fe(T,yd(d),t,r,[e]),Vd=(e,t,r=Te,d,o=Te,s,n=Te)=>{const[,i]=ue(),[a,l]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;l(r),r&&d&&(async()=>{await d(r),i([])})()})()},[e,...r,...o]),ne(()=>()=>{a&&(a.destroy(),s?.(a))},[a,...n]),a},Ld=()=>ye(6),Ed=e=>me(e,6),Od=e=>he(e,6),jd=(e,t)=>Ce(e,t,6),zd=e=>Ae(k,Od(e),7,[]),Ad=(e,t,r)=>Fe(k,Od(r),e,t,[]),Fd=(e,t,r=Te,d,o=Te)=>{const[s,n]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;n(r)})()},[e,...r]),ne(()=>()=>{s&&(s.destroy(),d?.(s))},[s,...o]),s},Md=()=>ye(7),Dd=e=>me(e,7),Hd=e=>he(e,7),Jd=(e,t)=>Ce(e,t,7),Nd=e=>Ae(k,Hd(e),7,[]),Qd=(e,t,r)=>Fe(k,Hd(r),e,t,[]),Wd=({children:e,separator:t,debugIds:r,id:d})=>{const o=O(t)||!M(e)?e:_(e,(e,r)=>r>0?[t,e]:e);return r&&!O(d)?[d,":{",o,"}"]:o},_d=({checkpoints:e,checkpointId:r,debugIds:o})=>t(Wd,{debugIds:o,id:r,children:Pd(r,e)??d}),Gd=({queryId:e,rowId:r,cellId:o,queries:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+($r(e,r,o,s)??d)}),Kd=({queryId:e,rowId:r,queries:d,resultCellComponent:o=Gd,getResultCellComponentProps:s,separator:n,debugIds:i})=>t(Wd,{separator:n,debugIds:i,id:r,children:_(Zr(e,r,d),n=>t(o,{...Ie(s,n),queryId:e,rowId:r,cellId:n,queries:d,debugIds:i},n))}),Ud=({tableId:e,rowId:r,cellId:o,store:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+(ht(e,r,o,s)??d)}),Xd=(e,t,r,d)=>{const o=bt(t,r,d);return e??o},Yd=({tableId:e,rowId:r,store:d,cellComponent:o=Ud,getCellComponentProps:s,customCellIds:n,separator:i,debugIds:a})=>t(Wd,{separator:i,debugIds:a,id:r,children:_(Xd(n,e,r,d),n=>t(o,{...Ie(s,n),tableId:e,rowId:r,cellId:n,store:d,debugIds:a},n))}),Zd=({tableId:e,store:r,rowComponent:d=Yd,getRowComponentProps:o,customCellIds:s,separator:n,debugIds:i},a)=>t(Wd,{separator:n,debugIds:i,id:e,children:_(a,n=>t(d,{...Ie(o,n),tableId:e,rowId:n,customCellIds:s,store:r,debugIds:i},n))}),$d=({queryId:e,queries:r,resultRowComponent:d=Kd,getResultRowComponentProps:o,separator:s,debugIds:n},i)=>t(Wd,{separator:s,debugIds:n,id:e,children:_(i,s=>t(d,{...Ie(o,s),queryId:e,rowId:s,queries:r,debugIds:n},s))}),eo=({relationshipId:e,relationships:r,rowComponent:d=Yd,getRowComponentProps:o,separator:s,debugIds:n},i,a)=>{const[l,u,c]=pe(Vr(r),e),I=i(e,a,l);return t(Wd,{separator:s,debugIds:n,id:a,children:_(I,e=>t(d,{...Ie(o,e),tableId:c,rowId:e,store:u,debugIds:n},e))})},to=e=>({checkpoints:r,checkpointComponent:d=_d,getCheckpointComponentProps:o,separator:s,debugIds:n})=>{const i=yd(r);return t(Wd,{separator:s,children:_(e(fd(i)),e=>t(d,{...Ie(o,e),checkpoints:i,checkpointId:e,debugIds:n},e))})},ro=to(e=>e[0]),oo=to(e=>E(e[1])?[]:[e[1]]),so=to(e=>e[2]),no=({indexId:e,sliceId:r,indexes:d,rowComponent:o=Yd,getRowComponentProps:s,separator:n,debugIds:i})=>{const[a,l,u]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(fr(d),e),c=qr(e,r,a);return t(Wd,{separator:n,debugIds:i,id:r,children:_(c,e=>t(o,{...Ie(s,e),tableId:u,rowId:e,store:l,debugIds:i},e))})},io=({indexId:e,indexes:r,sliceComponent:d=no,getSliceComponentProps:o,separator:s,debugIds:n})=>t(Wd,{separator:s,debugIds:n,id:e,children:_(Rr(e,r),s=>t(d,{...Ie(o,s),indexId:e,sliceId:s,indexes:r,debugIds:n},s))}),ao=e=>eo(e,zr,e.firstRowId),lo=e=>eo(e,jr,e.remoteRowId),uo=({metricId:e,metrics:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:mr(e,r)??d}),co=({relationshipId:e,localRowId:r,relationships:d,rowComponent:o=Yd,getRowComponentProps:s,debugIds:n})=>{const[i,a,,l]=pe(Vr(d),e),u=Or(e,r,i);return t(Wd,{debugIds:n,id:r,children:O(l)||O(u)?null:t(o,{...Ie(s,u),tableId:l,rowId:u,store:a,debugIds:n},u)})},Io=({cellId:e,descending:t,offset:r,limit:d,...o})=>$d(o,Xr(o.queryId,e,t,r,d,o.queries)),po=e=>$d(e,Ur(e.queryId,e.queries)),go=({cellId:e,descending:t,offset:r,limit:d,...o})=>Zd(o,ct(o.tableId,e,t,r,d,o.store)),bo=e=>Zd(e,ut(e.tableId,e.store)),mo=({store:e,tableComponent:r=bo,getTableComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(dt(e),o=>t(r,{...Ie(d,o),tableId:o,store:e,debugIds:s},o))}),ho=({valueId:e,store:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:d+(kt(e,r)??d)}),Co=({store:e,valueComponent:r=ho,getValueComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(Pt(e),o=>t(r,{...Ie(d,o),valueId:o,store:e,debugIds:s},o))});export{ro as BackwardCheckpointsView,Ud as CellView,_d as CheckpointView,oo as CurrentCheckpointView,so as ForwardCheckpointsView,io as IndexView,ao as LinkedRowsView,lo as LocalRowsView,uo as MetricView,qe as OFFSET_CHECKPOINTS,Pe as OFFSET_INDEXES,fe as OFFSET_METRICS,ve as OFFSET_PERSISTER,ke as OFFSET_QUERIES,Re as OFFSET_RELATIONSHIPS,we as OFFSET_STORE,xe as OFFSET_SYNCHRONIZER,Be as Provider,co as RemoteRowView,Gd as ResultCellView,Kd as ResultRowView,Io as ResultSortedTableView,po as ResultTableView,Yd as RowView,no as SliceView,go as SortedTableView,bo as TableView,mo as TablesView,ho as ValueView,Co as ValuesView,Bt as useAddRowCallback,ht as useCell,bt as useCellIds,$t as useCellIdsListener,tr as useCellListener,Ct as useCellState,Pd as useCheckpoint,fd as useCheckpointIds,Bd as useCheckpointIdsListener,Td as useCheckpointListener,Cd as useCheckpoints,hd as useCheckpointsIds,yd as useCheckpointsOrCheckpointsById,md as useCreateCheckpoints,Cr as useCreateIndexes,$e as useCreateMergeableStore,ur as useCreateMetrics,Vd as useCreatePersister,Dr as useCreateQueries,Sr as useCreateRelationships,Ge as useCreateStore,Fd as useCreateSynchronizer,Ft as useDelCellCallback,At as useDelRowCallback,zt as useDelTableCallback,jt as useDelTablesCallback,Dt as useDelValueCallback,Mt as useDelValuesCallback,lr as useDidFinishTransactionListener,kd as useGoBackwardCallback,qd as useGoForwardCallback,vd as useGoToCallback,mt as useHasCell,er as useHasCellListener,It as useHasRow,Yt as useHasRowListener,ot as useHasTable,at as useHasTableCell,Gt as useHasTableCellListener,Qt as useHasTableListener,et as useHasTables,Ht as useHasTablesListener,Rt as useHasValue,sr as useHasValueListener,yt as useHasValues,rr as useHasValuesListener,kr as useIndexIds,wr as useIndexes,yr as useIndexesIds,fr as useIndexesOrIndexesById,zr as useLinkedRowIds,Mr as useLinkedRowIdsListener,jr as useLocalRowIds,Fr as useLocalRowIdsListener,mr as useMetric,br as useMetricIds,hr as useMetricListener,Ir as useMetrics,cr as useMetricsIds,pr as useMetricsOrMetricsById,ud as useParamValue,pd as useParamValueListener,cd as useParamValueState,ad as useParamValues,Id as useParamValuesListener,ld as useParamValuesState,Ed as usePersister,Ld as usePersisterIds,Od as usePersisterOrPersisterById,zd as usePersisterStatus,Ad as usePersisterStatusListener,wd as useProvideCheckpoints,Pr as useProvideIndexes,gr as useProvideMetrics,jd as useProvidePersister,Qr as useProvideQueries,Lr as useProvideRelationships,Ze as useProvideStore,Jd as useProvideSynchronizer,Jr as useQueries,Hr as useQueriesIds,Nr as useQueriesOrQueriesById,Wr as useQueryIds,Sd as useRedoInformation,Er as useRelationshipIds,Tr as useRelationships,Br as useRelationshipsIds,Vr as useRelationshipsOrRelationshipsById,Or as useRemoteRowId,Ar as useRemoteRowIdListener,$r as useResultCell,Zr as useResultCellIds,nd as useResultCellIdsListener,id as useResultCellListener,Yr as useResultRow,Kr as useResultRowCount,rd as useResultRowCountListener,Ur as useResultRowIds,dd as useResultRowIdsListener,sd as useResultRowListener,Xr as useResultSortedRowIds,od as useResultSortedRowIdsListener,_r as useResultTable,Gr as useResultTableCellIds,td as useResultTableCellIdsListener,ed as useResultTableListener,pt as useRow,lt as useRowCount,Kt as useRowCountListener,ut as useRowIds,Ut as useRowIdsListener,Zt as useRowListener,gt as useRowState,Vt as useSetCellCallback,Rd as useSetCheckpointCallback,gd as useSetParamValueCallback,bd as useSetParamValuesCallback,Tt as useSetPartialRowCallback,Et as useSetPartialValuesCallback,St as useSetRowCallback,xt as useSetTableCallback,vt as useSetTablesCallback,Ot as useSetValueCallback,Lt as useSetValuesCallback,Rr as useSliceIds,vr as useSliceIdsListener,qr as useSliceRowIds,xr as useSliceRowIdsListener,ct as useSortedRowIds,Xt as useSortedRowIdsListener,_e as useSortedRowIdsListenerImpl,ir as useStartTransactionListener,Ue as useStore,Ke as useStoreIds,Ye as useStoreOrStoreById,Xe as useStores,Dd as useSynchronizer,Md as useSynchronizerIds,Hd as useSynchronizerOrSynchronizerById,Nd as useSynchronizerStatus,Qd as useSynchronizerStatusListener,st as useTable,it as useTableCellIds,_t as useTableCellIdsListener,dt as useTableIds,Nt as useTableIdsListener,Wt as useTableListener,nt as useTableState,tt as useTables,Jt as useTablesListener,rt as useTablesState,xd as useUndoInformation,kt as useValue,Pt as useValueIds,or as useValueIdsListener,nr as useValueListener,qt as useValueState,wt as useValues,dr as useValuesListener,ft as useValuesState,ar as useWillFinishTransactionListener};
Binary file
@@ -1 +1 @@
1
- import e from"react";import{jsx as t}from"react/jsx-runtime";const r=e=>typeof e,d="",o=r(d),s=r(r),n="Result",i="Has",a="Ids",l="Table",u=l+"s",c=l+a,I="Row",p=I+"Count",g=I+a,b="Sorted"+I+a,m="Cell",h=m+a,C="Value",y=C+"s",w=C+a,f="Transaction",P="Partial",R="Finish",k="Status",q="Metric",v="Slice",x="RemoteRowId",S="Local",B="Linked",T="Checkpoint",V=e=>(t,r,d)=>e(t)?d?.():r(t),L=globalThis,E=e=>null==e,O=e=>void 0===e,j=V(E),z=V(O),A=e=>r(e)==o,F=e=>r(e)==s,M=e=>Array.isArray(e),D=e=>e.length,H=()=>{},J=e=>e,N=(e,t)=>e.every(t),Q=(e,t)=>D(e)===D(t)&&N(e,(e,r)=>t[r]===e),W=(e,t)=>M(e)&&M(t)?Q(e,t):e===t,_=(e,t)=>e.map(t),G=(e,t,r)=>e.with(t,r),K=Object,U=e=>K.getPrototypeOf(e),X=K.entries,Y=e=>!E(e)&&j(U(e),e=>e==K.prototype||E(U(e)),()=>!0),Z=K.keys,$=(e,t)=>z(e,e=>e[t]),ee=(e,t,r=(e,t)=>e===t)=>{const d=X(e);return D(d)===D(Z(t))&&N(d,([e,d])=>Y(d)?!!Y(t[e])&&ee(t[e],d,r):r(d,t[e]))},te=JSON.stringify,{PureComponent:re,createContext:de,useCallback:oe,useContext:se,useEffect:ne,useLayoutEffect:ie,useMemo:ae,useRef:le,useState:ue,useSyncExternalStore:ce}=e,Ie=(e,...t)=>O(e)?{}:e(...t),pe=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],ge="tinybase_uirc",be=L[ge]?L[ge]:L[ge]=de([]),me=(e,t)=>{const r=se(be);return O(e)?r[2*t]:A(e)?$(r[2*t+1],e):e},he=(e,t)=>{const r=me(e,t);return O(e)||A(e)?r:e},Ce=(e,t,r)=>{const{16:d,17:o}=se(be);ne(()=>(d?.(r,e,t),()=>o?.(r,e)),[d,e,t,r,o])},ye=e=>Z(se(be)[2*e+1]??{}),we=0,fe=1,Pe=2,Re=3,ke=4,qe=5,ve=6,xe=7,Se=(e,t,r,d,o)=>[r??t[2*e],{...t[2*e+1],...d,...o[e]}],Be=({store:e,storesById:r,metrics:d,metricsById:o,indexes:s,indexesById:n,relationships:i,relationshipsById:a,queries:l,queriesById:u,checkpoints:c,checkpointsById:I,persister:p,persistersById:g,synchronizer:b,synchronizersById:m,children:h})=>{const C=se(be),[y,w]=ue(()=>_([,,,,,,,,].fill(0),(e,t)=>({}))),f=oe((e,t,r)=>w(d=>$(d[e],t)==r?d:G(d,e,{...d[e],[t]:r})),[]),P=oe((e,t)=>w(r=>((e,t)=>t in e)(r[e],t)?G(r,e,((e,t)=>(delete e[t],e))(r[e],t)):r),[]);return t(be.Provider,{value:ae(()=>[...Se(0,C,e,r,y),...Se(1,C,d,o,y),...Se(2,C,s,n,y),...Se(3,C,i,a,y),...Se(4,C,l,u,y),...Se(5,C,c,I,y),...Se(6,C,p,g,y),...Se(7,C,b,m,y),f,P],[y,e,r,d,o,s,n,i,a,l,u,c,I,p,g,b,m,C,f,P]),children:h})},Te=[],Ve=[{},[],[Te,void 0,Te],{},void 0,void 0,!1,0],Le=(e,t)=>e===t||(Y(e)||M(e))&&te(e)===te(t),Ee=[(e,t)=>ee(e,t,Le),Q,([e,t,r],[d,o,s])=>t===o&&Q(e,d)&&Q(r,s),(e,t)=>ee(e,t,W),W,Le],Oe=(e,t)=>e===t,je=(e,t,r=Te)=>{const[,d]=ue(),[o,s]=ue();return ne(()=>{const r=e?t(e):void 0;return s(r),d([]),r?.destroy},[e,...r]),o},ze=(e,t,...r)=>{const d=e?.["add"+t+"Listener"]?.(...r);return()=>e?.delListener?.(d)},Ae=(e,t,r,o=Te)=>{const s=le(Ve[r]),n=oe(()=>{const d=t?.[(6==r?"has":"get")+e]?.(...o)??Ve[r];return(Ee[r]??Oe)(d,s.current)?s.current:s.current=d},[t,r,e,...o]),a=oe(s=>ze(t,(6==r?i:d)+e,...o,s),[t,r,e,...o]);return ce(a,n,n)},Fe=(e,t,r,d=Te,o=Te,...s)=>ie(()=>ze(t,e,...o,r,...s),[t,e,...o,...d,...s]),Me=(e,t,r,d=Te,o=H,s=Te,n,...i)=>oe(d=>z(e,e=>z(r(d,e),r=>o(e[n+t](...Je(i,e,d),r),r))),[e,t,...d,...s,n,...Ne(i)]),De=(e,t,r,d,o,s,...n)=>Me(Ye(e),t,r,d,o,s,"set",...n),He=(e,t,r,o,s,n,...i)=>Me(Nr(e),t,r,o,s,n,d,...i),Je=(e,t,r)=>_(e,e=>F(e)?e(r,t):e),Ne=e=>{return t=e=>!F(e),e.filter(t);var t},Qe=(e,t,r=H,d=Te,...o)=>{const s=Ye(e);return oe(e=>r(s?.["del"+t](...Je(o,s,e))),[s,t,...d,...Ne(o)])},We=(e,t,r)=>{const d=yd(e);return oe(()=>d?.[t](r),[d,t,r])},_e=(e,t,r,d,o,s,n,i,a)=>Fe(b,Ye(a),s,n,[e,t,r,d,o],i),Ge=(e,t=Te)=>ae(e,t),Ke=()=>ye(0),Ue=e=>me(e,0),Xe=()=>({...se(be)[1]}),Ye=e=>he(e,0),Ze=(e,t)=>Ce(e,t,0),$e=(e,t=Te)=>ae(e,t),et=e=>Ae(u,Ye(e),6,[]),tt=e=>Ae(u,Ye(e),0),rt=e=>[tt(e),vt(J,[],e)],dt=e=>Ae(c,Ye(e),1),ot=(e,t)=>Ae(l,Ye(t),6,[e]),st=(e,t)=>Ae(l,Ye(t),0,[e]),nt=(e,t)=>[st(e,t),xt(e,J,[],t)],it=(e,t)=>Ae(l+h,Ye(t),1,[e]),at=(e,t,r)=>Ae(l+m,Ye(r),6,[e,t]),lt=(e,t)=>Ae(p,Ye(t),7,[e]),ut=(e,t)=>Ae(g,Ye(t),1,[e]),ct=(e,t,r,d,o,s)=>((e,t,r,d,o,s)=>Ae(b,Ye(s),1,[e,t,r,d,o]))(...Y(e)?[e.tableId,e.cellId,e.descending??!1,e.offset??0,e.limit,t]:[e,t,r,d,o,s]),It=(e,t,r)=>Ae(I,Ye(r),6,[e,t]),pt=(e,t,r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[e]),rd=(e,t,r,d)=>Fe(n+p,Nr(d),t,r,[e]),dd=(e,t,r,d)=>Fe(n+g,Nr(d),t,r,[e]),od=(e,t,r,d,o,s,i,a)=>Fe(n+b,Nr(a),s,i,[e,t,r,d,o]),sd=(e,t,r,d,o)=>Fe(n+I,Nr(o),r,d,[e,t]),nd=(e,t,r,d,o)=>Fe(n+h,Nr(o),r,d,[e,t]),id=(e,t,r,d,o,s)=>Fe(n+m,Nr(s),d,o,[e,t,r]),ad=(e,t)=>Ae("ParamValues",Nr(t),3,[e]),ld=(e,t)=>[ad(e,t),bd(e,J,[],t)],ud=(e,t,r)=>Ae("ParamValue",Nr(r),4,[e,t]),cd=(e,t,r)=>[ud(e,t,r),gd(e,t,J,[],r)],Id=(e,t,r,d)=>Fe("ParamValues",Nr(d),t,r,[e]),pd=(e,t,r,d,o)=>Fe("ParamValue",Nr(o),r,d,[e,t]),gd=(e,t,r,d,o,s,n)=>He(o,"setParamValue",r,d,s,n,e,t),bd=(e,t,r,d,o,s)=>He(d,"setParamValues",t,r,o,s,e),md=(e,t,r)=>je(e,t,r),hd=()=>ye(5),Cd=e=>me(e,5),yd=e=>he(e,5),wd=(e,t)=>Ce(e,t,5),fd=e=>Ae(T+a,yd(e),2),Pd=(e,t)=>Ae(T,yd(t),5,[e]),Rd=(e=H,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>{const o=e(t);d(r.addCheckpoint(o),r,o)}),[s,...t,...o])},kd=e=>We(e,"goBackward"),qd=e=>We(e,"goForward"),vd=(e,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>z(e(t),e=>d(r.goTo(e),e))),[s,...t,...o])},xd=e=>{const t=yd(e),[r,o]=fd(t);return[(s=r,!(0==D(s))),kd(t),o,z(o,e=>t?.getCheckpoint(e))??d];var s},Sd=e=>{const t=yd(e),[,,[r]]=fd(t);return[!O(r),qd(t),r,z(r,e=>t?.getCheckpoint(e))??d]},Bd=(e,t,r)=>Fe(T+a,yd(r),e,t),Td=(e,t,r,d)=>Fe(T,yd(d),t,r,[e]),Vd=(e,t,r=Te,d,o=Te,s,n=Te)=>{const[,i]=ue(),[a,l]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;l(r),r&&d&&(async()=>{await d(r),i([])})()})()},[e,...r,...o]),ne(()=>()=>{a&&(a.destroy(),s?.(a))},[a,...n]),a},Ld=()=>ye(6),Ed=e=>me(e,6),Od=e=>he(e,6),jd=(e,t)=>Ce(e,t,6),zd=e=>Ae(k,Od(e),7,[]),Ad=(e,t,r)=>Fe(k,Od(r),e,t,[]),Fd=(e,t,r=Te,d,o=Te)=>{const[s,n]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;n(r)})()},[e,...r]),ne(()=>()=>{s&&(s.destroy(),d?.(s))},[s,...o]),s},Md=()=>ye(7),Dd=e=>me(e,7),Hd=e=>he(e,7),Jd=(e,t)=>Ce(e,t,7),Nd=e=>Ae(k,Hd(e),7,[]),Qd=(e,t,r)=>Fe(k,Hd(r),e,t,[]),Wd=({children:e,separator:t,debugIds:r,id:d})=>{const o=O(t)||!M(e)?e:_(e,(e,r)=>r>0?[t,e]:e);return r&&!O(d)?[d,":{",o,"}"]:o},_d=({checkpoints:e,checkpointId:r,debugIds:o})=>t(Wd,{debugIds:o,id:r,children:Pd(r,e)??d}),Gd=({queryId:e,rowId:r,cellId:o,queries:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+($r(e,r,o,s)??d)}),Kd=({queryId:e,rowId:r,queries:d,resultCellComponent:o=Gd,getResultCellComponentProps:s,separator:n,debugIds:i})=>t(Wd,{separator:n,debugIds:i,id:r,children:_(Zr(e,r,d),n=>t(o,{...Ie(s,n),queryId:e,rowId:r,cellId:n,queries:d,debugIds:i},n))}),Ud=({tableId:e,rowId:r,cellId:o,store:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+(ht(e,r,o,s)??d)}),Xd=(e,t,r,d)=>{const o=bt(t,r,d);return e??o},Yd=({tableId:e,rowId:r,store:d,cellComponent:o=Ud,getCellComponentProps:s,customCellIds:n,separator:i,debugIds:a})=>t(Wd,{separator:i,debugIds:a,id:r,children:_(Xd(n,e,r,d),n=>t(o,{...Ie(s,n),tableId:e,rowId:r,cellId:n,store:d,debugIds:a},n))}),Zd=({tableId:e,store:r,rowComponent:d=Yd,getRowComponentProps:o,customCellIds:s,separator:n,debugIds:i},a)=>t(Wd,{separator:n,debugIds:i,id:e,children:_(a,n=>t(d,{...Ie(o,n),tableId:e,rowId:n,customCellIds:s,store:r,debugIds:i},n))}),$d=({queryId:e,queries:r,resultRowComponent:d=Kd,getResultRowComponentProps:o,separator:s,debugIds:n},i)=>t(Wd,{separator:s,debugIds:n,id:e,children:_(i,s=>t(d,{...Ie(o,s),queryId:e,rowId:s,queries:r,debugIds:n},s))}),eo=({relationshipId:e,relationships:r,rowComponent:d=Yd,getRowComponentProps:o,separator:s,debugIds:n},i,a)=>{const[l,u,c]=pe(Vr(r),e),I=i(e,a,l);return t(Wd,{separator:s,debugIds:n,id:a,children:_(I,e=>t(d,{...Ie(o,e),tableId:c,rowId:e,store:u,debugIds:n},e))})},to=e=>({checkpoints:r,checkpointComponent:d=_d,getCheckpointComponentProps:o,separator:s,debugIds:n})=>{const i=yd(r);return t(Wd,{separator:s,children:_(e(fd(i)),e=>t(d,{...Ie(o,e),checkpoints:i,checkpointId:e,debugIds:n},e))})},ro=to(e=>e[0]),oo=to(e=>O(e[1])?[]:[e[1]]),so=to(e=>e[2]),no=({indexId:e,sliceId:r,indexes:d,rowComponent:o=Yd,getRowComponentProps:s,separator:n,debugIds:i})=>{const[a,l,u]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(fr(d),e),c=qr(e,r,a);return t(Wd,{separator:n,debugIds:i,id:r,children:_(c,e=>t(o,{...Ie(s,e),tableId:u,rowId:e,store:l,debugIds:i},e))})},io=({indexId:e,indexes:r,sliceComponent:d=no,getSliceComponentProps:o,separator:s,debugIds:n})=>t(Wd,{separator:s,debugIds:n,id:e,children:_(Rr(e,r),s=>t(d,{...Ie(o,s),indexId:e,sliceId:s,indexes:r,debugIds:n},s))}),ao=e=>eo(e,zr,e.firstRowId),lo=e=>eo(e,jr,e.remoteRowId),uo=({metricId:e,metrics:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:mr(e,r)??d}),co=({relationshipId:e,localRowId:r,relationships:d,rowComponent:o=Yd,getRowComponentProps:s,debugIds:n})=>{const[i,a,,l]=pe(Vr(d),e),u=Or(e,r,i);return t(Wd,{debugIds:n,id:r,children:O(l)||O(u)?null:t(o,{...Ie(s,u),tableId:l,rowId:u,store:a,debugIds:n},u)})},Io=({cellId:e,descending:t,offset:r,limit:d,...o})=>$d(o,Xr(o.queryId,e,t,r,d,o.queries)),po=e=>$d(e,Ur(e.queryId,e.queries)),go=({cellId:e,descending:t,offset:r,limit:d,...o})=>Zd(o,ct(o.tableId,e,t,r,d,o.store)),bo=e=>Zd(e,ut(e.tableId,e.store)),mo=({store:e,tableComponent:r=bo,getTableComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(dt(e),o=>t(r,{...Ie(d,o),tableId:o,store:e,debugIds:s},o))}),ho=({valueId:e,store:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:d+(kt(e,r)??d)}),Co=({store:e,valueComponent:r=ho,getValueComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(Pt(e),o=>t(r,{...Ie(d,o),valueId:o,store:e,debugIds:s},o))});export{ro as BackwardCheckpointsView,Ud as CellView,_d as CheckpointView,oo as CurrentCheckpointView,so as ForwardCheckpointsView,io as IndexView,ao as LinkedRowsView,lo as LocalRowsView,uo as MetricView,qe as OFFSET_CHECKPOINTS,Pe as OFFSET_INDEXES,fe as OFFSET_METRICS,ve as OFFSET_PERSISTER,ke as OFFSET_QUERIES,Re as OFFSET_RELATIONSHIPS,we as OFFSET_STORE,xe as OFFSET_SYNCHRONIZER,Be as Provider,co as RemoteRowView,Gd as ResultCellView,Kd as ResultRowView,Io as ResultSortedTableView,po as ResultTableView,Yd as RowView,no as SliceView,go as SortedTableView,bo as TableView,mo as TablesView,ho as ValueView,Co as ValuesView,Bt as useAddRowCallback,ht as useCell,bt as useCellIds,$t as useCellIdsListener,tr as useCellListener,Ct as useCellState,Pd as useCheckpoint,fd as useCheckpointIds,Bd as useCheckpointIdsListener,Td as useCheckpointListener,Cd as useCheckpoints,hd as useCheckpointsIds,yd as useCheckpointsOrCheckpointsById,md as useCreateCheckpoints,Cr as useCreateIndexes,$e as useCreateMergeableStore,ur as useCreateMetrics,Vd as useCreatePersister,Dr as useCreateQueries,Sr as useCreateRelationships,Ge as useCreateStore,Fd as useCreateSynchronizer,Ft as useDelCellCallback,At as useDelRowCallback,zt as useDelTableCallback,jt as useDelTablesCallback,Dt as useDelValueCallback,Mt as useDelValuesCallback,lr as useDidFinishTransactionListener,kd as useGoBackwardCallback,qd as useGoForwardCallback,vd as useGoToCallback,mt as useHasCell,er as useHasCellListener,It as useHasRow,Yt as useHasRowListener,ot as useHasTable,at as useHasTableCell,Gt as useHasTableCellListener,Qt as useHasTableListener,et as useHasTables,Ht as useHasTablesListener,Rt as useHasValue,sr as useHasValueListener,yt as useHasValues,rr as useHasValuesListener,kr as useIndexIds,wr as useIndexes,yr as useIndexesIds,fr as useIndexesOrIndexesById,zr as useLinkedRowIds,Mr as useLinkedRowIdsListener,jr as useLocalRowIds,Fr as useLocalRowIdsListener,mr as useMetric,br as useMetricIds,hr as useMetricListener,Ir as useMetrics,cr as useMetricsIds,pr as useMetricsOrMetricsById,ud as useParamValue,pd as useParamValueListener,cd as useParamValueState,ad as useParamValues,Id as useParamValuesListener,ld as useParamValuesState,Ed as usePersister,Ld as usePersisterIds,Od as usePersisterOrPersisterById,zd as usePersisterStatus,Ad as usePersisterStatusListener,wd as useProvideCheckpoints,Pr as useProvideIndexes,gr as useProvideMetrics,jd as useProvidePersister,Qr as useProvideQueries,Lr as useProvideRelationships,Ze as useProvideStore,Jd as useProvideSynchronizer,Jr as useQueries,Hr as useQueriesIds,Nr as useQueriesOrQueriesById,Wr as useQueryIds,Sd as useRedoInformation,Er as useRelationshipIds,Tr as useRelationships,Br as useRelationshipsIds,Vr as useRelationshipsOrRelationshipsById,Or as useRemoteRowId,Ar as useRemoteRowIdListener,$r as useResultCell,Zr as useResultCellIds,nd as useResultCellIdsListener,id as useResultCellListener,Yr as useResultRow,Kr as useResultRowCount,rd as useResultRowCountListener,Ur as useResultRowIds,dd as useResultRowIdsListener,sd as useResultRowListener,Xr as useResultSortedRowIds,od as useResultSortedRowIdsListener,_r as useResultTable,Gr as useResultTableCellIds,td as useResultTableCellIdsListener,ed as useResultTableListener,pt as useRow,lt as useRowCount,Kt as useRowCountListener,ut as useRowIds,Ut as useRowIdsListener,Zt as useRowListener,gt as useRowState,Vt as useSetCellCallback,Rd as useSetCheckpointCallback,gd as useSetParamValueCallback,bd as useSetParamValuesCallback,Tt as useSetPartialRowCallback,Et as useSetPartialValuesCallback,St as useSetRowCallback,xt as useSetTableCallback,vt as useSetTablesCallback,Ot as useSetValueCallback,Lt as useSetValuesCallback,Rr as useSliceIds,vr as useSliceIdsListener,qr as useSliceRowIds,xr as useSliceRowIdsListener,ct as useSortedRowIds,Xt as useSortedRowIdsListener,_e as useSortedRowIdsListenerImpl,ir as useStartTransactionListener,Ue as useStore,Ke as useStoreIds,Ye as useStoreOrStoreById,Xe as useStores,Dd as useSynchronizer,Md as useSynchronizerIds,Hd as useSynchronizerOrSynchronizerById,Nd as useSynchronizerStatus,Qd as useSynchronizerStatusListener,st as useTable,it as useTableCellIds,_t as useTableCellIdsListener,dt as useTableIds,Nt as useTableIdsListener,Wt as useTableListener,nt as useTableState,tt as useTables,Jt as useTablesListener,rt as useTablesState,xd as useUndoInformation,kt as useValue,Pt as useValueIds,or as useValueIdsListener,nr as useValueListener,qt as useValueState,wt as useValues,dr as useValuesListener,ft as useValuesState,ar as useWillFinishTransactionListener};
1
+ import e from"react";import{jsx as t}from"react/jsx-runtime";const r=e=>typeof e,d="",o=r(d),s=r(r),n="Result",i="Has",a="Ids",l="Table",u=l+"s",c=l+a,I="Row",p=I+"Count",g=I+a,b="Sorted"+I+a,m="Cell",h=m+a,C="Value",y=C+"s",w=C+a,f="Transaction",P="Partial",R="Finish",k="Status",q="Metric",v="Slice",x="RemoteRowId",S="Local",B="Linked",T="Checkpoint",V=e=>(t,r,d)=>e(t)?d?.():r(t),L=globalThis,E=e=>null==e,O=e=>void 0===e,j=V(E),z=V(O),A=e=>r(e)==o,F=e=>r(e)==s,M=e=>Array.isArray(e),D=e=>e.length,H=()=>{},J=e=>e,N=(e,t)=>e.every(t),Q=(e,t)=>D(e)===D(t)&&N(e,(e,r)=>t[r]===e),W=(e,t)=>M(e)&&M(t)?Q(e,t):e===t,_=(e,t)=>e.map(t),G=(e,t,r)=>e.with(t,r),K=Object,U=e=>K.getPrototypeOf(e),X=K.entries,Y=e=>!E(e)&&j(U(e),e=>e==K.prototype||E(U(e)),()=>!0),Z=K.keys,$=(e,t)=>z(e,e=>e[t]),ee=(e,t,r=(e,t)=>e===t)=>{const d=X(e);return D(d)===D(Z(t))&&N(d,([e,d])=>Y(d)?!!Y(t[e])&&ee(t[e],d,r):r(d,t[e]))},te=JSON.stringify,{PureComponent:re,createContext:de,useCallback:oe,useContext:se,useEffect:ne,useLayoutEffect:ie,useMemo:ae,useRef:le,useState:ue,useSyncExternalStore:ce}=e,Ie=(e,...t)=>O(e)?{}:e(...t),pe=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],ge="tinybase_uirc",be=L[ge]?L[ge]:L[ge]=de([]),me=(e,t)=>{const r=se(be);return O(e)?r[2*t]:A(e)?$(r[2*t+1],e):e},he=(e,t)=>{const r=me(e,t);return O(e)||A(e)?r:e},Ce=(e,t,r)=>{const{16:d,17:o}=se(be);ne(()=>(d?.(r,e,t),()=>o?.(r,e)),[d,e,t,r,o])},ye=e=>Z(se(be)[2*e+1]??{}),we=0,fe=1,Pe=2,Re=3,ke=4,qe=5,ve=6,xe=7,Se=(e,t,r,d,o)=>[r??t[2*e],{...t[2*e+1],...d,...o[e]}],Be=({store:e,storesById:r,metrics:d,metricsById:o,indexes:s,indexesById:n,relationships:i,relationshipsById:a,queries:l,queriesById:u,checkpoints:c,checkpointsById:I,persister:p,persistersById:g,synchronizer:b,synchronizersById:m,children:h})=>{const C=se(be),[y,w]=ue(()=>_([,,,,,,,,].fill(0),(e,t)=>({}))),f=oe((e,t,r)=>w(d=>$(d[e],t)==r?d:G(d,e,{...d[e],[t]:r})),[]),P=oe((e,t)=>w(r=>((e,t)=>t in e)(r[e],t)?G(r,e,((e,t)=>(delete e[t],e))(r[e],t)):r),[]);return t(be.Provider,{value:ae(()=>[...Se(0,C,e,r,y),...Se(1,C,d,o,y),...Se(2,C,s,n,y),...Se(3,C,i,a,y),...Se(4,C,l,u,y),...Se(5,C,c,I,y),...Se(6,C,p,g,y),...Se(7,C,b,m,y),f,P],[y,e,r,d,o,s,n,i,a,l,u,c,I,p,g,b,m,C,f,P]),children:h})},Te=[],Ve=[{},[],[Te,void 0,Te],{},void 0,void 0,!1,0],Le=(e,t)=>e===t||(Y(e)||M(e))&&te(e)===te(t),Ee=[(e,t)=>ee(e,t,Le),Q,([e,t,r],[d,o,s])=>t===o&&Q(e,d)&&Q(r,s),(e,t)=>ee(e,t,W),W,Le],Oe=(e,t)=>e===t,je=(e,t,r=Te)=>{const[,d]=ue(),[o,s]=ue();return ne(()=>{const r=e?t(e):void 0;return s(r),d([]),r?.destroy},[e,...r]),o},ze=(e,t,...r)=>{const d=e?.["add"+t+"Listener"]?.(...r);return()=>e?.delListener?.(d)},Ae=(e,t,r,o=Te)=>{const s=le(Ve[r]),n=oe(()=>{const d=t?.[(6==r?"has":"get")+e]?.(...o)??Ve[r];return(Ee[r]??Oe)(d,s.current)?s.current:s.current=d},[t,r,e,...o]),a=oe(s=>ze(t,(6==r?i:d)+e,...o,s),[t,r,e,...o]);return ce(a,n,n)},Fe=(e,t,r,d=Te,o=Te,...s)=>ie(()=>ze(t,e,...o,r,...s),[t,e,...o,...d,...s]),Me=(e,t,r,d=Te,o=H,s=Te,n,...i)=>oe(d=>z(e,e=>z(r(d,e),r=>o(e[n+t](...Je(i,e,d),r),r))),[e,t,...d,...s,n,...Ne(i)]),De=(e,t,r,d,o,s,...n)=>Me(Ye(e),t,r,d,o,s,"set",...n),He=(e,t,r,o,s,n,...i)=>Me(Nr(e),t,r,o,s,n,d,...i),Je=(e,t,r)=>_(e,e=>F(e)?e(r,t):e),Ne=e=>{return t=e=>!F(e),e.filter(t);var t},Qe=(e,t,r=H,d=Te,...o)=>{const s=Ye(e);return oe(e=>r(s?.["del"+t](...Je(o,s,e))),[s,t,...d,...Ne(o)])},We=(e,t,r)=>{const d=yd(e);return oe(()=>d?.[t](r),[d,t,r])},_e=(e,t,r,d,o,s,n,i,a)=>Fe(b,Ye(a),s,n,[e,t,r,d,o],i),Ge=(e,t=Te)=>ae(e,t),Ke=()=>ye(0),Ue=e=>me(e,0),Xe=()=>({...se(be)[1]}),Ye=e=>he(e,0),Ze=(e,t)=>Ce(e,t,0),$e=(e,t=Te)=>ae(e,t),et=e=>Ae(u,Ye(e),6,[]),tt=e=>Ae(u,Ye(e),0),rt=e=>[tt(e),vt(J,[],e)],dt=e=>Ae(c,Ye(e),1),ot=(e,t)=>Ae(l,Ye(t),6,[e]),st=(e,t)=>Ae(l,Ye(t),0,[e]),nt=(e,t)=>[st(e,t),xt(e,J,[],t)],it=(e,t)=>Ae(l+h,Ye(t),1,[e]),at=(e,t,r)=>Ae(l+m,Ye(r),6,[e,t]),lt=(e,t)=>Ae(p,Ye(t),7,[e]),ut=(e,t)=>Ae(g,Ye(t),1,[e]),ct=(e,t,r,d,o,s)=>((e,t,r,d,o,s)=>Ae(b,Ye(s),1,[e,t,r,d,o]))(...Y(e)?[e.tableId,e.cellId,e.descending??!1,e.offset??0,e.limit,t]:[e,t,r,d,o,s]),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,r,[e]),td=(e,t,r,d)=>Fe(n+l+h,Nr(d),t,r,[e]),rd=(e,t,r,d)=>Fe(n+p,Nr(d),t,r,[e]),dd=(e,t,r,d)=>Fe(n+g,Nr(d),t,r,[e]),od=(e,t,r,d,o,s,i,a)=>Fe(n+b,Nr(a),s,i,[e,t,r,d,o]),sd=(e,t,r,d,o)=>Fe(n+I,Nr(o),r,d,[e,t]),nd=(e,t,r,d,o)=>Fe(n+h,Nr(o),r,d,[e,t]),id=(e,t,r,d,o,s)=>Fe(n+m,Nr(s),d,o,[e,t,r]),ad=(e,t)=>Ae("ParamValues",Nr(t),3,[e]),ld=(e,t)=>[ad(e,t),bd(e,J,[],t)],ud=(e,t,r)=>Ae("ParamValue",Nr(r),4,[e,t]),cd=(e,t,r)=>[ud(e,t,r),gd(e,t,J,[],r)],Id=(e,t,r,d)=>Fe("ParamValues",Nr(d),t,r,[e]),pd=(e,t,r,d,o)=>Fe("ParamValue",Nr(o),r,d,[e,t]),gd=(e,t,r,d,o,s,n)=>He(o,"setParamValue",r,d,s,n,e,t),bd=(e,t,r,d,o,s)=>He(d,"setParamValues",t,r,o,s,e),md=(e,t,r)=>je(e,t,r),hd=()=>ye(5),Cd=e=>me(e,5),yd=e=>he(e,5),wd=(e,t)=>Ce(e,t,5),fd=e=>Ae(T+a,yd(e),2),Pd=(e,t)=>Ae(T,yd(t),5,[e]),Rd=(e=H,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>{const o=e(t);d(r.addCheckpoint(o),r,o)}),[s,...t,...o])},kd=e=>We(e,"goBackward"),qd=e=>We(e,"goForward"),vd=(e,t=Te,r,d=H,o=Te)=>{const s=yd(r);return oe(t=>z(s,r=>z(e(t),e=>d(r.goTo(e),e))),[s,...t,...o])},xd=e=>{const t=yd(e),[r,o]=fd(t);return[(s=r,!(0==D(s))),kd(t),o,z(o,e=>t?.getCheckpoint(e))??d];var s},Sd=e=>{const t=yd(e),[,,[r]]=fd(t);return[!O(r),qd(t),r,z(r,e=>t?.getCheckpoint(e))??d]},Bd=(e,t,r)=>Fe(T+a,yd(r),e,t),Td=(e,t,r,d)=>Fe(T,yd(d),t,r,[e]),Vd=(e,t,r=Te,d,o=Te,s,n=Te)=>{const[,i]=ue(),[a,l]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;l(r),r&&d&&(async()=>{await d(r),i([])})()})()},[e,...r,...o]),ne(()=>()=>{a&&(a.destroy(),s?.(a))},[a,...n]),a},Ld=()=>ye(6),Ed=e=>me(e,6),Od=e=>he(e,6),jd=(e,t)=>Ce(e,t,6),zd=e=>Ae(k,Od(e),7,[]),Ad=(e,t,r)=>Fe(k,Od(r),e,t,[]),Fd=(e,t,r=Te,d,o=Te)=>{const[s,n]=ue();return ne(()=>{(async()=>{const r=e?await t(e):void 0;n(r)})()},[e,...r]),ne(()=>()=>{s&&(s.destroy(),d?.(s))},[s,...o]),s},Md=()=>ye(7),Dd=e=>me(e,7),Hd=e=>he(e,7),Jd=(e,t)=>Ce(e,t,7),Nd=e=>Ae(k,Hd(e),7,[]),Qd=(e,t,r)=>Fe(k,Hd(r),e,t,[]),Wd=({children:e,separator:t,debugIds:r,id:d})=>{const o=O(t)||!M(e)?e:_(e,(e,r)=>r>0?[t,e]:e);return r&&!O(d)?[d,":{",o,"}"]:o},_d=({checkpoints:e,checkpointId:r,debugIds:o})=>t(Wd,{debugIds:o,id:r,children:Pd(r,e)??d}),Gd=({queryId:e,rowId:r,cellId:o,queries:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+($r(e,r,o,s)??d)}),Kd=({queryId:e,rowId:r,queries:d,resultCellComponent:o=Gd,getResultCellComponentProps:s,separator:n,debugIds:i})=>t(Wd,{separator:n,debugIds:i,id:r,children:_(Zr(e,r,d),n=>t(o,{...Ie(s,n),queryId:e,rowId:r,cellId:n,queries:d,debugIds:i},n))}),Ud=({tableId:e,rowId:r,cellId:o,store:s,debugIds:n})=>t(Wd,{debugIds:n,id:o,children:d+(ht(e,r,o,s)??d)}),Xd=(e,t,r,d)=>{const o=bt(t,r,d);return e??o},Yd=({tableId:e,rowId:r,store:d,cellComponent:o=Ud,getCellComponentProps:s,customCellIds:n,separator:i,debugIds:a})=>t(Wd,{separator:i,debugIds:a,id:r,children:_(Xd(n,e,r,d),n=>t(o,{...Ie(s,n),tableId:e,rowId:r,cellId:n,store:d,debugIds:a},n))}),Zd=({tableId:e,store:r,rowComponent:d=Yd,getRowComponentProps:o,customCellIds:s,separator:n,debugIds:i},a)=>t(Wd,{separator:n,debugIds:i,id:e,children:_(a,n=>t(d,{...Ie(o,n),tableId:e,rowId:n,customCellIds:s,store:r,debugIds:i},n))}),$d=({queryId:e,queries:r,resultRowComponent:d=Kd,getResultRowComponentProps:o,separator:s,debugIds:n},i)=>t(Wd,{separator:s,debugIds:n,id:e,children:_(i,s=>t(d,{...Ie(o,s),queryId:e,rowId:s,queries:r,debugIds:n},s))}),eo=({relationshipId:e,relationships:r,rowComponent:d=Yd,getRowComponentProps:o,separator:s,debugIds:n},i,a)=>{const[l,u,c]=pe(Vr(r),e),I=i(e,a,l);return t(Wd,{separator:s,debugIds:n,id:a,children:_(I,e=>t(d,{...Ie(o,e),tableId:c,rowId:e,store:u,debugIds:n},e))})},to=e=>({checkpoints:r,checkpointComponent:d=_d,getCheckpointComponentProps:o,separator:s,debugIds:n})=>{const i=yd(r);return t(Wd,{separator:s,children:_(e(fd(i)),e=>t(d,{...Ie(o,e),checkpoints:i,checkpointId:e,debugIds:n},e))})},ro=to(e=>e[0]),oo=to(e=>E(e[1])?[]:[e[1]]),so=to(e=>e[2]),no=({indexId:e,sliceId:r,indexes:d,rowComponent:o=Yd,getRowComponentProps:s,separator:n,debugIds:i})=>{const[a,l,u]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(fr(d),e),c=qr(e,r,a);return t(Wd,{separator:n,debugIds:i,id:r,children:_(c,e=>t(o,{...Ie(s,e),tableId:u,rowId:e,store:l,debugIds:i},e))})},io=({indexId:e,indexes:r,sliceComponent:d=no,getSliceComponentProps:o,separator:s,debugIds:n})=>t(Wd,{separator:s,debugIds:n,id:e,children:_(Rr(e,r),s=>t(d,{...Ie(o,s),indexId:e,sliceId:s,indexes:r,debugIds:n},s))}),ao=e=>eo(e,zr,e.firstRowId),lo=e=>eo(e,jr,e.remoteRowId),uo=({metricId:e,metrics:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:mr(e,r)??d}),co=({relationshipId:e,localRowId:r,relationships:d,rowComponent:o=Yd,getRowComponentProps:s,debugIds:n})=>{const[i,a,,l]=pe(Vr(d),e),u=Or(e,r,i);return t(Wd,{debugIds:n,id:r,children:O(l)||O(u)?null:t(o,{...Ie(s,u),tableId:l,rowId:u,store:a,debugIds:n},u)})},Io=({cellId:e,descending:t,offset:r,limit:d,...o})=>$d(o,Xr(o.queryId,e,t,r,d,o.queries)),po=e=>$d(e,Ur(e.queryId,e.queries)),go=({cellId:e,descending:t,offset:r,limit:d,...o})=>Zd(o,ct(o.tableId,e,t,r,d,o.store)),bo=e=>Zd(e,ut(e.tableId,e.store)),mo=({store:e,tableComponent:r=bo,getTableComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(dt(e),o=>t(r,{...Ie(d,o),tableId:o,store:e,debugIds:s},o))}),ho=({valueId:e,store:r,debugIds:o})=>t(Wd,{debugIds:o,id:e,children:d+(kt(e,r)??d)}),Co=({store:e,valueComponent:r=ho,getValueComponentProps:d,separator:o,debugIds:s})=>t(Wd,{separator:o,children:_(Pt(e),o=>t(r,{...Ie(d,o),valueId:o,store:e,debugIds:s},o))});export{ro as BackwardCheckpointsView,Ud as CellView,_d as CheckpointView,oo as CurrentCheckpointView,so as ForwardCheckpointsView,io as IndexView,ao as LinkedRowsView,lo as LocalRowsView,uo as MetricView,qe as OFFSET_CHECKPOINTS,Pe as OFFSET_INDEXES,fe as OFFSET_METRICS,ve as OFFSET_PERSISTER,ke as OFFSET_QUERIES,Re as OFFSET_RELATIONSHIPS,we as OFFSET_STORE,xe as OFFSET_SYNCHRONIZER,Be as Provider,co as RemoteRowView,Gd as ResultCellView,Kd as ResultRowView,Io as ResultSortedTableView,po as ResultTableView,Yd as RowView,no as SliceView,go as SortedTableView,bo as TableView,mo as TablesView,ho as ValueView,Co as ValuesView,Bt as useAddRowCallback,ht as useCell,bt as useCellIds,$t as useCellIdsListener,tr as useCellListener,Ct as useCellState,Pd as useCheckpoint,fd as useCheckpointIds,Bd as useCheckpointIdsListener,Td as useCheckpointListener,Cd as useCheckpoints,hd as useCheckpointsIds,yd as useCheckpointsOrCheckpointsById,md as useCreateCheckpoints,Cr as useCreateIndexes,$e as useCreateMergeableStore,ur as useCreateMetrics,Vd as useCreatePersister,Dr as useCreateQueries,Sr as useCreateRelationships,Ge as useCreateStore,Fd as useCreateSynchronizer,Ft as useDelCellCallback,At as useDelRowCallback,zt as useDelTableCallback,jt as useDelTablesCallback,Dt as useDelValueCallback,Mt as useDelValuesCallback,lr as useDidFinishTransactionListener,kd as useGoBackwardCallback,qd as useGoForwardCallback,vd as useGoToCallback,mt as useHasCell,er as useHasCellListener,It as useHasRow,Yt as useHasRowListener,ot as useHasTable,at as useHasTableCell,Gt as useHasTableCellListener,Qt as useHasTableListener,et as useHasTables,Ht as useHasTablesListener,Rt as useHasValue,sr as useHasValueListener,yt as useHasValues,rr as useHasValuesListener,kr as useIndexIds,wr as useIndexes,yr as useIndexesIds,fr as useIndexesOrIndexesById,zr as useLinkedRowIds,Mr as useLinkedRowIdsListener,jr as useLocalRowIds,Fr as useLocalRowIdsListener,mr as useMetric,br as useMetricIds,hr as useMetricListener,Ir as useMetrics,cr as useMetricsIds,pr as useMetricsOrMetricsById,ud as useParamValue,pd as useParamValueListener,cd as useParamValueState,ad as useParamValues,Id as useParamValuesListener,ld as useParamValuesState,Ed as usePersister,Ld as usePersisterIds,Od as usePersisterOrPersisterById,zd as usePersisterStatus,Ad as usePersisterStatusListener,wd as useProvideCheckpoints,Pr as useProvideIndexes,gr as useProvideMetrics,jd as useProvidePersister,Qr as useProvideQueries,Lr as useProvideRelationships,Ze as useProvideStore,Jd as useProvideSynchronizer,Jr as useQueries,Hr as useQueriesIds,Nr as useQueriesOrQueriesById,Wr as useQueryIds,Sd as useRedoInformation,Er as useRelationshipIds,Tr as useRelationships,Br as useRelationshipsIds,Vr as useRelationshipsOrRelationshipsById,Or as useRemoteRowId,Ar as useRemoteRowIdListener,$r as useResultCell,Zr as useResultCellIds,nd as useResultCellIdsListener,id as useResultCellListener,Yr as useResultRow,Kr as useResultRowCount,rd as useResultRowCountListener,Ur as useResultRowIds,dd as useResultRowIdsListener,sd as useResultRowListener,Xr as useResultSortedRowIds,od as useResultSortedRowIdsListener,_r as useResultTable,Gr as useResultTableCellIds,td as useResultTableCellIdsListener,ed as useResultTableListener,pt as useRow,lt as useRowCount,Kt as useRowCountListener,ut as useRowIds,Ut as useRowIdsListener,Zt as useRowListener,gt as useRowState,Vt as useSetCellCallback,Rd as useSetCheckpointCallback,gd as useSetParamValueCallback,bd as useSetParamValuesCallback,Tt as useSetPartialRowCallback,Et as useSetPartialValuesCallback,St as useSetRowCallback,xt as useSetTableCallback,vt as useSetTablesCallback,Ot as useSetValueCallback,Lt as useSetValuesCallback,Rr as useSliceIds,vr as useSliceIdsListener,qr as useSliceRowIds,xr as useSliceRowIdsListener,ct as useSortedRowIds,Xt as useSortedRowIdsListener,_e as useSortedRowIdsListenerImpl,ir as useStartTransactionListener,Ue as useStore,Ke as useStoreIds,Ye as useStoreOrStoreById,Xe as useStores,Dd as useSynchronizer,Md as useSynchronizerIds,Hd as useSynchronizerOrSynchronizerById,Nd as useSynchronizerStatus,Qd as useSynchronizerStatusListener,st as useTable,it as useTableCellIds,_t as useTableCellIdsListener,dt as useTableIds,Nt as useTableIdsListener,Wt as useTableListener,nt as useTableState,tt as useTables,Jt as useTablesListener,rt as useTablesState,xd as useUndoInformation,kt as useValue,Pt as useValueIds,or as useValueIdsListener,nr as useValueListener,qt as useValueState,wt as useValues,dr as useValuesListener,ft as useValuesState,ar as useWillFinishTransactionListener};
@@ -0,0 +1 @@
1
+ import{createContext as e,useContext as t,createRenderEffect as o,untrack as r,onCleanup as s,createSignal as n,createMemo as d,createEffect as u}from"solid-js";import l from"solid-js/h";const c=e=>typeof e,I="",i=c(I),a=c(c),p="Result",g="Has",b="Ids",m="Table",w=m+"s",C=m+b,h="Row",y=h+"Count",v=h+b,P="Sorted"+h+b,q="Cell",R=q+b,k="Value",f=k+"s",x=k+b,B="Transaction",T="Partial",V="Finish",S="Status",L="Metric",j="Slice",z="RemoteRowId",A="Local",F="Linked",O="Checkpoint",D=e=>(t,o,r)=>e(t)?r?.():o(t),H=globalThis,M=e=>null==e,Q=e=>void 0===e,W=D(M),_=D(Q),E=e=>c(e)==i,G=e=>c(e)==a,J=e=>Array.isArray(e),K=e=>e.length,N=()=>{},U=e=>e,X=(e,t)=>e.every(t),Y=(e,t)=>K(e)===K(t)&&X(e,(e,o)=>t[o]===e),Z=(e,t)=>J(e)&&J(t)?Y(e,t):e===t,$=(e,t)=>e.map(t),ee=(e,t,o)=>e.with(t,o),te=Object,oe=e=>te.getPrototypeOf(e),re=te.entries,se=e=>!M(e)&&W(oe(e),e=>e==te.prototype||M(oe(e)),()=>!0),ne=te.keys,de=(e,t)=>_(e,e=>e[t]),ue=(e,t,o=(e,t)=>e===t)=>{const r=re(e);return K(r)===K(ne(t))&&X(r,([e,r])=>se(r)?!!se(t[e])&&ue(t[e],r,o):o(r,t[e]))},le=e=>G(e)?e():e,ce=(e,...t)=>Q(e)?{}:e(...t),Ie=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],ie="tinybase_uisc",ae=()=>[],pe={value:ae},ge=H,be=ge[ie]?ge[ie]:ge[ie]=e(pe),me=(e,o)=>{const r=t(be)?.value??ae;return()=>{const t=r(),s=le(e);return Q(s)?t[2*o]:E(s)?de(t[2*o+1],s):s}},we=(e,t)=>{const o=me(e,t);return()=>{const t=le(e);return Q(t)||E(t)?o():t}},Ce=(e,n,d)=>{const u=t(be)?.value??ae;o(()=>{const{16:t,17:o}=r(u);t?.(d,e,n),s(()=>o?.(d,e))})},he=e=>{const o=t(be)?.value??ae;return()=>ne(o()[2*e+1]??{})},ye=0,ve=1,Pe=2,qe=3,Re=4,ke=5,fe=6,xe=7,Be=(e,t,o,r,s)=>[o??t[2*e],{...t[2*e+1],...r,...s[e]}],Te=()=>[],Ve=e=>{const o=t(be)?.value??Te,[r,s]=n($([,,,,,,,,].fill(0),(e,t)=>({}))),u=(e,t,o)=>{s(r=>de(r[e],t)==o?r:ee(r,e,{...r[e],[t]:o}))},c=(e,t)=>{s(o=>((e,t)=>t in e)(o[e],t)?ee(o,e,((e,t)=>(delete e[t],e))(o[e],t)):o)},I=d(()=>[...Be(0,o(),e.store,e.storesById,r()),...Be(1,o(),e.metrics,e.metricsById,r()),...Be(2,o(),e.indexes,e.indexesById,r()),...Be(3,o(),e.relationships,e.relationshipsById,r()),...Be(4,o(),e.queries,e.queriesById,r()),...Be(5,o(),e.checkpoints,e.checkpointsById,r()),...Be(6,o(),e.persister,e.persistersById,r()),...Be(7,o(),e.synchronizer,e.synchronizersById,r()),u,c]);return l(be.Provider,{value:{value:I}},()=>e.children)},Se=[],Le=[{},[],[Se,void 0,Se],{},void 0,void 0,!1,0],je=[ue,Y,([e,t,o],[r,s,n])=>t===s&&Y(e,r)&&Y(o,n),(e,t)=>ue(e,t,Z),Z],ze=(e,t)=>e===t,Ae=e=>G(e)?e():e,Fe=[],Oe=(e,t)=>{const[o,r]=n();return u(()=>{const o=Ae(e),n=o?t(o):void 0;r(()=>n),s(()=>n?.destroy?.())}),o},De=(e,t,...o)=>{const r=e?.["add"+t+"Listener"]?.(...o);return()=>e?.delListener?.(r)},He=(e,t,d,u=Fe)=>{const[l,c]=n(Le[d]),i=()=>$(u,Ae),a=()=>{const o=Ae(t)?.[(6==d?"has":"get")+e]?.(...i())??Le[d],s=r(l);c(()=>(je[d]??ze)(o,s)?s:o)};return o(()=>{const o=Ae(t),r=i();a();const n=De(o,(6==d?g:I)+e,...r,a);s(n)}),l},Me=(e,t,r,n=Fe,...d)=>o(()=>{const o=De(Ae(t),e,...$(n,Ae),r,...$(d,Ae));s(o)}),Qe=(e,t,o,r=N,s,...n)=>d=>_(Ae(e),e=>_(o(d,e),o=>r(e[s+t](...Ee(n,e,d),o),o))),We=(e,t,o,r,...s)=>Qe($e(e),t,o,r,"set",...s),_e=(e,t,o,r,...s)=>Qe(Jo(e),t,o,r,I,...s),Ee=(e,t,o)=>$(e,e=>G(e)?0==e.length?Ae(e):e(o,t):e),Ge=(e,t,o=N,...r)=>{const s=$e(e);return e=>{const n=Ae(s);_(n,s=>o(s["del"+t](...Ee(r,s,e))))}},Je=(e,t,o)=>{const r=Pr(e);return()=>Ae(r)?.[t](o)},Ke=(e,t,o,r,s,n)=>He(P,$e(n),1,[e,t,o,r,s]),Ne=(e,t,o,r,s,n,d,u)=>Me(P,$e(u),n,[e,t,o,r,s],d),Ue=e=>d(e),Xe=()=>he(0),Ye=e=>me(e,0),Ze=()=>(()=>{const e=t(be)?.value??ae;return()=>({...e()[1]})})(),$e=e=>we(e,0),et=(e,t)=>Ce(e,t,0),tt=e=>d(e),ot=e=>He(w,$e(e),6,[]),rt=e=>He(w,$e(e),0),st=e=>[rt(e),Bt(U,e)],nt=e=>He(C,$e(e),1),dt=(e,t)=>He(m,$e(t),6,[e]),ut=(e,t)=>He(m,$e(t),0,[e]),lt=(e,t)=>[ut(e,t),Tt(e,U,t)],ct=(e,t)=>He(m+R,$e(t),1,[e]),It=(e,t,o)=>He(m+q,$e(o),6,[e,t]),it=(e,t)=>He(y,$e(t),7,[e]),at=(e,t)=>He(v,$e(t),1,[e]),pt=(e,t,o,r,s,n)=>se(e)?Ke(e.tableId,e.cellId,e.descending??!1,e.offset??0,e.limit,t):Ke(e,t,o,r,s,n),gt=(e,t,o)=>He(h,$e(o),6,[e,t]),bt=(e,t,o)=>He(h,$e(o),0,[e,t]),mt=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e,t,o,r)=>Me(y,$e(r),t,[e],o),Yt=(e,t,o,r)=>Me(v,$e(r),t,[e],o),Zt=(e,t,o,r,s,n,d,u)=>se(e)?Ne(e.tableId,e.cellId,e.descending??!1,e.offset??0,e.limit,t,o,r):Ne(e,t,o??!1,r??0,s,n,d,u),$t=(e,t,o,r,s)=>Me(g+h,$e(s),o,[e,t],r),eo=(e,t,o,r,s)=>Me(h,$e(s),o,[e,t],r),to=(e,t,o,r,s)=>Me(R,$e(s),o,[e,t],r),oo=(e,t,o,r,s,n)=>Me(g+q,$e(n),r,[e,t,o],s),ro=(e,t,o,r,s,n)=>Me(q,$e(n),r,[e,t,o],s),so=(e,t,o)=>Me(g+f,$e(o),e,[],t),no=(e,t,o)=>Me(f,$e(o),e,Fe,t),uo=(e,t,o)=>Me(x,$e(o),e,Fe,t),lo=(e,t,o,r)=>Me(g+k,$e(r),t,[e],o),co=(e,t,o,r)=>Me(k,$e(r),t,[e],o),Io=(e,t)=>Me("Start"+B,$e(t),e),io=(e,t)=>Me("Will"+V+B,$e(t),e),ao=(e,t)=>Me("Did"+V+B,$e(t),e),po=(e,t)=>Oe(e,t),go=()=>he(1),bo=e=>me(e,1),mo=e=>we(e,1),wo=(e,t)=>Ce(e,t,1),Co=e=>He(L+b,mo(e),1),ho=(e,t)=>He(L,mo(t),5,[e]),yo=(e,t,o)=>Me(L,mo(o),t,[e]),vo=(e,t)=>Oe(e,t),Po=()=>he(2),qo=e=>me(e,2),Ro=e=>we(e,2),ko=(e,t)=>Ce(e,t,2),fo=(e,t)=>He(j+b,Ro(t),1,[e]),xo=e=>He("Index"+b,Ro(e),1),Bo=(e,t,o)=>He(j+v,Ro(o),1,[e,t]),To=(e,t,o)=>Me(j+b,Ro(o),t,[e]),Vo=(e,t,o,r)=>Me(j+v,Ro(r),o,[e,t]),So=(e,t)=>Oe(e,t),Lo=()=>he(3),jo=e=>me(e,3),zo=e=>we(e,3),Ao=(e,t)=>Ce(e,t,3),Fo=e=>He("Relationship"+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amValue",Jo(r),o,[e,t]),wr=(e,t,o,r,s)=>_e(r,"setParamValue",o,s,e,t),Cr=(e,t,o,r)=>_e(o,"setParamValues",t,r,e),hr=(e,t)=>Oe(e,t),yr=()=>he(5),vr=e=>me(e,5),Pr=e=>we(e,5),qr=(e,t)=>Ce(e,t,5),Rr=e=>He(O+b,Pr(e),2),kr=(e,t)=>He(O,Pr(t),5,[e]),fr=(e=N,t,o=N)=>{const r=Pr(t);return t=>_(Ae(r),r=>{const s=e(t);o(r.addCheckpoint(s),r,s)})},xr=e=>Je(e,"goBackward"),Br=e=>Je(e,"goForward"),Tr=(e,t,o=N)=>{const r=Pr(t);return t=>_(Ae(r),r=>_(e(t),e=>o(r.goTo(e),e)))},Vr=e=>{const t=Pr(e),[o,r]=Ae(Rr(t));return[(s=o,!(0==K(s))),xr(t),r,_(r,e=>Ae(t)?.getCheckpoint(e))??I];var s},Sr=e=>{const t=Pr(e),[,,[o]]=Ae(Rr(t));return[!Q(o),Br(t),o,_(o,e=>Ae(t)?.getCheckpoint(e))??I]},Lr=(e,t)=>Me(O+b,Pr(t),e),jr=(e,t,o)=>Me(O,Pr(o),t,[e]),zr=(e,t,o,r)=>{const[d,l]=n();return u(()=>{let n,d=!0;const u=e=>{e.destroy(),r?.(e)};(async()=>{const r=Ae(e);n=r?await t(r):void 0,d?(l(()=>n),n&&o&&await o(n)):n&&u(n)})(),s(()=>{d=!1,l(()=>{}),n&&u(n)})}),d},Ar=()=>he(6),Fr=e=>me(e,6),Or=e=>we(e,6),Dr=(e,t)=>Ce(e,t,6),Hr=e=>He(S,Or(e),7,[]),Mr=(e,t)=>Me(S,Or(t),e,[]),Qr=(e,t,o)=>{const[r,d]=n();return u(()=>{let r,n=!0;const u=e=>{e.destroy(),o?.(e)};(async()=>{const o=Ae(e);r=o?await t(o):void 0,n?d(()=>r):r&&u(r)})(),s(()=>{n=!1,d(()=>{}),r&&u(r)})}),r},Wr=()=>he(7),_r=e=>me(e,7),Er=e=>we(e,7),Gr=(e,t)=>Ce(e,t,7),Jr=e=>He(S,Er(e),7,[]),Kr=(e,t)=>Me(S,Er(t),e,[]),Nr=(e,t,o,r)=>{const s=Q(t)||!J(e)?e:$(e,(e,o)=>o>0?[t,e]:e);return o?[r,":{",s,"}"]:s},Ur=e=>{const t=kr(()=>e.checkpointId,()=>e.checkpoints);return()=>Nr(le(t)??I,void 0,e.debugIds,e.checkpointId)},Xr=e=>{const t=or(()=>e.queryId,()=>e.rowId,()=>e.cellId,()=>e.queries);return()=>Nr(I+(le(t)??I),void 0,e.debugIds,e.cellId)},Yr=e=>{const t=tr(()=>e.queryId,()=>e.rowId,()=>e.queries);return()=>{const o=e.resultCellComponent??Xr;return Nr($(le(t),t=>l(o,{...ce(e.getResultCellComponentProps,t),queryId:e.queryId,rowId:e.rowId,cellId:t,queries:e.queries,debugIds:e.debugIds})),e.separator,e.debugIds,e.rowId)}},Zr=e=>{const t=ht(()=>e.tableId,()=>e.rowId,()=>e.cellId,()=>e.store);return()=>Nr(I+(le(t)??I),void 0,e.debugIds,e.cellId)},$r=e=>{const t=(t=>{const o=wt(()=>e.tableId,()=>e.rowId,()=>e.store);return()=>le(t)??le(o)})(()=>e.customCellIds);return()=>{const o=e.cellComponent??Zr;return Nr($(le(t),t=>l(o,{...ce(e.getCellComponentProps,t),tableId:e.tableId,rowId:e.rowId,cellId:t,store:e.store,debugIds:e.debugIds})),e.separator,e.debugIds,e.rowId)}},es=(e,t)=>()=>{const o=e.rowComponent??$r;return Nr($(le(t),t=>l(o,{...ce(e.getRowComponentProps,t),tableId:e.tableId,rowId:t,customCellIds:e.customCellIds,store:e.store,debugIds:e.debugIds})),e.separator,e.debugIds,e.tableId)},ts=(e,t)=>()=>{const o=e.resultRowComponent??Yr;return Nr($(le(t),t=>l(o,{...ce(e.getResultRowComponentProps,t),queryId:e.queryId,rowId:t,queries:e.queries,debugIds:e.debugIds})),e.separator,e.debugIds,e.queryId)},os=(e,t,o)=>{const r=zo(()=>e.relationships),s=t(()=>e.relationshipId,o,r);return()=>{const t=e.rowComponent??$r,[n,d,u]=Ie(le(r),e.relationshipId);return Nr($(le(s),o=>l(t,{...ce(e.getRowComponentProps,o),tableId:u,rowId:o,store:d,debugIds:e.debugIds})),e.separator,e.debugIds,le(o))}},rs=e=>t=>{const o=Pr(()=>t.checkpoints),r=Rr(o);return()=>{const s=t.checkpointComponent??Ur;return Nr($(e(le(r)),e=>l(s,{...ce(t.getCheckpointComponentProps,e),checkpoints:le(o),checkpointId:e,debugIds:t.debugIds})),t.separator)}},ss=rs(e=>e[0]),ns=rs(e=>M(e[1])?[]:[e[1]]),ds=rs(e=>e[2]),us=e=>{const t=Ro(()=>e.indexes),o=Bo(()=>e.indexId,()=>e.sliceId,t);return()=>{const r=e.rowComponent??$r,[s,n,d]=(u=le(t),c=e.indexId,[u,u?.getStore(),u?.getTableId(c)]);var u,c;return Nr($(le(o),t=>l(r,{...ce(e.getRowComponentProps,t),tableId:d,rowId:t,store:n,debugIds:e.debugIds})),e.separator,e.debugIds,e.sliceId)}},ls=e=>{const t=fo(()=>e.indexId,()=>e.indexes);return()=>{const o=e.sliceComponent??us;return Nr($(le(t),t=>l(o,{...ce(e.getSliceComponentProps,t),indexId:e.indexId,sliceId:t,indexes:e.indexes,debugIds:e.debugIds})),e.separator,e.debugIds,e.indexId)}},cs=e=>os(e,Ho,()=>e.firstRowId),Is=e=>os(e,Do,()=>e.remoteRowId),is=e=>{const t=ho(()=>e.metricId,()=>e.metrics);return()=>Nr(le(t)??I,void 0,e.debugIds,e.metricId)},as=e=>{const t=zo(()=>e.relationships),o=Oo(()=>e.relationshipId,()=>e.localRowId,t);return()=>{const r=e.rowComponent??$r,[s,n,,d]=Ie(le(t),e.relationshipId),u=le(o);return Nr(Q(d)||Q(u)?null:l(r,{...ce(e.getRowComponentProps,u),tableId:d,rowId:u,store:n,debugIds:e.debugIds}),void 0,e.debugIds,e.localRowId)}},ps=e=>ts(e,$o(()=>e.queryId,()=>e.cellId,()=>e.descending,()=>e.offset,()=>e.limit,()=>e.queries)),gs=e=>ts(e,Zo(()=>e.queryId,()=>e.queries)),bs=e=>es(e,pt(()=>e.tableId,()=>e.cellId,()=>e.descending,()=>e.offset,()=>e.limit,()=>e.store)),ms=e=>es(e,at(()=>e.tableId,()=>e.store)),ws=e=>{const t=nt(()=>e.store);return()=>{const o=e.tableComponent??ms;return Nr($(le(t),t=>l(o,{...ce(e.getTableComponentProps,t),tableId:t,store:e.store,debugIds:e.debugIds})),e.separator)}},Cs=e=>{const t=ft(()=>e.valueId,()=>e.store);return()=>Nr(I+(le(t)??I),void 0,e.debugIds,e.valueId)},hs=e=>{const t=Rt(()=>e.store);return()=>{const o=e.valueComponent??Cs;return Nr($(le(t),t=>l(o,{...ce(e.getValueComponentProps,t),valueId:t,store:e.store,debugIds:e.debugIds})),e.separator)}};export{ss as BackwardCheckpointsView,Zr as CellView,Ur as CheckpointView,ns as CurrentCheckpointView,ds as ForwardCheckpointsView,ls as IndexView,cs as LinkedRowsView,Is as LocalRowsView,is as MetricView,ke as OFFSET_CHECKPOINTS,Pe as OFFSET_INDEXES,ve as OFFSET_METRICS,fe as OFFSET_PERSISTER,Re as OFFSET_QUERIES,qe as OFFSET_RELATIONSHIPS,ye as OFFSET_STORE,xe as OFFSET_SYNCHRONIZER,Ve as Provider,as as RemoteRowView,Xr as ResultCellView,Yr as ResultRowView,ps as ResultSortedTableView,gs as ResultTableView,$r as RowView,us as SliceView,bs as SortedTableView,ms as TableView,ws as TablesView,Cs as ValueView,hs as ValuesView,St as useAddRowCallback,ht as useCell,wt as useCellIds,to as useCellIdsListener,ro as useCellListener,yt as useCellState,kr as useCheckpoint,Rr as useCheckpointIds,Lr as useCheckpointIdsListener,jr as useCheckpointListener,vr as useCheckpoints,yr as useCheckpointsIds,Pr as useCheckpointsOrCheckpointsById,hr as useCreateCheckpoints,vo as useCreateIndexes,tt as useCreateMergeableStore,po as useCreateMetrics,zr as useCreatePersister,_o as useCreateQueries,So as useCreateRelationships,Ue as useCreateStore,Qr as useCreateSynchronizer,Mt as useDelCellCallback,Ht as useDelRowCallback,Dt as useDelTableCallback,Ot as useDelTablesCallback,Wt as useDelValueCallback,Qt as useDelValuesCallback,ao as useDidFinishTransactionListener,xr as useGoBackwardCallback,Br as useGoForwardCallback,Tr as useGoToCallback,Ct as useHasCell,oo as useHasCellListener,gt as useHasRow,$t as useHasRowListener,dt as useHasTable,It as useHasTableCell,Ut as useHasTableCellListener,Jt as useHasTableListener,ot as useHasTables,_t as useHasTablesListener,kt as useHasValue,lo as useHasValueListener,vt as useHasValues,so as useHasValuesListener,xo as useIndexIds,qo as useIndexes,Po as useIndexesIds,Ro as useIndexesOrIndexesById,Ho as useLinkedRowIds,Wo as useLinkedRowIdsListener,Do as useLocalRowIds,Qo as useLocalRowIdsListener,ho as useMetric,Co as useMetricIds,yo as useMetricListener,bo as useMetrics,go as useMetricsIds,mo as useMetricsOrMetricsById,pr as useParamValue,mr as useParamValueListener,gr as useParamValueState,ir as useParamValues,br as useParamValuesListener,ar as useParamValuesState,Fr as usePersister,Ar as usePersisterIds,Or as usePersisterOrPersisterById,Hr as usePersisterStatus,Mr as usePersisterStatusListener,qr as useProvideCheckpoints,ko as useProvideIndexes,wo as useProvideMetrics,Dr as useProvidePersister,Ko as useProvideQueries,Ao as useProvideRelationships,et as useProvideStore,Gr as useProvideSynchronizer,Go as useQueries,Eo as useQueriesIds,Jo as useQueriesOrQueriesById,No as useQueryIds,Sr as useRedoInformation,Fo as useRelationshipIds,jo as useRelationships,Lo as useRelationshipsIds,zo as useRelationshipsOrRelationshipsById,Oo as useRemoteRowId,Mo as useRemoteRowIdListener,or as useResultCell,tr as useResultCellIds,cr as useResultCellIdsListener,Ir as useResultCellListener,er as useResultRow,Yo as useResultRowCount,nr as useResultRowCountListener,Zo as useResultRowIds,dr as useResultRowIdsListener,lr as useResultRowListener,$o as useResultSortedRowIds,ur as useResultSortedRowIdsListener,Uo as useResultTable,Xo as useResultTableCellIds,sr as useResultTableCellIdsListener,rr as useResultTableListener,bt as useRow,it as useRowCount,Xt as useRowCountListener,at as useRowIds,Yt as useRowIdsListener,eo as useRowListener,mt as useRowState,jt as useSetCellCallback,fr as useSetCheckpointCallback,wr as useSetParamValueCallback,Cr as useSetParamValuesCallback,Lt as useSetPartialRowCallback,At as useSetPartialValuesCallback,Vt as useSetRowCallback,Tt as useSetTableCallback,Bt as useSetTablesCallback,Ft as useSetValueCallback,zt as useSetValuesCallback,fo as useSliceIds,To as useSliceIdsListener,Bo as useSliceRowIds,Vo as useSliceRowIdsListener,pt as useSortedRowIds,Zt as useSortedRowIdsListener,Ne as useSortedRowIdsListenerImpl,Io as useStartTransactionListener,Ye as useStore,Xe as useStoreIds,$e as useStoreOrStoreById,Ze as useStores,_r as useSynchronizer,Wr as useSynchronizerIds,Er as useSynchronizerOrSynchronizerById,Jr as useSynchronizerStatus,Kr as useSynchronizerStatusListener,ut as useTable,ct as useTableCellIds,Nt as useTableCellIdsListener,nt as useTableIds,Gt as useTableIdsListener,Kt as useTableListener,lt as useTableState,rt as useTables,Et as useTablesListener,st as useTablesState,Vr as useUndoInformation,ft as useValue,Rt as useValueIds,uo as useValueIdsListener,co as useValueListener,xt as useValueState,Pt as useValues,no as useValuesListener,qt as useValuesState,io as useWillFinishTransactionListener};
Binary file
@@ -0,0 +1 @@
1
+ import{createContext as e,useContext as t,createRenderEffect as o,untrack as r,onCleanup as s,createSignal as n,createMemo as d,createEffect as u}from"solid-js";import l from"solid-js/h";const c=e=>typeof e,I="",i=c(I),a=c(c),p="Result",g="Has",b="Ids",m="Table",w=m+"s",C=m+b,h="Row",y=h+"Count",v=h+b,P="Sorted"+h+b,q="Cell",R=q+b,k="Value",f=k+"s",x=k+b,B="Transaction",T="Partial",V="Finish",S="Status",L="Metric",j="Slice",z="RemoteRowId",A="Local",F="Linked",O="Checkpoint",D=e=>(t,o,r)=>e(t)?r?.():o(t),H=globalThis,M=e=>null==e,Q=e=>void 0===e,W=D(M),_=D(Q),E=e=>c(e)==i,G=e=>c(e)==a,J=e=>Array.isArray(e),K=e=>e.length,N=()=>{},U=e=>e,X=(e,t)=>e.every(t),Y=(e,t)=>K(e)===K(t)&&X(e,(e,o)=>t[o]===e),Z=(e,t)=>J(e)&&J(t)?Y(e,t):e===t,$=(e,t)=>e.map(t),ee=(e,t,o)=>e.with(t,o),te=Object,oe=e=>te.getPrototypeOf(e),re=te.entries,se=e=>!M(e)&&W(oe(e),e=>e==te.prototype||M(oe(e)),()=>!0),ne=te.keys,de=(e,t)=>_(e,e=>e[t]),ue=(e,t,o=(e,t)=>e===t)=>{const r=re(e);return K(r)===K(ne(t))&&X(r,([e,r])=>se(r)?!!se(t[e])&&ue(t[e],r,o):o(r,t[e]))},le=e=>G(e)?e():e,ce=(e,...t)=>Q(e)?{}:e(...t),Ie=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],ie="tinybase_uisc",ae=()=>[],pe={value:ae},ge=H,be=ge[ie]?ge[ie]:ge[ie]=e(pe),me=(e,o)=>{const r=t(be)?.value??ae;return()=>{const t=r(),s=le(e);return Q(s)?t[2*o]:E(s)?de(t[2*o+1],s):s}},we=(e,t)=>{const o=me(e,t);return()=>{const t=le(e);return Q(t)||E(t)?o():t}},Ce=(e,n,d)=>{const u=t(be)?.value??ae;o(()=>{const{16:t,17:o}=r(u);t?.(d,e,n),s(()=>o?.(d,e))})},he=e=>{const o=t(be)?.value??ae;return()=>ne(o()[2*e+1]??{})},ye=0,ve=1,Pe=2,qe=3,Re=4,ke=5,fe=6,xe=7,Be=(e,t,o,r,s)=>[o??t[2*e],{...t[2*e+1],...r,...s[e]}],Te=()=>[],Ve=e=>{const o=t(be)?.value??Te,[r,s]=n($([,,,,,,,,].fill(0),(e,t)=>({}))),u=(e,t,o)=>{s(r=>de(r[e],t)==o?r:ee(r,e,{...r[e],[t]:o}))},c=(e,t)=>{s(o=>((e,t)=>t in e)(o[e],t)?ee(o,e,((e,t)=>(delete e[t],e))(o[e],t)):o)},I=d(()=>[...Be(0,o(),e.store,e.storesById,r()),...Be(1,o(),e.metrics,e.metricsById,r()),...Be(2,o(),e.indexes,e.indexesById,r()),...Be(3,o(),e.relationships,e.relationshipsById,r()),...Be(4,o(),e.queries,e.queriesById,r()),...Be(5,o(),e.checkpoints,e.checkpointsById,r()),...Be(6,o(),e.persister,e.persistersById,r()),...Be(7,o(),e.synchronizer,e.synchronizersById,r()),u,c]);return l(be.Provider,{value:{value:I}},()=>e.children)},Se=[],Le=[{},[],[Se,void 0,Se],{},void 0,void 0,!1,0],je=[ue,Y,([e,t,o],[r,s,n])=>t===s&&Y(e,r)&&Y(o,n),(e,t)=>ue(e,t,Z),Z],ze=(e,t)=>e===t,Ae=e=>G(e)?e():e,Fe=[],Oe=(e,t)=>{const[o,r]=n();return u(()=>{const o=Ae(e),n=o?t(o):void 0;r(()=>n),s(()=>n?.destroy?.())}),o},De=(e,t,...o)=>{const r=e?.["add"+t+"Listener"]?.(...o);return()=>e?.delListener?.(r)},He=(e,t,d,u=Fe)=>{const[l,c]=n(Le[d]),i=()=>$(u,Ae),a=()=>{const o=Ae(t)?.[(6==d?"has":"get")+e]?.(...i())??Le[d],s=r(l);c(()=>(je[d]??ze)(o,s)?s:o)};return o(()=>{const o=Ae(t),r=i();a();const n=De(o,(6==d?g:I)+e,...r,a);s(n)}),l},Me=(e,t,r,n=Fe,...d)=>o(()=>{const o=De(Ae(t),e,...$(n,Ae),r,...$(d,Ae));s(o)}),Qe=(e,t,o,r=N,s,...n)=>d=>_(Ae(e),e=>_(o(d,e),o=>r(e[s+t](...Ee(n,e,d),o),o))),We=(e,t,o,r,...s)=>Qe($e(e),t,o,r,"set",...s),_e=(e,t,o,r,...s)=>Qe(Jo(e),t,o,r,I,...s),Ee=(e,t,o)=>$(e,e=>G(e)?0==e.length?Ae(e):e(o,t):e),Ge=(e,t,o=N,...r)=>{const s=$e(e);return e=>{const n=Ae(s);_(n,s=>o(s["del"+t](...Ee(r,s,e))))}},Je=(e,t,o)=>{const r=Pr(e);return()=>Ae(r)?.[t](o)},Ke=(e,t,o,r,s,n)=>He(P,$e(n),1,[e,t,o,r,s]),Ne=(e,t,o,r,s,n,d,u)=>Me(P,$e(u),n,[e,t,o,r,s],d),Ue=e=>d(e),Xe=()=>he(0),Ye=e=>me(e,0),Ze=()=>(()=>{const e=t(be)?.value??ae;return()=>({...e()[1]})})(),$e=e=>we(e,0),et=(e,t)=>Ce(e,t,0),tt=e=>d(e),ot=e=>He(w,$e(e),6,[]),rt=e=>He(w,$e(e),0),st=e=>[rt(e),Bt(U,e)],nt=e=>He(C,$e(e),1),dt=(e,t)=>He(m,$e(t),6,[e]),ut=(e,t)=>He(m,$e(t),0,[e]),lt=(e,t)=>[ut(e,t),Tt(e,U,t)],ct=(e,t)=>He(m+R,$e(t),1,[e]),It=(e,t,o)=>He(m+q,$e(o),6,[e,t]),it=(e,t)=>He(y,$e(t),7,[e]),at=(e,t)=>He(v,$e(t),1,[e]),pt=(e,t,o,r,s,n)=>se(e)?Ke(e.tableId,e.cellId,e.descending??!1,e.offset??0,e.limit,t):Ke(e,t,o,r,s,n),gt=(e,t,o)=>He(h,$e(o),6,[e,t]),bt=(e,t,o)=>He(h,$e(o),0,[e,t]),mt=(e,t,o)=>[bt(e,t,o),Vt(e,t,U,o)],wt=(e,t,o)=>He(R,$e(o),1,[e,t]),Ct=(e,t,o,r)=>He(q,$e(r),6,[e,t,o]),ht=(e,t,o,r)=>He(q,$e(r),5,[e,t,o]),yt=(e,t,o,r)=>[ht(e,t,o,r),jt(e,t,o,U,r)],vt=e=>He(f,$e(e),6,[]),Pt=e=>He(f,$e(e),0),qt=e=>[Pt(e),zt(U,e)],Rt=e=>He(x,$e(e),1),kt=(e,t)=>He(k,$e(t),6,[e]),ft=(e,t)=>He(k,$e(t),5,[e]),xt=(e,t)=>[ft(e,t),Ft(e,U,t)],Bt=(e,t,o)=>We(t,w,e,o),Tt=(e,t,o,r)=>We(o,m,t,r,e),Vt=(e,t,o,r,s)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),Zo=(e,t)=>He(p+v,Jo(t),1,[e]),$o=(e,t,o,r=0,s,n)=>He(p+P,Jo(n),1,[e,t,o,r,s]),er=(e,t,o)=>He(p+h,Jo(o),0,[e,t]),tr=(e,t,o)=>He(p+R,Jo(o),1,[e,t]),or=(e,t,o,r)=>He(p+q,Jo(r),5,[e,t,o]),rr=(e,t,o)=>Me(p+m,Jo(o),t,[e]),sr=(e,t,o)=>Me(p+m+R,Jo(o),t,[e]),nr=(e,t,o)=>Me(p+y,Jo(o),t,[e]),dr=(e,t,o)=>Me(p+v,Jo(o),t,[e]),ur=(e,t,o,r,s,n,d)=>Me(p+P,Jo(d),n,[e,t,o,r,s]),lr=(e,t,o,r)=>Me(p+h,Jo(r),o,[e,t]),cr=(e,t,o,r)=>Me(p+R,Jo(r),o,[e,t]),Ir=(e,t,o,r,s)=>Me(p+q,Jo(s),r,[e,t,o]),ir=(e,t)=>He("ParamValues",Jo(t),3,[e]),ar=(e,t)=>[ir(e,t),Cr(e,U,t)],pr=(e,t,o)=>He("ParamValue",Jo(o),4,[e,t]),gr=(e,t,o)=>[pr(e,t,o),wr(e,t,U,o)],br=(e,t,o)=>Me("ParamValues",Jo(o),t,[e]),mr=(e,t,o,r)=>Me("ParamValue",Jo(r),o,[e,t]),wr=(e,t,o,r,s)=>_e(r,"setParamValue",o,s,e,t),Cr=(e,t,o,r)=>_e(o,"setParamValues",t,r,e),hr=(e,t)=>Oe(e,t),yr=()=>he(5),vr=e=>me(e,5),Pr=e=>we(e,5),qr=(e,t)=>Ce(e,t,5),Rr=e=>He(O+b,Pr(e),2),kr=(e,t)=>He(O,Pr(t),5,[e]),fr=(e=N,t,o=N)=>{const r=Pr(t);return t=>_(Ae(r),r=>{const s=e(t);o(r.addCheckpoint(s),r,s)})},xr=e=>Je(e,"goBackward"),Br=e=>Je(e,"goForward"),Tr=(e,t,o=N)=>{const r=Pr(t);return t=>_(Ae(r),r=>_(e(t),e=>o(r.goTo(e),e)))},Vr=e=>{const t=Pr(e),[o,r]=Ae(Rr(t));return[(s=o,!(0==K(s))),xr(t),r,_(r,e=>Ae(t)?.getCheckpoint(e))??I];var s},Sr=e=>{const t=Pr(e),[,,[o]]=Ae(Rr(t));return[!Q(o),Br(t),o,_(o,e=>Ae(t)?.getCheckpoint(e))??I]},Lr=(e,t)=>Me(O+b,Pr(t),e),jr=(e,t,o)=>Me(O,Pr(o),t,[e]),zr=(e,t,o,r)=>{const[d,l]=n();return u(()=>{let n,d=!0;const u=e=>{e.destroy(),r?.(e)};(async()=>{const r=Ae(e);n=r?await t(r):void 0,d?(l(()=>n),n&&o&&await o(n)):n&&u(n)})(),s(()=>{d=!1,l(()=>{}),n&&u(n)})}),d},Ar=()=>he(6),Fr=e=>me(e,6),Or=e=>we(e,6),Dr=(e,t)=>Ce(e,t,6),Hr=e=>He(S,Or(e),7,[]),Mr=(e,t)=>Me(S,Or(t),e,[]),Qr=(e,t,o)=>{const[r,d]=n();return u(()=>{let r,n=!0;const u=e=>{e.destroy(),o?.(e)};(async()=>{const o=Ae(e);r=o?await t(o):void 0,n?d(()=>r):r&&u(r)})(),s(()=>{n=!1,d(()=>{}),r&&u(r)})}),r},Wr=()=>he(7),_r=e=>me(e,7),Er=e=>we(e,7),Gr=(e,t)=>Ce(e,t,7),Jr=e=>He(S,Er(e),7,[]),Kr=(e,t)=>Me(S,Er(t),e,[]),Nr=(e,t,o,r)=>{const s=Q(t)||!J(e)?e:$(e,(e,o)=>o>0?[t,e]:e);return o?[r,":{",s,"}"]:s},Ur=e=>{const t=kr(()=>e.checkpointId,()=>e.checkpoints);return()=>Nr(le(t)??I,void 0,e.debugIds,e.checkpointId)},Xr=e=>{const t=or(()=>e.queryId,()=>e.rowId,()=>e.cellId,()=>e.queries);return()=>Nr(I+(le(t)??I),void 0,e.debugIds,e.cellId)},Yr=e=>{const t=tr(()=>e.queryId,()=>e.rowId,()=>e.queries);return()=>{const o=e.resultCellComponent??Xr;return Nr($(le(t),t=>l(o,{...ce(e.getResultCellComponentProps,t),queryId:e.queryId,rowId:e.rowId,cellId:t,queries:e.queries,debugIds:e.debugIds})),e.separator,e.debugIds,e.rowId)}},Zr=e=>{const t=ht(()=>e.tableId,()=>e.rowId,()=>e.cellId,()=>e.store);return()=>Nr(I+(le(t)??I),void 0,e.debugIds,e.cellId)},$r=e=>{const t=(t=>{const o=wt(()=>e.tableId,()=>e.rowId,()=>e.store);return()=>le(t)??le(o)})(()=>e.customCellIds);return()=>{const o=e.cellComponent??Zr;return Nr($(le(t),t=>l(o,{...ce(e.getCellComponentProps,t),tableId:e.tableId,rowId:e.rowId,cellId:t,store:e.store,debugIds:e.debugIds})),e.separator,e.debugIds,e.rowId)}},es=(e,t)=>()=>{const o=e.rowComponent??$r;return Nr($(le(t),t=>l(o,{...ce(e.getRowComponentProps,t),tableId:e.tableId,rowId:t,customCellIds:e.customCellIds,store:e.store,debugIds:e.debugIds})),e.separator,e.debugIds,e.tableId)},ts=(e,t)=>()=>{const o=e.resultRowComponent??Yr;return Nr($(le(t),t=>l(o,{...ce(e.getResultRowComponentProps,t),queryId:e.queryId,rowId:t,queries:e.queries,debugIds:e.debugIds})),e.separator,e.debugIds,e.queryId)},os=(e,t,o)=>{const r=zo(()=>e.relationships),s=t(()=>e.relationshipId,o,r);return()=>{const t=e.rowComponent??$r,[n,d,u]=Ie(le(r),e.relationshipId);return Nr($(le(s),o=>l(t,{...ce(e.getRowComponentProps,o),tableId:u,rowId:o,store:d,debugIds:e.debugIds})),e.separator,e.debugIds,le(o))}},rs=e=>t=>{const o=Pr(()=>t.checkpoints),r=Rr(o);return()=>{const s=t.checkpointComponent??Ur;return Nr($(e(le(r)),e=>l(s,{...ce(t.getCheckpointComponentProps,e),checkpoints:le(o),checkpointId:e,debugIds:t.debugIds})),t.separator)}},ss=rs(e=>e[0]),ns=rs(e=>M(e[1])?[]:[e[1]]),ds=rs(e=>e[2]),us=e=>{const t=Ro(()=>e.indexes),o=Bo(()=>e.indexId,()=>e.sliceId,t);return()=>{const r=e.rowComponent??$r,[s,n,d]=(u=le(t),c=e.indexId,[u,u?.getStore(),u?.getTableId(c)]);var u,c;return Nr($(le(o),t=>l(r,{...ce(e.getRowComponentProps,t),tableId:d,rowId:t,store:n,debugIds:e.debugIds})),e.separator,e.debugIds,e.sliceId)}},ls=e=>{const t=fo(()=>e.indexId,()=>e.indexes);return()=>{const o=e.sliceComponent??us;return Nr($(le(t),t=>l(o,{...ce(e.getSliceComponentProps,t),indexId:e.indexId,sliceId:t,indexes:e.indexes,debugIds:e.debugIds})),e.separator,e.debugIds,e.indexId)}},cs=e=>os(e,Ho,()=>e.firstRowId),Is=e=>os(e,Do,()=>e.remoteRowId),is=e=>{const t=ho(()=>e.metricId,()=>e.metrics);return()=>Nr(le(t)??I,void 0,e.debugIds,e.metricId)},as=e=>{const t=zo(()=>e.relationships),o=Oo(()=>e.relationshipId,()=>e.localRowId,t);return()=>{const r=e.rowComponent??$r,[s,n,,d]=Ie(le(t),e.relationshipId),u=le(o);return Nr(Q(d)||Q(u)?null:l(r,{...ce(e.getRowComponentProps,u),tableId:d,rowId:u,store:n,debugIds:e.debugIds}),void 0,e.debugIds,e.localRowId)}},ps=e=>ts(e,$o(()=>e.queryId,()=>e.cellId,()=>e.descending,()=>e.offset,()=>e.limit,()=>e.queries)),gs=e=>ts(e,Zo(()=>e.queryId,()=>e.queries)),bs=e=>es(e,pt(()=>e.tableId,()=>e.cellId,()=>e.descending,()=>e.offset,()=>e.limit,()=>e.store)),ms=e=>es(e,at(()=>e.tableId,()=>e.store)),ws=e=>{const t=nt(()=>e.store);return()=>{const o=e.tableComponent??ms;return Nr($(le(t),t=>l(o,{...ce(e.getTableComponentProps,t),tableId:t,store:e.store,debugIds:e.debugIds})),e.separator)}},Cs=e=>{const t=ft(()=>e.valueId,()=>e.store);return()=>Nr(I+(le(t)??I),void 0,e.debugIds,e.valueId)},hs=e=>{const t=Rt(()=>e.store);return()=>{const o=e.valueComponent??Cs;return Nr($(le(t),t=>l(o,{...ce(e.getValueComponentProps,t),valueId:t,store:e.store,debugIds:e.debugIds})),e.separator)}};export{ss as BackwardCheckpointsView,Zr as CellView,Ur as CheckpointView,ns as CurrentCheckpointView,ds as ForwardCheckpointsView,ls as IndexView,cs as LinkedRowsView,Is as LocalRowsView,is as MetricView,ke as OFFSET_CHECKPOINTS,Pe as OFFSET_INDEXES,ve as OFFSET_METRICS,fe as OFFSET_PERSISTER,Re as OFFSET_QUERIES,qe as OFFSET_RELATIONSHIPS,ye as OFFSET_STORE,xe as OFFSET_SYNCHRONIZER,Ve as Provider,as as RemoteRowView,Xr as ResultCellView,Yr as ResultRowView,ps as ResultSortedTableView,gs as ResultTableView,$r as RowView,us as SliceView,bs as SortedTableView,ms as TableView,ws as TablesView,Cs as ValueView,hs as ValuesView,St as useAddRowCallback,ht as useCell,wt as useCellIds,to as useCellIdsListener,ro as useCellListener,yt as useCellState,kr as useCheckpoint,Rr as useCheckpointIds,Lr as useCheckpointIdsListener,jr as useCheckpointListener,vr as useCheckpoints,yr as useCheckpointsIds,Pr as useCheckpointsOrCheckpointsById,hr as useCreateCheckpoints,vo as useCreateIndexes,tt as useCreateMergeableStore,po as useCreateMetrics,zr as useCreatePersister,_o as useCreateQueries,So as useCreateRelationships,Ue as useCreateStore,Qr as useCreateSynchronizer,Mt as useDelCellCallback,Ht as useDelRowCallback,Dt as useDelTableCallback,Ot as useDelTablesCallback,Wt as useDelValueCallback,Qt as useDelValuesCallback,ao as useDidFinishTransactionListener,xr as useGoBackwardCallback,Br as useGoForwardCallback,Tr as useGoToCallback,Ct as useHasCell,oo as useHasCellListener,gt as useHasRow,$t as useHasRowListener,dt as useHasTable,It as useHasTableCell,Ut as useHasTableCellListener,Jt as useHasTableListener,ot as useHasTables,_t as useHasTablesListener,kt as useHasValue,lo as useHasValueListener,vt as useHasValues,so as useHasValuesListener,xo as useIndexIds,qo as useIndexes,Po as useIndexesIds,Ro as useIndexesOrIndexesById,Ho as useLinkedRowIds,Wo as useLinkedRowIdsListener,Do as useLocalRowIds,Qo as useLocalRowIdsListener,ho as useMetric,Co as useMetricIds,yo as useMetricListener,bo as useMetrics,go as useMetricsIds,mo as useMetricsOrMetricsById,pr as useParamValue,mr as useParamValueListener,gr as useParamValueState,ir as useParamValues,br as useParamValuesListener,ar as useParamValuesState,Fr as usePersister,Ar as usePersisterIds,Or as usePersisterOrPersisterById,Hr as usePersisterStatus,Mr as usePersisterStatusListener,qr as useProvideCheckpoints,ko as useProvideIndexes,wo as useProvideMetrics,Dr as useProvidePersister,Ko as useProvideQueries,Ao as useProvideRelationships,et as useProvideStore,Gr as useProvideSynchronizer,Go as useQueries,Eo as useQueriesIds,Jo as useQueriesOrQueriesById,No as useQueryIds,Sr as useRedoInformation,Fo as useRelationshipIds,jo as useRelationships,Lo as useRelationshipsIds,zo as useRelationshipsOrRelationshipsById,Oo as useRemoteRowId,Mo as useRemoteRowIdListener,or as useResultCell,tr as useResultCellIds,cr as useResultCellIdsListener,Ir as useResultCellListener,er as useResultRow,Yo as useResultRowCount,nr as useResultRowCountListener,Zo as useResultRowIds,dr as useResultRowIdsListener,lr as useResultRowListener,$o as useResultSortedRowIds,ur as useResultSortedRowIdsListener,Uo as useResultTable,Xo as useResultTableCellIds,sr as useResultTableCellIdsListener,rr as useResultTableListener,bt as useRow,it as useRowCount,Xt as useRowCountListener,at as useRowIds,Yt as useRowIdsListener,eo as useRowListener,mt as useRowState,jt as useSetCellCallback,fr as useSetCheckpointCallback,wr as useSetParamValueCallback,Cr as useSetParamValuesCallback,Lt as useSetPartialRowCallback,At as useSetPartialValuesCallback,Vt as useSetRowCallback,Tt as useSetTableCallback,Bt as useSetTablesCallback,Ft as useSetValueCallback,zt as useSetValuesCallback,fo as useSliceIds,To as useSliceIdsListener,Bo as useSliceRowIds,Vo as useSliceRowIdsListener,pt as useSortedRowIds,Zt as useSortedRowIdsListener,Ne as useSortedRowIdsListenerImpl,Io as useStartTransactionListener,Ye as useStore,Xe as useStoreIds,$e as useStoreOrStoreById,Ze as useStores,_r as useSynchronizer,Wr as useSynchronizerIds,Er as useSynchronizerOrSynchronizerById,Jr as useSynchronizerStatus,Kr as useSynchronizerStatusListener,ut as useTable,ct as useTableCellIds,Nt as useTableCellIdsListener,nt as useTableIds,Gt as useTableIdsListener,Kt as useTableListener,lt as useTableState,rt as useTables,Et as useTablesListener,st as useTablesState,Vr as useUndoInformation,ft as useValue,Rt as useValueIds,uo as useValueIdsListener,co as useValueListener,xt as useValueState,Pt as useValues,no as useValuesListener,qt as useValuesState,io as useWillFinishTransactionListener};
@@ -1 +1 @@
1
- import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r,untrack as n}from"svelte";import{createSubscriber as s}from"svelte/reactivity";const d=e=>typeof e,u=d(""),o=d(d),c="Listener",g="Result",i="Has",a="Ids",p="Table",l=p+"s",I=p+a,f="Row",b=f+"Count",h=f+a,m="Sorted"+f+a,v="Cell",x=v+a,_="Value",w=_+"s",y=_+a,$="Transaction",k="Finish",q="Status",R="Metric",C="Slice",T="RemoteRowId",L="Local",B="Linked",V="Checkpoint",S=globalThis,z=e=>void 0===e,F=()=>!z(S.window),P=(j=z,(e,t,r)=>j(e)?r?.():t(e));var j;const A=()=>{},D=Object.keys,H="tinybase_uisc";class M{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get current(){return this.#t(),this.#e()}}class O extends M{#r;constructor(e,t,r){super(e,r),this.#r=t}get current(){return super.current}set current(e){this.#r(e)}}const Q=[],W={},E=[Q,void 0,Q],G=e=>(e=>d(e)==o)(e)?e():e,J=()=>t(H)??[],K=(e,t,r)=>{return z(t)?e[2*r]:d(t)==u?(n=e[2*r+1],s=t,P(n,e=>e[s])):t;var n,s},N=(e,t)=>K(J(),e,t),U=(e,t)=>{const r=J();return()=>K(r,G(e),t)},X=(e,t)=>D(e[2*t+1]??W),Y=e=>U(e,0),Z=e=>U(e,1),ee=e=>U(e,2),te=e=>U(e,3),re=e=>U(e,4),ne=e=>U(e,5),se=e=>U(e,6),de=e=>U(e,7),ue=(t,r,n,d=()=>Q,u)=>{const o=(u?"has":"get")+r,g="add"+(u?i:"")+r+c;let a=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=t(),n=d();e.set(a,s(e=>{const t=r?.[g]?.(...n,e);return()=>r?.delListener?.(t)}),!0)}),new M(()=>t()?.[o]?.(...d())??n,()=>e.get(a)())},oe=(t,r,n,s=()=>Q,d)=>{F()&&e.user_effect(()=>{const e=t(),u=s(),o=e?.["add"+r+c]?.(...u,n,...void 0!==d?[d]:Q);return()=>e?.delListener?.(o)})},ce=e=>ue(Y(e),l,!1,()=>Q,1),ge=e=>ue(Y(e),l,W),ie=e=>ue(Y(e),I,Q),ae=(e,t)=>ue(Y(t),p,!1,()=>[G(e)],1),pe=(e,t)=>ue(Y(t),p,W,()=>[G(e)]),le=(e,t)=>ue(Y(t),p+x,Q,()=>[G(e)]),Ie=(e,t,r)=>ue(Y(r),p+v,!1,()=>[G(e),G(t)],1),fe=(e,t)=>ue(Y(t),b,0,()=>[G(e)]),be=(e,t)=>ue(Y(t),h,Q,()=>[G(e)]),he=(e,t,r=!1,n=0,s,d)=>ue(Y(d),m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),me=(e,t,r)=>ue(Y(r),f,!1,()=>[G(e),G(t)],1),ve=(e,t,r)=>ue(Y(r),f,W,()=>[G(e),G(t)]),xe=(e,t,r)=>ue(Y(r),x,Q,()=>[G(e),G(t)]),_e=(e,t,r,n)=>ue(Y(n),v,!1,()=>[G(e),G(t),G(r)],1),we=(t,r,n,d)=>{const u=Y(d);let o=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const d=u(),c=G(t),g=G(r),i=G(n);e.set(o,s(e=>{const t=d?.addCellListener(c,g,i,e);return()=>d?.delListener?.(t)}),!0)}),new O(()=>u()?.getCell(G(t),G(r),G(n)),e=>u()?.setCell(G(t),G(r),G(n),e),()=>e.get(o)())},ye=e=>ue(Y(e),w,!1,()=>Q,1),$e=e=>ue(Y(e),w,W),ke=e=>ue(Y(e),y,Q),qe=(e,t)=>ue(Y(t),_,!1,()=>[G(e)],1),Re=(t,r)=>{const n=Y(r);let d=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=n(),u=G(t);e.set(d,s(e=>{const t=r?.addValueListener(u,e);return()=>r?.delListener?.(t)}),!0)}),new O(()=>n()?.getValue(G(t)),e=>n()?.setValue(G(t),e),()=>e.get(d)())},Ce=e=>N(e,0),Te=()=>{const t=J();let r=e.state(e.proxy(X(t,0)));return F()&&e.user_effect(()=>{e.set(r,X(t,0),!0)}),{get current(){return e.get(r)}}},Le=e=>N(e,1),Be=()=>{const t=J();let r=e.state(e.proxy(X(t,1)));return F()&&e.user_effect(()=>{e.set(r,X(t,1),!0)}),{get current(){return e.get(r)}}},Ve=e=>ue(Z(e),R+a,Q),Se=(e,t)=>ue(Z(t),R,void 0,()=>[G(e)]),ze=e=>N(e,2),Fe=()=>{const t=J();let r=e.state(e.proxy(X(t,2)));return F()&&e.user_effect(()=>{e.set(r,X(t,2),!0)}),{get current(){return e.get(r)}}},Pe=e=>ue(ee(e),"Index"+a,Q),je=(e,t)=>ue(ee(t),C+a,Q,()=>[G(e)]),Ae=(e,t,r)=>ue(ee(r),C+h,Q,()=>[G(e),G(t)]),De=(e,t)=>{const r=ee(e);return{get store(){return r()?.getStore()},get tableId(){return r()?.getTableId(G(t))}}},He=e=>N(e,4),Me=()=>{const t=J();let r=e.state(e.proxy(X(t,4)));return F()&&e.user_effect(()=>{e.set(r,X(t,4),!0)}),{get current(){return e.get(r)}}},Oe=e=>ue(re(e),"Query"+a,Q),Qe=(e,t)=>ue(re(t),g+p,W,()=>[G(e)]),We=(e,t)=>ue(re(t),g+p+x,Q,()=>[G(e)]),Ee=(e,t)=>ue(re(t),g+b,0,()=>[G(e)]),Ge=(e,t)=>ue(re(t),g+h,Q,()=>[G(e)]),Je=(e,t,r=!1,n=0,s,d)=>ue(re(d),g+m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),Ke=(e,t,r)=>ue(re(r),g+f,W,()=>[G(e),G(t)]),Ne=(e,t,r)=>ue(re(r),g+x,Q,()=>[G(e),G(t)]),Ue=(e,t,r,n)=>ue(re(n),g+v,void 0,()=>[G(e),G(t),G(r)]),Xe=e=>N(e,3),Ye=()=>{const t=J();let r=e.state(e.proxy(X(t,3)));return F()&&e.user_effect(()=>{e.set(r,X(t,3),!0)}),{get current(){return e.get(r)}}},Ze=e=>ue(te(e),"Relationship"+a,Q),et=(e,t,r)=>ue(te(r),T,void 0,()=>[G(e),G(t)]),tt=(e,t,r)=>ue(te(r),L+h,Q,()=>[G(e),G(t)]),rt=(e,t,r)=>ue(te(r),B+h,Q,()=>[G(e),G(t)]),nt=(e,t)=>{const r=te(e);return{get store(){return r()?.getStore()},get localTableId(){return r()?.getLocalTableId(G(t))},get remoteTableId(){return r()?.getRemoteTableId(G(t))}}},st=e=>N(e,5),dt=()=>{const t=J();let r=e.state(e.proxy(X(t,5)));return F()&&e.user_effect(()=>{e.set(r,X(t,5),!0)}),{get current(){return e.get(r)}}},ut=e=>ue(ne(e),V+a,E),ot=(e,t)=>ue(ne(t),V,void 0,()=>[G(e)]),ct=e=>{const t=ne(e);return()=>t()?.goBackward()},gt=e=>{const t=ne(e);return()=>t()?.goForward()},it=e=>N(e,6),at=()=>{const t=J();let r=e.state(e.proxy(X(t,6)));return F()&&e.user_effect(()=>{e.set(r,X(t,6),!0)}),{get current(){return e.get(r)}}},pt=e=>ue(se(e),q,0),lt=e=>N(e,7),It=()=>{const t=J();let r=e.state(e.proxy(X(t,7)));return F()&&e.user_effect(()=>{e.set(r,X(t,7),!0)}),{get current(){return e.get(r)}}},ft=e=>ue(de(e),q,0),bt=(e,t,r)=>oe(Y(r),i+l,e,()=>Q,t),ht=(e,t,r)=>oe(Y(r),l,e,()=>Q,t),mt=(e,t,r)=>oe(Y(r),I,e,()=>Q,t),vt=(e,t,r,n)=>oe(Y(n),i+p,t,()=>[G(e)],r),xt=(e,t,r,n)=>oe(Y(n),p,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g+p+x,t,()=>[G(e)]),Jt=(e,t,r)=>oe(re(r),g+b,t,()=>[G(e)]),Kt=(e,t,r)=>oe(re(r),g+h,t,()=>[G(e)]),Nt=(e,t,r,n,s,d,u)=>oe(re(u),g+m,d,()=>[G(e),G(t),G(r),G(n),G(s)]),Ut=(e,t,r,n)=>oe(re(n),g+f,r,()=>[G(e),G(t)]),Xt=(e,t,r,n)=>oe(re(n),g+x,r,()=>[G(e),G(t)]),Yt=(e,t,r,n,s)=>oe(re(s),g+v,n,()=>[G(e),G(t),G(r)]),Zt=(e,t,r)=>oe(re(r),"ParamValues",t,()=>[G(e)]),er=(e,t,r,n)=>oe(re(n),"ParamValue",r,()=>[G(e),G(t)]),tr=(e,t)=>oe(ne(t),V+a,e),rr=(e,t,r)=>oe(ne(r),V,t,()=>[G(e)]),nr=(e,t)=>oe(se(t),q,e),sr=(e,t)=>oe(de(t),q,e),dr=(t,r,n)=>{const s=J();F()&&e.user_effect(()=>(s[16]?.(n,t,r),()=>s[17]?.(n,t)))},ur=(e,t)=>dr(e,t,0),or=(e,t)=>dr(e,t,1),cr=(e,t)=>dr(e,t,2),gr=(e,t)=>dr(e,t,3),ir=(e,t)=>dr(e,t,4),ar=(e,t)=>dr(e,t,5),pr=(e,t)=>dr(e,t,6),lr=(e,t)=>dr(e,t,7);function Ir(t,r){e.push(r,!0);const n=ot(()=>r.checkpointId,()=>r.checkpoints),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.checkpointId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}var fr=e.from_html("<!><!>",1),br=e.from_html("<!><!><!>",1);function hr(t,r){e.push(r,!0);var n=br(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)},u=e.derived(()=>r.debugIds&&!z(r.id));e.if(s,t=>{e.get(u)&&t(d)});var o=e.sibling(s);e.each(o,18,()=>r.ids,e=>e,(t,n,s)=>{var d=fr(),u=e.first_child(d),o=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.separator),e.append(t,n)};e.if(u,t=>{e.get(s)>0&&r.separator&&t(o)});var c=e.sibling(u),g=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>n),e.append(t,s)},i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>n),e.append(t,s)};e.if(c,e=>{r.custom?e(g):e(i,-1)}),e.append(t,d)});var c=e.sibling(o),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)},i=e.derived(()=>r.debugIds&&!z(r.id));e.if(c,t=>{e.get(i)&&t(g)}),e.append(t,n),e.pop()}function mr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function vr(t,r){e.push(r,!0);const n=we(()=>r.tableId,()=>r.rowId,()=>r.cellId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function xr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[1]);var d=e.comment(),u=e.first_child(d),o=t=>{var n=e.comment(),d=e.first_child(n),u=t=>{var n=e.comment(),d=e.first_child(n);e.snippet(d,()=>r.checkpoint,()=>e.get(s)),e.append(t,n)},o=t=>{Ir(t,{get checkpointId(){return e.get(s)},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};e.if(d,e=>{r.checkpoint?e(u):e(o,-1)}),e.append(t,n)},c=e.derived(()=>!z(e.get(s)));e.if(u,t=>{e.get(c)&&t(o)}),e.append(t,d),e.pop()}function _r(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function wr(t,r){e.push(r,!0);const n=xe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{vr(t,{get tableId(){return r.tableId},get rowId(){return r.rowId},get cellId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:n,$$slots:{default:!0}})}e.pop()}function yr(t,r){e.push(r,!0);const{store:n,tableId:s}=De(()=>r.indexes,()=>r.indexId),d=Ae(()=>r.indexId,()=>r.sliceId,()=>r.indexes);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.sliceId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function $r(t,r){e.push(r,!0);const n=je(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{yr(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.indexId},get custom(){return r.slice},children:s,$$slots:{default:!0}})}e.pop()}function kr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=rt(()=>r.relationshipId,()=>r.firstRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.firstRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function qr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=tt(()=>r.relationshipId,()=>r.remoteRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.remoteRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function Rr(t,r){e.push(r,!0);const n=Se(()=>r.metricId,()=>r.metrics),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.metricId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Cr(s,d){e.push(d,!0);const u=t(H)??[];let o=e.proxy(Array.from({length:8},()=>({})));const c=(e,t,r)=>{o[e]={...n(()=>o[e]),[t]:r}},g=(e,t)=>{const{[t]:r,...s}=n(()=>o[e]);o[e]=s};r(H,{get 0(){return d.store??u[0]},get 1(){return{...u[1]??{},...d.storesById,...o[0]}},get 2(){return d.metrics??u[2]},get 3(){return{...u[3]??{},...d.metricsById,...o[1]}},get 4(){return d.indexes??u[4]},get 5(){return{...u[5]??{},...d.indexesById,...o[2]}},get 6(){return d.relationships??u[6]},get 7(){return{...u[7]??{},...d.relationshipsById,...o[3]}},get 8(){return d.queries??u[8]},get 9(){return{...u[9]??{},...d.queriesById,...o[4]}},get 10(){return d.checkpoints??u[10]},get 11(){return{...u[11]??{},...d.checkpointsById,...o[5]}},get 12(){return d.persister??u[12]},get 13(){return{...u[13]??{},...d.persistersById,...o[6]}},get 14(){return d.synchronizer??u[14]},get 15(){return{...u[15]??{},...d.synchronizersById,...o[7]}},get 16(){return c},get 17(){return g}});var i=e.comment(),a=e.first_child(i);e.snippet(a,()=>d.children),e.append(s,i),e.pop()}var Tr=e.from_html("<!><!><!>",1);function Lr(t,r){e.push(r,!0);const{store:n,remoteTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=et(()=>r.relationshipId,()=>r.localRowId,()=>r.relationships);var u=Tr(),o=e.first_child(u),c=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.localRowId??"")+":{")),e.append(t,n)};e.if(o,e=>{r.debugIds&&e(c)});var g=e.sibling(o),i=t=>{var u=e.comment(),o=e.first_child(u),c=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.row,()=>d.current),e.append(t,n)},g=e=>{wr(e,{get tableId(){return s},get rowId(){return d.current},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{r.row?e(c):s&&e(g,1)}),e.append(t,u)},a=e.derived(()=>!z(d.current));e.if(g,t=>{e.get(a)&&t(i)});var p=e.sibling(g),l=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(p,e=>{r.debugIds&&e(l)}),e.append(t,u),e.pop()}function Br(t,r){e.push(r,!0);const n=Ue(()=>r.queryId,()=>r.rowId,()=>r.cellId,()=>r.queries),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Vr(t,r){e.push(r,!0);const n=Ne(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{Br(t,{get queryId(){return r.queryId},get rowId(){return r.rowId},get cellId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:s,$$slots:{default:!0}})}e.pop()}function Sr(t,r){e.push(r,!0);const n=Je(()=>r.queryId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function zr(t,r){e.push(r,!0);const n=Ge(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Fr(t,r){e.push(r,!0);const n=he(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Pr(t,r){e.push(r,!0);const n=be(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function jr(t,r){e.push(r,!0);const n=ie(()=>r.store);{const s=(t,n=e.noop)=>{Pr(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s,$$slots:{default:!0}})}e.pop()}function Ar(t,r){e.push(r,!0);const n=Re(()=>r.valueId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.valueId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Dr(t,r){e.push(r,!0);const n=ke(()=>r.store);{const s=(t,n=e.noop)=>{Ar(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s,$$slots:{default:!0}})}e.pop()}export{mr as BackwardCheckpointsView,vr as CellView,Ir as CheckpointView,xr as CurrentCheckpointView,_r as ForwardCheckpointsView,$r as IndexView,kr as LinkedRowsView,qr as LocalRowsView,Rr as MetricView,Cr as Provider,Lr as RemoteRowView,Br as ResultCellView,Vr as ResultRowView,Sr as ResultSortedTableView,zr as ResultTableView,wr as RowView,yr as SliceView,Fr as SortedTableView,Pr as TableView,jr as TablesView,Ar as ValueView,Dr as ValuesView,ct as createGoBackwardCallback,gt as createGoForwardCallback,we as getCell,xe as getCellIds,ot as getCheckpoint,ut as getCheckpointIds,st as getCheckpoints,dt as getCheckpointsIds,Pe as getIndexIds,De as getIndexStoreTableId,ze as getIndexes,Fe as getIndexesIds,rt as getLinkedRowIds,tt as getLocalRowIds,Se as getMetric,Ve as getMetricIds,Le as getMetrics,Be as getMetricsIds,it as getPersister,at as getPersisterIds,pt as getPersisterStatus,He as getQueries,Me as getQueriesIds,Oe as getQueryIds,Ze as getRelationshipIds,Xe as getRelationships,Ye as getRelationshipsIds,nt as getRelationshipsStoreTableIds,et as getRemoteRowId,Ue as getResultCell,Ne as getResultCellIds,Ke as getResultRow,Ee as getResultRowCount,Ge as getResultRowIds,Je as getResultSortedRowIds,Qe as getResultTable,We as getResultTableCellIds,ve as getRow,fe as getRowCount,be as getRowIds,je as getSliceIds,Ae as getSliceRowIds,he as getSortedRowIds,Ce as getStore,Te as getStoreIds,lt as getSynchronizer,It as getSynchronizerIds,ft as getSynchronizerStatus,pe as getTable,le as getTableCellIds,ie as getTableIds,ge as getTables,Re as getValue,ke as getValueIds,$e as getValues,_e as hasCell,me as hasRow,ae as hasTable,Ie as hasTableCell,ce as hasTables,qe as hasValue,ye as hasValues,Lt as onCell,Ct as onCellIds,rr as onCheckpoint,tr as onCheckpointIds,At as onDidFinishTransaction,Tt as onHasCell,qt as onHasRow,vt as onHasTable,wt as onHasTableCell,bt as onHasTables,zt as onHasValue,Bt as onHasValues,Wt as onLinkedRowIds,Qt as onLocalRowIds,Dt as onMetric,er as onParamValue,Zt as onParamValues,nr as onPersisterStatus,Ot as onRemoteRowId,Yt as onResultCell,Xt as onResultCellIds,Ut as onResultRow,Jt as onResultRowCount,Kt as onResultRowIds,Nt as onResultSortedRowIds,Et as onResultTable,Gt as onResultTableCellIds,Rt as onRow,yt as onRowCount,$t as onRowIds,Ht as onSliceIds,Mt as onSliceRowIds,kt as onSortedRowIds,Pt as onStartTransaction,sr as onSynchronizerStatus,xt as onTable,_t as onTableCellIds,mt as onTableIds,ht as onTables,Ft as onValue,St as onValueIds,Vt as onValues,jt as onWillFinishTransaction,ar as provideCheckpoints,cr as provideIndexes,or as provideMetrics,pr as providePersister,ir as provideQueries,gr as provideRelationships,ur as provideStore,lr as provideSynchronizer,ne as resolveCheckpoints,ee as resolveIndexes,Z as resolveMetrics,se as resolvePersister,re as resolveQueries,te as resolveRelationships,Y as resolveStore,de as resolveSynchronizer};
1
+ import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r,untrack as n}from"svelte";import{createSubscriber as s}from"svelte/reactivity";const d=e=>typeof e,u=d(""),o=d(d),c="Listener",g="Result",i="Has",a="Ids",p="Table",l=p+"s",I=p+a,f="Row",b=f+"Count",h=f+a,m="Sorted"+f+a,v="Cell",x=v+a,_="Value",w=_+"s",y=_+a,$="Transaction",k="Finish",q="Status",R="Metric",C="Slice",T="RemoteRowId",L="Local",B="Linked",V="Checkpoint",S=globalThis,z=e=>void 0===e,F=()=>!z(S.window),P=(j=z,(e,t,r)=>j(e)?r?.():t(e));var j;const A=()=>{},D=Object.keys,H="tinybase_uisc";class M{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get current(){return this.#t(),this.#e()}}class O extends M{#r;constructor(e,t,r){super(e,r),this.#r=t}get current(){return super.current}set current(e){this.#r(e)}}const Q=[],W={},E=[Q,void 0,Q],G=e=>(e=>d(e)==o)(e)?e():e,J=()=>t(H)??[],K=(e,t,r)=>{return z(t)?e[2*r]:d(t)==u?(n=e[2*r+1],s=t,P(n,e=>e[s])):t;var n,s},N=(e,t)=>K(J(),e,t),U=(e,t)=>{const r=J();return()=>K(r,G(e),t)},X=(e,t)=>D(e[2*t+1]??W),Y=e=>U(e,0),Z=e=>U(e,1),ee=e=>U(e,2),te=e=>U(e,3),re=e=>U(e,4),ne=e=>U(e,5),se=e=>U(e,6),de=e=>U(e,7),ue=(t,r,n,d=()=>Q,u)=>{const o=(u?"has":"get")+r,g="add"+(u?i:"")+r+c;let a=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=t(),n=d();e.set(a,s(e=>{const t=r?.[g]?.(...n,e);return()=>r?.delListener?.(t)}),!0)}),new M(()=>t()?.[o]?.(...d())??n,()=>e.get(a)())},oe=(t,r,n,s=()=>Q,d)=>{F()&&e.user_effect(()=>{const e=t(),u=s(),o=e?.["add"+r+c]?.(...u,n,...void 0!==d?[d]:Q);return()=>e?.delListener?.(o)})},ce=e=>ue(Y(e),l,!1,()=>Q,1),ge=e=>ue(Y(e),l,W),ie=e=>ue(Y(e),I,Q),ae=(e,t)=>ue(Y(t),p,!1,()=>[G(e)],1),pe=(e,t)=>ue(Y(t),p,W,()=>[G(e)]),le=(e,t)=>ue(Y(t),p+x,Q,()=>[G(e)]),Ie=(e,t,r)=>ue(Y(r),p+v,!1,()=>[G(e),G(t)],1),fe=(e,t)=>ue(Y(t),b,0,()=>[G(e)]),be=(e,t)=>ue(Y(t),h,Q,()=>[G(e)]),he=(e,t,r=!1,n=0,s,d)=>ue(Y(d),m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),me=(e,t,r)=>ue(Y(r),f,!1,()=>[G(e),G(t)],1),ve=(e,t,r)=>ue(Y(r),f,W,()=>[G(e),G(t)]),xe=(e,t,r)=>ue(Y(r),x,Q,()=>[G(e),G(t)]),_e=(e,t,r,n)=>ue(Y(n),v,!1,()=>[G(e),G(t),G(r)],1),we=(t,r,n,d)=>{const u=Y(d);let o=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const d=u(),c=G(t),g=G(r),i=G(n);e.set(o,s(e=>{const t=d?.addCellListener(c,g,i,e);return()=>d?.delListener?.(t)}),!0)}),new O(()=>u()?.getCell(G(t),G(r),G(n)),e=>u()?.setCell(G(t),G(r),G(n),e),()=>e.get(o)())},ye=e=>ue(Y(e),w,!1,()=>Q,1),$e=e=>ue(Y(e),w,W),ke=e=>ue(Y(e),y,Q),qe=(e,t)=>ue(Y(t),_,!1,()=>[G(e)],1),Re=(t,r)=>{const n=Y(r);let d=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=n(),u=G(t);e.set(d,s(e=>{const t=r?.addValueListener(u,e);return()=>r?.delListener?.(t)}),!0)}),new O(()=>n()?.getValue(G(t)),e=>n()?.setValue(G(t),e),()=>e.get(d)())},Ce=e=>N(e,0),Te=()=>{const t=J();let r=e.state(e.proxy(X(t,0)));return F()&&e.user_effect(()=>{e.set(r,X(t,0),!0)}),{get current(){return e.get(r)}}},Le=e=>N(e,1),Be=()=>{const t=J();let r=e.state(e.proxy(X(t,1)));return F()&&e.user_effect(()=>{e.set(r,X(t,1),!0)}),{get current(){return e.get(r)}}},Ve=e=>ue(Z(e),R+a,Q),Se=(e,t)=>ue(Z(t),R,void 0,()=>[G(e)]),ze=e=>N(e,2),Fe=()=>{const t=J();let r=e.state(e.proxy(X(t,2)));return F()&&e.user_effect(()=>{e.set(r,X(t,2),!0)}),{get current(){return e.get(r)}}},Pe=e=>ue(ee(e),"Index"+a,Q),je=(e,t)=>ue(ee(t),C+a,Q,()=>[G(e)]),Ae=(e,t,r)=>ue(ee(r),C+h,Q,()=>[G(e),G(t)]),De=(e,t)=>{const r=ee(e);return{get store(){return r()?.getStore()},get tableId(){return r()?.getTableId(G(t))}}},He=e=>N(e,4),Me=()=>{const t=J();let r=e.state(e.proxy(X(t,4)));return F()&&e.user_effect(()=>{e.set(r,X(t,4),!0)}),{get current(){return e.get(r)}}},Oe=e=>ue(re(e),"Query"+a,Q),Qe=(e,t)=>ue(re(t),g+p,W,()=>[G(e)]),We=(e,t)=>ue(re(t),g+p+x,Q,()=>[G(e)]),Ee=(e,t)=>ue(re(t),g+b,0,()=>[G(e)]),Ge=(e,t)=>ue(re(t),g+h,Q,()=>[G(e)]),Je=(e,t,r=!1,n=0,s,d)=>ue(re(d),g+m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),Ke=(e,t,r)=>ue(re(r),g+f,W,()=>[G(e),G(t)]),Ne=(e,t,r)=>ue(re(r),g+x,Q,()=>[G(e),G(t)]),Ue=(e,t,r,n)=>ue(re(n),g+v,void 0,()=>[G(e),G(t),G(r)]),Xe=e=>N(e,3),Ye=()=>{const t=J();let r=e.state(e.proxy(X(t,3)));return F()&&e.user_effect(()=>{e.set(r,X(t,3),!0)}),{get current(){return e.get(r)}}},Ze=e=>ue(te(e),"Relationship"+a,Q),et=(e,t,r)=>ue(te(r),T,void 0,()=>[G(e),G(t)]),tt=(e,t,r)=>ue(te(r),L+h,Q,()=>[G(e),G(t)]),rt=(e,t,r)=>ue(te(r),B+h,Q,()=>[G(e),G(t)]),nt=(e,t)=>{const r=te(e);return{get store(){return r()?.getStore()},get localTableId(){return r()?.getLocalTableId(G(t))},get remoteTableId(){return r()?.getRemoteTableId(G(t))}}},st=e=>N(e,5),dt=()=>{const t=J();let r=e.state(e.proxy(X(t,5)));return F()&&e.user_effect(()=>{e.set(r,X(t,5),!0)}),{get current(){return e.get(r)}}},ut=e=>ue(ne(e),V+a,E),ot=(e,t)=>ue(ne(t),V,void 0,()=>[G(e)]),ct=e=>{const t=ne(e);return()=>t()?.goBackward()},gt=e=>{const t=ne(e);return()=>t()?.goForward()},it=e=>N(e,6),at=()=>{const t=J();let r=e.state(e.proxy(X(t,6)));return F()&&e.user_effect(()=>{e.set(r,X(t,6),!0)}),{get current(){return e.get(r)}}},pt=e=>ue(se(e),q,0),lt=e=>N(e,7),It=()=>{const t=J();let r=e.state(e.proxy(X(t,7)));return F()&&e.user_effect(()=>{e.set(r,X(t,7),!0)}),{get current(){return e.get(r)}}},ft=e=>ue(de(e),q,0),bt=(e,t,r)=>oe(Y(r),i+l,e,()=>Q,t),ht=(e,t,r)=>oe(Y(r),l,e,()=>Q,t),mt=(e,t,r)=>oe(Y(r),I,e,()=>Q,t),vt=(e,t,r,n)=>oe(Y(n),i+p,t,()=>[G(e)],r),xt=(e,t,r,n)=>oe(Y(n),p,t,()=>[G(e)],r),_t=(e,t,r,n)=>oe(Y(n),p+x,t,()=>[G(e)],r),wt=(e,t,r,n,s)=>oe(Y(s),i+p+v,r,()=>[G(e),G(t)],n),yt=(e,t,r,n)=>oe(Y(n),b,t,()=>[G(e)],r),$t=(e,t,r,n)=>oe(Y(n),h,t,()=>[G(e)],r),kt=(e,t,r,n,s,d,u,o)=>oe(Y(o),m,d,()=>[G(e),G(t),G(r),G(n),G(s)],u),qt=(e,t,r,n,s)=>oe(Y(s),i+f,r,()=>[G(e),G(t)],n),Rt=(e,t,r,n,s)=>oe(Y(s),f,r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ues",t,()=>[G(e)]),er=(e,t,r,n)=>oe(re(n),"ParamValue",r,()=>[G(e),G(t)]),tr=(e,t)=>oe(ne(t),V+a,e),rr=(e,t,r)=>oe(ne(r),V,t,()=>[G(e)]),nr=(e,t)=>oe(se(t),q,e),sr=(e,t)=>oe(de(t),q,e),dr=(t,r,n)=>{const s=J();F()&&e.user_effect(()=>(s[16]?.(n,t,r),()=>s[17]?.(n,t)))},ur=(e,t)=>dr(e,t,0),or=(e,t)=>dr(e,t,1),cr=(e,t)=>dr(e,t,2),gr=(e,t)=>dr(e,t,3),ir=(e,t)=>dr(e,t,4),ar=(e,t)=>dr(e,t,5),pr=(e,t)=>dr(e,t,6),lr=(e,t)=>dr(e,t,7);function Ir(t,r){e.push(r,!0);const n=ot(()=>r.checkpointId,()=>r.checkpoints),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.checkpointId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}var fr=e.from_html("<!><!>",1),br=e.from_html("<!><!><!>",1);function hr(t,r){e.push(r,!0);var n=br(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)},u=e.derived(()=>r.debugIds&&!z(r.id));e.if(s,t=>{e.get(u)&&t(d)});var o=e.sibling(s);e.each(o,18,()=>r.ids,e=>e,(t,n,s)=>{var d=fr(),u=e.first_child(d),o=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.separator),e.append(t,n)};e.if(u,t=>{e.get(s)>0&&r.separator&&t(o)});var c=e.sibling(u),g=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>n),e.append(t,s)},i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>n),e.append(t,s)};e.if(c,e=>{r.custom?e(g):e(i,-1)}),e.append(t,d)});var c=e.sibling(o),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)},i=e.derived(()=>r.debugIds&&!z(r.id));e.if(c,t=>{e.get(i)&&t(g)}),e.append(t,n),e.pop()}function mr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function vr(t,r){e.push(r,!0);const n=we(()=>r.tableId,()=>r.rowId,()=>r.cellId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function xr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[1]);var d=e.comment(),u=e.first_child(d),o=t=>{var n=e.comment(),d=e.first_child(n),u=t=>{var n=e.comment(),d=e.first_child(n);e.snippet(d,()=>r.checkpoint,()=>e.get(s)),e.append(t,n)},o=t=>{Ir(t,{get checkpointId(){return e.get(s)},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};e.if(d,e=>{r.checkpoint?e(u):e(o,-1)}),e.append(t,n)},c=e.derived(()=>!(null==e.get(s)));e.if(u,t=>{e.get(c)&&t(o)}),e.append(t,d),e.pop()}function _r(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function wr(t,r){e.push(r,!0);const n=xe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{vr(t,{get tableId(){return r.tableId},get rowId(){return r.rowId},get cellId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:n,$$slots:{default:!0}})}e.pop()}function yr(t,r){e.push(r,!0);const{store:n,tableId:s}=De(()=>r.indexes,()=>r.indexId),d=Ae(()=>r.indexId,()=>r.sliceId,()=>r.indexes);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})},g=e.derived(()=>!z(s));e.if(o,t=>{e.get(g)&&t(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.sliceId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function $r(t,r){e.push(r,!0);const n=je(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{yr(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.indexId},get custom(){return r.slice},children:s,$$slots:{default:!0}})}e.pop()}function kr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=rt(()=>r.relationshipId,()=>r.firstRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})},g=e.derived(()=>!z(s));e.if(o,t=>{e.get(g)&&t(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.firstRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function qr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=tt(()=>r.relationshipId,()=>r.remoteRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})},g=e.derived(()=>!z(s));e.if(o,t=>{e.get(g)&&t(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.remoteRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function Rr(t,r){e.push(r,!0);const n=Se(()=>r.metricId,()=>r.metrics),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.metricId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Cr(s,d){e.push(d,!0);const u=t(H)??[];let o=e.proxy(Array.from({length:8},()=>({})));const c=(e,t,r)=>{o[e]={...n(()=>o[e]),[t]:r}},g=(e,t)=>{const{[t]:r,...s}=n(()=>o[e]);o[e]=s};r(H,{get 0(){return d.store??u[0]},get 1(){return{...u[1]??{},...d.storesById,...o[0]}},get 2(){return d.metrics??u[2]},get 3(){return{...u[3]??{},...d.metricsById,...o[1]}},get 4(){return d.indexes??u[4]},get 5(){return{...u[5]??{},...d.indexesById,...o[2]}},get 6(){return d.relationships??u[6]},get 7(){return{...u[7]??{},...d.relationshipsById,...o[3]}},get 8(){return d.queries??u[8]},get 9(){return{...u[9]??{},...d.queriesById,...o[4]}},get 10(){return d.checkpoints??u[10]},get 11(){return{...u[11]??{},...d.checkpointsById,...o[5]}},get 12(){return d.persister??u[12]},get 13(){return{...u[13]??{},...d.persistersById,...o[6]}},get 14(){return d.synchronizer??u[14]},get 15(){return{...u[15]??{},...d.synchronizersById,...o[7]}},get 16(){return c},get 17(){return g}});var i=e.comment(),a=e.first_child(i);e.snippet(a,()=>d.children),e.append(s,i),e.pop()}var Tr=e.from_html("<!><!><!>",1);function Lr(t,r){e.push(r,!0);const{store:n,remoteTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=et(()=>r.relationshipId,()=>r.localRowId,()=>r.relationships);var u=Tr(),o=e.first_child(u),c=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.localRowId??"")+":{")),e.append(t,n)};e.if(o,e=>{r.debugIds&&e(c)});var g=e.sibling(o),i=t=>{var u=e.comment(),o=e.first_child(u),c=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.row,()=>d.current),e.append(t,n)},g=e=>{wr(e,{get tableId(){return s},get rowId(){return d.current},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{r.row?e(c):s&&e(g,1)}),e.append(t,u)},a=e.derived(()=>!z(d.current));e.if(g,t=>{e.get(a)&&t(i)});var p=e.sibling(g),l=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(p,e=>{r.debugIds&&e(l)}),e.append(t,u),e.pop()}function Br(t,r){e.push(r,!0);const n=Ue(()=>r.queryId,()=>r.rowId,()=>r.cellId,()=>r.queries),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Vr(t,r){e.push(r,!0);const n=Ne(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{Br(t,{get queryId(){return r.queryId},get rowId(){return r.rowId},get cellId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:s,$$slots:{default:!0}})}e.pop()}function Sr(t,r){e.push(r,!0);const n=Je(()=>r.queryId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function zr(t,r){e.push(r,!0);const n=Ge(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Fr(t,r){e.push(r,!0);const n=he(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Pr(t,r){e.push(r,!0);const n=be(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function jr(t,r){e.push(r,!0);const n=ie(()=>r.store);{const s=(t,n=e.noop)=>{Pr(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s,$$slots:{default:!0}})}e.pop()}function Ar(t,r){e.push(r,!0);const n=Re(()=>r.valueId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.valueId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Dr(t,r){e.push(r,!0);const n=ke(()=>r.store);{const s=(t,n=e.noop)=>{Ar(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s,$$slots:{default:!0}})}e.pop()}export{mr as BackwardCheckpointsView,vr as CellView,Ir as CheckpointView,xr as CurrentCheckpointView,_r as ForwardCheckpointsView,$r as IndexView,kr as LinkedRowsView,qr as LocalRowsView,Rr as MetricView,Cr as Provider,Lr as RemoteRowView,Br as ResultCellView,Vr as ResultRowView,Sr as ResultSortedTableView,zr as ResultTableView,wr as RowView,yr as SliceView,Fr as SortedTableView,Pr as TableView,jr as TablesView,Ar as ValueView,Dr as ValuesView,ct as createGoBackwardCallback,gt as createGoForwardCallback,we as getCell,xe as getCellIds,ot as getCheckpoint,ut as getCheckpointIds,st as getCheckpoints,dt as getCheckpointsIds,Pe as getIndexIds,De as getIndexStoreTableId,ze as getIndexes,Fe as getIndexesIds,rt as getLinkedRowIds,tt as getLocalRowIds,Se as getMetric,Ve as getMetricIds,Le as getMetrics,Be as getMetricsIds,it as getPersister,at as getPersisterIds,pt as getPersisterStatus,He as getQueries,Me as getQueriesIds,Oe as getQueryIds,Ze as getRelationshipIds,Xe as getRelationships,Ye as getRelationshipsIds,nt as getRelationshipsStoreTableIds,et as getRemoteRowId,Ue as getResultCell,Ne as getResultCellIds,Ke as getResultRow,Ee as getResultRowCount,Ge as getResultRowIds,Je as getResultSortedRowIds,Qe as getResultTable,We as getResultTableCellIds,ve as getRow,fe as getRowCount,be as getRowIds,je as getSliceIds,Ae as getSliceRowIds,he as getSortedRowIds,Ce as getStore,Te as getStoreIds,lt as getSynchronizer,It as getSynchronizerIds,ft as getSynchronizerStatus,pe as getTable,le as getTableCellIds,ie as getTableIds,ge as getTables,Re as getValue,ke as getValueIds,$e as getValues,_e as hasCell,me as hasRow,ae as hasTable,Ie as hasTableCell,ce as hasTables,qe as hasValue,ye as hasValues,Lt as onCell,Ct as onCellIds,rr as onCheckpoint,tr as onCheckpointIds,At as onDidFinishTransaction,Tt as onHasCell,qt as onHasRow,vt as onHasTable,wt as onHasTableCell,bt as onHasTables,zt as onHasValue,Bt as onHasValues,Wt as onLinkedRowIds,Qt as onLocalRowIds,Dt as onMetric,er as onParamValue,Zt as onParamValues,nr as onPersisterStatus,Ot as onRemoteRowId,Yt as onResultCell,Xt as onResultCellIds,Ut as onResultRow,Jt as onResultRowCount,Kt as onResultRowIds,Nt as onResultSortedRowIds,Et as onResultTable,Gt as onResultTableCellIds,Rt as onRow,yt as onRowCount,$t as onRowIds,Ht as onSliceIds,Mt as onSliceRowIds,kt as onSortedRowIds,Pt as onStartTransaction,sr as onSynchronizerStatus,xt as onTable,_t as onTableCellIds,mt as onTableIds,ht as onTables,Ft as onValue,St as onValueIds,Vt as onValues,jt as onWillFinishTransaction,ar as provideCheckpoints,cr as provideIndexes,or as provideMetrics,pr as providePersister,ir as provideQueries,gr as provideRelationships,ur as provideStore,lr as provideSynchronizer,ne as resolveCheckpoints,ee as resolveIndexes,Z as resolveMetrics,se as resolvePersister,re as resolveQueries,te as resolveRelationships,Y as resolveStore,de as resolveSynchronizer};
Binary file
@@ -1 +1 @@
1
- import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r,untrack as n}from"svelte";import{createSubscriber as s}from"svelte/reactivity";const d=e=>typeof e,u=d(""),o=d(d),c="Listener",g="Result",i="Has",a="Ids",p="Table",l=p+"s",I=p+a,f="Row",b=f+"Count",h=f+a,m="Sorted"+f+a,v="Cell",x=v+a,_="Value",w=_+"s",y=_+a,$="Transaction",k="Finish",q="Status",R="Metric",C="Slice",T="RemoteRowId",L="Local",B="Linked",V="Checkpoint",S=globalThis,z=e=>void 0===e,F=()=>!z(S.window),P=(j=z,(e,t,r)=>j(e)?r?.():t(e));var j;const A=()=>{},D=Object.keys,H="tinybase_uisc";class M{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get current(){return this.#t(),this.#e()}}class O extends M{#r;constructor(e,t,r){super(e,r),this.#r=t}get current(){return super.current}set current(e){this.#r(e)}}const Q=[],W={},E=[Q,void 0,Q],G=e=>(e=>d(e)==o)(e)?e():e,J=()=>t(H)??[],K=(e,t,r)=>{return z(t)?e[2*r]:d(t)==u?(n=e[2*r+1],s=t,P(n,e=>e[s])):t;var n,s},N=(e,t)=>K(J(),e,t),U=(e,t)=>{const r=J();return()=>K(r,G(e),t)},X=(e,t)=>D(e[2*t+1]??W),Y=e=>U(e,0),Z=e=>U(e,1),ee=e=>U(e,2),te=e=>U(e,3),re=e=>U(e,4),ne=e=>U(e,5),se=e=>U(e,6),de=e=>U(e,7),ue=(t,r,n,d=()=>Q,u)=>{const o=(u?"has":"get")+r,g="add"+(u?i:"")+r+c;let a=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=t(),n=d();e.set(a,s(e=>{const t=r?.[g]?.(...n,e);return()=>r?.delListener?.(t)}),!0)}),new M(()=>t()?.[o]?.(...d())??n,()=>e.get(a)())},oe=(t,r,n,s=()=>Q,d)=>{F()&&e.user_effect(()=>{const e=t(),u=s(),o=e?.["add"+r+c]?.(...u,n,...void 0!==d?[d]:Q);return()=>e?.delListener?.(o)})},ce=e=>ue(Y(e),l,!1,()=>Q,1),ge=e=>ue(Y(e),l,W),ie=e=>ue(Y(e),I,Q),ae=(e,t)=>ue(Y(t),p,!1,()=>[G(e)],1),pe=(e,t)=>ue(Y(t),p,W,()=>[G(e)]),le=(e,t)=>ue(Y(t),p+x,Q,()=>[G(e)]),Ie=(e,t,r)=>ue(Y(r),p+v,!1,()=>[G(e),G(t)],1),fe=(e,t)=>ue(Y(t),b,0,()=>[G(e)]),be=(e,t)=>ue(Y(t),h,Q,()=>[G(e)]),he=(e,t,r=!1,n=0,s,d)=>ue(Y(d),m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),me=(e,t,r)=>ue(Y(r),f,!1,()=>[G(e),G(t)],1),ve=(e,t,r)=>ue(Y(r),f,W,()=>[G(e),G(t)]),xe=(e,t,r)=>ue(Y(r),x,Q,()=>[G(e),G(t)]),_e=(e,t,r,n)=>ue(Y(n),v,!1,()=>[G(e),G(t),G(r)],1),we=(t,r,n,d)=>{const u=Y(d);let o=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const d=u(),c=G(t),g=G(r),i=G(n);e.set(o,s(e=>{const t=d?.addCellListener(c,g,i,e);return()=>d?.delListener?.(t)}),!0)}),new O(()=>u()?.getCell(G(t),G(r),G(n)),e=>u()?.setCell(G(t),G(r),G(n),e),()=>e.get(o)())},ye=e=>ue(Y(e),w,!1,()=>Q,1),$e=e=>ue(Y(e),w,W),ke=e=>ue(Y(e),y,Q),qe=(e,t)=>ue(Y(t),_,!1,()=>[G(e)],1),Re=(t,r)=>{const n=Y(r);let d=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=n(),u=G(t);e.set(d,s(e=>{const t=r?.addValueListener(u,e);return()=>r?.delListener?.(t)}),!0)}),new O(()=>n()?.getValue(G(t)),e=>n()?.setValue(G(t),e),()=>e.get(d)())},Ce=e=>N(e,0),Te=()=>{const t=J();let r=e.state(e.proxy(X(t,0)));return F()&&e.user_effect(()=>{e.set(r,X(t,0),!0)}),{get current(){return e.get(r)}}},Le=e=>N(e,1),Be=()=>{const t=J();let r=e.state(e.proxy(X(t,1)));return F()&&e.user_effect(()=>{e.set(r,X(t,1),!0)}),{get current(){return e.get(r)}}},Ve=e=>ue(Z(e),R+a,Q),Se=(e,t)=>ue(Z(t),R,void 0,()=>[G(e)]),ze=e=>N(e,2),Fe=()=>{const t=J();let r=e.state(e.proxy(X(t,2)));return F()&&e.user_effect(()=>{e.set(r,X(t,2),!0)}),{get current(){return e.get(r)}}},Pe=e=>ue(ee(e),"Index"+a,Q),je=(e,t)=>ue(ee(t),C+a,Q,()=>[G(e)]),Ae=(e,t,r)=>ue(ee(r),C+h,Q,()=>[G(e),G(t)]),De=(e,t)=>{const r=ee(e);return{get store(){return r()?.getStore()},get tableId(){return r()?.getTableId(G(t))}}},He=e=>N(e,4),Me=()=>{const t=J();let r=e.state(e.proxy(X(t,4)));return F()&&e.user_effect(()=>{e.set(r,X(t,4),!0)}),{get current(){return e.get(r)}}},Oe=e=>ue(re(e),"Query"+a,Q),Qe=(e,t)=>ue(re(t),g+p,W,()=>[G(e)]),We=(e,t)=>ue(re(t),g+p+x,Q,()=>[G(e)]),Ee=(e,t)=>ue(re(t),g+b,0,()=>[G(e)]),Ge=(e,t)=>ue(re(t),g+h,Q,()=>[G(e)]),Je=(e,t,r=!1,n=0,s,d)=>ue(re(d),g+m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),Ke=(e,t,r)=>ue(re(r),g+f,W,()=>[G(e),G(t)]),Ne=(e,t,r)=>ue(re(r),g+x,Q,()=>[G(e),G(t)]),Ue=(e,t,r,n)=>ue(re(n),g+v,void 0,()=>[G(e),G(t),G(r)]),Xe=e=>N(e,3),Ye=()=>{const t=J();let r=e.state(e.proxy(X(t,3)));return F()&&e.user_effect(()=>{e.set(r,X(t,3),!0)}),{get current(){return e.get(r)}}},Ze=e=>ue(te(e),"Relationship"+a,Q),et=(e,t,r)=>ue(te(r),T,void 0,()=>[G(e),G(t)]),tt=(e,t,r)=>ue(te(r),L+h,Q,()=>[G(e),G(t)]),rt=(e,t,r)=>ue(te(r),B+h,Q,()=>[G(e),G(t)]),nt=(e,t)=>{const r=te(e);return{get store(){return r()?.getStore()},get localTableId(){return r()?.getLocalTableId(G(t))},get remoteTableId(){return r()?.getRemoteTableId(G(t))}}},st=e=>N(e,5),dt=()=>{const t=J();let r=e.state(e.proxy(X(t,5)));return F()&&e.user_effect(()=>{e.set(r,X(t,5),!0)}),{get current(){return e.get(r)}}},ut=e=>ue(ne(e),V+a,E),ot=(e,t)=>ue(ne(t),V,void 0,()=>[G(e)]),ct=e=>{const t=ne(e);return()=>t()?.goBackward()},gt=e=>{const t=ne(e);return()=>t()?.goForward()},it=e=>N(e,6),at=()=>{const t=J();let r=e.state(e.proxy(X(t,6)));return F()&&e.user_effect(()=>{e.set(r,X(t,6),!0)}),{get current(){return e.get(r)}}},pt=e=>ue(se(e),q,0),lt=e=>N(e,7),It=()=>{const t=J();let r=e.state(e.proxy(X(t,7)));return F()&&e.user_effect(()=>{e.set(r,X(t,7),!0)}),{get current(){return e.get(r)}}},ft=e=>ue(de(e),q,0),bt=(e,t,r)=>oe(Y(r),i+l,e,()=>Q,t),ht=(e,t,r)=>oe(Y(r),l,e,()=>Q,t),mt=(e,t,r)=>oe(Y(r),I,e,()=>Q,t),vt=(e,t,r,n)=>oe(Y(n),i+p,t,()=>[G(e)],r),xt=(e,t,r,n)=>oe(Y(n),p,t,()=>[G(e)],r),_t=(e,t,r,n)=>oe(Y(n),p+x,t,()=>[G(e)],r),wt=(e,t,r,n,s)=>oe(Y(s),i+p+v,r,()=>[G(e),G(t)],n),yt=(e,t,r,n)=>oe(Y(n),b,t,()=>[G(e)],r),$t=(e,t,r,n)=>oe(Y(n),h,t,()=>[G(e)],r),kt=(e,t,r,n,s,d,u,o)=>oe(Y(o),m,d,()=>[G(e),G(t),G(r),G(n),G(s)],u),qt=(e,t,r,n,s)=>oe(Y(s),i+f,r,()=>[G(e),G(t)],n),Rt=(e,t,r,n,s)=>oe(Y(s),f,r,()=>[G(e),G(t)],n),Ct=(e,t,r,n,s)=>oe(Y(s),x,r,()=>[G(e),G(t)],n),Tt=(e,t,r,n,s,d)=>oe(Y(d),i+v,n,()=>[G(e),G(t),G(r)],s),Lt=(e,t,r,n,s,d)=>oe(Y(d),v,n,()=>[G(e),G(t),G(r)],s),Bt=(e,t,r)=>oe(Y(r),i+w,e,()=>Q,t),Vt=(e,t,r)=>oe(Y(r),w,e,()=>Q,t),St=(e,t,r)=>oe(Y(r),y,e,()=>Q,t),zt=(e,t,r,n)=>oe(Y(n),i+_,t,()=>[G(e)],r),Ft=(e,t,r,n)=>oe(Y(n),_,t,()=>[G(e)],r),Pt=(e,t)=>oe(Y(t),"Start"+$,e),jt=(e,t)=>oe(Y(t),"Will"+k+$,e),At=(e,t)=>oe(Y(t),"Did"+k+$,e),Dt=(e,t,r)=>oe(Z(r),R,t,()=>[G(e)]),Ht=(e,t,r)=>oe(ee(r),C+a,t,()=>[G(e)]),Mt=(e,t,r,n)=>oe(ee(n),C+h,r,()=>[G(e),G(t)]),Ot=(e,t,r,n)=>oe(te(n),T,r,()=>[G(e),G(t)]),Qt=(e,t,r,n)=>oe(te(n),L+h,r,()=>[G(e),G(t)]),Wt=(e,t,r,n)=>oe(te(n),B+h,r,()=>[G(e),G(t)]),Et=(e,t,r)=>oe(re(r),g+p,t,()=>[G(e)]),Gt=(e,t,r)=>oe(re(r),g+p+x,t,()=>[G(e)]),Jt=(e,t,r)=>oe(re(r),g+b,t,()=>[G(e)]),Kt=(e,t,r)=>oe(re(r),g+h,t,()=>[G(e)]),Nt=(e,t,r,n,s,d,u)=>oe(re(u),g+m,d,()=>[G(e),G(t),G(r),G(n),G(s)]),Ut=(e,t,r,n)=>oe(re(n),g+f,r,()=>[G(e),G(t)]),Xt=(e,t,r,n)=>oe(re(n),g+x,r,()=>[G(e),G(t)]),Yt=(e,t,r,n,s)=>oe(re(s),g+v,n,()=>[G(e),G(t),G(r)]),Zt=(e,t,r)=>oe(re(r),"ParamValues",t,()=>[G(e)]),er=(e,t,r,n)=>oe(re(n),"ParamValue",r,()=>[G(e),G(t)]),tr=(e,t)=>oe(ne(t),V+a,e),rr=(e,t,r)=>oe(ne(r),V,t,()=>[G(e)]),nr=(e,t)=>oe(se(t),q,e),sr=(e,t)=>oe(de(t),q,e),dr=(t,r,n)=>{const s=J();F()&&e.user_effect(()=>(s[16]?.(n,t,r),()=>s[17]?.(n,t)))},ur=(e,t)=>dr(e,t,0),or=(e,t)=>dr(e,t,1),cr=(e,t)=>dr(e,t,2),gr=(e,t)=>dr(e,t,3),ir=(e,t)=>dr(e,t,4),ar=(e,t)=>dr(e,t,5),pr=(e,t)=>dr(e,t,6),lr=(e,t)=>dr(e,t,7);function Ir(t,r){e.push(r,!0);const n=ot(()=>r.checkpointId,()=>r.checkpoints),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.checkpointId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}var fr=e.from_html("<!><!>",1),br=e.from_html("<!><!><!>",1);function hr(t,r){e.push(r,!0);var n=br(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)},u=e.derived(()=>r.debugIds&&!z(r.id));e.if(s,t=>{e.get(u)&&t(d)});var o=e.sibling(s);e.each(o,18,()=>r.ids,e=>e,(t,n,s)=>{var d=fr(),u=e.first_child(d),o=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.separator),e.append(t,n)};e.if(u,t=>{e.get(s)>0&&r.separator&&t(o)});var c=e.sibling(u),g=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>n),e.append(t,s)},i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>n),e.append(t,s)};e.if(c,e=>{r.custom?e(g):e(i,-1)}),e.append(t,d)});var c=e.sibling(o),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)},i=e.derived(()=>r.debugIds&&!z(r.id));e.if(c,t=>{e.get(i)&&t(g)}),e.append(t,n),e.pop()}function mr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function vr(t,r){e.push(r,!0);const n=we(()=>r.tableId,()=>r.rowId,()=>r.cellId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function xr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[1]);var d=e.comment(),u=e.first_child(d),o=t=>{var n=e.comment(),d=e.first_child(n),u=t=>{var n=e.comment(),d=e.first_child(n);e.snippet(d,()=>r.checkpoint,()=>e.get(s)),e.append(t,n)},o=t=>{Ir(t,{get checkpointId(){return e.get(s)},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};e.if(d,e=>{r.checkpoint?e(u):e(o,-1)}),e.append(t,n)},c=e.derived(()=>!z(e.get(s)));e.if(u,t=>{e.get(c)&&t(o)}),e.append(t,d),e.pop()}function _r(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function wr(t,r){e.push(r,!0);const n=xe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{vr(t,{get tableId(){return r.tableId},get rowId(){return r.rowId},get cellId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:n,$$slots:{default:!0}})}e.pop()}function yr(t,r){e.push(r,!0);const{store:n,tableId:s}=De(()=>r.indexes,()=>r.indexId),d=Ae(()=>r.indexId,()=>r.sliceId,()=>r.indexes);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.sliceId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function $r(t,r){e.push(r,!0);const n=je(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{yr(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.indexId},get custom(){return r.slice},children:s,$$slots:{default:!0}})}e.pop()}function kr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=rt(()=>r.relationshipId,()=>r.firstRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.firstRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function qr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=tt(()=>r.relationshipId,()=>r.remoteRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{s&&e(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.remoteRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function Rr(t,r){e.push(r,!0);const n=Se(()=>r.metricId,()=>r.metrics),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.metricId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Cr(s,d){e.push(d,!0);const u=t(H)??[];let o=e.proxy(Array.from({length:8},()=>({})));const c=(e,t,r)=>{o[e]={...n(()=>o[e]),[t]:r}},g=(e,t)=>{const{[t]:r,...s}=n(()=>o[e]);o[e]=s};r(H,{get 0(){return d.store??u[0]},get 1(){return{...u[1]??{},...d.storesById,...o[0]}},get 2(){return d.metrics??u[2]},get 3(){return{...u[3]??{},...d.metricsById,...o[1]}},get 4(){return d.indexes??u[4]},get 5(){return{...u[5]??{},...d.indexesById,...o[2]}},get 6(){return d.relationships??u[6]},get 7(){return{...u[7]??{},...d.relationshipsById,...o[3]}},get 8(){return d.queries??u[8]},get 9(){return{...u[9]??{},...d.queriesById,...o[4]}},get 10(){return d.checkpoints??u[10]},get 11(){return{...u[11]??{},...d.checkpointsById,...o[5]}},get 12(){return d.persister??u[12]},get 13(){return{...u[13]??{},...d.persistersById,...o[6]}},get 14(){return d.synchronizer??u[14]},get 15(){return{...u[15]??{},...d.synchronizersById,...o[7]}},get 16(){return c},get 17(){return g}});var i=e.comment(),a=e.first_child(i);e.snippet(a,()=>d.children),e.append(s,i),e.pop()}var Tr=e.from_html("<!><!><!>",1);function Lr(t,r){e.push(r,!0);const{store:n,remoteTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=et(()=>r.relationshipId,()=>r.localRowId,()=>r.relationships);var u=Tr(),o=e.first_child(u),c=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.localRowId??"")+":{")),e.append(t,n)};e.if(o,e=>{r.debugIds&&e(c)});var g=e.sibling(o),i=t=>{var u=e.comment(),o=e.first_child(u),c=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.row,()=>d.current),e.append(t,n)},g=e=>{wr(e,{get tableId(){return s},get rowId(){return d.current},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{r.row?e(c):s&&e(g,1)}),e.append(t,u)},a=e.derived(()=>!z(d.current));e.if(g,t=>{e.get(a)&&t(i)});var p=e.sibling(g),l=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(p,e=>{r.debugIds&&e(l)}),e.append(t,u),e.pop()}function Br(t,r){e.push(r,!0);const n=Ue(()=>r.queryId,()=>r.rowId,()=>r.cellId,()=>r.queries),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Vr(t,r){e.push(r,!0);const n=Ne(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{Br(t,{get queryId(){return r.queryId},get rowId(){return r.rowId},get cellId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:s,$$slots:{default:!0}})}e.pop()}function Sr(t,r){e.push(r,!0);const n=Je(()=>r.queryId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function zr(t,r){e.push(r,!0);const n=Ge(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Fr(t,r){e.push(r,!0);const n=he(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Pr(t,r){e.push(r,!0);const n=be(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function jr(t,r){e.push(r,!0);const n=ie(()=>r.store);{const s=(t,n=e.noop)=>{Pr(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s,$$slots:{default:!0}})}e.pop()}function Ar(t,r){e.push(r,!0);const n=Re(()=>r.valueId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.valueId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Dr(t,r){e.push(r,!0);const n=ke(()=>r.store);{const s=(t,n=e.noop)=>{Ar(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s,$$slots:{default:!0}})}e.pop()}export{mr as BackwardCheckpointsView,vr as CellView,Ir as CheckpointView,xr as CurrentCheckpointView,_r as ForwardCheckpointsView,$r as IndexView,kr as LinkedRowsView,qr as LocalRowsView,Rr as MetricView,Cr as Provider,Lr as RemoteRowView,Br as ResultCellView,Vr as ResultRowView,Sr as ResultSortedTableView,zr as ResultTableView,wr as RowView,yr as SliceView,Fr as SortedTableView,Pr as TableView,jr as TablesView,Ar as ValueView,Dr as ValuesView,ct as createGoBackwardCallback,gt as createGoForwardCallback,we as getCell,xe as getCellIds,ot as getCheckpoint,ut as getCheckpointIds,st as getCheckpoints,dt as getCheckpointsIds,Pe as getIndexIds,De as getIndexStoreTableId,ze as getIndexes,Fe as getIndexesIds,rt as getLinkedRowIds,tt as getLocalRowIds,Se as getMetric,Ve as getMetricIds,Le as getMetrics,Be as getMetricsIds,it as getPersister,at as getPersisterIds,pt as getPersisterStatus,He as getQueries,Me as getQueriesIds,Oe as getQueryIds,Ze as getRelationshipIds,Xe as getRelationships,Ye as getRelationshipsIds,nt as getRelationshipsStoreTableIds,et as getRemoteRowId,Ue as getResultCell,Ne as getResultCellIds,Ke as getResultRow,Ee as getResultRowCount,Ge as getResultRowIds,Je as getResultSortedRowIds,Qe as getResultTable,We as getResultTableCellIds,ve as getRow,fe as getRowCount,be as getRowIds,je as getSliceIds,Ae as getSliceRowIds,he as getSortedRowIds,Ce as getStore,Te as getStoreIds,lt as getSynchronizer,It as getSynchronizerIds,ft as getSynchronizerStatus,pe as getTable,le as getTableCellIds,ie as getTableIds,ge as getTables,Re as getValue,ke as getValueIds,$e as getValues,_e as hasCell,me as hasRow,ae as hasTable,Ie as hasTableCell,ce as hasTables,qe as hasValue,ye as hasValues,Lt as onCell,Ct as onCellIds,rr as onCheckpoint,tr as onCheckpointIds,At as onDidFinishTransaction,Tt as onHasCell,qt as onHasRow,vt as onHasTable,wt as onHasTableCell,bt as onHasTables,zt as onHasValue,Bt as onHasValues,Wt as onLinkedRowIds,Qt as onLocalRowIds,Dt as onMetric,er as onParamValue,Zt as onParamValues,nr as onPersisterStatus,Ot as onRemoteRowId,Yt as onResultCell,Xt as onResultCellIds,Ut as onResultRow,Jt as onResultRowCount,Kt as onResultRowIds,Nt as onResultSortedRowIds,Et as onResultTable,Gt as onResultTableCellIds,Rt as onRow,yt as onRowCount,$t as onRowIds,Ht as onSliceIds,Mt as onSliceRowIds,kt as onSortedRowIds,Pt as onStartTransaction,sr as onSynchronizerStatus,xt as onTable,_t as onTableCellIds,mt as onTableIds,ht as onTables,Ft as onValue,St as onValueIds,Vt as onValues,jt as onWillFinishTransaction,ar as provideCheckpoints,cr as provideIndexes,or as provideMetrics,pr as providePersister,ir as provideQueries,gr as provideRelationships,ur as provideStore,lr as provideSynchronizer,ne as resolveCheckpoints,ee as resolveIndexes,Z as resolveMetrics,se as resolvePersister,re as resolveQueries,te as resolveRelationships,Y as resolveStore,de as resolveSynchronizer};
1
+ import"svelte/internal/disclose-version";import*as e from"svelte/internal/client";import{getContext as t,setContext as r,untrack as n}from"svelte";import{createSubscriber as s}from"svelte/reactivity";const d=e=>typeof e,u=d(""),o=d(d),c="Listener",g="Result",i="Has",a="Ids",p="Table",l=p+"s",I=p+a,f="Row",b=f+"Count",h=f+a,m="Sorted"+f+a,v="Cell",x=v+a,_="Value",w=_+"s",y=_+a,$="Transaction",k="Finish",q="Status",R="Metric",C="Slice",T="RemoteRowId",L="Local",B="Linked",V="Checkpoint",S=globalThis,z=e=>void 0===e,F=()=>!z(S.window),P=(j=z,(e,t,r)=>j(e)?r?.():t(e));var j;const A=()=>{},D=Object.keys,H="tinybase_uisc";class M{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get current(){return this.#t(),this.#e()}}class O extends M{#r;constructor(e,t,r){super(e,r),this.#r=t}get current(){return super.current}set current(e){this.#r(e)}}const Q=[],W={},E=[Q,void 0,Q],G=e=>(e=>d(e)==o)(e)?e():e,J=()=>t(H)??[],K=(e,t,r)=>{return z(t)?e[2*r]:d(t)==u?(n=e[2*r+1],s=t,P(n,e=>e[s])):t;var n,s},N=(e,t)=>K(J(),e,t),U=(e,t)=>{const r=J();return()=>K(r,G(e),t)},X=(e,t)=>D(e[2*t+1]??W),Y=e=>U(e,0),Z=e=>U(e,1),ee=e=>U(e,2),te=e=>U(e,3),re=e=>U(e,4),ne=e=>U(e,5),se=e=>U(e,6),de=e=>U(e,7),ue=(t,r,n,d=()=>Q,u)=>{const o=(u?"has":"get")+r,g="add"+(u?i:"")+r+c;let a=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=t(),n=d();e.set(a,s(e=>{const t=r?.[g]?.(...n,e);return()=>r?.delListener?.(t)}),!0)}),new M(()=>t()?.[o]?.(...d())??n,()=>e.get(a)())},oe=(t,r,n,s=()=>Q,d)=>{F()&&e.user_effect(()=>{const e=t(),u=s(),o=e?.["add"+r+c]?.(...u,n,...void 0!==d?[d]:Q);return()=>e?.delListener?.(o)})},ce=e=>ue(Y(e),l,!1,()=>Q,1),ge=e=>ue(Y(e),l,W),ie=e=>ue(Y(e),I,Q),ae=(e,t)=>ue(Y(t),p,!1,()=>[G(e)],1),pe=(e,t)=>ue(Y(t),p,W,()=>[G(e)]),le=(e,t)=>ue(Y(t),p+x,Q,()=>[G(e)]),Ie=(e,t,r)=>ue(Y(r),p+v,!1,()=>[G(e),G(t)],1),fe=(e,t)=>ue(Y(t),b,0,()=>[G(e)]),be=(e,t)=>ue(Y(t),h,Q,()=>[G(e)]),he=(e,t,r=!1,n=0,s,d)=>ue(Y(d),m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),me=(e,t,r)=>ue(Y(r),f,!1,()=>[G(e),G(t)],1),ve=(e,t,r)=>ue(Y(r),f,W,()=>[G(e),G(t)]),xe=(e,t,r)=>ue(Y(r),x,Q,()=>[G(e),G(t)]),_e=(e,t,r,n)=>ue(Y(n),v,!1,()=>[G(e),G(t),G(r)],1),we=(t,r,n,d)=>{const u=Y(d);let o=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const d=u(),c=G(t),g=G(r),i=G(n);e.set(o,s(e=>{const t=d?.addCellListener(c,g,i,e);return()=>d?.delListener?.(t)}),!0)}),new O(()=>u()?.getCell(G(t),G(r),G(n)),e=>u()?.setCell(G(t),G(r),G(n),e),()=>e.get(o)())},ye=e=>ue(Y(e),w,!1,()=>Q,1),$e=e=>ue(Y(e),w,W),ke=e=>ue(Y(e),y,Q),qe=(e,t)=>ue(Y(t),_,!1,()=>[G(e)],1),Re=(t,r)=>{const n=Y(r);let d=e.state(e.proxy(A));return F()&&e.user_effect(()=>{const r=n(),u=G(t);e.set(d,s(e=>{const t=r?.addValueListener(u,e);return()=>r?.delListener?.(t)}),!0)}),new O(()=>n()?.getValue(G(t)),e=>n()?.setValue(G(t),e),()=>e.get(d)())},Ce=e=>N(e,0),Te=()=>{const t=J();let r=e.state(e.proxy(X(t,0)));return F()&&e.user_effect(()=>{e.set(r,X(t,0),!0)}),{get current(){return e.get(r)}}},Le=e=>N(e,1),Be=()=>{const t=J();let r=e.state(e.proxy(X(t,1)));return F()&&e.user_effect(()=>{e.set(r,X(t,1),!0)}),{get current(){return e.get(r)}}},Ve=e=>ue(Z(e),R+a,Q),Se=(e,t)=>ue(Z(t),R,void 0,()=>[G(e)]),ze=e=>N(e,2),Fe=()=>{const t=J();let r=e.state(e.proxy(X(t,2)));return F()&&e.user_effect(()=>{e.set(r,X(t,2),!0)}),{get current(){return e.get(r)}}},Pe=e=>ue(ee(e),"Index"+a,Q),je=(e,t)=>ue(ee(t),C+a,Q,()=>[G(e)]),Ae=(e,t,r)=>ue(ee(r),C+h,Q,()=>[G(e),G(t)]),De=(e,t)=>{const r=ee(e);return{get store(){return r()?.getStore()},get tableId(){return r()?.getTableId(G(t))}}},He=e=>N(e,4),Me=()=>{const t=J();let r=e.state(e.proxy(X(t,4)));return F()&&e.user_effect(()=>{e.set(r,X(t,4),!0)}),{get current(){return e.get(r)}}},Oe=e=>ue(re(e),"Query"+a,Q),Qe=(e,t)=>ue(re(t),g+p,W,()=>[G(e)]),We=(e,t)=>ue(re(t),g+p+x,Q,()=>[G(e)]),Ee=(e,t)=>ue(re(t),g+b,0,()=>[G(e)]),Ge=(e,t)=>ue(re(t),g+h,Q,()=>[G(e)]),Je=(e,t,r=!1,n=0,s,d)=>ue(re(d),g+m,Q,()=>[G(e),G(t),G(r),G(n),G(s)]),Ke=(e,t,r)=>ue(re(r),g+f,W,()=>[G(e),G(t)]),Ne=(e,t,r)=>ue(re(r),g+x,Q,()=>[G(e),G(t)]),Ue=(e,t,r,n)=>ue(re(n),g+v,void 0,()=>[G(e),G(t),G(r)]),Xe=e=>N(e,3),Ye=()=>{const t=J();let r=e.state(e.proxy(X(t,3)));return F()&&e.user_effect(()=>{e.set(r,X(t,3),!0)}),{get current(){return e.get(r)}}},Ze=e=>ue(te(e),"Relationship"+a,Q),et=(e,t,r)=>ue(te(r),T,void 0,()=>[G(e),G(t)]),tt=(e,t,r)=>ue(te(r),L+h,Q,()=>[G(e),G(t)]),rt=(e,t,r)=>ue(te(r),B+h,Q,()=>[G(e),G(t)]),nt=(e,t)=>{const r=te(e);return{get store(){return r()?.getStore()},get localTableId(){return r()?.getLocalTableId(G(t))},get remoteTableId(){return r()?.getRemoteTableId(G(t))}}},st=e=>N(e,5),dt=()=>{const t=J();let r=e.state(e.proxy(X(t,5)));return F()&&e.user_effect(()=>{e.set(r,X(t,5),!0)}),{get current(){return e.get(r)}}},ut=e=>ue(ne(e),V+a,E),ot=(e,t)=>ue(ne(t),V,void 0,()=>[G(e)]),ct=e=>{const t=ne(e);return()=>t()?.goBackward()},gt=e=>{const t=ne(e);return()=>t()?.goForward()},it=e=>N(e,6),at=()=>{const t=J();let r=e.state(e.proxy(X(t,6)));return F()&&e.user_effect(()=>{e.set(r,X(t,6),!0)}),{get current(){return e.get(r)}}},pt=e=>ue(se(e),q,0),lt=e=>N(e,7),It=()=>{const t=J();let r=e.state(e.proxy(X(t,7)));return F()&&e.user_effect(()=>{e.set(r,X(t,7),!0)}),{get current(){return e.get(r)}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),Ot=(e,t,r,n)=>oe(te(n),T,r,()=>[G(e),G(t)]),Qt=(e,t,r,n)=>oe(te(n),L+h,r,()=>[G(e),G(t)]),Wt=(e,t,r,n)=>oe(te(n),B+h,r,()=>[G(e),G(t)]),Et=(e,t,r)=>oe(re(r),g+p,t,()=>[G(e)]),Gt=(e,t,r)=>oe(re(r),g+p+x,t,()=>[G(e)]),Jt=(e,t,r)=>oe(re(r),g+b,t,()=>[G(e)]),Kt=(e,t,r)=>oe(re(r),g+h,t,()=>[G(e)]),Nt=(e,t,r,n,s,d,u)=>oe(re(u),g+m,d,()=>[G(e),G(t),G(r),G(n),G(s)]),Ut=(e,t,r,n)=>oe(re(n),g+f,r,()=>[G(e),G(t)]),Xt=(e,t,r,n)=>oe(re(n),g+x,r,()=>[G(e),G(t)]),Yt=(e,t,r,n,s)=>oe(re(s),g+v,n,()=>[G(e),G(t),G(r)]),Zt=(e,t,r)=>oe(re(r),"ParamValues",t,()=>[G(e)]),er=(e,t,r,n)=>oe(re(n),"ParamValue",r,()=>[G(e),G(t)]),tr=(e,t)=>oe(ne(t),V+a,e),rr=(e,t,r)=>oe(ne(r),V,t,()=>[G(e)]),nr=(e,t)=>oe(se(t),q,e),sr=(e,t)=>oe(de(t),q,e),dr=(t,r,n)=>{const s=J();F()&&e.user_effect(()=>(s[16]?.(n,t,r),()=>s[17]?.(n,t)))},ur=(e,t)=>dr(e,t,0),or=(e,t)=>dr(e,t,1),cr=(e,t)=>dr(e,t,2),gr=(e,t)=>dr(e,t,3),ir=(e,t)=>dr(e,t,4),ar=(e,t)=>dr(e,t,5),pr=(e,t)=>dr(e,t,6),lr=(e,t)=>dr(e,t,7);function Ir(t,r){e.push(r,!0);const n=ot(()=>r.checkpointId,()=>r.checkpoints),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.checkpointId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}var fr=e.from_html("<!><!>",1),br=e.from_html("<!><!><!>",1);function hr(t,r){e.push(r,!0);var n=br(),s=e.first_child(n),d=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.id??"")+":{")),e.append(t,n)},u=e.derived(()=>r.debugIds&&!z(r.id));e.if(s,t=>{e.get(u)&&t(d)});var o=e.sibling(s);e.each(o,18,()=>r.ids,e=>e,(t,n,s)=>{var d=fr(),u=e.first_child(d),o=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.separator),e.append(t,n)};e.if(u,t=>{e.get(s)>0&&r.separator&&t(o)});var c=e.sibling(u),g=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.custom,()=>n),e.append(t,s)},i=t=>{var s=e.comment(),d=e.first_child(s);e.snippet(d,()=>r.children,()=>n),e.append(t,s)};e.if(c,e=>{r.custom?e(g):e(i,-1)}),e.append(t,d)});var c=e.sibling(o),g=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)},i=e.derived(()=>r.debugIds&&!z(r.id));e.if(c,t=>{e.get(i)&&t(g)}),e.append(t,n),e.pop()}function mr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[0]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function vr(t,r){e.push(r,!0);const n=we(()=>r.tableId,()=>r.rowId,()=>r.cellId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function xr(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[1]);var d=e.comment(),u=e.first_child(d),o=t=>{var n=e.comment(),d=e.first_child(n),u=t=>{var n=e.comment(),d=e.first_child(n);e.snippet(d,()=>r.checkpoint,()=>e.get(s)),e.append(t,n)},o=t=>{Ir(t,{get checkpointId(){return e.get(s)},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};e.if(d,e=>{r.checkpoint?e(u):e(o,-1)}),e.append(t,n)},c=e.derived(()=>!(null==e.get(s)));e.if(u,t=>{e.get(c)&&t(o)}),e.append(t,d),e.pop()}function _r(t,r){e.push(r,!0);const n=ut(()=>r.checkpoints),s=e.derived(()=>n.current[2]);{const n=(t,n=e.noop)=>{Ir(t,{get checkpointId(){return n()},get checkpoints(){return r.checkpoints},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.checkpoint},children:n,$$slots:{default:!0}})}e.pop()}function wr(t,r){e.push(r,!0);const n=xe(()=>r.tableId,()=>r.rowId,()=>r.store),s=e.derived(()=>r.customCellIds??n.current);{const n=(t,n=e.noop)=>{vr(t,{get tableId(){return r.tableId},get rowId(){return r.rowId},get cellId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return e.get(s)},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:n,$$slots:{default:!0}})}e.pop()}function yr(t,r){e.push(r,!0);const{store:n,tableId:s}=De(()=>r.indexes,()=>r.indexId),d=Ae(()=>r.indexId,()=>r.sliceId,()=>r.indexes);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})},g=e.derived(()=>!z(s));e.if(o,t=>{e.get(g)&&t(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.sliceId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function $r(t,r){e.push(r,!0);const n=je(()=>r.indexId,()=>r.indexes);{const s=(t,n=e.noop)=>{yr(t,{get indexId(){return r.indexId},get sliceId(){return n()},get indexes(){return r.indexes},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.indexId},get custom(){return r.slice},children:s,$$slots:{default:!0}})}e.pop()}function kr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=rt(()=>r.relationshipId,()=>r.firstRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})},g=e.derived(()=>!z(s));e.if(o,t=>{e.get(g)&&t(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.firstRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function qr(t,r){e.push(r,!0);const{store:n,localTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=tt(()=>r.relationshipId,()=>r.remoteRowId,()=>r.relationships);{const u=(t,d=e.noop)=>{var u=e.comment(),o=e.first_child(u),c=e=>{wr(e,{get tableId(){return s},get rowId(){return d()},get store(){return n},get debugIds(){return r.debugIds}})},g=e.derived(()=>!z(s));e.if(o,t=>{e.get(g)&&t(c)}),e.append(t,u)};hr(t,{get ids(){return d.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.remoteRowId},get custom(){return r.row},children:u,$$slots:{default:!0}})}e.pop()}function Rr(t,r){e.push(r,!0);const n=Se(()=>r.metricId,()=>r.metrics),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.metricId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Cr(s,d){e.push(d,!0);const u=t(H)??[];let o=e.proxy(Array.from({length:8},()=>({})));const c=(e,t,r)=>{o[e]={...n(()=>o[e]),[t]:r}},g=(e,t)=>{const{[t]:r,...s}=n(()=>o[e]);o[e]=s};r(H,{get 0(){return d.store??u[0]},get 1(){return{...u[1]??{},...d.storesById,...o[0]}},get 2(){return d.metrics??u[2]},get 3(){return{...u[3]??{},...d.metricsById,...o[1]}},get 4(){return d.indexes??u[4]},get 5(){return{...u[5]??{},...d.indexesById,...o[2]}},get 6(){return d.relationships??u[6]},get 7(){return{...u[7]??{},...d.relationshipsById,...o[3]}},get 8(){return d.queries??u[8]},get 9(){return{...u[9]??{},...d.queriesById,...o[4]}},get 10(){return d.checkpoints??u[10]},get 11(){return{...u[11]??{},...d.checkpointsById,...o[5]}},get 12(){return d.persister??u[12]},get 13(){return{...u[13]??{},...d.persistersById,...o[6]}},get 14(){return d.synchronizer??u[14]},get 15(){return{...u[15]??{},...d.synchronizersById,...o[7]}},get 16(){return c},get 17(){return g}});var i=e.comment(),a=e.first_child(i);e.snippet(a,()=>d.children),e.append(s,i),e.pop()}var Tr=e.from_html("<!><!><!>",1);function Lr(t,r){e.push(r,!0);const{store:n,remoteTableId:s}=nt(()=>r.relationships,()=>r.relationshipId),d=et(()=>r.relationshipId,()=>r.localRowId,()=>r.relationships);var u=Tr(),o=e.first_child(u),c=t=>{var n=e.text();e.template_effect(()=>e.set_text(n,(r.localRowId??"")+":{")),e.append(t,n)};e.if(o,e=>{r.debugIds&&e(c)});var g=e.sibling(o),i=t=>{var u=e.comment(),o=e.first_child(u),c=t=>{var n=e.comment(),s=e.first_child(n);e.snippet(s,()=>r.row,()=>d.current),e.append(t,n)},g=e=>{wr(e,{get tableId(){return s},get rowId(){return d.current},get store(){return n},get debugIds(){return r.debugIds}})};e.if(o,e=>{r.row?e(c):s&&e(g,1)}),e.append(t,u)},a=e.derived(()=>!z(d.current));e.if(g,t=>{e.get(a)&&t(i)});var p=e.sibling(g),l=t=>{var r=e.text();r.nodeValue="}",e.append(t,r)};e.if(p,e=>{r.debugIds&&e(l)}),e.append(t,u),e.pop()}function Br(t,r){e.push(r,!0);const n=Ue(()=>r.queryId,()=>r.rowId,()=>r.cellId,()=>r.queries),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.cellId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Vr(t,r){e.push(r,!0);const n=Ne(()=>r.queryId,()=>r.rowId,()=>r.queries);{const s=(t,n=e.noop)=>{Br(t,{get queryId(){return r.queryId},get rowId(){return r.rowId},get cellId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.rowId},get custom(){return r.cell},children:s,$$slots:{default:!0}})}e.pop()}function Sr(t,r){e.push(r,!0);const n=Je(()=>r.queryId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function zr(t,r){e.push(r,!0);const n=Ge(()=>r.queryId,()=>r.queries);{const s=(t,n=e.noop)=>{Vr(t,{get queryId(){return r.queryId},get rowId(){return n()},get queries(){return r.queries},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.queryId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Fr(t,r){e.push(r,!0);const n=he(()=>r.tableId,()=>r.cellId,()=>r.descending??!1,()=>r.offset??0,()=>r.limit,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function Pr(t,r){e.push(r,!0);const n=be(()=>r.tableId,()=>r.store);{const s=(t,n=e.noop)=>{wr(t,{get tableId(){return r.tableId},get rowId(){return n()},get store(){return r.store},get customCellIds(){return r.customCellIds},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get id(){return r.tableId},get custom(){return r.row},children:s,$$slots:{default:!0}})}e.pop()}function jr(t,r){e.push(r,!0);const n=ie(()=>r.store);{const s=(t,n=e.noop)=>{Pr(t,{get tableId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.table},children:s,$$slots:{default:!0}})}e.pop()}function Ar(t,r){e.push(r,!0);const n=Re(()=>r.valueId,()=>r.store),s=e.derived(()=>""+(n.current??"")),d=e.derived(()=>r.debugIds?`${r.valueId}:{${e.get(s)}}`:e.get(s));e.next();var u=e.text();e.template_effect(()=>e.set_text(u,e.get(d))),e.append(t,u),e.pop()}function Dr(t,r){e.push(r,!0);const n=ke(()=>r.store);{const s=(t,n=e.noop)=>{Ar(t,{get valueId(){return n()},get store(){return r.store},get debugIds(){return r.debugIds}})};hr(t,{get ids(){return n.current},get separator(){return r.separator},get debugIds(){return r.debugIds},get custom(){return r.value},children:s,$$slots:{default:!0}})}e.pop()}export{mr as BackwardCheckpointsView,vr as CellView,Ir as CheckpointView,xr as CurrentCheckpointView,_r as ForwardCheckpointsView,$r as IndexView,kr as LinkedRowsView,qr as LocalRowsView,Rr as MetricView,Cr as Provider,Lr as RemoteRowView,Br as ResultCellView,Vr as ResultRowView,Sr as ResultSortedTableView,zr as ResultTableView,wr as RowView,yr as SliceView,Fr as SortedTableView,Pr as TableView,jr as TablesView,Ar as ValueView,Dr as ValuesView,ct as createGoBackwardCallback,gt as createGoForwardCallback,we as getCell,xe as getCellIds,ot as getCheckpoint,ut as getCheckpointIds,st as getCheckpoints,dt as getCheckpointsIds,Pe as getIndexIds,De as getIndexStoreTableId,ze as getIndexes,Fe as getIndexesIds,rt as getLinkedRowIds,tt as getLocalRowIds,Se as getMetric,Ve as getMetricIds,Le as getMetrics,Be as getMetricsIds,it as getPersister,at as getPersisterIds,pt as getPersisterStatus,He as getQueries,Me as getQueriesIds,Oe as getQueryIds,Ze as getRelationshipIds,Xe as getRelationships,Ye as getRelationshipsIds,nt as getRelationshipsStoreTableIds,et as getRemoteRowId,Ue as getResultCell,Ne as getResultCellIds,Ke as getResultRow,Ee as getResultRowCount,Ge as getResultRowIds,Je as getResultSortedRowIds,Qe as getResultTable,We as getResultTableCellIds,ve as getRow,fe as getRowCount,be as getRowIds,je as getSliceIds,Ae as getSliceRowIds,he as getSortedRowIds,Ce as getStore,Te as getStoreIds,lt as getSynchronizer,It as getSynchronizerIds,ft as getSynchronizerStatus,pe as getTable,le as getTableCellIds,ie as getTableIds,ge as getTables,Re as getValue,ke as getValueIds,$e as getValues,_e as hasCell,me as hasRow,ae as hasTable,Ie as hasTableCell,ce as hasTables,qe as hasValue,ye as hasValues,Lt as onCell,Ct as onCellIds,rr as onCheckpoint,tr as onCheckpointIds,At as onDidFinishTransaction,Tt as onHasCell,qt as onHasRow,vt as onHasTable,wt as onHasTableCell,bt as onHasTables,zt as onHasValue,Bt as onHasValues,Wt as onLinkedRowIds,Qt as onLocalRowIds,Dt as onMetric,er as onParamValue,Zt as onParamValues,nr as onPersisterStatus,Ot as onRemoteRowId,Yt as onResultCell,Xt as onResultCellIds,Ut as onResultRow,Jt as onResultRowCount,Kt as onResultRowIds,Nt as onResultSortedRowIds,Et as onResultTable,Gt as onResultTableCellIds,Rt as onRow,yt as onRowCount,$t as onRowIds,Ht as onSliceIds,Mt as onSliceRowIds,kt as onSortedRowIds,Pt as onStartTransaction,sr as onSynchronizerStatus,xt as onTable,_t as onTableCellIds,mt as onTableIds,ht as onTables,Ft as onValue,St as onValueIds,Vt as onValues,jt as onWillFinishTransaction,ar as provideCheckpoints,cr as provideIndexes,or as provideMetrics,pr as providePersister,ir as provideQueries,gr as provideRelationships,ur as provideStore,lr as provideSynchronizer,ne as resolveCheckpoints,ee as resolveIndexes,Z as resolveMetrics,se as resolvePersister,re as resolveQueries,te as resolveRelationships,Y as resolveStore,de as resolveSynchronizer};