tinybase 4.3.0-beta.1 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var e,t;e=this,t=function(e,t,l){"use strict";const a=e=>typeof e,n=a(""),o=a(!0),r=a(0),s="Value",i="currentTarget",d="value",u=isFinite,m=e=>null==e,{PureComponent:c,Fragment:h,createElement:b,useCallback:g,useLayoutEffect:p,useRef:w,useState:f}=t,I=(e,...t)=>m(e)?{}:e(...t),C=(e,t)=>e.map(t),y=Object,k=(e=[])=>y.fromEntries(e),v=(e,t)=>C(y.entries(e),(([e,l])=>t(l,e))),x="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",R='content:url("',T=R+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",S='</svg>")',N=R+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",V=C([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,a])=>T+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${a}' fill='white'/>`+S)),z=T+"<path d='M20 20l60 60M20 80l60-60' />"+S,M=T+`<path d='${x}' />`+S,$=T+`<path d='${x}M20 20l60 60' />`+S,q="*::-webkit-scrollbar";((e,t="")=>{e.join(t)})(v({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[q]:"width:0.5rem;height:0.5rem;",[q+"-track"]:"background:#111",[q+"-thumb"]:"background:#999;border:1px solid #111",[q+"-thumb:hover"]:"background:#fff",[q+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+N,...k(C(["bottom:0;left:0","top:0;right:0"],((e,t)=>[`>img[data-position='${t}']`,e]))),main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;",...k(C(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,t)=>[`main[data-position='${t}']`,e]))),header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":N,"header>img:nth-of-type(6)":z,...k(C(V,((e,t)=>[`header>img[data-id='${t}']`,e]))),"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":M,"details[open]>summary img.done":$,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"},((e,t)=>e?`& ${t}{${e}}`:"")));const B=(e,t,l,a)=>e==n?t:e==r?l:a,{useCallback:H,useMemo:O,useState:F}=t,E="editable",P=(e,t)=>C(l.useTableCellIds(e,t),(t=>e+"."+t)),j=(e,t,l)=>{const a=H(e,t);return l?a:void 0},A=(...e)=>O((()=>e),e),L=(e,t)=>O((()=>({store:e,tableId:t})),[e,t]),U=(e,t)=>O((()=>({queries:e,queryId:t})),[e,t]),D=(e,t=!1,l,a=0,n,o,r,s)=>{const[[i,d,u],m]=F([e,t,a]),c=H((e=>{m(e),s?.(e)}),[s]),h=j((e=>c([e,e==i&&!d,u])),[c,i,d,u],l),g=H((e=>c([i,d,e])),[c,i,d]),p=!0===r?Z:r;return[[i,d,u],h,O((()=>!1===r?null:b(p,{offset:u,limit:n,total:o,onChange:g})),[r,p,u,n,o,g])]},G=(e,t,l)=>O((()=>{const o=t??e;return k(v(Array.isArray(o)?k(C(o,(e=>[e,e]))):o,((e,t)=>{return[t,{label:t,component:l,...(o=e,a(o)==n?{label:e}:e)}];var o})))}),[t,l,e]),J=({className:e,headerRow:t,idColumn:l,params:[a,n,o,r,s,i]})=>b("table",{className:e},i?b("caption",null,i):null,!1===t?null:b("thead",null,b("tr",null,!1===l?null:b(K,{sort:r??[],label:"Id",onClick:s}),v(a,(({label:e},t)=>b(K,{key:t,cellId:t,label:e,sort:r??[],onClick:s}))))),b("tbody",null,C(o,(e=>b("tr",{key:e},!1===l?null:b("th",null,e),v(a,(({component:t,getComponentProps:l},a)=>b("td",{key:a},b(t,{...I(l,e,a),...n,rowId:e,cellId:a}))))))))),K=({cellId:e,sort:[t,l],label:a=e??"",onClick:n})=>b("th",{onClick:j((()=>n?.(e)),[n,e],n),className:m(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},m(l)||t!=e?null:(l?"↓":"↑")+" ",a),Q=({localRowId:e,params:[a,n,o,r,s,i,d]})=>{const u=l.useRemoteRowId(s,e,i);return b("tr",null,!1===a?null:b(t.Fragment,null,b("th",null,e),b("th",null,u)),v(n,(({component:t,getComponentProps:l},a)=>{const[n,s]=a.split(".",2),i=n===o?e:n===r?u:null;return m(i)?null:b("td",{key:a},b(t,{...I(l,i,s),store:d,tableId:n,rowId:i,cellId:s}))})))},W=({thing:e,onThingChange:t,className:l,hasSchema:s})=>{const[m,c]=F(),[h,g]=F(),[p,w]=F(),[f,I]=F(),[C,y]=F();h!==e&&(c((e=>{const t=a(e);return(e=>e==n||e==o)(t)||t==r&&u(e)?t:void 0})(e)),g(e),w(e+""),I(Number(e)||0),y(!!e));const k=H(((e,l)=>{l(e),g(e),t(e)}),[t]);return b("div",{className:l},b("button",{className:m,onClick:H((()=>{if(!s?.()){const e=B(m,r,o,n),l=B(e,p,f,C);c(e),g(l),t(l)}}),[s,t,p,f,C,m])},m),B(m,b("input",{key:m,value:p,onChange:H((e=>k(e[i][d]+"",w)),[k])}),b("input",{key:m,type:"number",value:f,onChange:H((e=>k(Number(e[i][d]||0),I)),[k])}),b("input",{key:m,type:"checkbox",checked:C,onChange:H((e=>k(!!e[i].checked,y)),[k])})))},X=({tableId:e,rowId:t,cellId:a,store:n,className:o})=>b(W,{thing:l.useCell(e,t,a,n),onThingChange:l.useSetCellCallback(e,t,a,(e=>e),[],n),className:o??E+"Cell",hasSchema:l.useStoreOrStoreById(n)?.hasTablesSchema}),Y=({valueId:e,store:t,className:a})=>b(W,{thing:l.useValue(e,t),onThingChange:l.useSetValueCallback(e,(e=>e),[],t),className:a??E+s,hasSchema:l.useStoreOrStoreById(t)?.hasValuesSchema}),Z=({onChange:e,total:l,offset:a=0,limit:n=l,singular:o="row",plural:r=o+"s"})=>{(a>l||a<0)&&(a=0,e(0));const s=j((()=>e(a-n)),[e,a,n],a>0),i=j((()=>e(a+n)),[e,a,n],a+n<l);return b(t.Fragment,null,l>n&&b(t.Fragment,null,b("button",{className:"previous",disabled:0==a,onClick:s},"←"),b("button",{className:"next",disabled:a+n>=l,onClick:i},"→"),a+1," to ",Math.min(l,a+n)," of "),l," ",1!=l?r:o)},_=e=>new Map(e);_(),_(),e.EditableCellView=X,e.EditableValueView=Y,e.RelationshipInHtmlTable=({relationshipId:e,relationships:a,editable:n,customCells:o,className:r,headerRow:s,idColumn:i=!0})=>{const[d,u,m,c]=((e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)])(l.useRelationshipsOrRelationshipsById(a),e),h=G([...P(m,u),...P(c,u)],o,n?X:l.CellView),g=A(i,h,m,c,e,d,u);return b("table",{className:r},!1===s?null:b("thead",null,b("tr",null,!1===i?null:b(t.Fragment,null,b("th",null,m,".Id"),b("th",null,c,".Id")),v(h,(({label:e},t)=>b("th",{key:t},e))))),b("tbody",null,C(l.useRowIds(m,u),(e=>b(Q,{key:e,localRowId:e,params:g})))))},e.ResultSortedTableInHtmlTable=({queryId:e,cellId:t,descending:a,offset:n,limit:o,queries:r,sortOnClick:s,paginator:i=!1,customCells:d,onChange:u,...m})=>{const[c,h,g]=D(t,a,s,n,o,l.useResultRowCount(e,r),i,u);return b(J,{...m,params:A(G(l.useResultTableCellIds(e,r),d,l.ResultCellView),U(r,e),l.useResultSortedRowIds(e,...c,o,r),c,h,g)})},e.ResultTableInHtmlTable=({queryId:e,queries:t,customCells:a,...n})=>b(J,{...n,params:A(G(l.useResultTableCellIds(e,t),a,l.ResultCellView),U(t,e),l.useResultRowIds(e,t))}),e.SliceInHtmlTable=({indexId:e,sliceId:t,indexes:a,editable:n,customCells:o,...r})=>{const[s,i,d]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(l.useIndexesOrIndexesById(a),e);return b(J,{...r,params:A(G(l.useTableCellIds(d,i),o,n?X:l.CellView),L(i,d),l.useSliceRowIds(e,t,s))})},e.SortedTableInHtmlTable=({tableId:e,cellId:t,descending:a,offset:n,limit:o,store:r,editable:s,sortOnClick:i,paginator:d=!1,onChange:u,customCells:m,...c})=>{const[h,g,p]=D(t,a,i,n,o,l.useRowCount(e,r),d,u);return b(J,{...c,params:A(G(l.useTableCellIds(e,r),m,s?X:l.CellView),L(r,e),l.useSortedRowIds(e,...h,o,r),h,g,p)})},e.SortedTablePaginator=Z,e.StoreInspector=e=>null,e.TableInHtmlTable=({tableId:e,store:t,editable:a,customCells:n,...o})=>b(J,{...o,params:A(G(l.useTableCellIds(e,t),n,a?X:l.CellView),L(t,e),l.useRowIds(e,t))}),e.ValuesInHtmlTable=({store:e,editable:t=!1,valueComponent:a=(t?Y:l.ValueView),getValueComponentProps:n,className:o,headerRow:r,idColumn:i})=>b("table",{className:o},!1===r?null:b("thead",null,b("tr",null,!1===i?null:b("th",null,"Id"),b("th",null,s))),b("tbody",null,C(l.useValueIds(e),(t=>b("tr",{key:t},!1===i?null:b("th",null,t),b("td",null,b(a,{...I(n,t),valueId:t,store:e})))))))},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDom={},e.React,e.TinyBaseUiReact);
1
+ var e,t;e=this,t=function(e,t,l){"use strict";const a=e=>typeof e,n=a(""),o=a(!0),r=a(0),s="Value",i="currentTarget",d="value",u=isFinite,m=e=>null==e,{PureComponent:c,Fragment:h,createElement:b,useCallback:g,useLayoutEffect:p,useRef:w,useState:f}=t,I=(e,...t)=>m(e)?{}:e(...t),C=(e,t)=>e.map(t),y=Object,k=(e=[])=>y.fromEntries(e),v=(e,t)=>C(y.entries(e),(([e,l])=>t(l,e))),x="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",R='content:url("',T=R+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",S='</svg>")',N=R+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",V=C([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,a])=>T+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${a}' fill='white'/>`+S)),z=T+"<path d='M20 20l60 60M20 80l60-60' />"+S,M=T+`<path d='${x}' />`+S,$=T+`<path d='${x}M20 20l60 60' />`+S,q="*::-webkit-scrollbar";((e,t="")=>{e.join(t)})(v({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[q]:"width:0.5rem;height:0.5rem;",[q+"-track"]:"background:#111",[q+"-thumb"]:"background:#999;border:1px solid #111",[q+"-thumb:hover"]:"background:#fff",[q+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+N,...k(C(["bottom:0;left:0","top:0;right:0"],((e,t)=>[`>img[data-position='${t}']`,e]))),main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;",...k(C(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,t)=>[`main[data-position='${t}']`,e]))),header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":N,"header>img:nth-of-type(6)":z,...k(C(V,((e,t)=>[`header>img[data-id='${t}']`,e]))),"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":M,"details[open]>summary img.done":$,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"},((e,t)=>e?`& ${t}{${e}}`:"")));const B=(e,t,l,a)=>e==n?t:e==r?l:a,{useCallback:F,useMemo:H,useState:O}=t,E="editable",P=(e,t)=>C(l.useTableCellIds(e,t),(t=>e+"."+t)),j=(e,t,l)=>{const a=F(e,t);return l?a:void 0},D=(...e)=>H((()=>e),e),A=(e,t)=>H((()=>({store:e,tableId:t})),[e,t]),L=(e,t)=>H((()=>({queries:e,queryId:t})),[e,t]),U=(e,t=!1,l,a=0,n,o,r,s)=>{const[[i,d,u],m]=O([e,t,a]),c=F((e=>{m(e),s?.(e)}),[s]),h=j((e=>c([e,e==i&&!d,u])),[c,i,d,u],l),g=F((e=>c([i,d,e])),[c,i,d]),p=!0===r?Z:r;return[[i,d,u],h,H((()=>!1===r?null:b(p,{offset:u,limit:n,total:o,onChange:g})),[r,p,u,n,o,g])]},G=(e,t,l)=>H((()=>{const o=t??e;return k(v(Array.isArray(o)?k(C(o,(e=>[e,e]))):o,((e,t)=>{return[t,{label:t,component:l,...(o=e,a(o)==n?{label:e}:e)}];var o})))}),[t,l,e]),J=({className:e,headerRow:t,idColumn:l,params:[a,n,o,r,s,i]})=>b("table",{className:e},i?b("caption",null,i):null,!1===t?null:b("thead",null,b("tr",null,!1===l?null:b(K,{sort:r??[],label:"Id",onClick:s}),v(a,(({label:e},t)=>b(K,{key:t,cellId:t,label:e,sort:r??[],onClick:s}))))),b("tbody",null,C(o,(e=>b("tr",{key:e},!1===l?null:b("th",null,e),v(a,(({component:t,getComponentProps:l},a)=>b("td",{key:a},b(t,{...I(l,e,a),...n,rowId:e,cellId:a}))))))))),K=({cellId:e,sort:[t,l],label:a=e??"",onClick:n})=>b("th",{onClick:j((()=>n?.(e)),[n,e],n),className:m(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},m(l)||t!=e?null:(l?"↓":"↑")+" ",a),Q=({localRowId:e,params:[a,n,o,r,s,i,d]})=>{const u=l.useRemoteRowId(s,e,i);return b("tr",null,!1===a?null:b(t.Fragment,null,b("th",null,e),b("th",null,u)),v(n,(({component:t,getComponentProps:l},a)=>{const[n,s]=a.split(".",2),i=n===o?e:n===r?u:null;return m(i)?null:b("td",{key:a},b(t,{...I(l,i,s),store:d,tableId:n,rowId:i,cellId:s}))})))},W=({thing:e,onThingChange:t,className:l,hasSchema:s})=>{const[m,c]=O(),[h,g]=O(),[p,w]=O(),[f,I]=O(),[C,y]=O();h!==e&&(c((e=>{const t=a(e);return(e=>e==n||e==o)(t)||t==r&&u(e)?t:void 0})(e)),g(e),w(e+""),I(Number(e)||0),y(!!e));const k=F(((e,l)=>{l(e),g(e),t(e)}),[t]);return b("div",{className:l},b("button",{className:m,onClick:F((()=>{if(!s?.()){const e=B(m,r,o,n),l=B(e,p,f,C);c(e),g(l),t(l)}}),[s,t,p,f,C,m])},m),B(m,b("input",{key:m,value:p,onChange:F((e=>k(e[i][d]+"",w)),[k])}),b("input",{key:m,type:"number",value:f,onChange:F((e=>k(Number(e[i][d]||0),I)),[k])}),b("input",{key:m,type:"checkbox",checked:C,onChange:F((e=>k(!!e[i].checked,y)),[k])})))},X=({tableId:e,rowId:t,cellId:a,store:n,className:o})=>b(W,{thing:l.useCell(e,t,a,n),onThingChange:l.useSetCellCallback(e,t,a,(e=>e),[],n),className:o??E+"Cell",hasSchema:l.useStoreOrStoreById(n)?.hasTablesSchema}),Y=({valueId:e,store:t,className:a})=>b(W,{thing:l.useValue(e,t),onThingChange:l.useSetValueCallback(e,(e=>e),[],t),className:a??E+s,hasSchema:l.useStoreOrStoreById(t)?.hasValuesSchema}),Z=({onChange:e,total:l,offset:a=0,limit:n=l,singular:o="row",plural:r=o+"s"})=>{(a>l||a<0)&&(a=0,e(0));const s=j((()=>e(a-n)),[e,a,n],a>0),i=j((()=>e(a+n)),[e,a,n],a+n<l);return b(t.Fragment,null,l>n&&b(t.Fragment,null,b("button",{className:"previous",disabled:0==a,onClick:s},"←"),b("button",{className:"next",disabled:a+n>=l,onClick:i},"→"),a+1," to ",Math.min(l,a+n)," of "),l," ",1!=l?r:o)};class _ extends c{constructor(e){super(e),this.componentDidCatch=(e,t)=>console.error(e,t.componentStack),this.state={e:0}}static{this.getDerivedStateFromError=()=>({e:1})}render(){return this.state.e?b("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const ee=e=>new Map(e);ee(),ee(),e.EditableCellView=X,e.EditableValueView=Y,e.RelationshipInHtmlTable=({relationshipId:e,relationships:a,editable:n,customCells:o,className:r,headerRow:s,idColumn:i=!0})=>{const[d,u,m,c]=((e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)])(l.useRelationshipsOrRelationshipsById(a),e),h=G([...P(m,u),...P(c,u)],o,n?X:l.CellView),g=D(i,h,m,c,e,d,u);return b("table",{className:r},!1===s?null:b("thead",null,b("tr",null,!1===i?null:b(t.Fragment,null,b("th",null,m,".Id"),b("th",null,c,".Id")),v(h,(({label:e},t)=>b("th",{key:t},e))))),b("tbody",null,C(l.useRowIds(m,u),(e=>b(Q,{key:e,localRowId:e,params:g})))))},e.ResultSortedTableInHtmlTable=({queryId:e,cellId:t,descending:a,offset:n,limit:o,queries:r,sortOnClick:s,paginator:i=!1,customCells:d,onChange:u,...m})=>{const[c,h,g]=U(t,a,s,n,o,l.useResultRowCount(e,r),i,u);return b(J,{...m,params:D(G(l.useResultTableCellIds(e,r),d,l.ResultCellView),L(r,e),l.useResultSortedRowIds(e,...c,o,r),c,h,g)})},e.ResultTableInHtmlTable=({queryId:e,queries:t,customCells:a,...n})=>b(J,{...n,params:D(G(l.useResultTableCellIds(e,t),a,l.ResultCellView),L(t,e),l.useResultRowIds(e,t))}),e.SliceInHtmlTable=({indexId:e,sliceId:t,indexes:a,editable:n,customCells:o,...r})=>{const[s,i,d]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(l.useIndexesOrIndexesById(a),e);return b(J,{...r,params:D(G(l.useTableCellIds(d,i),o,n?X:l.CellView),A(i,d),l.useSliceRowIds(e,t,s))})},e.SortedTableInHtmlTable=({tableId:e,cellId:t,descending:a,offset:n,limit:o,store:r,editable:s,sortOnClick:i,paginator:d=!1,onChange:u,customCells:m,...c})=>{const[h,g,p]=U(t,a,i,n,o,l.useRowCount(e,r),d,u);return b(J,{...c,params:D(G(l.useTableCellIds(e,r),m,s?X:l.CellView),A(r,e),l.useSortedRowIds(e,...h,o,r),h,g,p)})},e.SortedTablePaginator=Z,e.StoreInspector=e=>null,e.TableInHtmlTable=({tableId:e,store:t,editable:a,customCells:n,...o})=>b(J,{...o,params:D(G(l.useTableCellIds(e,t),n,a?X:l.CellView),A(t,e),l.useRowIds(e,t))}),e.ValuesInHtmlTable=({store:e,editable:t=!1,valueComponent:a=(t?Y:l.ValueView),getValueComponentProps:n,className:o,headerRow:r,idColumn:i})=>b("table",{className:o},!1===r?null:b("thead",null,b("tr",null,!1===i?null:b("th",null,"Id"),b("th",null,s))),b("tbody",null,C(l.useValueIds(e),(t=>b("tr",{key:t},!1===i?null:b("th",null,t),b("td",null,b(a,{...I(n,t),valueId:t,store:e})))))))},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDom={},e.React,e.TinyBaseUiReact);
Binary file
@@ -1 +1 @@
1
- var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,s="",r=n(s),a=n(!0),o=n(0),i=n(n),u="type",d="default",c="Ids",h="Table",m=h+"s",b=h+c,p="Row",v=p+"Count",g=p+c,f="Cell",I=f+c,y="Value",w=y+"s",C=y+c,k="currentTarget",x="value",S=e=>s+e,T=Math.floor,V=isFinite,R=(e,l)=>e instanceof l,O=e=>null==e,q=(e,l,t)=>O(e)?null==t?void 0:t():l(e),P=e=>e==r||e==a,N=e=>n(e)==i,E=e=>Array.isArray(e),L=(e,l,t)=>e.slice(l,t),{PureComponent:M,Fragment:j,createElement:z,useCallback:$,useLayoutEffect:A,useRef:F,useState:J}=l,D=(e,...l)=>O(e)?{}:e(...l),B=(e,l)=>e.forEach(l),H=(e,l)=>e.map(l),Q=e=>e.length,W=e=>0==Q(e),U=(e,...l)=>e.push(...l),G=e=>e.shift(),K=Object,X=K.keys,Y=K.isFrozen,Z=K.freeze,_=e=>R(e,K)&&e.constructor==K,ee=(e=[])=>K.fromEntries(e),le=(e,l)=>!O(((e,l)=>q(e,(e=>e[l])))(e,l)),te=(e,l)=>(delete e[l],e),ne=(e,l)=>H(K.entries(e),(([e,t])=>l(t,e))),se=e=>_(e)&&0==(e=>Q(X(e)))(e),re=e=>JSON.stringify(e,((e,l)=>R(l,Map)?K.fromEntries([...l]):l)),ae=JSON.parse,oe="tinybaseStoreInspector",ie="TinyBase Store Inspector",ue=["left","top","bottom","right","full"],de="state",ce="sort",he="open",me="position",be=he,pe="editable",ve=(...e)=>re(e),ge=(e,l)=>H(e.sort(),l),fe=(e,l)=>[!!t.useCell(de,e,pe,l),$((t=>{l.setCell(de,e,pe,(e=>!e)),t.preventDefault()}),[l,e])],Ie="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",ye='content:url("',we=ye+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",Ce='</svg>")',ke=ye+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",xe=H([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,l,t,n])=>we+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${l}' width='${t}' height='${n}' fill='white'/>`+Ce)),Se=we+"<path d='M20 20l60 60M20 80l60-60' />"+Ce,Te=we+`<path d='${Ie}' />`+Ce,Ve=we+`<path d='${Ie}M20 20l60 60' />`+Ce;var Re=Object.defineProperty,Oe=Object.defineProperties,qe=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Le=(e,l,t)=>l in e?Re(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Me=(e,l)=>{for(var t in l||(l={}))Ne.call(l,t)&&Le(e,t,l[t]);if(Pe)for(var t of Pe(l))Ee.call(l,t)&&Le(e,t,l[t]);return e},je=(e,l)=>Oe(e,qe(l));const ze="*::-webkit-scrollbar",$e=`#${oe}{\n all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999;\n ${((e,l="")=>e.join(l))(ne(je(Me(je(Me(je(Me({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[ze]:"width:0.5rem;height:0.5rem;",[ze+"-track"]:"background:#111",[ze+"-thumb"]:"background:#999;border:1px solid #111",[ze+"-thumb:hover"]:"background:#fff",[ze+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+ke},ee(H(["bottom:0;left:0","top:0;right:0"],((e,l)=>[`>img[data-position='${l}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),ee(H(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,l)=>[`main[data-position='${l}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":ke,"header>img:nth-of-type(6)":Se}),ee(H(xe,((e,l)=>[`header>img[data-id='${l}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":Te,"details[open]>summary img.done":Ve,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,l)=>e?`& ${l}{${e}}`:"")))}`,Ae=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!0),[],e);return t.useValue(be,e)?null:z("img",{onClick:s,title:ie,"data-position":n})},Fe=({uniqueId:e,summary:l,editable:n,handleEditable:s,children:r,s:a})=>{const o=!!t.useCell(de,e,he,a),i=t.useSetCellCallback(de,e,he,(e=>e[k].open),[],a);return z("details",{open:o,onToggle:i},z("summary",null,l,s?z("img",{onClick:s,className:n?"done":"edit"}):null),r)},Je=e=>{const l=n(e);return P(l)||l==o&&V(e)?l:void 0},De=(e,l,t,n,s)=>O(s)?e.delCell(l,t,n,!0):e.setCell(l,t,n,s),Be=(e,l,t)=>O(t)?e.delValue(l):e.setValue(l,t),He=(e,l,t,n)=>e==r?l:e==o?t:n;var Qe=Object.defineProperty,We=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Ye=(e,l,t)=>l in e?Qe(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Ze=(e,l)=>{for(var t in l||(l={}))Ke.call(l,t)&&Ye(e,t,l[t]);if(Ge)for(var t of Ge(l))Xe.call(l,t)&&Ye(e,t,l[t]);return e},_e=(e,l)=>We(e,Ue(l)),el=(e,l)=>{var t={};for(var n in e)Ke.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&Ge)for(var n of Ge(e))l.indexOf(n)<0&&Xe.call(e,n)&&(t[n]=e[n]);return t};const{useCallback:ll,useMemo:tl,useState:nl}=l,sl="editable",rl=(e,l)=>H(t.useTableCellIds(e,l),(l=>e+"."+l)),al=(e,l,t)=>{const n=ll(e,l);return t?n:void 0},ol=(...e)=>tl((()=>e),e),il=(e,l)=>tl((()=>({store:e,tableId:l})),[e,l]),ul=(e,l)=>tl((()=>({queries:e,queryId:l})),[e,l]),dl=(e,l=!1,t,n=0,s,r,a,o)=>{const[[i,u,d],c]=nl([e,l,n]),h=ll((e=>{c(e),null==o||o(e)}),[o]),m=al((e=>h([e,e==i&&!u,d])),[h,i,u,d],t),b=ll((e=>h([i,u,e])),[h,i,u]),p=!0===a?kl:a;return[[i,u,d],m,tl((()=>!1===a?null:z(p,{offset:d,limit:s,total:r,onChange:b})),[a,p,d,s,r,b])]},cl=(e,l,t)=>tl((()=>{const s=null!=l?l:e;return ee(ne(E(s)?ee(H(s,(e=>[e,e]))):s,((e,l)=>{return[l,Ze(Ze({},{label:l,component:t}),(s=e,n(s)==r?{label:e}:e))];var s})))}),[l,t,e]),hl=({className:e,headerRow:l,idColumn:t,params:[n,s,r,a,o,i]})=>z("table",{className:e},i?z("caption",null,i):null,!1===l?null:z("thead",null,z("tr",null,!1===t?null:z(ml,{sort:null!=a?a:[],label:"Id",onClick:o}),ne(n,(({label:e},l)=>z(ml,{key:l,cellId:l,label:e,sort:null!=a?a:[],onClick:o}))))),z("tbody",null,H(r,(e=>z("tr",{key:e},!1===t?null:z("th",null,e),ne(n,(({component:l,getComponentProps:t},n)=>z("td",{key:n},z(l,_e(Ze(Ze({},D(t,e,n)),s),{rowId:e,cellId:n})))))))))),ml=({cellId:e,sort:[l,t],label:n=(null!=e?e:s),onClick:r})=>z("th",{onClick:al((()=>null==r?void 0:r(e)),[r,e],r),className:O(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},O(t)||l!=e?null:(t?"↓":"↑")+" ",n),bl=({localRowId:e,params:[n,s,r,a,o,i,u]})=>{const d=t.useRemoteRowId(o,e,i);return z("tr",null,!1===n?null:z(l.Fragment,null,z("th",null,e),z("th",null,d)),ne(s,(({component:l,getComponentProps:t},n)=>{const[s,o]=n.split(".",2),i=s===r?e:s===a?d:null;return O(i)?null:z("td",{key:n},z(l,_e(Ze({},D(t,i,o)),{store:u,tableId:s,rowId:i,cellId:o})))})))},pl=({thing:e,onThingChange:l,className:t,hasSchema:n})=>{const[s,i]=nl(),[u,d]=nl(),[c,h]=nl(),[m,b]=nl(),[p,v]=nl();u!==e&&(i(Je(e)),d(e),h(e+""),b(Number(e)||0),v(!!e));const g=ll(((e,t)=>{t(e),d(e),l(e)}),[l]);return z("div",{className:t},z("button",{className:s,onClick:ll((()=>{if(!(null==n?void 0:n())){const e=He(s,o,a,r),t=He(e,c,m,p);i(e),d(t),l(t)}}),[n,l,c,m,p,s])},s),He(s,z("input",{key:s,value:c,onChange:ll((e=>g(e[k][x]+"",h)),[g])}),z("input",{key:s,type:"number",value:m,onChange:ll((e=>g(Number(e[k][x]||0),b)),[g])}),z("input",{key:s,type:"checkbox",checked:p,onChange:ll((e=>g(!!e[k].checked,v)),[g])})))},vl=e=>{var l=e,{tableId:n,cellId:s,descending:r,offset:a,limit:o,store:i,editable:u,sortOnClick:d,paginator:c=!1,onChange:h,customCells:m}=l,b=el(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[p,v,g]=dl(s,r,d,a,o,t.useRowCount(n,i),c,h);return z(hl,_e(Ze({},b),{params:ol(cl(t.useTableCellIds(n,i),m,u?wl:t.CellView),il(i,n),t.useSortedRowIds(n,...p,o,i),p,v,g)}))},gl=({store:e,editable:l=!1,valueComponent:n=(l?Cl:t.ValueView),getValueComponentProps:s,className:r,headerRow:a,idColumn:o})=>z("table",{className:r},!1===a?null:z("thead",null,z("tr",null,!1===o?null:z("th",null,"Id"),z("th",null,y))),z("tbody",null,H(t.useValueIds(e),(l=>z("tr",{key:l},!1===o?null:z("th",null,l),z("td",null,z(n,_e(Ze({},D(s,l)),{valueId:l,store:e})))))))),fl=e=>{var l=e,{indexId:n,sliceId:s,indexes:r,editable:a,customCells:o}=l,i=el(l,["indexId","sliceId","indexes","editable","customCells"]);const[u,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(t.useIndexesOrIndexesById(r),n);return z(hl,_e(Ze({},i),{params:ol(cl(t.useTableCellIds(c,d),o,a?wl:t.CellView),il(d,c),t.useSliceRowIds(n,s,u))}))},Il=({relationshipId:e,relationships:n,editable:s,customCells:r,className:a,headerRow:o,idColumn:i=!0})=>{const[u,d,c,h]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(t.useRelationshipsOrRelationshipsById(n),e),m=cl([...rl(c,d),...rl(h,d)],r,s?wl:t.CellView),b=ol(i,m,c,h,e,u,d);return z("table",{className:a},!1===o?null:z("thead",null,z("tr",null,!1===i?null:z(l.Fragment,null,z("th",null,c,".Id"),z("th",null,h,".Id")),ne(m,(({label:e},l)=>z("th",{key:l},e))))),z("tbody",null,H(t.useRowIds(c,d),(e=>z(bl,{key:e,localRowId:e,params:b})))))},yl=e=>{var l=e,{queryId:n,cellId:s,descending:r,offset:a,limit:o,queries:i,sortOnClick:u,paginator:d=!1,customCells:c,onChange:h}=l,m=el(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[b,p,v]=dl(s,r,u,a,o,t.useResultRowCount(n,i),d,h);return z(hl,_e(Ze({},m),{params:ol(cl(t.useResultTableCellIds(n,i),c,t.ResultCellView),ul(i,n),t.useResultSortedRowIds(n,...b,o,i),b,p,v)}))},wl=({tableId:e,rowId:l,cellId:n,store:s,className:r})=>{var a;return z(pl,{thing:t.useCell(e,l,n,s),onThingChange:t.useSetCellCallback(e,l,n,(e=>e),[],s),className:null!=r?r:sl+f,hasSchema:null==(a=t.useStoreOrStoreById(s))?void 0:a.hasTablesSchema})},Cl=({valueId:e,store:l,className:n})=>{var s;return z(pl,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=n?n:sl+y,hasSchema:null==(s=t.useStoreOrStoreById(l))?void 0:s.hasValuesSchema})},kl=({onChange:e,total:t,offset:n=0,limit:s=t,singular:r="row",plural:a=r+"s"})=>{(n>t||n<0)&&(n=0,e(0));const o=al((()=>e(n-s)),[e,n,s],n>0),i=al((()=>e(n+s)),[e,n,s],n+s<t);return z(l.Fragment,null,t>s&&z(l.Fragment,null,z("button",{className:"previous",disabled:0==n,onClick:o},"←"),z("button",{className:"next",disabled:n+s>=t,onClick:i},"→"),n+1," to ",Math.min(t,n+s)," of "),t," ",1!=t?a:r)},xl=({indexes:e,indexesId:l,indexId:n,s:s})=>z(Fe,{uniqueId:ve("i",l,n),summary:"Index: "+n,s:s},H(t.useSliceIds(n,e),(t=>z(Sl,{indexes:e,indexesId:l,indexId:n,sliceId:t,s:s,key:t})))),Sl=({indexes:e,indexesId:l,indexId:t,sliceId:n,s:s})=>{const r=ve("i",l,t,n),[a,o]=fe(r,s);return z(Fe,{uniqueId:r,summary:"Slice: "+n,editable:a,handleEditable:o,s:s},z(fl,{sliceId:n,indexId:t,indexes:e,editable:a}))},Tl=({indexesId:e,s:l})=>{const n=t.useIndexes(e),s=t.useIndexIds(n);return O(n)?null:z(Fe,{uniqueId:ve("i",e),summary:"Indexes: "+(null!=e?e:d),s:l},W(s)?"No indexes defined":ge(s,(t=>z(xl,{indexes:n,indexesId:e,indexId:t,s:l,key:t}))))},Vl=({metrics:e,metricId:l})=>z("tr",null,z("th",null,l),z("td",null,null==e?void 0:e.getTableId(l)),z("td",null,t.useMetric(l,e))),Rl=({metricsId:e,s:l})=>{const n=t.useMetrics(e),s=t.useMetricIds(n);return O(n)?null:z(Fe,{uniqueId:ve("m",e),summary:"Metrics: "+(null!=e?e:d),s:l},W(s)?"No metrics defined":z("table",null,z("thead",null,z("th",null,"Metric Id"),z("th",null,"Table Id"),z("th",null,"Metric")),z("tbody",null,H(s,(e=>z(Vl,{metrics:n,metricId:e,key:e}))))))},Ol=({queries:e,queriesId:l,queryId:n,s:s})=>{var r;const a=ve("q",l,n),[o,i,u]=ae(null!=(r=t.useCell(de,a,ce,s))?r:"[]"),d=t.useSetCellCallback(de,a,ce,re,[],s);return z(Fe,{uniqueId:a,summary:"Query: "+n,s:s},z(yl,{queryId:n,queries:e,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d}))},ql=({queriesId:e,s:l})=>{const n=t.useQueries(e),s=t.useQueryIds(n);return O(n)?null:z(Fe,{uniqueId:ve("q",e),summary:"Queries: "+(null!=e?e:d),s:l},W(s)?"No queries defined":ge(s,(t=>z(Ol,{queries:n,queriesId:e,queryId:t,s:l,key:t}))))},Pl=({relationships:e,relationshipsId:l,relationshipId:t,s:n})=>{const s=ve("r",l,t),[r,a]=fe(s,n);return z(Fe,{uniqueId:s,summary:"Relationship: "+t,editable:r,handleEditable:a,s:n},z(Il,{relationshipId:t,relationships:e,editable:r}))},Nl=({relationshipsId:e,s:l})=>{const n=t.useRelationships(e),s=t.useRelationshipIds(n);return O(n)?null:z(Fe,{uniqueId:ve("r",e),summary:"Relationships: "+(null!=e?e:d),s:l},W(s)?"No relationships defined":ge(s,(t=>z(Pl,{relationships:n,relationshipsId:e,relationshipId:t,s:l,key:t}))))},El=({tableId:e,store:l,storeId:n,s:s})=>{var r;const a=ve("t",n,e),[o,i,u]=ae(null!=(r=t.useCell(de,a,ce,s))?r:"[]"),d=t.useSetCellCallback(de,a,ce,re,[],s),[c,m]=fe(a,s);return z(Fe,{uniqueId:a,summary:h+": "+e,editable:c,handleEditable:m,s:s},z(vl,{tableId:e,store:l,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d,editable:c}))},Ll=({store:e,storeId:l,s:n})=>{const s=ve("v",l),[r,a]=fe(s,n);return W(t.useValueIds(e))?null:z(Fe,{uniqueId:s,summary:w,editable:r,handleEditable:a,s:n},z(gl,{store:e,editable:r}))},Ml=({storeId:e,s:l})=>{const n=t.useStore(e),s=t.useTableIds(n);return O(n)?null:z(Fe,{uniqueId:ve("s",e),summary:"Store: "+(null!=e?e:d),s:l},z(Ll,{storeId:e,store:n,s:l}),ge(s,(t=>z(El,{store:n,storeId:e,tableId:t,s:l,key:t}))))},jl=({s:e})=>{const l=F(null),n=F(0),[s,r]=J(!1),{scrollLeft:a,scrollTop:o}=t.useValues(e);A((()=>{const e=l.current;if(e&&!s){const l=new MutationObserver((()=>{e.scrollWidth>=T(a)+e.clientWidth&&e.scrollHeight>=T(o)+e.clientHeight&&e.scrollTo(a,o)}));return l.observe(e,{childList:!0,subtree:!0}),()=>l.disconnect()}}),[s,a,o]);const i=$((l=>{const{scrollLeft:t,scrollTop:s}=l[k];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:t,scrollTop:s})}))}),[e]),u=t.useStore(),d=t.useStoreIds(),c=t.useMetrics(),h=t.useMetricsIds(),m=t.useIndexes(),b=t.useIndexesIds(),p=t.useRelationships(),v=t.useRelationshipsIds(),g=t.useQueries(),f=t.useQueriesIds();return O(u)&&W(d)&&O(c)&&W(h)&&O(m)&&W(b)&&O(p)&&W(v)&&O(g)&&W(f)?z("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the StoreInspector inside a Provider component."):z("article",{ref:l,onScroll:i},z(Ml,{s:e}),H(d,(l=>z(Ml,{storeId:l,s:e,key:l}))),z(Rl,{s:e}),H(h,(l=>z(Rl,{metricsId:l,s:e,key:l}))),z(Tl,{s:e}),H(b,(l=>z(Tl,{indexesId:l,s:e,key:l}))),z(Nl,{s:e}),H(v,(l=>z(Nl,{relationshipsId:l,s:e,key:l}))),z(ql,{s:e}),H(f,(l=>z(ql,{queriesId:l,s:e,key:l}))))};var zl=Object.defineProperty,$l=(e,l,t)=>(((e,l,t)=>{l in e?zl(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t})(e,"symbol"!=typeof l?l+"":l,t),t);class Al extends M{constructor(e){super(e),$l(this,"componentDidCatch",((e,l)=>console.error(e,l.componentStack))),this.state={e:0}}render(){return this.state.e?z("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}$l(Al,"getDerivedStateFromError",(()=>({e:1})));const Fl=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!1),[],e),r=t.useSetValueCallback(me,(e=>Number(e[k].dataset.id)),[],e);return z("header",null,z("img",{title:ie}),z("span",null,ie),H(ue,((e,l)=>l==n?null:z("img",{onClick:r,"data-id":l,title:"Dock to "+e,key:l}))),z("img",{onClick:s,title:"Close"}))},Jl=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1;return t.useValue(be,e)?z("main",{"data-position":n},z(Fl,{s:e}),z(Al,null,z(jl,{s:e}))):null},Dl=e=>l=>{return t=(l,t)=>l+e(t),Kl(l).reduce(t,0);var t},Bl=e=>{var l;return null!=(l=null==e?void 0:e.size)?l:0},Hl=Dl(Bl),Ql=Dl(Hl),Wl=Dl(Ql),Ul=(e,l)=>{var t;return null!=(t=null==e?void 0:e.has(l))&&t},Gl=e=>O(e)||0==Bl(e),Kl=e=>{var l;return[...null!=(l=null==e?void 0:e.values())?l:[]]},Xl=e=>e.clear(),Yl=(e,l)=>null==e?void 0:e.forEach(l),Zl=(e,l)=>null==e?void 0:e.delete(l),_l=e=>new Map(e),et=e=>{var l;return[...null!=(l=null==e?void 0:e.keys())?l:[]]},lt=(e,l)=>null==e?void 0:e.get(l),tt=(e,l)=>Yl(e,((e,t)=>l(t,e))),nt=(e,l,t)=>O(t)?(Zl(e,l),e):null==e?void 0:e.set(l,t),st=(e,l,t)=>(Ul(e,l)||nt(e,l,t()),lt(e,l)),rt=(e,l,t,n=nt)=>(ne(l,((l,n)=>t(e,n,l))),tt(e,(t=>le(l,t)?0:n(e,t))),e),at=(e,l,t)=>{const n={};return Yl(e,((e,s)=>{const r=l?l(e,s):e;!(null==t?void 0:t(r,e))&&(n[s]=r)})),n},ot=(e,l,t)=>at(e,(e=>at(e,l,t)),se),it=(e,l,t)=>at(e,(e=>ot(e,l,t)),se),ut=(e,l)=>{const t=_l();return Yl(e,((e,n)=>{var s;return t.set(n,null!=(s=null==l?void 0:l(e))?s:e)})),t},dt=e=>ut(e,ut),ct=e=>ut(e,dt),ht=(e,l,t,n,s=0)=>q((t?st:lt)(e,l[s],s>Q(l)-2?t:_l),(r=>{if(s>Q(l)-2)return(null==n?void 0:n(r))&&nt(e,l[s]),r;const a=ht(r,l,t,n,s+1);return Gl(r)&&nt(e,l[s]),a}));var mt=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{o(t.next(e))}catch(e){s(e)}},a=e=>{try{o(t.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((t=t.apply(e,l)).next())}));const bt=_l(),pt=_l();var vt=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{o(t.next(e))}catch(e){s(e)}},a=e=>{try{o(t.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((t=t.apply(e,l)).next())}));const gt="storage",ft=globalThis.window,It=e=>new Set(E(e)||O(e)?e:[e]),yt=(e,l)=>null==e?void 0:e.add(l),wt=/^\d+$/,Ct=()=>{const e=[];let l=0;return[t=>{var n;return null!=(n=t?G(e):null)?n:s+l++},l=>{wt.test(l)&&Q(e)<1e3&&U(e,l)}]},kt=e=>[e,e],xt=(e,l=Hl)=>l(e[0])+l(e[1]),St=()=>[_l(),_l()],Tt=e=>[...e],Vt=([e,l])=>e===l,Rt=(e,l,t)=>O(e)||!_(e)||se(e)||Y(e)?(null==t||t(),!1):(ne(e,((t,n)=>{l(t,n)||te(e,n)})),!se(e)),Ot=(e,l,t)=>nt(e,l,lt(e,l)==-t?void 0:t),qt=()=>{let e,l,t=!1,n=!1,r=0;const a=_l(),i=_l(),c=_l(),k=_l(),x=_l(),T=_l(),V=_l(),R=_l(),E=_l(),M=_l(),j=_l(),z=_l(),$=_l(),A=_l(),F=It(),J=_l(),D=_l(),W=_l(),G=_l(),K=St(),X=St(),Y=St(),_=St(),ee=St(),oe=St(),ie=St(),ue=St(),de=St(),ce=St(),he=St(),me=St(),be=St(),pe=St(),ve=St(),ge=_l(),fe=St(),[Ie,ye,we,Ce]=(e=>{let l;const[t,n]=Ct(),r=_l();return[(e,n,a,o=[],i=(()=>[]))=>{null!=l||(l=Al);const u=t(1);return nt(r,u,[e,n,a,o,i]),yt(ht(n,null!=a?a:[s],It),u),u},(e,t,...n)=>B(((e,l=[s])=>{const t=[],n=(e,s)=>s==Q(l)?U(t,e):null===l[s]?Yl(e,(e=>n(e,s+1))):B([l[s],null],(l=>n(lt(e,l),s+1)));return n(e,0),t})(e,t),(e=>Yl(e,(e=>lt(r,e)[0](l,...null!=t?t:[],...n))))),e=>q(lt(r,e),(([,l,t])=>(ht(l,null!=t?t:[s],void 0,(l=>(Zl(l,e),Gl(l)?1:0))),nt(r,e),n(e),t))),e=>q(lt(r,e),(([e,,t=[],n,s])=>{const r=(...a)=>{var o,i;const u=Q(a);u==Q(t)?e(l,...a,...s(a)):O(t[u])?B(null!=(i=null==(o=n[u])?void 0:o.call(n,...a))?i:[],(e=>r(...a,e))):r(...a,t[u])};r()}))]})(),ke=e=>{if(!Rt(e,((e,l)=>[u,d].includes(l))))return!1;const l=e[u];return!(!P(l)&&l!=o||(Je(e[d])!=l&&te(e,d),0))},xe=(l,t)=>(!e||Ul(j,t)||nl(t))&&Rt(l,((e,l)=>Se(t,l,e)),(()=>nl(t))),Se=(e,l,t,n)=>Rt(n?t:Oe(t,e,l),((n,s)=>q(Te(e,l,s,n),(e=>(t[s]=e,!0)),(()=>!1))),(()=>nl(e,l))),Te=(l,t,n,s)=>e?q(lt(lt(j,l),n),(e=>Je(s)!=e[u]?nl(l,t,n,s,e[d]):s),(()=>nl(l,t,n,s))):O(Je(s))?nl(l,t,n,s):s,Ve=(e,l)=>Rt(l?e:qe(e),((l,t)=>q(Re(t,l),(l=>(e[t]=l,!0)),(()=>!1))),(()=>sl())),Re=(e,t)=>l?q(lt($,e),(l=>Je(t)!=l[u]?sl(e,t,l[d]):t),(()=>sl(e,t))):O(Je(t))?sl(e,t):t,Oe=(e,l,t)=>(q(lt(z,l),(([n,s])=>{Yl(n,((l,t)=>{le(e,t)||(e[t]=l)})),Yl(s,(n=>{le(e,n)||nl(l,t,n)}))})),e),qe=e=>(l&&(Yl(A,((l,t)=>{le(e,t)||(e[t]=l)})),Yl(F,(l=>{le(e,l)||sl(l)}))),e),Pe=e=>rt(j,e,((e,l,t)=>{const n=_l(),s=It();rt(st(j,l,_l),t,((e,l,t)=>{nt(e,l,t),q(t[d],(e=>nt(n,l,e)),(()=>yt(s,l)))})),nt(z,l,[n,s])}),((e,l)=>{nt(j,l),nt(z,l)})),Ne=e=>rt($,e,((e,l,t)=>{nt($,l,t),q(t[d],(e=>nt(A,l,e)),(()=>yt(F,l)))}),((e,l)=>{nt($,l),nt(A,l),Zl(F,l)})),Ee=e=>se(e)?ql():Sl(e),Le=e=>rt(W,e,((e,l,t)=>Me(l,t)),((e,l)=>Ue(l))),Me=(e,l)=>rt(st(W,e,(()=>(Ye(e,1),nt(J,e,Ct()),nt(D,e,_l()),_l()))),l,((l,t,n)=>je(e,l,t,n)),((l,t)=>Ge(e,l,t))),je=(e,l,t,n,s)=>rt(st(l,t,(()=>(Ze(e,t,1),_l()))),n,((l,n,s)=>ze(e,t,l,n,s)),((n,r)=>Ke(e,l,t,n,r,s))),ze=(e,l,t,n,s)=>{Ul(t,n)||_e(e,l,n,1);const r=lt(t,n);s!==r&&(el(e,l,n,r,s),nt(t,n,s))},$e=(e,l,t,n,s)=>q(lt(l,t),(l=>ze(e,t,l,n,s)),(()=>je(e,l,t,Oe({[n]:s},e,t)))),Ae=e=>se(e)?El():Tl(e),Fe=e=>rt(G,e,((e,l,t)=>He(l,t)),((e,l)=>Xe(l))),He=(e,l)=>{Ul(G,e)||ll(e,1);const t=lt(G,e);l!==t&&(tl(e,t,l),nt(G,e,l))},Qe=(e,l)=>{const[t]=lt(J,e),n=t(l);return Ul(lt(W,e),n)?Qe(e,l):n},We=e=>{var l;return null!=(l=lt(W,e))?l:Me(e,{})},Ue=e=>Me(e,{}),Ge=(e,l,t)=>{const[,n]=lt(J,e);n(t),je(e,l,t,{},!0)},Ke=(e,l,t,n,s,r)=>{var a;const o=lt(null==(a=lt(z,e))?void 0:a[0],s);if(!O(o)&&!r)return ze(e,t,n,s,o);const i=l=>{el(e,t,l,lt(n,l)),_e(e,t,l,-1),nt(n,l)};O(o)?i(s):tt(n,i),Gl(n)&&(Ze(e,t,-1),Gl(nt(l,t))&&(Ye(e,-1),nt(W,e),nt(J,e),nt(D,e)))},Xe=e=>{const l=lt(A,e);if(!O(l))return He(e,l);tl(e,lt(G,e)),ll(e,-1),nt(G,e)},Ye=(e,l)=>Ot(a,e,l),Ze=(e,l,t)=>Ot(st(k,e,_l),l,t)&&nt(c,e,st(c,e,(()=>0))+t),_e=(e,l,t,n)=>{var s;const r=lt(D,e),a=null!=(s=lt(r,t))?s:0;(0==a&&1==n||1==a&&-1==n)&&Ot(st(i,e,_l),t,n),nt(r,t,a!=-n?a+n:null),Ot(st(st(x,e,_l),l,_l),t,n)},el=(e,l,t,n,s)=>st(st(st(T,e,_l),l,_l),t,(()=>[n,0]))[1]=s,ll=(e,l)=>Ot(V,e,l),tl=(e,l,t)=>st(R,e,(()=>[l,0]))[1]=t,nl=(e,l,t,n,s)=>(U(st(st(st(E,e,_l),l,_l),t,(()=>[])),n),s),sl=(e,l,t)=>(U(st(M,e,(()=>[])),l),t),rl=(e,l,t)=>q(lt(lt(lt(T,e),l),t),(([e,l])=>[!0,e,l]),(()=>[!1,...kt(wl(e,l,t))])),al=e=>q(lt(R,e),(([e,l])=>[!0,e,l]),(()=>[!1,...kt(xl(e))])),ol=e=>Gl(E)||Gl(he[e])?0:Yl(e?ct(E):E,((l,t)=>Yl(l,((l,n)=>Yl(l,((l,s)=>ye(he[e],[t,n,s],l))))))),il=e=>Gl(M)||Gl(me[e])?0:Yl(e?ut(M):M,((l,t)=>ye(me[e],[t],l))),ul=(e,l,t)=>{if(!Gl(l))return ye(e,t,(()=>at(l))),1},dl=e=>{const l=Gl(ie[e]),t=Gl(de[e])&&Gl(_[e])&&Gl(ee[e])&&Gl(oe[e])&&l&&Gl(X[e]),n=Gl(ce[e])&&Gl(ue[e])&&Gl(Y[e])&&Gl(K[e]);if(!t||!n){const s=e?[ut(a),dt(i),ut(c),dt(k),ct(x),ct(T)]:[a,i,c,k,x,T];if(!t){ul(X[e],s[0]),Yl(s[1],((l,t)=>ul(_[e],l,[t]))),Yl(s[2],((l,t)=>{0!=l&&ye(ee[e],[t],gl(t))}));const t=It();Yl(s[3],((n,s)=>{ul(oe[e],n,[s])&&!l&&(ye(ie[e],[s,null]),yt(t,s))})),l||Yl(s[5],((l,n)=>{if(!Ul(t,n)){const t=It();Yl(l,(e=>Yl(e,(([l,n],s)=>n!==l?yt(t,s):Zl(e,s))))),Yl(t,(l=>ye(ie[e],[n,l])))}})),Yl(s[4],((l,t)=>Yl(l,((l,n)=>ul(de[e],l,[t,n])))))}if(!n){let l;Yl(s[5],((t,n)=>{let s;Yl(t,((t,r)=>{let a;Yl(t,(([t,o],i)=>{o!==t&&(ye(ce[e],[n,r,i],o,t,rl),l=s=a=1)})),a&&ye(ue[e],[n,r],rl)})),s&&ye(Y[e],[n],rl)})),l&&ye(K[e],void 0,rl)}}},cl=e=>{const l=Gl(pe[e]),t=Gl(ve[e])&&Gl(be[e]);if(!l||!t){const n=e?[ut(V),ut(R)]:[V,R];if(l||ul(pe[e],n[0]),!t){let l;Yl(n[1],(([t,n],s)=>{n!==t&&(ye(ve[e],[s],n,t,al),l=1)})),l&&ye(be[e],void 0,al)}}},hl=(e,...l)=>(jl((()=>e(...H(l,S)))),Al),ml=()=>[at(T,((e,l)=>-1===lt(a,l)?null:at(e,((e,t)=>-1===lt(lt(k,l),t)?null:at(e,(([,e])=>null!=e?e:null),((e,l)=>Vt(l)))),se)),se),at(R,(([,e])=>null!=e?e:null),((e,l)=>Vt(l)))],bl=()=>({cellsTouched:t,valuesTouched:n,changedCells:it(T,Tt,Vt),invalidCells:it(E),changedValues:at(R,Tt,Vt),invalidValues:at(M),changedTableIds:at(a),changedRowIds:ot(k),changedCellIds:it(x),changedValueIds:at(V)}),pl=()=>it(W),vl=()=>et(W),gl=e=>Bl(lt(W,S(e))),fl=e=>et(lt(W,S(e))),Il=(e,l,t,n=0,s)=>{return H(L((a=lt(W,S(e)),o=(e,t)=>[O(l)?t:lt(e,S(l)),t],r=([e],[l])=>{return((null!=(n=e)?n:0)<(null!=(s=l)?s:0)?-1:1)*(t?-1:1);var n,s},H([...null!=(i=null==a?void 0:a.entries())?i:[]],(([e,l])=>o(l,e))).sort(r)),n,O(s)?s:n+s),(([,e])=>e));var r,a,o,i},yl=(e,l)=>et(lt(lt(W,S(e)),S(l))),wl=(e,l,t)=>lt(lt(lt(W,S(e)),S(l)),S(t)),Cl=()=>at(G),kl=()=>et(G),xl=e=>lt(G,S(e)),Sl=e=>hl((()=>(e=>Rt(e,xe,nl))(e)?Le(e):0)),Tl=e=>hl((()=>Ve(e)?Fe(e):0)),Vl=e=>{try{Ee(ae(e))}catch(e){}return Al},Rl=l=>hl((()=>{if((e=Rt(l,(e=>Rt(e,ke))))&&(Pe(l),!Gl(W))){const e=pl();ql(),Sl(e)}})),Ol=e=>hl((()=>{if(l=(e=>Rt(e,ke))(e)){const t=Cl();Ml(),El(),l=!0,Ne(e),Tl(t)}})),ql=()=>hl((()=>Le({}))),Pl=e=>hl((e=>Ul(W,e)?Ue(e):0),e),Nl=(e,l)=>hl(((e,l)=>q(lt(W,e),(t=>Ul(t,l)?Ge(e,t,l):0))),e,l),El=()=>hl((()=>Fe({}))),Ll=()=>hl((()=>{Pe({}),e=!1})),Ml=()=>hl((()=>{Ne({}),l=!1})),jl=(e,l)=>{if(-1!=r){zl();const t=e();return $l(l),t}},zl=()=>(-1!=r&&r++,1==r&&ye(ge,void 0,ml,bl),Al),$l=e=>(r>0&&(r--,0==r&&(t=!Gl(T),n=!Gl(R),r=1,ol(1),t&&dl(1),il(1),n&&cl(1),(null==e?void 0:e(ml,bl))&&(Yl(T,((e,l)=>Yl(e,((e,t)=>Yl(e,(([e],n)=>De(Al,l,t,n,e))))))),Yl(R,(([e],l)=>Be(Al,l,e))),t=n=!1),ye(fe[0],void 0,ml,bl),r=-1,ol(0),t&&dl(0),il(0),n&&cl(0),ye(fe[1],void 0,ml,bl),r=0,t=n=!1,B([a,i,c,k,x,T,E,V,R,M],Xl))),Al),Al={getContent:()=>[pl(),Cl()],getTables:pl,getTableIds:vl,getTable:e=>ot(lt(W,S(e))),getTableCellIds:e=>et(lt(D,S(e))),getRowCount:gl,getRowIds:fl,getSortedRowIds:Il,getRow:(e,l)=>at(lt(lt(W,S(e)),S(l))),getCellIds:yl,getCell:wl,getValues:Cl,getValueIds:kl,getValue:xl,hasTables:()=>!Gl(W),hasTable:e=>Ul(W,S(e)),hasTableCell:(e,l)=>Ul(lt(D,S(e)),S(l)),hasRow:(e,l)=>Ul(lt(W,S(e)),S(l)),hasCell:(e,l,t)=>Ul(lt(lt(W,S(e)),S(l)),S(t)),hasValues:()=>!Gl(G),hasValue:e=>Ul(G,S(e)),getTablesJson:()=>re(W),getValuesJson:()=>re(G),getJson:()=>re([W,G]),getTablesSchemaJson:()=>re(j),getValuesSchemaJson:()=>re($),getSchemaJson:()=>re([j,$]),hasTablesSchema:()=>e,hasValuesSchema:()=>l,setContent:([e,l])=>hl((()=>{(se(e)?ql:Sl)(e),(se(l)?El:Tl)(l)})),setTables:Sl,setTable:(e,l)=>hl((e=>xe(l,e)?Me(e,l):0),e),setRow:(e,l,t)=>hl(((e,l)=>Se(e,l,t)?je(e,We(e),l,t):0),e,l),addRow:(e,l,t=!0)=>jl((()=>{let n;return Se(e,n,l)&&(e=S(e),je(e,We(e),n=Qe(e,t?1:0),l)),n})),setPartialRow:(e,l,t)=>hl(((e,l)=>{if(Se(e,l,t,1)){const n=We(e);ne(t,((t,s)=>$e(e,n,l,s,t)))}}),e,l),setCell:(e,l,t,n)=>hl(((e,l,t)=>q(Te(e,l,t,N(n)?n(wl(e,l,t)):n),(n=>$e(e,We(e),l,t,n)))),e,l,t),setValues:Tl,setPartialValues:e=>hl((()=>Ve(e,1)?ne(e,((e,l)=>He(l,e))):0)),setValue:(e,l)=>hl((e=>q(Re(e,N(l)?l(xl(e)):l),(l=>He(e,l)))),e),setTransactionChanges:e=>hl((()=>{ne(e[0],((e,l)=>O(e)?Pl(l):ne(e,((e,t)=>O(e)?Nl(l,t):ne(e,((e,n)=>De(Al,l,t,n,e))))))),ne(e[1],((e,l)=>Be(Al,l,e)))})),setTablesJson:Vl,setValuesJson:e=>{try{Ae(ae(e))}catch(e){}return Al},setJson:e=>hl((()=>{try{const[l,t]=ae(e);Ee(l),Ae(t)}catch(l){Vl(e)}})),setTablesSchema:Rl,setValuesSchema:Ol,setSchema:(e,l)=>hl((()=>{Rl(e),Ol(l)})),delTables:ql,delTable:Pl,delRow:Nl,delCell:(e,l,t,n)=>hl(((e,l,t)=>q(lt(W,e),(s=>q(lt(s,l),(r=>Ul(r,t)?Ke(e,s,l,r,t,n):0))))),e,l,t),delValues:El,delValue:e=>hl((e=>Ul(G,e)?Xe(e):0),e),delTablesSchema:Ll,delValuesSchema:Ml,delSchema:()=>hl((()=>{Ll(),Ml()})),transaction:jl,startTransaction:zl,finishTransaction:$l,forEachTable:e=>Yl(W,((l,t)=>e(t,(e=>Yl(l,((l,t)=>e(t,(e=>tt(l,e))))))))),forEachTableCell:(e,l)=>tt(lt(D,S(e)),l),forEachRow:(e,l)=>Yl(lt(W,S(e)),((e,t)=>l(t,(l=>tt(e,l))))),forEachCell:(e,l,t)=>tt(lt(lt(W,S(e)),S(l)),t),forEachValue:e=>tt(G,e),addSortedRowIdsListener:(e,l,t,n,s,r,a)=>{let o=Il(e,l,t,n,s);return Ie((()=>{const a=Il(e,l,t,n,s);var i,u,d;u=o,Q(i=a)===Q(u)&&(d=(e,l)=>u[l]===e,i.every(d))||(o=a,r(Al,e,l,t,n,s,o))}),ie[a?1:0],[e,l],[vl])},addStartTransactionListener:e=>Ie(e,ge),addWillFinishTransactionListener:e=>Ie(e,fe[0]),addDidFinishTransactionListener:e=>Ie(e,fe[1]),callListener:e=>(Ce(e),Al),delListener:e=>(we(e),Al),getListenerStats:()=>({tables:xt(K),tableIds:xt(X),tableCellIds:xt(_),table:xt(Y),rowCount:xt(ee),rowIds:xt(oe),sortedRowIds:xt(ie),row:xt(ue,Ql),cellIds:xt(de,Ql),cell:xt(ce,Wl),invalidCell:xt(he,Wl),values:xt(be),valueIds:xt(pe),value:xt(ve),invalidValue:xt(me),transaction:Hl(ge)+xt(fe)}),createStore:qt,addListener:Ie,callListeners:ye};return ne({[m]:[0,K],[b]:[0,X],[h]:[1,Y,[vl]],[h+I]:[1,_,[vl]],[v]:[1,ee,[vl]],[g]:[1,oe,[vl]],[p]:[2,ue,[vl,fl]],[I]:[2,de,[vl,fl]],[f]:[3,ce,[vl,fl,yl],e=>kt(wl(...e))],InvalidCell:[3,he],[w]:[0,be],[C]:[0,pe],[y]:[1,ve,[kl],e=>kt(xl(e[0]))],InvalidValue:[1,me]},(([e,l,t,n],s)=>{Al["add"+s+"Listener"]=(...s)=>Ie(s[e],l[s[e+1]?1:0],e>0?L(s,0,e):void 0,t,n)})),Z(Al)},Pt=({position:e="right",open:l=!1})=>{const n=t.useCreateStore(qt),s=ue.indexOf(e);return t.useCreatePersister(n,(e=>{return((e,l,t,n)=>((e,l,t,n,s,r,a=[])=>{let o,i,u,d=0,c=0,h=0,m=0;st(bt,a,(()=>0)),st(pt,a,(()=>[]));const b=e=>mt(void 0,null,(function*(){return 2!=d&&(d=1,c++,yield p.schedule((()=>mt(void 0,null,(function*(){yield e(),d=0}))))),p})),p={load:(t,n)=>mt(void 0,null,(function*(){return yield b((()=>mt(void 0,null,(function*(){try{e.setContent(yield l())}catch(l){e.setContent([t,n])}}))))})),startAutoLoad:(...t)=>mt(void 0,[...t],(function*(t={},s={}){return p.stopAutoLoad(),yield p.load(t,s),m=1,u=n(((t,n)=>mt(void 0,null,(function*(){if(n){const l=n();yield b((()=>mt(void 0,null,(function*(){return e.setTransactionChanges(l)}))))}else yield b((()=>mt(void 0,null,(function*(){var n;try{e.setContent(null!=(n=null==t?void 0:t())?n:yield l())}catch(e){null==r||r(e)}}))))})))),p})),stopAutoLoad:()=>(m&&(s(u),u=void 0,m=0),p),save:l=>mt(void 0,null,(function*(){return 1!=d&&(d=2,h++,yield p.schedule((()=>mt(void 0,null,(function*(){try{yield t(e.getContent,l)}catch(e){null==r||r(e)}d=0}))))),p})),startAutoSave:()=>mt(void 0,null,(function*(){return yield p.stopAutoSave().save(),o=e.addDidFinishTransactionListener(((e,l)=>{const[t,n]=l();se(t)&&se(n)||p.save((()=>[t,n]))})),p})),stopAutoSave:()=>(q(o,e.delListener),p),schedule:(...e)=>mt(void 0,null,(function*(){return U(lt(pt,a),...e),yield mt(void 0,null,(function*(){if(!lt(bt,a)){for(nt(bt,a,1);!O(i=G(lt(pt,a)));)try{yield i()}catch(e){null==r||r(e)}nt(bt,a,0)}})),p})),getStore:()=>e,destroy:()=>p.stopAutoLoad().stopAutoSave(),getStats:()=>({loads:c,saves:h})};return Z(p)})(e,(()=>vt(void 0,null,(function*(){return ae(t.getItem(l))}))),(e=>vt(void 0,null,(function*(){return t.setItem(l,re(e()))}))),(e=>{const n=n=>{n.storageArea===t&&n.key===l&&e((()=>ae(n.newValue)))};return ft.addEventListener(gt,n),n}),(e=>ft.removeEventListener(gt,e)),n))(e,oe,sessionStorage,l);var l}),void 0,(e=>{return t=function*(){yield e.load(void 0,{position:-1==s?1:s,open:!!l}),yield e.startAutoSave()},new Promise(((e,l)=>{var n=e=>{try{r(t.next(e))}catch(e){l(e)}},s=e=>{try{r(t.throw(e))}catch(e){l(e)}},r=l=>l.done?e(l.value):Promise.resolve(l.value).then(n,s);r((t=t.apply(void 0,null)).next())}));var t})),z(j,null,z("aside",{id:oe},z(Ae,{s:n}),z(Jl,{s:n})),z("style",null,$e))};var Nt=Object.defineProperty,Et=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable,jt=(e,l,t)=>l in e?Nt(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t;e.EditableCellView=wl,e.EditableValueView=Cl,e.RelationshipInHtmlTable=Il,e.ResultSortedTableInHtmlTable=yl,e.ResultTableInHtmlTable=e=>{var l=e,{queryId:n,queries:s,customCells:r}=l,a=el(l,["queryId","queries","customCells"]);return z(hl,_e(Ze({},a),{params:ol(cl(t.useResultTableCellIds(n,s),r,t.ResultCellView),ul(s,n),t.useResultRowIds(n,s))}))},e.SliceInHtmlTable=fl,e.SortedTableInHtmlTable=vl,e.SortedTablePaginator=kl,e.StoreInspector=e=>z(Pt,((e,l)=>{for(var t in l||(l={}))Lt.call(l,t)&&jt(e,t,l[t]);if(Et)for(var t of Et(l))Mt.call(l,t)&&jt(e,t,l[t]);return e})({},e)),e.TableInHtmlTable=e=>{var l=e,{tableId:n,store:s,editable:r,customCells:a}=l,o=el(l,["tableId","store","editable","customCells"]);return z(hl,_e(Ze({},o),{params:ol(cl(t.useTableCellIds(n,s),a,r?wl:t.CellView),il(s,n),t.useRowIds(n,s))}))},e.ValuesInHtmlTable=gl},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDomDebug={},e.React,e.TinyBaseUiReact);
1
+ var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,s="",r=n(s),a=n(!0),o=n(0),i=n(n),u="type",d="default",c="Ids",h="Table",m=h+"s",b=h+c,p="Row",g=p+"Count",v=p+c,f="Cell",I=f+c,y="Value",w=y+"s",C=y+c,k="currentTarget",x="value",S=e=>s+e,T=Math.floor,V=isFinite,R=(e,l)=>e instanceof l,O=e=>null==e,q=(e,l,t)=>O(e)?null==t?void 0:t():l(e),P=e=>e==r||e==a,N=e=>n(e)==i,E=e=>Array.isArray(e),L=(e,l,t)=>e.slice(l,t),{PureComponent:M,Fragment:j,createElement:z,useCallback:$,useLayoutEffect:A,useRef:F,useState:J}=l,D=(e,...l)=>O(e)?{}:e(...l),B=(e,l)=>e.forEach(l),H=(e,l)=>e.map(l),Q=e=>e.length,W=e=>0==Q(e),U=(e,...l)=>e.push(...l),G=e=>e.shift(),K=Object,X=K.keys,Y=K.isFrozen,Z=K.freeze,_=e=>R(e,K)&&e.constructor==K,ee=(e=[])=>K.fromEntries(e),le=(e,l)=>!O(((e,l)=>q(e,(e=>e[l])))(e,l)),te=(e,l)=>(delete e[l],e),ne=(e,l)=>H(K.entries(e),(([e,t])=>l(t,e))),se=e=>_(e)&&0==(e=>Q(X(e)))(e),re=e=>JSON.stringify(e,((e,l)=>R(l,Map)?K.fromEntries([...l]):l)),ae=JSON.parse,oe="tinybaseStoreInspector",ie="TinyBase Store Inspector",ue=["left","top","bottom","right","full"],de="state",ce="sort",he="open",me="position",be=he,pe="editable",ge=(...e)=>re(e),ve=(e,l)=>H(e.sort(),l),fe=(e,l)=>[!!t.useCell(de,e,pe,l),$((t=>{l.setCell(de,e,pe,(e=>!e)),t.preventDefault()}),[l,e])],Ie="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",ye='content:url("',we=ye+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",Ce='</svg>")',ke=ye+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",xe=H([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,l,t,n])=>we+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${l}' width='${t}' height='${n}' fill='white'/>`+Ce)),Se=we+"<path d='M20 20l60 60M20 80l60-60' />"+Ce,Te=we+`<path d='${Ie}' />`+Ce,Ve=we+`<path d='${Ie}M20 20l60 60' />`+Ce;var Re=Object.defineProperty,Oe=Object.defineProperties,qe=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Le=(e,l,t)=>l in e?Re(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Me=(e,l)=>{for(var t in l||(l={}))Ne.call(l,t)&&Le(e,t,l[t]);if(Pe)for(var t of Pe(l))Ee.call(l,t)&&Le(e,t,l[t]);return e},je=(e,l)=>Oe(e,qe(l));const ze="*::-webkit-scrollbar",$e=`#${oe}{\n all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999;\n ${((e,l="")=>e.join(l))(ne(je(Me(je(Me(je(Me({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[ze]:"width:0.5rem;height:0.5rem;",[ze+"-track"]:"background:#111",[ze+"-thumb"]:"background:#999;border:1px solid #111",[ze+"-thumb:hover"]:"background:#fff",[ze+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+ke},ee(H(["bottom:0;left:0","top:0;right:0"],((e,l)=>[`>img[data-position='${l}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),ee(H(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,l)=>[`main[data-position='${l}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":ke,"header>img:nth-of-type(6)":Se}),ee(H(xe,((e,l)=>[`header>img[data-id='${l}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":Te,"details[open]>summary img.done":Ve,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,l)=>e?`& ${l}{${e}}`:"")))}`,Ae=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!0),[],e);return t.useValue(be,e)?null:z("img",{onClick:s,title:ie,"data-position":n})},Fe=({uniqueId:e,summary:l,editable:n,handleEditable:s,children:r,s:a})=>{const o=!!t.useCell(de,e,he,a),i=t.useSetCellCallback(de,e,he,(e=>e[k].open),[],a);return z("details",{open:o,onToggle:i},z("summary",null,l,s?z("img",{onClick:s,className:n?"done":"edit"}):null),r)},Je=e=>{const l=n(e);return P(l)||l==o&&V(e)?l:void 0},De=(e,l,t,n,s)=>O(s)?e.delCell(l,t,n,!0):e.setCell(l,t,n,s),Be=(e,l,t)=>O(t)?e.delValue(l):e.setValue(l,t),He=(e,l,t,n)=>e==r?l:e==o?t:n;var Qe=Object.defineProperty,We=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Ye=(e,l,t)=>l in e?Qe(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Ze=(e,l)=>{for(var t in l||(l={}))Ke.call(l,t)&&Ye(e,t,l[t]);if(Ge)for(var t of Ge(l))Xe.call(l,t)&&Ye(e,t,l[t]);return e},_e=(e,l)=>We(e,Ue(l)),el=(e,l)=>{var t={};for(var n in e)Ke.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&Ge)for(var n of Ge(e))l.indexOf(n)<0&&Xe.call(e,n)&&(t[n]=e[n]);return t};const{useCallback:ll,useMemo:tl,useState:nl}=l,sl="editable",rl=(e,l)=>H(t.useTableCellIds(e,l),(l=>e+"."+l)),al=(e,l,t)=>{const n=ll(e,l);return t?n:void 0},ol=(...e)=>tl((()=>e),e),il=(e,l)=>tl((()=>({store:e,tableId:l})),[e,l]),ul=(e,l)=>tl((()=>({queries:e,queryId:l})),[e,l]),dl=(e,l=!1,t,n=0,s,r,a,o)=>{const[[i,u,d],c]=nl([e,l,n]),h=ll((e=>{c(e),null==o||o(e)}),[o]),m=al((e=>h([e,e==i&&!u,d])),[h,i,u,d],t),b=ll((e=>h([i,u,e])),[h,i,u]),p=!0===a?kl:a;return[[i,u,d],m,tl((()=>!1===a?null:z(p,{offset:d,limit:s,total:r,onChange:b})),[a,p,d,s,r,b])]},cl=(e,l,t)=>tl((()=>{const s=null!=l?l:e;return ee(ne(E(s)?ee(H(s,(e=>[e,e]))):s,((e,l)=>{return[l,Ze(Ze({},{label:l,component:t}),(s=e,n(s)==r?{label:e}:e))];var s})))}),[l,t,e]),hl=({className:e,headerRow:l,idColumn:t,params:[n,s,r,a,o,i]})=>z("table",{className:e},i?z("caption",null,i):null,!1===l?null:z("thead",null,z("tr",null,!1===t?null:z(ml,{sort:null!=a?a:[],label:"Id",onClick:o}),ne(n,(({label:e},l)=>z(ml,{key:l,cellId:l,label:e,sort:null!=a?a:[],onClick:o}))))),z("tbody",null,H(r,(e=>z("tr",{key:e},!1===t?null:z("th",null,e),ne(n,(({component:l,getComponentProps:t},n)=>z("td",{key:n},z(l,_e(Ze(Ze({},D(t,e,n)),s),{rowId:e,cellId:n})))))))))),ml=({cellId:e,sort:[l,t],label:n=(null!=e?e:s),onClick:r})=>z("th",{onClick:al((()=>null==r?void 0:r(e)),[r,e],r),className:O(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},O(t)||l!=e?null:(t?"↓":"↑")+" ",n),bl=({localRowId:e,params:[n,s,r,a,o,i,u]})=>{const d=t.useRemoteRowId(o,e,i);return z("tr",null,!1===n?null:z(l.Fragment,null,z("th",null,e),z("th",null,d)),ne(s,(({component:l,getComponentProps:t},n)=>{const[s,o]=n.split(".",2),i=s===r?e:s===a?d:null;return O(i)?null:z("td",{key:n},z(l,_e(Ze({},D(t,i,o)),{store:u,tableId:s,rowId:i,cellId:o})))})))},pl=({thing:e,onThingChange:l,className:t,hasSchema:n})=>{const[s,i]=nl(),[u,d]=nl(),[c,h]=nl(),[m,b]=nl(),[p,g]=nl();u!==e&&(i(Je(e)),d(e),h(e+""),b(Number(e)||0),g(!!e));const v=ll(((e,t)=>{t(e),d(e),l(e)}),[l]);return z("div",{className:t},z("button",{className:s,onClick:ll((()=>{if(!(null==n?void 0:n())){const e=He(s,o,a,r),t=He(e,c,m,p);i(e),d(t),l(t)}}),[n,l,c,m,p,s])},s),He(s,z("input",{key:s,value:c,onChange:ll((e=>v(e[k][x]+"",h)),[v])}),z("input",{key:s,type:"number",value:m,onChange:ll((e=>v(Number(e[k][x]||0),b)),[v])}),z("input",{key:s,type:"checkbox",checked:p,onChange:ll((e=>v(!!e[k].checked,g)),[v])})))},gl=e=>{var l=e,{tableId:n,cellId:s,descending:r,offset:a,limit:o,store:i,editable:u,sortOnClick:d,paginator:c=!1,onChange:h,customCells:m}=l,b=el(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[p,g,v]=dl(s,r,d,a,o,t.useRowCount(n,i),c,h);return z(hl,_e(Ze({},b),{params:ol(cl(t.useTableCellIds(n,i),m,u?wl:t.CellView),il(i,n),t.useSortedRowIds(n,...p,o,i),p,g,v)}))},vl=({store:e,editable:l=!1,valueComponent:n=(l?Cl:t.ValueView),getValueComponentProps:s,className:r,headerRow:a,idColumn:o})=>z("table",{className:r},!1===a?null:z("thead",null,z("tr",null,!1===o?null:z("th",null,"Id"),z("th",null,y))),z("tbody",null,H(t.useValueIds(e),(l=>z("tr",{key:l},!1===o?null:z("th",null,l),z("td",null,z(n,_e(Ze({},D(s,l)),{valueId:l,store:e})))))))),fl=e=>{var l=e,{indexId:n,sliceId:s,indexes:r,editable:a,customCells:o}=l,i=el(l,["indexId","sliceId","indexes","editable","customCells"]);const[u,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(t.useIndexesOrIndexesById(r),n);return z(hl,_e(Ze({},i),{params:ol(cl(t.useTableCellIds(c,d),o,a?wl:t.CellView),il(d,c),t.useSliceRowIds(n,s,u))}))},Il=({relationshipId:e,relationships:n,editable:s,customCells:r,className:a,headerRow:o,idColumn:i=!0})=>{const[u,d,c,h]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(t.useRelationshipsOrRelationshipsById(n),e),m=cl([...rl(c,d),...rl(h,d)],r,s?wl:t.CellView),b=ol(i,m,c,h,e,u,d);return z("table",{className:a},!1===o?null:z("thead",null,z("tr",null,!1===i?null:z(l.Fragment,null,z("th",null,c,".Id"),z("th",null,h,".Id")),ne(m,(({label:e},l)=>z("th",{key:l},e))))),z("tbody",null,H(t.useRowIds(c,d),(e=>z(bl,{key:e,localRowId:e,params:b})))))},yl=e=>{var l=e,{queryId:n,cellId:s,descending:r,offset:a,limit:o,queries:i,sortOnClick:u,paginator:d=!1,customCells:c,onChange:h}=l,m=el(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[b,p,g]=dl(s,r,u,a,o,t.useResultRowCount(n,i),d,h);return z(hl,_e(Ze({},m),{params:ol(cl(t.useResultTableCellIds(n,i),c,t.ResultCellView),ul(i,n),t.useResultSortedRowIds(n,...b,o,i),b,p,g)}))},wl=({tableId:e,rowId:l,cellId:n,store:s,className:r})=>{var a;return z(pl,{thing:t.useCell(e,l,n,s),onThingChange:t.useSetCellCallback(e,l,n,(e=>e),[],s),className:null!=r?r:sl+f,hasSchema:null==(a=t.useStoreOrStoreById(s))?void 0:a.hasTablesSchema})},Cl=({valueId:e,store:l,className:n})=>{var s;return z(pl,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=n?n:sl+y,hasSchema:null==(s=t.useStoreOrStoreById(l))?void 0:s.hasValuesSchema})},kl=({onChange:e,total:t,offset:n=0,limit:s=t,singular:r="row",plural:a=r+"s"})=>{(n>t||n<0)&&(n=0,e(0));const o=al((()=>e(n-s)),[e,n,s],n>0),i=al((()=>e(n+s)),[e,n,s],n+s<t);return z(l.Fragment,null,t>s&&z(l.Fragment,null,z("button",{className:"previous",disabled:0==n,onClick:o},"←"),z("button",{className:"next",disabled:n+s>=t,onClick:i},"→"),n+1," to ",Math.min(t,n+s)," of "),t," ",1!=t?a:r)},xl=({indexes:e,indexesId:l,indexId:n,s:s})=>z(Fe,{uniqueId:ge("i",l,n),summary:"Index: "+n,s:s},H(t.useSliceIds(n,e),(t=>z(Sl,{indexes:e,indexesId:l,indexId:n,sliceId:t,s:s,key:t})))),Sl=({indexes:e,indexesId:l,indexId:t,sliceId:n,s:s})=>{const r=ge("i",l,t,n),[a,o]=fe(r,s);return z(Fe,{uniqueId:r,summary:"Slice: "+n,editable:a,handleEditable:o,s:s},z(fl,{sliceId:n,indexId:t,indexes:e,editable:a}))},Tl=({indexesId:e,s:l})=>{const n=t.useIndexes(e),s=t.useIndexIds(n);return O(n)?null:z(Fe,{uniqueId:ge("i",e),summary:"Indexes: "+(null!=e?e:d),s:l},W(s)?"No indexes defined":ve(s,(t=>z(xl,{indexes:n,indexesId:e,indexId:t,s:l,key:t}))))},Vl=({metrics:e,metricId:l})=>z("tr",null,z("th",null,l),z("td",null,null==e?void 0:e.getTableId(l)),z("td",null,t.useMetric(l,e))),Rl=({metricsId:e,s:l})=>{const n=t.useMetrics(e),s=t.useMetricIds(n);return O(n)?null:z(Fe,{uniqueId:ge("m",e),summary:"Metrics: "+(null!=e?e:d),s:l},W(s)?"No metrics defined":z("table",null,z("thead",null,z("th",null,"Metric Id"),z("th",null,"Table Id"),z("th",null,"Metric")),z("tbody",null,H(s,(e=>z(Vl,{metrics:n,metricId:e,key:e}))))))},Ol=({queries:e,queriesId:l,queryId:n,s:s})=>{var r;const a=ge("q",l,n),[o,i,u]=ae(null!=(r=t.useCell(de,a,ce,s))?r:"[]"),d=t.useSetCellCallback(de,a,ce,re,[],s);return z(Fe,{uniqueId:a,summary:"Query: "+n,s:s},z(yl,{queryId:n,queries:e,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d}))},ql=({queriesId:e,s:l})=>{const n=t.useQueries(e),s=t.useQueryIds(n);return O(n)?null:z(Fe,{uniqueId:ge("q",e),summary:"Queries: "+(null!=e?e:d),s:l},W(s)?"No queries defined":ve(s,(t=>z(Ol,{queries:n,queriesId:e,queryId:t,s:l,key:t}))))},Pl=({relationships:e,relationshipsId:l,relationshipId:t,s:n})=>{const s=ge("r",l,t),[r,a]=fe(s,n);return z(Fe,{uniqueId:s,summary:"Relationship: "+t,editable:r,handleEditable:a,s:n},z(Il,{relationshipId:t,relationships:e,editable:r}))},Nl=({relationshipsId:e,s:l})=>{const n=t.useRelationships(e),s=t.useRelationshipIds(n);return O(n)?null:z(Fe,{uniqueId:ge("r",e),summary:"Relationships: "+(null!=e?e:d),s:l},W(s)?"No relationships defined":ve(s,(t=>z(Pl,{relationships:n,relationshipsId:e,relationshipId:t,s:l,key:t}))))},El=({tableId:e,store:l,storeId:n,s:s})=>{var r;const a=ge("t",n,e),[o,i,u]=ae(null!=(r=t.useCell(de,a,ce,s))?r:"[]"),d=t.useSetCellCallback(de,a,ce,re,[],s),[c,m]=fe(a,s);return z(Fe,{uniqueId:a,summary:h+": "+e,editable:c,handleEditable:m,s:s},z(gl,{tableId:e,store:l,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d,editable:c}))},Ll=({store:e,storeId:l,s:n})=>{const s=ge("v",l),[r,a]=fe(s,n);return W(t.useValueIds(e))?null:z(Fe,{uniqueId:s,summary:w,editable:r,handleEditable:a,s:n},z(vl,{store:e,editable:r}))},Ml=({storeId:e,s:l})=>{const n=t.useStore(e),s=t.useTableIds(n);return O(n)?null:z(Fe,{uniqueId:ge("s",e),summary:"Store: "+(null!=e?e:d),s:l},z(Ll,{storeId:e,store:n,s:l}),ve(s,(t=>z(El,{store:n,storeId:e,tableId:t,s:l,key:t}))))},jl=({s:e})=>{const l=F(null),n=F(0),[s,r]=J(!1),{scrollLeft:a,scrollTop:o}=t.useValues(e);A((()=>{const e=l.current;if(e&&!s){const l=new MutationObserver((()=>{e.scrollWidth>=T(a)+e.clientWidth&&e.scrollHeight>=T(o)+e.clientHeight&&e.scrollTo(a,o)}));return l.observe(e,{childList:!0,subtree:!0}),()=>l.disconnect()}}),[s,a,o]);const i=$((l=>{const{scrollLeft:t,scrollTop:s}=l[k];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:t,scrollTop:s})}))}),[e]),u=t.useStore(),d=t.useStoreIds(),c=t.useMetrics(),h=t.useMetricsIds(),m=t.useIndexes(),b=t.useIndexesIds(),p=t.useRelationships(),g=t.useRelationshipsIds(),v=t.useQueries(),f=t.useQueriesIds();return O(u)&&W(d)&&O(c)&&W(h)&&O(m)&&W(b)&&O(p)&&W(g)&&O(v)&&W(f)?z("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the StoreInspector inside a Provider component."):z("article",{ref:l,onScroll:i},z(Ml,{s:e}),H(d,(l=>z(Ml,{storeId:l,s:e,key:l}))),z(Rl,{s:e}),H(h,(l=>z(Rl,{metricsId:l,s:e,key:l}))),z(Tl,{s:e}),H(b,(l=>z(Tl,{indexesId:l,s:e,key:l}))),z(Nl,{s:e}),H(g,(l=>z(Nl,{relationshipsId:l,s:e,key:l}))),z(ql,{s:e}),H(f,(l=>z(ql,{queriesId:l,s:e,key:l}))))};class zl extends M{constructor(e){super(e),this.componentDidCatch=(e,l)=>console.error(e,l.componentStack),this.state={e:0}}render(){return this.state.e?z("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}zl.getDerivedStateFromError=()=>({e:1});const $l=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1,s=t.useSetValueCallback(be,(()=>!1),[],e),r=t.useSetValueCallback(me,(e=>Number(e[k].dataset.id)),[],e);return z("header",null,z("img",{title:ie}),z("span",null,ie),H(ue,((e,l)=>l==n?null:z("img",{onClick:r,"data-id":l,title:"Dock to "+e,key:l}))),z("img",{onClick:s,title:"Close"}))},Al=({s:e})=>{var l;const n=null!=(l=t.useValue(me,e))?l:1;return t.useValue(be,e)?z("main",{"data-position":n},z($l,{s:e}),z(zl,null,z(jl,{s:e}))):null},Fl=e=>l=>{return t=(l,t)=>l+e(t),Ul(l).reduce(t,0);var t},Jl=e=>{var l;return null!=(l=null==e?void 0:e.size)?l:0},Dl=Fl(Jl),Bl=Fl(Dl),Hl=Fl(Bl),Ql=(e,l)=>{var t;return null!=(t=null==e?void 0:e.has(l))&&t},Wl=e=>O(e)||0==Jl(e),Ul=e=>{var l;return[...null!=(l=null==e?void 0:e.values())?l:[]]},Gl=e=>e.clear(),Kl=(e,l)=>null==e?void 0:e.forEach(l),Xl=(e,l)=>null==e?void 0:e.delete(l),Yl=e=>new Map(e),Zl=e=>{var l;return[...null!=(l=null==e?void 0:e.keys())?l:[]]},_l=(e,l)=>null==e?void 0:e.get(l),et=(e,l)=>Kl(e,((e,t)=>l(t,e))),lt=(e,l,t)=>O(t)?(Xl(e,l),e):null==e?void 0:e.set(l,t),tt=(e,l,t)=>(Ql(e,l)||lt(e,l,t()),_l(e,l)),nt=(e,l,t,n=lt)=>(ne(l,((l,n)=>t(e,n,l))),et(e,(t=>le(l,t)?0:n(e,t))),e),st=(e,l,t)=>{const n={};return Kl(e,((e,s)=>{const r=l?l(e,s):e;!(null==t?void 0:t(r,e))&&(n[s]=r)})),n},rt=(e,l,t)=>st(e,(e=>st(e,l,t)),se),at=(e,l,t)=>st(e,(e=>rt(e,l,t)),se),ot=(e,l)=>{const t=Yl();return Kl(e,((e,n)=>{var s;return t.set(n,null!=(s=null==l?void 0:l(e))?s:e)})),t},it=e=>ot(e,ot),ut=e=>ot(e,it),dt=(e,l,t,n,s=0)=>q((t?tt:_l)(e,l[s],s>Q(l)-2?t:Yl),(r=>{if(s>Q(l)-2)return(null==n?void 0:n(r))&&lt(e,l[s]),r;const a=dt(r,l,t,n,s+1);return Wl(r)&&lt(e,l[s]),a}));var ct=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{o(t.next(e))}catch(e){s(e)}},a=e=>{try{o(t.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((t=t.apply(e,l)).next())}));const ht=Yl(),mt=Yl();var bt=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{o(t.next(e))}catch(e){s(e)}},a=e=>{try{o(t.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((t=t.apply(e,l)).next())}));const pt="storage",gt=globalThis.window,vt=e=>new Set(E(e)||O(e)?e:[e]),ft=(e,l)=>null==e?void 0:e.add(l),It=/^\d+$/,yt=()=>{const e=[];let l=0;return[t=>{var n;return null!=(n=t?G(e):null)?n:s+l++},l=>{It.test(l)&&Q(e)<1e3&&U(e,l)}]},wt=e=>[e,e],Ct=(e,l=Dl)=>l(e[0])+l(e[1]),kt=()=>[Yl(),Yl()],xt=e=>[...e],St=([e,l])=>e===l,Tt=(e,l,t)=>O(e)||!_(e)||se(e)||Y(e)?(null==t||t(),!1):(ne(e,((t,n)=>{l(t,n)||te(e,n)})),!se(e)),Vt=(e,l,t)=>lt(e,l,_l(e,l)==-t?void 0:t),Rt=()=>{let e,l,t=!1,n=!1,r=0;const a=Yl(),i=Yl(),c=Yl(),k=Yl(),x=Yl(),T=Yl(),V=Yl(),R=Yl(),E=Yl(),M=Yl(),j=Yl(),z=Yl(),$=Yl(),A=Yl(),F=vt(),J=Yl(),D=Yl(),W=Yl(),G=Yl(),K=kt(),X=kt(),Y=kt(),_=kt(),ee=kt(),oe=kt(),ie=kt(),ue=kt(),de=kt(),ce=kt(),he=kt(),me=kt(),be=kt(),pe=kt(),ge=kt(),ve=Yl(),fe=kt(),[Ie,ye,we,Ce]=(e=>{let l;const[t,n]=yt(),r=Yl();return[(e,n,a,o=[],i=(()=>[]))=>{null!=l||(l=Al);const u=t(1);return lt(r,u,[e,n,a,o,i]),ft(dt(n,null!=a?a:[s],vt),u),u},(e,t,...n)=>B(((e,l=[s])=>{const t=[],n=(e,s)=>s==Q(l)?U(t,e):null===l[s]?Kl(e,(e=>n(e,s+1))):B([l[s],null],(l=>n(_l(e,l),s+1)));return n(e,0),t})(e,t),(e=>Kl(e,(e=>_l(r,e)[0](l,...null!=t?t:[],...n))))),e=>q(_l(r,e),(([,l,t])=>(dt(l,null!=t?t:[s],void 0,(l=>(Xl(l,e),Wl(l)?1:0))),lt(r,e),n(e),t))),e=>q(_l(r,e),(([e,,t=[],n,s])=>{const r=(...a)=>{var o,i;const u=Q(a);u==Q(t)?e(l,...a,...s(a)):O(t[u])?B(null!=(i=null==(o=n[u])?void 0:o.call(n,...a))?i:[],(e=>r(...a,e))):r(...a,t[u])};r()}))]})(),ke=e=>{if(!Tt(e,((e,l)=>[u,d].includes(l))))return!1;const l=e[u];return!(!P(l)&&l!=o||(Je(e[d])!=l&&te(e,d),0))},xe=(l,t)=>(!e||Ql(j,t)||nl(t))&&Tt(l,((e,l)=>Se(t,l,e)),(()=>nl(t))),Se=(e,l,t,n)=>Tt(n?t:Oe(t,e,l),((n,s)=>q(Te(e,l,s,n),(e=>(t[s]=e,!0)),(()=>!1))),(()=>nl(e,l))),Te=(l,t,n,s)=>e?q(_l(_l(j,l),n),(e=>Je(s)!=e[u]?nl(l,t,n,s,e[d]):s),(()=>nl(l,t,n,s))):O(Je(s))?nl(l,t,n,s):s,Ve=(e,l)=>Tt(l?e:qe(e),((l,t)=>q(Re(t,l),(l=>(e[t]=l,!0)),(()=>!1))),(()=>sl())),Re=(e,t)=>l?q(_l($,e),(l=>Je(t)!=l[u]?sl(e,t,l[d]):t),(()=>sl(e,t))):O(Je(t))?sl(e,t):t,Oe=(e,l,t)=>(q(_l(z,l),(([n,s])=>{Kl(n,((l,t)=>{le(e,t)||(e[t]=l)})),Kl(s,(n=>{le(e,n)||nl(l,t,n)}))})),e),qe=e=>(l&&(Kl(A,((l,t)=>{le(e,t)||(e[t]=l)})),Kl(F,(l=>{le(e,l)||sl(l)}))),e),Pe=e=>nt(j,e,((e,l,t)=>{const n=Yl(),s=vt();nt(tt(j,l,Yl),t,((e,l,t)=>{lt(e,l,t),q(t[d],(e=>lt(n,l,e)),(()=>ft(s,l)))})),lt(z,l,[n,s])}),((e,l)=>{lt(j,l),lt(z,l)})),Ne=e=>nt($,e,((e,l,t)=>{lt($,l,t),q(t[d],(e=>lt(A,l,e)),(()=>ft(F,l)))}),((e,l)=>{lt($,l),lt(A,l),Xl(F,l)})),Ee=e=>se(e)?ql():Sl(e),Le=e=>nt(W,e,((e,l,t)=>Me(l,t)),((e,l)=>Ue(l))),Me=(e,l)=>nt(tt(W,e,(()=>(Ye(e,1),lt(J,e,yt()),lt(D,e,Yl()),Yl()))),l,((l,t,n)=>je(e,l,t,n)),((l,t)=>Ge(e,l,t))),je=(e,l,t,n,s)=>nt(tt(l,t,(()=>(Ze(e,t,1),Yl()))),n,((l,n,s)=>ze(e,t,l,n,s)),((n,r)=>Ke(e,l,t,n,r,s))),ze=(e,l,t,n,s)=>{Ql(t,n)||_e(e,l,n,1);const r=_l(t,n);s!==r&&(el(e,l,n,r,s),lt(t,n,s))},$e=(e,l,t,n,s)=>q(_l(l,t),(l=>ze(e,t,l,n,s)),(()=>je(e,l,t,Oe({[n]:s},e,t)))),Ae=e=>se(e)?El():Tl(e),Fe=e=>nt(G,e,((e,l,t)=>He(l,t)),((e,l)=>Xe(l))),He=(e,l)=>{Ql(G,e)||ll(e,1);const t=_l(G,e);l!==t&&(tl(e,t,l),lt(G,e,l))},Qe=(e,l)=>{const[t]=_l(J,e),n=t(l);return Ql(_l(W,e),n)?Qe(e,l):n},We=e=>{var l;return null!=(l=_l(W,e))?l:Me(e,{})},Ue=e=>Me(e,{}),Ge=(e,l,t)=>{const[,n]=_l(J,e);n(t),je(e,l,t,{},!0)},Ke=(e,l,t,n,s,r)=>{var a;const o=_l(null==(a=_l(z,e))?void 0:a[0],s);if(!O(o)&&!r)return ze(e,t,n,s,o);const i=l=>{el(e,t,l,_l(n,l)),_e(e,t,l,-1),lt(n,l)};O(o)?i(s):et(n,i),Wl(n)&&(Ze(e,t,-1),Wl(lt(l,t))&&(Ye(e,-1),lt(W,e),lt(J,e),lt(D,e)))},Xe=e=>{const l=_l(A,e);if(!O(l))return He(e,l);tl(e,_l(G,e)),ll(e,-1),lt(G,e)},Ye=(e,l)=>Vt(a,e,l),Ze=(e,l,t)=>Vt(tt(k,e,Yl),l,t)&&lt(c,e,tt(c,e,(()=>0))+t),_e=(e,l,t,n)=>{var s;const r=_l(D,e),a=null!=(s=_l(r,t))?s:0;(0==a&&1==n||1==a&&-1==n)&&Vt(tt(i,e,Yl),t,n),lt(r,t,a!=-n?a+n:null),Vt(tt(tt(x,e,Yl),l,Yl),t,n)},el=(e,l,t,n,s)=>tt(tt(tt(T,e,Yl),l,Yl),t,(()=>[n,0]))[1]=s,ll=(e,l)=>Vt(V,e,l),tl=(e,l,t)=>tt(R,e,(()=>[l,0]))[1]=t,nl=(e,l,t,n,s)=>(U(tt(tt(tt(E,e,Yl),l,Yl),t,(()=>[])),n),s),sl=(e,l,t)=>(U(tt(M,e,(()=>[])),l),t),rl=(e,l,t)=>q(_l(_l(_l(T,e),l),t),(([e,l])=>[!0,e,l]),(()=>[!1,...wt(wl(e,l,t))])),al=e=>q(_l(R,e),(([e,l])=>[!0,e,l]),(()=>[!1,...wt(xl(e))])),ol=e=>Wl(E)||Wl(he[e])?0:Kl(e?ut(E):E,((l,t)=>Kl(l,((l,n)=>Kl(l,((l,s)=>ye(he[e],[t,n,s],l))))))),il=e=>Wl(M)||Wl(me[e])?0:Kl(e?ot(M):M,((l,t)=>ye(me[e],[t],l))),ul=(e,l,t)=>{if(!Wl(l))return ye(e,t,(()=>st(l))),1},dl=e=>{const l=Wl(ie[e]),t=Wl(de[e])&&Wl(_[e])&&Wl(ee[e])&&Wl(oe[e])&&l&&Wl(X[e]),n=Wl(ce[e])&&Wl(ue[e])&&Wl(Y[e])&&Wl(K[e]);if(!t||!n){const s=e?[ot(a),it(i),ot(c),it(k),ut(x),ut(T)]:[a,i,c,k,x,T];if(!t){ul(X[e],s[0]),Kl(s[1],((l,t)=>ul(_[e],l,[t]))),Kl(s[2],((l,t)=>{0!=l&&ye(ee[e],[t],vl(t))}));const t=vt();Kl(s[3],((n,s)=>{ul(oe[e],n,[s])&&!l&&(ye(ie[e],[s,null]),ft(t,s))})),l||Kl(s[5],((l,n)=>{if(!Ql(t,n)){const t=vt();Kl(l,(e=>Kl(e,(([l,n],s)=>n!==l?ft(t,s):Xl(e,s))))),Kl(t,(l=>ye(ie[e],[n,l])))}})),Kl(s[4],((l,t)=>Kl(l,((l,n)=>ul(de[e],l,[t,n])))))}if(!n){let l;Kl(s[5],((t,n)=>{let s;Kl(t,((t,r)=>{let a;Kl(t,(([t,o],i)=>{o!==t&&(ye(ce[e],[n,r,i],o,t,rl),l=s=a=1)})),a&&ye(ue[e],[n,r],rl)})),s&&ye(Y[e],[n],rl)})),l&&ye(K[e],void 0,rl)}}},cl=e=>{const l=Wl(pe[e]),t=Wl(ge[e])&&Wl(be[e]);if(!l||!t){const n=e?[ot(V),ot(R)]:[V,R];if(l||ul(pe[e],n[0]),!t){let l;Kl(n[1],(([t,n],s)=>{n!==t&&(ye(ge[e],[s],n,t,al),l=1)})),l&&ye(be[e],void 0,al)}}},hl=(e,...l)=>(jl((()=>e(...H(l,S)))),Al),ml=()=>[st(T,((e,l)=>-1===_l(a,l)?null:st(e,((e,t)=>-1===_l(_l(k,l),t)?null:st(e,(([,e])=>null!=e?e:null),((e,l)=>St(l)))),se)),se),st(R,(([,e])=>null!=e?e:null),((e,l)=>St(l)))],bl=()=>({cellsTouched:t,valuesTouched:n,changedCells:at(T,xt,St),invalidCells:at(E),changedValues:st(R,xt,St),invalidValues:st(M),changedTableIds:st(a),changedRowIds:rt(k),changedCellIds:at(x),changedValueIds:st(V)}),pl=()=>at(W),gl=()=>Zl(W),vl=e=>Jl(_l(W,S(e))),fl=e=>Zl(_l(W,S(e))),Il=(e,l,t,n=0,s)=>{return H(L((a=_l(W,S(e)),o=(e,t)=>[O(l)?t:_l(e,S(l)),t],r=([e],[l])=>{return((null!=(n=e)?n:0)<(null!=(s=l)?s:0)?-1:1)*(t?-1:1);var n,s},H([...null!=(i=null==a?void 0:a.entries())?i:[]],(([e,l])=>o(l,e))).sort(r)),n,O(s)?s:n+s),(([,e])=>e));var r,a,o,i},yl=(e,l)=>Zl(_l(_l(W,S(e)),S(l))),wl=(e,l,t)=>_l(_l(_l(W,S(e)),S(l)),S(t)),Cl=()=>st(G),kl=()=>Zl(G),xl=e=>_l(G,S(e)),Sl=e=>hl((()=>(e=>Tt(e,xe,nl))(e)?Le(e):0)),Tl=e=>hl((()=>Ve(e)?Fe(e):0)),Vl=e=>{try{Ee(ae(e))}catch(e){}return Al},Rl=l=>hl((()=>{if((e=Tt(l,(e=>Tt(e,ke))))&&(Pe(l),!Wl(W))){const e=pl();ql(),Sl(e)}})),Ol=e=>hl((()=>{if(l=(e=>Tt(e,ke))(e)){const t=Cl();Ml(),El(),l=!0,Ne(e),Tl(t)}})),ql=()=>hl((()=>Le({}))),Pl=e=>hl((e=>Ql(W,e)?Ue(e):0),e),Nl=(e,l)=>hl(((e,l)=>q(_l(W,e),(t=>Ql(t,l)?Ge(e,t,l):0))),e,l),El=()=>hl((()=>Fe({}))),Ll=()=>hl((()=>{Pe({}),e=!1})),Ml=()=>hl((()=>{Ne({}),l=!1})),jl=(e,l)=>{if(-1!=r){zl();const t=e();return $l(l),t}},zl=()=>(-1!=r&&r++,1==r&&ye(ve,void 0,ml,bl),Al),$l=e=>(r>0&&(r--,0==r&&(t=!Wl(T),n=!Wl(R),r=1,ol(1),t&&dl(1),il(1),n&&cl(1),(null==e?void 0:e(ml,bl))&&(Kl(T,((e,l)=>Kl(e,((e,t)=>Kl(e,(([e],n)=>De(Al,l,t,n,e))))))),Kl(R,(([e],l)=>Be(Al,l,e))),t=n=!1),ye(fe[0],void 0,ml,bl),r=-1,ol(0),t&&dl(0),il(0),n&&cl(0),ye(fe[1],void 0,ml,bl),r=0,t=n=!1,B([a,i,c,k,x,T,E,V,R,M],Gl))),Al),Al={getContent:()=>[pl(),Cl()],getTables:pl,getTableIds:gl,getTable:e=>rt(_l(W,S(e))),getTableCellIds:e=>Zl(_l(D,S(e))),getRowCount:vl,getRowIds:fl,getSortedRowIds:Il,getRow:(e,l)=>st(_l(_l(W,S(e)),S(l))),getCellIds:yl,getCell:wl,getValues:Cl,getValueIds:kl,getValue:xl,hasTables:()=>!Wl(W),hasTable:e=>Ql(W,S(e)),hasTableCell:(e,l)=>Ql(_l(D,S(e)),S(l)),hasRow:(e,l)=>Ql(_l(W,S(e)),S(l)),hasCell:(e,l,t)=>Ql(_l(_l(W,S(e)),S(l)),S(t)),hasValues:()=>!Wl(G),hasValue:e=>Ql(G,S(e)),getTablesJson:()=>re(W),getValuesJson:()=>re(G),getJson:()=>re([W,G]),getTablesSchemaJson:()=>re(j),getValuesSchemaJson:()=>re($),getSchemaJson:()=>re([j,$]),hasTablesSchema:()=>e,hasValuesSchema:()=>l,setContent:([e,l])=>hl((()=>{(se(e)?ql:Sl)(e),(se(l)?El:Tl)(l)})),setTables:Sl,setTable:(e,l)=>hl((e=>xe(l,e)?Me(e,l):0),e),setRow:(e,l,t)=>hl(((e,l)=>Se(e,l,t)?je(e,We(e),l,t):0),e,l),addRow:(e,l,t=!0)=>jl((()=>{let n;return Se(e,n,l)&&(e=S(e),je(e,We(e),n=Qe(e,t?1:0),l)),n})),setPartialRow:(e,l,t)=>hl(((e,l)=>{if(Se(e,l,t,1)){const n=We(e);ne(t,((t,s)=>$e(e,n,l,s,t)))}}),e,l),setCell:(e,l,t,n)=>hl(((e,l,t)=>q(Te(e,l,t,N(n)?n(wl(e,l,t)):n),(n=>$e(e,We(e),l,t,n)))),e,l,t),setValues:Tl,setPartialValues:e=>hl((()=>Ve(e,1)?ne(e,((e,l)=>He(l,e))):0)),setValue:(e,l)=>hl((e=>q(Re(e,N(l)?l(xl(e)):l),(l=>He(e,l)))),e),setTransactionChanges:e=>hl((()=>{ne(e[0],((e,l)=>O(e)?Pl(l):ne(e,((e,t)=>O(e)?Nl(l,t):ne(e,((e,n)=>De(Al,l,t,n,e))))))),ne(e[1],((e,l)=>Be(Al,l,e)))})),setTablesJson:Vl,setValuesJson:e=>{try{Ae(ae(e))}catch(e){}return Al},setJson:e=>hl((()=>{try{const[l,t]=ae(e);Ee(l),Ae(t)}catch(l){Vl(e)}})),setTablesSchema:Rl,setValuesSchema:Ol,setSchema:(e,l)=>hl((()=>{Rl(e),Ol(l)})),delTables:ql,delTable:Pl,delRow:Nl,delCell:(e,l,t,n)=>hl(((e,l,t)=>q(_l(W,e),(s=>q(_l(s,l),(r=>Ql(r,t)?Ke(e,s,l,r,t,n):0))))),e,l,t),delValues:El,delValue:e=>hl((e=>Ql(G,e)?Xe(e):0),e),delTablesSchema:Ll,delValuesSchema:Ml,delSchema:()=>hl((()=>{Ll(),Ml()})),transaction:jl,startTransaction:zl,finishTransaction:$l,forEachTable:e=>Kl(W,((l,t)=>e(t,(e=>Kl(l,((l,t)=>e(t,(e=>et(l,e))))))))),forEachTableCell:(e,l)=>et(_l(D,S(e)),l),forEachRow:(e,l)=>Kl(_l(W,S(e)),((e,t)=>l(t,(l=>et(e,l))))),forEachCell:(e,l,t)=>et(_l(_l(W,S(e)),S(l)),t),forEachValue:e=>et(G,e),addSortedRowIdsListener:(e,l,t,n,s,r,a)=>{let o=Il(e,l,t,n,s);return Ie((()=>{const a=Il(e,l,t,n,s);var i,u,d;u=o,Q(i=a)===Q(u)&&(d=(e,l)=>u[l]===e,i.every(d))||(o=a,r(Al,e,l,t,n,s,o))}),ie[a?1:0],[e,l],[gl])},addStartTransactionListener:e=>Ie(e,ve),addWillFinishTransactionListener:e=>Ie(e,fe[0]),addDidFinishTransactionListener:e=>Ie(e,fe[1]),callListener:e=>(Ce(e),Al),delListener:e=>(we(e),Al),getListenerStats:()=>({tables:Ct(K),tableIds:Ct(X),tableCellIds:Ct(_),table:Ct(Y),rowCount:Ct(ee),rowIds:Ct(oe),sortedRowIds:Ct(ie),row:Ct(ue,Bl),cellIds:Ct(de,Bl),cell:Ct(ce,Hl),invalidCell:Ct(he,Hl),values:Ct(be),valueIds:Ct(pe),value:Ct(ge),invalidValue:Ct(me),transaction:Dl(ve)+Ct(fe)}),createStore:Rt,addListener:Ie,callListeners:ye};return ne({[m]:[0,K],[b]:[0,X],[h]:[1,Y,[gl]],[h+I]:[1,_,[gl]],[g]:[1,ee,[gl]],[v]:[1,oe,[gl]],[p]:[2,ue,[gl,fl]],[I]:[2,de,[gl,fl]],[f]:[3,ce,[gl,fl,yl],e=>wt(wl(...e))],InvalidCell:[3,he],[w]:[0,be],[C]:[0,pe],[y]:[1,ge,[kl],e=>wt(xl(e[0]))],InvalidValue:[1,me]},(([e,l,t,n],s)=>{Al["add"+s+"Listener"]=(...s)=>Ie(s[e],l[s[e+1]?1:0],e>0?L(s,0,e):void 0,t,n)})),Z(Al)},Ot=({position:e="right",open:l=!1})=>{const n=t.useCreateStore(Rt),s=ue.indexOf(e);return t.useCreatePersister(n,(e=>{return((e,l,t,n)=>((e,l,t,n,s,r,a=[])=>{let o,i,u,d=0,c=0,h=0,m=0;tt(ht,a,(()=>0)),tt(mt,a,(()=>[]));const b=e=>ct(void 0,null,(function*(){return 2!=d&&(d=1,c++,yield p.schedule((()=>ct(void 0,null,(function*(){yield e(),d=0}))))),p})),p={load:(t,n)=>ct(void 0,null,(function*(){return yield b((()=>ct(void 0,null,(function*(){try{e.setContent(yield l())}catch(l){e.setContent([t,n])}}))))})),startAutoLoad:(...t)=>ct(void 0,[...t],(function*(t={},s={}){return p.stopAutoLoad(),yield p.load(t,s),m=1,u=n(((t,n)=>ct(void 0,null,(function*(){if(n){const l=n();yield b((()=>ct(void 0,null,(function*(){return e.setTransactionChanges(l)}))))}else yield b((()=>ct(void 0,null,(function*(){var n;try{e.setContent(null!=(n=null==t?void 0:t())?n:yield l())}catch(e){null==r||r(e)}}))))})))),p})),stopAutoLoad:()=>(m&&(s(u),u=void 0,m=0),p),save:l=>ct(void 0,null,(function*(){return 1!=d&&(d=2,h++,yield p.schedule((()=>ct(void 0,null,(function*(){try{yield t(e.getContent,l)}catch(e){null==r||r(e)}d=0}))))),p})),startAutoSave:()=>ct(void 0,null,(function*(){return yield p.stopAutoSave().save(),o=e.addDidFinishTransactionListener(((e,l)=>{const[t,n]=l();se(t)&&se(n)||p.save((()=>[t,n]))})),p})),stopAutoSave:()=>(q(o,e.delListener),p),schedule:(...e)=>ct(void 0,null,(function*(){return U(_l(mt,a),...e),yield ct(void 0,null,(function*(){if(!_l(ht,a)){for(lt(ht,a,1);!O(i=G(_l(mt,a)));)try{yield i()}catch(e){null==r||r(e)}lt(ht,a,0)}})),p})),getStore:()=>e,destroy:()=>p.stopAutoLoad().stopAutoSave(),getStats:()=>({loads:c,saves:h})};return Z(p)})(e,(()=>bt(void 0,null,(function*(){return ae(t.getItem(l))}))),(e=>bt(void 0,null,(function*(){return t.setItem(l,re(e()))}))),(e=>{const n=n=>{n.storageArea===t&&n.key===l&&e((()=>ae(n.newValue)))};return gt.addEventListener(pt,n),n}),(e=>gt.removeEventListener(pt,e)),n))(e,oe,sessionStorage,l);var l}),void 0,(e=>{return t=function*(){yield e.load(void 0,{position:-1==s?1:s,open:!!l}),yield e.startAutoSave()},new Promise(((e,l)=>{var n=e=>{try{r(t.next(e))}catch(e){l(e)}},s=e=>{try{r(t.throw(e))}catch(e){l(e)}},r=l=>l.done?e(l.value):Promise.resolve(l.value).then(n,s);r((t=t.apply(void 0,null)).next())}));var t})),z(j,null,z("aside",{id:oe},z(Ae,{s:n}),z(Al,{s:n})),z("style",null,$e))};var qt=Object.defineProperty,Pt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Lt=(e,l,t)=>l in e?qt(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t;e.EditableCellView=wl,e.EditableValueView=Cl,e.RelationshipInHtmlTable=Il,e.ResultSortedTableInHtmlTable=yl,e.ResultTableInHtmlTable=e=>{var l=e,{queryId:n,queries:s,customCells:r}=l,a=el(l,["queryId","queries","customCells"]);return z(hl,_e(Ze({},a),{params:ol(cl(t.useResultTableCellIds(n,s),r,t.ResultCellView),ul(s,n),t.useResultRowIds(n,s))}))},e.SliceInHtmlTable=fl,e.SortedTableInHtmlTable=gl,e.SortedTablePaginator=kl,e.StoreInspector=e=>z(Ot,((e,l)=>{for(var t in l||(l={}))Nt.call(l,t)&&Lt(e,t,l[t]);if(Pt)for(var t of Pt(l))Et.call(l,t)&&Lt(e,t,l[t]);return e})({},e)),e.TableInHtmlTable=e=>{var l=e,{tableId:n,store:s,editable:r,customCells:a}=l,o=el(l,["tableId","store","editable","customCells"]);return z(hl,_e(Ze({},o),{params:ol(cl(t.useTableCellIds(n,s),a,r?wl:t.CellView),il(s,n),t.useRowIds(n,s))}))},e.ValuesInHtmlTable=vl},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDomDebug={},e.React,e.TinyBaseUiReact);
@@ -1 +1 @@
1
- var e,t;e=this,t=function(e,t,l){"use strict";const r=e=>typeof e,a=r(""),n=r(!0),o=r(0),s="Value",i="currentTarget",d="value",u=isFinite,c=e=>null==e,{PureComponent:m,Fragment:h,createElement:b,useCallback:p,useLayoutEffect:g,useRef:f,useState:w}=t,v=(e,...t)=>c(e)?{}:e(...t),y=(e,t)=>e.map(t),I=Object,C=(e=[])=>I.fromEntries(e),k=(e,t)=>y(I.entries(e),(([e,l])=>t(l,e))),x="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",R='content:url("',O=R+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",T='</svg>")',S=R+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",N=y([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,r])=>O+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${r}' fill='white'/>`+T)),V=O+"<path d='M20 20l60 60M20 80l60-60' />"+T,j=O+`<path d='${x}' />`+T,P=O+`<path d='${x}M20 20l60 60' />`+T;var z=Object.defineProperty,q=Object.defineProperties,M=Object.getOwnPropertyDescriptors,$=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,F=(e,t,l)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,H=(e,t)=>{for(var l in t||(t={}))B.call(t,l)&&F(e,l,t[l]);if($)for(var l of $(t))E.call(t,l)&&F(e,l,t[l]);return e},D=(e,t)=>q(e,M(t));const A="*::-webkit-scrollbar";((e,t="")=>{e.join(t)})(k(D(H(D(H(D(H({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[A]:"width:0.5rem;height:0.5rem;",[A+"-track"]:"background:#111",[A+"-thumb"]:"background:#999;border:1px solid #111",[A+"-thumb:hover"]:"background:#fff",[A+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+S},C(y(["bottom:0;left:0","top:0;right:0"],((e,t)=>[`>img[data-position='${t}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),C(y(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,t)=>[`main[data-position='${t}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":S,"header>img:nth-of-type(6)":V}),C(y(N,((e,t)=>[`header>img[data-id='${t}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":j,"details[open]>summary img.done":P,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,t)=>e?`& ${t}{${e}}`:"")));const L=(e,t,l,r)=>e==a?t:e==o?l:r;var U=Object.defineProperty,G=Object.defineProperties,J=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,X=(e,t,l)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Y=(e,t)=>{for(var l in t||(t={}))Q.call(t,l)&&X(e,l,t[l]);if(K)for(var l of K(t))W.call(t,l)&&X(e,l,t[l]);return e},Z=(e,t)=>G(e,J(t)),_=(e,t)=>{var l={};for(var r in e)Q.call(e,r)&&t.indexOf(r)<0&&(l[r]=e[r]);if(null!=e&&K)for(var r of K(e))t.indexOf(r)<0&&W.call(e,r)&&(l[r]=e[r]);return l};const{useCallback:ee,useMemo:te,useState:le}=t,re="editable",ae=(e,t)=>y(l.useTableCellIds(e,t),(t=>e+"."+t)),ne=(e,t,l)=>{const r=ee(e,t);return l?r:void 0},oe=(...e)=>te((()=>e),e),se=(e,t)=>te((()=>({store:e,tableId:t})),[e,t]),ie=(e,t)=>te((()=>({queries:e,queryId:t})),[e,t]),de=(e,t=!1,l,r=0,a,n,o,s)=>{const[[i,d,u],c]=le([e,t,r]),m=ee((e=>{c(e),null==s||s(e)}),[s]),h=ne((e=>m([e,e==i&&!d,u])),[m,i,d,u],l),p=ee((e=>m([i,d,e])),[m,i,d]),g=!0===o?fe:o;return[[i,d,u],h,te((()=>!1===o?null:b(g,{offset:u,limit:a,total:n,onChange:p})),[o,g,u,a,n,p])]},ue=(e,t,l)=>te((()=>{const n=null!=t?t:e;return C(k(Array.isArray(n)?C(y(n,(e=>[e,e]))):n,((e,t)=>{return[t,Y(Y({},{label:t,component:l}),(n=e,r(n)==a?{label:e}:e))];var n})))}),[t,l,e]),ce=({className:e,headerRow:t,idColumn:l,params:[r,a,n,o,s,i]})=>b("table",{className:e},i?b("caption",null,i):null,!1===t?null:b("thead",null,b("tr",null,!1===l?null:b(me,{sort:null!=o?o:[],label:"Id",onClick:s}),k(r,(({label:e},t)=>b(me,{key:t,cellId:t,label:e,sort:null!=o?o:[],onClick:s}))))),b("tbody",null,y(n,(e=>b("tr",{key:e},!1===l?null:b("th",null,e),k(r,(({component:t,getComponentProps:l},r)=>b("td",{key:r},b(t,Z(Y(Y({},v(l,e,r)),a),{rowId:e,cellId:r})))))))))),me=({cellId:e,sort:[t,l],label:r=(null!=e?e:""),onClick:a})=>b("th",{onClick:ne((()=>null==a?void 0:a(e)),[a,e],a),className:c(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},c(l)||t!=e?null:(l?"↓":"↑")+" ",r),he=({localRowId:e,params:[r,a,n,o,s,i,d]})=>{const u=l.useRemoteRowId(s,e,i);return b("tr",null,!1===r?null:b(t.Fragment,null,b("th",null,e),b("th",null,u)),k(a,(({component:t,getComponentProps:l},r)=>{const[a,s]=r.split(".",2),i=a===n?e:a===o?u:null;return c(i)?null:b("td",{key:r},b(t,Z(Y({},v(l,i,s)),{store:d,tableId:a,rowId:i,cellId:s})))})))},be=({thing:e,onThingChange:t,className:l,hasSchema:s})=>{const[c,m]=le(),[h,p]=le(),[g,f]=le(),[w,v]=le(),[y,I]=le();h!==e&&(m((e=>{const t=r(e);return(e=>e==a||e==n)(t)||t==o&&u(e)?t:void 0})(e)),p(e),f(e+""),v(Number(e)||0),I(!!e));const C=ee(((e,l)=>{l(e),p(e),t(e)}),[t]);return b("div",{className:l},b("button",{className:c,onClick:ee((()=>{if(!(null==s?void 0:s())){const e=L(c,o,n,a),l=L(e,g,w,y);m(e),p(l),t(l)}}),[s,t,g,w,y,c])},c),L(c,b("input",{key:c,value:g,onChange:ee((e=>C(e[i][d]+"",f)),[C])}),b("input",{key:c,type:"number",value:w,onChange:ee((e=>C(Number(e[i][d]||0),v)),[C])}),b("input",{key:c,type:"checkbox",checked:y,onChange:ee((e=>C(!!e[i].checked,I)),[C])})))},pe=({tableId:e,rowId:t,cellId:r,store:a,className:n})=>{var o;return b(be,{thing:l.useCell(e,t,r,a),onThingChange:l.useSetCellCallback(e,t,r,(e=>e),[],a),className:null!=n?n:re+"Cell",hasSchema:null==(o=l.useStoreOrStoreById(a))?void 0:o.hasTablesSchema})},ge=({valueId:e,store:t,className:r})=>{var a;return b(be,{thing:l.useValue(e,t),onThingChange:l.useSetValueCallback(e,(e=>e),[],t),className:null!=r?r:re+s,hasSchema:null==(a=l.useStoreOrStoreById(t))?void 0:a.hasValuesSchema})},fe=({onChange:e,total:l,offset:r=0,limit:a=l,singular:n="row",plural:o=n+"s"})=>{(r>l||r<0)&&(r=0,e(0));const s=ne((()=>e(r-a)),[e,r,a],r>0),i=ne((()=>e(r+a)),[e,r,a],r+a<l);return b(t.Fragment,null,l>a&&b(t.Fragment,null,b("button",{className:"previous",disabled:0==r,onClick:s},"←"),b("button",{className:"next",disabled:r+a>=l,onClick:i},"→"),r+1," to ",Math.min(l,r+a)," of "),l," ",1!=l?o:n)};var we=Object.defineProperty,ve=(e,t,l)=>(((e,t,l)=>{t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l})(e,"symbol"!=typeof t?t+"":t,l),l);ve(class extends m{constructor(e){super(e),ve(this,"componentDidCatch",((e,t)=>console.error(e,t.componentStack))),this.state={e:0}}render(){return this.state.e?b("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}},"getDerivedStateFromError",(()=>({e:1})));const ye=e=>new Map(e);ye(),ye(),e.EditableCellView=pe,e.EditableValueView=ge,e.RelationshipInHtmlTable=({relationshipId:e,relationships:r,editable:a,customCells:n,className:o,headerRow:s,idColumn:i=!0})=>{const[d,u,c,m]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)])(l.useRelationshipsOrRelationshipsById(r),e),h=ue([...ae(c,u),...ae(m,u)],n,a?pe:l.CellView),p=oe(i,h,c,m,e,d,u);return b("table",{className:o},!1===s?null:b("thead",null,b("tr",null,!1===i?null:b(t.Fragment,null,b("th",null,c,".Id"),b("th",null,m,".Id")),k(h,(({label:e},t)=>b("th",{key:t},e))))),b("tbody",null,y(l.useRowIds(c,u),(e=>b(he,{key:e,localRowId:e,params:p})))))},e.ResultSortedTableInHtmlTable=e=>{var t=e,{queryId:r,cellId:a,descending:n,offset:o,limit:s,queries:i,sortOnClick:d,paginator:u=!1,customCells:c,onChange:m}=t,h=_(t,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[p,g,f]=de(a,n,d,o,s,l.useResultRowCount(r,i),u,m);return b(ce,Z(Y({},h),{params:oe(ue(l.useResultTableCellIds(r,i),c,l.ResultCellView),ie(i,r),l.useResultSortedRowIds(r,...p,s,i),p,g,f)}))},e.ResultTableInHtmlTable=e=>{var t=e,{queryId:r,queries:a,customCells:n}=t,o=_(t,["queryId","queries","customCells"]);return b(ce,Z(Y({},o),{params:oe(ue(l.useResultTableCellIds(r,a),n,l.ResultCellView),ie(a,r),l.useResultRowIds(r,a))}))},e.SliceInHtmlTable=e=>{var t=e,{indexId:r,sliceId:a,indexes:n,editable:o,customCells:s}=t,i=_(t,["indexId","sliceId","indexes","editable","customCells"]);const[d,u,c]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(l.useIndexesOrIndexesById(n),r);return b(ce,Z(Y({},i),{params:oe(ue(l.useTableCellIds(c,u),s,o?pe:l.CellView),se(u,c),l.useSliceRowIds(r,a,d))}))},e.SortedTableInHtmlTable=e=>{var t=e,{tableId:r,cellId:a,descending:n,offset:o,limit:s,store:i,editable:d,sortOnClick:u,paginator:c=!1,onChange:m,customCells:h}=t,p=_(t,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[g,f,w]=de(a,n,u,o,s,l.useRowCount(r,i),c,m);return b(ce,Z(Y({},p),{params:oe(ue(l.useTableCellIds(r,i),h,d?pe:l.CellView),se(i,r),l.useSortedRowIds(r,...g,s,i),g,f,w)}))},e.SortedTablePaginator=fe,e.StoreInspector=e=>null,e.TableInHtmlTable=e=>{var t=e,{tableId:r,store:a,editable:n,customCells:o}=t,s=_(t,["tableId","store","editable","customCells"]);return b(ce,Z(Y({},s),{params:oe(ue(l.useTableCellIds(r,a),o,n?pe:l.CellView),se(a,r),l.useRowIds(r,a))}))},e.ValuesInHtmlTable=({store:e,editable:t=!1,valueComponent:r=(t?ge:l.ValueView),getValueComponentProps:a,className:n,headerRow:o,idColumn:i})=>b("table",{className:n},!1===o?null:b("thead",null,b("tr",null,!1===i?null:b("th",null,"Id"),b("th",null,s))),b("tbody",null,y(l.useValueIds(e),(t=>b("tr",{key:t},!1===i?null:b("th",null,t),b("td",null,b(r,Z(Y({},v(a,t)),{valueId:t,store:e}))))))))},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDom={},e.React,e.TinyBaseUiReact);
1
+ var e,t;e=this,t=function(e,t,l){"use strict";const r=e=>typeof e,a=r(""),n=r(!0),o=r(0),s="Value",i="currentTarget",d="value",u=isFinite,c=e=>null==e,{PureComponent:m,Fragment:h,createElement:b,useCallback:p,useLayoutEffect:g,useRef:f,useState:w}=t,v=(e,...t)=>c(e)?{}:e(...t),I=(e,t)=>e.map(t),y=Object,C=(e=[])=>y.fromEntries(e),k=(e,t)=>I(y.entries(e),(([e,l])=>t(l,e))),x="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",R='content:url("',T=R+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",O='</svg>")',S=R+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",N=I([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,r])=>T+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${r}' fill='white'/>`+O)),V=T+"<path d='M20 20l60 60M20 80l60-60' />"+O,j=T+`<path d='${x}' />`+O,P=T+`<path d='${x}M20 20l60 60' />`+O;var z=Object.defineProperty,q=Object.defineProperties,M=Object.getOwnPropertyDescriptors,$=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,F=(e,t,l)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,H=(e,t)=>{for(var l in t||(t={}))B.call(t,l)&&F(e,l,t[l]);if($)for(var l of $(t))E.call(t,l)&&F(e,l,t[l]);return e},D=(e,t)=>q(e,M(t));const A="*::-webkit-scrollbar";((e,t="")=>{e.join(t)})(k(D(H(D(H(D(H({"*":"all:revert","*::before":"all:revert","*::after":"all:revert",[A]:"width:0.5rem;height:0.5rem;",[A+"-track"]:"background:#111",[A+"-thumb"]:"background:#999;border:1px solid #111",[A+"-thumb:hover"]:"background:#fff",[A+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+S},C(I(["bottom:0;left:0","top:0;right:0"],((e,t)=>[`>img[data-position='${t}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),C(I(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,t)=>[`main[data-position='${t}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":S,"header>img:nth-of-type(6)":V}),C(I(N,((e,t)=>[`header>img[data-id='${t}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":j,"details[open]>summary img.done":P,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem","th,td":"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,t)=>e?`& ${t}{${e}}`:"")));const L=(e,t,l,r)=>e==a?t:e==o?l:r;var U=Object.defineProperty,G=Object.defineProperties,J=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,Q=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,X=(e,t,l)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Y=(e,t)=>{for(var l in t||(t={}))Q.call(t,l)&&X(e,l,t[l]);if(K)for(var l of K(t))W.call(t,l)&&X(e,l,t[l]);return e},Z=(e,t)=>G(e,J(t)),_=(e,t)=>{var l={};for(var r in e)Q.call(e,r)&&t.indexOf(r)<0&&(l[r]=e[r]);if(null!=e&&K)for(var r of K(e))t.indexOf(r)<0&&W.call(e,r)&&(l[r]=e[r]);return l};const{useCallback:ee,useMemo:te,useState:le}=t,re="editable",ae=(e,t)=>I(l.useTableCellIds(e,t),(t=>e+"."+t)),ne=(e,t,l)=>{const r=ee(e,t);return l?r:void 0},oe=(...e)=>te((()=>e),e),se=(e,t)=>te((()=>({store:e,tableId:t})),[e,t]),ie=(e,t)=>te((()=>({queries:e,queryId:t})),[e,t]),de=(e,t=!1,l,r=0,a,n,o,s)=>{const[[i,d,u],c]=le([e,t,r]),m=ee((e=>{c(e),null==s||s(e)}),[s]),h=ne((e=>m([e,e==i&&!d,u])),[m,i,d,u],l),p=ee((e=>m([i,d,e])),[m,i,d]),g=!0===o?fe:o;return[[i,d,u],h,te((()=>!1===o?null:b(g,{offset:u,limit:a,total:n,onChange:p})),[o,g,u,a,n,p])]},ue=(e,t,l)=>te((()=>{const n=null!=t?t:e;return C(k(Array.isArray(n)?C(I(n,(e=>[e,e]))):n,((e,t)=>{return[t,Y(Y({},{label:t,component:l}),(n=e,r(n)==a?{label:e}:e))];var n})))}),[t,l,e]),ce=({className:e,headerRow:t,idColumn:l,params:[r,a,n,o,s,i]})=>b("table",{className:e},i?b("caption",null,i):null,!1===t?null:b("thead",null,b("tr",null,!1===l?null:b(me,{sort:null!=o?o:[],label:"Id",onClick:s}),k(r,(({label:e},t)=>b(me,{key:t,cellId:t,label:e,sort:null!=o?o:[],onClick:s}))))),b("tbody",null,I(n,(e=>b("tr",{key:e},!1===l?null:b("th",null,e),k(r,(({component:t,getComponentProps:l},r)=>b("td",{key:r},b(t,Z(Y(Y({},v(l,e,r)),a),{rowId:e,cellId:r})))))))))),me=({cellId:e,sort:[t,l],label:r=(null!=e?e:""),onClick:a})=>b("th",{onClick:ne((()=>null==a?void 0:a(e)),[a,e],a),className:c(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},c(l)||t!=e?null:(l?"↓":"↑")+" ",r),he=({localRowId:e,params:[r,a,n,o,s,i,d]})=>{const u=l.useRemoteRowId(s,e,i);return b("tr",null,!1===r?null:b(t.Fragment,null,b("th",null,e),b("th",null,u)),k(a,(({component:t,getComponentProps:l},r)=>{const[a,s]=r.split(".",2),i=a===n?e:a===o?u:null;return c(i)?null:b("td",{key:r},b(t,Z(Y({},v(l,i,s)),{store:d,tableId:a,rowId:i,cellId:s})))})))},be=({thing:e,onThingChange:t,className:l,hasSchema:s})=>{const[c,m]=le(),[h,p]=le(),[g,f]=le(),[w,v]=le(),[I,y]=le();h!==e&&(m((e=>{const t=r(e);return(e=>e==a||e==n)(t)||t==o&&u(e)?t:void 0})(e)),p(e),f(e+""),v(Number(e)||0),y(!!e));const C=ee(((e,l)=>{l(e),p(e),t(e)}),[t]);return b("div",{className:l},b("button",{className:c,onClick:ee((()=>{if(!(null==s?void 0:s())){const e=L(c,o,n,a),l=L(e,g,w,I);m(e),p(l),t(l)}}),[s,t,g,w,I,c])},c),L(c,b("input",{key:c,value:g,onChange:ee((e=>C(e[i][d]+"",f)),[C])}),b("input",{key:c,type:"number",value:w,onChange:ee((e=>C(Number(e[i][d]||0),v)),[C])}),b("input",{key:c,type:"checkbox",checked:I,onChange:ee((e=>C(!!e[i].checked,y)),[C])})))},pe=({tableId:e,rowId:t,cellId:r,store:a,className:n})=>{var o;return b(be,{thing:l.useCell(e,t,r,a),onThingChange:l.useSetCellCallback(e,t,r,(e=>e),[],a),className:null!=n?n:re+"Cell",hasSchema:null==(o=l.useStoreOrStoreById(a))?void 0:o.hasTablesSchema})},ge=({valueId:e,store:t,className:r})=>{var a;return b(be,{thing:l.useValue(e,t),onThingChange:l.useSetValueCallback(e,(e=>e),[],t),className:null!=r?r:re+s,hasSchema:null==(a=l.useStoreOrStoreById(t))?void 0:a.hasValuesSchema})},fe=({onChange:e,total:l,offset:r=0,limit:a=l,singular:n="row",plural:o=n+"s"})=>{(r>l||r<0)&&(r=0,e(0));const s=ne((()=>e(r-a)),[e,r,a],r>0),i=ne((()=>e(r+a)),[e,r,a],r+a<l);return b(t.Fragment,null,l>a&&b(t.Fragment,null,b("button",{className:"previous",disabled:0==r,onClick:s},"←"),b("button",{className:"next",disabled:r+a>=l,onClick:i},"→"),r+1," to ",Math.min(l,r+a)," of "),l," ",1!=l?o:n)};(class extends m{constructor(e){super(e),this.componentDidCatch=(e,t)=>console.error(e,t.componentStack),this.state={e:0}}render(){return this.state.e?b("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}).getDerivedStateFromError=()=>({e:1});const we=e=>new Map(e);we(),we(),e.EditableCellView=pe,e.EditableValueView=ge,e.RelationshipInHtmlTable=({relationshipId:e,relationships:r,editable:a,customCells:n,className:o,headerRow:s,idColumn:i=!0})=>{const[d,u,c,m]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)])(l.useRelationshipsOrRelationshipsById(r),e),h=ue([...ae(c,u),...ae(m,u)],n,a?pe:l.CellView),p=oe(i,h,c,m,e,d,u);return b("table",{className:o},!1===s?null:b("thead",null,b("tr",null,!1===i?null:b(t.Fragment,null,b("th",null,c,".Id"),b("th",null,m,".Id")),k(h,(({label:e},t)=>b("th",{key:t},e))))),b("tbody",null,I(l.useRowIds(c,u),(e=>b(he,{key:e,localRowId:e,params:p})))))},e.ResultSortedTableInHtmlTable=e=>{var t=e,{queryId:r,cellId:a,descending:n,offset:o,limit:s,queries:i,sortOnClick:d,paginator:u=!1,customCells:c,onChange:m}=t,h=_(t,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[p,g,f]=de(a,n,d,o,s,l.useResultRowCount(r,i),u,m);return b(ce,Z(Y({},h),{params:oe(ue(l.useResultTableCellIds(r,i),c,l.ResultCellView),ie(i,r),l.useResultSortedRowIds(r,...p,s,i),p,g,f)}))},e.ResultTableInHtmlTable=e=>{var t=e,{queryId:r,queries:a,customCells:n}=t,o=_(t,["queryId","queries","customCells"]);return b(ce,Z(Y({},o),{params:oe(ue(l.useResultTableCellIds(r,a),n,l.ResultCellView),ie(a,r),l.useResultRowIds(r,a))}))},e.SliceInHtmlTable=e=>{var t=e,{indexId:r,sliceId:a,indexes:n,editable:o,customCells:s}=t,i=_(t,["indexId","sliceId","indexes","editable","customCells"]);const[d,u,c]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(l.useIndexesOrIndexesById(n),r);return b(ce,Z(Y({},i),{params:oe(ue(l.useTableCellIds(c,u),s,o?pe:l.CellView),se(u,c),l.useSliceRowIds(r,a,d))}))},e.SortedTableInHtmlTable=e=>{var t=e,{tableId:r,cellId:a,descending:n,offset:o,limit:s,store:i,editable:d,sortOnClick:u,paginator:c=!1,onChange:m,customCells:h}=t,p=_(t,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[g,f,w]=de(a,n,u,o,s,l.useRowCount(r,i),c,m);return b(ce,Z(Y({},p),{params:oe(ue(l.useTableCellIds(r,i),h,d?pe:l.CellView),se(i,r),l.useSortedRowIds(r,...g,s,i),g,f,w)}))},e.SortedTablePaginator=fe,e.StoreInspector=e=>null,e.TableInHtmlTable=e=>{var t=e,{tableId:r,store:a,editable:n,customCells:o}=t,s=_(t,["tableId","store","editable","customCells"]);return b(ce,Z(Y({},s),{params:oe(ue(l.useTableCellIds(r,a),o,n?pe:l.CellView),se(a,r),l.useRowIds(r,a))}))},e.ValuesInHtmlTable=({store:e,editable:t=!1,valueComponent:r=(t?ge:l.ValueView),getValueComponentProps:a,className:n,headerRow:o,idColumn:i})=>b("table",{className:n},!1===o?null:b("thead",null,b("tr",null,!1===i?null:b("th",null,"Id"),b("th",null,s))),b("tbody",null,I(l.useValueIds(e),(t=>b("tr",{key:t},!1===i?null:b("th",null,t),b("td",null,b(r,Z(Y({},v(a,t)),{valueId:t,store:e}))))))))},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDom={},e.React,e.TinyBaseUiReact);
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "4.3.0-beta.1",
3
+ "version": "4.3.1",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",
@@ -211,7 +211,7 @@
211
211
  "publishPackage": "gulp publishPackage"
212
212
  },
213
213
  "devDependencies": {
214
- "@automerge/automerge": "^2.1.1",
214
+ "@automerge/automerge": "^2.1.2",
215
215
  "@babel/cli": "^7.22.15",
216
216
  "@babel/core": "^7.22.20",
217
217
  "@babel/preset-env": "^7.22.20",
@@ -228,14 +228,14 @@
228
228
  "@types/jest": "^29.5.5",
229
229
  "@types/jest-environment-puppeteer": "^5.0.4",
230
230
  "@types/less": "^3.0.4",
231
- "@types/node": "^20.6.2",
231
+ "@types/node": "^20.6.3",
232
232
  "@types/puppeteer": "^5.4.7",
233
- "@types/react": "^18.2.21",
233
+ "@types/react": "^18.2.22",
234
234
  "@types/react-dom": "^18.2.7",
235
- "@types/react-test-renderer": "^18.0.1",
235
+ "@types/react-test-renderer": "^18.0.2",
236
236
  "@types/tmp": "^0.2.4",
237
- "@typescript-eslint/eslint-plugin": "^6.7.0",
238
- "@typescript-eslint/parser": "^6.7.0",
237
+ "@typescript-eslint/eslint-plugin": "^6.7.2",
238
+ "@typescript-eslint/parser": "^6.7.2",
239
239
  "@vlcn.io/crsqlite-wasm": "^0.15.2",
240
240
  "asciichart": "^1.5.25",
241
241
  "automerge-repo": "^0.1.0",
@@ -251,7 +251,7 @@
251
251
  "eslint": "^8.49.0",
252
252
  "eslint-config-prettier": "^9.0.0",
253
253
  "eslint-plugin-jest": "^27.4.0",
254
- "eslint-plugin-jsdoc": "^46.8.1",
254
+ "eslint-plugin-jsdoc": "^46.8.2",
255
255
  "eslint-plugin-react": "7.33.2",
256
256
  "eslint-plugin-react-hooks": "^4.6.0",
257
257
  "expo-sqlite": "^11.6.0",
@@ -265,15 +265,15 @@
265
265
  "jest-fetch-mock": "^3.0.3",
266
266
  "jest-puppeteer": "^9.0.0",
267
267
  "less": "^4.2.0",
268
- "partykit": "^0.0.16",
269
- "partysocket": "^0.0.7",
268
+ "partykit": "^0.0.20",
269
+ "partysocket": "^0.0.8",
270
270
  "prettier": "^3.0.3",
271
271
  "puppeteer": "21.1.1",
272
272
  "react": "^18.2.0",
273
273
  "react-dom": "^18.2.0",
274
274
  "react-test-renderer": "^18.2.0",
275
275
  "rollup": "^3.29.2",
276
- "rollup-plugin-esbuild": "^5.0.0",
276
+ "rollup-plugin-esbuild": "^6.0.1",
277
277
  "rollup-plugin-gzip": "^3.1.0",
278
278
  "rollup-plugin-preserve-shebang": "^1.0.1",
279
279
  "rollup-plugin-prettier": "^4.0.0",
@@ -283,7 +283,7 @@
283
283
  "tmp": "^0.2.1",
284
284
  "ts-unused-exports": "^10.0.1",
285
285
  "typescript": "5.2.2",
286
- "yjs": "^13.6.7"
286
+ "yjs": "^13.6.8"
287
287
  },
288
288
  "peerDependencies": {
289
289
  "@sqlite.org/sqlite-wasm": "^3.43.1-build1",