tinybase 5.2.1 → 5.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/es6/min/ui-react/index.cjs +1 -1
- package/cjs/es6/min/ui-react/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-inspector/index.cjs +1 -1
- package/cjs/es6/min/ui-react-inspector/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/ui-react/index.cjs +10 -1
- package/cjs/es6/ui-react/with-schemas/index.cjs +10 -1
- package/cjs/es6/ui-react-inspector/index.cjs +1 -1
- package/cjs/es6/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react/index.cjs +1 -1
- package/cjs/min/ui-react/index.cjs.gz +0 -0
- package/cjs/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react-inspector/index.cjs +1 -1
- package/cjs/min/ui-react-inspector/index.cjs.gz +0 -0
- package/cjs/min/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
- package/cjs/ui-react/index.cjs +10 -1
- package/cjs/ui-react/with-schemas/index.cjs +10 -1
- package/cjs/ui-react-inspector/index.cjs +1 -1
- package/cjs/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/es6/min/ui-react/index.js +1 -1
- package/es6/min/ui-react/index.js.gz +0 -0
- package/es6/min/ui-react/with-schemas/index.js +1 -1
- package/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/index.js +1 -1
- package/es6/min/ui-react-inspector/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/es6/ui-react/index.js +10 -1
- package/es6/ui-react/with-schemas/index.js +10 -1
- package/es6/ui-react-inspector/index.js +1 -1
- package/es6/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react/index.js +1 -1
- package/min/ui-react/index.js.gz +0 -0
- package/min/ui-react/with-schemas/index.js +1 -1
- package/min/ui-react/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/package.json +1 -1
- package/readme.md +13 -13
- package/releases.md +23 -23
- package/ui-react/index.js +10 -1
- package/ui-react/with-schemas/index.js +10 -1
- package/ui-react-inspector/index.js +1 -1
- package/ui-react-inspector/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react/index.js +1 -1
- package/umd/es6/min/ui-react/index.js.gz +0 -0
- package/umd/es6/min/ui-react/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react-inspector/index.js +1 -1
- package/umd/es6/min/ui-react-inspector/index.js.gz +0 -0
- package/umd/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/umd/es6/ui-react/index.js +12 -1
- package/umd/es6/ui-react/with-schemas/index.js +12 -1
- package/umd/es6/ui-react-inspector/index.js +2 -1
- package/umd/es6/ui-react-inspector/with-schemas/index.js +2 -1
- package/umd/min/ui-react/index.js +1 -1
- package/umd/min/ui-react/index.js.gz +0 -0
- package/umd/min/ui-react/with-schemas/index.js +1 -1
- package/umd/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react-inspector/index.js +1 -1
- package/umd/min/ui-react-inspector/index.js.gz +0 -0
- package/umd/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/umd/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/umd/ui-react/index.js +12 -1
- package/umd/ui-react/with-schemas/index.js +12 -1
- package/umd/ui-react-inspector/index.js +2 -1
- package/umd/ui-react-inspector/with-schemas/index.js +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{useCell as t,useValue as l,useSetValueCallback as n,useSetCellCallback as r,useValueIds as o,ValueView as a,useStoreOrStoreById as s,useRowCount as i,useSortedRowIds as d,useTableCellIds as u,useIndexesOrIndexesById as c,useSliceRowIds as h,useRelationshipsOrRelationshipsById as m,useRowIds as p,useResultRowCount as g,useResultSortedRowIds as b,useResultTableCellIds as v,useRemoteRowId as f,CellView as y,ResultCellView as I,useIndexes as w,useIndexIds as C,useSliceIds as k,useMetrics as x,useMetricIds as T,useMetric as S,useQueries as O,useQueryIds as q,useRelationships as P,useRelationshipIds as N,useStore as V,useTableIds as M,useValues as L,useStoreIds as E,useMetricsIds as R,useIndexesIds as j,useRelationshipsIds as z,useQueriesIds as $,useCreateStore as A,useCreatePersister as F}from"../../ui-react/with-schemas/index.js";const J=e=>typeof e,D="",B=J(D),H=J(!0),W=J(0),Q=J(J),G="type",K="default",U="Has",X="Ids",Y="Table",Z=Y+"s",_=Y+X,ee="Row",te=ee+"Count",le=ee+X,ne="Cell",re=ne+X,oe="Value",ae=oe+"s",se=oe+X,ie="currentTarget",de="value",ue=e=>D+e,ce=globalThis.window,he=Math,me=he.min,pe=he.floor,ge=isFinite,be=e=>null==e,ve=(e,t,l)=>be(e)?null==l?void 0:l():t(e),fe=e=>e==B||e==H,ye=e=>J(e)==Q,Ie=e=>Array.isArray(e),we=(e,t,l)=>e.slice(t,l),Ce=e=>e.length,ke=e=>{throw Error(e)},{PureComponent:xe,Fragment:Te,createElement:Se,useCallback:Oe,useLayoutEffect:qe,useRef:Pe,useState:Ne}=e,Ve=(e,...t)=>be(e)?{}:e(...t),Me=(e,t)=>e.sort(t),Le=(e,t)=>e.forEach(t),Ee=(e,t)=>e.map(t),Re=e=>0==Ce(e),je=(e,...t)=>e.push(...t),ze=e=>e.shift(),$e=Object,Ae=e=>$e.getPrototypeOf(e),Fe=$e.entries,Je=$e.isFrozen,De=e=>!be(e)&&ve(Ae(e),(e=>e==$e.prototype||be(Ae(e))),(()=>!0)),Be=$e.keys,He=$e.freeze,We=(e=[])=>$e.fromEntries(e),Qe=(e,t)=>t in e,Ge=(e,t)=>(delete e[t],e),Ke=(e,t)=>Ee(Fe(e),(([e,l])=>t(l,e))),Ue=e=>De(e)&&0==(e=>Ce(Be(e)))(e),Xe=(e,t,l,n=0)=>be(e)||!De(e)||!n&&Ue(e)||Je(e)?(null==l||l(),!1):(Ke(e,((l,n)=>{t(l,n)||Ge(e,n)})),!!n||!Ue(e)),Ye=JSON.stringify,Ze=JSON.parse,_e=e=>Ye(e,((e,t)=>t instanceof Map?$e.fromEntries([...t]):t)),et="tinybaseInspector",tt="TinyBase Inspector",lt=["left","top","bottom","right","full"],nt="state",rt="sort",ot="open",at="position",st=ot,it="editable",dt=(...e)=>_e(e),ut=(e,t)=>Ee(Me(e),t),ct=(e,l)=>[!!t(nt,e,it,l),Oe((t=>{l.setCell(nt,e,it,(e=>!e)),t.preventDefault()}),[l,e])],ht="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",mt='content:url("',pt=mt+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",gt='</svg>")',bt=mt+"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\")",vt=Ee([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,n])=>pt+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${n}' fill='white'/>`+gt)),ft=pt+"<path d='M20 20l60 60M20 80l60-60' />"+gt,yt=pt+`<path d='${ht}' />`+gt,It=pt+`<path d='${ht}M20 20l60 60' />`+gt;var wt=Object.defineProperty,Ct=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,xt=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,Ot=(e,t,l)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,qt=(e,t)=>{for(var l in t||(t={}))Tt.call(t,l)&&Ot(e,l,t[l]);if(xt)for(var l of xt(t))St.call(t,l)&&Ot(e,l,t[l]);return e},Pt=(e,t)=>Ct(e,kt(t));const Nt="*::-webkit-scrollbar",Vt=((e,t="")=>e.join(t))(Ke(Pt(qt(Pt(qt(Pt(qt({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[Nt]:"width:0.5rem;height:0.5rem;",[Nt+"-track"]:"background:#111",[Nt+"-thumb"]:"background:#999;border:1px solid #111",[Nt+"-thumb:hover"]:"background:#fff",[Nt+"-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;"+bt},We(Ee(["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;"}),We(Ee(["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)":bt,"header>img:nth-of-type(6)":ft}),We(Ee(vt,((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":yt,"details[open]>summary img.done":It,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,#${et} 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?`#${et} ${t}{${e}}`:""))),Mt=({s:e})=>{var t;const r=null!=(t=l(at,e))?t:1,o=n(st,(()=>!0),[],e);return l(st,e)?null:Se("img",{onClick:o,title:tt,"data-position":r})},Lt=({uniqueId:e,summary:l,editable:n,handleEditable:o,children:a,s:s})=>{const i=!!t(nt,e,ot,s),d=r(nt,e,ot,(e=>e[ie].open),[],s);return Se("details",{open:i,onToggle:d},Se("summary",null,l,o?Se("img",{onClick:o,className:n?"done":"edit"}):null),a)},Et=e=>{const t=J(e);return fe(t)||t==W&&ge(e)?t:void 0},Rt=(e,t,l,n,r)=>be(r)?e.delCell(t,l,n,!0):e.setCell(t,l,n,r),jt=(e,t,l)=>be(l)?e.delValue(t):e.setValue(t,l),zt=(e,t,l,n)=>e==B?t:e==W?l:n;var $t=Object.defineProperty,At=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Ht=(e,t,l)=>t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Wt=(e,t)=>{for(var l in t||(t={}))Dt.call(t,l)&&Ht(e,l,t[l]);if(Jt)for(var l of Jt(t))Bt.call(t,l)&&Ht(e,l,t[l]);return e},Qt=(e,t)=>At(e,Ft(t)),Gt=(e,t)=>{var l={};for(var n in e)Dt.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&Jt)for(var n of Jt(e))t.indexOf(n)<0&&Bt.call(e,n)&&(l[n]=e[n]);return l};const{useCallback:Kt,useMemo:Ut,useState:Xt}=e,Yt="editable",Zt=(e,t)=>Ee(u(e,t),(t=>e+"."+t)),_t=(e,t,l)=>{const n=Kt(e,t);return l?n:void 0},el=(...e)=>Ut((()=>e),e),tl=(e,t)=>Ut((()=>({store:e,tableId:t})),[e,t]),ll=(e,t)=>Ut((()=>({queries:e,queryId:t})),[e,t]),nl=(e,t=!1,l,n=0,r,o,a,s)=>{const[[i,d,u],c]=Xt([e,t,n]),h=Kt((e=>{c(e),null==s||s(e)}),[s]),m=_t((e=>h([e,e==i&&!d,u])),[h,i,d,u],l),p=Kt((e=>h([i,d,e])),[h,i,d]),g=!0===a?bl:a;return[[i,d,u],m,Ut((()=>!1===a?null:Se(g,{offset:u,limit:r,total:o,onChange:p})),[a,g,u,r,o,p])]},rl=(e,t,l)=>Ut((()=>{const n=null!=t?t:e;return r=Ie(n)?We(Ee(n,(e=>[e,e]))):n,o=(e,t)=>Wt(Wt({},{label:t,component:l}),J(e)==B?{label:e}:e),We(Ke(r,((e,t)=>[t,o(e,t)])));var r,o}),[t,l,e]),ol=({className:e,headerRow:t,idColumn:l,params:[n,r,o,a,s,i]})=>Se("table",{className:e},i?Se("caption",null,i):null,!1===t?null:Se("thead",null,Se("tr",null,!1===l?null:Se(al,{sort:null!=a?a:[],label:"Id",onClick:s}),Ke(n,(({label:e},t)=>Se(al,{key:t,cellId:t,label:e,sort:null!=a?a:[],onClick:s}))))),Se("tbody",null,Ee(o,(e=>Se("tr",{key:e},!1===l?null:Se("th",null,e),Ke(n,(({component:t,getComponentProps:l},n)=>Se("td",{key:n},Se(t,Qt(Wt(Wt({},Ve(l,e,n)),r),{rowId:e,cellId:n})))))))))),al=({cellId:e,sort:[t,l],label:n=(null!=e?e:D),onClick:r})=>Se("th",{onClick:_t((()=>null==r?void 0:r(e)),[r,e],r),className:be(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},be(l)||t!=e?null:(l?"↓":"↑")+" ",n),sl=({localRowId:t,params:[l,n,r,o,a,s,i]})=>{const d=f(a,t,s);return Se("tr",null,!1===l?null:Se(e.Fragment,null,Se("th",null,t),Se("th",null,d)),Ke(n,(({component:e,getComponentProps:l},n)=>{const[a,s]=n.split(".",2),u=a===r?t:a===o?d:null;return be(u)?null:Se("td",{key:n},Se(e,Qt(Wt({},Ve(l,u,s)),{store:i,tableId:a,rowId:u,cellId:s})))})))},il=({thing:e,onThingChange:t,className:l,hasSchema:n,showType:r=!0})=>{const[o,a]=Xt(),[s,i]=Xt(),[d,u]=Xt(),[c,h]=Xt(),[m,p]=Xt();s!==e&&(a(Et(e)),i(e),u(e+""),h(Number(e)||0),p(!!e));const g=Kt(((e,l)=>{l(e),i(e),t(e)}),[t]),b=Kt((()=>{if(!(null==n?void 0:n())){const e=zt(o,W,H,B),l=zt(e,d,c,m);a(e),i(l),t(l)}}),[n,t,d,c,m,o]);return Se("div",{className:l},r?Se("button",{className:o,onClick:b},o):null,zt(o,Se("input",{key:o,value:d,onChange:Kt((e=>g(e[ie][de]+"",u)),[g])}),Se("input",{key:o,type:"number",value:c,onChange:Kt((e=>g(Number(e[ie][de]||0),h)),[g])}),Se("input",{key:o,type:"checkbox",checked:m,onChange:Kt((e=>g(!!e[ie].checked,p)),[g])})))},dl=e=>{var t=e,{tableId:l,cellId:n,descending:r,offset:o,limit:a,store:s,editable:c,sortOnClick:h,paginator:m=!1,onChange:p,customCells:g}=t,b=Gt(t,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[v,f,I]=nl(n,r,h,o,a,i(l,s),m,p);return Se(ol,Qt(Wt({},b),{params:el(rl(u(l,s),g,c?pl:y),tl(s,l),d(l,...v,a,s),v,f,I)}))},ul=({store:e,editable:t=!1,valueComponent:l=(t?gl:a),getValueComponentProps:n,className:r,headerRow:s,idColumn:i})=>Se("table",{className:r},!1===s?null:Se("thead",null,Se("tr",null,!1===i?null:Se("th",null,"Id"),Se("th",null,oe))),Se("tbody",null,Ee(o(e),(t=>Se("tr",{key:t},!1===i?null:Se("th",null,t),Se("td",null,Se(l,Qt(Wt({},Ve(n,t)),{valueId:t,store:e})))))))),cl=e=>{var t=e,{indexId:l,sliceId:n,indexes:r,editable:o,customCells:a}=t,s=Gt(t,["indexId","sliceId","indexes","editable","customCells"]);const[i,d,m]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(c(r),l);return Se(ol,Qt(Wt({},s),{params:el(rl(u(m,d),a,o?pl:y),tl(d,m),h(l,n,i))}))},hl=({relationshipId:t,relationships:l,editable:n,customCells:r,className:o,headerRow:a,idColumn:s=!0})=>{const[i,d,u,c]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)])(m(l),t),h=rl([...Zt(u,d),...Zt(c,d)],r,n?pl:y),g=el(s,h,u,c,t,i,d);return Se("table",{className:o},!1===a?null:Se("thead",null,Se("tr",null,!1===s?null:Se(e.Fragment,null,Se("th",null,u,".Id"),Se("th",null,c,".Id")),Ke(h,(({label:e},t)=>Se("th",{key:t},e))))),Se("tbody",null,Ee(p(u,d),(e=>Se(sl,{key:e,localRowId:e,params:g})))))},ml=e=>{var t=e,{queryId:l,cellId:n,descending:r,offset:o,limit:a,queries:s,sortOnClick:i,paginator:d=!1,customCells:u,onChange:c}=t,h=Gt(t,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[m,p,f]=nl(n,r,i,o,a,g(l,s),d,c);return Se(ol,Qt(Wt({},h),{params:el(rl(v(l,s),u,I),ll(s,l),b(l,...m,a,s),m,p,f)}))},pl=({tableId:e,rowId:l,cellId:n,store:o,className:a,showType:i})=>{var d;return Se(il,{thing:t(e,l,n,o),onThingChange:r(e,l,n,(e=>e),[],o),className:null!=a?a:Yt+ne,showType:i,hasSchema:null==(d=s(o))?void 0:d.hasTablesSchema})},gl=({valueId:e,store:t,className:r,showType:o})=>{var a;return Se(il,{thing:l(e,t),onThingChange:n(e,(e=>e),[],t),className:null!=r?r:Yt+oe,showType:o,hasSchema:null==(a=s(t))?void 0:a.hasValuesSchema})},bl=({onChange:t,total:l,offset:n=0,limit:r=l,singular:o="row",plural:a=o+"s"})=>{(n>l||n<0)&&(n=0,t(0));const s=_t((()=>t(n-r)),[t,n,r],n>0),i=_t((()=>t(n+r)),[t,n,r],n+r<l);return Se(e.Fragment,null,l>r&&Se(e.Fragment,null,Se("button",{className:"previous",disabled:0==n,onClick:s},"←"),Se("button",{className:"next",disabled:n+r>=l,onClick:i},"→"),n+1," to ",me(l,n+r)," of "),l," ",1!=l?a:o)},vl=({indexes:e,indexesId:t,indexId:l,s:n})=>Se(Lt,{uniqueId:dt("i",t,l),summary:"Index: "+l,s:n},Ee(k(l,e),(r=>Se(fl,{indexes:e,indexesId:t,indexId:l,sliceId:r,s:n,key:r})))),fl=({indexes:e,indexesId:t,indexId:l,sliceId:n,s:r})=>{const o=dt("i",t,l,n),[a,s]=ct(o,r);return Se(Lt,{uniqueId:o,summary:"Slice: "+n,editable:a,handleEditable:s,s:r},Se(cl,{sliceId:n,indexId:l,indexes:e,editable:a}))},yl=({indexesId:e,s:t})=>{const l=w(e),n=C(l);return be(l)?null:Se(Lt,{uniqueId:dt("i",e),summary:"Indexes: "+(null!=e?e:K),s:t},Re(n)?"No indexes defined":ut(n,(n=>Se(vl,{indexes:l,indexesId:e,indexId:n,s:t,key:n}))))},Il=({metrics:e,metricId:t})=>Se("tr",null,Se("th",null,t),Se("td",null,null==e?void 0:e.getTableId(t)),Se("td",null,S(t,e))),wl=({metricsId:e,s:t})=>{const l=x(e),n=T(l);return be(l)?null:Se(Lt,{uniqueId:dt("m",e),summary:"Metrics: "+(null!=e?e:K),s:t},Re(n)?"No metrics defined":Se("table",null,Se("thead",null,Se("th",null,"Metric Id"),Se("th",null,"Table Id"),Se("th",null,"Metric")),Se("tbody",null,Ee(n,(e=>Se(Il,{metrics:l,metricId:e,key:e}))))))},Cl=({queries:e,queriesId:l,queryId:n,s:o})=>{var a;const s=dt("q",l,n),[i,d,u]=Ze(null!=(a=t(nt,s,rt,o))?a:"[]"),c=r(nt,s,rt,_e,[],o);return Se(Lt,{uniqueId:s,summary:"Query: "+n,s:o},Se(ml,{queryId:n,queries:e,cellId:i,descending:d,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:c}))},kl=({queriesId:e,s:t})=>{const l=O(e),n=q(l);return be(l)?null:Se(Lt,{uniqueId:dt("q",e),summary:"Queries: "+(null!=e?e:K),s:t},Re(n)?"No queries defined":ut(n,(n=>Se(Cl,{queries:l,queriesId:e,queryId:n,s:t,key:n}))))},xl=({relationships:e,relationshipsId:t,relationshipId:l,s:n})=>{const r=dt("r",t,l),[o,a]=ct(r,n);return Se(Lt,{uniqueId:r,summary:"Relationship: "+l,editable:o,handleEditable:a,s:n},Se(hl,{relationshipId:l,relationships:e,editable:o}))},Tl=({relationshipsId:e,s:t})=>{const l=P(e),n=N(l);return be(l)?null:Se(Lt,{uniqueId:dt("r",e),summary:"Relationships: "+(null!=e?e:K),s:t},Re(n)?"No relationships defined":ut(n,(n=>Se(xl,{relationships:l,relationshipsId:e,relationshipId:n,s:t,key:n}))))},Sl=({tableId:e,store:l,storeId:n,s:o})=>{var a;const s=dt("t",n,e),[i,d,u]=Ze(null!=(a=t(nt,s,rt,o))?a:"[]"),c=r(nt,s,rt,_e,[],o),[h,m]=ct(s,o);return Se(Lt,{uniqueId:s,summary:Y+": "+e,editable:h,handleEditable:m,s:o},Se(dl,{tableId:e,store:l,cellId:i,descending:d,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:c,editable:h}))},Ol=({store:e,storeId:t,s:l})=>{const n=dt("v",t),[r,a]=ct(n,l);return Re(o(e))?null:Se(Lt,{uniqueId:n,summary:ae,editable:r,handleEditable:a,s:l},Se(ul,{store:e,editable:r}))},ql=({storeId:e,s:t})=>{const l=V(e),n=M(l);return be(l)?null:Se(Lt,{uniqueId:dt("s",e),summary:(l.isMergeable()?"Mergeable":"")+"Store: "+(null!=e?e:K),s:t},Se(Ol,{storeId:e,store:l,s:t}),ut(n,(n=>Se(Sl,{store:l,storeId:e,tableId:n,s:t,key:n}))))},Pl=({s:e})=>{const t=Pe(null),l=Pe(0),[n,r]=Ne(!1),{scrollLeft:o,scrollTop:a}=L(e);qe((()=>{const e=t.current;if(e&&!n){const t=new MutationObserver((()=>{e.scrollWidth>=pe(o)+e.clientWidth&&e.scrollHeight>=pe(a)+e.clientHeight&&e.scrollTo(o,a)}));return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()}}),[n,o,a]);const s=Oe((t=>{const{scrollLeft:n,scrollTop:o}=t[ie];cancelIdleCallback(l.current),l.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:n,scrollTop:o})}))}),[e]),i=V(),d=E(),u=x(),c=R(),h=w(),m=j(),p=P(),g=z(),b=O(),v=$();return be(i)&&Re(d)&&be(u)&&Re(c)&&be(h)&&Re(m)&&be(p)&&Re(g)&&be(b)&&Re(v)?Se("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the Inspector inside a Provider component."):Se("article",{ref:t,onScroll:s},Se(ql,{s:e}),Ee(d,(t=>Se(ql,{storeId:t,s:e,key:t}))),Se(wl,{s:e}),Ee(c,(t=>Se(wl,{metricsId:t,s:e,key:t}))),Se(yl,{s:e}),Ee(m,(t=>Se(yl,{indexesId:t,s:e,key:t}))),Se(Tl,{s:e}),Ee(g,(t=>Se(Tl,{relationshipsId:t,s:e,key:t}))),Se(kl,{s:e}),Ee(v,(t=>Se(kl,{queriesId:t,s:e,key:t}))))};var Nl=Object.defineProperty;class Vl extends xe{constructor(e){var t,l,n;super(e),n=(e,t)=>console.error(e,t.componentStack),(l="componentDidCatch")in(t=this)?Nl(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,this.state={e:0}}static getDerivedStateFromError(){return{e:1}}render(){return this.state.e?Se("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const Ml=({s:e})=>{var t;const r=null!=(t=l(at,e))?t:1,o=n(st,(()=>!1),[],e),a=n(at,(e=>Number(e[ie].dataset.id)),[],e);return Se("header",null,Se("img",{title:tt}),Se("span",null,tt),Ee(lt,((e,t)=>t==r?null:Se("img",{onClick:a,"data-id":t,title:"Dock to "+e,key:t}))),Se("img",{onClick:o,title:"Close"}))},Ll=({s:e})=>{var t;const n=null!=(t=l(at,e))?t:1;return l(st,e)?Se("main",{"data-position":n},Se(Ml,{s:e}),Se(Vl,null,Se(Pl,{s:e}))):null},El=e=>t=>{return l=(t,l)=>t+e(l),Jl(t).reduce(l,0);var l},Rl=e=>{var t;return null!=(t=null==e?void 0:e.size)?t:0},jl=El(Rl),zl=El(jl),$l=El(zl),Al=(e,t)=>{var l;return null!=(l=null==e?void 0:e.has(t))&&l},Fl=e=>be(e)||0==Rl(e),Jl=e=>{var t;return[...null!=(t=null==e?void 0:e.values())?t:[]]},Dl=e=>e.clear(),Bl=(e,t)=>null==e?void 0:e.forEach(t),Hl=(e,t)=>null==e?void 0:e.delete(t),Wl=e=>new Map(e),Ql=e=>{var t;return[...null!=(t=null==e?void 0:e.keys())?t:[]]},Gl=(e,t)=>null==e?void 0:e.get(t),Kl=(e,t)=>Bl(e,((e,l)=>t(l,e))),Ul=(e,t,l)=>be(l)?(Hl(e,t),e):null==e?void 0:e.set(t,l),Xl=(e,t,l,n)=>(Al(e,t)?null==n||n(Gl(e,t)):Ul(e,t,l()),Gl(e,t)),Yl=(e,t,l,n=Ul)=>(Ke(t,((t,n)=>l(e,n,t))),Kl(e,(l=>Qe(t,l)?0:n(e,l))),e),Zl=(e,t,l,n)=>{const r={};return Bl(e,((e,o)=>{if(!(null==l?void 0:l(e,o))){const l=t?t(e,o):e;(null==n?void 0:n(l))||(r[o]=l)}})),r},_l=(e,t,l)=>Zl(e,(e=>Zl(e,t,l)),Fl,Ue),en=(e,t,l)=>Zl(e,(e=>_l(e,t,l)),Fl,Ue),tn=(e,t)=>{const l=Wl();return Bl(e,((e,n)=>{var r;return l.set(n,null!=(r=null==t?void 0:t(e))?r:e)})),l},ln=e=>tn(e,tn),nn=e=>tn(e,ln),rn=(e,t,l,n,r=0)=>ve((l?Xl:Gl)(e,t[r],r>Ce(t)-2?l:Wl),(o=>{if(r>Ce(t)-2)return(null==n?void 0:n(o))&&Ul(e,t[r]),o;const a=rn(o,t,l,n,r+1);return Fl(o)&&Ul(e,t[r]),a}));var on=Object.defineProperty,an=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,un=(e,t,l)=>t in e?on(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,cn=(e,t,l)=>new Promise(((n,r)=>{var o=e=>{try{s(l.next(e))}catch(e){r(e)}},a=e=>{try{s(l.throw(e))}catch(e){r(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((l=l.apply(e,t)).next())}));const hn=Wl(),mn=Wl();var pn=(e,t,l)=>new Promise(((n,r)=>{var o=e=>{try{s(l.next(e))}catch(e){r(e)}},a=e=>{try{s(l.throw(e))}catch(e){r(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((l=l.apply(e,t)).next())}));const gn="storage",bn=e=>new Set(Ie(e)||be(e)?e:[e]),vn=(e,t)=>null==e?void 0:e.add(t),fn=/^\d+$/,yn=()=>{const e=[];let t=0;return[l=>{var n;return null!=(n=l?ze(e):null)?n:D+t++},t=>{fn.test(t)&&Ce(e)<1e3&&je(e,t)}]},In=e=>[e,e],wn=(e,t=jl)=>t(e[0])+t(e[1]),Cn=()=>[Wl(),Wl()],kn=e=>[...e],xn=([e,t])=>e===t;Wl(Ee("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(D),((e,t)=>[e,t])));const Tn=(e,t,l)=>Ul(e,t,Gl(e,t)==-l?void 0:l),Sn=()=>{let e,t,l=!1,n=!1,r=0,o=[];const a=Wl(),s=Wl(),i=Wl(),d=Wl(),u=Wl(),c=Wl(),h=Wl(),m=Wl(),p=Wl(),g=Wl(),b=Wl(),v=Wl(),f=Wl(),y=Wl(),I=bn(),w=Wl(),C=Wl(),k=Wl(),x=Wl(),T=Cn(),S=Cn(),O=Cn(),q=Cn(),P=Cn(),N=Cn(),V=Cn(),M=Cn(),L=Cn(),E=Cn(),R=Cn(),j=Cn(),z=Cn(),$=Cn(),A=Cn(),F=Cn(),J=Cn(),B=Cn(),H=Cn(),Q=Cn(),X=Cn(),ie=Cn(),de=Wl(),ce=Cn(),[he,me,pe,ge]=(()=>{let e;const[t,l]=yn(),n=Wl();return[(l,r,o,a=[],s=()=>[])=>{null!=e||(e=rl);const i=t(1);return Ul(n,i,[l,r,o,a,s]),vn(rn(r,null!=o?o:[D],bn),i),i},(t,l,...r)=>Le(((e,t=[D])=>{const l=[],n=(e,r)=>r==Ce(t)?je(l,e):null===t[r]?Bl(e,(e=>n(e,r+1))):Le([t[r],null],(t=>n(Gl(e,t),r+1)));return n(e,0),l})(t,l),(t=>Bl(t,(t=>Gl(n,t)[0](e,...null!=l?l:[],...r))))),e=>ve(Gl(n,e),(([,t,r])=>(rn(t,null!=r?r:[D],void 0,(t=>(Hl(t,e),Fl(t)?1:0))),Ul(n,e),l(e),r))),t=>ve(Gl(n,t),(([t,,l=[],n,r])=>{const o=(...a)=>{var s,i;const d=Ce(a);d==Ce(l)?t(e,...a,...r(a)):be(l[d])?Le(null!=(i=null==(s=n[d])?void 0:s.call(n,...a))?i:[],(e=>o(...a,e))):o(...a,l[d])};o()}))]})(),ke=e=>{if(!Xe(e,((e,t)=>[G,K].includes(t))))return!1;const t=e[G];return!(!fe(t)&&t!=W||(Et(e[K])!=t&&Ge(e,K),0))},xe=Ie,Te=(t,l)=>(!e||Al(b,l)||mt(l))&&Xe(t,((e,t)=>Se(l,t,e)),(()=>mt(l))),Se=(e,t,l,n)=>Xe(n?l:Ne(l,e,t),((n,r)=>ve(Oe(e,t,r,n),(e=>(l[r]=e,!0)),(()=>!1))),(()=>mt(e,t))),Oe=(t,l,n,r)=>e?ve(Gl(Gl(b,t),n),(e=>Et(r)!=e[G]?mt(t,l,n,r,e[K]):r),(()=>mt(t,l,n,r))):be(Et(r))?mt(t,l,n,r):r,qe=(e,t)=>Xe(t?e:Ve(e),((t,l)=>ve(Pe(l,t),(t=>(e[l]=t,!0)),(()=>!1))),(()=>pt())),Pe=(e,l)=>t?ve(Gl(f,e),(t=>Et(l)!=t[G]?pt(e,l,t[K]):l),(()=>pt(e,l))):be(Et(l))?pt(e,l):l,Ne=(e,t,l)=>(ve(Gl(v,t),(([n,r])=>{Bl(n,((t,l)=>{Qe(e,l)||(e[l]=t)})),Bl(r,(n=>{Qe(e,n)||mt(t,l,n)}))})),e),Ve=e=>(t&&(Bl(y,((t,l)=>{Qe(e,l)||(e[l]=t)})),Bl(I,(t=>{Qe(e,t)||pt(t)}))),e),Re=e=>Yl(b,e,((e,t,l)=>{const n=Wl(),r=bn();Yl(Xl(b,t,Wl),l,((e,t,l)=>{Ul(e,t,l),ve(l[K],(e=>Ul(n,t,e)),(()=>vn(r,t)))})),Ul(v,t,[n,r])}),((e,t)=>{Ul(b,t),Ul(v,t)})),ze=e=>Yl(f,e,((e,t,l)=>{Ul(f,t,l),ve(l[K],(e=>Ul(y,t,e)),(()=>vn(I,t)))}),((e,t)=>{Ul(f,t),Ul(y,t),Hl(I,t)})),$e=e=>Ue(e)?Ut():Ht(e),Ae=e=>Yl(k,e,((e,t,l)=>Fe(t,l)),((e,t)=>nt(t))),Fe=(e,t)=>Yl(Xl(k,e,(()=>(st(e,1),Ul(w,e,yn()),Ul(C,e,Wl()),Wl()))),t,((t,l,n)=>Je(e,t,l,n)),((t,l)=>rt(e,t,l))),Je=(e,t,l,n,r)=>Yl(Xl(t,l,(()=>(it(e,l,1),Wl()))),n,((t,n,r)=>De(e,l,t,n,r)),((n,o)=>ot(e,t,l,n,o,r))),De=(e,t,l,n,r)=>{Al(l,n)||dt(e,t,n,1);const o=Gl(l,n);r!==o&&(ut(e,t,n,o,r),Ul(l,n,r))},Be=(e,t,l,n,r)=>ve(Gl(t,l),(t=>De(e,l,t,n,r)),(()=>Je(e,t,l,Ne({[n]:r},e,l)))),We=e=>Ue(e)?Zt():Wt(e),Ye=e=>Yl(x,e,((e,t,l)=>et(t,l)),((e,t)=>at(t))),et=(e,t)=>{Al(x,e)||ct(e,1);const l=Gl(x,e);t!==l&&(ht(e,l,t),Ul(x,e,t))},tt=(e,t)=>{const[l]=Gl(w,e),n=l(t);return Al(Gl(k,e),n)?tt(e,t):n},lt=e=>{var t;return null!=(t=Gl(k,e))?t:Fe(e,{})},nt=e=>Fe(e,{}),rt=(e,t,l)=>{const[,n]=Gl(w,e);n(l),Je(e,t,l,{},!0)},ot=(e,t,l,n,r,o)=>{var a;const s=Gl(null==(a=Gl(v,e))?void 0:a[0],r);if(!be(s)&&!o)return De(e,l,n,r,s);const i=t=>{ut(e,l,t,Gl(n,t)),dt(e,l,t,-1),Ul(n,t)};be(s)?i(r):Kl(n,i),Fl(n)&&(it(e,l,-1),Fl(Ul(t,l))&&(st(e,-1),Ul(k,e),Ul(w,e),Ul(C,e)))},at=e=>{const t=Gl(y,e);if(!be(t))return et(e,t);ht(e,Gl(x,e)),ct(e,-1),Ul(x,e)},st=(e,t)=>Tn(a,e,t),it=(e,t,l)=>Tn(Xl(d,e,Wl),t,l)&&Ul(i,e,Xl(i,e,(()=>0))+l),dt=(e,t,l,n)=>{var r;const o=Gl(C,e),a=null!=(r=Gl(o,l))?r:0;(0==a&&1==n||1==a&&-1==n)&&Tn(Xl(s,e,Wl),l,n),Ul(o,l,a!=-n?a+n:null),Tn(Xl(Xl(u,e,Wl),t,Wl),l,n)},ut=(e,t,l,n,r)=>{var a;Xl(Xl(Xl(c,e,Wl),t,Wl),l,(()=>[n,0]))[1]=r,null==(a=o[3])||a.call(o,e,t,l,r)},ct=(e,t)=>Tn(h,e,t),ht=(e,t,l)=>{var n;Xl(m,e,(()=>[t,0]))[1]=l,null==(n=o[4])||n.call(o,e,l)},mt=(e,t,l,n,r)=>(je(Xl(Xl(Xl(p,e,Wl),t,Wl),l,(()=>[])),n),r),pt=(e,t,l)=>(je(Xl(g,e,(()=>[])),t),l),gt=(e,t,l)=>ve(Gl(Gl(Gl(c,e),t),l),(([e,t])=>[!0,e,t]),(()=>[!1,...In(Nt(e,t,l))])),bt=e=>ve(Gl(m,e),(([e,t])=>[!0,e,t]),(()=>[!1,...In(Lt(e))])),vt=e=>Fl(p)||Fl(F[e])?0:Bl(e?nn(p):p,((t,l)=>Bl(t,((t,n)=>Bl(t,((t,r)=>me(F[e],[l,n,r],t))))))),ft=e=>Fl(g)||Fl(J[e])?0:Bl(e?tn(g):g,((t,l)=>me(J[e],[l],t))),yt=(e,t,l,n)=>{if(!Fl(e))return me(t,n,(()=>Zl(e))),Kl(e,((e,t)=>me(l,[...null!=n?n:[],e],1==t))),1},It=e=>{const t=zt();t!=l&&me(T[e],void 0,t);const n=Fl(E[e]),r=Fl(z[e])&&Fl($[e])&&Fl(L[e])&&Fl(R[e])&&Fl(N[e])&&Fl(V[e])&&Fl(M[e])&&n&&Fl(O[e])&&Fl(q[e]),o=Fl(A[e])&&Fl(j[e])&&Fl(P[e])&&Fl(S[e]);if(!r||!o){const t=e?[tn(a),ln(s),tn(i),ln(d),nn(u),nn(c)]:[a,s,i,d,u,c];if(!r){yt(t[0],O[e],q[e]),Bl(t[1],((t,l)=>yt(t,N[e],V[e],[l]))),Bl(t[2],((t,l)=>{0!=t&&me(M[e],[l],St(l))}));const l=bn();Bl(t[3],((t,r)=>{yt(t,L[e],R[e],[r])&&!n&&(me(E[e],[r,null]),vn(l,r))})),n||Bl(t[5],((t,n)=>{if(!Al(l,n)){const l=bn();Bl(t,(e=>Bl(e,(([t,n],r)=>n!==t?vn(l,r):Hl(e,r))))),Bl(l,(t=>me(E[e],[n,t])))}})),Bl(t[4],((t,l)=>Bl(t,((t,n)=>yt(t,z[e],$[e],[l,n])))))}if(!o){let l;Bl(t[5],((t,n)=>{let r;Bl(t,((t,o)=>{let a;Bl(t,(([t,s],i)=>{s!==t&&(me(A[e],[n,o,i],s,t,gt),l=r=a=1)})),a&&me(j[e],[n,o],gt)})),r&&me(P[e],[n],gt)})),l&&me(S[e],void 0,gt)}}},wt=e=>{const t=Dt();t!=n&&me(B[e],void 0,t);const l=Fl(Q[e])&&Fl(X[e]),r=Fl(ie[e])&&Fl(H[e]);if(!l||!r){const t=e?[tn(h),tn(m)]:[h,m];if(l||yt(t[0],Q[e],X[e]),!r){let l;Bl(t[1],(([t,n],r)=>{n!==t&&(me(ie[e],[r],n,t,bt),l=1)})),l&&me(H[e],void 0,bt)}}},Ct=(e,...t)=>(tl((()=>e(...Ee(t,ue)))),rl),kt=()=>en(k),xt=()=>Ql(k),Tt=e=>Ql(Gl(C,ue(e))),St=e=>Rl(Gl(k,ue(e))),Ot=e=>Ql(Gl(k,ue(e))),qt=(e,t,l,n=0,r)=>{return Ee(we(Me((o=Gl(k,ue(e)),a=(e,l)=>[be(t)?l:Gl(e,ue(t)),l],Ee([...null!=(s=null==o?void 0:o.entries())?s:[]],(([e,t])=>a(t,e)))),(([e],[t])=>{return((null!=(n=e)?n:0)<(null!=(r=t)?r:0)?-1:1)*(l?-1:1);var n,r})),n,be(r)?r:n+r),(([,e])=>e));var o,a,s},Pt=(e,t)=>Ql(Gl(Gl(k,ue(e)),ue(t))),Nt=(e,t,l)=>Gl(Gl(Gl(k,ue(e)),ue(t)),ue(l)),Vt=()=>Zl(x),Mt=()=>Ql(x),Lt=e=>Gl(x,ue(e)),zt=()=>!Fl(k),$t=e=>Al(k,ue(e)),At=(e,t)=>Al(Gl(C,ue(e)),ue(t)),Ft=(e,t)=>Al(Gl(k,ue(e)),ue(t)),Jt=(e,t,l)=>Al(Gl(Gl(k,ue(e)),ue(t)),ue(l)),Dt=()=>!Fl(x),Bt=e=>Al(x,ue(e)),Ht=e=>Ct((()=>(e=>Xe(e,Te,mt))(e)?Ae(e):0)),Wt=e=>Ct((()=>qe(e)?Ye(e):0)),Qt=e=>{try{$e(Ze(e))}catch(e){}return rl},Gt=t=>Ct((()=>{if((e=Xe(t,(e=>Xe(e,ke))))&&(Re(t),!Fl(k))){const e=kt();Ut(),Ht(e)}})),Kt=e=>Ct((()=>{if(t=(e=>Xe(e,ke))(e)){const l=Vt();el(),Zt(),t=!0,ze(e),Wt(l)}})),Ut=()=>Ct((()=>Ae({}))),Xt=e=>Ct((e=>Al(k,e)?nt(e):0),e),Yt=(e,t)=>Ct(((e,t)=>ve(Gl(k,e),(l=>Al(l,t)?rt(e,l,t):0))),e,t),Zt=()=>Ct((()=>Ye({}))),_t=()=>Ct((()=>{Re({}),e=!1})),el=()=>Ct((()=>{ze({}),t=!1})),tl=(e,t)=>{if(-1!=r){ll();const l=e();return nl(t),l}},ll=()=>{var e;return-1!=r&&r++,1==r&&(null==(e=o[0])||e.call(o),me(de)),rl},nl=e=>{var t,b;return r>0&&(r--,0==r&&(r=1,vt(1),Fl(c)||It(1),ft(1),Fl(m)||wt(1),(null==e?void 0:e(rl))&&(Bl(c,((e,t)=>Bl(e,((e,l)=>Bl(e,(([e],n)=>Rt(rl,t,l,n,e))))))),Dl(c),Bl(m,(([e],t)=>jt(rl,t,e))),Dl(m)),me(ce[0],void 0),r=-1,vt(0),Fl(c)||It(0),ft(0),Fl(m)||wt(0),null==(t=o[1])||t.call(o),me(ce[1],void 0),null==(b=o[2])||b.call(o),r=0,l=zt(),n=Dt(),Le([a,s,i,d,u,c,p,h,m,g],Dl))),rl},rl={getContent:()=>[kt(),Vt()],getTables:kt,getTableIds:xt,getTable:e=>_l(Gl(k,ue(e))),getTableCellIds:Tt,getRowCount:St,getRowIds:Ot,getSortedRowIds:qt,getRow:(e,t)=>Zl(Gl(Gl(k,ue(e)),ue(t))),getCellIds:Pt,getCell:Nt,getValues:Vt,getValueIds:Mt,getValue:Lt,hasTables:zt,hasTable:$t,hasTableCell:At,hasRow:Ft,hasCell:Jt,hasValues:Dt,hasValue:Bt,getTablesJson:()=>_e(k),getValuesJson:()=>_e(x),getJson:()=>_e([k,x]),getTablesSchemaJson:()=>_e(b),getValuesSchemaJson:()=>_e(f),getSchemaJson:()=>_e([b,f]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:e=>Ct((()=>xe(e)?(([e,t])=>{(Ue(e)?Ut:Ht)(e),(Ue(t)?Zt:Wt)(t)})(e):0)),setTables:Ht,setTable:(e,t)=>Ct((e=>Te(t,e)?Fe(e,t):0),e),setRow:(e,t,l)=>Ct(((e,t)=>Se(e,t,l)?Je(e,lt(e),t,l):0),e,t),addRow:(e,t,l=!0)=>tl((()=>{let n;return Se(e,n,t)&&(e=ue(e),Je(e,lt(e),n=tt(e,l?1:0),t)),n})),setPartialRow:(e,t,l)=>Ct(((e,t)=>{if(Se(e,t,l,1)){const n=lt(e);Ke(l,((l,r)=>Be(e,n,t,r,l)))}}),e,t),setCell:(e,t,l,n)=>Ct(((e,t,l)=>ve(Oe(e,t,l,ye(n)?n(Nt(e,t,l)):n),(n=>Be(e,lt(e),t,l,n)))),e,t,l),setValues:Wt,setPartialValues:e=>Ct((()=>qe(e,1)?Ke(e,((e,t)=>et(t,e))):0)),setValue:(e,t)=>Ct((e=>ve(Pe(e,ye(t)?t(Lt(e)):t),(t=>et(e,t)))),e),applyChanges:e=>Ct((()=>{Ke(e[0],((e,t)=>be(e)?Xt(t):Ke(e,((e,l)=>be(e)?Yt(t,l):Ke(e,((e,n)=>Rt(rl,t,l,n,e))))))),Ke(e[1],((e,t)=>jt(rl,t,e)))})),setTablesJson:Qt,setValuesJson:e=>{try{We(Ze(e))}catch(e){}return rl},setJson:e=>Ct((()=>{try{const[t,l]=Ze(e);$e(t),We(l)}catch(t){Qt(e)}})),setTablesSchema:Gt,setValuesSchema:Kt,setSchema:(e,t)=>Ct((()=>{Gt(e),Kt(t)})),delTables:Ut,delTable:Xt,delRow:Yt,delCell:(e,t,l,n)=>Ct(((e,t,l)=>ve(Gl(k,e),(r=>ve(Gl(r,t),(o=>Al(o,l)?ot(e,r,t,o,l,n):0))))),e,t,l),delValues:Zt,delValue:e=>Ct((e=>Al(x,e)?at(e):0),e),delTablesSchema:_t,delValuesSchema:el,delSchema:()=>Ct((()=>{_t(),el()})),transaction:tl,startTransaction:ll,getTransactionChanges:()=>[Zl(c,((e,t)=>-1===Gl(a,t)?void 0:Zl(e,((e,l)=>-1===Gl(Gl(d,t),l)?void 0:Zl(e,(([,e])=>e),(e=>xn(e)))),Fl,Ue)),Fl,Ue),Zl(m,(([,e])=>e),(e=>xn(e))),1],getTransactionLog:()=>[!Fl(c),!Fl(m),en(c,kn,xn),en(p),Zl(m,kn,xn),Zl(g),Zl(a),_l(d),en(u),Zl(h)],finishTransaction:nl,forEachTable:e=>Bl(k,((t,l)=>e(l,(e=>Bl(t,((t,l)=>e(l,(e=>Kl(t,e))))))))),forEachTableCell:(e,t)=>Kl(Gl(C,ue(e)),t),forEachRow:(e,t)=>Bl(Gl(k,ue(e)),((e,l)=>t(l,(t=>Kl(e,t))))),forEachCell:(e,t,l)=>Kl(Gl(Gl(k,ue(e)),ue(t)),l),forEachValue:e=>Kl(x,e),addSortedRowIdsListener:(e,t,l,n,r,o,a)=>{let s=qt(e,t,l,n,r);return he((()=>{const a=qt(e,t,l,n,r);var i,d,u;d=s,Ce(i=a)===Ce(d)&&(u=(e,t)=>d[t]===e,i.every(u))||(s=a,o(rl,e,t,l,n,r,s))}),E[a?1:0],[e,t],[xt])},addStartTransactionListener:e=>he(e,de),addWillFinishTransactionListener:e=>he(e,ce[0]),addDidFinishTransactionListener:e=>he(e,ce[1]),callListener:e=>(ge(e),rl),delListener:e=>(pe(e),rl),getListenerStats:()=>({hasTables:wn(T),tables:wn(S),tableIds:wn(O),hasTable:wn(q),table:wn(P),tableCellIds:wn(N),hasTableCell:wn(V,zl),rowCount:wn(M),rowIds:wn(L),sortedRowIds:wn(E),hasRow:wn(R,zl),row:wn(j,zl),cellIds:wn(z,zl),hasCell:wn($,$l),cell:wn(A,$l),invalidCell:wn(F,$l),hasValues:wn(B),values:wn(H),valueIds:wn(Q),hasValue:wn(X),value:wn(ie),invalidValue:wn(J),transaction:jl(de)+wn(ce)}),isMergeable:()=>!1,createStore:Sn,addListener:he,callListeners:me,setInternalListeners:(e,t,l,n,r)=>o=[e,t,l,n,r]};return Ke({[U+Z]:[0,T,[],()=>[zt()]],[Z]:[0,S],[_]:[0,O],[U+Y]:[1,q,[xt],e=>[$t(...e)]],[Y]:[1,P,[xt]],[Y+re]:[1,N,[xt]],[U+Y+ne]:[2,V,[xt,Tt],e=>[At(...e)]],[te]:[1,M,[xt]],[le]:[1,L,[xt]],[U+ee]:[2,R,[xt,Ot],e=>[Ft(...e)]],[ee]:[2,j,[xt,Ot]],[re]:[2,z,[xt,Ot]],[U+ne]:[3,$,[xt,Ot,Pt],e=>[Jt(...e)]],[ne]:[3,A,[xt,Ot,Pt],e=>In(Nt(...e))],InvalidCell:[3,F],[U+ae]:[0,B,[],()=>[Dt()]],[ae]:[0,H],[se]:[0,Q],[U+oe]:[1,X,[Mt],e=>[Bt(...e)]],[oe]:[1,ie,[Mt],e=>In(Lt(e[0]))],InvalidValue:[1,J]},(([e,t,l,n],r)=>{rl["add"+r+"Listener"]=(...r)=>he(r[e],t[r[e+1]?1:0],e>0?we(r,0,e):void 0,l,n)})),He(rl)},On=({position:e="right",open:t=!1})=>{const l=A(Sn),n=lt.indexOf(e);return F(l,(e=>{return t=et,l=sessionStorage,((e,t,l,n,r,o,a,s={},i=[])=>{let d,u,c,h=0,m=0,p=0;Xl(hn,i,(()=>0)),Xl(mn,i,(()=>[]));const[g,b,v,f,y]=((e=1,t)=>1!=e&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!Ue(e)||!Ue(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!Ue(e)||!Ue(t),t.setContent]:ke("Store type not supported by this Persister"))(a,e),I=t=>{(g&&Ie(null==t?void 0:t[0])?1===(null==t?void 0:t[2])?e.applyMergeableChanges:e.setMergeableContent:1===(null==t?void 0:t[2])?e.applyChanges:e.setContent)(t)},w=e=>cn(void 0,null,(function*(){return 2!=h&&(h=1,m++,yield T((()=>cn(void 0,null,(function*(){try{const e=yield t();Ie(e)?I(e):ke("Content is not an array "+e)}catch(t){e&&y(e)}h=0}))))),S})),C=()=>(u&&(r(u),u=void 0),S),k=e=>cn(void 0,null,(function*(){return 1!=h&&(h=2,p++,yield T((()=>cn(void 0,null,(function*(){try{yield l(b,e)}catch(e){}h=0}))))),S})),x=()=>(ve(c,e.delListener),c=void 0,S),T=(...e)=>cn(void 0,null,(function*(){return je(Gl(mn,i),...e),yield cn(void 0,null,(function*(){if(!Gl(hn,i)){for(Ul(hn,i,1);!be(d=ze(Gl(mn,i)));)try{yield d()}catch(e){}Ul(hn,i,0)}})),S})),S=((e,t)=>{for(var l in t||(t={}))sn.call(t,l)&&un(e,l,t[l]);if(an)for(var l of an(t))dn.call(t,l)&&un(e,l,t[l]);return e})({load:w,startAutoLoad:e=>cn(void 0,null,(function*(){yield C().load(e);try{u=yield n(((e,t)=>cn(void 0,null,(function*(){t||e?2!=h&&(h=1,m++,I(null!=t?t:e),h=0):yield w()}))))}catch(e){}return S})),stopAutoLoad:C,isAutoLoading:()=>!be(u),save:k,startAutoSave:()=>cn(void 0,null,(function*(){return yield x().save(),c=e.addDidFinishTransactionListener((()=>{const e=v();f(e)&&k(e)})),S})),stopAutoSave:x,isAutoSaving:()=>!be(c),schedule:T,getStore:()=>e,destroy:()=>(Gl(mn,i).splice(0,void 0),C().stopAutoSave()),getStats:()=>({loads:m,saves:p})},s);return He(S)})(e,(()=>pn(void 0,null,(function*(){return e=l.getItem(t),Ze(e,((e,t)=>""===t?void 0:t));var e}))),(e=>pn(void 0,null,(function*(){return l.setItem(t,(n=e(),Ye(n,((e,t)=>void 0===t?"":t))));var n}))),(e=>{const n=n=>{if(n.storageArea===l&&n.key===t)try{e(Ze(n.newValue))}catch(t){e()}};return ce.addEventListener(gn,n),n}),(e=>ce.removeEventListener(gn,e)),0,3,{getStorageName:()=>t});var t,l}),void 0,(e=>{return l=function*(){yield e.load([{},{position:-1==n?1:n,open:!!t}]),yield e.startAutoSave()},new Promise(((e,t)=>{var n=e=>{try{o(l.next(e))}catch(e){t(e)}},r=e=>{try{o(l.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);o((l=l.apply(void 0,null)).next())}));var l})),Se(Te,null,Se("aside",{id:et},Se(Mt,{s:l}),Se(Ll,{s:l})),Se("style",null,Vt))};export{On as Inspector};
|
|
1
|
+
import e from"react";import{useCell as t,useValue as l,useSetValueCallback as n,useSetCellCallback as r,useValueIds as o,ValueView as a,useStoreOrStoreById as s,useRowCount as i,useSortedRowIds as d,useTableCellIds as u,useIndexesOrIndexesById as c,useSliceRowIds as h,useRelationshipsOrRelationshipsById as m,useRowIds as p,useResultRowCount as g,useResultSortedRowIds as b,useResultTableCellIds as v,useRemoteRowId as f,CellView as y,ResultCellView as I,useIndexes as w,useIndexIds as C,useSliceIds as k,useMetrics as x,useMetricIds as T,useMetric as S,useQueries as O,useQueryIds as q,useRelationships as P,useRelationshipIds as N,useStore as V,useTableIds as M,useValues as L,useStoreIds as E,useMetricsIds as R,useIndexesIds as j,useRelationshipsIds as z,useQueriesIds as $,useCreateStore as A,useCreatePersister as F}from"../../ui-react/with-schemas/index.js";const J=e=>typeof e,D="",B=J(D),H=J(!0),W=J(0),Q=J(J),G="type",K="default",U="Has",X="Ids",Y="Table",Z=Y+"s",_=Y+X,ee="Row",te=ee+"Count",le=ee+X,ne="Cell",re=ne+X,oe="Value",ae=oe+"s",se=oe+X,ie="currentTarget",de="value",ue=e=>D+e,ce=globalThis.window,he=Math,me=he.min,pe=he.floor,ge=isFinite,be=e=>null==e,ve=(e,t,l)=>be(e)?null==l?void 0:l():t(e),fe=e=>e==B||e==H,ye=e=>J(e)==Q,Ie=e=>Array.isArray(e),we=(e,t,l)=>e.slice(t,l),Ce=e=>e.length,ke=e=>{throw Error(e)},{PureComponent:xe,Fragment:Te,createElement:Se,useCallback:Oe,useLayoutEffect:qe,useRef:Pe,useState:Ne}=e,Ve=(e,...t)=>be(e)?{}:e(...t),Me=(e,t)=>e.sort(t),Le=(e,t)=>e.forEach(t),Ee=(e,t)=>e.map(t),Re=e=>0==Ce(e),je=(e,...t)=>e.push(...t),ze=e=>e.shift(),$e=Object,Ae=e=>$e.getPrototypeOf(e),Fe=$e.entries,Je=$e.isFrozen,De=e=>!be(e)&&ve(Ae(e),(e=>e==$e.prototype||be(Ae(e))),(()=>!0)),Be=$e.keys,He=$e.freeze,We=(e=[])=>$e.fromEntries(e),Qe=(e,t)=>t in e,Ge=(e,t)=>(delete e[t],e),Ke=(e,t)=>Ee(Fe(e),(([e,l])=>t(l,e))),Ue=e=>De(e)&&0==(e=>Ce(Be(e)))(e),Xe=(e,t,l,n=0)=>be(e)||!De(e)||!n&&Ue(e)||Je(e)?(null==l||l(),!1):(Ke(e,((l,n)=>{t(l,n)||Ge(e,n)})),!!n||!Ue(e)),Ye=JSON.stringify,Ze=JSON.parse,_e=e=>Ye(e,((e,t)=>t instanceof Map?$e.fromEntries([...t]):t)),et="tinybaseInspector",tt="TinyBase Inspector",lt=["left","top","bottom","right","full"],nt="state",rt="sort",ot="open",at="position",st=ot,it="editable",dt=(...e)=>_e(e),ut=(e,t)=>Ee(Me([...e]),t),ct=(e,l)=>[!!t(nt,e,it,l),Oe((t=>{l.setCell(nt,e,it,(e=>!e)),t.preventDefault()}),[l,e])],ht="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",mt='content:url("',pt=mt+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",gt='</svg>")',bt=mt+"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\")",vt=Ee([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,n])=>pt+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${n}' fill='white'/>`+gt)),ft=pt+"<path d='M20 20l60 60M20 80l60-60' />"+gt,yt=pt+`<path d='${ht}' />`+gt,It=pt+`<path d='${ht}M20 20l60 60' />`+gt;var wt=Object.defineProperty,Ct=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,xt=Object.getOwnPropertySymbols,Tt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,Ot=(e,t,l)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,qt=(e,t)=>{for(var l in t||(t={}))Tt.call(t,l)&&Ot(e,l,t[l]);if(xt)for(var l of xt(t))St.call(t,l)&&Ot(e,l,t[l]);return e},Pt=(e,t)=>Ct(e,kt(t));const Nt="*::-webkit-scrollbar",Vt=((e,t="")=>e.join(t))(Ke(Pt(qt(Pt(qt(Pt(qt({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[Nt]:"width:0.5rem;height:0.5rem;",[Nt+"-track"]:"background:#111",[Nt+"-thumb"]:"background:#999;border:1px solid #111",[Nt+"-thumb:hover"]:"background:#fff",[Nt+"-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;"+bt},We(Ee(["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;"}),We(Ee(["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)":bt,"header>img:nth-of-type(6)":ft}),We(Ee(vt,((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":yt,"details[open]>summary img.done":It,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,#${et} 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?`#${et} ${t}{${e}}`:""))),Mt=({s:e})=>{var t;const r=null!=(t=l(at,e))?t:1,o=n(st,(()=>!0),[],e);return l(st,e)?null:Se("img",{onClick:o,title:tt,"data-position":r})},Lt=({uniqueId:e,summary:l,editable:n,handleEditable:o,children:a,s:s})=>{const i=!!t(nt,e,ot,s),d=r(nt,e,ot,(e=>e[ie].open),[],s);return Se("details",{open:i,onToggle:d},Se("summary",null,l,o?Se("img",{onClick:o,className:n?"done":"edit"}):null),a)},Et=e=>{const t=J(e);return fe(t)||t==W&&ge(e)?t:void 0},Rt=(e,t,l,n,r)=>be(r)?e.delCell(t,l,n,!0):e.setCell(t,l,n,r),jt=(e,t,l)=>be(l)?e.delValue(t):e.setValue(t,l),zt=(e,t,l,n)=>e==B?t:e==W?l:n;var $t=Object.defineProperty,At=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,Ht=(e,t,l)=>t in e?$t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Wt=(e,t)=>{for(var l in t||(t={}))Dt.call(t,l)&&Ht(e,l,t[l]);if(Jt)for(var l of Jt(t))Bt.call(t,l)&&Ht(e,l,t[l]);return e},Qt=(e,t)=>At(e,Ft(t)),Gt=(e,t)=>{var l={};for(var n in e)Dt.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&Jt)for(var n of Jt(e))t.indexOf(n)<0&&Bt.call(e,n)&&(l[n]=e[n]);return l};const{useCallback:Kt,useMemo:Ut,useState:Xt}=e,Yt="editable",Zt=(e,t)=>Ee(u(e,t),(t=>e+"."+t)),_t=(e,t,l)=>{const n=Kt(e,t);return l?n:void 0},el=(...e)=>Ut((()=>e),e),tl=(e,t)=>Ut((()=>({store:e,tableId:t})),[e,t]),ll=(e,t)=>Ut((()=>({queries:e,queryId:t})),[e,t]),nl=(e,t=!1,l,n=0,r,o,a,s)=>{const[[i,d,u],c]=Xt([e,t,n]),h=Kt((e=>{c(e),null==s||s(e)}),[s]),m=_t((e=>h([e,e==i&&!d,u])),[h,i,d,u],l),p=Kt((e=>h([i,d,e])),[h,i,d]),g=!0===a?bl:a;return[[i,d,u],m,Ut((()=>!1===a?null:Se(g,{offset:u,limit:r,total:o,onChange:p})),[a,g,u,r,o,p])]},rl=(e,t,l)=>Ut((()=>{const n=null!=t?t:e;return r=Ie(n)?We(Ee(n,(e=>[e,e]))):n,o=(e,t)=>Wt(Wt({},{label:t,component:l}),J(e)==B?{label:e}:e),We(Ke(r,((e,t)=>[t,o(e,t)])));var r,o}),[t,l,e]),ol=({className:e,headerRow:t,idColumn:l,params:[n,r,o,a,s,i]})=>Se("table",{className:e},i?Se("caption",null,i):null,!1===t?null:Se("thead",null,Se("tr",null,!1===l?null:Se(al,{sort:null!=a?a:[],label:"Id",onClick:s}),Ke(n,(({label:e},t)=>Se(al,{key:t,cellId:t,label:e,sort:null!=a?a:[],onClick:s}))))),Se("tbody",null,Ee(o,(e=>Se("tr",{key:e},!1===l?null:Se("th",null,e),Ke(n,(({component:t,getComponentProps:l},n)=>Se("td",{key:n},Se(t,Qt(Wt(Wt({},Ve(l,e,n)),r),{rowId:e,cellId:n})))))))))),al=({cellId:e,sort:[t,l],label:n=(null!=e?e:D),onClick:r})=>Se("th",{onClick:_t((()=>null==r?void 0:r(e)),[r,e],r),className:be(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},be(l)||t!=e?null:(l?"↓":"↑")+" ",n),sl=({localRowId:t,params:[l,n,r,o,a,s,i]})=>{const d=f(a,t,s);return Se("tr",null,!1===l?null:Se(e.Fragment,null,Se("th",null,t),Se("th",null,d)),Ke(n,(({component:e,getComponentProps:l},n)=>{const[a,s]=n.split(".",2),u=a===r?t:a===o?d:null;return be(u)?null:Se("td",{key:n},Se(e,Qt(Wt({},Ve(l,u,s)),{store:i,tableId:a,rowId:u,cellId:s})))})))},il=({thing:e,onThingChange:t,className:l,hasSchema:n,showType:r=!0})=>{const[o,a]=Xt(),[s,i]=Xt(),[d,u]=Xt(),[c,h]=Xt(),[m,p]=Xt();s!==e&&(a(Et(e)),i(e),u(e+""),h(Number(e)||0),p(!!e));const g=Kt(((e,l)=>{l(e),i(e),t(e)}),[t]),b=Kt((()=>{if(!(null==n?void 0:n())){const e=zt(o,W,H,B),l=zt(e,d,c,m);a(e),i(l),t(l)}}),[n,t,d,c,m,o]);return Se("div",{className:l},r?Se("button",{className:o,onClick:b},o):null,zt(o,Se("input",{key:o,value:d,onChange:Kt((e=>g(e[ie][de]+"",u)),[g])}),Se("input",{key:o,type:"number",value:c,onChange:Kt((e=>g(Number(e[ie][de]||0),h)),[g])}),Se("input",{key:o,type:"checkbox",checked:m,onChange:Kt((e=>g(!!e[ie].checked,p)),[g])})))},dl=e=>{var t=e,{tableId:l,cellId:n,descending:r,offset:o,limit:a,store:s,editable:c,sortOnClick:h,paginator:m=!1,onChange:p,customCells:g}=t,b=Gt(t,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[v,f,I]=nl(n,r,h,o,a,i(l,s),m,p);return Se(ol,Qt(Wt({},b),{params:el(rl(u(l,s),g,c?pl:y),tl(s,l),d(l,...v,a,s),v,f,I)}))},ul=({store:e,editable:t=!1,valueComponent:l=(t?gl:a),getValueComponentProps:n,className:r,headerRow:s,idColumn:i})=>Se("table",{className:r},!1===s?null:Se("thead",null,Se("tr",null,!1===i?null:Se("th",null,"Id"),Se("th",null,oe))),Se("tbody",null,Ee(o(e),(t=>Se("tr",{key:t},!1===i?null:Se("th",null,t),Se("td",null,Se(l,Qt(Wt({},Ve(n,t)),{valueId:t,store:e})))))))),cl=e=>{var t=e,{indexId:l,sliceId:n,indexes:r,editable:o,customCells:a}=t,s=Gt(t,["indexId","sliceId","indexes","editable","customCells"]);const[i,d,m]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(c(r),l);return Se(ol,Qt(Wt({},s),{params:el(rl(u(m,d),a,o?pl:y),tl(d,m),h(l,n,i))}))},hl=({relationshipId:t,relationships:l,editable:n,customCells:r,className:o,headerRow:a,idColumn:s=!0})=>{const[i,d,u,c]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)])(m(l),t),h=rl([...Zt(u,d),...Zt(c,d)],r,n?pl:y),g=el(s,h,u,c,t,i,d);return Se("table",{className:o},!1===a?null:Se("thead",null,Se("tr",null,!1===s?null:Se(e.Fragment,null,Se("th",null,u,".Id"),Se("th",null,c,".Id")),Ke(h,(({label:e},t)=>Se("th",{key:t},e))))),Se("tbody",null,Ee(p(u,d),(e=>Se(sl,{key:e,localRowId:e,params:g})))))},ml=e=>{var t=e,{queryId:l,cellId:n,descending:r,offset:o,limit:a,queries:s,sortOnClick:i,paginator:d=!1,customCells:u,onChange:c}=t,h=Gt(t,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[m,p,f]=nl(n,r,i,o,a,g(l,s),d,c);return Se(ol,Qt(Wt({},h),{params:el(rl(v(l,s),u,I),ll(s,l),b(l,...m,a,s),m,p,f)}))},pl=({tableId:e,rowId:l,cellId:n,store:o,className:a,showType:i})=>{var d;return Se(il,{thing:t(e,l,n,o),onThingChange:r(e,l,n,(e=>e),[],o),className:null!=a?a:Yt+ne,showType:i,hasSchema:null==(d=s(o))?void 0:d.hasTablesSchema})},gl=({valueId:e,store:t,className:r,showType:o})=>{var a;return Se(il,{thing:l(e,t),onThingChange:n(e,(e=>e),[],t),className:null!=r?r:Yt+oe,showType:o,hasSchema:null==(a=s(t))?void 0:a.hasValuesSchema})},bl=({onChange:t,total:l,offset:n=0,limit:r=l,singular:o="row",plural:a=o+"s"})=>{(n>l||n<0)&&(n=0,t(0));const s=_t((()=>t(n-r)),[t,n,r],n>0),i=_t((()=>t(n+r)),[t,n,r],n+r<l);return Se(e.Fragment,null,l>r&&Se(e.Fragment,null,Se("button",{className:"previous",disabled:0==n,onClick:s},"←"),Se("button",{className:"next",disabled:n+r>=l,onClick:i},"→"),n+1," to ",me(l,n+r)," of "),l," ",1!=l?a:o)},vl=({indexes:e,indexesId:t,indexId:l,s:n})=>Se(Lt,{uniqueId:dt("i",t,l),summary:"Index: "+l,s:n},Ee(k(l,e),(r=>Se(fl,{indexes:e,indexesId:t,indexId:l,sliceId:r,s:n,key:r})))),fl=({indexes:e,indexesId:t,indexId:l,sliceId:n,s:r})=>{const o=dt("i",t,l,n),[a,s]=ct(o,r);return Se(Lt,{uniqueId:o,summary:"Slice: "+n,editable:a,handleEditable:s,s:r},Se(cl,{sliceId:n,indexId:l,indexes:e,editable:a}))},yl=({indexesId:e,s:t})=>{const l=w(e),n=C(l);return be(l)?null:Se(Lt,{uniqueId:dt("i",e),summary:"Indexes: "+(null!=e?e:K),s:t},Re(n)?"No indexes defined":ut(n,(n=>Se(vl,{indexes:l,indexesId:e,indexId:n,s:t,key:n}))))},Il=({metrics:e,metricId:t})=>Se("tr",null,Se("th",null,t),Se("td",null,null==e?void 0:e.getTableId(t)),Se("td",null,S(t,e))),wl=({metricsId:e,s:t})=>{const l=x(e),n=T(l);return be(l)?null:Se(Lt,{uniqueId:dt("m",e),summary:"Metrics: "+(null!=e?e:K),s:t},Re(n)?"No metrics defined":Se("table",null,Se("thead",null,Se("th",null,"Metric Id"),Se("th",null,"Table Id"),Se("th",null,"Metric")),Se("tbody",null,Ee(n,(e=>Se(Il,{metrics:l,metricId:e,key:e}))))))},Cl=({queries:e,queriesId:l,queryId:n,s:o})=>{var a;const s=dt("q",l,n),[i,d,u]=Ze(null!=(a=t(nt,s,rt,o))?a:"[]"),c=r(nt,s,rt,_e,[],o);return Se(Lt,{uniqueId:s,summary:"Query: "+n,s:o},Se(ml,{queryId:n,queries:e,cellId:i,descending:d,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:c}))},kl=({queriesId:e,s:t})=>{const l=O(e),n=q(l);return be(l)?null:Se(Lt,{uniqueId:dt("q",e),summary:"Queries: "+(null!=e?e:K),s:t},Re(n)?"No queries defined":ut(n,(n=>Se(Cl,{queries:l,queriesId:e,queryId:n,s:t,key:n}))))},xl=({relationships:e,relationshipsId:t,relationshipId:l,s:n})=>{const r=dt("r",t,l),[o,a]=ct(r,n);return Se(Lt,{uniqueId:r,summary:"Relationship: "+l,editable:o,handleEditable:a,s:n},Se(hl,{relationshipId:l,relationships:e,editable:o}))},Tl=({relationshipsId:e,s:t})=>{const l=P(e),n=N(l);return be(l)?null:Se(Lt,{uniqueId:dt("r",e),summary:"Relationships: "+(null!=e?e:K),s:t},Re(n)?"No relationships defined":ut(n,(n=>Se(xl,{relationships:l,relationshipsId:e,relationshipId:n,s:t,key:n}))))},Sl=({tableId:e,store:l,storeId:n,s:o})=>{var a;const s=dt("t",n,e),[i,d,u]=Ze(null!=(a=t(nt,s,rt,o))?a:"[]"),c=r(nt,s,rt,_e,[],o),[h,m]=ct(s,o);return Se(Lt,{uniqueId:s,summary:Y+": "+e,editable:h,handleEditable:m,s:o},Se(dl,{tableId:e,store:l,cellId:i,descending:d,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:c,editable:h}))},Ol=({store:e,storeId:t,s:l})=>{const n=dt("v",t),[r,a]=ct(n,l);return Re(o(e))?null:Se(Lt,{uniqueId:n,summary:ae,editable:r,handleEditable:a,s:l},Se(ul,{store:e,editable:r}))},ql=({storeId:e,s:t})=>{const l=V(e),n=M(l);return be(l)?null:Se(Lt,{uniqueId:dt("s",e),summary:(l.isMergeable()?"Mergeable":"")+"Store: "+(null!=e?e:K),s:t},Se(Ol,{storeId:e,store:l,s:t}),ut(n,(n=>Se(Sl,{store:l,storeId:e,tableId:n,s:t,key:n}))))},Pl=({s:e})=>{const t=Pe(null),l=Pe(0),[n,r]=Ne(!1),{scrollLeft:o,scrollTop:a}=L(e);qe((()=>{const e=t.current;if(e&&!n){const t=new MutationObserver((()=>{e.scrollWidth>=pe(o)+e.clientWidth&&e.scrollHeight>=pe(a)+e.clientHeight&&e.scrollTo(o,a)}));return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()}}),[n,o,a]);const s=Oe((t=>{const{scrollLeft:n,scrollTop:o}=t[ie];cancelIdleCallback(l.current),l.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:n,scrollTop:o})}))}),[e]),i=V(),d=E(),u=x(),c=R(),h=w(),m=j(),p=P(),g=z(),b=O(),v=$();return be(i)&&Re(d)&&be(u)&&Re(c)&&be(h)&&Re(m)&&be(p)&&Re(g)&&be(b)&&Re(v)?Se("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the Inspector inside a Provider component."):Se("article",{ref:t,onScroll:s},Se(ql,{s:e}),Ee(d,(t=>Se(ql,{storeId:t,s:e,key:t}))),Se(wl,{s:e}),Ee(c,(t=>Se(wl,{metricsId:t,s:e,key:t}))),Se(yl,{s:e}),Ee(m,(t=>Se(yl,{indexesId:t,s:e,key:t}))),Se(Tl,{s:e}),Ee(g,(t=>Se(Tl,{relationshipsId:t,s:e,key:t}))),Se(kl,{s:e}),Ee(v,(t=>Se(kl,{queriesId:t,s:e,key:t}))))};var Nl=Object.defineProperty;class Vl extends xe{constructor(e){var t,l,n;super(e),n=(e,t)=>console.error(e,t.componentStack),(l="componentDidCatch")in(t=this)?Nl(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,this.state={e:0}}static getDerivedStateFromError(){return{e:1}}render(){return this.state.e?Se("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const Ml=({s:e})=>{var t;const r=null!=(t=l(at,e))?t:1,o=n(st,(()=>!1),[],e),a=n(at,(e=>Number(e[ie].dataset.id)),[],e);return Se("header",null,Se("img",{title:tt}),Se("span",null,tt),Ee(lt,((e,t)=>t==r?null:Se("img",{onClick:a,"data-id":t,title:"Dock to "+e,key:t}))),Se("img",{onClick:o,title:"Close"}))},Ll=({s:e})=>{var t;const n=null!=(t=l(at,e))?t:1;return l(st,e)?Se("main",{"data-position":n},Se(Ml,{s:e}),Se(Vl,null,Se(Pl,{s:e}))):null},El=e=>t=>{return l=(t,l)=>t+e(l),Jl(t).reduce(l,0);var l},Rl=e=>{var t;return null!=(t=null==e?void 0:e.size)?t:0},jl=El(Rl),zl=El(jl),$l=El(zl),Al=(e,t)=>{var l;return null!=(l=null==e?void 0:e.has(t))&&l},Fl=e=>be(e)||0==Rl(e),Jl=e=>{var t;return[...null!=(t=null==e?void 0:e.values())?t:[]]},Dl=e=>e.clear(),Bl=(e,t)=>null==e?void 0:e.forEach(t),Hl=(e,t)=>null==e?void 0:e.delete(t),Wl=e=>new Map(e),Ql=e=>{var t;return[...null!=(t=null==e?void 0:e.keys())?t:[]]},Gl=(e,t)=>null==e?void 0:e.get(t),Kl=(e,t)=>Bl(e,((e,l)=>t(l,e))),Ul=(e,t,l)=>be(l)?(Hl(e,t),e):null==e?void 0:e.set(t,l),Xl=(e,t,l,n)=>(Al(e,t)?null==n||n(Gl(e,t)):Ul(e,t,l()),Gl(e,t)),Yl=(e,t,l,n=Ul)=>(Ke(t,((t,n)=>l(e,n,t))),Kl(e,(l=>Qe(t,l)?0:n(e,l))),e),Zl=(e,t,l,n)=>{const r={};return Bl(e,((e,o)=>{if(!(null==l?void 0:l(e,o))){const l=t?t(e,o):e;(null==n?void 0:n(l))||(r[o]=l)}})),r},_l=(e,t,l)=>Zl(e,(e=>Zl(e,t,l)),Fl,Ue),en=(e,t,l)=>Zl(e,(e=>_l(e,t,l)),Fl,Ue),tn=(e,t)=>{const l=Wl();return Bl(e,((e,n)=>{var r;return l.set(n,null!=(r=null==t?void 0:t(e))?r:e)})),l},ln=e=>tn(e,tn),nn=e=>tn(e,ln),rn=(e,t,l,n,r=0)=>ve((l?Xl:Gl)(e,t[r],r>Ce(t)-2?l:Wl),(o=>{if(r>Ce(t)-2)return(null==n?void 0:n(o))&&Ul(e,t[r]),o;const a=rn(o,t,l,n,r+1);return Fl(o)&&Ul(e,t[r]),a}));var on=Object.defineProperty,an=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,un=(e,t,l)=>t in e?on(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,cn=(e,t,l)=>new Promise(((n,r)=>{var o=e=>{try{s(l.next(e))}catch(e){r(e)}},a=e=>{try{s(l.throw(e))}catch(e){r(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((l=l.apply(e,t)).next())}));const hn=Wl(),mn=Wl();var pn=(e,t,l)=>new Promise(((n,r)=>{var o=e=>{try{s(l.next(e))}catch(e){r(e)}},a=e=>{try{s(l.throw(e))}catch(e){r(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);s((l=l.apply(e,t)).next())}));const gn="storage",bn=e=>new Set(Ie(e)||be(e)?e:[e]),vn=(e,t)=>null==e?void 0:e.add(t),fn=/^\d+$/,yn=()=>{const e=[];let t=0;return[l=>{var n;return null!=(n=l?ze(e):null)?n:D+t++},t=>{fn.test(t)&&Ce(e)<1e3&&je(e,t)}]},In=e=>[e,e],wn=(e,t=jl)=>t(e[0])+t(e[1]),Cn=()=>[Wl(),Wl()],kn=e=>[...e],xn=([e,t])=>e===t;Wl(Ee("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(D),((e,t)=>[e,t])));const Tn=(e,t,l)=>Ul(e,t,Gl(e,t)==-l?void 0:l),Sn=()=>{let e,t,l=!1,n=!1,r=0,o=[];const a=Wl(),s=Wl(),i=Wl(),d=Wl(),u=Wl(),c=Wl(),h=Wl(),m=Wl(),p=Wl(),g=Wl(),b=Wl(),v=Wl(),f=Wl(),y=Wl(),I=bn(),w=Wl(),C=Wl(),k=Wl(),x=Wl(),T=Cn(),S=Cn(),O=Cn(),q=Cn(),P=Cn(),N=Cn(),V=Cn(),M=Cn(),L=Cn(),E=Cn(),R=Cn(),j=Cn(),z=Cn(),$=Cn(),A=Cn(),F=Cn(),J=Cn(),B=Cn(),H=Cn(),Q=Cn(),X=Cn(),ie=Cn(),de=Wl(),ce=Cn(),[he,me,pe,ge]=(()=>{let e;const[t,l]=yn(),n=Wl();return[(l,r,o,a=[],s=()=>[])=>{null!=e||(e=rl);const i=t(1);return Ul(n,i,[l,r,o,a,s]),vn(rn(r,null!=o?o:[D],bn),i),i},(t,l,...r)=>Le(((e,t=[D])=>{const l=[],n=(e,r)=>r==Ce(t)?je(l,e):null===t[r]?Bl(e,(e=>n(e,r+1))):Le([t[r],null],(t=>n(Gl(e,t),r+1)));return n(e,0),l})(t,l),(t=>Bl(t,(t=>Gl(n,t)[0](e,...null!=l?l:[],...r))))),e=>ve(Gl(n,e),(([,t,r])=>(rn(t,null!=r?r:[D],void 0,(t=>(Hl(t,e),Fl(t)?1:0))),Ul(n,e),l(e),r))),t=>ve(Gl(n,t),(([t,,l=[],n,r])=>{const o=(...a)=>{var s,i;const d=Ce(a);d==Ce(l)?t(e,...a,...r(a)):be(l[d])?Le(null!=(i=null==(s=n[d])?void 0:s.call(n,...a))?i:[],(e=>o(...a,e))):o(...a,l[d])};o()}))]})(),ke=e=>{if(!Xe(e,((e,t)=>[G,K].includes(t))))return!1;const t=e[G];return!(!fe(t)&&t!=W||(Et(e[K])!=t&&Ge(e,K),0))},xe=Ie,Te=(t,l)=>(!e||Al(b,l)||mt(l))&&Xe(t,((e,t)=>Se(l,t,e)),(()=>mt(l))),Se=(e,t,l,n)=>Xe(n?l:Ne(l,e,t),((n,r)=>ve(Oe(e,t,r,n),(e=>(l[r]=e,!0)),(()=>!1))),(()=>mt(e,t))),Oe=(t,l,n,r)=>e?ve(Gl(Gl(b,t),n),(e=>Et(r)!=e[G]?mt(t,l,n,r,e[K]):r),(()=>mt(t,l,n,r))):be(Et(r))?mt(t,l,n,r):r,qe=(e,t)=>Xe(t?e:Ve(e),((t,l)=>ve(Pe(l,t),(t=>(e[l]=t,!0)),(()=>!1))),(()=>pt())),Pe=(e,l)=>t?ve(Gl(f,e),(t=>Et(l)!=t[G]?pt(e,l,t[K]):l),(()=>pt(e,l))):be(Et(l))?pt(e,l):l,Ne=(e,t,l)=>(ve(Gl(v,t),(([n,r])=>{Bl(n,((t,l)=>{Qe(e,l)||(e[l]=t)})),Bl(r,(n=>{Qe(e,n)||mt(t,l,n)}))})),e),Ve=e=>(t&&(Bl(y,((t,l)=>{Qe(e,l)||(e[l]=t)})),Bl(I,(t=>{Qe(e,t)||pt(t)}))),e),Re=e=>Yl(b,e,((e,t,l)=>{const n=Wl(),r=bn();Yl(Xl(b,t,Wl),l,((e,t,l)=>{Ul(e,t,l),ve(l[K],(e=>Ul(n,t,e)),(()=>vn(r,t)))})),Ul(v,t,[n,r])}),((e,t)=>{Ul(b,t),Ul(v,t)})),ze=e=>Yl(f,e,((e,t,l)=>{Ul(f,t,l),ve(l[K],(e=>Ul(y,t,e)),(()=>vn(I,t)))}),((e,t)=>{Ul(f,t),Ul(y,t),Hl(I,t)})),$e=e=>Ue(e)?Ut():Ht(e),Ae=e=>Yl(k,e,((e,t,l)=>Fe(t,l)),((e,t)=>nt(t))),Fe=(e,t)=>Yl(Xl(k,e,(()=>(st(e,1),Ul(w,e,yn()),Ul(C,e,Wl()),Wl()))),t,((t,l,n)=>Je(e,t,l,n)),((t,l)=>rt(e,t,l))),Je=(e,t,l,n,r)=>Yl(Xl(t,l,(()=>(it(e,l,1),Wl()))),n,((t,n,r)=>De(e,l,t,n,r)),((n,o)=>ot(e,t,l,n,o,r))),De=(e,t,l,n,r)=>{Al(l,n)||dt(e,t,n,1);const o=Gl(l,n);r!==o&&(ut(e,t,n,o,r),Ul(l,n,r))},Be=(e,t,l,n,r)=>ve(Gl(t,l),(t=>De(e,l,t,n,r)),(()=>Je(e,t,l,Ne({[n]:r},e,l)))),We=e=>Ue(e)?Zt():Wt(e),Ye=e=>Yl(x,e,((e,t,l)=>et(t,l)),((e,t)=>at(t))),et=(e,t)=>{Al(x,e)||ct(e,1);const l=Gl(x,e);t!==l&&(ht(e,l,t),Ul(x,e,t))},tt=(e,t)=>{const[l]=Gl(w,e),n=l(t);return Al(Gl(k,e),n)?tt(e,t):n},lt=e=>{var t;return null!=(t=Gl(k,e))?t:Fe(e,{})},nt=e=>Fe(e,{}),rt=(e,t,l)=>{const[,n]=Gl(w,e);n(l),Je(e,t,l,{},!0)},ot=(e,t,l,n,r,o)=>{var a;const s=Gl(null==(a=Gl(v,e))?void 0:a[0],r);if(!be(s)&&!o)return De(e,l,n,r,s);const i=t=>{ut(e,l,t,Gl(n,t)),dt(e,l,t,-1),Ul(n,t)};be(s)?i(r):Kl(n,i),Fl(n)&&(it(e,l,-1),Fl(Ul(t,l))&&(st(e,-1),Ul(k,e),Ul(w,e),Ul(C,e)))},at=e=>{const t=Gl(y,e);if(!be(t))return et(e,t);ht(e,Gl(x,e)),ct(e,-1),Ul(x,e)},st=(e,t)=>Tn(a,e,t),it=(e,t,l)=>Tn(Xl(d,e,Wl),t,l)&&Ul(i,e,Xl(i,e,(()=>0))+l),dt=(e,t,l,n)=>{var r;const o=Gl(C,e),a=null!=(r=Gl(o,l))?r:0;(0==a&&1==n||1==a&&-1==n)&&Tn(Xl(s,e,Wl),l,n),Ul(o,l,a!=-n?a+n:null),Tn(Xl(Xl(u,e,Wl),t,Wl),l,n)},ut=(e,t,l,n,r)=>{var a;Xl(Xl(Xl(c,e,Wl),t,Wl),l,(()=>[n,0]))[1]=r,null==(a=o[3])||a.call(o,e,t,l,r)},ct=(e,t)=>Tn(h,e,t),ht=(e,t,l)=>{var n;Xl(m,e,(()=>[t,0]))[1]=l,null==(n=o[4])||n.call(o,e,l)},mt=(e,t,l,n,r)=>(je(Xl(Xl(Xl(p,e,Wl),t,Wl),l,(()=>[])),n),r),pt=(e,t,l)=>(je(Xl(g,e,(()=>[])),t),l),gt=(e,t,l)=>ve(Gl(Gl(Gl(c,e),t),l),(([e,t])=>[!0,e,t]),(()=>[!1,...In(Nt(e,t,l))])),bt=e=>ve(Gl(m,e),(([e,t])=>[!0,e,t]),(()=>[!1,...In(Lt(e))])),vt=e=>Fl(p)||Fl(F[e])?0:Bl(e?nn(p):p,((t,l)=>Bl(t,((t,n)=>Bl(t,((t,r)=>me(F[e],[l,n,r],t))))))),ft=e=>Fl(g)||Fl(J[e])?0:Bl(e?tn(g):g,((t,l)=>me(J[e],[l],t))),yt=(e,t,l,n)=>{if(!Fl(e))return me(t,n,(()=>Zl(e))),Kl(e,((e,t)=>me(l,[...null!=n?n:[],e],1==t))),1},It=e=>{const t=zt();t!=l&&me(T[e],void 0,t);const n=Fl(E[e]),r=Fl(z[e])&&Fl($[e])&&Fl(L[e])&&Fl(R[e])&&Fl(N[e])&&Fl(V[e])&&Fl(M[e])&&n&&Fl(O[e])&&Fl(q[e]),o=Fl(A[e])&&Fl(j[e])&&Fl(P[e])&&Fl(S[e]);if(!r||!o){const t=e?[tn(a),ln(s),tn(i),ln(d),nn(u),nn(c)]:[a,s,i,d,u,c];if(!r){yt(t[0],O[e],q[e]),Bl(t[1],((t,l)=>yt(t,N[e],V[e],[l]))),Bl(t[2],((t,l)=>{0!=t&&me(M[e],[l],St(l))}));const l=bn();Bl(t[3],((t,r)=>{yt(t,L[e],R[e],[r])&&!n&&(me(E[e],[r,null]),vn(l,r))})),n||Bl(t[5],((t,n)=>{if(!Al(l,n)){const l=bn();Bl(t,(e=>Bl(e,(([t,n],r)=>n!==t?vn(l,r):Hl(e,r))))),Bl(l,(t=>me(E[e],[n,t])))}})),Bl(t[4],((t,l)=>Bl(t,((t,n)=>yt(t,z[e],$[e],[l,n])))))}if(!o){let l;Bl(t[5],((t,n)=>{let r;Bl(t,((t,o)=>{let a;Bl(t,(([t,s],i)=>{s!==t&&(me(A[e],[n,o,i],s,t,gt),l=r=a=1)})),a&&me(j[e],[n,o],gt)})),r&&me(P[e],[n],gt)})),l&&me(S[e],void 0,gt)}}},wt=e=>{const t=Dt();t!=n&&me(B[e],void 0,t);const l=Fl(Q[e])&&Fl(X[e]),r=Fl(ie[e])&&Fl(H[e]);if(!l||!r){const t=e?[tn(h),tn(m)]:[h,m];if(l||yt(t[0],Q[e],X[e]),!r){let l;Bl(t[1],(([t,n],r)=>{n!==t&&(me(ie[e],[r],n,t,bt),l=1)})),l&&me(H[e],void 0,bt)}}},Ct=(e,...t)=>(tl((()=>e(...Ee(t,ue)))),rl),kt=()=>en(k),xt=()=>Ql(k),Tt=e=>Ql(Gl(C,ue(e))),St=e=>Rl(Gl(k,ue(e))),Ot=e=>Ql(Gl(k,ue(e))),qt=(e,t,l,n=0,r)=>{return Ee(we(Me((o=Gl(k,ue(e)),a=(e,l)=>[be(t)?l:Gl(e,ue(t)),l],Ee([...null!=(s=null==o?void 0:o.entries())?s:[]],(([e,t])=>a(t,e)))),(([e],[t])=>{return((null!=(n=e)?n:0)<(null!=(r=t)?r:0)?-1:1)*(l?-1:1);var n,r})),n,be(r)?r:n+r),(([,e])=>e));var o,a,s},Pt=(e,t)=>Ql(Gl(Gl(k,ue(e)),ue(t))),Nt=(e,t,l)=>Gl(Gl(Gl(k,ue(e)),ue(t)),ue(l)),Vt=()=>Zl(x),Mt=()=>Ql(x),Lt=e=>Gl(x,ue(e)),zt=()=>!Fl(k),$t=e=>Al(k,ue(e)),At=(e,t)=>Al(Gl(C,ue(e)),ue(t)),Ft=(e,t)=>Al(Gl(k,ue(e)),ue(t)),Jt=(e,t,l)=>Al(Gl(Gl(k,ue(e)),ue(t)),ue(l)),Dt=()=>!Fl(x),Bt=e=>Al(x,ue(e)),Ht=e=>Ct((()=>(e=>Xe(e,Te,mt))(e)?Ae(e):0)),Wt=e=>Ct((()=>qe(e)?Ye(e):0)),Qt=e=>{try{$e(Ze(e))}catch(e){}return rl},Gt=t=>Ct((()=>{if((e=Xe(t,(e=>Xe(e,ke))))&&(Re(t),!Fl(k))){const e=kt();Ut(),Ht(e)}})),Kt=e=>Ct((()=>{if(t=(e=>Xe(e,ke))(e)){const l=Vt();el(),Zt(),t=!0,ze(e),Wt(l)}})),Ut=()=>Ct((()=>Ae({}))),Xt=e=>Ct((e=>Al(k,e)?nt(e):0),e),Yt=(e,t)=>Ct(((e,t)=>ve(Gl(k,e),(l=>Al(l,t)?rt(e,l,t):0))),e,t),Zt=()=>Ct((()=>Ye({}))),_t=()=>Ct((()=>{Re({}),e=!1})),el=()=>Ct((()=>{ze({}),t=!1})),tl=(e,t)=>{if(-1!=r){ll();const l=e();return nl(t),l}},ll=()=>{var e;return-1!=r&&r++,1==r&&(null==(e=o[0])||e.call(o),me(de)),rl},nl=e=>{var t,b;return r>0&&(r--,0==r&&(r=1,vt(1),Fl(c)||It(1),ft(1),Fl(m)||wt(1),(null==e?void 0:e(rl))&&(Bl(c,((e,t)=>Bl(e,((e,l)=>Bl(e,(([e],n)=>Rt(rl,t,l,n,e))))))),Dl(c),Bl(m,(([e],t)=>jt(rl,t,e))),Dl(m)),me(ce[0],void 0),r=-1,vt(0),Fl(c)||It(0),ft(0),Fl(m)||wt(0),null==(t=o[1])||t.call(o),me(ce[1],void 0),null==(b=o[2])||b.call(o),r=0,l=zt(),n=Dt(),Le([a,s,i,d,u,c,p,h,m,g],Dl))),rl},rl={getContent:()=>[kt(),Vt()],getTables:kt,getTableIds:xt,getTable:e=>_l(Gl(k,ue(e))),getTableCellIds:Tt,getRowCount:St,getRowIds:Ot,getSortedRowIds:qt,getRow:(e,t)=>Zl(Gl(Gl(k,ue(e)),ue(t))),getCellIds:Pt,getCell:Nt,getValues:Vt,getValueIds:Mt,getValue:Lt,hasTables:zt,hasTable:$t,hasTableCell:At,hasRow:Ft,hasCell:Jt,hasValues:Dt,hasValue:Bt,getTablesJson:()=>_e(k),getValuesJson:()=>_e(x),getJson:()=>_e([k,x]),getTablesSchemaJson:()=>_e(b),getValuesSchemaJson:()=>_e(f),getSchemaJson:()=>_e([b,f]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:e=>Ct((()=>xe(e)?(([e,t])=>{(Ue(e)?Ut:Ht)(e),(Ue(t)?Zt:Wt)(t)})(e):0)),setTables:Ht,setTable:(e,t)=>Ct((e=>Te(t,e)?Fe(e,t):0),e),setRow:(e,t,l)=>Ct(((e,t)=>Se(e,t,l)?Je(e,lt(e),t,l):0),e,t),addRow:(e,t,l=!0)=>tl((()=>{let n;return Se(e,n,t)&&(e=ue(e),Je(e,lt(e),n=tt(e,l?1:0),t)),n})),setPartialRow:(e,t,l)=>Ct(((e,t)=>{if(Se(e,t,l,1)){const n=lt(e);Ke(l,((l,r)=>Be(e,n,t,r,l)))}}),e,t),setCell:(e,t,l,n)=>Ct(((e,t,l)=>ve(Oe(e,t,l,ye(n)?n(Nt(e,t,l)):n),(n=>Be(e,lt(e),t,l,n)))),e,t,l),setValues:Wt,setPartialValues:e=>Ct((()=>qe(e,1)?Ke(e,((e,t)=>et(t,e))):0)),setValue:(e,t)=>Ct((e=>ve(Pe(e,ye(t)?t(Lt(e)):t),(t=>et(e,t)))),e),applyChanges:e=>Ct((()=>{Ke(e[0],((e,t)=>be(e)?Xt(t):Ke(e,((e,l)=>be(e)?Yt(t,l):Ke(e,((e,n)=>Rt(rl,t,l,n,e))))))),Ke(e[1],((e,t)=>jt(rl,t,e)))})),setTablesJson:Qt,setValuesJson:e=>{try{We(Ze(e))}catch(e){}return rl},setJson:e=>Ct((()=>{try{const[t,l]=Ze(e);$e(t),We(l)}catch(t){Qt(e)}})),setTablesSchema:Gt,setValuesSchema:Kt,setSchema:(e,t)=>Ct((()=>{Gt(e),Kt(t)})),delTables:Ut,delTable:Xt,delRow:Yt,delCell:(e,t,l,n)=>Ct(((e,t,l)=>ve(Gl(k,e),(r=>ve(Gl(r,t),(o=>Al(o,l)?ot(e,r,t,o,l,n):0))))),e,t,l),delValues:Zt,delValue:e=>Ct((e=>Al(x,e)?at(e):0),e),delTablesSchema:_t,delValuesSchema:el,delSchema:()=>Ct((()=>{_t(),el()})),transaction:tl,startTransaction:ll,getTransactionChanges:()=>[Zl(c,((e,t)=>-1===Gl(a,t)?void 0:Zl(e,((e,l)=>-1===Gl(Gl(d,t),l)?void 0:Zl(e,(([,e])=>e),(e=>xn(e)))),Fl,Ue)),Fl,Ue),Zl(m,(([,e])=>e),(e=>xn(e))),1],getTransactionLog:()=>[!Fl(c),!Fl(m),en(c,kn,xn),en(p),Zl(m,kn,xn),Zl(g),Zl(a),_l(d),en(u),Zl(h)],finishTransaction:nl,forEachTable:e=>Bl(k,((t,l)=>e(l,(e=>Bl(t,((t,l)=>e(l,(e=>Kl(t,e))))))))),forEachTableCell:(e,t)=>Kl(Gl(C,ue(e)),t),forEachRow:(e,t)=>Bl(Gl(k,ue(e)),((e,l)=>t(l,(t=>Kl(e,t))))),forEachCell:(e,t,l)=>Kl(Gl(Gl(k,ue(e)),ue(t)),l),forEachValue:e=>Kl(x,e),addSortedRowIdsListener:(e,t,l,n,r,o,a)=>{let s=qt(e,t,l,n,r);return he((()=>{const a=qt(e,t,l,n,r);var i,d,u;d=s,Ce(i=a)===Ce(d)&&(u=(e,t)=>d[t]===e,i.every(u))||(s=a,o(rl,e,t,l,n,r,s))}),E[a?1:0],[e,t],[xt])},addStartTransactionListener:e=>he(e,de),addWillFinishTransactionListener:e=>he(e,ce[0]),addDidFinishTransactionListener:e=>he(e,ce[1]),callListener:e=>(ge(e),rl),delListener:e=>(pe(e),rl),getListenerStats:()=>({hasTables:wn(T),tables:wn(S),tableIds:wn(O),hasTable:wn(q),table:wn(P),tableCellIds:wn(N),hasTableCell:wn(V,zl),rowCount:wn(M),rowIds:wn(L),sortedRowIds:wn(E),hasRow:wn(R,zl),row:wn(j,zl),cellIds:wn(z,zl),hasCell:wn($,$l),cell:wn(A,$l),invalidCell:wn(F,$l),hasValues:wn(B),values:wn(H),valueIds:wn(Q),hasValue:wn(X),value:wn(ie),invalidValue:wn(J),transaction:jl(de)+wn(ce)}),isMergeable:()=>!1,createStore:Sn,addListener:he,callListeners:me,setInternalListeners:(e,t,l,n,r)=>o=[e,t,l,n,r]};return Ke({[U+Z]:[0,T,[],()=>[zt()]],[Z]:[0,S],[_]:[0,O],[U+Y]:[1,q,[xt],e=>[$t(...e)]],[Y]:[1,P,[xt]],[Y+re]:[1,N,[xt]],[U+Y+ne]:[2,V,[xt,Tt],e=>[At(...e)]],[te]:[1,M,[xt]],[le]:[1,L,[xt]],[U+ee]:[2,R,[xt,Ot],e=>[Ft(...e)]],[ee]:[2,j,[xt,Ot]],[re]:[2,z,[xt,Ot]],[U+ne]:[3,$,[xt,Ot,Pt],e=>[Jt(...e)]],[ne]:[3,A,[xt,Ot,Pt],e=>In(Nt(...e))],InvalidCell:[3,F],[U+ae]:[0,B,[],()=>[Dt()]],[ae]:[0,H],[se]:[0,Q],[U+oe]:[1,X,[Mt],e=>[Bt(...e)]],[oe]:[1,ie,[Mt],e=>In(Lt(e[0]))],InvalidValue:[1,J]},(([e,t,l,n],r)=>{rl["add"+r+"Listener"]=(...r)=>he(r[e],t[r[e+1]?1:0],e>0?we(r,0,e):void 0,l,n)})),He(rl)},On=({position:e="right",open:t=!1})=>{const l=A(Sn),n=lt.indexOf(e);return F(l,(e=>{return t=et,l=sessionStorage,((e,t,l,n,r,o,a,s={},i=[])=>{let d,u,c,h=0,m=0,p=0;Xl(hn,i,(()=>0)),Xl(mn,i,(()=>[]));const[g,b,v,f,y]=((e=1,t)=>1!=e&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!Ue(e)||!Ue(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!Ue(e)||!Ue(t),t.setContent]:ke("Store type not supported by this Persister"))(a,e),I=t=>{(g&&Ie(null==t?void 0:t[0])?1===(null==t?void 0:t[2])?e.applyMergeableChanges:e.setMergeableContent:1===(null==t?void 0:t[2])?e.applyChanges:e.setContent)(t)},w=e=>cn(void 0,null,(function*(){return 2!=h&&(h=1,m++,yield T((()=>cn(void 0,null,(function*(){try{const e=yield t();Ie(e)?I(e):ke("Content is not an array "+e)}catch(t){e&&y(e)}h=0}))))),S})),C=()=>(u&&(r(u),u=void 0),S),k=e=>cn(void 0,null,(function*(){return 1!=h&&(h=2,p++,yield T((()=>cn(void 0,null,(function*(){try{yield l(b,e)}catch(e){}h=0}))))),S})),x=()=>(ve(c,e.delListener),c=void 0,S),T=(...e)=>cn(void 0,null,(function*(){return je(Gl(mn,i),...e),yield cn(void 0,null,(function*(){if(!Gl(hn,i)){for(Ul(hn,i,1);!be(d=ze(Gl(mn,i)));)try{yield d()}catch(e){}Ul(hn,i,0)}})),S})),S=((e,t)=>{for(var l in t||(t={}))sn.call(t,l)&&un(e,l,t[l]);if(an)for(var l of an(t))dn.call(t,l)&&un(e,l,t[l]);return e})({load:w,startAutoLoad:e=>cn(void 0,null,(function*(){yield C().load(e);try{u=yield n(((e,t)=>cn(void 0,null,(function*(){t||e?2!=h&&(h=1,m++,I(null!=t?t:e),h=0):yield w()}))))}catch(e){}return S})),stopAutoLoad:C,isAutoLoading:()=>!be(u),save:k,startAutoSave:()=>cn(void 0,null,(function*(){return yield x().save(),c=e.addDidFinishTransactionListener((()=>{const e=v();f(e)&&k(e)})),S})),stopAutoSave:x,isAutoSaving:()=>!be(c),schedule:T,getStore:()=>e,destroy:()=>(Gl(mn,i).splice(0,void 0),C().stopAutoSave()),getStats:()=>({loads:m,saves:p})},s);return He(S)})(e,(()=>pn(void 0,null,(function*(){return e=l.getItem(t),Ze(e,((e,t)=>""===t?void 0:t));var e}))),(e=>pn(void 0,null,(function*(){return l.setItem(t,(n=e(),Ye(n,((e,t)=>void 0===t?"":t))));var n}))),(e=>{const n=n=>{if(n.storageArea===l&&n.key===t)try{e(Ze(n.newValue))}catch(t){e()}};return ce.addEventListener(gn,n),n}),(e=>ce.removeEventListener(gn,e)),0,3,{getStorageName:()=>t});var t,l}),void 0,(e=>{return l=function*(){yield e.load([{},{position:-1==n?1:n,open:!!t}]),yield e.startAutoSave()},new Promise(((e,t)=>{var n=e=>{try{o(l.next(e))}catch(e){t(e)}},r=e=>{try{o(l.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);o((l=l.apply(void 0,null)).next())}));var l})),Se(Te,null,Se("aside",{id:et},Se(Mt,{s:l}),Se(Ll,{s:l})),Se("style",null,Vt))};export{On as Inspector};
|
|
Binary file
|
package/es6/ui-react/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
const getTypeOf = (thing) => typeof thing;
|
|
4
|
+
const TINYBASE = 'tinybase';
|
|
4
5
|
const EMPTY_STRING = '';
|
|
5
6
|
const STRING = getTypeOf(EMPTY_STRING);
|
|
6
7
|
const FUNCTION = getTypeOf(getTypeOf);
|
|
@@ -24,6 +25,7 @@ const VALUE = 'Value';
|
|
|
24
25
|
const VALUES = VALUE + 's';
|
|
25
26
|
const VALUE_IDS = VALUE + IDS;
|
|
26
27
|
|
|
28
|
+
const GLOBAL = globalThis;
|
|
27
29
|
const isUndefined = (thing) => thing == void 0;
|
|
28
30
|
const ifNotUndefined = (value, then, otherwise) =>
|
|
29
31
|
isUndefined(value) ? (otherwise == null ? void 0 : otherwise()) : then(value);
|
|
@@ -57,6 +59,7 @@ const isObject = (obj) =>
|
|
|
57
59
|
);
|
|
58
60
|
const objIds = object.keys;
|
|
59
61
|
const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
|
|
62
|
+
const objHas = (obj, id) => id in obj;
|
|
60
63
|
const objDel = (obj, id) => {
|
|
61
64
|
delete obj[id];
|
|
62
65
|
return obj;
|
|
@@ -75,9 +78,15 @@ const objIsEqual = (obj1, obj2) => {
|
|
|
75
78
|
)
|
|
76
79
|
);
|
|
77
80
|
};
|
|
81
|
+
const objEnsure = (obj, id, getDefaultValue) => {
|
|
82
|
+
if (!objHas(obj, id)) {
|
|
83
|
+
obj[id] = getDefaultValue();
|
|
84
|
+
}
|
|
85
|
+
return obj[id];
|
|
86
|
+
};
|
|
78
87
|
|
|
79
88
|
const {createContext, useContext: useContext$1, useEffect: useEffect$1} = React;
|
|
80
|
-
const Context = createContext([]);
|
|
89
|
+
const Context = objEnsure(GLOBAL, TINYBASE + '_uirc', () => createContext([]));
|
|
81
90
|
const useThing = (id, offset) => {
|
|
82
91
|
var _a;
|
|
83
92
|
const contextValue = useContext$1(Context);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
const getTypeOf = (thing) => typeof thing;
|
|
4
|
+
const TINYBASE = 'tinybase';
|
|
4
5
|
const EMPTY_STRING = '';
|
|
5
6
|
const STRING = getTypeOf(EMPTY_STRING);
|
|
6
7
|
const FUNCTION = getTypeOf(getTypeOf);
|
|
@@ -24,6 +25,7 @@ const VALUE = 'Value';
|
|
|
24
25
|
const VALUES = VALUE + 's';
|
|
25
26
|
const VALUE_IDS = VALUE + IDS;
|
|
26
27
|
|
|
28
|
+
const GLOBAL = globalThis;
|
|
27
29
|
const isUndefined = (thing) => thing == void 0;
|
|
28
30
|
const ifNotUndefined = (value, then, otherwise) =>
|
|
29
31
|
isUndefined(value) ? (otherwise == null ? void 0 : otherwise()) : then(value);
|
|
@@ -57,6 +59,7 @@ const isObject = (obj) =>
|
|
|
57
59
|
);
|
|
58
60
|
const objIds = object.keys;
|
|
59
61
|
const objGet = (obj, id) => ifNotUndefined(obj, (obj2) => obj2[id]);
|
|
62
|
+
const objHas = (obj, id) => id in obj;
|
|
60
63
|
const objDel = (obj, id) => {
|
|
61
64
|
delete obj[id];
|
|
62
65
|
return obj;
|
|
@@ -75,9 +78,15 @@ const objIsEqual = (obj1, obj2) => {
|
|
|
75
78
|
)
|
|
76
79
|
);
|
|
77
80
|
};
|
|
81
|
+
const objEnsure = (obj, id, getDefaultValue) => {
|
|
82
|
+
if (!objHas(obj, id)) {
|
|
83
|
+
obj[id] = getDefaultValue();
|
|
84
|
+
}
|
|
85
|
+
return obj[id];
|
|
86
|
+
};
|
|
78
87
|
|
|
79
88
|
const {createContext, useContext: useContext$1, useEffect: useEffect$1} = React;
|
|
80
|
-
const Context = createContext([]);
|
|
89
|
+
const Context = objEnsure(GLOBAL, TINYBASE + '_uirc', () => createContext([]));
|
|
81
90
|
const useThing = (id, offset) => {
|
|
82
91
|
var _a;
|
|
83
92
|
const contextValue = useContext$1(Context);
|
|
@@ -201,7 +201,7 @@ const POSITION_VALUE = 'position';
|
|
|
201
201
|
const OPEN_VALUE = OPEN_CELL;
|
|
202
202
|
const EDITABLE_CELL = 'editable';
|
|
203
203
|
const getUniqueId = (...args) => jsonStringWithMap(args);
|
|
204
|
-
const sortedIdsMap = (ids, callback) => arrayMap(arraySort(ids), callback);
|
|
204
|
+
const sortedIdsMap = (ids, callback) => arrayMap(arraySort([...ids]), callback);
|
|
205
205
|
const useEditable = (uniqueId, s) => [
|
|
206
206
|
!!useCell(STATE_TABLE, uniqueId, EDITABLE_CELL, s),
|
|
207
207
|
useCallback$1(
|
|
@@ -201,7 +201,7 @@ const POSITION_VALUE = 'position';
|
|
|
201
201
|
const OPEN_VALUE = OPEN_CELL;
|
|
202
202
|
const EDITABLE_CELL = 'editable';
|
|
203
203
|
const getUniqueId = (...args) => jsonStringWithMap(args);
|
|
204
|
-
const sortedIdsMap = (ids, callback) => arrayMap(arraySort(ids), callback);
|
|
204
|
+
const sortedIdsMap = (ids, callback) => arrayMap(arraySort([...ids]), callback);
|
|
205
205
|
const useEditable = (uniqueId, s) => [
|
|
206
206
|
!!useCell(STATE_TABLE, uniqueId, EDITABLE_CELL, s),
|
|
207
207
|
useCallback$1(
|
package/min/ui-react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",i="Table",a=i+"s",l=i+c,I="Row",p=I+"Count",g=I+c,b="Sorted"+I+c,C="Cell",m=C+c,y="Value",w=y+"s",k=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:ie,useRef:ae,useState:le,useSyncExternalStore:Ie}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=le(),[r,d]=le();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},we=(e,t,s,r=pe)=>{const d=ae(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return Ie(c,n)},ke=(e,t,o,s=pe,r=pe,...d)=>ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...Re(n,s,e),o),o)))))),[u,t,...s,...d,...fe(n)])},Re=(e,t,o)=>L(e,(e=>v(e)?e(o,t):e)),fe=e=>{return t=e=>!v(e),e.filter(t);var t},ve=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((e=>o(d?.["del"+t](...Re(r,d,e)))),[d,t,...s,...fe(r)])},qe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},Pe=(e,t=pe)=>ce(e,t),xe=(e,t=pe)=>ce(e,t),Se=()=>G(1),Le=e=>we(a,K(e),4,[]),Be=e=>we(a,K(e),0),Te=e=>we(l,K(e),1),Ee=(e,t)=>we(i,K(t),4,[e]),Me=(e,t)=>we(i,K(t),0,[e]),Fe=(e,t)=>we(i+m,K(t),1,[e]),Ve=(e,t,o)=>we(i+C,K(o),4,[e,t]),Ae=(e,t)=>we(p,K(t),5,[e]),Oe=(e,t)=>we(g,K(t),1,[e]),je=(e,t,o,s=0,r,d)=>we(b,K(d),1,[e,t,o,s,r]),De=(e,t,o)=>we(I,K(o),4,[e,t]),He=(e,t,o)=>we(I,K(o),0,[e,t]),Qe=(e,t,o)=>we(m,K(o),1,[e,t]),We=(e,t,o,s)=>we(C,K(s),4,[e,t,o]),ze=(e,t,o,s)=>we(C,K(s),3,[e,t,o]),Ge=e=>we(w,K(e),4,[]),Je=e=>we(w,K(e),0),Ke=e=>we(k,K(e),1),Ne=(e,t)=>we(y,K(t),4,[e]),Ue=(e,t)=>we(y,K(t),3,[e]),Xe=(e,t,o,s,r)=>he(o,a,e,t,s,r),Ye=(e,t,o,s,r,d)=>he(s,i,t,o,r,d,e),Ze=(e,t,o,s,r,d,n)=>he(r,I,o,s,d,n,e,t),$e=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},_e=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),et=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),tt=(e,t,o,s,r)=>he(o,w,e,t,s,r),ot=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),st=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),rt=(e,t,o)=>ve(e,a,t,o),dt=(e,t,o,s)=>ve(t,i,o,s,e),nt=(e,t,o,s,r)=>ve(o,I,s,r,e,t),ut=(e,t,o,s,r,d,n)=>ve(r,C,d,n,e,t,o,s),ct=(e,t,o)=>ve(e,w,t,o),it=(e,t,o,s)=>ve(t,y,o,s,e),at=(e,t,o,s)=>ke(u+a,K(s),e,t,[],o),lt=(e,t,o,s)=>ke(a,K(s),e,t,pe,o),It=(e,t,o,s)=>ke(l,K(s),e,t,pe,o),pt=(e,t,o,s,r)=>ke(u+i,K(r),t,o,[e],s),gt=(e,t,o,s,r)=>ke(i,K(r),t,o,[e],s),bt=(e,t,o,s,r)=>ke(i+m,K(r),t,o,[e],s),Ct=(e,t,o,s,r,d)=>ke(u+i+C,K(d),o,s,[e,t],r),mt=(e,t,o,s,r)=>ke(p,K(r),t,o,[e],s),yt=(e,t,o,s,r)=>ke(g,K(r),t,o,[e],s),wt=(e,t,o,s,r,d,n,u,c)=>ke(b,K(c),d,n,[e,t,o,s,r],u),kt=(e,t,o,s,r,d)=>ke(u+I,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d)=>ke(I,K(d),o,s,[e,t],r),Rt=(e,t,o,s,r,d)=>ke(m,K(d),o,s,[e,t],r),ft=(e,t,o,s,r,d,n)=>ke(u+C,K(n),s,r,[e,t,o],d),vt=(e,t,o,s,r,d,n)=>ke(C,K(n),s,r,[e,t,o],d),qt=(e,t,o,s)=>ke(u+w,K(s),e,t,[],o),Pt=(e,t,o,s)=>ke(w,K(s),e,t,pe,o),xt=(e,t,o,s)=>ke(k,K(s),e,t,pe,o),St=(e,t,o,s,r)=>ke(u+y,K(r),t,o,[e],s),Lt=(e,t,o,s,r)=>ke(y,K(r),t,o,[e],s),Bt=(e,t,o)=>ke("Start"+de,K(o),e,t),Tt=(e,t,o)=>ke("WillFinish"+de,K(o),e,t),Et=(e,t,o)=>ke("DidFinish"+de,K(o),e,t),Mt=(e,t,o)=>me(e,t,o),Ft=()=>G(3),Vt=e=>we("MetricIds",X(e),1),At=(e,t)=>we("Metric",X(t),3,[e]),Ot=(e,t,o,s)=>ke("Metric",X(s),t,o,[e]),jt=(e,t,o)=>me(e,t,o),Dt=()=>G(5),Ht=(e,t)=>we("SliceIds",Z(t),1,[e]),Qt=e=>we("IndexIds",Z(e),1),Wt=(e,t,o)=>we("Slice"+g,Z(o),1,[e,t]),zt=(e,t,o,s)=>ke("SliceIds",Z(s),t,o,[e]),Gt=(e,t,o,s,r)=>ke("Slice"+g,Z(r),o,s,[e,t]),Jt=(e,t,o)=>me(e,t,o),Kt=()=>G(7),Nt=e=>we("RelationshipIds",_(e),1),Ut=(e,t,o)=>we("RemoteRowId",_(o),3,[e,t]),Xt=(e,t,o)=>we("Local"+g,_(o),1,[e,t]),Yt=(e,t,o)=>we("Linked"+g,_(o),1,[e,t]),Zt=(e,t,o,s,r)=>ke("RemoteRowId",_(r),o,s,[e,t]),$t=(e,t,o,s,r)=>ke("Local"+g,_(r),o,s,[e,t]),_t=(e,t,o,s,r)=>ke("Linked"+g,_(r),o,s,[e,t]),eo=(e,t,o)=>me(e,t,o),to=()=>G(9),oo=e=>we("QueryIds",te(e),1),so=(e,t)=>we(n+i,te(t),0,[e]),ro=(e,t)=>we(n+i+m,te(t),1,[e]),no=(e,t)=>we(n+p,te(t),5,[e]),uo=(e,t)=>we(n+g,te(t),1,[e]),co=(e,t,o,s=0,r,d)=>we(n+b,te(d),1,[e,t,o,s,r]),io=(e,t,o)=>we(n+I,te(o),0,[e,t]),ao=(e,t,o)=>we(n+m,te(o),1,[e,t]),lo=(e,t,o,s)=>we(n+C,te(s),3,[e,t,o]),Io=(e,t,o,s)=>ke(n+i,te(s),t,o,[e]),po=(e,t,o,s)=>ke(n+i+m,te(s),t,o,[e]),go=(e,t,o,s)=>ke(n+p,te(s),t,o,[e]),bo=(e,t,o,s)=>ke(n+g,te(s),t,o,[e]),Co=(e,t,o,s,r,d,u,c)=>ke(n+b,te(c),d,u,[e,t,o,s,r]),mo=(e,t,o,s,r)=>ke(n+I,te(r),o,s,[e,t]),yo=(e,t,o,s,r)=>ke(n+m,te(r),o,s,[e,t]),wo=(e,t,o,s,r,d)=>ke(n+C,te(d),s,r,[e,t,o]),ko=(e,t,o)=>me(e,t,o),ho=()=>G(11),Ro=e=>we("CheckpointIds",se(e),2),fo=(e,t)=>we("Checkpoint",se(t),3,[e]),vo=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},qo=e=>qe(e,"goBackward"),Po=e=>qe(e,"goForward"),xo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},So=e=>{const t=se(e),[s,r]=Ro(t);return[(d=s,!(0==q(d))),qo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},Lo=e=>{const t=se(e),[,,[s]]=Ro(t);return[!h(s),Po(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},Bo=(e,t,o)=>ke("CheckpointIds",se(o),e,t),To=(e,t,o,s)=>ke("Checkpoint",se(s),t,o,[e]),Eo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=le(),[c,i]=le();return ue((()=>{(async()=>{const o=e?await t(e):void 0;i(o),o&&s&&(async()=>{await s(o),u([])})()})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},Mo=(e,t,o=pe,s,r=pe)=>{const[d,n]=le();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Fo,Fragment:Vo,createElement:Ao,useCallback:Oo,useLayoutEffect:jo,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>h(e)?{}:e(...t),Wo=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:zo,useContext:Go,useMemo:Jo,useState:Ko}=e,No=({tableId:e,store:t,rowComponent:o=es,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>$o(L(u,(d=>Ao(o,{...Qo(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Uo=({queryId:e,queries:t,resultRowComponent:o=ps,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>$o(L(n,(r=>Ao(o,{...Qo(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),Xo=({relationshipId:e,relationships:t,rowComponent:o=es,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,i,a]=Wo(_(t),e),l=n(e,u,c);return $o(L(l,(e=>Ao(o,{...Qo(s,e),key:e,tableId:a,rowId:e,store:i,debugIds:d}))),r,d,u)},Yo=e=>({checkpoints:t,checkpointComponent:o=Cs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return $o(L(e(Ro(n)),(e=>Ao(o,{...Qo(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Zo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:i,checkpoints:a,checkpointsById:l,children:I})=>{const p=Go(Q),[g,b]=Ko({}),C=zo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=zo((e=>b((t=>({...A(t,e)})))),[]);return Ao(Q.Provider,{value:Jo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...i},a??p[10],{...p[11],...l},C,m]),[e,t,g,o,s,r,d,n,u,c,i,a,l,p,C,m])},I)},$o=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},_o=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>$o(o+(ze(e,t,s,r)??o),void 0,d,s),es=({tableId:e,rowId:t,store:o,cellComponent:s=_o,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>$o(L(((e,t,o,s)=>{const r=Qe(t,o,s);return e??r})(d,e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),ts=e=>No(e,Oe(e.tableId,e.store)),os=({cellId:e,descending:t,offset:o,limit:s,...r})=>No(r,je(r.tableId,e,t,o,s,r.store)),ss=({store:e,tableComponent:t=ts,getTableComponentProps:o,separator:s,debugIds:r})=>$o(L(Te(e),(s=>Ao(t,{...Qo(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),rs=({valueId:e,store:t,debugIds:s})=>$o(o+(Ue(e,t)??o),void 0,s,e),ds=({store:e,valueComponent:t=rs,getValueComponentProps:o,separator:s,debugIds:r})=>$o(L(Ke(e),(s=>Ao(t,{...Qo(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),ns=({metricId:e,metrics:t,debugIds:s})=>$o(At(e,t)??o,void 0,s,e),us=({indexId:e,sliceId:t,indexes:o,rowComponent:s=es,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),a=Wt(e,t,u);return $o(L(a,(e=>Ao(s,{...Qo(r,e),key:e,tableId:i,rowId:e,store:c,debugIds:n}))),d,n,t)},cs=({indexId:e,indexes:t,sliceComponent:o=us,getSliceComponentProps:s,separator:r,debugIds:d})=>$o(L(Ht(e,t),(r=>Ao(o,{...Qo(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),is=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=es,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Wo(_(o),e),i=Ut(e,t,n);return $o(h(c)||h(i)?null:Ao(s,{...Qo(r,i),key:i,tableId:c,rowId:i,store:u,debugIds:d}),void 0,d,t)},as=e=>Xo(e,Xt,e.remoteRowId),ls=e=>Xo(e,Yt,e.firstRowId),Is=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>$o(o+(lo(e,t,s,r)??o),void 0,d,s),ps=({queryId:e,rowId:t,queries:o,resultCellComponent:s=Is,getResultCellComponentProps:r,separator:d,debugIds:n})=>$o(L(ao(e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),gs=e=>Uo(e,uo(e.queryId,e.queries)),bs=({cellId:e,descending:t,offset:o,limit:s,...r})=>Uo(r,co(r.queryId,e,t,o,s,r.queries)),Cs=({checkpoints:e,checkpointId:t,debugIds:s})=>$o(fo(t,e)??o,void 0,s,t),ms=Yo((e=>e[0])),ys=Yo((e=>h(e[1])?[]:[e[1]])),ws=Yo((e=>e[2]));export{ms as BackwardCheckpointsView,_o as CellView,Cs as CheckpointView,ys as CurrentCheckpointView,ws as ForwardCheckpointsView,cs as IndexView,ls as LinkedRowsView,as as LocalRowsView,ns as MetricView,Zo as Provider,is as RemoteRowView,Is as ResultCellView,ps as ResultRowView,bs as ResultSortedTableView,gs as ResultTableView,es as RowView,us as SliceView,os as SortedTableView,ts as TableView,ss as TablesView,rs as ValueView,ds as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,Rt as useCellIdsListener,vt as useCellListener,fo as useCheckpoint,Ro as useCheckpointIds,Bo as useCheckpointIdsListener,To as useCheckpointListener,oe as useCheckpoints,ho as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,ko as useCreateCheckpoints,jt as useCreateIndexes,xe as useCreateMergeableStore,Mt as useCreateMetrics,Eo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,Pe as useCreateStore,Mo as useCreateSynchronizer,ut as useDelCellCallback,nt as useDelRowCallback,dt as useDelTableCallback,rt as useDelTablesCallback,it as useDelValueCallback,ct as useDelValuesCallback,Et as useDidFinishTransactionListener,qo as useGoBackwardCallback,Po as useGoForwardCallback,xo as useGoToCallback,We as useHasCell,ft as useHasCellListener,De as useHasRow,kt as useHasRowListener,Ee as useHasTable,Ve as useHasTableCell,Ct as useHasTableCellListener,pt as useHasTableListener,Le as useHasTables,at as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,qt as useHasValuesListener,Qt as useIndexIds,Y as useIndexes,Dt as useIndexesIds,Z as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,At as useMetric,Vt as useMetricIds,Ot as useMetricListener,U as useMetrics,Ft as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,to as useQueriesIds,te as useQueriesOrQueriesById,oo as useQueryIds,Lo as useRedoInformation,Nt as useRelationshipIds,$ as useRelationships,Kt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,lo as useResultCell,ao as useResultCellIds,yo as useResultCellIdsListener,wo as useResultCellListener,io as useResultRow,no as useResultRowCount,go as useResultRowCountListener,uo as useResultRowIds,bo as useResultRowIdsListener,mo as useResultRowListener,co as useResultSortedRowIds,Co as useResultSortedRowIdsListener,so as useResultTable,ro as useResultTableCellIds,po as useResultTableCellIdsListener,Io as useResultTableListener,He as useRow,Ae as useRowCount,mt as useRowCountListener,Oe as useRowIds,yt as useRowIdsListener,ht as useRowListener,et as useSetCellCallback,vo as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,st as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,je as useSortedRowIds,wt as useSortedRowIdsListener,Bt as useStartTransactionListener,J as useStore,Se as useStoreIds,K as useStoreOrStoreById,Me as useTable,Fe as useTableCellIds,bt as useTableCellIdsListener,Te as useTableIds,It as useTableIdsListener,gt as useTableListener,Be as useTables,lt as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,xt as useValueIdsListener,Lt as useValueListener,Je as useValues,Pt as useValuesListener,Tt as useWillFinishTransactionListener};
|
|
1
|
+
import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",i="Table",a=i+"s",l=i+c,I="Row",p=I+"Count",g=I+c,b="Sorted"+I+c,C="Cell",m=C+c,y="Value",w=y+"s",k=y+c,h=globalThis,R=e=>null==e,v=(e,t,o)=>R(e)?o?.():t(e),f=e=>t(e)==s,q=e=>t(e)==r,P=e=>e.length,x=()=>{},S=(e,t)=>e.every(t),L=(e,t)=>P(e)===P(t)&&S(e,((e,o)=>t[o]===e)),T=(e,t)=>e.map(t),B=Object,E=e=>B.getPrototypeOf(e),M=B.entries,F=e=>!R(e)&&v(E(e),(e=>e==B.prototype||R(E(e))),(()=>!0)),V=B.keys,A=(e,t)=>v(e,(e=>e[t])),O=(e,t)=>(delete e[t],e),j=(e,t)=>{const o=M(e);return P(o)===P(V(t))&&S(o,(([e,o])=>F(o)?!!F(t[e])&&j(t[e],o):t[e]===o))},{createContext:D,useContext:H,useEffect:Q}=e,W=(G=()=>D([]),((e,t)=>t in e)(_=h,z="tinybase_uirc")||(_[z]=G()),_[z]);var _,z,G;const J=(e,t)=>{const o=H(W);return R(e)?o[t]:f(e)?A(o[t+1]??{},e):e},K=(e,t)=>{const o=J(e,t);return R(e)||f(e)?o:e},N=e=>V(H(W)[e]??{}),U=e=>J(e,0),X=e=>K(e,0),Y=(e,t)=>{const{12:o,13:s}=H(W);Q((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},Z=e=>J(e,2),$=e=>K(e,2),ee=e=>J(e,4),te=e=>K(e,4),oe=e=>J(e,6),se=e=>K(e,6),re=e=>J(e,8),de=e=>K(e,8),ne=e=>J(e,10),ue=e=>K(e,10),ce=e=>e.toLowerCase();ce(d);const ie="Transaction";ce(ie);const{useCallback:ae,useEffect:le,useMemo:Ie,useLayoutEffect:pe,useRef:ge,useState:be,useSyncExternalStore:Ce}=e,me=[],ye=[{},[],[me,void 0,me],void 0,!1,0],we=[j,L,([e,t,o],[s,r,d])=>t===r&&L(e,s)&&L(o,d)],ke=(e,t)=>e===t,he=(e,t,o=me)=>{const[,s]=be(),[r,d]=be();return le((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},Re=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ve=(e,t,s,r=me)=>{const d=ge(ye[s]),n=ae((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ye[s];return(we[s]??ke)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ae((d=>Re(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return Ce(c,n)},fe=(e,t,o,s=me,r=me,...d)=>pe((()=>Re(t,e,...r,o,...d)),[t,e,...r,...s,...d]),qe=(e,t,o,s=me,r=x,d=me,...n)=>{const u=X(e);return ae((e=>v(u,(s=>v(o(e,s),(o=>r(s["set"+t](...Pe(n,s,e),o),o)))))),[u,t,...s,...d,...xe(n)])},Pe=(e,t,o)=>T(e,(e=>q(e)?e(o,t):e)),xe=e=>{return t=e=>!q(e),e.filter(t);var t},Se=(e,t,o=x,s=me,...r)=>{const d=X(e);return ae((e=>o(d?.["del"+t](...Pe(r,d,e)))),[d,t,...s,...xe(r)])},Le=(e,t,o)=>{const s=ue(e);return ae((()=>s?.[t](o)),[s,t,o])},Te=(e,t=me)=>Ie(e,t),Be=(e,t=me)=>Ie(e,t),Ee=()=>N(1),Me=e=>ve(a,X(e),4,[]),Fe=e=>ve(a,X(e),0),Ve=e=>ve(l,X(e),1),Ae=(e,t)=>ve(i,X(t),4,[e]),Oe=(e,t)=>ve(i,X(t),0,[e]),je=(e,t)=>ve(i+m,X(t),1,[e]),De=(e,t,o)=>ve(i+C,X(o),4,[e,t]),He=(e,t)=>ve(p,X(t),5,[e]),Qe=(e,t)=>ve(g,X(t),1,[e]),We=(e,t,o,s=0,r,d)=>ve(b,X(d),1,[e,t,o,s,r]),_e=(e,t,o)=>ve(I,X(o),4,[e,t]),ze=(e,t,o)=>ve(I,X(o),0,[e,t]),Ge=(e,t,o)=>ve(m,X(o),1,[e,t]),Je=(e,t,o,s)=>ve(C,X(s),4,[e,t,o]),Ke=(e,t,o,s)=>ve(C,X(s),3,[e,t,o]),Ne=e=>ve(w,X(e),4,[]),Ue=e=>ve(w,X(e),0),Xe=e=>ve(k,X(e),1),Ye=(e,t)=>ve(y,X(t),4,[e]),Ze=(e,t)=>ve(y,X(t),3,[e]),$e=(e,t,o,s,r)=>qe(o,a,e,t,s,r),et=(e,t,o,s,r,d)=>qe(s,i,t,o,r,d,e),tt=(e,t,o,s,r,d,n)=>qe(r,I,o,s,d,n,e,t),ot=(e,t,o=me,s,r=x,d=me,n=!0)=>{const u=X(s);return ae((o=>v(u,(s=>v(t(o,s),(t=>r(s.addRow(q(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},st=(e,t,o,s,r,d,n)=>qe(r,"PartialRow",o,s,d,n,e,t),rt=(e,t,o,s,r,d,n,u)=>qe(d,C,s,r,n,u,e,t,o),dt=(e,t,o,s,r)=>qe(o,w,e,t,s,r),nt=(e,t,o,s,r)=>qe(o,"PartialValues",e,t,s,r),ut=(e,t,o,s,r,d)=>qe(s,y,t,o,r,d,e),ct=(e,t,o)=>Se(e,a,t,o),it=(e,t,o,s)=>Se(t,i,o,s,e),at=(e,t,o,s,r)=>Se(o,I,s,r,e,t),lt=(e,t,o,s,r,d,n)=>Se(r,C,d,n,e,t,o,s),It=(e,t,o)=>Se(e,w,t,o),pt=(e,t,o,s)=>Se(t,y,o,s,e),gt=(e,t,o,s)=>fe(u+a,X(s),e,t,[],o),bt=(e,t,o,s)=>fe(a,X(s),e,t,me,o),Ct=(e,t,o,s)=>fe(l,X(s),e,t,me,o),mt=(e,t,o,s,r)=>fe(u+i,X(r),t,o,[e],s),yt=(e,t,o,s,r)=>fe(i,X(r),t,o,[e],s),wt=(e,t,o,s,r)=>fe(i+m,X(r),t,o,[e],s),kt=(e,t,o,s,r,d)=>fe(u+i+C,X(d),o,s,[e,t],r),ht=(e,t,o,s,r)=>fe(p,X(r),t,o,[e],s),Rt=(e,t,o,s,r)=>fe(g,X(r),t,o,[e],s),vt=(e,t,o,s,r,d,n,u,c)=>fe(b,X(c),d,n,[e,t,o,s,r],u),ft=(e,t,o,s,r,d)=>fe(u+I,X(d),o,s,[e,t],r),qt=(e,t,o,s,r,d)=>fe(I,X(d),o,s,[e,t],r),Pt=(e,t,o,s,r,d)=>fe(m,X(d),o,s,[e,t],r),xt=(e,t,o,s,r,d,n)=>fe(u+C,X(n),s,r,[e,t,o],d),St=(e,t,o,s,r,d,n)=>fe(C,X(n),s,r,[e,t,o],d),Lt=(e,t,o,s)=>fe(u+w,X(s),e,t,[],o),Tt=(e,t,o,s)=>fe(w,X(s),e,t,me,o),Bt=(e,t,o,s)=>fe(k,X(s),e,t,me,o),Et=(e,t,o,s,r)=>fe(u+y,X(r),t,o,[e],s),Mt=(e,t,o,s,r)=>fe(y,X(r),t,o,[e],s),Ft=(e,t,o)=>fe("Start"+ie,X(o),e,t),Vt=(e,t,o)=>fe("WillFinish"+ie,X(o),e,t),At=(e,t,o)=>fe("DidFinish"+ie,X(o),e,t),Ot=(e,t,o)=>he(e,t,o),jt=()=>N(3),Dt=e=>ve("MetricIds",$(e),1),Ht=(e,t)=>ve("Metric",$(t),3,[e]),Qt=(e,t,o,s)=>fe("Metric",$(s),t,o,[e]),Wt=(e,t,o)=>he(e,t,o),_t=()=>N(5),zt=(e,t)=>ve("SliceIds",te(t),1,[e]),Gt=e=>ve("IndexIds",te(e),1),Jt=(e,t,o)=>ve("Slice"+g,te(o),1,[e,t]),Kt=(e,t,o,s)=>fe("SliceIds",te(s),t,o,[e]),Nt=(e,t,o,s,r)=>fe("Slice"+g,te(r),o,s,[e,t]),Ut=(e,t,o)=>he(e,t,o),Xt=()=>N(7),Yt=e=>ve("RelationshipIds",se(e),1),Zt=(e,t,o)=>ve("RemoteRowId",se(o),3,[e,t]),$t=(e,t,o)=>ve("Local"+g,se(o),1,[e,t]),eo=(e,t,o)=>ve("Linked"+g,se(o),1,[e,t]),to=(e,t,o,s,r)=>fe("RemoteRowId",se(r),o,s,[e,t]),oo=(e,t,o,s,r)=>fe("Local"+g,se(r),o,s,[e,t]),so=(e,t,o,s,r)=>fe("Linked"+g,se(r),o,s,[e,t]),ro=(e,t,o)=>he(e,t,o),no=()=>N(9),uo=e=>ve("QueryIds",de(e),1),co=(e,t)=>ve(n+i,de(t),0,[e]),io=(e,t)=>ve(n+i+m,de(t),1,[e]),ao=(e,t)=>ve(n+p,de(t),5,[e]),lo=(e,t)=>ve(n+g,de(t),1,[e]),Io=(e,t,o,s=0,r,d)=>ve(n+b,de(d),1,[e,t,o,s,r]),po=(e,t,o)=>ve(n+I,de(o),0,[e,t]),go=(e,t,o)=>ve(n+m,de(o),1,[e,t]),bo=(e,t,o,s)=>ve(n+C,de(s),3,[e,t,o]),Co=(e,t,o,s)=>fe(n+i,de(s),t,o,[e]),mo=(e,t,o,s)=>fe(n+i+m,de(s),t,o,[e]),yo=(e,t,o,s)=>fe(n+p,de(s),t,o,[e]),wo=(e,t,o,s)=>fe(n+g,de(s),t,o,[e]),ko=(e,t,o,s,r,d,u,c)=>fe(n+b,de(c),d,u,[e,t,o,s,r]),ho=(e,t,o,s,r)=>fe(n+I,de(r),o,s,[e,t]),Ro=(e,t,o,s,r)=>fe(n+m,de(r),o,s,[e,t]),vo=(e,t,o,s,r,d)=>fe(n+C,de(d),s,r,[e,t,o]),fo=(e,t,o)=>he(e,t,o),qo=()=>N(11),Po=e=>ve("CheckpointIds",ue(e),2),xo=(e,t)=>ve("Checkpoint",ue(t),3,[e]),So=(e=x,t=me,o,s=x,r=me)=>{const d=ue(o);return ae((t=>v(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},Lo=e=>Le(e,"goBackward"),To=e=>Le(e,"goForward"),Bo=(e,t=me,o,s=x,r=me)=>{const d=ue(o);return ae((t=>v(d,(o=>v(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},Eo=e=>{const t=ue(e),[s,r]=Po(t);return[(d=s,!(0==P(d))),Lo(t),r,v(r,(e=>t?.getCheckpoint(e)))??o];var d},Mo=e=>{const t=ue(e),[,,[s]]=Po(t);return[!R(s),To(t),s,v(s,(e=>t?.getCheckpoint(e)))??o]},Fo=(e,t,o)=>fe("CheckpointIds",ue(o),e,t),Vo=(e,t,o,s)=>fe("Checkpoint",ue(s),t,o,[e]),Ao=(e,t,o=me,s,r=me,d,n=me)=>{const[,u]=be(),[c,i]=be();return le((()=>{(async()=>{const o=e?await t(e):void 0;i(o),o&&s&&(async()=>{await s(o),u([])})()})()}),[e,...o,...r]),le((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},Oo=(e,t,o=me,s,r=me)=>{const[d,n]=be();return le((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),le((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:jo,Fragment:Do,createElement:Ho,useCallback:Qo,useLayoutEffect:Wo,useRef:_o,useState:zo}=e,Go=(e,...t)=>R(e)?{}:e(...t),Jo=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:Ko,useContext:No,useMemo:Uo,useState:Xo}=e,Yo=({tableId:e,store:t,rowComponent:o=rs,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>os(T(u,(d=>Ho(o,{...Go(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Zo=({queryId:e,queries:t,resultRowComponent:o=ms,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>os(T(n,(r=>Ho(o,{...Go(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),$o=({relationshipId:e,relationships:t,rowComponent:o=rs,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,i,a]=Jo(se(t),e),l=n(e,u,c);return os(T(l,(e=>Ho(o,{...Go(s,e),key:e,tableId:a,rowId:e,store:i,debugIds:d}))),r,d,u)},es=e=>({checkpoints:t,checkpointComponent:o=ks,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=ue(t);return os(T(e(Po(n)),(e=>Ho(o,{...Go(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},ts=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:i,checkpoints:a,checkpointsById:l,children:I})=>{const p=No(W),[g,b]=Xo({}),C=Ko(((e,t)=>b((o=>A(o,e)==t?o:{...o,[e]:t}))),[]),m=Ko((e=>b((t=>({...O(t,e)})))),[]);return Ho(W.Provider,{value:Uo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...i},a??p[10],{...p[11],...l},C,m]),[e,t,g,o,s,r,d,n,u,c,i,a,l,p,C,m])},I)},os=(e,t,o,s)=>{const r=R(t)||!Array.isArray(e)?e:T(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},ss=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>os(o+(Ke(e,t,s,r)??o),void 0,d,s),rs=({tableId:e,rowId:t,store:o,cellComponent:s=ss,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>os(T(((e,t,o,s)=>{const r=Ge(t,o,s);return e??r})(d,e,t,o),(d=>Ho(s,{...Go(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),ds=e=>Yo(e,Qe(e.tableId,e.store)),ns=({cellId:e,descending:t,offset:o,limit:s,...r})=>Yo(r,We(r.tableId,e,t,o,s,r.store)),us=({store:e,tableComponent:t=ds,getTableComponentProps:o,separator:s,debugIds:r})=>os(T(Ve(e),(s=>Ho(t,{...Go(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),cs=({valueId:e,store:t,debugIds:s})=>os(o+(Ze(e,t)??o),void 0,s,e),is=({store:e,valueComponent:t=cs,getValueComponentProps:o,separator:s,debugIds:r})=>os(T(Xe(e),(s=>Ho(t,{...Go(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),as=({metricId:e,metrics:t,debugIds:s})=>os(Ht(e,t)??o,void 0,s,e),ls=({indexId:e,sliceId:t,indexes:o,rowComponent:s=rs,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(te(o),e),a=Jt(e,t,u);return os(T(a,(e=>Ho(s,{...Go(r,e),key:e,tableId:i,rowId:e,store:c,debugIds:n}))),d,n,t)},Is=({indexId:e,indexes:t,sliceComponent:o=ls,getSliceComponentProps:s,separator:r,debugIds:d})=>os(T(zt(e,t),(r=>Ho(o,{...Go(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),ps=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=rs,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Jo(se(o),e),i=Zt(e,t,n);return os(R(c)||R(i)?null:Ho(s,{...Go(r,i),key:i,tableId:c,rowId:i,store:u,debugIds:d}),void 0,d,t)},gs=e=>$o(e,$t,e.remoteRowId),bs=e=>$o(e,eo,e.firstRowId),Cs=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>os(o+(bo(e,t,s,r)??o),void 0,d,s),ms=({queryId:e,rowId:t,queries:o,resultCellComponent:s=Cs,getResultCellComponentProps:r,separator:d,debugIds:n})=>os(T(go(e,t,o),(d=>Ho(s,{...Go(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),ys=e=>Zo(e,lo(e.queryId,e.queries)),ws=({cellId:e,descending:t,offset:o,limit:s,...r})=>Zo(r,Io(r.queryId,e,t,o,s,r.queries)),ks=({checkpoints:e,checkpointId:t,debugIds:s})=>os(xo(t,e)??o,void 0,s,t),hs=es((e=>e[0])),Rs=es((e=>R(e[1])?[]:[e[1]])),vs=es((e=>e[2]));export{hs as BackwardCheckpointsView,ss as CellView,ks as CheckpointView,Rs as CurrentCheckpointView,vs as ForwardCheckpointsView,Is as IndexView,bs as LinkedRowsView,gs as LocalRowsView,as as MetricView,ts as Provider,ps as RemoteRowView,Cs as ResultCellView,ms as ResultRowView,ws as ResultSortedTableView,ys as ResultTableView,rs as RowView,ls as SliceView,ns as SortedTableView,ds as TableView,us as TablesView,cs as ValueView,is as ValuesView,ot as useAddRowCallback,Ke as useCell,Ge as useCellIds,Pt as useCellIdsListener,St as useCellListener,xo as useCheckpoint,Po as useCheckpointIds,Fo as useCheckpointIdsListener,Vo as useCheckpointListener,ne as useCheckpoints,qo as useCheckpointsIds,ue as useCheckpointsOrCheckpointsById,fo as useCreateCheckpoints,Wt as useCreateIndexes,Be as useCreateMergeableStore,Ot as useCreateMetrics,Ao as useCreatePersister,ro as useCreateQueries,Ut as useCreateRelationships,Te as useCreateStore,Oo as useCreateSynchronizer,lt as useDelCellCallback,at as useDelRowCallback,it as useDelTableCallback,ct as useDelTablesCallback,pt as useDelValueCallback,It as useDelValuesCallback,At as useDidFinishTransactionListener,Lo as useGoBackwardCallback,To as useGoForwardCallback,Bo as useGoToCallback,Je as useHasCell,xt as useHasCellListener,_e as useHasRow,ft as useHasRowListener,Ae as useHasTable,De as useHasTableCell,kt as useHasTableCellListener,mt as useHasTableListener,Me as useHasTables,gt as useHasTablesListener,Ye as useHasValue,Et as useHasValueListener,Ne as useHasValues,Lt as useHasValuesListener,Gt as useIndexIds,ee as useIndexes,_t as useIndexesIds,te as useIndexesOrIndexesById,eo as useLinkedRowIds,so as useLinkedRowIdsListener,$t as useLocalRowIds,oo as useLocalRowIdsListener,Ht as useMetric,Dt as useMetricIds,Qt as useMetricListener,Z as useMetrics,jt as useMetricsIds,$ as useMetricsOrMetricsById,Y as useProvideStore,re as useQueries,no as useQueriesIds,de as useQueriesOrQueriesById,uo as useQueryIds,Mo as useRedoInformation,Yt as useRelationshipIds,oe as useRelationships,Xt as useRelationshipsIds,se as useRelationshipsOrRelationshipsById,Zt as useRemoteRowId,to as useRemoteRowIdListener,bo as useResultCell,go as useResultCellIds,Ro as useResultCellIdsListener,vo as useResultCellListener,po as useResultRow,ao as useResultRowCount,yo as useResultRowCountListener,lo as useResultRowIds,wo as useResultRowIdsListener,ho as useResultRowListener,Io as useResultSortedRowIds,ko as useResultSortedRowIdsListener,co as useResultTable,io as useResultTableCellIds,mo as useResultTableCellIdsListener,Co as useResultTableListener,ze as useRow,He as useRowCount,ht as useRowCountListener,Qe as useRowIds,Rt as useRowIdsListener,qt as useRowListener,rt as useSetCellCallback,So as useSetCheckpointCallback,st as useSetPartialRowCallback,nt as useSetPartialValuesCallback,tt as useSetRowCallback,et as useSetTableCallback,$e as useSetTablesCallback,ut as useSetValueCallback,dt as useSetValuesCallback,zt as useSliceIds,Kt as useSliceIdsListener,Jt as useSliceRowIds,Nt as useSliceRowIdsListener,We as useSortedRowIds,vt as useSortedRowIdsListener,Ft as useStartTransactionListener,U as useStore,Ee as useStoreIds,X as useStoreOrStoreById,Oe as useTable,je as useTableCellIds,wt as useTableCellIdsListener,Ve as useTableIds,Ct as useTableIdsListener,yt as useTableListener,Fe as useTables,bt as useTablesListener,Eo as useUndoInformation,Ze as useValue,Xe as useValueIds,Bt as useValueIdsListener,Mt as useValueListener,Ue as useValues,Tt as useValuesListener,Vt as useWillFinishTransactionListener};
|
package/min/ui-react/index.js.gz
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",i="Table",a=i+"s",l=i+c,I="Row",p=I+"Count",g=I+c,b="Sorted"+I+c,C="Cell",m=C+c,y="Value",w=y+"s",k=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:ie,useRef:ae,useState:le,useSyncExternalStore:Ie}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=le(),[r,d]=le();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},we=(e,t,s,r=pe)=>{const d=ae(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return Ie(c,n)},ke=(e,t,o,s=pe,r=pe,...d)=>ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...Re(n,s,e),o),o)))))),[u,t,...s,...d,...fe(n)])},Re=(e,t,o)=>L(e,(e=>v(e)?e(o,t):e)),fe=e=>{return t=e=>!v(e),e.filter(t);var t},ve=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((e=>o(d?.["del"+t](...Re(r,d,e)))),[d,t,...s,...fe(r)])},qe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},Pe=(e,t=pe)=>ce(e,t),xe=(e,t=pe)=>ce(e,t),Se=()=>G(1),Le=e=>we(a,K(e),4,[]),Be=e=>we(a,K(e),0),Te=e=>we(l,K(e),1),Ee=(e,t)=>we(i,K(t),4,[e]),Me=(e,t)=>we(i,K(t),0,[e]),Fe=(e,t)=>we(i+m,K(t),1,[e]),Ve=(e,t,o)=>we(i+C,K(o),4,[e,t]),Ae=(e,t)=>we(p,K(t),5,[e]),Oe=(e,t)=>we(g,K(t),1,[e]),je=(e,t,o,s=0,r,d)=>we(b,K(d),1,[e,t,o,s,r]),De=(e,t,o)=>we(I,K(o),4,[e,t]),He=(e,t,o)=>we(I,K(o),0,[e,t]),Qe=(e,t,o)=>we(m,K(o),1,[e,t]),We=(e,t,o,s)=>we(C,K(s),4,[e,t,o]),ze=(e,t,o,s)=>we(C,K(s),3,[e,t,o]),Ge=e=>we(w,K(e),4,[]),Je=e=>we(w,K(e),0),Ke=e=>we(k,K(e),1),Ne=(e,t)=>we(y,K(t),4,[e]),Ue=(e,t)=>we(y,K(t),3,[e]),Xe=(e,t,o,s,r)=>he(o,a,e,t,s,r),Ye=(e,t,o,s,r,d)=>he(s,i,t,o,r,d,e),Ze=(e,t,o,s,r,d,n)=>he(r,I,o,s,d,n,e,t),$e=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},_e=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),et=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),tt=(e,t,o,s,r)=>he(o,w,e,t,s,r),ot=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),st=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),rt=(e,t,o)=>ve(e,a,t,o),dt=(e,t,o,s)=>ve(t,i,o,s,e),nt=(e,t,o,s,r)=>ve(o,I,s,r,e,t),ut=(e,t,o,s,r,d,n)=>ve(r,C,d,n,e,t,o,s),ct=(e,t,o)=>ve(e,w,t,o),it=(e,t,o,s)=>ve(t,y,o,s,e),at=(e,t,o,s)=>ke(u+a,K(s),e,t,[],o),lt=(e,t,o,s)=>ke(a,K(s),e,t,pe,o),It=(e,t,o,s)=>ke(l,K(s),e,t,pe,o),pt=(e,t,o,s,r)=>ke(u+i,K(r),t,o,[e],s),gt=(e,t,o,s,r)=>ke(i,K(r),t,o,[e],s),bt=(e,t,o,s,r)=>ke(i+m,K(r),t,o,[e],s),Ct=(e,t,o,s,r,d)=>ke(u+i+C,K(d),o,s,[e,t],r),mt=(e,t,o,s,r)=>ke(p,K(r),t,o,[e],s),yt=(e,t,o,s,r)=>ke(g,K(r),t,o,[e],s),wt=(e,t,o,s,r,d,n,u,c)=>ke(b,K(c),d,n,[e,t,o,s,r],u),kt=(e,t,o,s,r,d)=>ke(u+I,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d)=>ke(I,K(d),o,s,[e,t],r),Rt=(e,t,o,s,r,d)=>ke(m,K(d),o,s,[e,t],r),ft=(e,t,o,s,r,d,n)=>ke(u+C,K(n),s,r,[e,t,o],d),vt=(e,t,o,s,r,d,n)=>ke(C,K(n),s,r,[e,t,o],d),qt=(e,t,o,s)=>ke(u+w,K(s),e,t,[],o),Pt=(e,t,o,s)=>ke(w,K(s),e,t,pe,o),xt=(e,t,o,s)=>ke(k,K(s),e,t,pe,o),St=(e,t,o,s,r)=>ke(u+y,K(r),t,o,[e],s),Lt=(e,t,o,s,r)=>ke(y,K(r),t,o,[e],s),Bt=(e,t,o)=>ke("Start"+de,K(o),e,t),Tt=(e,t,o)=>ke("WillFinish"+de,K(o),e,t),Et=(e,t,o)=>ke("DidFinish"+de,K(o),e,t),Mt=(e,t,o)=>me(e,t,o),Ft=()=>G(3),Vt=e=>we("MetricIds",X(e),1),At=(e,t)=>we("Metric",X(t),3,[e]),Ot=(e,t,o,s)=>ke("Metric",X(s),t,o,[e]),jt=(e,t,o)=>me(e,t,o),Dt=()=>G(5),Ht=(e,t)=>we("SliceIds",Z(t),1,[e]),Qt=e=>we("IndexIds",Z(e),1),Wt=(e,t,o)=>we("Slice"+g,Z(o),1,[e,t]),zt=(e,t,o,s)=>ke("SliceIds",Z(s),t,o,[e]),Gt=(e,t,o,s,r)=>ke("Slice"+g,Z(r),o,s,[e,t]),Jt=(e,t,o)=>me(e,t,o),Kt=()=>G(7),Nt=e=>we("RelationshipIds",_(e),1),Ut=(e,t,o)=>we("RemoteRowId",_(o),3,[e,t]),Xt=(e,t,o)=>we("Local"+g,_(o),1,[e,t]),Yt=(e,t,o)=>we("Linked"+g,_(o),1,[e,t]),Zt=(e,t,o,s,r)=>ke("RemoteRowId",_(r),o,s,[e,t]),$t=(e,t,o,s,r)=>ke("Local"+g,_(r),o,s,[e,t]),_t=(e,t,o,s,r)=>ke("Linked"+g,_(r),o,s,[e,t]),eo=(e,t,o)=>me(e,t,o),to=()=>G(9),oo=e=>we("QueryIds",te(e),1),so=(e,t)=>we(n+i,te(t),0,[e]),ro=(e,t)=>we(n+i+m,te(t),1,[e]),no=(e,t)=>we(n+p,te(t),5,[e]),uo=(e,t)=>we(n+g,te(t),1,[e]),co=(e,t,o,s=0,r,d)=>we(n+b,te(d),1,[e,t,o,s,r]),io=(e,t,o)=>we(n+I,te(o),0,[e,t]),ao=(e,t,o)=>we(n+m,te(o),1,[e,t]),lo=(e,t,o,s)=>we(n+C,te(s),3,[e,t,o]),Io=(e,t,o,s)=>ke(n+i,te(s),t,o,[e]),po=(e,t,o,s)=>ke(n+i+m,te(s),t,o,[e]),go=(e,t,o,s)=>ke(n+p,te(s),t,o,[e]),bo=(e,t,o,s)=>ke(n+g,te(s),t,o,[e]),Co=(e,t,o,s,r,d,u,c)=>ke(n+b,te(c),d,u,[e,t,o,s,r]),mo=(e,t,o,s,r)=>ke(n+I,te(r),o,s,[e,t]),yo=(e,t,o,s,r)=>ke(n+m,te(r),o,s,[e,t]),wo=(e,t,o,s,r,d)=>ke(n+C,te(d),s,r,[e,t,o]),ko=(e,t,o)=>me(e,t,o),ho=()=>G(11),Ro=e=>we("CheckpointIds",se(e),2),fo=(e,t)=>we("Checkpoint",se(t),3,[e]),vo=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},qo=e=>qe(e,"goBackward"),Po=e=>qe(e,"goForward"),xo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},So=e=>{const t=se(e),[s,r]=Ro(t);return[(d=s,!(0==q(d))),qo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},Lo=e=>{const t=se(e),[,,[s]]=Ro(t);return[!h(s),Po(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},Bo=(e,t,o)=>ke("CheckpointIds",se(o),e,t),To=(e,t,o,s)=>ke("Checkpoint",se(s),t,o,[e]),Eo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=le(),[c,i]=le();return ue((()=>{(async()=>{const o=e?await t(e):void 0;i(o),o&&s&&(async()=>{await s(o),u([])})()})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},Mo=(e,t,o=pe,s,r=pe)=>{const[d,n]=le();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Fo,Fragment:Vo,createElement:Ao,useCallback:Oo,useLayoutEffect:jo,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>h(e)?{}:e(...t),Wo=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:zo,useContext:Go,useMemo:Jo,useState:Ko}=e,No=({tableId:e,store:t,rowComponent:o=es,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>$o(L(u,(d=>Ao(o,{...Qo(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Uo=({queryId:e,queries:t,resultRowComponent:o=ps,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>$o(L(n,(r=>Ao(o,{...Qo(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),Xo=({relationshipId:e,relationships:t,rowComponent:o=es,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,i,a]=Wo(_(t),e),l=n(e,u,c);return $o(L(l,(e=>Ao(o,{...Qo(s,e),key:e,tableId:a,rowId:e,store:i,debugIds:d}))),r,d,u)},Yo=e=>({checkpoints:t,checkpointComponent:o=Cs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return $o(L(e(Ro(n)),(e=>Ao(o,{...Qo(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Zo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:i,checkpoints:a,checkpointsById:l,children:I})=>{const p=Go(Q),[g,b]=Ko({}),C=zo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=zo((e=>b((t=>({...A(t,e)})))),[]);return Ao(Q.Provider,{value:Jo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...i},a??p[10],{...p[11],...l},C,m]),[e,t,g,o,s,r,d,n,u,c,i,a,l,p,C,m])},I)},$o=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},_o=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>$o(o+(ze(e,t,s,r)??o),void 0,d,s),es=({tableId:e,rowId:t,store:o,cellComponent:s=_o,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>$o(L(((e,t,o,s)=>{const r=Qe(t,o,s);return e??r})(d,e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),ts=e=>No(e,Oe(e.tableId,e.store)),os=({cellId:e,descending:t,offset:o,limit:s,...r})=>No(r,je(r.tableId,e,t,o,s,r.store)),ss=({store:e,tableComponent:t=ts,getTableComponentProps:o,separator:s,debugIds:r})=>$o(L(Te(e),(s=>Ao(t,{...Qo(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),rs=({valueId:e,store:t,debugIds:s})=>$o(o+(Ue(e,t)??o),void 0,s,e),ds=({store:e,valueComponent:t=rs,getValueComponentProps:o,separator:s,debugIds:r})=>$o(L(Ke(e),(s=>Ao(t,{...Qo(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),ns=({metricId:e,metrics:t,debugIds:s})=>$o(At(e,t)??o,void 0,s,e),us=({indexId:e,sliceId:t,indexes:o,rowComponent:s=es,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),a=Wt(e,t,u);return $o(L(a,(e=>Ao(s,{...Qo(r,e),key:e,tableId:i,rowId:e,store:c,debugIds:n}))),d,n,t)},cs=({indexId:e,indexes:t,sliceComponent:o=us,getSliceComponentProps:s,separator:r,debugIds:d})=>$o(L(Ht(e,t),(r=>Ao(o,{...Qo(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),is=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=es,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Wo(_(o),e),i=Ut(e,t,n);return $o(h(c)||h(i)?null:Ao(s,{...Qo(r,i),key:i,tableId:c,rowId:i,store:u,debugIds:d}),void 0,d,t)},as=e=>Xo(e,Xt,e.remoteRowId),ls=e=>Xo(e,Yt,e.firstRowId),Is=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>$o(o+(lo(e,t,s,r)??o),void 0,d,s),ps=({queryId:e,rowId:t,queries:o,resultCellComponent:s=Is,getResultCellComponentProps:r,separator:d,debugIds:n})=>$o(L(ao(e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),gs=e=>Uo(e,uo(e.queryId,e.queries)),bs=({cellId:e,descending:t,offset:o,limit:s,...r})=>Uo(r,co(r.queryId,e,t,o,s,r.queries)),Cs=({checkpoints:e,checkpointId:t,debugIds:s})=>$o(fo(t,e)??o,void 0,s,t),ms=Yo((e=>e[0])),ys=Yo((e=>h(e[1])?[]:[e[1]])),ws=Yo((e=>e[2]));export{ms as BackwardCheckpointsView,_o as CellView,Cs as CheckpointView,ys as CurrentCheckpointView,ws as ForwardCheckpointsView,cs as IndexView,ls as LinkedRowsView,as as LocalRowsView,ns as MetricView,Zo as Provider,is as RemoteRowView,Is as ResultCellView,ps as ResultRowView,bs as ResultSortedTableView,gs as ResultTableView,es as RowView,us as SliceView,os as SortedTableView,ts as TableView,ss as TablesView,rs as ValueView,ds as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,Rt as useCellIdsListener,vt as useCellListener,fo as useCheckpoint,Ro as useCheckpointIds,Bo as useCheckpointIdsListener,To as useCheckpointListener,oe as useCheckpoints,ho as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,ko as useCreateCheckpoints,jt as useCreateIndexes,xe as useCreateMergeableStore,Mt as useCreateMetrics,Eo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,Pe as useCreateStore,Mo as useCreateSynchronizer,ut as useDelCellCallback,nt as useDelRowCallback,dt as useDelTableCallback,rt as useDelTablesCallback,it as useDelValueCallback,ct as useDelValuesCallback,Et as useDidFinishTransactionListener,qo as useGoBackwardCallback,Po as useGoForwardCallback,xo as useGoToCallback,We as useHasCell,ft as useHasCellListener,De as useHasRow,kt as useHasRowListener,Ee as useHasTable,Ve as useHasTableCell,Ct as useHasTableCellListener,pt as useHasTableListener,Le as useHasTables,at as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,qt as useHasValuesListener,Qt as useIndexIds,Y as useIndexes,Dt as useIndexesIds,Z as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,At as useMetric,Vt as useMetricIds,Ot as useMetricListener,U as useMetrics,Ft as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,to as useQueriesIds,te as useQueriesOrQueriesById,oo as useQueryIds,Lo as useRedoInformation,Nt as useRelationshipIds,$ as useRelationships,Kt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,lo as useResultCell,ao as useResultCellIds,yo as useResultCellIdsListener,wo as useResultCellListener,io as useResultRow,no as useResultRowCount,go as useResultRowCountListener,uo as useResultRowIds,bo as useResultRowIdsListener,mo as useResultRowListener,co as useResultSortedRowIds,Co as useResultSortedRowIdsListener,so as useResultTable,ro as useResultTableCellIds,po as useResultTableCellIdsListener,Io as useResultTableListener,He as useRow,Ae as useRowCount,mt as useRowCountListener,Oe as useRowIds,yt as useRowIdsListener,ht as useRowListener,et as useSetCellCallback,vo as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,st as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,je as useSortedRowIds,wt as useSortedRowIdsListener,Bt as useStartTransactionListener,J as useStore,Se as useStoreIds,K as useStoreOrStoreById,Me as useTable,Fe as useTableCellIds,bt as useTableCellIdsListener,Te as useTableIds,It as useTableIdsListener,gt as useTableListener,Be as useTables,lt as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,xt as useValueIdsListener,Lt as useValueListener,Je as useValues,Pt as useValuesListener,Tt as useWillFinishTransactionListener};
|
|
1
|
+
import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",i="Table",a=i+"s",l=i+c,I="Row",p=I+"Count",g=I+c,b="Sorted"+I+c,C="Cell",m=C+c,y="Value",w=y+"s",k=y+c,h=globalThis,R=e=>null==e,v=(e,t,o)=>R(e)?o?.():t(e),f=e=>t(e)==s,q=e=>t(e)==r,P=e=>e.length,x=()=>{},S=(e,t)=>e.every(t),L=(e,t)=>P(e)===P(t)&&S(e,((e,o)=>t[o]===e)),T=(e,t)=>e.map(t),B=Object,E=e=>B.getPrototypeOf(e),M=B.entries,F=e=>!R(e)&&v(E(e),(e=>e==B.prototype||R(E(e))),(()=>!0)),V=B.keys,A=(e,t)=>v(e,(e=>e[t])),O=(e,t)=>(delete e[t],e),j=(e,t)=>{const o=M(e);return P(o)===P(V(t))&&S(o,(([e,o])=>F(o)?!!F(t[e])&&j(t[e],o):t[e]===o))},{createContext:D,useContext:H,useEffect:Q}=e,W=(G=()=>D([]),((e,t)=>t in e)(_=h,z="tinybase_uirc")||(_[z]=G()),_[z]);var _,z,G;const J=(e,t)=>{const o=H(W);return R(e)?o[t]:f(e)?A(o[t+1]??{},e):e},K=(e,t)=>{const o=J(e,t);return R(e)||f(e)?o:e},N=e=>V(H(W)[e]??{}),U=e=>J(e,0),X=e=>K(e,0),Y=(e,t)=>{const{12:o,13:s}=H(W);Q((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},Z=e=>J(e,2),$=e=>K(e,2),ee=e=>J(e,4),te=e=>K(e,4),oe=e=>J(e,6),se=e=>K(e,6),re=e=>J(e,8),de=e=>K(e,8),ne=e=>J(e,10),ue=e=>K(e,10),ce=e=>e.toLowerCase();ce(d);const ie="Transaction";ce(ie);const{useCallback:ae,useEffect:le,useMemo:Ie,useLayoutEffect:pe,useRef:ge,useState:be,useSyncExternalStore:Ce}=e,me=[],ye=[{},[],[me,void 0,me],void 0,!1,0],we=[j,L,([e,t,o],[s,r,d])=>t===r&&L(e,s)&&L(o,d)],ke=(e,t)=>e===t,he=(e,t,o=me)=>{const[,s]=be(),[r,d]=be();return le((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},Re=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ve=(e,t,s,r=me)=>{const d=ge(ye[s]),n=ae((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ye[s];return(we[s]??ke)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ae((d=>Re(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return Ce(c,n)},fe=(e,t,o,s=me,r=me,...d)=>pe((()=>Re(t,e,...r,o,...d)),[t,e,...r,...s,...d]),qe=(e,t,o,s=me,r=x,d=me,...n)=>{const u=X(e);return ae((e=>v(u,(s=>v(o(e,s),(o=>r(s["set"+t](...Pe(n,s,e),o),o)))))),[u,t,...s,...d,...xe(n)])},Pe=(e,t,o)=>T(e,(e=>q(e)?e(o,t):e)),xe=e=>{return t=e=>!q(e),e.filter(t);var t},Se=(e,t,o=x,s=me,...r)=>{const d=X(e);return ae((e=>o(d?.["del"+t](...Pe(r,d,e)))),[d,t,...s,...xe(r)])},Le=(e,t,o)=>{const s=ue(e);return ae((()=>s?.[t](o)),[s,t,o])},Te=(e,t=me)=>Ie(e,t),Be=(e,t=me)=>Ie(e,t),Ee=()=>N(1),Me=e=>ve(a,X(e),4,[]),Fe=e=>ve(a,X(e),0),Ve=e=>ve(l,X(e),1),Ae=(e,t)=>ve(i,X(t),4,[e]),Oe=(e,t)=>ve(i,X(t),0,[e]),je=(e,t)=>ve(i+m,X(t),1,[e]),De=(e,t,o)=>ve(i+C,X(o),4,[e,t]),He=(e,t)=>ve(p,X(t),5,[e]),Qe=(e,t)=>ve(g,X(t),1,[e]),We=(e,t,o,s=0,r,d)=>ve(b,X(d),1,[e,t,o,s,r]),_e=(e,t,o)=>ve(I,X(o),4,[e,t]),ze=(e,t,o)=>ve(I,X(o),0,[e,t]),Ge=(e,t,o)=>ve(m,X(o),1,[e,t]),Je=(e,t,o,s)=>ve(C,X(s),4,[e,t,o]),Ke=(e,t,o,s)=>ve(C,X(s),3,[e,t,o]),Ne=e=>ve(w,X(e),4,[]),Ue=e=>ve(w,X(e),0),Xe=e=>ve(k,X(e),1),Ye=(e,t)=>ve(y,X(t),4,[e]),Ze=(e,t)=>ve(y,X(t),3,[e]),$e=(e,t,o,s,r)=>qe(o,a,e,t,s,r),et=(e,t,o,s,r,d)=>qe(s,i,t,o,r,d,e),tt=(e,t,o,s,r,d,n)=>qe(r,I,o,s,d,n,e,t),ot=(e,t,o=me,s,r=x,d=me,n=!0)=>{const u=X(s);return ae((o=>v(u,(s=>v(t(o,s),(t=>r(s.addRow(q(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},st=(e,t,o,s,r,d,n)=>qe(r,"PartialRow",o,s,d,n,e,t),rt=(e,t,o,s,r,d,n,u)=>qe(d,C,s,r,n,u,e,t,o),dt=(e,t,o,s,r)=>qe(o,w,e,t,s,r),nt=(e,t,o,s,r)=>qe(o,"PartialValues",e,t,s,r),ut=(e,t,o,s,r,d)=>qe(s,y,t,o,r,d,e),ct=(e,t,o)=>Se(e,a,t,o),it=(e,t,o,s)=>Se(t,i,o,s,e),at=(e,t,o,s,r)=>Se(o,I,s,r,e,t),lt=(e,t,o,s,r,d,n)=>Se(r,C,d,n,e,t,o,s),It=(e,t,o)=>Se(e,w,t,o),pt=(e,t,o,s)=>Se(t,y,o,s,e),gt=(e,t,o,s)=>fe(u+a,X(s),e,t,[],o),bt=(e,t,o,s)=>fe(a,X(s),e,t,me,o),Ct=(e,t,o,s)=>fe(l,X(s),e,t,me,o),mt=(e,t,o,s,r)=>fe(u+i,X(r),t,o,[e],s),yt=(e,t,o,s,r)=>fe(i,X(r),t,o,[e],s),wt=(e,t,o,s,r)=>fe(i+m,X(r),t,o,[e],s),kt=(e,t,o,s,r,d)=>fe(u+i+C,X(d),o,s,[e,t],r),ht=(e,t,o,s,r)=>fe(p,X(r),t,o,[e],s),Rt=(e,t,o,s,r)=>fe(g,X(r),t,o,[e],s),vt=(e,t,o,s,r,d,n,u,c)=>fe(b,X(c),d,n,[e,t,o,s,r],u),ft=(e,t,o,s,r,d)=>fe(u+I,X(d),o,s,[e,t],r),qt=(e,t,o,s,r,d)=>fe(I,X(d),o,s,[e,t],r),Pt=(e,t,o,s,r,d)=>fe(m,X(d),o,s,[e,t],r),xt=(e,t,o,s,r,d,n)=>fe(u+C,X(n),s,r,[e,t,o],d),St=(e,t,o,s,r,d,n)=>fe(C,X(n),s,r,[e,t,o],d),Lt=(e,t,o,s)=>fe(u+w,X(s),e,t,[],o),Tt=(e,t,o,s)=>fe(w,X(s),e,t,me,o),Bt=(e,t,o,s)=>fe(k,X(s),e,t,me,o),Et=(e,t,o,s,r)=>fe(u+y,X(r),t,o,[e],s),Mt=(e,t,o,s,r)=>fe(y,X(r),t,o,[e],s),Ft=(e,t,o)=>fe("Start"+ie,X(o),e,t),Vt=(e,t,o)=>fe("WillFinish"+ie,X(o),e,t),At=(e,t,o)=>fe("DidFinish"+ie,X(o),e,t),Ot=(e,t,o)=>he(e,t,o),jt=()=>N(3),Dt=e=>ve("MetricIds",$(e),1),Ht=(e,t)=>ve("Metric",$(t),3,[e]),Qt=(e,t,o,s)=>fe("Metric",$(s),t,o,[e]),Wt=(e,t,o)=>he(e,t,o),_t=()=>N(5),zt=(e,t)=>ve("SliceIds",te(t),1,[e]),Gt=e=>ve("IndexIds",te(e),1),Jt=(e,t,o)=>ve("Slice"+g,te(o),1,[e,t]),Kt=(e,t,o,s)=>fe("SliceIds",te(s),t,o,[e]),Nt=(e,t,o,s,r)=>fe("Slice"+g,te(r),o,s,[e,t]),Ut=(e,t,o)=>he(e,t,o),Xt=()=>N(7),Yt=e=>ve("RelationshipIds",se(e),1),Zt=(e,t,o)=>ve("RemoteRowId",se(o),3,[e,t]),$t=(e,t,o)=>ve("Local"+g,se(o),1,[e,t]),eo=(e,t,o)=>ve("Linked"+g,se(o),1,[e,t]),to=(e,t,o,s,r)=>fe("RemoteRowId",se(r),o,s,[e,t]),oo=(e,t,o,s,r)=>fe("Local"+g,se(r),o,s,[e,t]),so=(e,t,o,s,r)=>fe("Linked"+g,se(r),o,s,[e,t]),ro=(e,t,o)=>he(e,t,o),no=()=>N(9),uo=e=>ve("QueryIds",de(e),1),co=(e,t)=>ve(n+i,de(t),0,[e]),io=(e,t)=>ve(n+i+m,de(t),1,[e]),ao=(e,t)=>ve(n+p,de(t),5,[e]),lo=(e,t)=>ve(n+g,de(t),1,[e]),Io=(e,t,o,s=0,r,d)=>ve(n+b,de(d),1,[e,t,o,s,r]),po=(e,t,o)=>ve(n+I,de(o),0,[e,t]),go=(e,t,o)=>ve(n+m,de(o),1,[e,t]),bo=(e,t,o,s)=>ve(n+C,de(s),3,[e,t,o]),Co=(e,t,o,s)=>fe(n+i,de(s),t,o,[e]),mo=(e,t,o,s)=>fe(n+i+m,de(s),t,o,[e]),yo=(e,t,o,s)=>fe(n+p,de(s),t,o,[e]),wo=(e,t,o,s)=>fe(n+g,de(s),t,o,[e]),ko=(e,t,o,s,r,d,u,c)=>fe(n+b,de(c),d,u,[e,t,o,s,r]),ho=(e,t,o,s,r)=>fe(n+I,de(r),o,s,[e,t]),Ro=(e,t,o,s,r)=>fe(n+m,de(r),o,s,[e,t]),vo=(e,t,o,s,r,d)=>fe(n+C,de(d),s,r,[e,t,o]),fo=(e,t,o)=>he(e,t,o),qo=()=>N(11),Po=e=>ve("CheckpointIds",ue(e),2),xo=(e,t)=>ve("Checkpoint",ue(t),3,[e]),So=(e=x,t=me,o,s=x,r=me)=>{const d=ue(o);return ae((t=>v(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},Lo=e=>Le(e,"goBackward"),To=e=>Le(e,"goForward"),Bo=(e,t=me,o,s=x,r=me)=>{const d=ue(o);return ae((t=>v(d,(o=>v(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},Eo=e=>{const t=ue(e),[s,r]=Po(t);return[(d=s,!(0==P(d))),Lo(t),r,v(r,(e=>t?.getCheckpoint(e)))??o];var d},Mo=e=>{const t=ue(e),[,,[s]]=Po(t);return[!R(s),To(t),s,v(s,(e=>t?.getCheckpoint(e)))??o]},Fo=(e,t,o)=>fe("CheckpointIds",ue(o),e,t),Vo=(e,t,o,s)=>fe("Checkpoint",ue(s),t,o,[e]),Ao=(e,t,o=me,s,r=me,d,n=me)=>{const[,u]=be(),[c,i]=be();return le((()=>{(async()=>{const o=e?await t(e):void 0;i(o),o&&s&&(async()=>{await s(o),u([])})()})()}),[e,...o,...r]),le((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},Oo=(e,t,o=me,s,r=me)=>{const[d,n]=be();return le((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),le((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:jo,Fragment:Do,createElement:Ho,useCallback:Qo,useLayoutEffect:Wo,useRef:_o,useState:zo}=e,Go=(e,...t)=>R(e)?{}:e(...t),Jo=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:Ko,useContext:No,useMemo:Uo,useState:Xo}=e,Yo=({tableId:e,store:t,rowComponent:o=rs,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>os(T(u,(d=>Ho(o,{...Go(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Zo=({queryId:e,queries:t,resultRowComponent:o=ms,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>os(T(n,(r=>Ho(o,{...Go(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),$o=({relationshipId:e,relationships:t,rowComponent:o=rs,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,i,a]=Jo(se(t),e),l=n(e,u,c);return os(T(l,(e=>Ho(o,{...Go(s,e),key:e,tableId:a,rowId:e,store:i,debugIds:d}))),r,d,u)},es=e=>({checkpoints:t,checkpointComponent:o=ks,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=ue(t);return os(T(e(Po(n)),(e=>Ho(o,{...Go(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},ts=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:i,checkpoints:a,checkpointsById:l,children:I})=>{const p=No(W),[g,b]=Xo({}),C=Ko(((e,t)=>b((o=>A(o,e)==t?o:{...o,[e]:t}))),[]),m=Ko((e=>b((t=>({...O(t,e)})))),[]);return Ho(W.Provider,{value:Uo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...i},a??p[10],{...p[11],...l},C,m]),[e,t,g,o,s,r,d,n,u,c,i,a,l,p,C,m])},I)},os=(e,t,o,s)=>{const r=R(t)||!Array.isArray(e)?e:T(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},ss=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>os(o+(Ke(e,t,s,r)??o),void 0,d,s),rs=({tableId:e,rowId:t,store:o,cellComponent:s=ss,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>os(T(((e,t,o,s)=>{const r=Ge(t,o,s);return e??r})(d,e,t,o),(d=>Ho(s,{...Go(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),ds=e=>Yo(e,Qe(e.tableId,e.store)),ns=({cellId:e,descending:t,offset:o,limit:s,...r})=>Yo(r,We(r.tableId,e,t,o,s,r.store)),us=({store:e,tableComponent:t=ds,getTableComponentProps:o,separator:s,debugIds:r})=>os(T(Ve(e),(s=>Ho(t,{...Go(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),cs=({valueId:e,store:t,debugIds:s})=>os(o+(Ze(e,t)??o),void 0,s,e),is=({store:e,valueComponent:t=cs,getValueComponentProps:o,separator:s,debugIds:r})=>os(T(Xe(e),(s=>Ho(t,{...Go(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),as=({metricId:e,metrics:t,debugIds:s})=>os(Ht(e,t)??o,void 0,s,e),ls=({indexId:e,sliceId:t,indexes:o,rowComponent:s=rs,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(te(o),e),a=Jt(e,t,u);return os(T(a,(e=>Ho(s,{...Go(r,e),key:e,tableId:i,rowId:e,store:c,debugIds:n}))),d,n,t)},Is=({indexId:e,indexes:t,sliceComponent:o=ls,getSliceComponentProps:s,separator:r,debugIds:d})=>os(T(zt(e,t),(r=>Ho(o,{...Go(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),ps=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=rs,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Jo(se(o),e),i=Zt(e,t,n);return os(R(c)||R(i)?null:Ho(s,{...Go(r,i),key:i,tableId:c,rowId:i,store:u,debugIds:d}),void 0,d,t)},gs=e=>$o(e,$t,e.remoteRowId),bs=e=>$o(e,eo,e.firstRowId),Cs=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>os(o+(bo(e,t,s,r)??o),void 0,d,s),ms=({queryId:e,rowId:t,queries:o,resultCellComponent:s=Cs,getResultCellComponentProps:r,separator:d,debugIds:n})=>os(T(go(e,t,o),(d=>Ho(s,{...Go(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),ys=e=>Zo(e,lo(e.queryId,e.queries)),ws=({cellId:e,descending:t,offset:o,limit:s,...r})=>Zo(r,Io(r.queryId,e,t,o,s,r.queries)),ks=({checkpoints:e,checkpointId:t,debugIds:s})=>os(xo(t,e)??o,void 0,s,t),hs=es((e=>e[0])),Rs=es((e=>R(e[1])?[]:[e[1]])),vs=es((e=>e[2]));export{hs as BackwardCheckpointsView,ss as CellView,ks as CheckpointView,Rs as CurrentCheckpointView,vs as ForwardCheckpointsView,Is as IndexView,bs as LinkedRowsView,gs as LocalRowsView,as as MetricView,ts as Provider,ps as RemoteRowView,Cs as ResultCellView,ms as ResultRowView,ws as ResultSortedTableView,ys as ResultTableView,rs as RowView,ls as SliceView,ns as SortedTableView,ds as TableView,us as TablesView,cs as ValueView,is as ValuesView,ot as useAddRowCallback,Ke as useCell,Ge as useCellIds,Pt as useCellIdsListener,St as useCellListener,xo as useCheckpoint,Po as useCheckpointIds,Fo as useCheckpointIdsListener,Vo as useCheckpointListener,ne as useCheckpoints,qo as useCheckpointsIds,ue as useCheckpointsOrCheckpointsById,fo as useCreateCheckpoints,Wt as useCreateIndexes,Be as useCreateMergeableStore,Ot as useCreateMetrics,Ao as useCreatePersister,ro as useCreateQueries,Ut as useCreateRelationships,Te as useCreateStore,Oo as useCreateSynchronizer,lt as useDelCellCallback,at as useDelRowCallback,it as useDelTableCallback,ct as useDelTablesCallback,pt as useDelValueCallback,It as useDelValuesCallback,At as useDidFinishTransactionListener,Lo as useGoBackwardCallback,To as useGoForwardCallback,Bo as useGoToCallback,Je as useHasCell,xt as useHasCellListener,_e as useHasRow,ft as useHasRowListener,Ae as useHasTable,De as useHasTableCell,kt as useHasTableCellListener,mt as useHasTableListener,Me as useHasTables,gt as useHasTablesListener,Ye as useHasValue,Et as useHasValueListener,Ne as useHasValues,Lt as useHasValuesListener,Gt as useIndexIds,ee as useIndexes,_t as useIndexesIds,te as useIndexesOrIndexesById,eo as useLinkedRowIds,so as useLinkedRowIdsListener,$t as useLocalRowIds,oo as useLocalRowIdsListener,Ht as useMetric,Dt as useMetricIds,Qt as useMetricListener,Z as useMetrics,jt as useMetricsIds,$ as useMetricsOrMetricsById,Y as useProvideStore,re as useQueries,no as useQueriesIds,de as useQueriesOrQueriesById,uo as useQueryIds,Mo as useRedoInformation,Yt as useRelationshipIds,oe as useRelationships,Xt as useRelationshipsIds,se as useRelationshipsOrRelationshipsById,Zt as useRemoteRowId,to as useRemoteRowIdListener,bo as useResultCell,go as useResultCellIds,Ro as useResultCellIdsListener,vo as useResultCellListener,po as useResultRow,ao as useResultRowCount,yo as useResultRowCountListener,lo as useResultRowIds,wo as useResultRowIdsListener,ho as useResultRowListener,Io as useResultSortedRowIds,ko as useResultSortedRowIdsListener,co as useResultTable,io as useResultTableCellIds,mo as useResultTableCellIdsListener,Co as useResultTableListener,ze as useRow,He as useRowCount,ht as useRowCountListener,Qe as useRowIds,Rt as useRowIdsListener,qt as useRowListener,rt as useSetCellCallback,So as useSetCheckpointCallback,st as useSetPartialRowCallback,nt as useSetPartialValuesCallback,tt as useSetRowCallback,et as useSetTableCallback,$e as useSetTablesCallback,ut as useSetValueCallback,dt as useSetValuesCallback,zt as useSliceIds,Kt as useSliceIdsListener,Jt as useSliceRowIds,Nt as useSliceRowIdsListener,We as useSortedRowIds,vt as useSortedRowIdsListener,Ft as useStartTransactionListener,U as useStore,Ee as useStoreIds,X as useStoreOrStoreById,Oe as useTable,je as useTableCellIds,wt as useTableCellIdsListener,Ve as useTableIds,Ct as useTableIdsListener,yt as useTableListener,Fe as useTables,bt as useTablesListener,Eo as useUndoInformation,Ze as useValue,Xe as useValueIds,Bt as useValueIdsListener,Mt as useValueListener,Ue as useValues,Tt as useValuesListener,Vt as useWillFinishTransactionListener};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"react";import{useCell as t,useValue as n,useSetValueCallback as s,useSetCellCallback as l,useValueIds as a,ValueView as r,useStoreOrStoreById as o,useRowCount as i,useSortedRowIds as d,useTableCellIds as c,useIndexesOrIndexesById as u,useSliceRowIds as h,useRelationshipsOrRelationshipsById as m,useRowIds as g,useResultRowCount as p,useResultSortedRowIds as b,useResultTableCellIds as f,useRemoteRowId as y,CellView as I,ResultCellView as w,useIndexes as v,useIndexIds as C,useSliceIds as k,useMetrics as T,useMetricIds as x,useMetric as S,useQueries as q,useQueryIds as N,useRelationships as V,useRelationshipIds as M,useStore as L,useTableIds as R,useValues as E,useStoreIds as z,useMetricsIds as $,useIndexesIds as A,useRelationshipsIds as F,useQueriesIds as J,useCreateStore as O,useCreatePersister as P}from"../ui-react/index.js";const D=e=>typeof e,j="",B=D(j),H=D(!0),W=D(0),Q=D(D),G="type",K="default",U="Has",X="Ids",Y="Table",Z=Y+"s",_=Y+X,ee="Row",te=ee+"Count",ne=ee+X,se="Cell",le=se+X,ae="Value",re=ae+"s",oe=ae+X,ie="currentTarget",de="value",ce=e=>j+e,ue=globalThis.window,he=Math,me=he.min,ge=he.floor,pe=isFinite,be=e=>null==e,fe=(e,t,n)=>be(e)?n?.():t(e),ye=e=>e==B||e==H,Ie=e=>D(e)==Q,we=e=>Array.isArray(e),ve=(e,t,n)=>e.slice(t,n),Ce=e=>e.length,ke=e=>{throw Error(e)},{PureComponent:Te,Fragment:xe,createElement:Se,useCallback:qe,useLayoutEffect:Ne,useRef:Ve,useState:Me}=e,Le=(e,...t)=>be(e)?{}:e(...t),Re=(e,t)=>e.sort(t),Ee=(e,t)=>e.forEach(t),ze=(e,t)=>e.map(t),$e=e=>0==Ce(e),Ae=(e,...t)=>e.push(...t),Fe=e=>e.shift(),Je=Object,Oe=e=>Je.getPrototypeOf(e),Pe=Je.entries,De=Je.isFrozen,je=e=>!be(e)&&fe(Oe(e),(e=>e==Je.prototype||be(Oe(e))),(()=>!0)),Be=Je.keys,He=Je.freeze,We=(e=[])=>Je.fromEntries(e),Qe=(e,t)=>t in e,Ge=(e,t)=>(delete e[t],e),Ke=(e,t)=>ze(Pe(e),(([e,n])=>t(n,e))),Ue=e=>je(e)&&0==(e=>Ce(Be(e)))(e),Xe=(e,t,n,s=0)=>be(e)||!je(e)||!s&&Ue(e)||De(e)?(n?.(),!1):(Ke(e,((n,s)=>{t(n,s)||Ge(e,s)})),!!s||!Ue(e)),Ye=JSON.stringify,Ze=JSON.parse,_e=e=>Ye(e,((e,t)=>t instanceof Map?Je.fromEntries([...t]):t)),et="tinybaseInspector",tt="TinyBase Inspector",nt=["left","top","bottom","right","full"],st="state",lt="sort",at="open",rt="position",ot=at,it="editable",dt=(...e)=>_e(e),ct=(e,t)=>ze(Re(e),t),ut=(e,n)=>[!!t(st,e,it,n),qe((t=>{n.setCell(st,e,it,(e=>!e)),t.preventDefault()}),[n,e])],ht="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",mt='content:url("',gt=mt+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",pt='</svg>")',bt=mt+"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\")",ft=ze([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,n,s])=>gt+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${n}' height='${s}' fill='white'/>`+pt)),yt=gt+"<path d='M20 20l60 60M20 80l60-60' />"+pt,It=gt+`<path d='${ht}' />`+pt,wt=gt+`<path d='${ht}M20 20l60 60' />`+pt,vt="*::-webkit-scrollbar",Ct=((e,t="")=>e.join(t))(Ke({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[vt]:"width:0.5rem;height:0.5rem;",[vt+"-track"]:"background:#111",[vt+"-thumb"]:"background:#999;border:1px solid #111",[vt+"-thumb:hover"]:"background:#fff",[vt+"-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;"+bt,...We(ze(["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;",...We(ze(["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)":bt,"header>img:nth-of-type(6)":yt,...We(ze(ft,((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":It,"details[open]>summary img.done":wt,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,#${et} 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?`#${et} ${t}{${e}}`:""))),kt=({s:e})=>{const t=n(rt,e)??1,l=s(ot,(()=>!0),[],e);return n(ot,e)?null:Se("img",{onClick:l,title:tt,"data-position":t})},Tt=({uniqueId:e,summary:n,editable:s,handleEditable:a,children:r,s:o})=>{const i=!!t(st,e,at,o),d=l(st,e,at,(e=>e[ie].open),[],o);return Se("details",{open:i,onToggle:d},Se("summary",null,n,a?Se("img",{onClick:a,className:s?"done":"edit"}):null),r)},xt=e=>{const t=D(e);return ye(t)||t==W&&pe(e)?t:void 0},St=(e,t,n,s,l)=>be(l)?e.delCell(t,n,s,!0):e.setCell(t,n,s,l),qt=(e,t,n)=>be(n)?e.delValue(t):e.setValue(t,n),Nt=(e,t,n,s)=>e==B?t:e==W?n:s,{useCallback:Vt,useMemo:Mt,useState:Lt}=e,Rt="editable",Et=(e,t)=>ze(c(e,t),(t=>e+"."+t)),zt=(e,t,n)=>{const s=Vt(e,t);return n?s:void 0},$t=(...e)=>Mt((()=>e),e),At=(e,t)=>Mt((()=>({store:e,tableId:t})),[e,t]),Ft=(e,t)=>Mt((()=>({queries:e,queryId:t})),[e,t]),Jt=(e,t=!1,n,s=0,l,a,r,o)=>{const[[i,d,c],u]=Lt([e,t,s]),h=Vt((e=>{u(e),o?.(e)}),[o]),m=zt((e=>h([e,e==i&&!d,c])),[h,i,d,c],n),g=Vt((e=>h([i,d,e])),[h,i,d]),p=!0===r?Yt:r;return[[i,d,c],m,Mt((()=>!1===r?null:Se(p,{offset:c,limit:l,total:a,onChange:g})),[r,p,c,l,a,g])]},Ot=(e,t,n)=>Mt((()=>{const s=t??e;return l=we(s)?We(ze(s,(e=>[e,e]))):s,a=(e,t)=>{return{label:t,component:n,...(s=e,D(s)==B?{label:e}:e)};var s},We(Ke(l,((e,t)=>[t,a(e,t)])));var l,a}),[t,n,e]),Pt=({className:e,headerRow:t,idColumn:n,params:[s,l,a,r,o,i]})=>Se("table",{className:e},i?Se("caption",null,i):null,!1===t?null:Se("thead",null,Se("tr",null,!1===n?null:Se(Dt,{sort:r??[],label:"Id",onClick:o}),Ke(s,(({label:e},t)=>Se(Dt,{key:t,cellId:t,label:e,sort:r??[],onClick:o}))))),Se("tbody",null,ze(a,(e=>Se("tr",{key:e},!1===n?null:Se("th",null,e),Ke(s,(({component:t,getComponentProps:n},s)=>Se("td",{key:s},Se(t,{...Le(n,e,s),...l,rowId:e,cellId:s}))))))))),Dt=({cellId:e,sort:[t,n],label:s=e??j,onClick:l})=>Se("th",{onClick:zt((()=>l?.(e)),[l,e],l),className:be(n)||t!=e?void 0:`sorted ${n?"de":"a"}scending`},be(n)||t!=e?null:(n?"↓":"↑")+" ",s),jt=({localRowId:t,params:[n,s,l,a,r,o,i]})=>{const d=y(r,t,o);return Se("tr",null,!1===n?null:Se(e.Fragment,null,Se("th",null,t),Se("th",null,d)),Ke(s,(({component:e,getComponentProps:n},s)=>{const[r,o]=s.split(".",2),c=r===l?t:r===a?d:null;return be(c)?null:Se("td",{key:s},Se(e,{...Le(n,c,o),store:i,tableId:r,rowId:c,cellId:o}))})))},Bt=({thing:e,onThingChange:t,className:n,hasSchema:s,showType:l=!0})=>{const[a,r]=Lt(),[o,i]=Lt(),[d,c]=Lt(),[u,h]=Lt(),[m,g]=Lt();o!==e&&(r(xt(e)),i(e),c(e+""),h(Number(e)||0),g(!!e));const p=Vt(((e,n)=>{n(e),i(e),t(e)}),[t]),b=Vt((()=>{if(!s?.()){const e=Nt(a,W,H,B),n=Nt(e,d,u,m);r(e),i(n),t(n)}}),[s,t,d,u,m,a]);return Se("div",{className:n},l?Se("button",{className:a,onClick:b},a):null,Nt(a,Se("input",{key:a,value:d,onChange:Vt((e=>p(e[ie][de]+"",c)),[p])}),Se("input",{key:a,type:"number",value:u,onChange:Vt((e=>p(Number(e[ie][de]||0),h)),[p])}),Se("input",{key:a,type:"checkbox",checked:m,onChange:Vt((e=>p(!!e[ie].checked,g)),[p])})))},Ht=({tableId:e,cellId:t,descending:n,offset:s,limit:l,store:a,editable:r,sortOnClick:o,paginator:u=!1,onChange:h,customCells:m,...g})=>{const[p,b,f]=Jt(t,n,o,s,l,i(e,a),u,h);return Se(Pt,{...g,params:$t(Ot(c(e,a),m,r?Ut:I),At(a,e),d(e,...p,l,a),p,b,f)})},Wt=({store:e,editable:t=!1,valueComponent:n=(t?Xt:r),getValueComponentProps:s,className:l,headerRow:o,idColumn:i})=>Se("table",{className:l},!1===o?null:Se("thead",null,Se("tr",null,!1===i?null:Se("th",null,"Id"),Se("th",null,ae))),Se("tbody",null,ze(a(e),(t=>Se("tr",{key:t},!1===i?null:Se("th",null,t),Se("td",null,Se(n,{...Le(s,t),valueId:t,store:e}))))))),Qt=({indexId:e,sliceId:t,indexes:n,editable:s,customCells:l,...a})=>{const[r,o,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(u(n),e);return Se(Pt,{...a,params:$t(Ot(c(i,o),l,s?Ut:I),At(o,i),h(e,t,r))})},Gt=({relationshipId:t,relationships:n,editable:s,customCells:l,className:a,headerRow:r,idColumn:o=!0})=>{const[i,d,c,u]=((e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)])(m(n),t),h=Ot([...Et(c,d),...Et(u,d)],l,s?Ut:I),p=$t(o,h,c,u,t,i,d);return Se("table",{className:a},!1===r?null:Se("thead",null,Se("tr",null,!1===o?null:Se(e.Fragment,null,Se("th",null,c,".Id"),Se("th",null,u,".Id")),Ke(h,(({label:e},t)=>Se("th",{key:t},e))))),Se("tbody",null,ze(g(c,d),(e=>Se(jt,{key:e,localRowId:e,params:p})))))},Kt=({queryId:e,cellId:t,descending:n,offset:s,limit:l,queries:a,sortOnClick:r,paginator:o=!1,customCells:i,onChange:d,...c})=>{const[u,h,m]=Jt(t,n,r,s,l,p(e,a),o,d);return Se(Pt,{...c,params:$t(Ot(f(e,a),i,w),Ft(a,e),b(e,...u,l,a),u,h,m)})},Ut=({tableId:e,rowId:n,cellId:s,store:a,className:r,showType:i})=>Se(Bt,{thing:t(e,n,s,a),onThingChange:l(e,n,s,(e=>e),[],a),className:r??Rt+se,showType:i,hasSchema:o(a)?.hasTablesSchema}),Xt=({valueId:e,store:t,className:l,showType:a})=>Se(Bt,{thing:n(e,t),onThingChange:s(e,(e=>e),[],t),className:l??Rt+ae,showType:a,hasSchema:o(t)?.hasValuesSchema}),Yt=({onChange:t,total:n,offset:s=0,limit:l=n,singular:a="row",plural:r=a+"s"})=>{(s>n||s<0)&&(s=0,t(0));const o=zt((()=>t(s-l)),[t,s,l],s>0),i=zt((()=>t(s+l)),[t,s,l],s+l<n);return Se(e.Fragment,null,n>l&&Se(e.Fragment,null,Se("button",{className:"previous",disabled:0==s,onClick:o},"←"),Se("button",{className:"next",disabled:s+l>=n,onClick:i},"→"),s+1," to ",me(n,s+l)," of "),n," ",1!=n?r:a)},Zt=({indexes:e,indexesId:t,indexId:n,s:s})=>Se(Tt,{uniqueId:dt("i",t,n),summary:"Index: "+n,s:s},ze(k(n,e),(l=>Se(_t,{indexes:e,indexesId:t,indexId:n,sliceId:l,s:s,key:l})))),_t=({indexes:e,indexesId:t,indexId:n,sliceId:s,s:l})=>{const a=dt("i",t,n,s),[r,o]=ut(a,l);return Se(Tt,{uniqueId:a,summary:"Slice: "+s,editable:r,handleEditable:o,s:l},Se(Qt,{sliceId:s,indexId:n,indexes:e,editable:r}))},en=({indexesId:e,s:t})=>{const n=v(e),s=C(n);return be(n)?null:Se(Tt,{uniqueId:dt("i",e),summary:"Indexes: "+(e??K),s:t},$e(s)?"No indexes defined":ct(s,(s=>Se(Zt,{indexes:n,indexesId:e,indexId:s,s:t,key:s}))))},tn=({metrics:e,metricId:t})=>Se("tr",null,Se("th",null,t),Se("td",null,e?.getTableId(t)),Se("td",null,S(t,e))),nn=({metricsId:e,s:t})=>{const n=T(e),s=x(n);return be(n)?null:Se(Tt,{uniqueId:dt("m",e),summary:"Metrics: "+(e??K),s:t},$e(s)?"No metrics defined":Se("table",null,Se("thead",null,Se("th",null,"Metric Id"),Se("th",null,"Table Id"),Se("th",null,"Metric")),Se("tbody",null,ze(s,(e=>Se(tn,{metrics:n,metricId:e,key:e}))))))},sn=({queries:e,queriesId:n,queryId:s,s:a})=>{const r=dt("q",n,s),[o,i,d]=Ze(t(st,r,lt,a)??"[]"),c=l(st,r,lt,_e,[],a);return Se(Tt,{uniqueId:r,summary:"Query: "+s,s:a},Se(Kt,{queryId:s,queries:e,cellId:o,descending:i,offset:d,limit:10,paginator:!0,sortOnClick:!0,onChange:c}))},ln=({queriesId:e,s:t})=>{const n=q(e),s=N(n);return be(n)?null:Se(Tt,{uniqueId:dt("q",e),summary:"Queries: "+(e??K),s:t},$e(s)?"No queries defined":ct(s,(s=>Se(sn,{queries:n,queriesId:e,queryId:s,s:t,key:s}))))},an=({relationships:e,relationshipsId:t,relationshipId:n,s:s})=>{const l=dt("r",t,n),[a,r]=ut(l,s);return Se(Tt,{uniqueId:l,summary:"Relationship: "+n,editable:a,handleEditable:r,s:s},Se(Gt,{relationshipId:n,relationships:e,editable:a}))},rn=({relationshipsId:e,s:t})=>{const n=V(e),s=M(n);return be(n)?null:Se(Tt,{uniqueId:dt("r",e),summary:"Relationships: "+(e??K),s:t},$e(s)?"No relationships defined":ct(s,(s=>Se(an,{relationships:n,relationshipsId:e,relationshipId:s,s:t,key:s}))))},on=({tableId:e,store:n,storeId:s,s:a})=>{const r=dt("t",s,e),[o,i,d]=Ze(t(st,r,lt,a)??"[]"),c=l(st,r,lt,_e,[],a),[u,h]=ut(r,a);return Se(Tt,{uniqueId:r,summary:Y+": "+e,editable:u,handleEditable:h,s:a},Se(Ht,{tableId:e,store:n,cellId:o,descending:i,offset:d,limit:10,paginator:!0,sortOnClick:!0,onChange:c,editable:u}))},dn=({store:e,storeId:t,s:n})=>{const s=dt("v",t),[l,r]=ut(s,n);return $e(a(e))?null:Se(Tt,{uniqueId:s,summary:re,editable:l,handleEditable:r,s:n},Se(Wt,{store:e,editable:l}))},cn=({storeId:e,s:t})=>{const n=L(e),s=R(n);return be(n)?null:Se(Tt,{uniqueId:dt("s",e),summary:(n.isMergeable()?"Mergeable":"")+"Store: "+(e??K),s:t},Se(dn,{storeId:e,store:n,s:t}),ct(s,(s=>Se(on,{store:n,storeId:e,tableId:s,s:t,key:s}))))},un=({s:e})=>{const t=Ve(null),n=Ve(0),[s,l]=Me(!1),{scrollLeft:a,scrollTop:r}=E(e);Ne((()=>{const e=t.current;if(e&&!s){const t=new MutationObserver((()=>{e.scrollWidth>=ge(a)+e.clientWidth&&e.scrollHeight>=ge(r)+e.clientHeight&&e.scrollTo(a,r)}));return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()}}),[s,a,r]);const o=qe((t=>{const{scrollLeft:s,scrollTop:a}=t[ie];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{l(!0),e.setPartialValues({scrollLeft:s,scrollTop:a})}))}),[e]),i=L(),d=z(),c=T(),u=$(),h=v(),m=A(),g=V(),p=F(),b=q(),f=J();return be(i)&&$e(d)&&be(c)&&$e(u)&&be(h)&&$e(m)&&be(g)&&$e(p)&&be(b)&&$e(f)?Se("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the Inspector inside a Provider component."):Se("article",{ref:t,onScroll:o},Se(cn,{s:e}),ze(d,(t=>Se(cn,{storeId:t,s:e,key:t}))),Se(nn,{s:e}),ze(u,(t=>Se(nn,{metricsId:t,s:e,key:t}))),Se(en,{s:e}),ze(m,(t=>Se(en,{indexesId:t,s:e,key:t}))),Se(rn,{s:e}),ze(p,(t=>Se(rn,{relationshipsId:t,s:e,key:t}))),Se(ln,{s:e}),ze(f,(t=>Se(ln,{queriesId:t,s:e,key:t}))))};class hn extends Te{constructor(e){super(e),this.state={e:0}}static getDerivedStateFromError(){return{e:1}}componentDidCatch=(e,t)=>console.error(e,t.componentStack);render(){return this.state.e?Se("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const mn=({s:e})=>{const t=n(rt,e)??1,l=s(ot,(()=>!1),[],e),a=s(rt,(e=>Number(e[ie].dataset.id)),[],e);return Se("header",null,Se("img",{title:tt}),Se("span",null,tt),ze(nt,((e,n)=>n==t?null:Se("img",{onClick:a,"data-id":n,title:"Dock to "+e,key:n}))),Se("img",{onClick:l,title:"Close"}))},gn=({s:e})=>{const t=n(rt,e)??1;return n(ot,e)?Se("main",{"data-position":t},Se(mn,{s:e}),Se(hn,null,Se(un,{s:e}))):null},pn=e=>t=>{return n=(t,n)=>t+e(n),Cn(t).reduce(n,0);var n},bn=e=>e?.size??0,fn=pn(bn),yn=pn(fn),In=pn(yn),wn=(e,t)=>e?.has(t)??!1,vn=e=>be(e)||0==bn(e),Cn=e=>[...e?.values()??[]],kn=e=>e.clear(),Tn=(e,t)=>e?.forEach(t),xn=(e,t)=>e?.delete(t),Sn=e=>new Map(e),qn=e=>[...e?.keys()??[]],Nn=(e,t)=>e?.get(t),Vn=(e,t)=>Tn(e,((e,n)=>t(n,e))),Mn=(e,t,n)=>be(n)?(xn(e,t),e):e?.set(t,n),Ln=(e,t,n,s)=>(wn(e,t)?s?.(Nn(e,t)):Mn(e,t,n()),Nn(e,t)),Rn=(e,t,n,s=Mn)=>(Ke(t,((t,s)=>n(e,s,t))),Vn(e,(n=>Qe(t,n)?0:s(e,n))),e),En=(e,t,n,s)=>{const l={};return Tn(e,((e,a)=>{if(!n?.(e,a)){const n=t?t(e,a):e;s?.(n)||(l[a]=n)}})),l},zn=(e,t,n)=>En(e,(e=>En(e,t,n)),vn,Ue),$n=(e,t,n)=>En(e,(e=>zn(e,t,n)),vn,Ue),An=(e,t)=>{const n=Sn();return Tn(e,((e,s)=>n.set(s,t?.(e)??e))),n},Fn=e=>An(e,An),Jn=e=>An(e,Fn),On=(e,t,n,s,l=0)=>fe((n?Ln:Nn)(e,t[l],l>Ce(t)-2?n:Sn),(a=>{if(l>Ce(t)-2)return s?.(a)&&Mn(e,t[l]),a;const r=On(a,t,n,s,l+1);return vn(a)&&Mn(e,t[l]),r})),Pn=Sn(),Dn=Sn(),jn="storage",Bn=e=>new Set(we(e)||be(e)?e:[e]),Hn=(e,t)=>e?.add(t),Wn=/^\d+$/,Qn=()=>{const e=[];let t=0;return[n=>(n?Fe(e):null)??j+t++,t=>{Wn.test(t)&&Ce(e)<1e3&&Ae(e,t)}]},Gn=e=>[e,e],Kn=(e,t=fn)=>t(e[0])+t(e[1]),Un=()=>[Sn(),Sn()],Xn=e=>[...e],Yn=([e,t])=>e===t;Sn(ze("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(j),((e,t)=>[e,t])));const Zn=(e,t,n)=>Mn(e,t,Nn(e,t)==-n?void 0:n),_n=()=>{let e,t,n=!1,s=!1,l=0,a=[];const r=Sn(),o=Sn(),i=Sn(),d=Sn(),c=Sn(),u=Sn(),h=Sn(),m=Sn(),g=Sn(),p=Sn(),b=Sn(),f=Sn(),y=Sn(),I=Sn(),w=Bn(),v=Sn(),C=Sn(),k=Sn(),T=Sn(),x=Un(),S=Un(),q=Un(),N=Un(),V=Un(),M=Un(),L=Un(),R=Un(),E=Un(),z=Un(),$=Un(),A=Un(),F=Un(),J=Un(),O=Un(),P=Un(),D=Un(),B=Un(),H=Un(),Q=Un(),X=Un(),ie=Un(),de=Sn(),ue=Un(),[he,me,ge,pe]=(()=>{let e;const[t,n]=Qn(),s=Sn();return[(n,l,a,r=[],o=()=>[])=>{e??=ln;const i=t(1);return Mn(s,i,[n,l,a,r,o]),Hn(On(l,a??[j],Bn),i),i},(t,n,...l)=>Ee(((e,t=[j])=>{const n=[],s=(e,l)=>l==Ce(t)?Ae(n,e):null===t[l]?Tn(e,(e=>s(e,l+1))):Ee([t[l],null],(t=>s(Nn(e,t),l+1)));return s(e,0),n})(t,n),(t=>Tn(t,(t=>Nn(s,t)[0](e,...n??[],...l))))),e=>fe(Nn(s,e),(([,t,l])=>(On(t,l??[j],void 0,(t=>(xn(t,e),vn(t)?1:0))),Mn(s,e),n(e),l))),t=>fe(Nn(s,t),(([t,,n=[],s,l])=>{const a=(...r)=>{const o=Ce(r);o==Ce(n)?t(e,...r,...l(r)):be(n[o])?Ee(s[o]?.(...r)??[],(e=>a(...r,e))):a(...r,n[o])};a()}))]})(),ke=e=>{if(!Xe(e,((e,t)=>[G,K].includes(t))))return!1;const t=e[G];return!(!ye(t)&&t!=W||(xt(e[K])!=t&&Ge(e,K),0))},Te=we,xe=(t,n)=>(!e||wn(b,n)||mt(n))&&Xe(t,((e,t)=>Se(n,t,e)),(()=>mt(n))),Se=(e,t,n,s)=>Xe(s?n:Me(n,e,t),((s,l)=>fe(qe(e,t,l,s),(e=>(n[l]=e,!0)),(()=>!1))),(()=>mt(e,t))),qe=(t,n,s,l)=>e?fe(Nn(Nn(b,t),s),(e=>xt(l)!=e[G]?mt(t,n,s,l,e[K]):l),(()=>mt(t,n,s,l))):be(xt(l))?mt(t,n,s,l):l,Ne=(e,t)=>Xe(t?e:Le(e),((t,n)=>fe(Ve(n,t),(t=>(e[n]=t,!0)),(()=>!1))),(()=>gt())),Ve=(e,n)=>t?fe(Nn(y,e),(t=>xt(n)!=t[G]?gt(e,n,t[K]):n),(()=>gt(e,n))):be(xt(n))?gt(e,n):n,Me=(e,t,n)=>(fe(Nn(f,t),(([s,l])=>{Tn(s,((t,n)=>{Qe(e,n)||(e[n]=t)})),Tn(l,(s=>{Qe(e,s)||mt(t,n,s)}))})),e),Le=e=>(t&&(Tn(I,((t,n)=>{Qe(e,n)||(e[n]=t)})),Tn(w,(t=>{Qe(e,t)||gt(t)}))),e),$e=e=>Rn(b,e,((e,t,n)=>{const s=Sn(),l=Bn();Rn(Ln(b,t,Sn),n,((e,t,n)=>{Mn(e,t,n),fe(n[K],(e=>Mn(s,t,e)),(()=>Hn(l,t)))})),Mn(f,t,[s,l])}),((e,t)=>{Mn(b,t),Mn(f,t)})),Fe=e=>Rn(y,e,((e,t,n)=>{Mn(y,t,n),fe(n[K],(e=>Mn(I,t,e)),(()=>Hn(w,t)))}),((e,t)=>{Mn(y,t),Mn(I,t),xn(w,t)})),Je=e=>Ue(e)?Ut():Ht(e),Oe=e=>Rn(k,e,((e,t,n)=>Pe(t,n)),((e,t)=>st(t))),Pe=(e,t)=>Rn(Ln(k,e,(()=>(ot(e,1),Mn(v,e,Qn()),Mn(C,e,Sn()),Sn()))),t,((t,n,s)=>De(e,t,n,s)),((t,n)=>lt(e,t,n))),De=(e,t,n,s,l)=>Rn(Ln(t,n,(()=>(it(e,n,1),Sn()))),s,((t,s,l)=>je(e,n,t,s,l)),((s,a)=>at(e,t,n,s,a,l))),je=(e,t,n,s,l)=>{wn(n,s)||dt(e,t,s,1);const a=Nn(n,s);l!==a&&(ct(e,t,s,a,l),Mn(n,s,l))},Be=(e,t,n,s,l)=>fe(Nn(t,n),(t=>je(e,n,t,s,l)),(()=>De(e,t,n,Me({[s]:l},e,n)))),We=e=>Ue(e)?Zt():Wt(e),Ye=e=>Rn(T,e,((e,t,n)=>et(t,n)),((e,t)=>rt(t))),et=(e,t)=>{wn(T,e)||ut(e,1);const n=Nn(T,e);t!==n&&(ht(e,n,t),Mn(T,e,t))},tt=(e,t)=>{const[n]=Nn(v,e),s=n(t);return wn(Nn(k,e),s)?tt(e,t):s},nt=e=>Nn(k,e)??Pe(e,{}),st=e=>Pe(e,{}),lt=(e,t,n)=>{const[,s]=Nn(v,e);s(n),De(e,t,n,{},!0)},at=(e,t,n,s,l,a)=>{const r=Nn(Nn(f,e)?.[0],l);if(!be(r)&&!a)return je(e,n,s,l,r);const o=t=>{ct(e,n,t,Nn(s,t)),dt(e,n,t,-1),Mn(s,t)};be(r)?o(l):Vn(s,o),vn(s)&&(it(e,n,-1),vn(Mn(t,n))&&(ot(e,-1),Mn(k,e),Mn(v,e),Mn(C,e)))},rt=e=>{const t=Nn(I,e);if(!be(t))return et(e,t);ht(e,Nn(T,e)),ut(e,-1),Mn(T,e)},ot=(e,t)=>Zn(r,e,t),it=(e,t,n)=>Zn(Ln(d,e,Sn),t,n)&&Mn(i,e,Ln(i,e,(()=>0))+n),dt=(e,t,n,s)=>{const l=Nn(C,e),a=Nn(l,n)??0;(0==a&&1==s||1==a&&-1==s)&&Zn(Ln(o,e,Sn),n,s),Mn(l,n,a!=-s?a+s:null),Zn(Ln(Ln(c,e,Sn),t,Sn),n,s)},ct=(e,t,n,s,l)=>{Ln(Ln(Ln(u,e,Sn),t,Sn),n,(()=>[s,0]))[1]=l,a[3]?.(e,t,n,l)},ut=(e,t)=>Zn(h,e,t),ht=(e,t,n)=>{Ln(m,e,(()=>[t,0]))[1]=n,a[4]?.(e,n)},mt=(e,t,n,s,l)=>(Ae(Ln(Ln(Ln(g,e,Sn),t,Sn),n,(()=>[])),s),l),gt=(e,t,n)=>(Ae(Ln(p,e,(()=>[])),t),n),pt=(e,t,n)=>fe(Nn(Nn(Nn(u,e),t),n),(([e,t])=>[!0,e,t]),(()=>[!1,...Gn(Et(e,t,n))])),bt=e=>fe(Nn(m,e),(([e,t])=>[!0,e,t]),(()=>[!1,...Gn(At(e))])),ft=e=>vn(g)||vn(P[e])?0:Tn(e?Jn(g):g,((t,n)=>Tn(t,((t,s)=>Tn(t,((t,l)=>me(P[e],[n,s,l],t))))))),yt=e=>vn(p)||vn(D[e])?0:Tn(e?An(p):p,((t,n)=>me(D[e],[n],t))),It=(e,t,n,s)=>{if(!vn(e))return me(t,s,(()=>En(e))),Vn(e,((e,t)=>me(n,[...s??[],e],1==t))),1},wt=e=>{const t=Ft();t!=n&&me(x[e],void 0,t);const s=vn(z[e]),l=vn(F[e])&&vn(J[e])&&vn(E[e])&&vn($[e])&&vn(M[e])&&vn(L[e])&&vn(R[e])&&s&&vn(q[e])&&vn(N[e]),a=vn(O[e])&&vn(A[e])&&vn(V[e])&&vn(S[e]);if(!l||!a){const t=e?[An(r),Fn(o),An(i),Fn(d),Jn(c),Jn(u)]:[r,o,i,d,c,u];if(!l){It(t[0],q[e],N[e]),Tn(t[1],((t,n)=>It(t,M[e],L[e],[n]))),Tn(t[2],((t,n)=>{0!=t&&me(R[e],[n],Vt(n))}));const n=Bn();Tn(t[3],((t,l)=>{It(t,E[e],$[e],[l])&&!s&&(me(z[e],[l,null]),Hn(n,l))})),s||Tn(t[5],((t,s)=>{if(!wn(n,s)){const n=Bn();Tn(t,(e=>Tn(e,(([t,s],l)=>s!==t?Hn(n,l):xn(e,l))))),Tn(n,(t=>me(z[e],[s,t])))}})),Tn(t[4],((t,n)=>Tn(t,((t,s)=>It(t,F[e],J[e],[n,s])))))}if(!a){let n;Tn(t[5],((t,s)=>{let l;Tn(t,((t,a)=>{let r;Tn(t,(([t,o],i)=>{o!==t&&(me(O[e],[s,a,i],o,t,pt),n=l=r=1)})),r&&me(A[e],[s,a],pt)})),l&&me(V[e],[s],pt)})),n&&me(S[e],void 0,pt)}}},vt=e=>{const t=jt();t!=s&&me(B[e],void 0,t);const n=vn(Q[e])&&vn(X[e]),l=vn(ie[e])&&vn(H[e]);if(!n||!l){const t=e?[An(h),An(m)]:[h,m];if(n||It(t[0],Q[e],X[e]),!l){let n;Tn(t[1],(([t,s],l)=>{s!==t&&(me(ie[e],[l],s,t,bt),n=1)})),n&&me(H[e],void 0,bt)}}},Ct=(e,...t)=>(tn((()=>e(...ze(t,ce)))),ln),kt=()=>$n(k),Tt=()=>qn(k),Nt=e=>qn(Nn(C,ce(e))),Vt=e=>bn(Nn(k,ce(e))),Mt=e=>qn(Nn(k,ce(e))),Lt=(e,t,n,s=0,l)=>{return ze(ve(Re((a=Nn(k,ce(e)),r=(e,n)=>[be(t)?n:Nn(e,ce(t)),n],ze([...a?.entries()??[]],(([e,t])=>r(t,e)))),(([e],[t])=>((e??0)<(t??0)?-1:1)*(n?-1:1))),s,be(l)?l:s+l),(([,e])=>e));var a,r},Rt=(e,t)=>qn(Nn(Nn(k,ce(e)),ce(t))),Et=(e,t,n)=>Nn(Nn(Nn(k,ce(e)),ce(t)),ce(n)),zt=()=>En(T),$t=()=>qn(T),At=e=>Nn(T,ce(e)),Ft=()=>!vn(k),Jt=e=>wn(k,ce(e)),Ot=(e,t)=>wn(Nn(C,ce(e)),ce(t)),Pt=(e,t)=>wn(Nn(k,ce(e)),ce(t)),Dt=(e,t,n)=>wn(Nn(Nn(k,ce(e)),ce(t)),ce(n)),jt=()=>!vn(T),Bt=e=>wn(T,ce(e)),Ht=e=>Ct((()=>(e=>Xe(e,xe,mt))(e)?Oe(e):0)),Wt=e=>Ct((()=>Ne(e)?Ye(e):0)),Qt=e=>{try{Je(Ze(e))}catch{}return ln},Gt=t=>Ct((()=>{if((e=Xe(t,(e=>Xe(e,ke))))&&($e(t),!vn(k))){const e=kt();Ut(),Ht(e)}})),Kt=e=>Ct((()=>{if(t=(e=>Xe(e,ke))(e)){const n=zt();en(),Zt(),t=!0,Fe(e),Wt(n)}})),Ut=()=>Ct((()=>Oe({}))),Xt=e=>Ct((e=>wn(k,e)?st(e):0),e),Yt=(e,t)=>Ct(((e,t)=>fe(Nn(k,e),(n=>wn(n,t)?lt(e,n,t):0))),e,t),Zt=()=>Ct((()=>Ye({}))),_t=()=>Ct((()=>{$e({}),e=!1})),en=()=>Ct((()=>{Fe({}),t=!1})),tn=(e,t)=>{if(-1!=l){nn();const n=e();return sn(t),n}},nn=()=>(-1!=l&&l++,1==l&&(a[0]?.(),me(de)),ln),sn=e=>(l>0&&(l--,0==l&&(l=1,ft(1),vn(u)||wt(1),yt(1),vn(m)||vt(1),e?.(ln)&&(Tn(u,((e,t)=>Tn(e,((e,n)=>Tn(e,(([e],s)=>St(ln,t,n,s,e))))))),kn(u),Tn(m,(([e],t)=>qt(ln,t,e))),kn(m)),me(ue[0],void 0),l=-1,ft(0),vn(u)||wt(0),yt(0),vn(m)||vt(0),a[1]?.(),me(ue[1],void 0),a[2]?.(),l=0,n=Ft(),s=jt(),Ee([r,o,i,d,c,u,g,h,m,p],kn))),ln),ln={getContent:()=>[kt(),zt()],getTables:kt,getTableIds:Tt,getTable:e=>zn(Nn(k,ce(e))),getTableCellIds:Nt,getRowCount:Vt,getRowIds:Mt,getSortedRowIds:Lt,getRow:(e,t)=>En(Nn(Nn(k,ce(e)),ce(t))),getCellIds:Rt,getCell:Et,getValues:zt,getValueIds:$t,getValue:At,hasTables:Ft,hasTable:Jt,hasTableCell:Ot,hasRow:Pt,hasCell:Dt,hasValues:jt,hasValue:Bt,getTablesJson:()=>_e(k),getValuesJson:()=>_e(T),getJson:()=>_e([k,T]),getTablesSchemaJson:()=>_e(b),getValuesSchemaJson:()=>_e(y),getSchemaJson:()=>_e([b,y]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:e=>Ct((()=>Te(e)?(([e,t])=>{(Ue(e)?Ut:Ht)(e),(Ue(t)?Zt:Wt)(t)})(e):0)),setTables:Ht,setTable:(e,t)=>Ct((e=>xe(t,e)?Pe(e,t):0),e),setRow:(e,t,n)=>Ct(((e,t)=>Se(e,t,n)?De(e,nt(e),t,n):0),e,t),addRow:(e,t,n=!0)=>tn((()=>{let s;return Se(e,s,t)&&(e=ce(e),De(e,nt(e),s=tt(e,n?1:0),t)),s})),setPartialRow:(e,t,n)=>Ct(((e,t)=>{if(Se(e,t,n,1)){const s=nt(e);Ke(n,((n,l)=>Be(e,s,t,l,n)))}}),e,t),setCell:(e,t,n,s)=>Ct(((e,t,n)=>fe(qe(e,t,n,Ie(s)?s(Et(e,t,n)):s),(s=>Be(e,nt(e),t,n,s)))),e,t,n),setValues:Wt,setPartialValues:e=>Ct((()=>Ne(e,1)?Ke(e,((e,t)=>et(t,e))):0)),setValue:(e,t)=>Ct((e=>fe(Ve(e,Ie(t)?t(At(e)):t),(t=>et(e,t)))),e),applyChanges:e=>Ct((()=>{Ke(e[0],((e,t)=>be(e)?Xt(t):Ke(e,((e,n)=>be(e)?Yt(t,n):Ke(e,((e,s)=>St(ln,t,n,s,e))))))),Ke(e[1],((e,t)=>qt(ln,t,e)))})),setTablesJson:Qt,setValuesJson:e=>{try{We(Ze(e))}catch{}return ln},setJson:e=>Ct((()=>{try{const[t,n]=Ze(e);Je(t),We(n)}catch{Qt(e)}})),setTablesSchema:Gt,setValuesSchema:Kt,setSchema:(e,t)=>Ct((()=>{Gt(e),Kt(t)})),delTables:Ut,delTable:Xt,delRow:Yt,delCell:(e,t,n,s)=>Ct(((e,t,n)=>fe(Nn(k,e),(l=>fe(Nn(l,t),(a=>wn(a,n)?at(e,l,t,a,n,s):0))))),e,t,n),delValues:Zt,delValue:e=>Ct((e=>wn(T,e)?rt(e):0),e),delTablesSchema:_t,delValuesSchema:en,delSchema:()=>Ct((()=>{_t(),en()})),transaction:tn,startTransaction:nn,getTransactionChanges:()=>[En(u,((e,t)=>-1===Nn(r,t)?void 0:En(e,((e,n)=>-1===Nn(Nn(d,t),n)?void 0:En(e,(([,e])=>e),(e=>Yn(e)))),vn,Ue)),vn,Ue),En(m,(([,e])=>e),(e=>Yn(e))),1],getTransactionLog:()=>[!vn(u),!vn(m),$n(u,Xn,Yn),$n(g),En(m,Xn,Yn),En(p),En(r),zn(d),$n(c),En(h)],finishTransaction:sn,forEachTable:e=>Tn(k,((t,n)=>e(n,(e=>Tn(t,((t,n)=>e(n,(e=>Vn(t,e))))))))),forEachTableCell:(e,t)=>Vn(Nn(C,ce(e)),t),forEachRow:(e,t)=>Tn(Nn(k,ce(e)),((e,n)=>t(n,(t=>Vn(e,t))))),forEachCell:(e,t,n)=>Vn(Nn(Nn(k,ce(e)),ce(t)),n),forEachValue:e=>Vn(T,e),addSortedRowIdsListener:(e,t,n,s,l,a,r)=>{let o=Lt(e,t,n,s,l);return he((()=>{const r=Lt(e,t,n,s,l);var i,d,c;d=o,Ce(i=r)===Ce(d)&&(c=(e,t)=>d[t]===e,i.every(c))||(o=r,a(ln,e,t,n,s,l,o))}),z[r?1:0],[e,t],[Tt])},addStartTransactionListener:e=>he(e,de),addWillFinishTransactionListener:e=>he(e,ue[0]),addDidFinishTransactionListener:e=>he(e,ue[1]),callListener:e=>(pe(e),ln),delListener:e=>(ge(e),ln),getListenerStats:()=>({hasTables:Kn(x),tables:Kn(S),tableIds:Kn(q),hasTable:Kn(N),table:Kn(V),tableCellIds:Kn(M),hasTableCell:Kn(L,yn),rowCount:Kn(R),rowIds:Kn(E),sortedRowIds:Kn(z),hasRow:Kn($,yn),row:Kn(A,yn),cellIds:Kn(F,yn),hasCell:Kn(J,In),cell:Kn(O,In),invalidCell:Kn(P,In),hasValues:Kn(B),values:Kn(H),valueIds:Kn(Q),hasValue:Kn(X),value:Kn(ie),invalidValue:Kn(D),transaction:fn(de)+Kn(ue)}),isMergeable:()=>!1,createStore:_n,addListener:he,callListeners:me,setInternalListeners:(e,t,n,s,l)=>a=[e,t,n,s,l]};return Ke({[U+Z]:[0,x,[],()=>[Ft()]],[Z]:[0,S],[_]:[0,q],[U+Y]:[1,N,[Tt],e=>[Jt(...e)]],[Y]:[1,V,[Tt]],[Y+le]:[1,M,[Tt]],[U+Y+se]:[2,L,[Tt,Nt],e=>[Ot(...e)]],[te]:[1,R,[Tt]],[ne]:[1,E,[Tt]],[U+ee]:[2,$,[Tt,Mt],e=>[Pt(...e)]],[ee]:[2,A,[Tt,Mt]],[le]:[2,F,[Tt,Mt]],[U+se]:[3,J,[Tt,Mt,Rt],e=>[Dt(...e)]],[se]:[3,O,[Tt,Mt,Rt],e=>Gn(Et(...e))],InvalidCell:[3,P],[U+re]:[0,B,[],()=>[jt()]],[re]:[0,H],[oe]:[0,Q],[U+ae]:[1,X,[$t],e=>[Bt(...e)]],[ae]:[1,ie,[$t],e=>Gn(At(e[0]))],InvalidValue:[1,D]},(([e,t,n,s],l)=>{ln["add"+l+"Listener"]=(...l)=>he(l[e],t[l[e+1]?1:0],e>0?ve(l,0,e):void 0,n,s)})),He(ln)},es=({position:e="right",open:t=!1})=>{const n=O(_n),s=nt.indexOf(e);return P(n,(e=>{return t=et,n=sessionStorage,((e,t,n,s,l,a,r,o={},i=[])=>{let d,c,u,h=0,m=0,g=0;Ln(Pn,i,(()=>0)),Ln(Dn,i,(()=>[]));const[p,b,f,y,I]=((e=1,t)=>1!=e&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!Ue(e)||!Ue(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!Ue(e)||!Ue(t),t.setContent]:ke("Store type not supported by this Persister"))(r,e),w=t=>{(p&&we(t?.[0])?1===t?.[2]?e.applyMergeableChanges:e.setMergeableContent:1===t?.[2]?e.applyChanges:e.setContent)(t)},v=async e=>(2!=h&&(h=1,m++,await x((async()=>{try{const e=await t();we(e)?w(e):ke("Content is not an array "+e)}catch(t){e&&I(e)}h=0}))),S),C=()=>(c&&(l(c),c=void 0),S),k=async e=>(1!=h&&(h=2,g++,await x((async()=>{try{await n(b,e)}catch(e){}h=0}))),S),T=()=>(fe(u,e.delListener),u=void 0,S),x=async(...e)=>(Ae(Nn(Dn,i),...e),await(async()=>{if(!Nn(Pn,i)){for(Mn(Pn,i,1);!be(d=Fe(Nn(Dn,i)));)try{await d()}catch(e){}Mn(Pn,i,0)}})(),S),S={load:v,startAutoLoad:async e=>{await C().load(e);try{c=await s((async(e,t)=>{t||e?2!=h&&(h=1,m++,w(t??e),h=0):await v()}))}catch(e){}return S},stopAutoLoad:C,isAutoLoading:()=>!be(c),save:k,startAutoSave:async()=>(await T().save(),u=e.addDidFinishTransactionListener((()=>{const e=f();y(e)&&k(e)})),S),stopAutoSave:T,isAutoSaving:()=>!be(u),schedule:x,getStore:()=>e,destroy:()=>(Nn(Dn,i).splice(0,void 0),C().stopAutoSave()),getStats:()=>({loads:m,saves:g}),...o};return He(S)})(e,(async()=>{return e=n.getItem(t),Ze(e,((e,t)=>""===t?void 0:t));var e}),(async e=>{return n.setItem(t,(s=e(),Ye(s,((e,t)=>void 0===t?"":t))));var s}),(e=>{const s=s=>{if(s.storageArea===n&&s.key===t)try{e(Ze(s.newValue))}catch{e()}};return ue.addEventListener(jn,s),s}),(e=>ue.removeEventListener(jn,e)),0,3,{getStorageName:()=>t});var t,n}),void 0,(async e=>{await e.load([{},{position:-1==s?1:s,open:!!t}]),await e.startAutoSave()})),Se(xe,null,Se("aside",{id:et},Se(kt,{s:n}),Se(gn,{s:n})),Se("style",null,Ct))};export{es as Inspector};
|
|
1
|
+
import e from"react";import{useCell as t,useValue as n,useSetValueCallback as s,useSetCellCallback as l,useValueIds as a,ValueView as r,useStoreOrStoreById as o,useRowCount as i,useSortedRowIds as d,useTableCellIds as c,useIndexesOrIndexesById as u,useSliceRowIds as h,useRelationshipsOrRelationshipsById as m,useRowIds as g,useResultRowCount as p,useResultSortedRowIds as b,useResultTableCellIds as f,useRemoteRowId as y,CellView as I,ResultCellView as w,useIndexes as v,useIndexIds as C,useSliceIds as k,useMetrics as T,useMetricIds as x,useMetric as S,useQueries as q,useQueryIds as N,useRelationships as V,useRelationshipIds as M,useStore as L,useTableIds as R,useValues as E,useStoreIds as z,useMetricsIds as $,useIndexesIds as A,useRelationshipsIds as F,useQueriesIds as J,useCreateStore as O,useCreatePersister as P}from"../ui-react/index.js";const D=e=>typeof e,j="",B=D(j),H=D(!0),W=D(0),Q=D(D),G="type",K="default",U="Has",X="Ids",Y="Table",Z=Y+"s",_=Y+X,ee="Row",te=ee+"Count",ne=ee+X,se="Cell",le=se+X,ae="Value",re=ae+"s",oe=ae+X,ie="currentTarget",de="value",ce=e=>j+e,ue=globalThis.window,he=Math,me=he.min,ge=he.floor,pe=isFinite,be=e=>null==e,fe=(e,t,n)=>be(e)?n?.():t(e),ye=e=>e==B||e==H,Ie=e=>D(e)==Q,we=e=>Array.isArray(e),ve=(e,t,n)=>e.slice(t,n),Ce=e=>e.length,ke=e=>{throw Error(e)},{PureComponent:Te,Fragment:xe,createElement:Se,useCallback:qe,useLayoutEffect:Ne,useRef:Ve,useState:Me}=e,Le=(e,...t)=>be(e)?{}:e(...t),Re=(e,t)=>e.sort(t),Ee=(e,t)=>e.forEach(t),ze=(e,t)=>e.map(t),$e=e=>0==Ce(e),Ae=(e,...t)=>e.push(...t),Fe=e=>e.shift(),Je=Object,Oe=e=>Je.getPrototypeOf(e),Pe=Je.entries,De=Je.isFrozen,je=e=>!be(e)&&fe(Oe(e),(e=>e==Je.prototype||be(Oe(e))),(()=>!0)),Be=Je.keys,He=Je.freeze,We=(e=[])=>Je.fromEntries(e),Qe=(e,t)=>t in e,Ge=(e,t)=>(delete e[t],e),Ke=(e,t)=>ze(Pe(e),(([e,n])=>t(n,e))),Ue=e=>je(e)&&0==(e=>Ce(Be(e)))(e),Xe=(e,t,n,s=0)=>be(e)||!je(e)||!s&&Ue(e)||De(e)?(n?.(),!1):(Ke(e,((n,s)=>{t(n,s)||Ge(e,s)})),!!s||!Ue(e)),Ye=JSON.stringify,Ze=JSON.parse,_e=e=>Ye(e,((e,t)=>t instanceof Map?Je.fromEntries([...t]):t)),et="tinybaseInspector",tt="TinyBase Inspector",nt=["left","top","bottom","right","full"],st="state",lt="sort",at="open",rt="position",ot=at,it="editable",dt=(...e)=>_e(e),ct=(e,t)=>ze(Re([...e]),t),ut=(e,n)=>[!!t(st,e,it,n),qe((t=>{n.setCell(st,e,it,(e=>!e)),t.preventDefault()}),[n,e])],ht="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",mt='content:url("',gt=mt+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",pt='</svg>")',bt=mt+"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\")",ft=ze([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,n,s])=>gt+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${n}' height='${s}' fill='white'/>`+pt)),yt=gt+"<path d='M20 20l60 60M20 80l60-60' />"+pt,It=gt+`<path d='${ht}' />`+pt,wt=gt+`<path d='${ht}M20 20l60 60' />`+pt,vt="*::-webkit-scrollbar",Ct=((e,t="")=>e.join(t))(Ke({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[vt]:"width:0.5rem;height:0.5rem;",[vt+"-track"]:"background:#111",[vt+"-thumb"]:"background:#999;border:1px solid #111",[vt+"-thumb:hover"]:"background:#fff",[vt+"-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;"+bt,...We(ze(["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;",...We(ze(["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)":bt,"header>img:nth-of-type(6)":yt,...We(ze(ft,((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":It,"details[open]>summary img.done":wt,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,#${et} 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?`#${et} ${t}{${e}}`:""))),kt=({s:e})=>{const t=n(rt,e)??1,l=s(ot,(()=>!0),[],e);return n(ot,e)?null:Se("img",{onClick:l,title:tt,"data-position":t})},Tt=({uniqueId:e,summary:n,editable:s,handleEditable:a,children:r,s:o})=>{const i=!!t(st,e,at,o),d=l(st,e,at,(e=>e[ie].open),[],o);return Se("details",{open:i,onToggle:d},Se("summary",null,n,a?Se("img",{onClick:a,className:s?"done":"edit"}):null),r)},xt=e=>{const t=D(e);return ye(t)||t==W&&pe(e)?t:void 0},St=(e,t,n,s,l)=>be(l)?e.delCell(t,n,s,!0):e.setCell(t,n,s,l),qt=(e,t,n)=>be(n)?e.delValue(t):e.setValue(t,n),Nt=(e,t,n,s)=>e==B?t:e==W?n:s,{useCallback:Vt,useMemo:Mt,useState:Lt}=e,Rt="editable",Et=(e,t)=>ze(c(e,t),(t=>e+"."+t)),zt=(e,t,n)=>{const s=Vt(e,t);return n?s:void 0},$t=(...e)=>Mt((()=>e),e),At=(e,t)=>Mt((()=>({store:e,tableId:t})),[e,t]),Ft=(e,t)=>Mt((()=>({queries:e,queryId:t})),[e,t]),Jt=(e,t=!1,n,s=0,l,a,r,o)=>{const[[i,d,c],u]=Lt([e,t,s]),h=Vt((e=>{u(e),o?.(e)}),[o]),m=zt((e=>h([e,e==i&&!d,c])),[h,i,d,c],n),g=Vt((e=>h([i,d,e])),[h,i,d]),p=!0===r?Yt:r;return[[i,d,c],m,Mt((()=>!1===r?null:Se(p,{offset:c,limit:l,total:a,onChange:g})),[r,p,c,l,a,g])]},Ot=(e,t,n)=>Mt((()=>{const s=t??e;return l=we(s)?We(ze(s,(e=>[e,e]))):s,a=(e,t)=>{return{label:t,component:n,...(s=e,D(s)==B?{label:e}:e)};var s},We(Ke(l,((e,t)=>[t,a(e,t)])));var l,a}),[t,n,e]),Pt=({className:e,headerRow:t,idColumn:n,params:[s,l,a,r,o,i]})=>Se("table",{className:e},i?Se("caption",null,i):null,!1===t?null:Se("thead",null,Se("tr",null,!1===n?null:Se(Dt,{sort:r??[],label:"Id",onClick:o}),Ke(s,(({label:e},t)=>Se(Dt,{key:t,cellId:t,label:e,sort:r??[],onClick:o}))))),Se("tbody",null,ze(a,(e=>Se("tr",{key:e},!1===n?null:Se("th",null,e),Ke(s,(({component:t,getComponentProps:n},s)=>Se("td",{key:s},Se(t,{...Le(n,e,s),...l,rowId:e,cellId:s}))))))))),Dt=({cellId:e,sort:[t,n],label:s=e??j,onClick:l})=>Se("th",{onClick:zt((()=>l?.(e)),[l,e],l),className:be(n)||t!=e?void 0:`sorted ${n?"de":"a"}scending`},be(n)||t!=e?null:(n?"↓":"↑")+" ",s),jt=({localRowId:t,params:[n,s,l,a,r,o,i]})=>{const d=y(r,t,o);return Se("tr",null,!1===n?null:Se(e.Fragment,null,Se("th",null,t),Se("th",null,d)),Ke(s,(({component:e,getComponentProps:n},s)=>{const[r,o]=s.split(".",2),c=r===l?t:r===a?d:null;return be(c)?null:Se("td",{key:s},Se(e,{...Le(n,c,o),store:i,tableId:r,rowId:c,cellId:o}))})))},Bt=({thing:e,onThingChange:t,className:n,hasSchema:s,showType:l=!0})=>{const[a,r]=Lt(),[o,i]=Lt(),[d,c]=Lt(),[u,h]=Lt(),[m,g]=Lt();o!==e&&(r(xt(e)),i(e),c(e+""),h(Number(e)||0),g(!!e));const p=Vt(((e,n)=>{n(e),i(e),t(e)}),[t]),b=Vt((()=>{if(!s?.()){const e=Nt(a,W,H,B),n=Nt(e,d,u,m);r(e),i(n),t(n)}}),[s,t,d,u,m,a]);return Se("div",{className:n},l?Se("button",{className:a,onClick:b},a):null,Nt(a,Se("input",{key:a,value:d,onChange:Vt((e=>p(e[ie][de]+"",c)),[p])}),Se("input",{key:a,type:"number",value:u,onChange:Vt((e=>p(Number(e[ie][de]||0),h)),[p])}),Se("input",{key:a,type:"checkbox",checked:m,onChange:Vt((e=>p(!!e[ie].checked,g)),[p])})))},Ht=({tableId:e,cellId:t,descending:n,offset:s,limit:l,store:a,editable:r,sortOnClick:o,paginator:u=!1,onChange:h,customCells:m,...g})=>{const[p,b,f]=Jt(t,n,o,s,l,i(e,a),u,h);return Se(Pt,{...g,params:$t(Ot(c(e,a),m,r?Ut:I),At(a,e),d(e,...p,l,a),p,b,f)})},Wt=({store:e,editable:t=!1,valueComponent:n=(t?Xt:r),getValueComponentProps:s,className:l,headerRow:o,idColumn:i})=>Se("table",{className:l},!1===o?null:Se("thead",null,Se("tr",null,!1===i?null:Se("th",null,"Id"),Se("th",null,ae))),Se("tbody",null,ze(a(e),(t=>Se("tr",{key:t},!1===i?null:Se("th",null,t),Se("td",null,Se(n,{...Le(s,t),valueId:t,store:e}))))))),Qt=({indexId:e,sliceId:t,indexes:n,editable:s,customCells:l,...a})=>{const[r,o,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(u(n),e);return Se(Pt,{...a,params:$t(Ot(c(i,o),l,s?Ut:I),At(o,i),h(e,t,r))})},Gt=({relationshipId:t,relationships:n,editable:s,customCells:l,className:a,headerRow:r,idColumn:o=!0})=>{const[i,d,c,u]=((e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)])(m(n),t),h=Ot([...Et(c,d),...Et(u,d)],l,s?Ut:I),p=$t(o,h,c,u,t,i,d);return Se("table",{className:a},!1===r?null:Se("thead",null,Se("tr",null,!1===o?null:Se(e.Fragment,null,Se("th",null,c,".Id"),Se("th",null,u,".Id")),Ke(h,(({label:e},t)=>Se("th",{key:t},e))))),Se("tbody",null,ze(g(c,d),(e=>Se(jt,{key:e,localRowId:e,params:p})))))},Kt=({queryId:e,cellId:t,descending:n,offset:s,limit:l,queries:a,sortOnClick:r,paginator:o=!1,customCells:i,onChange:d,...c})=>{const[u,h,m]=Jt(t,n,r,s,l,p(e,a),o,d);return Se(Pt,{...c,params:$t(Ot(f(e,a),i,w),Ft(a,e),b(e,...u,l,a),u,h,m)})},Ut=({tableId:e,rowId:n,cellId:s,store:a,className:r,showType:i})=>Se(Bt,{thing:t(e,n,s,a),onThingChange:l(e,n,s,(e=>e),[],a),className:r??Rt+se,showType:i,hasSchema:o(a)?.hasTablesSchema}),Xt=({valueId:e,store:t,className:l,showType:a})=>Se(Bt,{thing:n(e,t),onThingChange:s(e,(e=>e),[],t),className:l??Rt+ae,showType:a,hasSchema:o(t)?.hasValuesSchema}),Yt=({onChange:t,total:n,offset:s=0,limit:l=n,singular:a="row",plural:r=a+"s"})=>{(s>n||s<0)&&(s=0,t(0));const o=zt((()=>t(s-l)),[t,s,l],s>0),i=zt((()=>t(s+l)),[t,s,l],s+l<n);return Se(e.Fragment,null,n>l&&Se(e.Fragment,null,Se("button",{className:"previous",disabled:0==s,onClick:o},"←"),Se("button",{className:"next",disabled:s+l>=n,onClick:i},"→"),s+1," to ",me(n,s+l)," of "),n," ",1!=n?r:a)},Zt=({indexes:e,indexesId:t,indexId:n,s:s})=>Se(Tt,{uniqueId:dt("i",t,n),summary:"Index: "+n,s:s},ze(k(n,e),(l=>Se(_t,{indexes:e,indexesId:t,indexId:n,sliceId:l,s:s,key:l})))),_t=({indexes:e,indexesId:t,indexId:n,sliceId:s,s:l})=>{const a=dt("i",t,n,s),[r,o]=ut(a,l);return Se(Tt,{uniqueId:a,summary:"Slice: "+s,editable:r,handleEditable:o,s:l},Se(Qt,{sliceId:s,indexId:n,indexes:e,editable:r}))},en=({indexesId:e,s:t})=>{const n=v(e),s=C(n);return be(n)?null:Se(Tt,{uniqueId:dt("i",e),summary:"Indexes: "+(e??K),s:t},$e(s)?"No indexes defined":ct(s,(s=>Se(Zt,{indexes:n,indexesId:e,indexId:s,s:t,key:s}))))},tn=({metrics:e,metricId:t})=>Se("tr",null,Se("th",null,t),Se("td",null,e?.getTableId(t)),Se("td",null,S(t,e))),nn=({metricsId:e,s:t})=>{const n=T(e),s=x(n);return be(n)?null:Se(Tt,{uniqueId:dt("m",e),summary:"Metrics: "+(e??K),s:t},$e(s)?"No metrics defined":Se("table",null,Se("thead",null,Se("th",null,"Metric Id"),Se("th",null,"Table Id"),Se("th",null,"Metric")),Se("tbody",null,ze(s,(e=>Se(tn,{metrics:n,metricId:e,key:e}))))))},sn=({queries:e,queriesId:n,queryId:s,s:a})=>{const r=dt("q",n,s),[o,i,d]=Ze(t(st,r,lt,a)??"[]"),c=l(st,r,lt,_e,[],a);return Se(Tt,{uniqueId:r,summary:"Query: "+s,s:a},Se(Kt,{queryId:s,queries:e,cellId:o,descending:i,offset:d,limit:10,paginator:!0,sortOnClick:!0,onChange:c}))},ln=({queriesId:e,s:t})=>{const n=q(e),s=N(n);return be(n)?null:Se(Tt,{uniqueId:dt("q",e),summary:"Queries: "+(e??K),s:t},$e(s)?"No queries defined":ct(s,(s=>Se(sn,{queries:n,queriesId:e,queryId:s,s:t,key:s}))))},an=({relationships:e,relationshipsId:t,relationshipId:n,s:s})=>{const l=dt("r",t,n),[a,r]=ut(l,s);return Se(Tt,{uniqueId:l,summary:"Relationship: "+n,editable:a,handleEditable:r,s:s},Se(Gt,{relationshipId:n,relationships:e,editable:a}))},rn=({relationshipsId:e,s:t})=>{const n=V(e),s=M(n);return be(n)?null:Se(Tt,{uniqueId:dt("r",e),summary:"Relationships: "+(e??K),s:t},$e(s)?"No relationships defined":ct(s,(s=>Se(an,{relationships:n,relationshipsId:e,relationshipId:s,s:t,key:s}))))},on=({tableId:e,store:n,storeId:s,s:a})=>{const r=dt("t",s,e),[o,i,d]=Ze(t(st,r,lt,a)??"[]"),c=l(st,r,lt,_e,[],a),[u,h]=ut(r,a);return Se(Tt,{uniqueId:r,summary:Y+": "+e,editable:u,handleEditable:h,s:a},Se(Ht,{tableId:e,store:n,cellId:o,descending:i,offset:d,limit:10,paginator:!0,sortOnClick:!0,onChange:c,editable:u}))},dn=({store:e,storeId:t,s:n})=>{const s=dt("v",t),[l,r]=ut(s,n);return $e(a(e))?null:Se(Tt,{uniqueId:s,summary:re,editable:l,handleEditable:r,s:n},Se(Wt,{store:e,editable:l}))},cn=({storeId:e,s:t})=>{const n=L(e),s=R(n);return be(n)?null:Se(Tt,{uniqueId:dt("s",e),summary:(n.isMergeable()?"Mergeable":"")+"Store: "+(e??K),s:t},Se(dn,{storeId:e,store:n,s:t}),ct(s,(s=>Se(on,{store:n,storeId:e,tableId:s,s:t,key:s}))))},un=({s:e})=>{const t=Ve(null),n=Ve(0),[s,l]=Me(!1),{scrollLeft:a,scrollTop:r}=E(e);Ne((()=>{const e=t.current;if(e&&!s){const t=new MutationObserver((()=>{e.scrollWidth>=ge(a)+e.clientWidth&&e.scrollHeight>=ge(r)+e.clientHeight&&e.scrollTo(a,r)}));return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()}}),[s,a,r]);const o=qe((t=>{const{scrollLeft:s,scrollTop:a}=t[ie];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{l(!0),e.setPartialValues({scrollLeft:s,scrollTop:a})}))}),[e]),i=L(),d=z(),c=T(),u=$(),h=v(),m=A(),g=V(),p=F(),b=q(),f=J();return be(i)&&$e(d)&&be(c)&&$e(u)&&be(h)&&$e(m)&&be(g)&&$e(p)&&be(b)&&$e(f)?Se("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the Inspector inside a Provider component."):Se("article",{ref:t,onScroll:o},Se(cn,{s:e}),ze(d,(t=>Se(cn,{storeId:t,s:e,key:t}))),Se(nn,{s:e}),ze(u,(t=>Se(nn,{metricsId:t,s:e,key:t}))),Se(en,{s:e}),ze(m,(t=>Se(en,{indexesId:t,s:e,key:t}))),Se(rn,{s:e}),ze(p,(t=>Se(rn,{relationshipsId:t,s:e,key:t}))),Se(ln,{s:e}),ze(f,(t=>Se(ln,{queriesId:t,s:e,key:t}))))};class hn extends Te{constructor(e){super(e),this.state={e:0}}static getDerivedStateFromError(){return{e:1}}componentDidCatch=(e,t)=>console.error(e,t.componentStack);render(){return this.state.e?Se("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const mn=({s:e})=>{const t=n(rt,e)??1,l=s(ot,(()=>!1),[],e),a=s(rt,(e=>Number(e[ie].dataset.id)),[],e);return Se("header",null,Se("img",{title:tt}),Se("span",null,tt),ze(nt,((e,n)=>n==t?null:Se("img",{onClick:a,"data-id":n,title:"Dock to "+e,key:n}))),Se("img",{onClick:l,title:"Close"}))},gn=({s:e})=>{const t=n(rt,e)??1;return n(ot,e)?Se("main",{"data-position":t},Se(mn,{s:e}),Se(hn,null,Se(un,{s:e}))):null},pn=e=>t=>{return n=(t,n)=>t+e(n),Cn(t).reduce(n,0);var n},bn=e=>e?.size??0,fn=pn(bn),yn=pn(fn),In=pn(yn),wn=(e,t)=>e?.has(t)??!1,vn=e=>be(e)||0==bn(e),Cn=e=>[...e?.values()??[]],kn=e=>e.clear(),Tn=(e,t)=>e?.forEach(t),xn=(e,t)=>e?.delete(t),Sn=e=>new Map(e),qn=e=>[...e?.keys()??[]],Nn=(e,t)=>e?.get(t),Vn=(e,t)=>Tn(e,((e,n)=>t(n,e))),Mn=(e,t,n)=>be(n)?(xn(e,t),e):e?.set(t,n),Ln=(e,t,n,s)=>(wn(e,t)?s?.(Nn(e,t)):Mn(e,t,n()),Nn(e,t)),Rn=(e,t,n,s=Mn)=>(Ke(t,((t,s)=>n(e,s,t))),Vn(e,(n=>Qe(t,n)?0:s(e,n))),e),En=(e,t,n,s)=>{const l={};return Tn(e,((e,a)=>{if(!n?.(e,a)){const n=t?t(e,a):e;s?.(n)||(l[a]=n)}})),l},zn=(e,t,n)=>En(e,(e=>En(e,t,n)),vn,Ue),$n=(e,t,n)=>En(e,(e=>zn(e,t,n)),vn,Ue),An=(e,t)=>{const n=Sn();return Tn(e,((e,s)=>n.set(s,t?.(e)??e))),n},Fn=e=>An(e,An),Jn=e=>An(e,Fn),On=(e,t,n,s,l=0)=>fe((n?Ln:Nn)(e,t[l],l>Ce(t)-2?n:Sn),(a=>{if(l>Ce(t)-2)return s?.(a)&&Mn(e,t[l]),a;const r=On(a,t,n,s,l+1);return vn(a)&&Mn(e,t[l]),r})),Pn=Sn(),Dn=Sn(),jn="storage",Bn=e=>new Set(we(e)||be(e)?e:[e]),Hn=(e,t)=>e?.add(t),Wn=/^\d+$/,Qn=()=>{const e=[];let t=0;return[n=>(n?Fe(e):null)??j+t++,t=>{Wn.test(t)&&Ce(e)<1e3&&Ae(e,t)}]},Gn=e=>[e,e],Kn=(e,t=fn)=>t(e[0])+t(e[1]),Un=()=>[Sn(),Sn()],Xn=e=>[...e],Yn=([e,t])=>e===t;Sn(ze("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(j),((e,t)=>[e,t])));const Zn=(e,t,n)=>Mn(e,t,Nn(e,t)==-n?void 0:n),_n=()=>{let e,t,n=!1,s=!1,l=0,a=[];const r=Sn(),o=Sn(),i=Sn(),d=Sn(),c=Sn(),u=Sn(),h=Sn(),m=Sn(),g=Sn(),p=Sn(),b=Sn(),f=Sn(),y=Sn(),I=Sn(),w=Bn(),v=Sn(),C=Sn(),k=Sn(),T=Sn(),x=Un(),S=Un(),q=Un(),N=Un(),V=Un(),M=Un(),L=Un(),R=Un(),E=Un(),z=Un(),$=Un(),A=Un(),F=Un(),J=Un(),O=Un(),P=Un(),D=Un(),B=Un(),H=Un(),Q=Un(),X=Un(),ie=Un(),de=Sn(),ue=Un(),[he,me,ge,pe]=(()=>{let e;const[t,n]=Qn(),s=Sn();return[(n,l,a,r=[],o=()=>[])=>{e??=ln;const i=t(1);return Mn(s,i,[n,l,a,r,o]),Hn(On(l,a??[j],Bn),i),i},(t,n,...l)=>Ee(((e,t=[j])=>{const n=[],s=(e,l)=>l==Ce(t)?Ae(n,e):null===t[l]?Tn(e,(e=>s(e,l+1))):Ee([t[l],null],(t=>s(Nn(e,t),l+1)));return s(e,0),n})(t,n),(t=>Tn(t,(t=>Nn(s,t)[0](e,...n??[],...l))))),e=>fe(Nn(s,e),(([,t,l])=>(On(t,l??[j],void 0,(t=>(xn(t,e),vn(t)?1:0))),Mn(s,e),n(e),l))),t=>fe(Nn(s,t),(([t,,n=[],s,l])=>{const a=(...r)=>{const o=Ce(r);o==Ce(n)?t(e,...r,...l(r)):be(n[o])?Ee(s[o]?.(...r)??[],(e=>a(...r,e))):a(...r,n[o])};a()}))]})(),ke=e=>{if(!Xe(e,((e,t)=>[G,K].includes(t))))return!1;const t=e[G];return!(!ye(t)&&t!=W||(xt(e[K])!=t&&Ge(e,K),0))},Te=we,xe=(t,n)=>(!e||wn(b,n)||mt(n))&&Xe(t,((e,t)=>Se(n,t,e)),(()=>mt(n))),Se=(e,t,n,s)=>Xe(s?n:Me(n,e,t),((s,l)=>fe(qe(e,t,l,s),(e=>(n[l]=e,!0)),(()=>!1))),(()=>mt(e,t))),qe=(t,n,s,l)=>e?fe(Nn(Nn(b,t),s),(e=>xt(l)!=e[G]?mt(t,n,s,l,e[K]):l),(()=>mt(t,n,s,l))):be(xt(l))?mt(t,n,s,l):l,Ne=(e,t)=>Xe(t?e:Le(e),((t,n)=>fe(Ve(n,t),(t=>(e[n]=t,!0)),(()=>!1))),(()=>gt())),Ve=(e,n)=>t?fe(Nn(y,e),(t=>xt(n)!=t[G]?gt(e,n,t[K]):n),(()=>gt(e,n))):be(xt(n))?gt(e,n):n,Me=(e,t,n)=>(fe(Nn(f,t),(([s,l])=>{Tn(s,((t,n)=>{Qe(e,n)||(e[n]=t)})),Tn(l,(s=>{Qe(e,s)||mt(t,n,s)}))})),e),Le=e=>(t&&(Tn(I,((t,n)=>{Qe(e,n)||(e[n]=t)})),Tn(w,(t=>{Qe(e,t)||gt(t)}))),e),$e=e=>Rn(b,e,((e,t,n)=>{const s=Sn(),l=Bn();Rn(Ln(b,t,Sn),n,((e,t,n)=>{Mn(e,t,n),fe(n[K],(e=>Mn(s,t,e)),(()=>Hn(l,t)))})),Mn(f,t,[s,l])}),((e,t)=>{Mn(b,t),Mn(f,t)})),Fe=e=>Rn(y,e,((e,t,n)=>{Mn(y,t,n),fe(n[K],(e=>Mn(I,t,e)),(()=>Hn(w,t)))}),((e,t)=>{Mn(y,t),Mn(I,t),xn(w,t)})),Je=e=>Ue(e)?Ut():Ht(e),Oe=e=>Rn(k,e,((e,t,n)=>Pe(t,n)),((e,t)=>st(t))),Pe=(e,t)=>Rn(Ln(k,e,(()=>(ot(e,1),Mn(v,e,Qn()),Mn(C,e,Sn()),Sn()))),t,((t,n,s)=>De(e,t,n,s)),((t,n)=>lt(e,t,n))),De=(e,t,n,s,l)=>Rn(Ln(t,n,(()=>(it(e,n,1),Sn()))),s,((t,s,l)=>je(e,n,t,s,l)),((s,a)=>at(e,t,n,s,a,l))),je=(e,t,n,s,l)=>{wn(n,s)||dt(e,t,s,1);const a=Nn(n,s);l!==a&&(ct(e,t,s,a,l),Mn(n,s,l))},Be=(e,t,n,s,l)=>fe(Nn(t,n),(t=>je(e,n,t,s,l)),(()=>De(e,t,n,Me({[s]:l},e,n)))),We=e=>Ue(e)?Zt():Wt(e),Ye=e=>Rn(T,e,((e,t,n)=>et(t,n)),((e,t)=>rt(t))),et=(e,t)=>{wn(T,e)||ut(e,1);const n=Nn(T,e);t!==n&&(ht(e,n,t),Mn(T,e,t))},tt=(e,t)=>{const[n]=Nn(v,e),s=n(t);return wn(Nn(k,e),s)?tt(e,t):s},nt=e=>Nn(k,e)??Pe(e,{}),st=e=>Pe(e,{}),lt=(e,t,n)=>{const[,s]=Nn(v,e);s(n),De(e,t,n,{},!0)},at=(e,t,n,s,l,a)=>{const r=Nn(Nn(f,e)?.[0],l);if(!be(r)&&!a)return je(e,n,s,l,r);const o=t=>{ct(e,n,t,Nn(s,t)),dt(e,n,t,-1),Mn(s,t)};be(r)?o(l):Vn(s,o),vn(s)&&(it(e,n,-1),vn(Mn(t,n))&&(ot(e,-1),Mn(k,e),Mn(v,e),Mn(C,e)))},rt=e=>{const t=Nn(I,e);if(!be(t))return et(e,t);ht(e,Nn(T,e)),ut(e,-1),Mn(T,e)},ot=(e,t)=>Zn(r,e,t),it=(e,t,n)=>Zn(Ln(d,e,Sn),t,n)&&Mn(i,e,Ln(i,e,(()=>0))+n),dt=(e,t,n,s)=>{const l=Nn(C,e),a=Nn(l,n)??0;(0==a&&1==s||1==a&&-1==s)&&Zn(Ln(o,e,Sn),n,s),Mn(l,n,a!=-s?a+s:null),Zn(Ln(Ln(c,e,Sn),t,Sn),n,s)},ct=(e,t,n,s,l)=>{Ln(Ln(Ln(u,e,Sn),t,Sn),n,(()=>[s,0]))[1]=l,a[3]?.(e,t,n,l)},ut=(e,t)=>Zn(h,e,t),ht=(e,t,n)=>{Ln(m,e,(()=>[t,0]))[1]=n,a[4]?.(e,n)},mt=(e,t,n,s,l)=>(Ae(Ln(Ln(Ln(g,e,Sn),t,Sn),n,(()=>[])),s),l),gt=(e,t,n)=>(Ae(Ln(p,e,(()=>[])),t),n),pt=(e,t,n)=>fe(Nn(Nn(Nn(u,e),t),n),(([e,t])=>[!0,e,t]),(()=>[!1,...Gn(Et(e,t,n))])),bt=e=>fe(Nn(m,e),(([e,t])=>[!0,e,t]),(()=>[!1,...Gn(At(e))])),ft=e=>vn(g)||vn(P[e])?0:Tn(e?Jn(g):g,((t,n)=>Tn(t,((t,s)=>Tn(t,((t,l)=>me(P[e],[n,s,l],t))))))),yt=e=>vn(p)||vn(D[e])?0:Tn(e?An(p):p,((t,n)=>me(D[e],[n],t))),It=(e,t,n,s)=>{if(!vn(e))return me(t,s,(()=>En(e))),Vn(e,((e,t)=>me(n,[...s??[],e],1==t))),1},wt=e=>{const t=Ft();t!=n&&me(x[e],void 0,t);const s=vn(z[e]),l=vn(F[e])&&vn(J[e])&&vn(E[e])&&vn($[e])&&vn(M[e])&&vn(L[e])&&vn(R[e])&&s&&vn(q[e])&&vn(N[e]),a=vn(O[e])&&vn(A[e])&&vn(V[e])&&vn(S[e]);if(!l||!a){const t=e?[An(r),Fn(o),An(i),Fn(d),Jn(c),Jn(u)]:[r,o,i,d,c,u];if(!l){It(t[0],q[e],N[e]),Tn(t[1],((t,n)=>It(t,M[e],L[e],[n]))),Tn(t[2],((t,n)=>{0!=t&&me(R[e],[n],Vt(n))}));const n=Bn();Tn(t[3],((t,l)=>{It(t,E[e],$[e],[l])&&!s&&(me(z[e],[l,null]),Hn(n,l))})),s||Tn(t[5],((t,s)=>{if(!wn(n,s)){const n=Bn();Tn(t,(e=>Tn(e,(([t,s],l)=>s!==t?Hn(n,l):xn(e,l))))),Tn(n,(t=>me(z[e],[s,t])))}})),Tn(t[4],((t,n)=>Tn(t,((t,s)=>It(t,F[e],J[e],[n,s])))))}if(!a){let n;Tn(t[5],((t,s)=>{let l;Tn(t,((t,a)=>{let r;Tn(t,(([t,o],i)=>{o!==t&&(me(O[e],[s,a,i],o,t,pt),n=l=r=1)})),r&&me(A[e],[s,a],pt)})),l&&me(V[e],[s],pt)})),n&&me(S[e],void 0,pt)}}},vt=e=>{const t=jt();t!=s&&me(B[e],void 0,t);const n=vn(Q[e])&&vn(X[e]),l=vn(ie[e])&&vn(H[e]);if(!n||!l){const t=e?[An(h),An(m)]:[h,m];if(n||It(t[0],Q[e],X[e]),!l){let n;Tn(t[1],(([t,s],l)=>{s!==t&&(me(ie[e],[l],s,t,bt),n=1)})),n&&me(H[e],void 0,bt)}}},Ct=(e,...t)=>(tn((()=>e(...ze(t,ce)))),ln),kt=()=>$n(k),Tt=()=>qn(k),Nt=e=>qn(Nn(C,ce(e))),Vt=e=>bn(Nn(k,ce(e))),Mt=e=>qn(Nn(k,ce(e))),Lt=(e,t,n,s=0,l)=>{return ze(ve(Re((a=Nn(k,ce(e)),r=(e,n)=>[be(t)?n:Nn(e,ce(t)),n],ze([...a?.entries()??[]],(([e,t])=>r(t,e)))),(([e],[t])=>((e??0)<(t??0)?-1:1)*(n?-1:1))),s,be(l)?l:s+l),(([,e])=>e));var a,r},Rt=(e,t)=>qn(Nn(Nn(k,ce(e)),ce(t))),Et=(e,t,n)=>Nn(Nn(Nn(k,ce(e)),ce(t)),ce(n)),zt=()=>En(T),$t=()=>qn(T),At=e=>Nn(T,ce(e)),Ft=()=>!vn(k),Jt=e=>wn(k,ce(e)),Ot=(e,t)=>wn(Nn(C,ce(e)),ce(t)),Pt=(e,t)=>wn(Nn(k,ce(e)),ce(t)),Dt=(e,t,n)=>wn(Nn(Nn(k,ce(e)),ce(t)),ce(n)),jt=()=>!vn(T),Bt=e=>wn(T,ce(e)),Ht=e=>Ct((()=>(e=>Xe(e,xe,mt))(e)?Oe(e):0)),Wt=e=>Ct((()=>Ne(e)?Ye(e):0)),Qt=e=>{try{Je(Ze(e))}catch{}return ln},Gt=t=>Ct((()=>{if((e=Xe(t,(e=>Xe(e,ke))))&&($e(t),!vn(k))){const e=kt();Ut(),Ht(e)}})),Kt=e=>Ct((()=>{if(t=(e=>Xe(e,ke))(e)){const n=zt();en(),Zt(),t=!0,Fe(e),Wt(n)}})),Ut=()=>Ct((()=>Oe({}))),Xt=e=>Ct((e=>wn(k,e)?st(e):0),e),Yt=(e,t)=>Ct(((e,t)=>fe(Nn(k,e),(n=>wn(n,t)?lt(e,n,t):0))),e,t),Zt=()=>Ct((()=>Ye({}))),_t=()=>Ct((()=>{$e({}),e=!1})),en=()=>Ct((()=>{Fe({}),t=!1})),tn=(e,t)=>{if(-1!=l){nn();const n=e();return sn(t),n}},nn=()=>(-1!=l&&l++,1==l&&(a[0]?.(),me(de)),ln),sn=e=>(l>0&&(l--,0==l&&(l=1,ft(1),vn(u)||wt(1),yt(1),vn(m)||vt(1),e?.(ln)&&(Tn(u,((e,t)=>Tn(e,((e,n)=>Tn(e,(([e],s)=>St(ln,t,n,s,e))))))),kn(u),Tn(m,(([e],t)=>qt(ln,t,e))),kn(m)),me(ue[0],void 0),l=-1,ft(0),vn(u)||wt(0),yt(0),vn(m)||vt(0),a[1]?.(),me(ue[1],void 0),a[2]?.(),l=0,n=Ft(),s=jt(),Ee([r,o,i,d,c,u,g,h,m,p],kn))),ln),ln={getContent:()=>[kt(),zt()],getTables:kt,getTableIds:Tt,getTable:e=>zn(Nn(k,ce(e))),getTableCellIds:Nt,getRowCount:Vt,getRowIds:Mt,getSortedRowIds:Lt,getRow:(e,t)=>En(Nn(Nn(k,ce(e)),ce(t))),getCellIds:Rt,getCell:Et,getValues:zt,getValueIds:$t,getValue:At,hasTables:Ft,hasTable:Jt,hasTableCell:Ot,hasRow:Pt,hasCell:Dt,hasValues:jt,hasValue:Bt,getTablesJson:()=>_e(k),getValuesJson:()=>_e(T),getJson:()=>_e([k,T]),getTablesSchemaJson:()=>_e(b),getValuesSchemaJson:()=>_e(y),getSchemaJson:()=>_e([b,y]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:e=>Ct((()=>Te(e)?(([e,t])=>{(Ue(e)?Ut:Ht)(e),(Ue(t)?Zt:Wt)(t)})(e):0)),setTables:Ht,setTable:(e,t)=>Ct((e=>xe(t,e)?Pe(e,t):0),e),setRow:(e,t,n)=>Ct(((e,t)=>Se(e,t,n)?De(e,nt(e),t,n):0),e,t),addRow:(e,t,n=!0)=>tn((()=>{let s;return Se(e,s,t)&&(e=ce(e),De(e,nt(e),s=tt(e,n?1:0),t)),s})),setPartialRow:(e,t,n)=>Ct(((e,t)=>{if(Se(e,t,n,1)){const s=nt(e);Ke(n,((n,l)=>Be(e,s,t,l,n)))}}),e,t),setCell:(e,t,n,s)=>Ct(((e,t,n)=>fe(qe(e,t,n,Ie(s)?s(Et(e,t,n)):s),(s=>Be(e,nt(e),t,n,s)))),e,t,n),setValues:Wt,setPartialValues:e=>Ct((()=>Ne(e,1)?Ke(e,((e,t)=>et(t,e))):0)),setValue:(e,t)=>Ct((e=>fe(Ve(e,Ie(t)?t(At(e)):t),(t=>et(e,t)))),e),applyChanges:e=>Ct((()=>{Ke(e[0],((e,t)=>be(e)?Xt(t):Ke(e,((e,n)=>be(e)?Yt(t,n):Ke(e,((e,s)=>St(ln,t,n,s,e))))))),Ke(e[1],((e,t)=>qt(ln,t,e)))})),setTablesJson:Qt,setValuesJson:e=>{try{We(Ze(e))}catch{}return ln},setJson:e=>Ct((()=>{try{const[t,n]=Ze(e);Je(t),We(n)}catch{Qt(e)}})),setTablesSchema:Gt,setValuesSchema:Kt,setSchema:(e,t)=>Ct((()=>{Gt(e),Kt(t)})),delTables:Ut,delTable:Xt,delRow:Yt,delCell:(e,t,n,s)=>Ct(((e,t,n)=>fe(Nn(k,e),(l=>fe(Nn(l,t),(a=>wn(a,n)?at(e,l,t,a,n,s):0))))),e,t,n),delValues:Zt,delValue:e=>Ct((e=>wn(T,e)?rt(e):0),e),delTablesSchema:_t,delValuesSchema:en,delSchema:()=>Ct((()=>{_t(),en()})),transaction:tn,startTransaction:nn,getTransactionChanges:()=>[En(u,((e,t)=>-1===Nn(r,t)?void 0:En(e,((e,n)=>-1===Nn(Nn(d,t),n)?void 0:En(e,(([,e])=>e),(e=>Yn(e)))),vn,Ue)),vn,Ue),En(m,(([,e])=>e),(e=>Yn(e))),1],getTransactionLog:()=>[!vn(u),!vn(m),$n(u,Xn,Yn),$n(g),En(m,Xn,Yn),En(p),En(r),zn(d),$n(c),En(h)],finishTransaction:sn,forEachTable:e=>Tn(k,((t,n)=>e(n,(e=>Tn(t,((t,n)=>e(n,(e=>Vn(t,e))))))))),forEachTableCell:(e,t)=>Vn(Nn(C,ce(e)),t),forEachRow:(e,t)=>Tn(Nn(k,ce(e)),((e,n)=>t(n,(t=>Vn(e,t))))),forEachCell:(e,t,n)=>Vn(Nn(Nn(k,ce(e)),ce(t)),n),forEachValue:e=>Vn(T,e),addSortedRowIdsListener:(e,t,n,s,l,a,r)=>{let o=Lt(e,t,n,s,l);return he((()=>{const r=Lt(e,t,n,s,l);var i,d,c;d=o,Ce(i=r)===Ce(d)&&(c=(e,t)=>d[t]===e,i.every(c))||(o=r,a(ln,e,t,n,s,l,o))}),z[r?1:0],[e,t],[Tt])},addStartTransactionListener:e=>he(e,de),addWillFinishTransactionListener:e=>he(e,ue[0]),addDidFinishTransactionListener:e=>he(e,ue[1]),callListener:e=>(pe(e),ln),delListener:e=>(ge(e),ln),getListenerStats:()=>({hasTables:Kn(x),tables:Kn(S),tableIds:Kn(q),hasTable:Kn(N),table:Kn(V),tableCellIds:Kn(M),hasTableCell:Kn(L,yn),rowCount:Kn(R),rowIds:Kn(E),sortedRowIds:Kn(z),hasRow:Kn($,yn),row:Kn(A,yn),cellIds:Kn(F,yn),hasCell:Kn(J,In),cell:Kn(O,In),invalidCell:Kn(P,In),hasValues:Kn(B),values:Kn(H),valueIds:Kn(Q),hasValue:Kn(X),value:Kn(ie),invalidValue:Kn(D),transaction:fn(de)+Kn(ue)}),isMergeable:()=>!1,createStore:_n,addListener:he,callListeners:me,setInternalListeners:(e,t,n,s,l)=>a=[e,t,n,s,l]};return Ke({[U+Z]:[0,x,[],()=>[Ft()]],[Z]:[0,S],[_]:[0,q],[U+Y]:[1,N,[Tt],e=>[Jt(...e)]],[Y]:[1,V,[Tt]],[Y+le]:[1,M,[Tt]],[U+Y+se]:[2,L,[Tt,Nt],e=>[Ot(...e)]],[te]:[1,R,[Tt]],[ne]:[1,E,[Tt]],[U+ee]:[2,$,[Tt,Mt],e=>[Pt(...e)]],[ee]:[2,A,[Tt,Mt]],[le]:[2,F,[Tt,Mt]],[U+se]:[3,J,[Tt,Mt,Rt],e=>[Dt(...e)]],[se]:[3,O,[Tt,Mt,Rt],e=>Gn(Et(...e))],InvalidCell:[3,P],[U+re]:[0,B,[],()=>[jt()]],[re]:[0,H],[oe]:[0,Q],[U+ae]:[1,X,[$t],e=>[Bt(...e)]],[ae]:[1,ie,[$t],e=>Gn(At(e[0]))],InvalidValue:[1,D]},(([e,t,n,s],l)=>{ln["add"+l+"Listener"]=(...l)=>he(l[e],t[l[e+1]?1:0],e>0?ve(l,0,e):void 0,n,s)})),He(ln)},es=({position:e="right",open:t=!1})=>{const n=O(_n),s=nt.indexOf(e);return P(n,(e=>{return t=et,n=sessionStorage,((e,t,n,s,l,a,r,o={},i=[])=>{let d,c,u,h=0,m=0,g=0;Ln(Pn,i,(()=>0)),Ln(Dn,i,(()=>[]));const[p,b,f,y,I]=((e=1,t)=>1!=e&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!Ue(e)||!Ue(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!Ue(e)||!Ue(t),t.setContent]:ke("Store type not supported by this Persister"))(r,e),w=t=>{(p&&we(t?.[0])?1===t?.[2]?e.applyMergeableChanges:e.setMergeableContent:1===t?.[2]?e.applyChanges:e.setContent)(t)},v=async e=>(2!=h&&(h=1,m++,await x((async()=>{try{const e=await t();we(e)?w(e):ke("Content is not an array "+e)}catch(t){e&&I(e)}h=0}))),S),C=()=>(c&&(l(c),c=void 0),S),k=async e=>(1!=h&&(h=2,g++,await x((async()=>{try{await n(b,e)}catch(e){}h=0}))),S),T=()=>(fe(u,e.delListener),u=void 0,S),x=async(...e)=>(Ae(Nn(Dn,i),...e),await(async()=>{if(!Nn(Pn,i)){for(Mn(Pn,i,1);!be(d=Fe(Nn(Dn,i)));)try{await d()}catch(e){}Mn(Pn,i,0)}})(),S),S={load:v,startAutoLoad:async e=>{await C().load(e);try{c=await s((async(e,t)=>{t||e?2!=h&&(h=1,m++,w(t??e),h=0):await v()}))}catch(e){}return S},stopAutoLoad:C,isAutoLoading:()=>!be(c),save:k,startAutoSave:async()=>(await T().save(),u=e.addDidFinishTransactionListener((()=>{const e=f();y(e)&&k(e)})),S),stopAutoSave:T,isAutoSaving:()=>!be(u),schedule:x,getStore:()=>e,destroy:()=>(Nn(Dn,i).splice(0,void 0),C().stopAutoSave()),getStats:()=>({loads:m,saves:g}),...o};return He(S)})(e,(async()=>{return e=n.getItem(t),Ze(e,((e,t)=>""===t?void 0:t));var e}),(async e=>{return n.setItem(t,(s=e(),Ye(s,((e,t)=>void 0===t?"":t))));var s}),(e=>{const s=s=>{if(s.storageArea===n&&s.key===t)try{e(Ze(s.newValue))}catch{e()}};return ue.addEventListener(jn,s),s}),(e=>ue.removeEventListener(jn,e)),0,3,{getStorageName:()=>t});var t,n}),void 0,(async e=>{await e.load([{},{position:-1==s?1:s,open:!!t}]),await e.startAutoSave()})),Se(xe,null,Se("aside",{id:et},Se(kt,{s:n}),Se(gn,{s:n})),Se("style",null,Ct))};export{es as Inspector};
|