-
Notifications
You must be signed in to change notification settings - Fork 0
/
Datatable.9bd3a419.js
20 lines (16 loc) · 43.5 KB
/
Datatable.9bd3a419.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import{S as ue,i as de,s as fe,r as At,u as jt,v as Tt,w as Dt,t as P,e as V,h as We,l as W,a as X,p as Pt,D as M,E as I,O as he,F as pe,G as b,c as H,b as Y,m as O,g as oe,d as ut,f as z,P as J,Q,R as we,B as Z,a4 as Fe,I as j,H as N,K as T,L as $,J as G,M as v,N as k,a5 as Vt,a6 as Bt,U as se,V as ne,Y as Ce,a2 as Mt,a3 as Be,a7 as Ie,a8 as Ae,a0 as q,X as le,z as xt,a9 as qe}from"./chunks/index.591d8817.js";import{d as R,r as be,w as D}from"./chunks/index.2a87ddeb.js";const dt=s=>{const e=Object.entries(s),t=e.map(([r])=>r);return R(e.map(([,r])=>r),r=>Object.fromEntries(r.map((l,n)=>[t[n],l])))},Ht=s=>s&1,Ot=s=>({}),Ye=s=>({...s[0]});function zt(s){let e;const t=s[3].default,r=At(t,s,s[2],Ye);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,n){r&&r.m(l,n),e=!0},p(l,[n]){r&&r.p&&(!e||n&5)&&jt(r,t,l,l[2],Ht(n)||!e?Tt(l[2]):Dt(t,l[2],n,Ot),Ye)},i(l){e||(P(r,l),e=!0)},o(l){V(r,l),e=!1},d(l){r&&r.d(l)}}}function Nt(s,e,t){const r=[];let l=We(e,r),n,{$$slots:a={},$$scope:o}=e;const c=dt(l);return W(s,c,d=>t(0,n=d)),s.$$set=d=>{e=X(X({},e),Pt(d)),t(4,l=We(e,r)),"$$scope"in d&&t(2,o=d.$$scope)},[n,c,o,a]}class Re extends ue{constructor(e){super(),de(this,e,Nt,zt,fe,{})}}const Me=s=>s?.subscribe instanceof Function,Gt=be(void 0),ft=(s={})=>{const e=u=>Object.fromEntries(Object.entries(u).filter(([,f])=>f)),{subscribe:t,update:r,set:l}=D(e(s)),n=u=>{r(f=>{const m=u(f);return e(m)})};return{subscribe:t,update:n,set:u=>n(()=>u),toggle:u=>{r(f=>f[u]===!0?(delete f[u],f):{...f,[u]:!0})},add:u=>{r(f=>({...f,[u]:!0}))},addAll:u=>{r(f=>({...f,...Object.fromEntries(u.map(m=>[m,!0]))}))},remove:u=>{r(f=>(delete f[u],f))},clear:()=>{l({})}}};function Lt(s){let e,t,r;const l=[s[0].props??{}];var n=s[0].component;function a(o){let c={};for(let d=0;d<l.length;d+=1)c=X(c,l[d]);return{props:c}}return n&&(e=new n(a())),{c(){e&&H(e.$$.fragment),t=M()},l(o){e&&Y(e.$$.fragment,o),t=M()},m(o,c){e&&O(e,o,c),I(o,t,c),r=!0},p(o,c){const d=c&1?oe(l,[ut(o[0].props??{})]):{};if(n!==(n=o[0].component)){if(e){he();const i=e;V(i.$$.fragment,1,0,()=>{z(i,1)}),pe()}n?(e=new n(a()),H(e.$$.fragment),P(e.$$.fragment,1),O(e,t.parentNode,t)):e=null}else n&&e.$set(d)},i(o){r||(e&&P(e.$$.fragment,o),r=!0)},o(o){e&&V(e.$$.fragment,o),r=!1},d(o){o&&b(t),e&&z(e,o)}}}function Ut(s){let e,t;return e=new Re({props:{props:s[0].props,$$slots:{default:[qt,({props:r})=>({3:r}),({props:r})=>r?8:0]},$$scope:{ctx:s}}}),{c(){H(e.$$.fragment)},l(r){Y(e.$$.fragment,r)},m(r,l){O(e,r,l),t=!0},p(r,l){const n={};l&1&&(n.props=r[0].props),l&25&&(n.$$scope={dirty:l,ctx:r}),e.$set(n)},i(r){t||(P(e.$$.fragment,r),t=!0)},o(r){V(e.$$.fragment,r),t=!1},d(r){z(e,r)}}}function Kt(s){let e;return{c(){e=J(s[0])},l(t){e=Q(t,s[0])},m(t,r){I(t,e,r)},p(t,r){r&1&&we(e,t[0])},i:Z,o:Z,d(t){t&&b(e)}}}function Wt(s){let e;return{c(){e=J(s[1])},l(t){e=Q(t,s[1])},m(t,r){I(t,e,r)},p(t,r){r&2&&we(e,t[1])},i:Z,o:Z,d(t){t&&b(e)}}}function qt(s){let e,t,r;const l=[s[3]??{}];var n=s[0].component;function a(o){let c={};for(let d=0;d<l.length;d+=1)c=X(c,l[d]);return{props:c}}return n&&(e=new n(a())),{c(){e&&H(e.$$.fragment),t=M()},l(o){e&&Y(e.$$.fragment,o),t=M()},m(o,c){e&&O(e,o,c),I(o,t,c),r=!0},p(o,c){const d=c&8?oe(l,[ut(o[3]??{})]):{};if(n!==(n=o[0].component)){if(e){he();const i=e;V(i.$$.fragment,1,0,()=>{z(i,1)}),pe()}n?(e=new n(a()),H(e.$$.fragment),P(e.$$.fragment,1),O(e,t.parentNode,t)):e=null}else n&&e.$set(d)},i(o){r||(e&&P(e.$$.fragment,o),r=!0)},o(o){e&&V(e.$$.fragment,o),r=!1},d(o){o&&b(t),e&&z(e,o)}}}function Yt(s){let e,t,r,l,n,a;const o=[Wt,Kt,Ut,Lt],c=[];function d(i,u){return u&1&&(e=null),u&1&&(t=null),e==null&&(e=!!Me(i[0])),e?0:typeof i[0]=="string"||typeof i[0]=="number"?1:(t==null&&(t=!!Me(i[0].props)),t?2:3)}return r=d(s,-1),l=c[r]=o[r](s),{c(){l.c(),n=M()},l(i){l.l(i),n=M()},m(i,u){c[r].m(i,u),I(i,n,u),a=!0},p(i,[u]){let f=r;r=d(i,u),r===f?c[r].p(i,u):(he(),V(c[f],1,1,()=>{c[f]=null}),pe(),l=c[r],l?l.p(i,u):(l=c[r]=o[r](i),l.c()),P(l,1),l.m(n.parentNode,n))},i(i){a||(P(l),a=!0)},o(i){V(l),a=!1},d(i){c[r].d(i),i&&b(n)}}}function Jt(s,e,t){let r,{of:l}=e;const n=Me(l)?l:Gt;return W(s,n,a=>t(1,r=a)),s.$$set=a=>{"of"in a&&t(0,l=a.of)},[l,r,n]}class ht extends ue{constructor(e){super(),de(this,e,Jt,Yt,fe,{of:0})}}class pt{header;footer;height;plugins;constructor({header:e,footer:t,height:r,plugins:l}){this.header=e,this.footer=t,this.height=r,this.plugins=l}isFlat(){return"__flat"in this}isData(){return"__data"in this}isDisplay(){return"__display"in this}isGroup(){return"__group"in this}}class gt extends pt{__flat=!0;id;constructor({header:e,footer:t,plugins:r,id:l}){super({header:e,footer:t,plugins:r,height:1}),this.id=l}}class Qt extends gt{__data=!0;cell;accessorKey;accessorFn;constructor({header:e,footer:t,plugins:r,cell:l,accessor:n,id:a}){if(super({header:e,footer:t,plugins:r,id:"Initialization not complete"}),this.cell=l,n instanceof Function?this.accessorFn=n:this.accessorKey=n,a===void 0&&this.accessorKey===void 0)throw new Error("A column id or string accessor is required");this.id=a??String(this.accessorKey)}getValue(e){if(this.accessorFn!==void 0)return this.accessorFn(e);if(this.accessorKey!==void 0)return e[this.accessorKey]}}class Xt extends gt{__display=!0;cell;data;constructor({header:e,footer:t,plugins:r,id:l,cell:n,data:a}){super({header:e,footer:t,plugins:r,id:l}),this.cell=n,this.data=a}}class Zt extends pt{__group=!0;columns;ids;constructor({header:e,footer:t,columns:r,plugins:l}){const n=Math.max(...r.map(a=>a.height))+1;super({header:e,footer:t,height:n,plugins:l}),this.columns=r,this.ids=mt(r)}}const mt=s=>s.flatMap(e=>e.isFlat()?[e.id]:e.isGroup()?e.ids:[]),_t=s=>s.flatMap(e=>e.isFlat()?[e]:e.isGroup()?_t(e.columns):[]),er=s=>{const e=new Map;return s.forEach(t=>{e.set(t,(e.get(t)??0)+1)}),e},tr=s=>Array.from(er(s).entries()).filter(([,e])=>e!==1).map(([e])=>e),rr=s=>Object.entries(s).map(([e,t])=>`${e}:${t}`).join(";"),sr=(s,e)=>s.style===void 0&&e.style===void 0?{...s,...e}:{...s,...e,style:{...typeof s.style=="object"?s.style:{},...typeof e.style=="object"?e.style:{}}},$e=s=>s.style===void 0||typeof s.style!="object"?s:{...s,style:rr(s.style)};class je{id;constructor({id:e}){this.id=e}attrsForName={};attrs(){return R(Object.values(this.attrsForName),e=>{let t={};return e.forEach(r=>{t=sr(t,r)}),$e(t)})}propsForName={};props(){return dt(this.propsForName)}state;injectState(e){this.state=e}applyHook(e,t){t.props!==void 0&&(this.propsForName[e]=t.props),t.attrs!==void 0&&(this.attrsForName[e]=t.attrs)}}class bt extends je{row;constructor({id:e,row:t}){super({id:e}),this.row=t}attrs(){return R(super.attrs(),e=>({...e,role:"cell"}))}rowColId(){return`${this.row.id}:${this.column.id}`}dataRowColId(){if(!!this.row.isData())return`${this.row.dataId}:${this.column.id}`}isData(){return"__data"in this}isDisplay(){return"__display"in this}}class He extends bt{__data=!0;column;label;value;constructor({row:e,column:t,label:r,value:l}){super({id:t.id,row:e}),this.column=t,this.label=r,this.value=l}render(){if(this.label===void 0)return`${this.value}`;if(this.state===void 0)throw new Error("Missing `state` reference");return this.label({column:this.column,row:this.row,value:this.value},this.state)}clone(){return new He({row:this.row,column:this.column,label:this.label,value:this.value})}}class Oe extends bt{__display=!0;column;label;constructor({row:e,column:t,label:r}){super({id:t.id,row:e}),this.column=t,this.label=r}render(){if(this.state===void 0)throw new Error("Missing `state` reference");return this.label({column:this.column,row:this.row},this.state)}clone(){return new Oe({row:this.row,column:this.column,label:this.label})}}const Je=s=>s!==null,re=s=>s!==void 0;class nr extends je{cells;cellForId;depth;parentRow;subRows;constructor({id:e,cells:t,cellForId:r,depth:l=0,parentRow:n}){super({id:e}),this.cells=t,this.cellForId=r,this.depth=l,this.parentRow=n}attrs(){return R(super.attrs(),e=>({...e,role:"row"}))}isData(){return"__data"in this}isDisplay(){return"__display"in this}}class ze extends nr{__data=!0;dataId;original;constructor({id:e,dataId:t,original:r,cells:l,cellForId:n,depth:a=0,parentRow:o}){super({id:e,cells:l,cellForId:n,depth:a,parentRow:o}),this.dataId=t,this.original=r}clone({includeCells:e=!1}={}){const t=new ze({id:this.id,dataId:this.dataId,cellForId:this.cellForId,cells:this.cells,original:this.original,depth:this.depth});if(!e)return t;const r=Object.fromEntries(Object.entries(t.cellForId).map(([n,a])=>{const o=a.clone();return o.row=t,[n,o]})),l=t.cells.map(({id:n})=>r[n]);return t.cellForId=r,t.cells=l,t}}const lr=(s,e,{rowDataId:t}={})=>{const r=s.map((l,n)=>{const a=n.toString();return new ze({id:a,dataId:t!==void 0?t(l,n):a,original:l,cells:[],cellForId:{}})});return s.forEach((l,n)=>{const a=e.map(o=>{if(o.isData()){const c=o,d=c.getValue(l);return new He({row:r[n],column:c,label:o.cell,value:d})}if(o.isDisplay()){const c=o;return new Oe({row:r[n],column:c,label:o.cell})}throw new Error("Unrecognized `FlatColumn` implementation")});r[n].cells=a,e.forEach((o,c)=>{r[n].cellForId[o.id]=a[c]})}),r},or=(s,e)=>{const t=s.map(r=>{const l=r.clone();return l.cells=[],l.cellForId={},l});return s.length===0||e.length===0?s:(s.forEach((r,l)=>{const n=r.cells.map(o=>{const c=o.clone();return c.row=t[l],c}),a=e.map(o=>n.find(c=>c.id===o)).filter(re);t[l].cells=a,n.forEach(o=>{t[l].cellForId[o.id]=o})}),t)},wt=" ";class vt extends je{label;colspan;colstart;constructor({id:e,label:t,colspan:r,colstart:l}){super({id:e}),this.label=t,this.colspan=r,this.colstart=l}render(){if(this.label instanceof Function){if(this.state===void 0)throw new Error("Missing `state` reference");return this.label(this.state)}return this.label}attrs(){return R(super.attrs(),e=>({...e,role:"columnheader",colspan:this.colspan}))}isFlat(){return"__flat"in this}isData(){return"__data"in this}isFlatDisplay(){return"__flat"in this&&"__display"in this}isGroup(){return"__group"in this}isGroupDisplay(){return"__group"in this&&"__display"in this}}class Te extends vt{__flat=!0;constructor({id:e,label:t,colstart:r}){super({id:e,label:t,colspan:1,colstart:r})}clone(){return new Te({id:this.id,label:this.label,colstart:this.colstart})}}class Ne extends Te{__data=!0;accessorKey;accessorFn;constructor({id:e,label:t,accessorKey:r,accessorFn:l,colstart:n}){super({id:e,label:t,colstart:n}),this.accessorKey=r,this.accessorFn=l}clone(){return new Ne({id:this.id,label:this.label,accessorFn:this.accessorFn,accessorKey:this.accessorKey,colstart:this.colstart})}}class De extends Te{__display=!0;constructor({id:e,label:t=wt,colstart:r}){super({id:e,label:t,colstart:r})}clone(){return new De({id:this.id,label:this.label,colstart:this.colstart})}}class Pe extends vt{__group=!0;ids;allId;allIds;constructor({label:e,ids:t,allIds:r,colspan:l,colstart:n}){super({id:`[${t.join(",")}]`,label:e,colspan:l,colstart:n}),this.ids=t,this.allId=`[${r.join(",")}]`,this.allIds=r}setIds(e){this.ids=e,this.id=`[${this.ids.join(",")}]`}pushId(e){this.ids=[...this.ids,e],this.id=`[${this.ids.join(",")}]`}clone(){return new Pe({label:this.label,ids:this.ids,allIds:this.allIds,colspan:this.colspan,colstart:this.colstart})}}class Ge extends Pe{__display=!0;constructor({label:e=wt,ids:t,allIds:r,colspan:l=1,colstart:n}){super({label:e,ids:t,allIds:r,colspan:l,colstart:n})}clone(){return new Ge({label:this.label,ids:this.ids,allIds:this.allIds,colspan:this.colspan,colstart:this.colstart})}}const ar=s=>s.reduce((e,t)=>e+t,0),yt=(s,e)=>{const t=[];for(let r=0;r<e;r++)t.push(Array(s).fill(null));return t},Qe=s=>{const e=s.length;if(e===0)return s;const t=s[0].length,r=yt(e,t);for(let l=0;l<t;l++)for(let n=0;n<e;n++)r[l][n]=s[n][l];return r};class Le extends je{cells;constructor({id:e,cells:t}){super({id:e}),this.cells=t}attrs(){return R(super.attrs(),e=>({...e,role:"row"}))}clone(){return new Le({id:this.id,cells:this.cells})}}const ir=(s,e=[])=>{const t=cr(s);let r=Qe(t);return r=ur(r,e),dr(r),fr(Qe(r))},cr=s=>{const e=ar(s.map(n=>n.isGroup()?n.ids.length:1)),t=Math.max(...s.map(n=>n.height)),r=yt(e,t);let l=0;return s.forEach(n=>{const a=t-n.height;Rt(r,n,a,l),l+=n.isGroup()?n.ids.length:1}),r.map((n,a)=>n.map((o,c)=>{if(o!==null)return o;if(a===t-1)return new De({id:c.toString(),colstart:c});const d=r[t-1][c]?.id??c.toString();return new Ge({ids:[],allIds:[d],colstart:c})}))},Rt=(s,e,t,r)=>{if(e.isData()){s[s.length-1][r]=new Ne({label:e.header,accessorFn:e.accessorFn,accessorKey:e.accessorKey,id:e.id,colstart:r});return}if(e.isDisplay()){s[s.length-1][r]=new De({id:e.id,label:e.header,colstart:r});return}if(e.isGroup()){for(let n=0;n<e.ids.length;n++)s[t][r+n]=new Pe({label:e.header,colspan:1,allIds:e.ids,ids:[],colstart:r});let l=0;e.columns.forEach(n=>{Rt(s,n,t+1,r+l),l+=n.isGroup()?n.ids.length:1});return}},ur=(s,e)=>{if(e.length===0)return s;const t=[];return e.forEach((r,l)=>{const n=s.find(a=>{const o=a[a.length-1];if(!o.isFlat())throw new Error("The last element of each column must be a `FlatHeaderCell`");return o.id===r});n!==void 0&&t.push(n.map(a=>{const o=a.clone();return o.colstart=l,o}))}),t},dr=s=>{s.forEach(e=>{const t=e[e.length-1];if(!t.isFlat())throw new Error("The last element of each column must be a `FlatHeaderCell`");e.forEach(r=>{r.isGroup()&&r.pushId(t.id)})})},fr=s=>s.map((e,t)=>new Le({id:t.toString(),cells:hr(e)})),hr=s=>{if(s.length===0)return s;const e=[];let t=0,r=1;for(;t<s.length;){const l=s[t].clone();if(!l.isGroup()){e.push(l),t++;continue}r=t+1;const n=[...l.ids];for(;r<s.length;){const a=s[r];if(!a.isGroup()||l.allId!==a.allId)break;n.push(...a.ids),r++}l.setIds(n),l.colspan=r-t,e.push(l),t=r}return e},pr=(s,e,{rowDataId:t}={})=>{const{data:r,plugins:l}=s,n=_t(e),a=be(n),o=R([r,a],([w,E])=>lr(w,E,{rowDataId:t})),c=D([]),d=D(),i=D([]),u=D([]),f=D({role:"table"}),m=D({}),h=D({role:"rowgroup"}),g={data:r,columns:e,flatColumns:n,tableAttrs:f,tableHeadAttrs:m,tableBodyAttrs:h,visibleColumns:c,headerRows:d,originalRows:o,rows:i,pageRows:u},_=Object.fromEntries(Object.entries(l).map(([w,E])=>{const A=Object.fromEntries(n.map(B=>{const K=B.plugins?.[w];if(K!==void 0)return[B.id,K]}).filter(re));return[w,E({pluginName:w,tableState:g,columnOptions:A})]})),S=Object.fromEntries(Object.entries(_).map(([w,E])=>[w,E.pluginState])),p={data:r,columns:e,flatColumns:n,tableAttrs:f,tableHeadAttrs:m,tableBodyAttrs:h,visibleColumns:c,headerRows:d,originalRows:o,rows:i,pageRows:u,pluginStates:S},y=Object.values(_).map(w=>w.deriveTableAttrs).filter(re);let C=be({role:"table"});y.forEach(w=>{C=w(C)});const L=R(C,w=>{const E=$e(w);return f.set(E),E}),ee=Object.values(_).map(w=>w.deriveTableBodyAttrs).filter(re);let F=be({});ee.forEach(w=>{F=w(F)});const U=R(F,w=>{const E=$e(w);return m.set(E),E}),x=Object.values(_).map(w=>w.deriveTableBodyAttrs).filter(re);let ge=be({role:"rowgroup"});x.forEach(w=>{ge=w(ge)});const ve=R(ge,w=>{const E=$e(w);return h.set(E),E}),ke=Object.values(_).map(w=>w.deriveFlatColumns).filter(re);let me=a;ke.forEach(w=>{me=w(me)});const te=R(me,w=>(c.set(w),w)),Se=R([o,te],([w,E])=>or(w,E.map(A=>A.id))),ye=Object.values(_).map(w=>w.deriveRows).filter(re);let _e=Se;ye.forEach(w=>{_e=w(_e)});const Ue=R(_e,w=>(w.forEach(E=>{E.injectState(p),E.cells.forEach(A=>{A.injectState(p)})}),Object.entries(_).forEach(([E,A])=>{w.forEach(B=>{A.hooks?.["tbody.tr"]!==void 0&&B.applyHook(E,A.hooks["tbody.tr"](B)),B.cells.forEach(K=>{A.hooks?.["tbody.tr.td"]!==void 0&&K.applyHook(E,A.hooks["tbody.tr.td"](K))})})}),i.set(w),w)),$t=Object.values(_).map(w=>w.derivePageRows).filter(re);let Ve=Ue;$t.forEach(w=>{Ve=w(Ve)});const Ct=R(Ve,w=>(w.forEach(E=>{E.injectState(p),E.cells.forEach(A=>{A.injectState(p)})}),Object.entries(_).forEach(([E,A])=>{w.forEach(B=>{A.hooks?.["tbody.tr"]!==void 0&&B.applyHook(E,A.hooks["tbody.tr"](B)),B.cells.forEach(K=>{A.hooks?.["tbody.tr.td"]!==void 0&&K.applyHook(E,A.hooks["tbody.tr.td"](K))})})}),u.set(w),w)),It=R(te,w=>{const E=ir(e,w.map(A=>A.id));return E.forEach(A=>{A.injectState(p),A.cells.forEach(B=>{B.injectState(p)})}),Object.entries(_).forEach(([A,B])=>{E.forEach(K=>{B.hooks?.["thead.tr"]!==void 0&&K.applyHook(A,B.hooks["thead.tr"](K)),K.cells.forEach(Ke=>{B.hooks?.["thead.tr.th"]!==void 0&&Ke.applyHook(A,B.hooks["thead.tr.th"](Ke))})})}),d.set(E),E});return{tableAttrs:L,tableHeadAttrs:U,tableBodyAttrs:ve,visibleColumns:te,flatColumns:n,headerRows:It,originalRows:o,rows:Ue,pageRows:Ct,pluginStates:S}};class gr{data;plugins;constructor(e,t){this.data=e,this.plugins=t}createColumns(e){const t=mt(e),r=tr(t);if(r.length!==0)throw new Error(`Duplicate column ids not allowed: "${r.join('", "')}"`);return e}column(e){return new Qt(e)}group(e){return new Zt(e)}display(e){return new Xt(e)}createViewModel(e,t){return pr(this,e,t)}}const mr=(s,e={})=>new gr(s,e);function ae(s,e){return{component:s,props:e}}/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Xe(s,e,t){if(t||arguments.length===2)for(var r=0,l=e.length,n;r<l;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return s.concat(n||Array.prototype.slice.call(e))}var _r=function(s){var e=s.replace(/\[(\d+)\]/g,".$1");return e.startsWith(".")&&(e=e.slice(1)),e.split(".")},Ee=function(s,e){for(var t=s,r=0,l=e;r<l.length;r++){var n=l[r];if(t==null)return;t=t[n]}return t},Ze=function(s){var e=Object.create(s);return Object.assign(e,s),e};function br(s,e){var t=_r(e);if(t.some(function(c){return c==="__proto__"}))throw new Error('key cannot include "__proto__"');var r=t.slice(0,t.length-1),l=t[t.length-1],n=R(s,function(c){return Ee(c,t)}),a=function(c){s.update(function(d){if(d==null)return d;var i=Array.isArray(d)?Xe([],d,!0):Ze(d);return Ee(i,r)[l]=c,i})},o=function(c){s.update(function(d){if(d==null)return d;var i=c(Ee(d,t)),u=Array.isArray(d)?Xe([],d,!0):Ze(d);return Ee(u,r)[l]=i,u})};return{subscribe:n.subscribe,set:a,update:o}}const kt=(s,e,t)=>s.map(l=>{const{subRows:n}=l;if(n===void 0)return l;const a=kt(n,e,t),o=l.clone();return o.subRows=a,o}).filter(l=>{if((l.subRows?.length??0)!==0)return!0;for(const[n,a]of Object.entries(t)){const o=l.cellForId[n];if(!o.isData())continue;const{value:c}=o,d=e[n];if(d===void 0)continue;if(!a.fn({value:c,filterValue:d}))return!1}return!0}),wr=()=>({columnOptions:s,tableState:e})=>{const t=D({}),r=D([]),l=D([]);return{pluginState:{filterValues:t,preFilteredRows:r},deriveRows:o=>R([o,t],([c,d])=>{r.set(c);const i=kt(c,d,s);return l.set(i),i}),hooks:{"thead.tr.th":o=>{const c=br(t,o.id);return{props:R([],()=>{const i=s[o.id];if(i===void 0)return;c.set(i.initialFilterValue);const u=R(r,h=>o.isData()?h.map(g=>g.cellForId[o.id]?.value):[]),f=R(l,h=>o.isData()?h.map(g=>g.cellForId[o.id]?.value):[]);return{render:i.render({id:o.id,filterValue:c,...e,values:f,preFilteredRows:r,preFilteredValues:u})}})}}}}},vr=({initialColumnIdOrder:s=[],hideUnspecifiedColumns:e=!1}={})=>()=>{const t=D(s);return{pluginState:{columnIdOrder:t},deriveFlatColumns:n=>R([n,t],([a,o])=>{const c=[...a],d=[];return o.forEach(i=>{const u=c.findIndex(f=>f.id===i);d.push(...c.splice(u,1))}),e||d.push(...c),d})}},yr=s=>s instanceof MouseEvent?s.shiftKey:!1,Rr=1,kr=({items:s,initialPageSize:e,initialPageIndex:t})=>{const r=D(e),l=i=>{r.update(u=>{const f=i(u);return Math.max(f,Rr)})},n=i=>l(()=>i),a=R([r,s],([i,u])=>{const f=Math.ceil(u.length/i);return o.update(m=>f>0&&m>=f?f-1:m),f}),o=D(t),c=R(o,i=>i>0),d=R([o,a],([i,u])=>i<u-1);return{pageSize:{subscribe:r.subscribe,update:l,set:n},pageCount:a,pageIndex:o,hasPreviousPage:c,hasNextPage:d}},Sr=({initialPageIndex:s=0,initialPageSize:e=10}={})=>()=>{const t=D([]),r=D([]),{pageSize:l,pageCount:n,pageIndex:a,hasPreviousPage:o,hasNextPage:c}=kr({items:t,initialPageIndex:s,initialPageSize:e});return{pluginState:{pageSize:l,pageIndex:a,pageCount:n,hasPreviousPage:o,hasNextPage:c},derivePageRows:u=>R([u,l,a],([f,m,h])=>{t.set(f);const g=h*m,_=f.slice(g,g+m);return r.set(_),_})}},ce=(s,e,t)=>s.isData()&&(!t||s.subRows===void 0)?e[s.dataId]===!0:s.subRows===void 0?!1:s.subRows.every(r=>ce(r,e,t)),et=(s,e,t)=>s.isData()&&(!t||s.subRows===void 0)?e[s.dataId]===!0:s.subRows===void 0?!1:s.subRows.some(r=>ce(r,e,t)),St=(s,e,t,r)=>{s.isData()&&(t[s.dataId]=e,!r)||s.subRows!==void 0&&s.subRows.forEach(l=>{St(l,e,t,r)})},Fr=(s,e,t)=>{const{subscribe:r}=R(e,a=>{if(s.isData()){if(!t)return a[s.dataId]===!0;if(a[s.dataId]===!0)return!0}return ce(s,a,t)}),l=a=>{e.update(o=>{const c=ce(s,o,t),d={...o};return St(s,a(c),d,t),s.parentRow!==void 0&&s.parentRow.isData()&&(d[s.parentRow.dataId]=ce(s.parentRow,d,t)),d})};return{subscribe:r,update:l,set:a=>l(()=>a)}},Er=({initialSelectedDataIds:s={},linkDataSubRows:e=!0}={})=>({tableState:t})=>{const r=ft(s),l=h=>{const g=Fr(h,r,e),_=R([g,r],([p,y])=>p?!1:et(h,y,e)),S=R(r,p=>ce(h,p,e));return{isSelected:g,isSomeSubRowsSelected:_,isAllSubRowsSelected:S}},n=R([t.rows,r],([h,g])=>h.every(_=>_.isData()?g[_.dataId]===!0:!0)),a=h=>{if(h){const _=Fe(t.rows).map(S=>S.isData()?S.dataId:null).filter(Je);r.addAll(_)}else r.clear()},o={subscribe:n.subscribe,update(h){const g=Fe(n);a(h(g))},set:a},c=R([t.rows,r],([h,g])=>h.some(_=>_.isData()?g[_.dataId]===!0:!1)),d=R([t.pageRows,r],([h,g])=>h.every(_=>_.isData()?g[_.dataId]===!0:!0)),i=h=>{if(h){const _=Fe(t.pageRows).map(S=>S.isData()?S.dataId:null).filter(Je);r.addAll(_)}else r.clear()},u={subscribe:d.subscribe,update(h){const g=Fe(d);i(h(g))},set:i},f=R([t.pageRows,r],([h,g])=>h.some(_=>_.isData()?g[_.dataId]===!0:!1));return{pluginState:{selectedDataIds:r,getRowState:l,allRowsSelected:o,someRowsSelected:c,allPageRowsSelected:u,somePageRowsSelected:f},hooks:{"tbody.tr":h=>({props:R(r,_=>{const S=et(h,_,e),p=ce(h,_,e);return{selected:h.isData()?_[h.dataId]===!0:p,someSubRowsSelected:S,allSubRowsSelected:p}})})}}},xe=(s,e)=>Array.isArray(s)&&Array.isArray(e)?$r(s,e):typeof s=="number"&&typeof e=="number"?s-e:s<e?-1:s>e?1:0,$r=(s,e)=>{const t=Math.min(s.length,e.length);for(let r=0;r<t;r++){const l=xe(s[r],e[r]);if(l!==0)return l}return 0},Cr=s=>{const{subscribe:e,update:t,set:r}=D(s);return{subscribe:e,update:t,set:r,toggleId:(a,{multiSort:o=!0}={})=>{t(c=>{const d=c.findIndex(u=>u.id===a);return o?d===-1?[...c,{id:a,order:"asc"}]:c[d].order==="asc"?[...c.slice(0,d),{id:a,order:"desc"},...c.slice(d+1)]:[...c.slice(0,d),...c.slice(d+1)]:d===-1?[{id:a,order:"asc"}]:c[d].order==="asc"?[{id:a,order:"desc"}]:[]})},clearId:a=>{t(o=>{const c=o.findIndex(d=>d.id===a);return c===-1?o:[...o.slice(0,c),...o.slice(c+1)]})}}},Ft=(s,e,t)=>{const r=[...s];r.sort((l,n)=>{for(const a of e){const o=t[a.id]?.invert??!1,c=l.cellForId[a.id],d=n.cellForId[a.id];let i=0;const u=t[a.id]?.getSortValue;if(!c.isData())return 0;const f=c.value,m=d.value;if(u!==void 0){const h=u(f),g=u(m);i=xe(h,g)}else(typeof f=="string"||typeof f=="number")&&(i=xe(f,m));if(i!==0){let h=1;return a.order==="desc"&&(h*=-1),o&&(h*=-1),i*h}}return 0});for(let l=0;l<r.length;l++){const{subRows:n}=r[l];if(n===void 0)continue;const a=Ft(n,e,t),o=r[l].clone();o.subRows=a,r[l]=o}return r},Ir=({initialSortKeys:s=[],disableMultiSort:e=!1,isMultiSortEvent:t=yr}={})=>({columnOptions:r})=>{const l=Object.entries(r).filter(([,i])=>i.disable===!0).map(([i])=>i),n=Cr(s),a=D([]),o=D([]);return{pluginState:{sortKeys:n,preSortedRows:a},deriveRows:i=>R([i,n],([u,f])=>{a.set(u);const m=Ft(u,f,r);return o.set(m),m}),hooks:{"thead.tr.th":i=>{const u=l.includes(i.id);return{props:R(n,m=>{const h=m.find(S=>S.id===i.id),g=S=>{!i.isData()||u||n.toggleId(i.id,{multiSort:e?!1:t(S)})},_=()=>{!i.isData()||l.includes(i.id)||n.clearId(i.id)};return{order:h?.order,toggle:g,clear:_,disabled:u}})}},"tbody.tr.td":i=>({props:R(n,f=>({order:f.find(h=>h.id===i.id)?.order}))})}}},Et=(s,e,t,{tableCellMatches:r,fn:l,includeHiddenColumns:n})=>s.map(o=>{const{subRows:c}=o;if(c===void 0)return o;const d=Et(c,e,t,{tableCellMatches:r,fn:l,includeHiddenColumns:n}),i=o.clone();return i.subRows=d,i}).filter(o=>(o.subRows?.length??0)!==0?!0:Object.values(o.cellForId).map(d=>{const i=t[d.id];if(i?.exclude===!0||o.cells.find(h=>h.id===d.id)===void 0&&!n||!d.isData())return!1;let f=d.value;i?.getFilterValue!==void 0&&(f=i?.getFilterValue(f));const m=l({value:String(f),filterValue:e});if(m){const h=d.dataRowColId();h!==void 0&&(r[h]=m)}return m}).includes(!0)),Ar=({fn:s=jr,initialFilterValue:e="",includeHiddenColumns:t=!1}={})=>({columnOptions:r})=>{const l=D(e),n=D([]),a=D([]),o=ft();return{pluginState:{filterValue:l,preFilteredRows:n},deriveRows:i=>R([i,l],([u,f])=>{n.set(u),o.clear();const m={},h=Et(u,f,r,{tableCellMatches:m,fn:s,includeHiddenColumns:t});return o.set(m),a.set(h),h}),hooks:{"tbody.tr.td":i=>({props:R([l,o],([f,m])=>{const h=i.dataRowColId();return{matches:f!==""&&h!==void 0&&(m[h]??!1)}})})}}},jr=({filterValue:s,value:e})=>s===""?!0:String(e).toLowerCase().startsWith(String(s).toLowerCase());function tt(s){let e,t;return{c(){e=new Vt(!1),t=M(),this.h()},l(r){e=Bt(r,!1),t=M(),this.h()},h(){e.a=t},m(r,l){e.m(s[3],r,l),I(r,t,l)},p(r,l){l&8&&e.p(r[3])},d(r){r&&b(t),r&&e.d()}}}function Tr(s){let e,t,r,l,n=(s[0]??"")+"",a,o,c,d=(s[1]??"")+"",i,u=s[3]&&tt(s);return{c(){e=j("a"),u&&u.c(),t=N(),r=j("div"),l=j("div"),a=J(n),o=N(),c=j("div"),i=J(d),this.h()},l(f){e=T(f,"A",{href:!0,class:!0});var m=$(e);u&&u.l(m),t=G(m),r=T(m,"DIV",{});var h=$(r);l=T(h,"DIV",{class:!0});var g=$(l);a=Q(g,n),g.forEach(b),o=G(h),c=T(h,"DIV",{class:!0});var _=$(c);i=Q(_,d),_.forEach(b),h.forEach(b),m.forEach(b),this.h()},h(){v(l,"class","font-medium text-gray-900 dark:text-gray-100"),v(c,"class","text-gray-500 dark:text-gray-400"),v(e,"href",s[2]),v(e,"class","hover:underline flex flex-row")},m(f,m){I(f,e,m),u&&u.m(e,null),k(e,t),k(e,r),k(r,l),k(l,a),k(r,o),k(r,c),k(c,i)},p(f,[m]){f[3]?u?u.p(f,m):(u=tt(f),u.c(),u.m(e,t)):u&&(u.d(1),u=null),m&1&&n!==(n=(f[0]??"")+"")&&we(a,n),m&2&&d!==(d=(f[1]??"")+"")&&we(i,d),m&4&&v(e,"href",f[2])},i:Z,o:Z,d(f){f&&b(e),u&&u.d()}}}function Dr(s,e,t){let{title:r}=e,{subtitle:l=""}=e,{href:n=""}=e,{icon:a=void 0}=e;return s.$$set=o=>{"title"in o&&t(0,r=o.title),"subtitle"in o&&t(1,l=o.subtitle),"href"in o&&t(2,n=o.href),"icon"in o&&t(3,a=o.icon)},[r,l,n,a]}class ie extends ue{constructor(e){super(),de(this,e,Dr,Tr,fe,{title:0,subtitle:1,href:2,icon:3})}}function Pr(s,e){return[s.column({header:"Title",id:"title-block",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.tt,icon:`<svg class="mr-1 inline-block h-5 w-5 drop-shadow-md"><use href="/img/flags.svg#${t.id}" xlink:href="#${t.id}"></use></svg>`,href:"/"+e+"/countries/"+t.id})}),s.column({header:"Population",accessor:"po",cell:({value:t})=>t.toLocaleString("en-US")}),s.column({header:"Region",accessor:"rn"})]}function Vr(s,e){return[s.column({header:"Title",id:"title-block",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.title,href:t.url})})]}function Br(s,e){return[s.column({header:"Title",id:"title-block",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.title,subtitle:t.title_vernacular??"",href:t.url})}),s.column({header:"Author",accessor:"author"})]}function Mr(s,e){return[s.column({header:"Title",id:"title-block",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.tt,subtitle:t.tv,href:"/"+e+"/bibles/"+t.id}),plugins:{sort:{getSortValue:t=>t.tt+t.tv},tableFilter:{getFilterValue:t=>t.tt+t.tv}}}),s.column({header:"Date",accessor:"dt"}),s.column({header:"Language",accessor:"ln"})]}function xr(s,e){return[s.column({header:"Title",id:"title-block",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.tt,subtitle:t.iso,href:"/"+e+"/languages/"+t.id}),plugins:{sort:{getSortValue:t=>t.tt+t.tv},tableFilter:{getFilterValue:t=>t.tt+t.tv}}}),s.column({header:"Population",accessor:"po",cell:({value:t})=>t.toLocaleString("en-US")})]}function Hr(s,e){return[s.column({header:"Title",id:"title-block",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.tt,subtitle:t.tv,href:"/"+t.lc+"/bibles/"+t.id}),plugins:{sort:{getSortValue:t=>t.tt+t.tv},tableFilter:{getFilterValue:t=>t.tt+t.tv}}}),s.column({header:"Date",accessor:"dt"})]}function Or(s,e){return[s.column({header:"Title",id:"title-block",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.name,subtitle:t.autonym,href:"/"+e+"/languages/"+t.iso})}),s.column({header:"Population",cell:({value:t})=>t.toLocaleString("en-US"),accessor:"population"})]}function zr(s,e){return[s.column({header:"Title",id:"name",accessor:t=>t,cell:({value:t})=>ae(ie,{title:t.name,subtitle:t.family,href:"/"+e+"/alphabets/"+t.script})})]}function Nr(s){let e,t,r,l,n,a,o,c,d,i,u=s[0]+1+"",f,m,h,g,_,S,p,y,C,L,ee,F;return{c(){e=j("nav"),t=j("div"),r=j("button"),l=se("svg"),n=se("path"),a=J(`
Previous`),c=N(),d=j("div"),i=j("span"),f=J(u),m=J(" of "),h=J(s[2]),g=N(),_=j("div"),S=j("button"),p=J(`Next
`),y=se("svg"),C=se("path"),this.h()},l(U){e=T(U,"NAV",{class:!0});var x=$(e);t=T(x,"DIV",{class:!0});var ge=$(t);r=T(ge,"BUTTON",{class:!0});var ve=$(r);l=ne(ve,"svg",{class:!0,xmlns:!0,viewBox:!0,fill:!0,"aria-hidden":!0});var ke=$(l);n=ne(ke,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),$(n).forEach(b),ke.forEach(b),a=Q(ve,`
Previous`),ve.forEach(b),ge.forEach(b),c=G(x),d=T(x,"DIV",{class:!0});var me=$(d);i=T(me,"SPAN",{class:!0});var te=$(i);f=Q(te,u),m=Q(te," of "),h=Q(te,s[2]),te.forEach(b),me.forEach(b),g=G(x),_=T(x,"DIV",{class:!0});var Se=$(_);S=T(Se,"BUTTON",{class:!0});var ye=$(S);p=Q(ye,`Next
`),y=ne(ye,"svg",{class:!0,xmlns:!0,viewBox:!0,fill:!0,"aria-hidden":!0});var _e=$(y);C=ne(_e,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),$(C).forEach(b),_e.forEach(b),ye.forEach(b),Se.forEach(b),x.forEach(b),this.h()},h(){v(n,"fill-rule","evenodd"),v(n,"d","M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z"),v(n,"clip-rule","evenodd"),v(l,"class","mr-3 h-5 w-5 text-gray-400"),v(l,"xmlns","http://www.w3.org/2000/svg"),v(l,"viewBox","0 0 20 20"),v(l,"fill","currentColor"),v(l,"aria-hidden","true"),r.disabled=o=!s[1],v(r,"class","border-t-2 border-transparent pt-4 pr-1 inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300"),v(t,"class","-mt-px w-0 flex-1 flex"),v(i,"class","border-transparent text-gray-500 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium"),v(d,"class","hidden md:-mt-px md:flex"),v(C,"fill-rule","evenodd"),v(C,"d","M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"),v(C,"clip-rule","evenodd"),v(y,"class","ml-3 h-5 w-5 text-gray-400"),v(y,"xmlns","http://www.w3.org/2000/svg"),v(y,"viewBox","0 0 20 20"),v(y,"fill","currentColor"),v(y,"aria-hidden","true"),S.disabled=L=!s[3],v(S,"class","border-t-2 border-transparent pt-4 pl-1 inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300"),v(_,"class","-mt-px w-0 flex-1 flex justify-end"),v(e,"class","border-t border-gray-200 dark:border-gray-800 px-4 flex items-center justify-between sm:px-0")},m(U,x){I(U,e,x),k(e,t),k(t,r),k(r,l),k(l,n),k(r,a),k(e,c),k(e,d),k(d,i),k(i,f),k(i,m),k(i,h),k(e,g),k(e,_),k(_,S),k(S,p),k(S,y),k(y,C),ee||(F=[Ce(r,"click",s[9]),Ce(S,"click",s[10])],ee=!0)},p(U,[x]){x&2&&o!==(o=!U[1])&&(r.disabled=o),x&1&&u!==(u=U[0]+1+"")&&we(f,u),x&4&&we(h,U[2]),x&8&&L!==(L=!U[3])&&(S.disabled=L)},i:Z,o:Z,d(U){U&&b(e),ee=!1,Mt(F)}}}function Gr(s,e,t){let r,l,n,a,{pluginStates:o}=e;const{pageIndex:c,pageCount:d,pageSize:i,hasPreviousPage:u,hasNextPage:f}=o.page;W(s,c,g=>t(0,r=g)),W(s,d,g=>t(2,n=g)),W(s,u,g=>t(1,l=g)),W(s,f,g=>t(3,a=g));const m=()=>Be(c,r--,r),h=()=>Be(c,r++,r);return s.$$set=g=>{"pluginStates"in g&&t(8,o=g.pluginStates)},[r,l,n,a,c,d,u,f,o,m,h]}class Lr extends ue{constructor(e){super(),de(this,e,Gr,Nr,fe,{pluginStates:8})}}function rt(s,e,t){const r=s.slice();return r[1]=e[t],r}function st(s,e,t){const r=s.slice();return r[5]=e[t],r}function Ur(s){let e,t;return{c(){e=se("svg"),t=se("path"),this.h()},l(r){e=ne(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var l=$(e);t=ne(l,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),$(t).forEach(b),l.forEach(b),this.h()},h(){v(t,"fill-rule","evenodd"),v(t,"d","M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"),v(t,"clip-rule","evenodd"),v(e,"xmlns","http://www.w3.org/2000/svg"),v(e,"viewBox","0 0 20 20"),v(e,"fill","currentColor"),v(e,"class","w-5 h-5")},m(r,l){I(r,e,l),k(e,t)},d(r){r&&b(e)}}}function Kr(s){let e,t;return{c(){e=se("svg"),t=se("path"),this.h()},l(r){e=ne(r,"svg",{xmlns:!0,viewBox:!0,fill:!0,class:!0});var l=$(e);t=ne(l,"path",{"fill-rule":!0,d:!0,"clip-rule":!0}),$(t).forEach(b),l.forEach(b),this.h()},h(){v(t,"fill-rule","evenodd"),v(t,"d","M14.77 12.79a.75.75 0 01-1.06-.02L10 8.832 6.29 12.77a.75.75 0 11-1.08-1.04l4.25-4.5a.75.75 0 011.08 0l4.25 4.5a.75.75 0 01-.02 1.06z"),v(t,"clip-rule","evenodd"),v(e,"xmlns","http://www.w3.org/2000/svg"),v(e,"viewBox","0 0 20 20"),v(e,"fill","currentColor"),v(e,"class","w-5 h-5")},m(r,l){I(r,e,l),k(e,t)},d(r){r&&b(e)}}}function Wr(s){let e,t,r,l,n,a,o,c;r=new ht({props:{of:s[5].render()}});function d(h,g){if(h[8].sort.order==="asc")return Kr;if(h[8].sort.order==="desc")return Ur}let i=d(s),u=i&&i(s),f=[{class:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-stone-200"},s[4]],m={};for(let h=0;h<f.length;h+=1)m=X(m,f[h]);return{c(){e=j("th"),t=j("div"),H(r.$$.fragment),l=N(),u&&u.c(),n=N(),this.h()},l(h){e=T(h,"TH",{class:!0});var g=$(e);t=T(g,"DIV",{class:!0});var _=$(t);Y(r.$$.fragment,_),l=G(_),u&&u.l(_),_.forEach(b),g.forEach(b),n=G(h),this.h()},h(){v(t,"class","flex flex-row cursor-pointer"),q(e,m),le(e,"sorted",s[8].sort.order!==void 0)},m(h,g){I(h,e,g),k(e,t),O(r,t,null),k(t,l),u&&u.m(t,null),I(h,n,g),a=!0,o||(c=Ce(e,"click",function(){xt(s[8].sort.toggle)&&s[8].sort.toggle.apply(this,arguments)}),o=!0)},p(h,g){s=h;const _={};g&1&&(_.of=s[5].render()),r.$set(_),i!==(i=d(s))&&(u&&u.d(1),u=i&&i(s),u&&(u.c(),u.m(t,null))),q(e,m=oe(f,[{class:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-stone-200"},g&16&&s[4]])),le(e,"sorted",s[8].sort.order!==void 0)},i(h){a||(P(r.$$.fragment,h),a=!0)},o(h){V(r.$$.fragment,h),a=!1},d(h){h&&b(e),z(r),u&&u.d(),h&&b(n),o=!1,c()}}}function nt(s,e){let t,r,l;return r=new Re({props:{attrs:e[5].attrs(),props:e[5].props(),$$slots:{default:[Wr,({attrs:n,props:a})=>({4:n,8:a}),({attrs:n,props:a})=>(n?16:0)|(a?256:0)]},$$scope:{ctx:e}}}),{key:s,first:null,c(){t=M(),H(r.$$.fragment),this.h()},l(n){t=M(),Y(r.$$.fragment,n),this.h()},h(){this.first=t},m(n,a){I(n,t,a),O(r,n,a),l=!0},p(n,a){e=n;const o={};a&1&&(o.attrs=e[5].attrs()),a&1&&(o.props=e[5].props()),a&785&&(o.$$scope={dirty:a,ctx:e}),r.$set(o)},i(n){l||(P(r.$$.fragment,n),l=!0)},o(n){V(r.$$.fragment,n),l=!1},d(n){n&&b(t),z(r,n)}}}function qr(s){let e,t=[],r=new Map,l,n,a=s[1].cells;const o=i=>i[5].id;for(let i=0;i<a.length;i+=1){let u=st(s,a,i),f=o(u);r.set(f,t[i]=nt(f,u))}let c=[s[4]],d={};for(let i=0;i<c.length;i+=1)d=X(d,c[i]);return{c(){e=j("tr");for(let i=0;i<t.length;i+=1)t[i].c();l=N(),this.h()},l(i){e=T(i,"TR",{});var u=$(e);for(let f=0;f<t.length;f+=1)t[f].l(u);u.forEach(b),l=G(i),this.h()},h(){q(e,d)},m(i,u){I(i,e,u);for(let f=0;f<t.length;f+=1)t[f].m(e,null);I(i,l,u),n=!0},p(i,u){u&273&&(a=i[1].cells,he(),t=Ie(t,u,o,1,i,a,r,e,Ae,nt,null,st),pe()),q(e,d=oe(c,[u&16&&i[4]]))},i(i){if(!n){for(let u=0;u<a.length;u+=1)P(t[u]);n=!0}},o(i){for(let u=0;u<t.length;u+=1)V(t[u]);n=!1},d(i){i&&b(e);for(let u=0;u<t.length;u+=1)t[u].d();i&&b(l)}}}function lt(s,e){let t,r,l;return r=new Re({props:{attrs:e[1].attrs(),$$slots:{default:[qr,({attrs:n})=>({4:n}),({attrs:n})=>n?16:0]},$$scope:{ctx:e}}}),{key:s,first:null,c(){t=M(),H(r.$$.fragment),this.h()},l(n){t=M(),Y(r.$$.fragment,n),this.h()},h(){this.first=t},m(n,a){I(n,t,a),O(r,n,a),l=!0},p(n,a){e=n;const o={};a&1&&(o.attrs=e[1].attrs()),a&529&&(o.$$scope={dirty:a,ctx:e}),r.$set(o)},i(n){l||(P(r.$$.fragment,n),l=!0)},o(n){V(r.$$.fragment,n),l=!1},d(n){n&&b(t),z(r,n)}}}function Yr(s){let e,t=[],r=new Map,l,n=s[0];const a=o=>o[1].id;for(let o=0;o<n.length;o+=1){let c=rt(s,n,o),d=a(c);r.set(d,t[o]=lt(d,c))}return{c(){e=j("thead");for(let o=0;o<t.length;o+=1)t[o].c();this.h()},l(o){e=T(o,"THEAD",{class:!0});var c=$(e);for(let d=0;d<t.length;d+=1)t[d].l(c);c.forEach(b),this.h()},h(){v(e,"class","bg-gray-50 dark:bg-stone-900")},m(o,c){I(o,e,c);for(let d=0;d<t.length;d+=1)t[d].m(e,null);l=!0},p(o,[c]){c&273&&(n=o[0],he(),t=Ie(t,c,a,1,o,n,r,e,Ae,lt,null,rt),pe())},i(o){if(!l){for(let c=0;c<n.length;c+=1)P(t[c]);l=!0}},o(o){for(let c=0;c<t.length;c+=1)V(t[c]);l=!1},d(o){o&&b(e);for(let c=0;c<t.length;c+=1)t[c].d()}}}function Jr(s,e,t){let{headerRows:r}=e;return s.$$set=l=>{"headerRows"in l&&t(0,r=l.headerRows)},[r]}class Qr extends ue{constructor(e){super(),de(this,e,Jr,Yr,fe,{headerRows:0})}}function Xr(s){let e,t,r,l,n,a,o,c,d;return{c(){e=j("div"),t=j("div"),r=j("input"),l=N(),n=j("div"),a=j("kbd"),o=J("\u2318K"),this.h()},l(i){e=T(i,"DIV",{class:!0});var u=$(e);t=T(u,"DIV",{class:!0});var f=$(t);r=T(f,"INPUT",{type:!0,name:!0,id:!0,placeholder:!0,class:!0}),l=G(f),n=T(f,"DIV",{class:!0});var m=$(n);a=T(m,"KBD",{class:!0});var h=$(a);o=Q(h,"\u2318K"),h.forEach(b),m.forEach(b),f.forEach(b),u.forEach(b),this.h()},h(){v(r,"type","text"),v(r,"name","search"),v(r,"id","search"),v(r,"placeholder","Filter the table rows..."),v(r,"class","shadow-sm focus:ring-primary-500 focus:border-primary-500 block w-full pr-12 sm:text-sm border-gray-300 dark:border-gray-700 rounded-md dark:bg-gray-900"),v(a,"class","inline-flex items-center border border-gray-200 dark:border-gray-700 rounded px-2 text-sm font-sans font-medium text-gray-400"),v(n,"class","absolute inset-y-0 right-0 flex py-1.5 pr-1.5"),v(t,"class","mt-1 relative flex items-center"),v(e,"class","mx-auto max-w-xl my-8")},m(i,u){I(i,e,u),k(e,t),k(t,r),qe(r,s[0]),k(t,l),k(t,n),k(n,a),k(a,o),c||(d=Ce(r,"input",s[3]),c=!0)},p(i,[u]){u&1&&r.value!==i[0]&&qe(r,i[0])},i:Z,o:Z,d(i){i&&b(e),c=!1,d()}}}function Zr(s,e,t){let r,{pluginStates:l}=e;const{filterValue:n}=l.tableFilter;W(s,n,o=>t(0,r=o));function a(){r=this.value,n.set(r)}return s.$$set=o=>{"pluginStates"in o&&t(2,l=o.pluginStates)},[r,n,l,a]}class es extends ue{constructor(e){super(),de(this,e,Zr,Xr,fe,{pluginStates:2})}}function ot(s,e,t){const r=s.slice();return r[20]=e[t],r}function at(s,e,t){const r=s.slice();return r[25]=e[t],r}function ts(s){let e,t,r,l;t=new ht({props:{of:s[25].render()}});let n=[{class:"whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"},s[23]],a={};for(let o=0;o<n.length;o+=1)a=X(a,n[o]);return{c(){e=j("td"),H(t.$$.fragment),r=N(),this.h()},l(o){e=T(o,"TD",{class:!0});var c=$(e);Y(t.$$.fragment,c),c.forEach(b),r=G(o),this.h()},h(){q(e,a),le(e,"sorted",s[28].sort.order!==void 0),le(e,"matches",s[28].tableFilter.matches)},m(o,c){I(o,e,c),O(t,e,null),I(o,r,c),l=!0},p(o,c){const d={};c&8&&(d.of=o[25].render()),t.$set(d),q(e,a=oe(n,[{class:"whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"},c&8388608&&o[23]])),le(e,"sorted",o[28].sort.order!==void 0),le(e,"matches",o[28].tableFilter.matches)},i(o){l||(P(t.$$.fragment,o),l=!0)},o(o){V(t.$$.fragment,o),l=!1},d(o){o&&b(e),z(t),o&&b(r)}}}function it(s,e){let t,r,l;return r=new Re({props:{attrs:e[25].attrs(),props:e[25].props(),$$slots:{default:[ts,({attrs:n,props:a})=>({23:n,28:a}),({attrs:n,props:a})=>(n?8388608:0)|(a?268435456:0)]},$$scope:{ctx:e}}}),{key:s,first:null,c(){t=M(),H(r.$$.fragment),this.h()},l(n){t=M(),Y(r.$$.fragment,n),this.h()},h(){this.first=t},m(n,a){I(n,t,a),O(r,n,a),l=!0},p(n,a){e=n;const o={};a&8&&(o.attrs=e[25].attrs()),a&8&&(o.props=e[25].props()),a&813694984&&(o.$$scope={dirty:a,ctx:e}),r.$set(o)},i(n){l||(P(r.$$.fragment,n),l=!0)},o(n){V(r.$$.fragment,n),l=!1},d(n){n&&b(t),z(r,n)}}}function rs(s){let e,t=[],r=new Map,l,n,a=s[20].cells;const o=i=>i[25].id;for(let i=0;i<a.length;i+=1){let u=at(s,a,i),f=o(u);r.set(f,t[i]=it(f,u))}let c=[s[23]],d={};for(let i=0;i<c.length;i+=1)d=X(d,c[i]);return{c(){e=j("tr");for(let i=0;i<t.length;i+=1)t[i].c();l=N(),this.h()},l(i){e=T(i,"TR",{});var u=$(e);for(let f=0;f<t.length;f+=1)t[f].l(u);u.forEach(b),l=G(i),this.h()},h(){q(e,d),le(e,"selected",s[24].select.selected)},m(i,u){I(i,e,u);for(let f=0;f<t.length;f+=1)t[f].m(e,null);I(i,l,u),n=!0},p(i,u){u&276824072&&(a=i[20].cells,he(),t=Ie(t,u,o,1,i,a,r,e,Ae,it,null,at),pe()),q(e,d=oe(c,[u&8388608&&i[23]])),le(e,"selected",i[24].select.selected)},i(i){if(!n){for(let u=0;u<a.length;u+=1)P(t[u]);n=!0}},o(i){for(let u=0;u<t.length;u+=1)V(t[u]);n=!1},d(i){i&&b(e);for(let u=0;u<t.length;u+=1)t[u].d();i&&b(l)}}}function ct(s,e){let t,r,l;return r=new Re({props:{attrs:e[20].attrs(),rowProps:e[20].props(),$$slots:{default:[rs,({attrs:n,rowProps:a})=>({23:n,24:a}),({attrs:n,rowProps:a})=>(n?8388608:0)|(a?16777216:0)]},$$scope:{ctx:e}}}),{key:s,first:null,c(){t=M(),H(r.$$.fragment),this.h()},l(n){t=M(),Y(r.$$.fragment,n),this.h()},h(){this.first=t},m(n,a){I(n,t,a),O(r,n,a),l=!0},p(n,a){e=n;const o={};a&8&&(o.attrs=e[20].attrs()),a&8&&(o.rowProps=e[20].props()),a&562036744&&(o.$$scope={dirty:a,ctx:e}),r.$set(o)},i(n){l||(P(r.$$.fragment,n),l=!0)},o(n){V(r.$$.fragment,n),l=!1},d(n){n&&b(t),z(r,n)}}}function ss(s){let e,t,r,l,n,a,o=[],c=new Map,d,i,u;e=new es({props:{pluginStates:s[8]}}),l=new Qr({props:{headerRows:s[1]}});let f=s[3];const m=p=>p[20].id;for(let p=0;p<f.length;p+=1){let y=ot(s,f,p),C=m(y);c.set(C,o[p]=ct(C,y))}let h=[{class:"divide-y divide-gray-200 dark:divide-gray-900 bg-white dark:bg-stone-700"},s[2]],g={};for(let p=0;p<h.length;p+=1)g=X(g,h[p]);let _=[{class:"min-w-full divide-y divide-gray-300 dark:divide-gray-900 rounded-t-lg"},s[0]],S={};for(let p=0;p<_.length;p+=1)S=X(S,_[p]);return i=new Lr({props:{pluginStates:s[8]}}),{c(){H(e.$$.fragment),t=N(),r=j("table"),H(l.$$.fragment),n=N(),a=j("tbody");for(let p=0;p<o.length;p+=1)o[p].c();d=N(),H(i.$$.fragment),this.h()},l(p){Y(e.$$.fragment,p),t=G(p),r=T(p,"TABLE",{class:!0});var y=$(r);Y(l.$$.fragment,y),n=G(y),a=T(y,"TBODY",{class:!0});var C=$(a);for(let L=0;L<o.length;L+=1)o[L].l(C);C.forEach(b),y.forEach(b),d=G(p),Y(i.$$.fragment,p),this.h()},h(){q(a,g),q(r,S)},m(p,y){O(e,p,y),I(p,t,y),I(p,r,y),O(l,r,null),k(r,n),k(r,a);for(let C=0;C<o.length;C+=1)o[C].m(a,null);I(p,d,y),O(i,p,y),u=!0},p(p,[y]){const C={};y&2&&(C.headerRows=p[1]),l.$set(C),y&293601288&&(f=p[3],he(),o=Ie(o,y,m,1,p,f,c,a,Ae,ct,null,ot),pe()),q(a,g=oe(h,[{class:"divide-y divide-gray-200 dark:divide-gray-900 bg-white dark:bg-stone-700"},y&4&&p[2]])),q(r,S=oe(_,[{class:"min-w-full divide-y divide-gray-300 dark:divide-gray-900 rounded-t-lg"},y&1&&p[0]]))},i(p){if(!u){P(e.$$.fragment,p),P(l.$$.fragment,p);for(let y=0;y<f.length;y+=1)P(o[y]);P(i.$$.fragment,p),u=!0}},o(p){V(e.$$.fragment,p),V(l.$$.fragment,p);for(let y=0;y<o.length;y+=1)V(o[y]);V(i.$$.fragment,p),u=!1},d(p){z(e,p),p&&b(t),p&&b(r),z(l);for(let y=0;y<o.length;y+=1)o[y].d();p&&b(d),z(i,p)}}}function ns(s,e,t){let r,l,n,a,o,{tableType:c}=e,{inputData:d}=e,{locale:i}=e;const u=be(d),f=mr(u,{filter:wr(),tableFilter:Ar(),sort:Ir(),select:Er({initialSelectedDataIds:{1:!0}}),orderColumns:vr(),page:Sr({initialPageSize:200})}),m=F=>{switch(c){case"languages":return xr(F,i);case"language_bibles":return Hr(F);case"bibles":return Mr(F,i);case"countries":return Pr(F,i);case"alphabets":return zr(F,i);case"films":return Vr(F);case"resources":return Br(F);case"country_languages":return Or(F,i)}},h=f.createColumns(m(f)),{flatColumns:g,headerRows:_,pageRows:S,tableAttrs:p,tableBodyAttrs:y,pluginStates:C}=f.createViewModel(h);W(s,_,F=>t(1,n=F)),W(s,S,F=>t(3,o=F)),W(s,p,F=>t(0,l=F)),W(s,y,F=>t(2,a=F));const L=g.map(F=>F.id),{columnIdOrder:ee}=C.orderColumns;return W(s,ee,F=>t(13,r=F)),Be(ee,r=L,r),s.$$set=F=>{"tableType"in F&&t(10,c=F.tableType),"inputData"in F&&t(11,d=F.inputData),"locale"in F&&t(12,i=F.locale)},[l,n,a,o,_,S,p,y,C,ee,c,d,i]}class as extends ue{constructor(e){super(),de(this,e,ns,ss,fe,{tableType:10,inputData:11,locale:12})}}export{as as default};