import{s as Ce,c as sl,e as O,a as z,b as I,d as F,g as _,f as Q,h as p,i as k,j as T,aa as rn,u as cl,m as ml,n as dl,Y as _l,ab as fl,l as pe,X as ol,r as L,z as x,M as E,t as ke,w as te,x as ne,y as ce,I as yl,J as Sl,p as el,R as Fe,U as Ke,T as Dl,ac as Be,Q as ll,v as Ye,ad as Bl,G as Ll,H as Pl,a7 as Un,q as hl,o as Vn,a8 as jn,N as Nl,ae as fn,af as un,L as qn,ag as zn}from"../chunks/scheduler.C39PMv9a.js";import{S as ye,i as Se,b as A,d as R,m as U,t as m,a as g,e as V,g as W,c as X,f as xe,k as an}from"../chunks/index.Te5Nl1-a.js";import{I as qe,g as gl,v as bl,e as me,x as rl,Q as il,y as Qn,z as Hn,A as Wn,C as Fl,D as Xn}from"../chunks/VennDiagram.svelte_svelte_type_style_lang.-64_fZ65.js";import{w as Jn}from"../chunks/entry.galzRTFy.js";import{f as Gl,s as ul}from"../chunks/index.Cx6KSiTC.js";import{B as Al}from"../chunks/Button.CSceGTOW.js";import{s as kl,c as sn,g as cn,V as Kn,Q as Tl,E as mn,p as Ze,u as Rl,d as Yn,a as dn,S as Zn,C as $n,D as _n}from"../chunks/colours.2ZU4LZol.js";import{g as Oe,f as we,c as xn}from"../chunks/CopyIcon.DryQyYGB.js";import{X as eo,S as lo,c as to,d as no,e as oo,f as ro,g as io,h as fo,E as Ul,i as Vl,P as uo}from"../chunks/index.ta-mt3DI.js";import{E as ao}from"../chunks/index.BUqOVkrY.js";function so(o){let l,t,e,n,i,r,u,f,a;e=new qe({props:{class:"w-6 h-6",src:eo}});const s=o[3].default,c=sl(s,o,o[2],null);return{c(){l=O("dialog"),t=O("button"),A(e.$$.fragment),n=z(),i=O("div"),c&&c.c(),this.h()},l(d){l=I(d,"DIALOG",{class:!0});var h=F(l);t=I(h,"BUTTON",{class:!0});var S=F(t);R(e.$$.fragment,S),S.forEach(_),n=Q(h),i=I(h,"DIV",{class:!0});var b=F(i);c&&c.l(b),b.forEach(_),h.forEach(_),this.h()},h(){p(t,"class","absolute top-2 right-2 text-gray-500 hover:text-gray-700 focus:outline-none"),p(i,"class","py-2 px-6"),p(l,"class","w-[90vw] rounded-lg relative")},m(d,h){k(d,l,h),T(l,t),U(e,t,null),T(l,n),T(l,i),c&&c.m(i,null),u=!0,f||(a=rn(r=o[1].call(null,l,o[0])),f=!0)},p(d,[h]){c&&c.p&&(!u||h&4)&&cl(c,s,d,d[2],u?dl(s,d[2],h,null):ml(d[2]),null),r&&_l(r.update)&&h&1&&r.update.call(null,d[0])},i(d){u||(m(e.$$.fragment,d),m(c,d),u=!0)},o(d){g(e.$$.fragment,d),g(c,d),u=!1},d(d){d&&_(l),V(e),c&&c.d(d),f=!1,a()}}}function co(o,l,t){let{$$slots:e={},$$scope:n}=l,{open:i=!1}=l;function r(u,f){f?u.showModal():u.close();function a(d){d.target===u&&t(0,i=!1)}function s(){t(0,i=!1)}u.addEventListener("click",a);const c=u.firstElementChild;return c.addEventListener("click",s),{update(d){d?u.showModal():u.close()},destroy(){u.removeEventListener("click",a),c.removeEventListener("click",s)}}}return o.$$set=u=>{"open"in u&&t(0,i=u.open),"$$scope"in u&&t(2,n=u.$$scope)},[i,r,n,e]}class mo extends ye{constructor(l){super(),Se(this,l,co,so,Ce,{open:0})}}function _o(o){let l,t,e,n,i,r,u,f;return i=new qe({props:{src:lo,class:"pl-0.5"}}),{c(){l=O("div"),t=O("input"),e=z(),n=O("div"),A(i.$$.fragment),this.h()},l(a){l=I(a,"DIV",{class:!0});var s=F(l);t=I(s,"INPUT",{class:!0,type:!0,placeholder:!0}),e=Q(s),n=I(s,"DIV",{class:!0});var c=F(n);R(i.$$.fragment,c),c.forEach(_),s.forEach(_),this.h()},h(){p(t,"class","search-bar svelte-104e064"),p(t,"type","text"),p(t,"placeholder",o[1]),p(n,"class","search-icon svelte-104e064"),p(l,"class","search-container svelte-104e064")},m(a,s){k(a,l,s),T(l,t),fl(t,o[0]),T(l,e),T(l,n),U(i,n,null),r=!0,u||(f=[pe(t,"input",o[3]),pe(t,"keyup",o[4])],u=!0)},p(a,[s]){(!r||s&2)&&p(t,"placeholder",a[1]),s&1&&t.value!==a[0]&&fl(t,a[0])},i(a){r||(m(i.$$.fragment,a),r=!0)},o(a){g(i.$$.fragment,a),r=!1},d(a){a&&_(l),V(i),u=!1,ol(f)}}}function ho(o,l,t){let{placeholder:e="Search"}=l,{value:n}=l,{searchFunction:i}=l;function r(){n=this.value,t(0,n)}const u=()=>i(n);return o.$$set=f=>{"placeholder"in f&&t(1,e=f.placeholder),"value"in f&&t(0,n=f.value),"searchFunction"in f&&t(2,i=f.searchFunction)},[n,e,i,r,u]}class go extends ye{constructor(l){super(),Se(this,l,ho,_o,Ce,{placeholder:1,value:0,searchFunction:2})}}function bo(o){let l;return{c(){l=L()},l(t){l=L()},m(t,e){k(t,l,e)},p(t,[e]){},i:x,o:x,d(t){t&&_(l)}}}function ko(o,l,t){let{data:e}=l,{link:n}=l;const i=r=>r[n];return o.$$set=r=>{"data"in r&&t(0,e=r.data),"link"in r&&t(1,n=r.link)},[e,n,i]}class hn extends ye{constructor(l){super(),Se(this,l,ko,bo,Ce,{data:0,link:1})}}function Ue(o,l){const t=l.filter(e=>e.id===o.id);if(t===void 0||t.length!==1){const e=o.id===void 0?new Error('please add an "id" property to all the '):new Error(`column with id: "${o.id}" not found`);if(kl)throw e;return console.warn(e.message),""}return t[0]}function al(o,l,t){if(!t||!o.length)return null;let e=0,n=0;return o.forEach(i=>{const r=Number(i[l]??0),u=Number(i[t]??0);e+=r*u,n+=u}),n>0?e/n:0}function ze(o,l,t,e,n=null){if(!t&&e==="number"&&(t="sum"),!o||!o.length)return null;if(e!=="number"&&["sum","min","max","mean","weightedMean","median",void 0].includes(t))return"-";const i=o.map(r=>r[l]).filter(r=>r!==void 0);switch(t){case"sum":return i.reduce((r,u)=>r+Number(u),0);case"min":return Math.min(...i);case"max":return Math.max(...i);case"mean":return i.length?i.reduce((r,u)=>r+Number(u),0)/i.length:"-";case"count":return o.length;case"countDistinct":return new Set(i).size;case"weightedMean":{if(!n)return"Weight column name required for weightedMean";let r=0,u=o.reduce((f,a)=>{const s=a[n]||0;return r+=s,f+(Number(a[l])||0)*s},0);return r>0?u/r:null}case"median":{const r=i.sort((f,a)=>f-a),u=Math.floor(r.length/2);return r.length%2!==0?r[u]:(r[u-1]+r[u])/2}default:return`${t}`}}function De(o,l){const t=o.filter(e=>!l.includes(e));return[...l,...t]}function po(o){let l,t;return l=new Kn({props:{error:o[8]}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&256&&(i.error=e[8]),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function wo(o){let l,t,e,n;function i(a,s){return a[5]==="right"?yo:Co}let r=i(o),u=r(o),f=o[3]&&Hl(o);return{c(){l=O("span"),t=O("span"),u.c(),e=z(),f&&f.c(),this.h()},l(a){l=I(a,"SPAN",{class:!0});var s=F(l);t=I(s,"SPAN",{});var c=F(t);u.l(c),e=Q(c),f&&f.l(c),c.forEach(_),s.forEach(_),this.h()},h(){E(t,"text-align",o[6]??"right"),p(l,"class",n="m-0 "+o[7]+" font-ui inline-block rounded-md"),ke(l,"px-1",o[0]),E(l,"background-color",o[0]?o[12][o[11]].chipColor:void 0),E(l,"border",o[0]?`1px solid ${o[12][o[11]].chipBorder}`:void 0),E(l,"color",o[12][o[11]].color)},m(a,s){k(a,l,s),T(l,t),u.m(t,null),T(t,e),f&&f.m(t,null)},p(a,s){r===(r=i(a))&&u?u.p(a,s):(u.d(1),u=r(a),u&&(u.c(),u.m(t,e))),a[3]?f?f.p(a,s):(f=Hl(a),f.c(),f.m(t,null)):f&&(f.d(1),f=null),s&64&&E(t,"text-align",a[6]??"right"),s&128&&n!==(n="m-0 "+a[7]+" font-ui inline-block rounded-md")&&p(l,"class",n),s&129&&ke(l,"px-1",a[0]),s&2049&&E(l,"background-color",a[0]?a[12][a[11]].chipColor:void 0),s&2049&&E(l,"border",a[0]?`1px solid ${a[12][a[11]].chipBorder}`:void 0),s&2048&&E(l,"color",a[12][a[11]].color)},i:x,o:x,d(a){a&&_(l),u.d(),f&&f.d()}}}function Co(o){let l,t,e=o[2]&&jl(o),n=o[1]&&ql(o);return{c(){e&&e.c(),l=z(),n&&n.c(),t=L()},l(i){e&&e.l(i),l=Q(i),n&&n.l(i),t=L()},m(i,r){e&&e.m(i,r),k(i,l,r),n&&n.m(i,r),k(i,t,r)},p(i,r){i[2]?e?e.p(i,r):(e=jl(i),e.c(),e.m(l.parentNode,l)):e&&(e.d(1),e=null),i[1]?n?n.p(i,r):(n=ql(i),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(i){i&&(_(l),_(t)),e&&e.d(i),n&&n.d(i)}}}function yo(o){let l,t,e=o[1]&&zl(o),n=o[2]&&Ql(o);return{c(){e&&e.c(),l=z(),n&&n.c(),t=L()},l(i){e&&e.l(i),l=Q(i),n&&n.l(i),t=L()},m(i,r){e&&e.m(i,r),k(i,l,r),n&&n.m(i,r),k(i,t,r)},p(i,r){i[1]?e?e.p(i,r):(e=zl(i),e.c(),e.m(l.parentNode,l)):e&&(e.d(1),e=null),i[2]?n?n.p(i,r):(n=Ql(i),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(i){i&&(_(l),_(t)),e&&e.d(i),n&&n.d(i)}}}function jl(o){let l,t,e=o[11]==="positive"?"▲":o[11]==="negative"?"▼":"—";return{c(){l=O("span"),t=new yl(!1),this.h()},l(n){l=I(n,"SPAN",{class:!0});var i=F(l);t=Sl(i,!1),i.forEach(_),this.h()},h(){t.a=null,p(l,"class","font-[system-ui]")},m(n,i){k(n,l,i),t.m(e,l)},p(n,i){i&2048&&e!==(e=n[11]==="positive"?"▲":n[11]==="negative"?"▼":"—")&&t.p(e)},d(n){n&&_(l)}}}function ql(o){let l;function t(i,r){return i[9]===null?No:So}let e=t(o),n=e(o);return{c(){n.c(),l=L()},l(i){n.l(i),l=L()},m(i,r){n.m(i,r),k(i,l,r)},p(i,r){e===(e=t(i))&&n?n.p(i,r):(n.d(1),n=e(i),n&&(n.c(),n.m(l.parentNode,l)))},d(i){i&&_(l),n.d(i)}}}function So(o){let l,t=we(o[9],o[10],o[4])+"",e;return{c(){l=O("span"),e=te(t)},l(n){l=I(n,"SPAN",{});var i=F(l);e=ne(i,t),i.forEach(_)},m(n,i){k(n,l,i),T(l,e)},p(n,i){i&1552&&t!==(t=we(n[9],n[10],n[4])+"")&&ce(e,t)},d(n){n&&_(l)}}}function No(o){let l,t="–";return{c(){l=O("span"),l.textContent=t,this.h()},l(e){l=I(e,"SPAN",{class:!0,"data-svelte-h":!0}),el(l)!=="svelte-45ueay"&&(l.textContent=t),this.h()},h(){p(l,"class","font-[system-ui]")},m(e,n){k(e,l,n)},p:x,d(e){e&&_(l)}}}function zl(o){let l;function t(i,r){return i[9]===null?vo:To}let e=t(o),n=e(o);return{c(){n.c(),l=L()},l(i){n.l(i),l=L()},m(i,r){n.m(i,r),k(i,l,r)},p(i,r){e===(e=t(i))&&n?n.p(i,r):(n.d(1),n=e(i),n&&(n.c(),n.m(l.parentNode,l)))},d(i){i&&_(l),n.d(i)}}}function To(o){let l,t=we(o[9],o[10],o[4])+"",e;return{c(){l=O("span"),e=te(t)},l(n){l=I(n,"SPAN",{});var i=F(l);e=ne(i,t),i.forEach(_)},m(n,i){k(n,l,i),T(l,e)},p(n,i){i&1552&&t!==(t=we(n[9],n[10],n[4])+"")&&ce(e,t)},d(n){n&&_(l)}}}function vo(o){let l,t="–";return{c(){l=O("span"),l.textContent=t,this.h()},l(e){l=I(e,"SPAN",{class:!0,"data-svelte-h":!0}),el(l)!=="svelte-45ueay"&&(l.textContent=t),this.h()},h(){p(l,"class","font-[system-ui]")},m(e,n){k(e,l,n)},p:x,d(e){e&&_(l)}}}function Ql(o){let l,t,e=o[11]==="positive"?"▲":o[11]==="negative"?"▼":"– ";return{c(){l=O("span"),t=new yl(!1),this.h()},l(n){l=I(n,"SPAN",{class:!0});var i=F(l);t=Sl(i,!1),i.forEach(_),this.h()},h(){t.a=null,p(l,"class","font-[system-ui]")},m(n,i){k(n,l,i),t.m(e,l)},p(n,i){i&2048&&e!==(e=n[11]==="positive"?"▲":n[11]==="negative"?"▼":"– ")&&t.p(e)},d(n){n&&_(l)}}}function Hl(o){let l,t;return{c(){l=O("span"),t=te(o[3])},l(e){l=I(e,"SPAN",{});var n=F(l);t=ne(n,o[3]),n.forEach(_)},m(e,n){k(e,l,n),T(l,t)},p(e,n){n&8&&ce(t,e[3])},d(e){e&&_(l)}}}function Eo(o){let l,t,e,n;const i=[wo,po],r=[];function u(f,a){return f[8]?1:0}return l=u(o),t=r[l]=i[l](o),{c(){t.c(),e=L()},l(f){t.l(f),e=L()},m(f,a){r[l].m(f,a),k(f,e,a),n=!0},p(f,[a]){let s=l;l=u(f),l===s?r[l].p(f,a):(W(),g(r[s],1,1,()=>{r[s]=null}),X(),t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e))},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),r[l].d(f)}}}function Mo(o,l,t){let{data:e=void 0}=l,{row:n=0}=l,{column:i=void 0}=l,{value:r=void 0}=l,{text:u=void 0}=l,{chip:f=!1}=l,{downIsGood:a=!1}=l,{fmt:s=void 0}=l,{format_object:c=void 0}=l,{columnUnitSummary:d=void 0}=l,{showValue:h=!0}=l,{showSymbol:S=!0}=l,{symbolPosition:b="right"}=l,{align:y="right"}=l,{fontClass:M=f?"text-sm":"text-base"}=l,{neutralMin:B=0}=l,{neutralMax:P=0}=l,q={positive:{color:a?"var(--red-700)":"var(--green-700)",chipColor:a?"var(--red-100)":"var(--green-100)",chipBorder:a?"var(--red-300)":"var(--green-300)"},negative:{color:a?"var(--green-700)":"var(--red-700)",chipColor:a?"var(--green-100)":"var(--red-100)",chipBorder:a?"var(--green-300)":"var(--red-300)"},neutral:{color:"var(--grey-500)",chipColor:"var(--grey-100)",chipBorder:"var(--grey-300)"}},re,j,ie,D,J;return o.$$set=G=>{"data"in G&&t(13,e=G.data),"row"in G&&t(16,n=G.row),"column"in G&&t(14,i=G.column),"value"in G&&t(17,r=G.value),"text"in G&&t(3,u=G.text),"chip"in G&&t(0,f=G.chip),"downIsGood"in G&&t(15,a=G.downIsGood),"fmt"in G&&t(18,s=G.fmt),"format_object"in G&&t(19,c=G.format_object),"columnUnitSummary"in G&&t(4,d=G.columnUnitSummary),"showValue"in G&&t(1,h=G.showValue),"showSymbol"in G&&t(2,S=G.showSymbol),"symbolPosition"in G&&t(5,b=G.symbolPosition),"align"in G&&t(6,y=G.align),"fontClass"in G&&t(7,M=G.fontClass),"neutralMin"in G&&t(20,B=G.neutralMin),"neutralMax"in G&&t(21,P=G.neutralMax)},o.$$.update=()=>{var G;if(o.$$.dirty&1&&t(0,f=f==="true"||f===!0),o.$$.dirty&32768&&t(15,a=a==="true"||a===!0),o.$$.dirty&2&&t(1,h=h==="true"||h===!0),o.$$.dirty&4&&t(2,S=S==="true"||S===!0),o.$$.dirty&8348416)try{if(t(8,re=void 0),e){if(typeof e=="string")throw Error(`Received: data=${e}, expected: data={${e}}`);if(Array.isArray(e)||t(13,e=[e]),isNaN(n))throw Error("row must be a number (row="+n+")");try{Object.keys(e[n])[0]}catch{throw Error("Row "+n+" does not exist in the dataset")}t(14,i=i??Object.keys(e[n])[0]),sn(e,[i]),t(22,ie=cn(e,"array")),t(9,j=e[n][i]),t(22,ie=ie.filter(K=>K.id===i)),s?t(10,D=Oe(s,(G=ie[0].format)==null?void 0:G.valueType)):t(10,D=ie[0].format)}else if(r!==void 0){if(isNaN(r))throw Error("value must be a number (value="+r+")");t(9,j=r),t(10,D=s?Oe(s,"number"):c??void 0)}else throw Error("No data or value provided. If you referenced a query result, check that the name is correct.");t(11,J=j>P?"positive":j{e=null}),X()):e?(e.p(n,i),i&16&&m(e,1)):(e=Wl(n),e.c(),m(e,1),e.m(l,null))},i(n){t||(m(e),t=!0)},o(n){g(e),t=!1},d(n){n&&_(l),e&&e.d()}}}function Bo(o){let l,t="Loading...";return{c(){l=O("p"),l.textContent=t,this.h()},l(e){l=I(e,"P",{slot:!0,class:!0,"data-svelte-h":!0}),el(l)!=="svelte-e46ma0"&&(l.textContent=t),this.h()},h(){p(l,"slot","skeleton"),p(l,"class","text-gray-500")},m(e,n){k(e,l,n)},p:x,d(e){e&&_(l)}}}function Lo(o){let l,t;return l=new Tl({props:{data:o[0],$$slots:{skeleton:[Bo],empty:[Do],default:[Io,({loaded:e})=>({7:e}),({loaded:e})=>e?128:0]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,[n]){const i={};n&1&&(i.data=e[0]),n&414&&(i.$$scope={dirty:n,ctx:e}),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}let Po="Delta";function Fo(o,l,t){let e,{data:n=void 0}=l;const i=typeof n=="object"&&"__isQueryStore"in n?n.hash:void 0;let r=(n==null?void 0:n.hash)===i,{emptySet:u=void 0}=l,{emptyMessage:f=void 0}=l;return o.$$set=a=>{t(6,l=Fe(Fe({},l),Ke(a))),"data"in a&&t(0,n=a.data),"emptySet"in a&&t(1,u=a.emptySet),"emptyMessage"in a&&t(2,f=a.emptyMessage)},o.$$.update=()=>{o.$$.dirty&1&&t(3,r=(n==null?void 0:n.hash)===i),t(4,e=Object.fromEntries(Object.entries(l).filter(([,a])=>a!==void 0)))},l=Ke(l),[n,u,f,r,e]}class pl extends ye{constructor(l){super(),Se(this,l,Fo,Lo,Ce,{data:0,emptySet:1,emptyMessage:2})}}function Go(o){let l,t,e;const n=o[17].default,i=sl(n,o,o[16],null);return{c(){l=O("td"),i&&i.c(),this.h()},l(r){l=I(r,"TD",{class:!0,rowspan:!0,colspan:!0});var u=F(l);i&&i.l(u),u.forEach(_),this.h()},h(){p(l,"class",t=(o[15].class||"")+" "+o[0]+" "+o[11]+" whitespace-nowrap overflow-hidden first:pl-[3px] "+(o[14]?"text-xs py-[1px] px-[4px]":"py-[2px] px-[8px]")+" svelte-iw64fb"),p(l,"rowspan",o[6]),p(l,"colspan",o[7]),E(l,"text-align",o[1]),E(l,"height",o[2]),E(l,"width",o[3]),E(l,"white-space",o[4]?"normal":"nowrap"),E(l,"vertical-align",o[5]),E(l,"display",o[8]?void 0:"none"),E(l,"background-color",o[9]),E(l,"color",o[10]),E(l,"padding-left",o[12]),E(l,"border-bottom",o[13])},m(r,u){k(r,l,u),i&&i.m(l,null),e=!0},p(r,[u]){i&&i.p&&(!e||u&65536)&&cl(i,n,r,r[16],e?dl(n,r[16],u,null):ml(r[16]),null),(!e||u&51201&&t!==(t=(r[15].class||"")+" "+r[0]+" "+r[11]+" whitespace-nowrap overflow-hidden first:pl-[3px] "+(r[14]?"text-xs py-[1px] px-[4px]":"py-[2px] px-[8px]")+" svelte-iw64fb"))&&p(l,"class",t),(!e||u&64)&&p(l,"rowspan",r[6]),(!e||u&128)&&p(l,"colspan",r[7]),u&2&&E(l,"text-align",r[1]),u&4&&E(l,"height",r[2]),u&8&&E(l,"width",r[3]),u&16&&E(l,"white-space",r[4]?"normal":"nowrap"),u&32&&E(l,"vertical-align",r[5]),u&256&&E(l,"display",r[8]?void 0:"none"),u&512&&E(l,"background-color",r[9]),u&1024&&E(l,"color",r[10]),u&4096&&E(l,"padding-left",r[12]),u&8192&&E(l,"border-bottom",r[13])},i(r){e||(m(i,r),e=!0)},o(r){g(i,r),e=!1},d(r){r&&_(l),i&&i.d(r)}}}function Ao(o,l,t){const e=["dataType","align","height","width","wrap","verticalAlign","rowSpan","colSpan","show","cellColor","fontColor","topBorder","paddingLeft","borderBottom","compact"];let n=Dl(l,e),{$$slots:i={},$$scope:r}=l,{dataType:u=void 0}=l,{align:f=void 0}=l,{height:a=void 0}=l,{width:s=void 0}=l,{wrap:c=void 0}=l,{verticalAlign:d="middle"}=l,{rowSpan:h=1}=l,{colSpan:S=1}=l,{show:b=!0}=l,{cellColor:y=void 0}=l,{fontColor:M=void 0}=l,{topBorder:B=void 0}=l,{paddingLeft:P=void 0}=l,{borderBottom:q=void 0}=l,{compact:re=!1}=l;return o.$$set=j=>{l=Fe(Fe({},l),Ke(j)),t(15,n=Dl(l,e)),"dataType"in j&&t(0,u=j.dataType),"align"in j&&t(1,f=j.align),"height"in j&&t(2,a=j.height),"width"in j&&t(3,s=j.width),"wrap"in j&&t(4,c=j.wrap),"verticalAlign"in j&&t(5,d=j.verticalAlign),"rowSpan"in j&&t(6,h=j.rowSpan),"colSpan"in j&&t(7,S=j.colSpan),"show"in j&&t(8,b=j.show),"cellColor"in j&&t(9,y=j.cellColor),"fontColor"in j&&t(10,M=j.fontColor),"topBorder"in j&&t(11,B=j.topBorder),"paddingLeft"in j&&t(12,P=j.paddingLeft),"borderBottom"in j&&t(13,q=j.borderBottom),"compact"in j&&t(14,re=j.compact),"$$scope"in j&&t(16,r=j.$$scope)},[u,f,a,s,c,d,h,S,b,y,M,B,P,q,re,n,r,i]}class Qe extends ye{constructor(l){super(),Se(this,l,Ao,Go,Ce,{dataType:0,align:1,height:2,width:3,wrap:4,verticalAlign:5,rowSpan:6,colSpan:7,show:8,cellColor:9,fontColor:10,topBorder:11,paddingLeft:12,borderBottom:13,compact:14})}}function Xl(o,l,t){const e=o.slice();return e[21]=l[t],e[23]=t,e}function Jl(o,l,t){const e=o.slice();return e[24]=l[t],e[40]=t,e}function Kl(o,l,t){var b,y,M,B;const e=o.slice();e[24]=l[t],e[37]=t;const n=Ue(e[24],e[13]);e[25]=n;const i=e[24].scaleColumn?e[13].find(function(...q){return o[18](e[24],...q)}):e[25];e[26]=i;const r=e[24].colorMin??((b=e[26].columnUnitSummary)==null?void 0:b.min);e[27]=r;const u=e[24].colorMax??((y=e[26].columnUnitSummary)==null?void 0:y.max);e[28]=u;const f=e[28]-e[27]!==0&&!isNaN(e[28])&&!isNaN(e[27]);e[29]=f;const a=e[24].fmt?Oe(e[24].fmt,(M=e[25].format)==null?void 0:M.valueType):e[24].fmtColumn?Oe(e[21][e[24].fmtColumn],(B=e[25].format)==null?void 0:B.valuetype):e[25].format;e[30]=a;const s=e[24].colorBreakpoints??(e[24].colorMid?[e[27],e[24].colorMid,e[28]]:[e[27],e[28]]);e[31]=s;const c=e[24].colorPalette?rl.scale(e[24].colorPalette).domain(e[31]).nodata("white"):"";e[32]=c;const d=e[24].contentType==="colorscale"&&e[29]&&e[24].colorPalette?e[24].scaleColumn?e[32](e[21][e[24].scaleColumn]).hex():e[32](e[21][e[24].id]).hex():"";e[33]=d;const h=e[24].redNegatives?e[21][e[24].id]<0?"rgb(220 38 38)":"":e[24].contentType==="colorscale"&&e[29]&&e[24].colorPalette?rl.contrast(e[33],Rl.grey999)g(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;rg(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r{r[s]=null}),X(),t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e))},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),r[l].d(f)}}}function et(o){var e;let l,t;return l=new Qe({props:{class:(e=o[25])==null?void 0:e.type,compact:o[12],verticalAlign:o[7]==="section"?o[10]:void 0,rowSpan:o[7]==="section"&&o[8]===o[25].id&&o[23]===0?o[9]:1,show:!(o[7]==="section"&&o[8]===o[25].id&&o[23]!==0),align:o[24].align,paddingLeft:o[37]===0&&o[6]&&o[7]==="accordion"&&!o[3]?"28px":void 0,height:o[24].height,width:o[24].width,wrap:o[24].wrap,cellColor:o[33],fontColor:o[34],borderBottom:o[35],$$slots:{default:[lr]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(n){R(l.$$.fragment,n)},m(n,i){U(l,n,i),t=!0},p(n,i){var u;const r={};i[0]&26624&&(r.class=(u=n[25])==null?void 0:u.type),i[0]&4096&&(r.compact=n[12]),i[0]&1152&&(r.verticalAlign=n[7]==="section"?n[10]:void 0),i[0]&27520&&(r.rowSpan=n[7]==="section"&&n[8]===n[25].id&&n[23]===0?n[9]:1),i[0]&27008&&(r.show=!(n[7]==="section"&&n[8]===n[25].id&&n[23]!==0)),i[0]&18432&&(r.align=n[24].align),i[0]&200&&(r.paddingLeft=n[37]===0&&n[6]&&n[7]==="accordion"&&!n[3]?"28px":void 0),i[0]&18432&&(r.height=n[24].height),i[0]&18432&&(r.width=n[24].width),i[0]&18432&&(r.wrap=n[24].wrap),i[0]&26625&&(r.cellColor=n[33]),i[0]&26625&&(r.fontColor=n[34]),i[0]&26641&&(r.borderBottom=n[35]),i[0]&26625|i[1]&1024&&(r.$$scope={dirty:i,ctx:n}),l.$set(r)},i(n){t||(m(l.$$.fragment,n),t=!0)},o(n){g(l.$$.fragment,n),t=!1},d(n){V(l,n)}}}function lt(o){let l,t,e,n,i,r,u,f,a=o[3]&&o[7]!=="section"&&Yl(o);const s=[Qo,zo],c=[];function d(S,b){return S[14].columns.length>0?0:1}e=d(o),n=c[e]=s[e](o);function h(){return o[20](o[21])}return{c(){l=O("tr"),a&&a.c(),t=z(),n.c(),i=z(),this.h()},l(S){l=I(S,"TR",{class:!0});var b=F(l);a&&a.l(b),t=Q(b),n.l(b),i=Q(b),b.forEach(_),this.h()},h(){p(l,"class","svelte-1ukk5on"),ke(l,"shaded-row",o[1]&&o[23]%2===1),ke(l,"row-link",o[2]!=null),ke(l,"row-lines",o[4])},m(S,b){k(S,l,b),a&&a.m(l,null),T(l,t),c[e].m(l,null),T(l,i),r=!0,u||(f=pe(l,"click",h),u=!0)},p(S,b){o=S,o[3]&&o[7]!=="section"?a?(a.p(o,b),b[0]&136&&m(a,1)):(a=Yl(o),a.c(),m(a,1),a.m(l,t)):a&&(W(),g(a,1,1,()=>{a=null}),X());let y=e;e=d(o),e===y?c[e].p(o,b):(W(),g(c[y],1,1,()=>{c[y]=null}),X(),n=c[e],n?n.p(o,b):(n=c[e]=s[e](o),n.c()),m(n,1),n.m(l,i)),(!r||b[0]&2)&&ke(l,"shaded-row",o[1]&&o[23]%2===1),(!r||b[0]&4)&&ke(l,"row-link",o[2]!=null),(!r||b[0]&16)&&ke(l,"row-lines",o[4])},i(S){r||(m(a),m(n),r=!0)},o(S){g(a),g(n),r=!1},d(S){S&&_(l),a&&a.d(),c[e].d(),u=!1,f()}}}function tr(o){let l,t,e=me(o[0]),n=[];for(let r=0;rg(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;ro.show===!0;function nr(o,l,t){let e;const n=ll(Ze);Ye(o,n,D=>t(14,e=D));let{displayedData:i=void 0}=l,{rowShading:r=void 0}=l,{link:u=void 0}=l,{rowNumbers:f=void 0}=l,{rowLines:a=void 0}=l,{index:s=void 0}=l,{columnSummary:c=void 0}=l,{grouped:d=!1}=l,{groupType:h=void 0}=l,{groupColumn:S=void 0}=l,{rowSpan:b=void 0}=l,{groupNamePosition:y="middle"}=l,{finalColumnOrder:M=void 0}=l,{compact:B=void 0}=l;function P(D){u&&(window.location=D)}const q=(D,J)=>M.indexOf(D.id)-M.indexOf(J.id),re=(D,J)=>J.id===D.scaleColumn,j=(D,J)=>M.indexOf(D.id)-M.indexOf(J.id),ie=D=>P(D[u]);return o.$$set=D=>{"displayedData"in D&&t(0,i=D.displayedData),"rowShading"in D&&t(1,r=D.rowShading),"link"in D&&t(2,u=D.link),"rowNumbers"in D&&t(3,f=D.rowNumbers),"rowLines"in D&&t(4,a=D.rowLines),"index"in D&&t(5,s=D.index),"columnSummary"in D&&t(13,c=D.columnSummary),"grouped"in D&&t(6,d=D.grouped),"groupType"in D&&t(7,h=D.groupType),"groupColumn"in D&&t(8,S=D.groupColumn),"rowSpan"in D&&t(9,b=D.rowSpan),"groupNamePosition"in D&&t(10,y=D.groupNamePosition),"finalColumnOrder"in D&&t(11,M=D.finalColumnOrder),"compact"in D&&t(12,B=D.compact)},[i,r,u,f,a,s,d,h,S,b,y,M,B,c,e,n,P,q,re,j,ie]}class vl extends ye{constructor(l){super(),Se(this,l,nr,tr,Ce,{displayedData:0,rowShading:1,link:2,rowNumbers:3,rowLines:4,index:5,columnSummary:13,grouped:6,groupType:7,groupColumn:8,rowSpan:9,groupNamePosition:10,finalColumnOrder:11,compact:12},null,[-1,-1])}}function nt(o,l,t){const e=o.slice();e[12]=l[t];const n=Ue(e[12],e[2]);e[13]=n;const i=e[12].totalFmt?Oe(e[12].totalFmt):e[12].fmt?Oe(e[12].fmt):e[13].format;e[14]=i;const r=e[12].totalAgg??"sum";return e[15]=r,e}function ot(o){let l,t;return l=new Qe({props:{class:"index w-[2%]",compact:o[7],topBorder:"border-t border-gray-600"}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&128&&(i.compact=e[7]),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function or(o){let l=(o[12].totalFmt?we(o[15],o[14],o[13].columnUnitSummary):o[15])+"",t;return{c(){t=te(l)},l(e){t=ne(e,l)},m(e,n){k(e,t,n)},p(e,n){n&324&&l!==(l=(e[12].totalFmt?we(e[15],e[14],e[13].columnUnitSummary):e[15])+"")&&ce(t,l)},i:x,o:x,d(e){e&&_(t)}}}function rr(o){let l,t,e,n;const i=[fr,ir],r=[];function u(f,a){return f[12].contentType==="delta"?0:1}return l=u(o),t=r[l]=i[l](o),{c(){t.c(),e=L()},l(f){t.l(f),e=L()},m(f,a){r[l].m(f,a),k(f,e,a),n=!0},p(f,a){let s=l;l=u(f),l===s?r[l].p(f,a):(W(),g(r[s],1,1,()=>{r[s]=null}),X(),t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e))},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),r[l].d(f)}}}function ir(o){let l=we(o[15]==="weightedMean"?al(o[0],o[12].id,o[12].weightCol):o[13].columnUnitSummary[o[15]],o[14],o[13].columnUnitSummary)+"",t;return{c(){t=te(l)},l(e){t=ne(e,l)},m(e,n){k(e,t,n)},p(e,n){n&325&&l!==(l=we(e[15]==="weightedMean"?al(e[0],e[12].id,e[12].weightCol):e[13].columnUnitSummary[e[15]],e[14],e[13].columnUnitSummary)+"")&&ce(t,l)},i:x,o:x,d(e){e&&_(t)}}}function fr(o){let l,t;return l=new pl({props:{value:o[15]==="weightedMean"?al(o[0],o[12].id,o[12].weightCol):o[13].columnUnitSummary[o[15]],downIsGood:o[12].downIsGood,format_object:o[14],columnUnitSummary:o[13].columnUnitSummary,showValue:o[12].showValue,showSymbol:o[12].deltaSymbol,align:o[12].align,fontClass:"font-semibold text-[9.25pt]",neutralMin:o[12].neutralMin,neutralMax:o[12].neutralMax,chip:o[12].chip}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&325&&(i.value=e[15]==="weightedMean"?al(e[0],e[12].id,e[12].weightCol):e[13].columnUnitSummary[e[15]]),n&324&&(i.downIsGood=e[12].downIsGood),n&324&&(i.format_object=e[14]),n&324&&(i.columnUnitSummary=e[13].columnUnitSummary),n&324&&(i.showValue=e[12].showValue),n&324&&(i.showSymbol=e[12].deltaSymbol),n&324&&(i.align=e[12].align),n&324&&(i.neutralMin=e[12].neutralMin),n&324&&(i.neutralMax=e[12].neutralMax),n&324&&(i.chip=e[12].chip),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function ur(o){let l,t,e,n,i;const r=[rr,or],u=[];function f(a,s){return s&324&&(l=null),l==null&&(l=!!["sum","mean","weightedMean","median","min","max","count","countDistinct"].includes(a[15])),l?0:1}return t=f(o,-1),e=u[t]=r[t](o),{c(){e.c(),n=z()},l(a){e.l(a),n=Q(a)},m(a,s){u[t].m(a,s),k(a,n,s),i=!0},p(a,s){let c=t;t=f(a,s),t===c?u[t].p(a,s):(W(),g(u[c],1,1,()=>{u[c]=null}),X(),e=u[t],e?e.p(a,s):(e=u[t]=r[t](a),e.c()),m(e,1),e.m(n.parentNode,n))},i(a){i||(m(e),i=!0)},o(a){g(e),i=!1},d(a){a&&_(n),u[t].d(a)}}}function rt(o){let l,t;return l=new Qe({props:{compact:o[7],dataType:o[13].type,align:o[12].align,height:o[12].height,width:o[12].width,wrap:o[12].wrap,topBorder:"border-t border-gray-600",$$slots:{default:[ur]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&128&&(i.compact=e[7]),n&324&&(i.dataType=e[13].type),n&324&&(i.align=e[12].align),n&324&&(i.height=e[12].height),n&324&&(i.width=e[12].width),n&324&&(i.wrap=e[12].wrap),n&262469&&(i.$$scope={dirty:n,ctx:e}),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function ar(o){let l,t,e,n=o[1]&&o[5]!=="section"&&ot(o),i=me(o[8].columns.length>0?o[8].columns.sort(o[10]):o[2].filter(it).sort(o[11])),r=[];for(let f=0;fg(r[f],1,1,()=>{r[f]=null});return{c(){l=O("tr"),n&&n.c(),t=z();for(let f=0;f{n=null}),X()),a&453){i=me(f[8].columns.length>0?f[8].columns.sort(f[10]):f[2].filter(it).sort(f[11]));let s;for(s=0;so.show===!0;function sr(o,l,t){let e;const n=ll(Ze);Ye(o,n,b=>t(8,e=b));let{data:i=void 0}=l,{rowNumbers:r=void 0}=l,{columnSummary:u=void 0}=l,{rowColor:f=void 0}=l,{fontColor:a=void 0}=l,{groupType:s=void 0}=l,{finalColumnOrder:c=void 0}=l,{compact:d=void 0}=l;const h=(b,y)=>c.indexOf(b.id)-c.indexOf(y.id),S=(b,y)=>c.indexOf(b.id)-c.indexOf(y.id);return o.$$set=b=>{"data"in b&&t(0,i=b.data),"rowNumbers"in b&&t(1,r=b.rowNumbers),"columnSummary"in b&&t(2,u=b.columnSummary),"rowColor"in b&&t(3,f=b.rowColor),"fontColor"in b&&t(4,a=b.fontColor),"groupType"in b&&t(5,s=b.groupType),"finalColumnOrder"in b&&t(6,c=b.finalColumnOrder),"compact"in b&&t(7,d=b.compact)},[i,r,u,f,a,s,c,d,e,n,h,S]}class cr extends ye{constructor(l){super(),Se(this,l,sr,ar,Ce,{data:0,rowNumbers:1,columnSummary:2,rowColor:3,fontColor:4,groupType:5,finalColumnOrder:6,compact:7})}}function ft(o,l,t){var f,a;const e=o.slice();e[13]=l[t];const n=Ue(e[13],e[2]);e[14]=n;const i=e[13].fmt?Oe(e[13].fmt,(f=e[14].format)==null?void 0:f.valueType):e[14].format;e[15]=i;const r=e[13].subtotalFmt?Oe(e[13].subtotalFmt):e[13].totalFmt?Oe(e[13].totalFmt):e[15];e[16]=r;const u=((a=e[16])==null?void 0:a.valueType)==="date"?"":e[16];return e[17]=u,e}function mr(o){let l;return{c(){l=te(o[0])},l(t){l=ne(t,o[0])},m(t,e){k(t,l,e)},p(t,e){e&1&&ce(l,t[0])},i:x,o:x,d(t){t&&_(l)}}}function dr(o){let l,t,e,n;const i=[hr,_r],r=[];function u(f,a){return f[13].contentType==="delta"?0:1}return l=u(o),t=r[l]=i[l](o),{c(){t.c(),e=L()},l(f){t.l(f),e=L()},m(f,a){r[l].m(f,a),k(f,e,a),n=!0},p(f,a){let s=l;l=u(f),l===s?r[l].p(f,a):(W(),g(r[s],1,1,()=>{r[s]=null}),X(),t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e))},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),r[l].d(f)}}}function _r(o){let l=we(ze(o[1],o[13].id,o[13].totalAgg,o[14].type,o[13].weightCol),o[17],o[14].columnUnitSummary)+"",t;return{c(){t=te(l)},l(e){t=ne(e,l)},m(e,n){k(e,t,n)},p(e,n){n&646&&l!==(l=we(ze(e[1],e[13].id,e[13].totalAgg,e[14].type,e[13].weightCol),e[17],e[14].columnUnitSummary)+"")&&ce(t,l)},i:x,o:x,d(e){e&&_(t)}}}function hr(o){let l,t;return l=new pl({props:{value:ze(o[1],o[13].id,o[13].totalAgg,o[14].type,o[13].weightCol),downIsGood:o[13].downIsGood,format_object:o[15],columnUnitSummary:o[14].columnUnitSummary,showValue:o[13].showValue,showSymbol:o[13].deltaSymbol,align:o[13].align,fontClass:"font-medium text-[9.25pt]",neutralMin:o[13].neutralMin,neutralMax:o[13].neutralMax,chip:o[13].chip}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&646&&(i.value=ze(e[1],e[13].id,e[13].totalAgg,e[14].type,e[13].weightCol)),n&644&&(i.downIsGood=e[13].downIsGood),n&644&&(i.format_object=e[15]),n&644&&(i.columnUnitSummary=e[14].columnUnitSummary),n&644&&(i.showValue=e[13].showValue),n&644&&(i.showSymbol=e[13].deltaSymbol),n&644&&(i.align=e[13].align),n&644&&(i.neutralMin=e[13].neutralMin),n&644&&(i.neutralMax=e[13].neutralMax),n&644&&(i.chip=e[13].chip),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function gr(o){let l,t,e,n;const i=[dr,mr],r=[];function u(f,a){return f[13].id!==f[4]?0:f[5]==="section"?1:-1}return~(l=u(o))&&(t=r[l]=i[l](o)),{c(){t&&t.c(),e=z()},l(f){t&&t.l(f),e=Q(f)},m(f,a){~l&&r[l].m(f,a),k(f,e,a),n=!0},p(f,a){let s=l;l=u(f),l===s?~l&&r[l].p(f,a):(t&&(W(),g(r[s],1,1,()=>{r[s]=null}),X()),~l?(t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e)):t=null)},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),~l&&r[l].d(f)}}}function ut(o){let l,t;return l=new Qe({props:{class:o[14].type+" font-medium border-t-[1px] border-t-gray-300",compact:o[8],align:o[13].align,$$slots:{default:[gr]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&644&&(i.class=e[14].type+" font-medium border-t-[1px] border-t-gray-300"),n&256&&(i.compact=e[8]),n&644&&(i.align=e[13].align),n&1049271&&(i.$$scope={dirty:n,ctx:e}),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function br(o){let l,t,e=me(o[9].columns.length>0?o[9].columns.sort(o[11]):o[2].filter(at).sort(o[12])),n=[];for(let r=0;rg(n[r],1,1,()=>{n[r]=null});return{c(){l=O("tr");for(let r=0;r0?r[9].columns.sort(r[11]):r[2].filter(at).sort(r[12]));let f;for(f=0;fo.show===!0;function kr(o,l,t){let e;const n=ll(Ze);Ye(o,n,y=>t(9,e=y));let{groupName:i=void 0}=l,{currentGroupData:r=void 0}=l,{columnSummary:u=void 0}=l,{rowColor:f="var(--grey-100)"}=l,{groupBy:a=void 0}=l,{groupType:s=void 0}=l,{fontColor:c=void 0}=l,{finalColumnOrder:d=void 0}=l,{compact:h=void 0}=l;const S=(y,M)=>d.indexOf(y.id)-d.indexOf(M.id),b=(y,M)=>d.indexOf(y.id)-d.indexOf(M.id);return o.$$set=y=>{"groupName"in y&&t(0,i=y.groupName),"currentGroupData"in y&&t(1,r=y.currentGroupData),"columnSummary"in y&&t(2,u=y.columnSummary),"rowColor"in y&&t(3,f=y.rowColor),"groupBy"in y&&t(4,a=y.groupBy),"groupType"in y&&t(5,s=y.groupType),"fontColor"in y&&t(6,c=y.fontColor),"finalColumnOrder"in y&&t(7,d=y.finalColumnOrder),"compact"in y&&t(8,h=y.compact)},[i,r,u,f,a,s,c,d,h,e,n,S,b]}class pr extends ye{constructor(l){super(),Se(this,l,kr,br,Ce,{groupName:0,currentGroupData:1,columnSummary:2,rowColor:3,groupBy:4,groupType:5,fontColor:6,finalColumnOrder:7,compact:8})}}function wr(o){let l,t;return l=new qe({props:{src:to,class:"w-3 h-3 inline mb-0.5"}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Cr(o){let l,t;return l=new qe({props:{src:no,class:"w-3 h-3 inline mb-0.5"}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function yr(o){let l,t,e,n;const i=[Cr,wr],r=[];function u(f,a){return f[0]?0:1}return l=u(o),t=r[l]=i[l](o),{c(){t.c(),e=L()},l(f){t.l(f),e=L()},m(f,a){r[l].m(f,a),k(f,e,a),n=!0},p(f,[a]){let s=l;l=u(f),l!==s&&(W(),g(r[s],1,1,()=>{r[s]=null}),X(),t=r[l],t||(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e))},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),r[l].d(f)}}}function Sr(o,l,t){let{ascending:e}=l;return o.$$set=n=>{"ascending"in n&&t(0,e=n.ascending)},[e]}class gn extends ye{constructor(l){super(),Se(this,l,Sr,yr,Ce,{ascending:0})}}function st(o,l,t){const e=o.slice();return e[15]=l[t],e}function ct(o,l,t){const e=o.slice();return e[15]=l[t],e}function mt(o,l,t){const e=o.slice();return e[15]=l[t],e}function Cl(o){const l=o.slice(),t=l[11].columns.map((e,n,i)=>{let r=n===0||e.colGroup!==i[n-1].colGroup,u=1;if(e.colGroup)for(let f=n+1;f0&&_t(o);return{c(){t&&t.c(),l=L()},l(e){t&&t.l(e),l=L()},m(e,n){t&&t.m(e,n),k(e,l,n)},p(e,n){e[20].length>0?t?t.p(e,n):(t=_t(e),t.c(),t.m(l.parentNode,l)):t&&(t.d(1),t=null)},d(e){e&&_(l),t&&t.d(e)}}}function _t(o){let l,t,e=o[0]&&ht(o),n=me(o[20]),i=[];for(let r=0;rg(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;rg(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r{c=null}),X()),(!f||h&1048&&u!==(u=o[15].type+" "+(o[10]?"text-xs py-[1px] px-[4px]":"py-[2px] px-[8px]")+" svelte-1vzwapn"))&&p(l,"class",u),h&4&&E(l,"color",o[2]),h&2&&E(l,"background-color",o[1]),h&32&&E(l,"cursor",o[5]?"pointer":"auto"),h&512&&E(l,"white-space",o[9]?"normal":"nowrap")},i(d){f||(m(c),f=!0)},o(d){g(c),f=!1},d(d){d&&_(l),c&&c.d(),a=!1,s()}}}function wt(o){let l,t;return l=new gn({props:{ascending:o[8].ascending}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&256&&(i.ascending=e[8].ascending),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Ct(o){let l,t=(o[15].title?o[15].title:o[7]?Ue(o[15],o[4]).title:Ue(o[15],o[4]).id)+"",e,n,i,r,u,f,a,s=o[8].col===o[15].id&&wt(o);return{c(){l=O("th"),e=te(t),n=z(),s&&s.c(),i=z(),this.h()},l(c){l=I(c,"TH",{class:!0});var d=F(l);e=ne(d,t),n=Q(d),s&&s.l(d),i=Q(d),d.forEach(_),this.h()},h(){p(l,"class",r=Ue(o[15],o[4]).type+" "+(o[10]?"text-xs py-[1px] px-[4px]":"py-[2px] px-[8px]")+" svelte-1vzwapn"),E(l,"text-align",o[15].align),E(l,"color",o[2]),E(l,"background-color",o[1]),E(l,"cursor",o[5]?"pointer":"auto"),E(l,"white-space",o[15].wrapTitle||o[9]?"normal":"nowrap"),E(l,"vertical-align","bottom")},m(c,d){k(c,l,d),T(l,e),T(l,n),s&&s.m(l,null),T(l,i),u=!0,f||(a=pe(l,"click",function(){_l(o[5]?o[6](o[15].id):"")&&(o[5]?o[6](o[15].id):"").apply(this,arguments)}),f=!0)},p(c,d){o=c,(!u||d&2200)&&t!==(t=(o[15].title?o[15].title:o[7]?Ue(o[15],o[4]).title:Ue(o[15],o[4]).id)+"")&&ce(e,t),o[8].col===o[15].id?s?(s.p(o,d),d&2312&&m(s,1)):(s=wt(o),s.c(),m(s,1),s.m(l,i)):s&&(W(),g(s,1,1,()=>{s=null}),X()),(!u||d&3096&&r!==(r=Ue(o[15],o[4]).type+" "+(o[10]?"text-xs py-[1px] px-[4px]":"py-[2px] px-[8px]")+" svelte-1vzwapn"))&&p(l,"class",r),d&2056&&E(l,"text-align",o[15].align),d&4&&E(l,"color",o[2]),d&2&&E(l,"background-color",o[1]),d&32&&E(l,"cursor",o[5]?"pointer":"auto"),d&2568&&E(l,"white-space",o[15].wrapTitle||o[9]?"normal":"nowrap")},i(c){u||(m(s),u=!0)},o(c){g(s),u=!1},d(c){c&&_(l),s&&s.d(),f=!1,a()}}}function Or(o){let l,t,e,n,i,r,u,f=o[11].columns.length>0&&dt(Cl(o)),a=o[0]&&bt(o);const s=[Mr,Er],c=[];function d(h,S){return h[11].columns.length>0?0:1}return i=d(o),r=c[i]=s[i](o),{c(){l=O("thead"),f&&f.c(),t=z(),e=O("tr"),a&&a.c(),n=z(),r.c(),this.h()},l(h){l=I(h,"THEAD",{});var S=F(l);f&&f.l(S),t=Q(S),e=I(S,"TR",{class:!0});var b=F(e);a&&a.l(b),n=Q(b),r.l(b),b.forEach(_),S.forEach(_),this.h()},h(){p(e,"class","border-b border-gray-600")},m(h,S){k(h,l,S),f&&f.m(l,null),T(l,t),T(l,e),a&&a.m(e,null),T(e,n),c[i].m(e,null),u=!0},p(h,[S]){h[11].columns.length>0?f?f.p(Cl(h),S):(f=dt(Cl(h)),f.c(),f.m(l,t)):f&&(f.d(1),f=null),h[0]?a?a.p(h,S):(a=bt(h),a.c(),a.m(e,n)):a&&(a.d(1),a=null);let b=i;i=d(h),i===b?c[i].p(h,S):(W(),g(c[b],1,1,()=>{c[b]=null}),X(),r=c[i],r?r.p(h,S):(r=c[i]=s[i](h),r.c()),m(r,1),r.m(e,null))},i(h){u||(m(r),u=!0)},o(h){g(r),u=!1},d(h){h&&_(l),f&&f.d(),a&&a.d(),c[i].d()}}}const yt=o=>o.show===!0;function Ir(o,l,t){let e;const n=ll(Ze);Ye(o,n,B=>t(11,e=B));let{rowNumbers:i=void 0}=l,{headerColor:r=void 0}=l,{headerFontColor:u=void 0}=l,{finalColumnOrder:f=void 0}=l,{columnSummary:a=void 0}=l,{sortable:s=void 0}=l,{sort:c=void 0}=l,{formatColumnTitles:d=void 0}=l,{sortBy:h=void 0}=l,{wrapTitles:S=void 0}=l,{compact:b=void 0}=l;const y=(B,P)=>f.indexOf(B.id)-f.indexOf(P.id),M=(B,P)=>f.indexOf(B.id)-f.indexOf(P.id);return o.$$set=B=>{"rowNumbers"in B&&t(0,i=B.rowNumbers),"headerColor"in B&&t(1,r=B.headerColor),"headerFontColor"in B&&t(2,u=B.headerFontColor),"finalColumnOrder"in B&&t(3,f=B.finalColumnOrder),"columnSummary"in B&&t(4,a=B.columnSummary),"sortable"in B&&t(5,s=B.sortable),"sort"in B&&t(6,c=B.sort),"formatColumnTitles"in B&&t(7,d=B.formatColumnTitles),"sortBy"in B&&t(8,h=B.sortBy),"wrapTitles"in B&&t(9,S=B.wrapTitles),"compact"in B&&t(10,b=B.compact)},[i,r,u,f,a,s,c,d,h,S,b,e,n,y,M]}class Dr extends ye{constructor(l){super(),Se(this,l,Ir,Or,Ce,{rowNumbers:0,headerColor:1,headerFontColor:2,finalColumnOrder:3,columnSummary:4,sortable:5,sort:6,formatColumnTitles:7,sortBy:8,wrapTitles:9,compact:10})}}function Br(o){let l,t,e;return{c(){l=O("span"),t=Ll("svg"),e=Ll("path"),this.h()},l(n){l=I(n,"SPAN",{"aria-expanded":!0,class:!0});var i=F(l);t=Pl(i,"svg",{viewBox:!0,width:!0,height:!0,class:!0});var r=F(t);e=Pl(r,"path",{fill:!0,"fill-rule":!0,d:!0}),F(e).forEach(_),r.forEach(_),i.forEach(_),this.h()},h(){p(e,"fill",o[1]),p(e,"fill-rule","evenodd"),p(e,"d","M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z"),p(t,"viewBox","0 0 16 16"),p(t,"width",o[2]),p(t,"height",o[2]),p(t,"class","svelte-c6mrxw"),p(l,"aria-expanded",o[0]),p(l,"class","inline-flex svelte-c6mrxw")},m(n,i){k(n,l,i),T(l,t),T(t,e)},p(n,[i]){i&2&&p(e,"fill",n[1]),i&4&&p(t,"width",n[2]),i&4&&p(t,"height",n[2]),i&1&&p(l,"aria-expanded",n[0])},i:x,o:x,d(n){n&&_(l)}}}function Lr(o,l,t){let{toggled:e=!1}=l,{color:n="#2d2d2d"}=l,{size:i=10}=l;return o.$$set=r=>{"toggled"in r&&t(0,e=r.toggled),"color"in r&&t(1,n=r.color),"size"in r&&t(2,i=r.size)},[e,n,i]}class Pr extends ye{constructor(l){super(),Se(this,l,Lr,Br,Ce,{toggled:0,color:1,size:2})}}function St(o,l,t){var f,a;const e=o.slice();e[16]=l[t],e[22]=t;const n=Ue(e[16],e[3]);e[17]=n;const i=e[16].fmt?Oe(e[16].fmt,(f=e[17].format)==null?void 0:f.valueType):e[17].format;e[18]=i;const r=e[16].subtotalFmt?Oe(e[16].subtotalFmt):e[16].totalFmt?Oe(e[16].totalFmt):e[18];e[19]=r;const u=((a=e[19])==null?void 0:a.valueType)==="date"?"":e[19];return e[20]=u,e}function Fr(o){let l,t;return l=new Qe({}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p:x,i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Gr(o){let l,t;return l=new Qe({props:{class:o[17].type+" font-medium",compact:o[8],align:o[16].align,$$slots:{default:[qr]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&648&&(i.class=e[17].type+" font-medium"),n&256&&(i.compact=e[8]),n&648&&(i.align=e[16].align),n&8389258&&(i.$$scope={dirty:n,ctx:e}),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Ar(o){let l,t;return l=new Qe({props:{class:"font-medium py-[3px]",compact:o[8],colSpan:o[4]?2:1,paddingLeft:"1px",$$slots:{default:[zr]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&256&&(i.compact=e[8]),n&16&&(i.colSpan=e[4]?2:1),n&8388613&&(i.$$scope={dirty:n,ctx:e}),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Rr(o){let l=o[16].totalAgg+"",t;return{c(){t=te(l)},l(e){t=ne(e,l)},m(e,n){k(e,t,n)},p(e,n){n&648&&l!==(l=e[16].totalAgg+"")&&ce(t,l)},i:x,o:x,d(e){e&&_(t)}}}function Ur(o){let l,t,e,n;const i=[jr,Vr],r=[];function u(f,a){return f[16].contentType==="delta"?0:1}return l=u(o),t=r[l]=i[l](o),{c(){t.c(),e=L()},l(f){t.l(f),e=L()},m(f,a){r[l].m(f,a),k(f,e,a),n=!0},p(f,a){let s=l;l=u(f),l===s?r[l].p(f,a):(W(),g(r[s],1,1,()=>{r[s]=null}),X(),t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e))},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),r[l].d(f)}}}function Vr(o){let l=we(ze(o[1],o[16].id,o[16].totalAgg,o[17].type,o[16].weightCol),o[20],o[17].columnUnitSummary)+"",t;return{c(){t=te(l)},l(e){t=ne(e,l)},m(e,n){k(e,t,n)},p(e,n){n&650&&l!==(l=we(ze(e[1],e[16].id,e[16].totalAgg,e[17].type,e[16].weightCol),e[20],e[17].columnUnitSummary)+"")&&ce(t,l)},i:x,o:x,d(e){e&&_(t)}}}function jr(o){let l,t;return l=new pl({props:{value:ze(o[1],o[16].id,o[16].totalAgg,o[17].type,o[16].weightCol),downIsGood:o[16].downIsGood,format_object:o[20],columnUnitSummary:o[17].columnUnitSummary,showValue:o[16].showValue,showSymbol:o[16].deltaSymbol,align:o[16].align,fontClass:"font-medium text-[9.25pt]",neutralMin:o[16].neutralMin,neutralMax:o[16].neutralMax,chip:o[16].chip}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n&650&&(i.value=ze(e[1],e[16].id,e[16].totalAgg,e[17].type,e[16].weightCol)),n&648&&(i.downIsGood=e[16].downIsGood),n&648&&(i.format_object=e[20]),n&648&&(i.columnUnitSummary=e[17].columnUnitSummary),n&648&&(i.showValue=e[16].showValue),n&648&&(i.showSymbol=e[16].deltaSymbol),n&648&&(i.align=e[16].align),n&648&&(i.neutralMin=e[16].neutralMin),n&648&&(i.neutralMax=e[16].neutralMax),n&648&&(i.chip=e[16].chip),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function qr(o){let l,t,e,n,i;const r=[Ur,Rr],u=[];function f(a,s){return s&648&&(l=null),l==null&&(l=!!([void 0,"sum","mean","median","min","max","weightedMean","count","countDistinct"].includes(a[16].totalAgg)||a[16].subtotalFmt)),l?0:1}return t=f(o,-1),e=u[t]=r[t](o),{c(){e.c(),n=z()},l(a){e.l(a),n=Q(a)},m(a,s){u[t].m(a,s),k(a,n,s),i=!0},p(a,s){let c=t;t=f(a,s),t===c?u[t].p(a,s):(W(),g(u[c],1,1,()=>{u[c]=null}),X(),e=u[t],e?e.p(a,s):(e=u[t]=r[t](a),e.c()),m(e,1),e.m(n.parentNode,n))},i(a){i||(m(e),i=!0)},o(a){g(e),i=!1},d(a){a&&_(n),u[t].d(a)}}}function zr(o){let l,t,e,n,i,r,u;return e=new Pr({props:{toggled:o[2]}}),{c(){l=O("div"),t=O("span"),A(e.$$.fragment),n=z(),i=te(o[0]),r=z(),this.h()},l(f){l=I(f,"DIV",{class:!0});var a=F(l);t=I(a,"SPAN",{class:!0});var s=F(t);R(e.$$.fragment,s),s.forEach(_),n=Q(a),i=ne(a,o[0]),a.forEach(_),r=Q(f),this.h()},h(){p(t,"class","inline-flex print-hidden chevron svelte-bqpzbr"),p(l,"class","items-center gap-2 align-top")},m(f,a){k(f,l,a),T(l,t),U(e,t,null),T(l,n),T(l,i),k(f,r,a),u=!0},p(f,a){const s={};a&4&&(s.toggled=f[2]),e.$set(s),(!u||a&1)&&ce(i,f[0])},i(f){u||(m(e.$$.fragment,f),u=!0)},o(f){g(e.$$.fragment,f),u=!1},d(f){f&&(_(l),_(r)),V(e)}}}function Nt(o){let l,t,e,n;const i=[Ar,Gr,Fr],r=[];function u(f,a){return f[22]===0?0:f[6]?1:2}return l=u(o),t=r[l]=i[l](o),{c(){t.c(),e=L()},l(f){t.l(f),e=L()},m(f,a){r[l].m(f,a),k(f,e,a),n=!0},p(f,a){let s=l;l=u(f),l===s?r[l].p(f,a):(W(),g(r[s],1,1,()=>{r[s]=null}),X(),t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e))},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),r[l].d(f)}}}function Qr(o){let l,t,e,n,i=me(o[9].columns.length>0?o[9].columns.sort(o[12]):o[3].filter(Tt).sort(o[13])),r=[];for(let f=0;fg(r[f],1,1,()=>{r[f]=null});return{c(){l=O("tr");for(let f=0;f0?f[9].columns.sort(f[12]):f[3].filter(Tt).sort(f[13]));let s;for(s=0;so.show===!0;function Hr(o,l,t){let e;const n=ll(Ze);Ye(o,n,P=>t(9,e=P));let{groupName:i}=l,{currentGroupData:r}=l,{toggled:u}=l,{columnSummary:f}=l,{rowNumbers:a}=l,{rowColor:s=void 0}=l,{subtotals:c=!0}=l,{finalColumnOrder:d=void 0}=l,{compact:h=void 0}=l;const S=Un();function b(){S("toggle",{groupName:i})}const y=(P,q)=>d.indexOf(P.id)-d.indexOf(q.id),M=(P,q)=>d.indexOf(P.id)-d.indexOf(q.id),B=P=>P.key==="Enter"&&b();return o.$$set=P=>{"groupName"in P&&t(0,i=P.groupName),"currentGroupData"in P&&t(1,r=P.currentGroupData),"toggled"in P&&t(2,u=P.toggled),"columnSummary"in P&&t(3,f=P.columnSummary),"rowNumbers"in P&&t(4,a=P.rowNumbers),"rowColor"in P&&t(5,s=P.rowColor),"subtotals"in P&&t(6,c=P.subtotals),"finalColumnOrder"in P&&t(7,d=P.finalColumnOrder),"compact"in P&&t(8,h=P.compact)},[i,r,u,f,a,s,c,d,h,e,n,b,y,M,B]}class Wr extends ye{constructor(l){super(),Se(this,l,Hr,Qr,Ce,{groupName:0,currentGroupData:1,toggled:2,columnSummary:3,rowNumbers:4,rowColor:5,subtotals:6,finalColumnOrder:7,compact:8})}}function vt(o){let l,t,e,n="Fullscreen",i,r,u,f,a,s;return r=new qe({props:{class:"w-3 h-3",src:ao}}),{c(){l=O("div"),t=O("button"),e=O("span"),e.textContent=n,i=z(),A(r.$$.fragment),this.h()},l(c){l=I(c,"DIV",{});var d=F(l);t=I(d,"BUTTON",{type:!0,"aria-label":!0,class:!0});var h=F(t);e=I(h,"SPAN",{"data-svelte-h":!0}),el(e)!=="svelte-qzhydn"&&(e.textContent=n),i=Q(h),R(r.$$.fragment,h),h.forEach(_),d.forEach(_),this.h()},h(){p(t,"type","button"),p(t,"aria-label","Enter Fullscreen"),p(t,"class","svelte-p80uux")},m(c,d){k(c,l,d),T(l,t),T(t,e),T(t,i),U(r,t,null),f=!0,a||(s=pe(t,"click",o[1]),a=!0)},i(c){f||(m(r.$$.fragment,c),c&&hl(()=>{f&&(u||(u=xe(l,Gl,{duration:200},!0)),u.run(1))}),f=!0)},o(c){g(r.$$.fragment,c),c&&(u||(u=xe(l,Gl,{duration:200},!1)),u.run(0)),f=!1},d(c){c&&_(l),V(r),c&&u&&u.end(),a=!1,s()}}}function Xr(o){let l,t,e=o[0]&&vt(o);return{c(){e&&e.c(),l=L()},l(n){e&&e.l(n),l=L()},m(n,i){e&&e.m(n,i),k(n,l,i),t=!0},p(n,[i]){n[0]?e?i&1&&m(e,1):(e=vt(n),e.c(),m(e,1),e.m(l.parentNode,l)):e&&(W(),g(e,1,1,()=>{e=null}),X())},i(n){t||(m(e),t=!0)},o(n){g(e),t=!1},d(n){n&&_(l),e&&e.d(n)}}}function Jr(o,l,t){let{display:e}=l;function n(i){Vn.call(this,o,i)}return o.$$set=i=>{"display"in i&&t(0,e=i.display)},[e,n]}class bn extends ye{constructor(l){super(),Se(this,l,Jr,Xr,Ce,{display:0})}}function Kr(o,l,t){let e,n,i=ll(Ze);Ye(o,i,N=>t(35,n=N));let r,{id:u}=l;function f(){try{if(!Object.keys(n.data[0]).includes(u))throw r="Error in table: "+u+" does not exist in the dataset",new Error(r)}catch(N){if(r=N.message,kl)throw r}}let{title:a=void 0}=l,{align:s=void 0}=l;s==="centre"&&(s="center");let{wrap:c=!1}=l,{wrapTitle:d=!1}=l,{contentType:h=void 0}=l,{height:S=void 0}=l,{width:b=void 0}=l,{alt:y=void 0}=l,{openInNewTab:M=!1}=l,{linkLabel:B=void 0}=l,{fmt:P=void 0}=l,{totalAgg:q=void 0}=l,{totalFmt:re=void 0}=l,{weightCol:j=void 0}=l,{subtotalFmt:ie=void 0}=l,{colorMax:D=void 0}=l,{colorMin:J=void 0}=l,{colorMid:G=void 0}=l,{colorBreakpoints:K=void 0}=l,{scaleColor:_e="green"}=l,{scaleColumn:Y=void 0}=l,Ne={green:["white","hsla(129, 33%, 57%,1)"],red:["white","hsla(0, 56%, 56%,1)"],blue:["white","hsla(198, 56%, 56%,1)"]},ae;_e instanceof Array?ae=_e:(ae=Ne[_e],ae==null&&(ae=["white",_e]));let{downIsGood:Te=!1}=l,{showValue:oe=!0}=l,{deltaSymbol:w=!0}=l,{neutralMin:v=0}=l,{neutralMax:Z=0}=l,{chip:se=!1}=l,{colGroup:be=void 0}=l,{fmtColumn:fe=void 0}=l,{redNegatives:le=!1}=l;const He=()=>{i.update(N=>{const ue=N.columns.findIndex(de=>de.id===u);return ue===-1?N.columns.push(e):N.columns=[...N.columns.slice(0,ue),e,...N.columns.slice(ue+1)],N})};return o.$$set=N=>{"id"in N&&t(10,u=N.id),"title"in N&&t(11,a=N.title),"align"in N&&t(1,s=N.align),"wrap"in N&&t(2,c=N.wrap),"wrapTitle"in N&&t(3,d=N.wrapTitle),"contentType"in N&&t(12,h=N.contentType),"height"in N&&t(13,S=N.height),"width"in N&&t(14,b=N.width),"alt"in N&&t(15,y=N.alt),"openInNewTab"in N&&t(4,M=N.openInNewTab),"linkLabel"in N&&t(16,B=N.linkLabel),"fmt"in N&&t(17,P=N.fmt),"totalAgg"in N&&t(18,q=N.totalAgg),"totalFmt"in N&&t(19,re=N.totalFmt),"weightCol"in N&&t(20,j=N.weightCol),"subtotalFmt"in N&&t(21,ie=N.subtotalFmt),"colorMax"in N&&t(22,D=N.colorMax),"colorMin"in N&&t(23,J=N.colorMin),"colorMid"in N&&t(24,G=N.colorMid),"colorBreakpoints"in N&&t(25,K=N.colorBreakpoints),"scaleColor"in N&&t(26,_e=N.scaleColor),"scaleColumn"in N&&t(27,Y=N.scaleColumn),"downIsGood"in N&&t(5,Te=N.downIsGood),"showValue"in N&&t(6,oe=N.showValue),"deltaSymbol"in N&&t(7,w=N.deltaSymbol),"neutralMin"in N&&t(28,v=N.neutralMin),"neutralMax"in N&&t(29,Z=N.neutralMax),"chip"in N&&t(8,se=N.chip),"colGroup"in N&&t(30,be=N.colGroup),"fmtColumn"in N&&t(31,fe=N.fmtColumn),"redNegatives"in N&&t(9,le=N.redNegatives)},o.$$.update=()=>{o.$$.dirty[0]&4&&t(2,c=c==="true"||c===!0),o.$$.dirty[0]&8&&t(3,d=d==="true"||d===!0),o.$$.dirty[0]&16&&t(4,M=M==="true"||M===!0),o.$$.dirty[0]&32&&t(5,Te=Te==="true"||Te===!0),o.$$.dirty[0]&64&&t(6,oe=oe==="true"||oe===!0),o.$$.dirty[0]&128&&t(7,w=w==="true"||w===!0),o.$$.dirty[0]&256&&t(8,se=se==="true"||se===!0),o.$$.dirty[0]&512&&t(9,le=le==="true"||le===!0),o.$$.dirty[0]&2147483646|o.$$.dirty[1]&3&&t(33,e={id:u,title:a,align:s,wrap:c,wrapTitle:d,contentType:h,height:S,width:b,alt:y,openInNewTab:M,linkLabel:B,fmt:P,fmtColumn:fe,totalAgg:q,totalFmt:re,subtotalFmt:ie,weightCol:j,downIsGood:Te,deltaSymbol:w,chip:se,neutralMin:v,neutralMax:Z,showValue:oe,colorMax:D,colorMin:J,scaleColor:_e,scaleColumn:Y,colGroup:be,colorMid:G,colorBreakpoints:K,colorPalette:ae,redNegatives:le}),o.$$.dirty[1]&4&&He()},f(),[i,s,c,d,M,Te,oe,w,se,le,u,a,h,S,b,y,B,P,q,re,j,ie,D,J,G,K,_e,Y,v,Z,be,fe,ae,e]}class Yr extends ye{constructor(l){super(),Se(this,l,Kr,null,Ce,{id:10,title:11,align:1,wrap:2,wrapTitle:3,contentType:12,height:13,width:14,alt:15,openInNewTab:4,linkLabel:16,fmt:17,totalAgg:18,totalFmt:19,weightCol:20,subtotalFmt:21,colorMax:22,colorMin:23,colorMid:24,colorBreakpoints:25,scaleColor:26,scaleColumn:27,downIsGood:5,showValue:6,deltaSymbol:7,neutralMin:28,neutralMax:29,chip:8,colGroup:30,fmtColumn:31,redNegatives:9},null,[-1,-1])}}function Et(o,l,t){const e=o.slice();return e[78]=l[t],e}function Mt(o,l,t){const e=o.slice();return e[81]=l[t],e}function Ot(o,l,t){const e=o.slice();return e[78]=l[t],e}function It(o){o[86]=23;const t=279;o[87]=t}function Dt(o,l,t){const e=o.slice();return e[78]=l[t],e}function Bt(o){let l,t,e;function n(r){o[63](r)}let i={$$slots:{default:[$r]},$$scope:{ctx:o}};return o[48]!==void 0&&(i.open=o[48]),l=new mo({props:i}),Nl.push(()=>an(l,"open",n)),{c(){A(l.$$.fragment)},l(r){R(l.$$.fragment,r)},m(r,u){U(l,r,u),e=!0},p(r,u){const f={};u[1]&8652800|u[2]&16384&&(f.$$scope={dirty:u,ctx:r}),!t&&u[1]&131072&&(t=!0,f.open=r[48],fn(()=>t=!1)),l.$set(f)},i(r){e||(m(l.$$.fragment,r),e=!0)},o(r){g(l.$$.fragment,r),e=!1},d(r){V(l,r)}}}function Lt(o){let l,t;const e=[o[78]];let n={};for(let i=0;ig(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;rg(K[w],1,1,()=>{K[w]=null});let Y=o[4]&&Gt(o);f=new Dr({props:{rowNumbers:o[1],headerColor:o[23],headerFontColor:o[24],finalColumnOrder:De(o[42].columns.length>0?o[42].columns.map(Kt):Object.keys(o[0][0]),o[42].priorityColumns),columnSummary:o[30],compact:o[26],sortable:o[5],sort:o[41],formatColumnTitles:o[11],sortBy:o[35],wrapTitles:o[10]}}),s=new Tl({props:{data:o[34],$$slots:{skeleton:[ii],default:[ri]},$$scope:{ctx:o}}});const Ne=[ui,fi],ae=[];function Te(w,v){return w[28]&&w[37]>1?0:1}b=Te(o),y=ae[b]=Ne[b](o);let oe=o[3]&&Ht(o);return{c(){D&&D.c(),l=z(),J&&J.c(),t=z();for(let w=0;w{J=null}),X()),v[0]&1|v[1]&2048){G=me(w[42].columns.filter(Jt));let fe;for(fe=0;fe{Y=null}),X());const Z={};v[0]&2&&(Z.rowNumbers=w[1]),v[0]&8388608&&(Z.headerColor=w[23]),v[0]&16777216&&(Z.headerFontColor=w[24]),v[0]&1|v[1]&2048&&(Z.finalColumnOrder=De(w[42].columns.length>0?w[42].columns.map(Kt):Object.keys(w[0][0]),w[42].priorityColumns)),v[0]&1073741824&&(Z.columnSummary=w[30]),v[0]&67108864&&(Z.compact=w[26]),v[0]&32&&(Z.sortable=w[5]),v[1]&1024&&(Z.sort=w[41]),v[0]&2048&&(Z.formatColumnTitles=w[11]),v[1]&16&&(Z.sortBy=w[35]),v[0]&1024&&(Z.wrapTitles=w[10]),f.$set(Z);const se={};v[1]&8&&(se.data=w[34]),v[0]&1281352583|v[1]&10541|v[2]&16384&&(se.$$scope={dirty:v,ctx:w}),s.$set(se),v[0]&33554432&&E(r,"background-color",w[25]);let be=b;b=Te(w),b===be?ae[b].p(w,v):(W(),g(ae[be],1,1,()=>{ae[be]=null}),X(),y=ae[b],y?y.p(w,v):(y=ae[b]=Ne[b](w),y.c()),m(y,1),y.m(n,null)),w[3]?oe?(oe.p(w,v),v[0]&8&&m(oe,1)):(oe=Ht(w),oe.c(),m(oe,1),oe.m(P.parentNode,P)):oe&&(W(),g(oe,1,1,()=>{oe=null}),X())},i(w){if(!q){m(D,w),m(J);for(let v=0;v{q&&(M||(M=xe(n,ul,{},!0)),M.run(1))}),m(oe),q=!0}},o(w){g(D,w),g(J),K=K.filter(Boolean);for(let v=0;van(l,"value",n)),{c(){A(l.$$.fragment)},l(r){R(l.$$.fragment,r)},m(r,u){U(l,r,u),e=!0},p(r,u){const f={};!t&&u[1]&4&&(t=!0,f.value=r[33],fn(()=>t=!1)),l.$set(f)},i(r){e||(m(l.$$.fragment,r),e=!0)},o(r){g(l.$$.fragment,r),e=!1},d(r){V(l,r)}}}function li(o){let l,t;return l=new vl({props:{displayedData:o[36],rowShading:o[8],link:o[22],rowNumbers:o[1],rowLines:o[9],compact:o[26],index:o[31],columnSummary:o[30],finalColumnOrder:De(o[42].columns.length>0?o[42].columns.map(en):Object.keys(o[0][0]),o[42].priorityColumns)}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[1]&32&&(i.displayedData=e[36]),n[0]&256&&(i.rowShading=e[8]),n[0]&4194304&&(i.link=e[22]),n[0]&2&&(i.rowNumbers=e[1]),n[0]&512&&(i.rowLines=e[9]),n[0]&67108864&&(i.compact=e[26]),n[1]&1&&(i.index=e[31]),n[0]&1073741824&&(i.columnSummary=e[30]),n[0]&1|n[1]&2048&&(i.finalColumnOrder=De(e[42].columns.length>0?e[42].columns.map(en):Object.keys(e[0][0]),e[42].priorityColumns)),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function ti(o){let l,t,e=me(o[44]),n=[];for(let r=0;rg(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r0?o[42].columns.map($t):Object.keys(o[0][0]),o[42].priorityColumns)}});let i=o[2]&&At(o);return{c(){A(l.$$.fragment),t=z(),i&&i.c(),e=L()},l(r){R(l.$$.fragment,r),t=Q(r),i&&i.l(r),e=L()},m(r,u){U(l,r,u),k(r,t,u),i&&i.m(r,u),k(r,e,u),n=!0},p(r,u){const f={};u[0]&8192&&(f.groupColumn=r[13]),u[0]&16384&&(f.groupType=r[14]),u[1]&8448&&(f.rowSpan=r[39][r[81]].length),u[1]&8448&&(f.displayedData=r[39][r[81]]),u[0]&256&&(f.rowShading=r[8]),u[0]&4194304&&(f.link=r[22]),u[0]&2&&(f.rowNumbers=r[1]),u[0]&512&&(f.rowLines=r[9]),u[0]&67108864&&(f.compact=r[26]),u[1]&1&&(f.index=r[31]),u[0]&1073741824&&(f.columnSummary=r[30]),u[0]&65536&&(f.groupNamePosition=r[16]),u[0]&1|u[1]&2048&&(f.finalColumnOrder=De(r[42].columns.length>0?r[42].columns.map($t):Object.keys(r[0][0]),r[42].priorityColumns)),l.$set(f),r[2]?i?(i.p(r,u),u[0]&4&&m(i,1)):(i=At(r),i.c(),m(i,1),i.m(e.parentNode,e)):i&&(W(),g(i,1,1,()=>{i=null}),X())},i(r){n||(m(l.$$.fragment,r),m(i),n=!0)},o(r){g(l.$$.fragment,r),g(i),n=!1},d(r){r&&(_(t),_(e)),V(l,r),i&&i.d(r)}}}function oi(o){let l,t,e,n;l=new Wr({props:{groupName:o[81],currentGroupData:o[39][o[81]],toggled:o[27][o[81]],columnSummary:o[30],rowColor:o[15],rowNumbers:o[1],subtotals:o[2],compact:o[26],finalColumnOrder:De(o[42].columns.length>0?o[42].columns.map(Yt):Object.keys(o[0][0]),o[42].priorityColumns)}}),l.$on("toggle",o[53]);let i=o[27][o[81]]&&Rt(o);return{c(){A(l.$$.fragment),t=z(),i&&i.c(),e=L()},l(r){R(l.$$.fragment,r),t=Q(r),i&&i.l(r),e=L()},m(r,u){U(l,r,u),k(r,t,u),i&&i.m(r,u),k(r,e,u),n=!0},p(r,u){const f={};u[1]&8192&&(f.groupName=r[81]),u[1]&8448&&(f.currentGroupData=r[39][r[81]]),u[0]&134217728|u[1]&8192&&(f.toggled=r[27][r[81]]),u[0]&1073741824&&(f.columnSummary=r[30]),u[0]&32768&&(f.rowColor=r[15]),u[0]&2&&(f.rowNumbers=r[1]),u[0]&4&&(f.subtotals=r[2]),u[0]&67108864&&(f.compact=r[26]),u[0]&1|u[1]&2048&&(f.finalColumnOrder=De(r[42].columns.length>0?r[42].columns.map(Yt):Object.keys(r[0][0]),r[42].priorityColumns)),l.$set(f),r[27][r[81]]?i?(i.p(r,u),u[0]&134217728|u[1]&8192&&m(i,1)):(i=Rt(r),i.c(),m(i,1),i.m(e.parentNode,e)):i&&(W(),g(i,1,1,()=>{i=null}),X())},i(r){n||(m(l.$$.fragment,r),m(i),n=!0)},o(r){g(l.$$.fragment,r),g(i),n=!1},d(r){r&&(_(t),_(e)),V(l,r),i&&i.d(r)}}}function At(o){let l,t;return l=new pr({props:{groupName:o[81],currentGroupData:o[39][o[81]],columnSummary:o[30],rowColor:o[17],fontColor:o[18],groupType:o[14],groupBy:o[13],compact:o[26],finalColumnOrder:De(o[42].columns.length>0?o[42].columns.map(xt):Object.keys(o[0][0]),o[42].priorityColumns)}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[1]&8192&&(i.groupName=e[81]),n[1]&8448&&(i.currentGroupData=e[39][e[81]]),n[0]&1073741824&&(i.columnSummary=e[30]),n[0]&131072&&(i.rowColor=e[17]),n[0]&262144&&(i.fontColor=e[18]),n[0]&16384&&(i.groupType=e[14]),n[0]&8192&&(i.groupBy=e[13]),n[0]&67108864&&(i.compact=e[26]),n[0]&1|n[1]&2048&&(i.finalColumnOrder=De(e[42].columns.length>0?e[42].columns.map(xt):Object.keys(e[0][0]),e[42].priorityColumns)),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Rt(o){let l,t;return l=new vl({props:{displayedData:o[39][o[81]],groupType:o[14],rowShading:o[8],link:o[22],rowNumbers:o[1],rowLines:o[9],compact:o[26],index:o[31],columnSummary:o[30],grouped:!0,groupColumn:o[13],finalColumnOrder:De(o[42].columns.length>0?o[42].columns.map(Zt):Object.keys(o[0][0]),o[42].priorityColumns)}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[1]&8448&&(i.displayedData=e[39][e[81]]),n[0]&16384&&(i.groupType=e[14]),n[0]&256&&(i.rowShading=e[8]),n[0]&4194304&&(i.link=e[22]),n[0]&2&&(i.rowNumbers=e[1]),n[0]&512&&(i.rowLines=e[9]),n[0]&67108864&&(i.compact=e[26]),n[1]&1&&(i.index=e[31]),n[0]&1073741824&&(i.columnSummary=e[30]),n[0]&8192&&(i.groupColumn=e[13]),n[0]&1|n[1]&2048&&(i.finalColumnOrder=De(e[42].columns.length>0?e[42].columns.map(Zt):Object.keys(e[0][0]),e[42].priorityColumns)),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Ut(o){let l,t,e,n;const i=[oi,ni],r=[];function u(f,a){return f[14]==="accordion"?0:f[14]==="section"?1:-1}return~(l=u(o))&&(t=r[l]=i[l](o)),{c(){t&&t.c(),e=L()},l(f){t&&t.l(f),e=L()},m(f,a){~l&&r[l].m(f,a),k(f,e,a),n=!0},p(f,a){let s=l;l=u(f),l===s?~l&&r[l].p(f,a):(t&&(W(),g(r[s],1,1,()=>{r[s]=null}),X()),~l?(t=r[l],t?t.p(f,a):(t=r[l]=i[l](f),t.c()),m(t,1),t.m(e.parentNode,e)):t=null)},i(f){n||(m(t),n=!0)},o(f){g(t),n=!1},d(f){f&&_(e),~l&&r[l].d(f)}}}function Vt(o){let l,t;return l=new cr({props:{data:o[0],rowNumbers:o[1],columnSummary:o[30],rowColor:o[19],fontColor:o[20],groupType:o[14],compact:o[26],finalColumnOrder:De(o[42].columns.length>0?o[42].columns.map(ln):Object.keys(o[0][0]),o[42].priorityColumns)}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[0]&1&&(i.data=e[0]),n[0]&2&&(i.rowNumbers=e[1]),n[0]&1073741824&&(i.columnSummary=e[30]),n[0]&524288&&(i.rowColor=e[19]),n[0]&1048576&&(i.fontColor=e[20]),n[0]&16384&&(i.groupType=e[14]),n[0]&67108864&&(i.compact=e[26]),n[0]&1|n[1]&2048&&(i.finalColumnOrder=De(e[42].columns.length>0?e[42].columns.map(ln):Object.keys(e[0][0]),e[42].priorityColumns)),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function ri(o){let l,t,e,n,i;const r=[ti,li],u=[];function f(s,c){return s[13]&&s[39]&&s[33]===""?0:1}l=f(o),t=u[l]=r[l](o);let a=o[7]&&o[33]===""&&Vt(o);return{c(){t.c(),e=z(),a&&a.c(),n=L()},l(s){t.l(s),e=Q(s),a&&a.l(s),n=L()},m(s,c){u[l].m(s,c),k(s,e,c),a&&a.m(s,c),k(s,n,c),i=!0},p(s,c){let d=l;l=f(s),l===d?u[l].p(s,c):(W(),g(u[d],1,1,()=>{u[d]=null}),X(),t=u[l],t?t.p(s,c):(t=u[l]=r[l](s),t.c()),m(t,1),t.m(e.parentNode,e)),s[7]&&s[33]===""?a?(a.p(s,c),c[0]&128|c[1]&4&&m(a,1)):(a=Vt(s),a.c(),m(a,1),a.m(n.parentNode,n)):a&&(W(),g(a,1,1,()=>{a=null}),X())},i(s){i||(m(t),m(a),i=!0)},o(s){g(t),g(a),i=!1},d(s){s&&(_(e),_(n)),u[l].d(s),a&&a.d(s)}}}function ii(o){let l,t,e,n,i;return e=new Zn({}),{c(){l=O("tr"),t=O("td"),A(e.$$.fragment),this.h()},l(r){l=I(r,"TR",{class:!0});var u=F(l);t=I(u,"TD",{colspan:!0,class:!0});var f=F(t);R(e.$$.fragment,f),f.forEach(_),u.forEach(_),this.h()},h(){p(t,"colspan",n=o[34].columns.length),p(t,"class","h-32 svelte-fmobgf"),p(l,"class","svelte-fmobgf")},m(r,u){k(r,l,u),T(l,t),U(e,t,null),i=!0},p(r,u){(!i||u[1]&8&&n!==(n=r[34].columns.length))&&p(t,"colspan",n)},i(r){i||(m(e.$$.fragment,r),i=!0)},o(r){g(e.$$.fragment,r),i=!1},d(r){r&&_(l),V(e)}}}function fi(o){let l,t,e,n=o[6]&&jt(o),i=!o[21]&&qt(o);return{c(){l=O("div"),n&&n.c(),t=z(),i&&i.c(),this.h()},l(r){l=I(r,"DIV",{class:!0});var u=F(l);n&&n.l(u),t=Q(u),i&&i.l(u),u.forEach(_),this.h()},h(){p(l,"class","table-footer svelte-fmobgf")},m(r,u){k(r,l,u),n&&n.m(l,null),T(l,t),i&&i.m(l,null),e=!0},p(r,u){r[6]?n?(n.p(r,u),u[0]&64&&m(n,1)):(n=jt(r),n.c(),m(n,1),n.m(l,t)):n&&(W(),g(n,1,1,()=>{n=null}),X()),r[21]?i&&(W(),g(i,1,1,()=>{i=null}),X()):i?(i.p(r,u),u[0]&2097152&&m(i,1)):(i=qt(r),i.c(),m(i,1),i.m(l,null))},i(r){e||(m(n),m(i),e=!0)},o(r){g(n),g(i),e=!1},d(r){r&&_(l),n&&n.d(),i&&i.d()}}}function ui(o){let l,t,e,n,i,r,u,f,a,s,c,d,h,S,b,y,M,B=o[37].toLocaleString()+"",P,q,re,j=o[46].toLocaleString()+"",ie,D,J=o[45].toLocaleString()+"",G,K,_e,Y,Ne,ae,Te,oe,w,v,Z,se,be,fe,le,He,N;i=new qe({props:{src:oo}}),s=new qe({props:{src:ro,class:"h-[0.83em]"}}),ae=new qe({props:{src:io,class:"h-[0.83em]"}}),Z=new qe({props:{src:fo}});let ue=o[6]&&zt(o),de=!o[21]&&Qt(o);return{c(){l=O("div"),t=O("div"),e=O("button"),n=O("div"),A(i.$$.fragment),u=z(),f=O("button"),a=O("div"),A(s.$$.fragment),d=z(),h=O("span"),S=te(`Page
`),b=O("input"),y=te(`
/
`),M=O("span"),P=te(B),q=z(),re=O("span"),ie=te(j),D=te(" of "),G=te(J),K=te(" records"),_e=z(),Y=O("button"),Ne=O("div"),A(ae.$$.fragment),oe=z(),w=O("button"),v=O("div"),A(Z.$$.fragment),be=z(),ue&&ue.c(),fe=z(),de&&de.c(),this.h()},l(H){l=I(H,"DIV",{class:!0});var $=F(l);t=I($,"DIV",{class:!0});var Ie=F(t);e=I(Ie,"BUTTON",{"aria-label":!0,class:!0});var Le=F(e);n=I(Le,"DIV",{class:!0});var Ge=F(n);R(i.$$.fragment,Ge),Ge.forEach(_),Le.forEach(_),u=Q(Ie),f=I(Ie,"BUTTON",{"aria-label":!0,class:!0});var Ve=F(f);a=I(Ve,"DIV",{class:!0});var Ee=F(a);R(s.$$.fragment,Ee),Ee.forEach(_),Ve.forEach(_),d=Q(Ie),h=I(Ie,"SPAN",{class:!0});var Ae=F(h);S=ne(Ae,`Page
`),b=I(Ae,"INPUT",{class:!0,style:!0,type:!0,placeholder:!0}),y=ne(Ae,`
/
`),M=I(Ae,"SPAN",{class:!0});var ge=F(M);P=ne(ge,B),ge.forEach(_),Ae.forEach(_),q=Q(Ie),re=I(Ie,"SPAN",{class:!0});var je=F(re);ie=ne(je,j),D=ne(je," of "),G=ne(je,J),K=ne(je," records"),je.forEach(_),_e=Q(Ie),Y=I(Ie,"BUTTON",{"aria-label":!0,class:!0});var $e=F(Y);Ne=I($e,"DIV",{class:!0});var We=F(Ne);R(ae.$$.fragment,We),We.forEach(_),$e.forEach(_),oe=Q(Ie),w=I(Ie,"BUTTON",{"aria-label":!0,class:!0});var Xe=F(w);v=I(Xe,"DIV",{class:!0});var Pe=F(v);R(Z.$$.fragment,Pe),Pe.forEach(_),Xe.forEach(_),Ie.forEach(_),be=Q($),ue&&ue.l($),fe=Q($),de&&de.l($),$.forEach(_),this.h()},h(){p(n,"class","page-icon flex items-center svelte-fmobgf"),p(e,"aria-label","first-page"),p(e,"class","page-changer svelte-fmobgf"),e.disabled=r=o[38]===1,ke(e,"hovering",o[43]),p(a,"class","page-icon h-[0.83em] flex items-center svelte-fmobgf"),p(f,"aria-label","previous-page"),p(f,"class","page-changer svelte-fmobgf"),f.disabled=c=o[38]===1,ke(f,"hovering",o[43]),p(b,"class","page-input svelte-fmobgf"),E(b,"width",o[32]?o[51]:o[50]),p(b,"type","number"),p(b,"placeholder",o[38]),ke(b,"hovering",o[43]),ke(b,"error",o[32]>o[37]),p(M,"class","page-count ml-1 svelte-fmobgf"),p(h,"class","page-count svelte-fmobgf"),p(re,"class","print-page-count svelte-fmobgf"),p(Ne,"class","page-icon h-[0.83em] flex items-center svelte-fmobgf"),p(Y,"aria-label","next-page"),p(Y,"class","page-changer svelte-fmobgf"),Y.disabled=Te=o[38]===o[37],ke(Y,"hovering",o[43]),p(v,"class","page-icon flex items-center svelte-fmobgf"),p(w,"aria-label","last-page"),p(w,"class","page-changer svelte-fmobgf"),w.disabled=se=o[38]===o[37],ke(w,"hovering",o[43]),p(t,"class","page-labels mr-auto svelte-fmobgf"),p(l,"class","pagination svelte-fmobgf")},m(H,$){k(H,l,$),T(l,t),T(t,e),T(e,n),U(i,n,null),T(t,u),T(t,f),T(f,a),U(s,a,null),T(t,d),T(t,h),T(h,S),T(h,b),fl(b,o[32]),T(h,y),T(h,M),T(M,P),T(t,q),T(t,re),T(re,ie),T(re,D),T(re,G),T(re,K),T(t,_e),T(t,Y),T(Y,Ne),U(ae,Ne,null),T(t,oe),T(t,w),T(w,v),U(Z,v,null),T(l,be),ue&&ue.m(l,null),T(l,fe),de&&de.m(l,null),le=!0,He||(N=[pe(e,"click",o[65]),pe(f,"click",o[66]),pe(b,"input",o[67]),pe(b,"keyup",o[68]),pe(b,"change",o[69]),pe(Y,"click",o[70]),pe(w,"click",o[71])],He=!0)},p(H,$){(!le||$[1]&128&&r!==(r=H[38]===1))&&(e.disabled=r),(!le||$[1]&4096)&&ke(e,"hovering",H[43]),(!le||$[1]&128&&c!==(c=H[38]===1))&&(f.disabled=c),(!le||$[1]&4096)&&ke(f,"hovering",H[43]),(!le||$[1]&1572866)&&E(b,"width",H[32]?H[51]:H[50]),(!le||$[1]&128)&&p(b,"placeholder",H[38]),$[1]&2&&un(b.value)!==H[32]&&fl(b,H[32]),(!le||$[1]&4096)&&ke(b,"hovering",H[43]),(!le||$[1]&66)&&ke(b,"error",H[32]>H[37]),(!le||$[1]&64)&&B!==(B=H[37].toLocaleString()+"")&&ce(P,B),(!le||$[1]&32768)&&j!==(j=H[46].toLocaleString()+"")&&ce(ie,j),(!le||$[1]&16384)&&J!==(J=H[45].toLocaleString()+"")&&ce(G,J),(!le||$[1]&192&&Te!==(Te=H[38]===H[37]))&&(Y.disabled=Te),(!le||$[1]&4096)&&ke(Y,"hovering",H[43]),(!le||$[1]&192&&se!==(se=H[38]===H[37]))&&(w.disabled=se),(!le||$[1]&4096)&&ke(w,"hovering",H[43]),H[6]?ue?(ue.p(H,$),$[0]&64&&m(ue,1)):(ue=zt(H),ue.c(),m(ue,1),ue.m(l,fe)):ue&&(W(),g(ue,1,1,()=>{ue=null}),X()),H[21]?de&&(W(),g(de,1,1,()=>{de=null}),X()):de?(de.p(H,$),$[0]&2097152&&m(de,1)):(de=Qt(H),de.c(),m(de,1),de.m(l,null))},i(H){le||(m(i.$$.fragment,H),m(s.$$.fragment,H),m(ae.$$.fragment,H),m(Z.$$.fragment,H),m(ue),m(de),le=!0)},o(H){g(i.$$.fragment,H),g(s.$$.fragment,H),g(ae.$$.fragment,H),g(Z.$$.fragment,H),g(ue),g(de),le=!1},d(H){H&&_(l),V(i),V(s),V(ae),V(Z),ue&&ue.d(),de&&de.d(),He=!1,ol(N)}}}function jt(o){let l,t;return l=new _n({props:{class:"download-button",data:o[47],queryID:o[12],display:o[43]}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[1]&65536&&(i.data=e[47]),n[0]&4096&&(i.queryID=e[12]),n[1]&4096&&(i.display=e[43]),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function qt(o){let l,t;return l=new bn({props:{display:o[43]}}),l.$on("click",o[73]),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[1]&4096&&(i.display=e[43]),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function zt(o){let l,t;return l=new _n({props:{class:"download-button",data:o[47],queryID:o[12],display:o[43]}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[1]&65536&&(i.data=e[47]),n[0]&4096&&(i.queryID=e[12]),n[1]&4096&&(i.display=e[43]),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Qt(o){let l,t;return l=new bn({props:{display:o[43]}}),l.$on("click",o[72]),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[1]&4096&&(i.display=e[43]),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Ht(o){let l,t,e=o[12]&&Wt(o);return{c(){e&&e.c(),l=L()},l(n){e&&e.l(n),l=L()},m(n,i){e&&e.m(n,i),k(n,l,i),t=!0},p(n,i){n[12]?e?(e.p(n,i),i[0]&4096&&m(e,1)):(e=Wt(n),e.c(),m(e,1),e.m(l.parentNode,l)):e&&(W(),g(e,1,1,()=>{e=null}),X())},i(n){t||(m(e),t=!0)},o(n){g(e),t=!1},d(n){n&&_(l),e&&e.d(n)}}}function Wt(o){let l,t;return l=new $n({props:{$$slots:{default:[ai]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,n){const i={};n[0]&4097|n[2]&16384&&(i.$$scope={dirty:n,ctx:e}),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}function Xt(o){let l=` `,t,e,n;return{c(){t=te(l),e=z(),n=O("br"),this.h()},l(i){t=ne(i,l),e=Q(i),n=I(i,"BR",{class:!0}),this.h()},h(){p(n,"class","svelte-fmobgf")},m(i,r){k(i,t,r),k(i,e,r),k(i,n,r)},p(i,r){r[0]&1&&l!==(l=` `)&&ce(t,l)},d(i){i&&(_(t),_(e),_(n))}}}function ai(o){let l=``,t,e,n,i,r,u="",f,a=me(Object.keys(o[0][0])),s=[];for(let c=0;c`)&&ce(t,l),d[0]&1){a=me(Object.keys(c[0][0]));let h;for(h=0;h{f=null}),X());let S=t;t=c(d),t===S?s[t].p(d,h):(W(),g(s[S],1,1,()=>{s[S]=null}),X(),e=s[t],e?e.p(d,h):(e=s[t]=a[t](d),e.c()),m(e,1),e.m(n.parentNode,n))},i(d){i||(m(f),m(e),i=!0)},o(d){g(f),g(e),i=!1},d(d){d&&(_(l),_(n)),f&&f.d(d),s[t].d(d),r=!1,u()}}}let ci="1.5em",mi="1em",di="0em",_i=!1;function hi(o,l){return o.map(t=>{var e={};return l.forEach(n=>e[n]=t[n]),e})}const Jt=o=>o.contentType==="link",gi=()=>{},Kt=o=>o.id,Yt=o=>o.id,Zt=o=>o.id,$t=o=>o.id,xt=o=>o.id,en=o=>o.id,ln=o=>o.id;function bi(o,l,t){let e,n,i,r,u,{$$slots:f={},$$scope:a}=l,s=Jn({});Ye(o,s,C=>t(42,u=C)),jn(Ze,s);let{data:c}=l,{queryID:d=void 0}=l,{rows:h=10}=l,{rowNumbers:S=!1}=l,{groupBy:b=void 0}=l,{groupsOpen:y=!0}=l,{groupType:M="accordion"}=l,{accordionRowColor:B=void 0}=l,{groupNamePosition:P="middle"}=l;M==="section"&&(S=!1);let{subtotals:q=!1}=l,{subtotalRowColor:re=void 0}=l,{subtotalFontColor:j=void 0}=l,ie={};function D({detail:C}){const{groupName:ee}=C;t(27,ie[ee]=!ie[ee],ie)}let J,G=!1,{generateMarkdown:K=!1}=l,{search:_e=!1}=l,{sortable:Y=!0}=l,{downloadable:Ne=!0}=l,{totalRow:ae=!1}=l,{totalRowColor:Te=void 0}=l,{totalFontColor:oe=void 0}=l,{isFullPage:w=!1}=l,{link:v=void 0}=l,{showLinkCol:Z=!1}=l,se;s.update(C=>({...C,data:c,columns:[]}));let{rowShading:be=!1}=l,{rowLines:fe=!0}=l,{wrapTitles:le=!1}=l,{headerColor:He=void 0}=l,{headerFontColor:N="var(--grey-900)"}=l,{formatColumnTitles:ue=!0}=l,{backgroundColor:de="white"}=l,{compact:H=void 0}=l,$,Ie=[b];s.update(C=>({...C,priorityColumns:Ie}));let Le=0,Ge=null,Ve="",Ee,Ae,ge={col:null,ascending:null},je,$e,We=Ee,Xe,Pe=1,tl,El=0,Ml,Re={},wl=[],nl=!1,Ol;function wn(){t(49,Ol=window.innerHeight)}function Cn(C){nl=C,t(48,nl)}function yn(C){Ve=C,t(33,Ve)}const Sn=()=>r(0),Nn=()=>r(Pe-2);function Tn(){Ge=un(this.value),t(32,Ge),t(55,h),t(31,Le),t(59,tl),t(34,Ee),t(0,c),t(4,_e),t(35,ge),t(13,b),t(39,Re),t(30,$),t(57,Z),t(22,v),t(29,se),t(42,u),t(27,ie),t(56,y)}const vn=()=>r((Ge??1)-1),En=()=>r((Ge??1)-1),Mn=()=>r(Pe),On=()=>r(Xe-1),In=()=>t(48,nl=!0),Dn=()=>t(48,nl=!0),Bn=()=>t(43,G=!0),Ln=()=>t(43,G=!1);return o.$$set=C=>{t(54,l=Fe(Fe({},l),Ke(C))),"data"in C&&t(0,c=C.data),"queryID"in C&&t(12,d=C.queryID),"rows"in C&&t(55,h=C.rows),"rowNumbers"in C&&t(1,S=C.rowNumbers),"groupBy"in C&&t(13,b=C.groupBy),"groupsOpen"in C&&t(56,y=C.groupsOpen),"groupType"in C&&t(14,M=C.groupType),"accordionRowColor"in C&&t(15,B=C.accordionRowColor),"groupNamePosition"in C&&t(16,P=C.groupNamePosition),"subtotals"in C&&t(2,q=C.subtotals),"subtotalRowColor"in C&&t(17,re=C.subtotalRowColor),"subtotalFontColor"in C&&t(18,j=C.subtotalFontColor),"generateMarkdown"in C&&t(3,K=C.generateMarkdown),"search"in C&&t(4,_e=C.search),"sortable"in C&&t(5,Y=C.sortable),"downloadable"in C&&t(6,Ne=C.downloadable),"totalRow"in C&&t(7,ae=C.totalRow),"totalRowColor"in C&&t(19,Te=C.totalRowColor),"totalFontColor"in C&&t(20,oe=C.totalFontColor),"isFullPage"in C&&t(21,w=C.isFullPage),"link"in C&&t(22,v=C.link),"showLinkCol"in C&&t(57,Z=C.showLinkCol),"rowShading"in C&&t(8,be=C.rowShading),"rowLines"in C&&t(9,fe=C.rowLines),"wrapTitles"in C&&t(10,le=C.wrapTitles),"headerColor"in C&&t(23,He=C.headerColor),"headerFontColor"in C&&t(24,N=C.headerFontColor),"formatColumnTitles"in C&&t(11,ue=C.formatColumnTitles),"backgroundColor"in C&&t(25,de=C.backgroundColor),"compact"in C&&t(26,H=C.compact),"$$scope"in C&&t(76,a=C.$$scope)},o.$$.update=()=>{if(o.$$.dirty[1]&16777216&&t(55,h=Number.parseInt(h)),o.$$.dirty[0]&2&&t(1,S=S==="true"||S===!0),o.$$.dirty[1]&33554432&&t(56,y=y==="true"||y===!0),o.$$.dirty[0]&4&&t(2,q=q==="true"||q===!0),o.$$.dirty[1]&67108864&&t(57,Z=Z==="true"||Z===!0),o.$$.dirty[0]&1614807041|o.$$.dirty[1]&67108864)try{t(29,se=void 0),sn(c),t(30,$=cn(c,"array"));const C=$.filter(ee=>{var he;return ee.type==="date"&&!(((he=c[0])==null?void 0:he[ee.id])instanceof Date)}).map(ee=>ee.id);for(let ee=0;eeh&&!b),o.$$.dirty[0]&8&&t(3,K=K==="true"||K===!0),o.$$.dirty[0]&16&&t(4,_e=_e==="true"||_e===!0),o.$$.dirty[0]&32&&t(5,Y=Y==="true"||Y===!0),o.$$.dirty[0]&64&&t(6,Ne=Ne==="true"||Ne===!0),o.$$.dirty[0]&128&&t(7,ae=ae==="true"||ae===!0),o.$$.dirty[0]&256&&t(8,be=be==="true"||be===!0),o.$$.dirty[0]&512&&t(9,fe=fe==="true"||fe===!0),o.$$.dirty[0]&1024&&t(10,le=le==="true"||le===!0),o.$$.dirty[0]&2048&&t(11,ue=ue==="true"||ue===!0),o.$$.dirty[0]&1&&t(34,Ee=c),o.$$.dirty[0]&17&&il.isQuery(c)&&_e&&t(58,Ae=Yn(il.createReactive({loadGracePeriod:1e3,callback:C=>{t(34,Ee=C)},execFn:Qn},c.opts,c),200)),o.$$.dirty[0]&8193|o.$$.dirty[1]&280&&t(41,n=C=>{ge.col==C?t(35,ge.ascending=!ge.ascending,ge):(t(35,ge.col=C,ge),t(35,ge.ascending=!0,ge));const ee=ge.ascending?1:-1,he=Me=>Me==null||typeof Me=="number"&&isNaN(Me),ve=(Me,Je)=>he(Me[C])&&!he(Je[C])||Me[C]Je[C]?1*ee:0;c.sort(ve),t(34,Ee=Ee.sort(ve)),b&&Object.keys(Re).forEach(Me=>{t(39,Re[Me]=Re[Me].sort(ve),Re)})}),o.$$.dirty[1]&285212683&&t(40,r=C=>{t(31,Le=C*h),t(59,tl=Le+h),t(38,Pe=Math.ceil(tl/h)),Ge&&t(32,Ge=Math.ceil(tl/h)),t(45,$e=Ee.length),t(36,We=Ee.slice(Le,Le+h))}),o.$$.dirty[1]&2&&t(51,e=`${(Ge??1).toString().length}ch`),o.$$.dirty[0]&1|o.$$.dirty[1]&134219780&&Ae)if(Ve){let C=u.columns.length>0?u.columns.map(ee=>ee.id):c.columns.map(ee=>ee.column_name);Ae(c.search(Ve,C,Ve.length===1?.5:Ve.length>=6?.9:.8),c.opts)}else Ae(c,c.opts);if(o.$$.dirty[0]&17&&_e&&!il.isQuery(c)&&Hn.add({status:"warning",title:"Search Failed",description:"Please use a query instead.",timeout:5e3}),o.$$.dirty[0]&1&&t(35,ge={col:null,ascending:null}),o.$$.dirty[0]&1744838657|o.$$.dirty[1]&33556736&&!se){t(39,Re=c.reduce((ee,he)=>{const ve=he[b];return ee[ve]||(ee[ve]=[]),ee[ve].push(he),ee},{})),t(60,wl=Object.keys(Re).reduce((ee,he)=>(ee[he]={},(u.columns.length>0?u.columns:$).forEach(Me=>{var Il;const Je=Me.id,Pn=(Il=$.find(Rn=>Rn.id===Je))==null?void 0:Il.type,Fn=Me.totalAgg,Gn=Me.weightCol,An=Re[he];ee[he][Je]=ze(An,Je,Fn,Pn,Gn)}),ee),{}));const C=Object.keys(ie);Object.keys(Re).forEach(ee=>{C.includes(ee)||t(27,ie[ee]=y,ie)})}o.$$.dirty[0]&8192|o.$$.dirty[1]&536871184&&(b&&ge.col?t(44,je=Object.entries(wl).sort((C,ee)=>{const he=C[1][ge.col],ve=ee[1][ge.col];return(he==null||isNaN(he))&&ve!==void 0&&ve!==null&&!isNaN(ve)?-1*(ge.ascending?1:-1):(ve==null||isNaN(ve))&&he!==void 0&&he!==null&&!isNaN(he)?1*(ge.ascending?1:-1):heve?1*(ge.ascending?1:-1):0}).map(C=>C[0])):t(44,je=Object.keys(Re).sort())),o.$$.dirty[1]&8&&t(45,$e=Ee.length),o.$$.dirty[1]&16777217&&t(38,Pe=Math.ceil((Le+h)/h)),o.$$.dirty[0]&268435456|o.$$.dirty[1]&16777961&&(J?(t(37,Xe=Math.ceil(Ee.length/h)),t(36,We=Ee.slice(Le,Le+h)),t(46,El=We.length),Xe0?hi(c,u.columns.map(C=>C.id)):c)},l=Ke(l),[c,S,q,K,_e,Y,Ne,ae,be,fe,le,ue,d,b,M,B,P,re,j,Te,oe,w,v,He,N,de,H,ie,J,se,$,Le,Ge,Ve,Ee,ge,We,Xe,Pe,Re,r,n,u,G,je,$e,El,Ml,nl,Ol,i,e,s,D,l,h,y,Z,Ae,tl,wl,f,wn,Cn,yn,Sn,Nn,Tn,vn,En,Mn,On,In,Dn,Bn,Ln,a]}class kn extends ye{constructor(l){super(),Se(this,l,bi,si,Ce,{data:0,queryID:12,rows:55,rowNumbers:1,groupBy:13,groupsOpen:56,groupType:14,accordionRowColor:15,groupNamePosition:16,subtotals:2,subtotalRowColor:17,subtotalFontColor:18,generateMarkdown:3,search:4,sortable:5,downloadable:6,totalRow:7,totalRowColor:19,totalFontColor:20,isFullPage:21,link:22,showLinkCol:57,rowShading:8,rowLines:9,wrapTitles:10,headerColor:23,headerFontColor:24,formatColumnTitles:11,backgroundColor:25,compact:26},null,[-1,-1,-1])}}function ki(o){let l;const t=o[6].default,e=sl(t,o,o[7],null);return{c(){e&&e.c()},l(n){e&&e.l(n)},m(n,i){e&&e.m(n,i),l=!0},p(n,i){e&&e.p&&(!l||i&128)&&cl(e,t,n,n[7],l?dl(t,n[7],i,null):ml(n[7]),null)},i(n){l||(m(e,n),l=!0)},o(n){g(e,n),l=!1},d(n){e&&e.d(n)}}}function pi(o){let l,t;const e=[o[4],{data:o[10]},{queryID:o[5]}];let n={$$slots:{default:[ki]},$$scope:{ctx:o}};for(let i=0;i({10:e}),({loaded:e})=>e?1024:0],empty:[wi],default:[pi,({loaded:e})=>({10:e}),({loaded:e})=>e?1024:0]},$$scope:{ctx:o}}}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p(e,[n]){const i={};n&1&&(i.data=e[0]),n&1182&&(i.$$scope={dirty:n,ctx:e}),l.$set(i)},i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}let pn="Data Table";function Si(o,l,t){let e,{$$slots:n={},$$scope:i}=l,{data:r}=l;const u=il.isQuery(r)?r.hash:void 0;let f=(r==null?void 0:r.hash)===u,{emptySet:a=void 0}=l,{emptyMessage:s=void 0}=l,c=r==null?void 0:r.id;return o.$$set=d=>{t(9,l=Fe(Fe({},l),Ke(d))),"data"in d&&t(0,r=d.data),"emptySet"in d&&t(1,a=d.emptySet),"emptyMessage"in d&&t(2,s=d.emptyMessage),"$$scope"in d&&t(7,i=d.$$scope)},o.$$.update=()=>{o.$$.dirty&1&&t(3,f=(r==null?void 0:r.hash)===u),t(4,e=Object.fromEntries(Object.entries(l).filter(([,d])=>d!==void 0)))},l=Ke(l),[r,a,s,f,e,c,n,i]}class Ni extends ye{constructor(l){super(),Se(this,l,Si,yi,Ce,{data:0,emptySet:1,emptyMessage:2})}}function tn(o){let l,t,e,n,i;return t=new Al({props:{size:"sm",outline:!0,icon:o[1]?Ul:Vl,$$slots:{default:[Ei]},$$scope:{ctx:o}}}),t.$on("click",o[10]),n=new Al({props:{size:"sm",variant:"success",outline:!0,icon:uo,$$slots:{default:[Mi]},$$scope:{ctx:o}}}),n.$on("click",o[11]),{c(){l=O("div"),A(t.$$.fragment),e=z(),A(n.$$.fragment),this.h()},l(r){l=I(r,"DIV",{class:!0});var u=F(l);R(t.$$.fragment,u),e=Q(u),R(n.$$.fragment,u),u.forEach(_),this.h()},h(){p(l,"class","absolute bottom-2 right-2 z-10 flex gap-2")},m(r,u){k(r,l,u),U(t,l,null),T(l,e),U(n,l,null),i=!0},p(r,u){const f={};u&2&&(f.icon=r[1]?Ul:Vl),u&32770&&(f.$$scope={dirty:u,ctx:r}),t.$set(f);const a={};u&32768&&(a.$$scope={dirty:u,ctx:r}),n.$set(a)},i(r){i||(m(t.$$.fragment,r),m(n.$$.fragment,r),i=!0)},o(r){g(t.$$.fragment,r),g(n.$$.fragment,r),i=!1},d(r){r&&_(l),V(t),V(n)}}}function Ti(o){let l;return{c(){l=te("Show Results")},l(t){l=ne(t,"Show Results")},m(t,e){k(t,l,e)},d(t){t&&_(l)}}}function vi(o){let l;return{c(){l=te("Hide Results")},l(t){l=ne(t,"Hide Results")},m(t,e){k(t,l,e)},d(t){t&&_(l)}}}function Ei(o){let l;function t(i,r){return i[1]?vi:Ti}let e=t(o),n=e(o);return{c(){n.c(),l=L()},l(i){n.l(i),l=L()},m(i,r){n.m(i,r),k(i,l,r)},p(i,r){e!==(e=t(i))&&(n.d(1),n=e(i),n&&(n.c(),n.m(l.parentNode,l)))},d(i){i&&_(l),n.d(i)}}}function Mi(o){let l;return{c(){l=te("Submit")},l(t){l=ne(t,"Submit")},m(t,e){k(t,l,e)},d(t){t&&_(l)}}}function nn(o){let l,t=o[8].error+"",e;return{c(){l=O("pre"),e=te(t),this.h()},l(n){l=I(n,"PRE",{class:!0});var i=F(l);e=ne(i,t),i.forEach(_),this.h()},h(){p(l,"class","text-red-500 text-xs font-mono")},m(n,i){k(n,l,i),T(l,e)},p(n,i){i&256&&t!==(t=n[8].error+"")&&ce(e,t)},d(n){n&&_(l)}}}function on(o){let l,t,e,n;return t=new Ni({props:{data:o[8]}}),{c(){l=O("div"),A(t.$$.fragment)},l(i){l=I(i,"DIV",{});var r=F(l);R(t.$$.fragment,r),r.forEach(_)},m(i,r){k(i,l,r),U(t,l,null),n=!0},p(i,r){const u={};r&256&&(u.data=i[8]),t.$set(u)},i(i){n||(m(t.$$.fragment,i),i&&hl(()=>{n&&(e||(e=xe(l,ul,{},!0)),e.run(1))}),n=!0)},o(i){g(t.$$.fragment,i),i&&(e||(e=xe(l,ul,{},!1)),e.run(0)),n=!1},d(i){i&&_(l),V(t),i&&e&&e.end()}}}function Oi(o){let l,t="SQL Console",e,n,i,r,u,f=o[8].error&&!o[2]&&!!o[4],a,s,c,d,h=!o[3]&&tn(o),S=f&&nn(o),b=o[1]&&on(o);return{c(){l=O("h1"),l.textContent=t,e=z(),n=O("section"),i=O("div"),h&&h.c(),u=z(),S&&S.c(),a=z(),b&&b.c(),this.h()},l(y){l=I(y,"H1",{class:!0,"data-svelte-h":!0}),el(l)!=="svelte-7ylf69"&&(l.textContent=t),e=Q(y),n=I(y,"SECTION",{class:!0,role:!0});var M=F(n);i=I(M,"DIV",{class:!0});var B=F(i);h&&h.l(B),B.forEach(_),u=Q(M),S&&S.l(M),a=Q(M),b&&b.l(M),M.forEach(_),this.h()},h(){p(l,"class","markdown"),p(i,"class","w-full relative rounded border border-gray-300 min-h-[8rem] cursor-text"),p(n,"class","px-0 py-2 bg-white flex flex-col gap-2 min-h-[8rem] svelte-1bw0fbe"),p(n,"role","none")},m(y,M){k(y,l,M),k(y,e,M),k(y,n,M),T(n,i),h&&h.m(i,null),o[12](i),T(n,u),S&&S.m(n,null),T(n,a),b&&b.m(n,null),s=!0,c||(d=[rn(r=Wn.call(null,i,o[5])),pe(n,"click",o[13]),pe(n,"keydown",o[14])],c=!0)},p(y,[M]){y[3]?h&&(W(),g(h,1,1,()=>{h=null}),X()):h?(h.p(y,M),M&8&&m(h,1)):(h=tn(y),h.c(),m(h,1),h.m(i,null)),r&&_l(r.update)&&M&32&&r.update.call(null,y[5]),M&276&&(f=y[8].error&&!y[2]&&!!y[4]),f?S?S.p(y,M):(S=nn(y),S.c(),S.m(n,a)):S&&(S.d(1),S=null),y[1]?b?(b.p(y,M),M&2&&m(b,1)):(b=on(y),b.c(),m(b,1),b.m(n,null)):b&&(W(),g(b,1,1,()=>{b=null}),X())},i(y){s||(m(h),m(b),s=!0)},o(y){g(h),g(b),s=!1},d(y){y&&(_(l),_(e),_(n)),h&&h.d(),o[12](null),S&&S.d(),b&&b.d(),c=!1,ol(d)}}}function Ii(o,l,t){let e,n=x,i=()=>(n(),n=zn(d,q=>t(8,e=q)),d);o.$$.on_destroy.push(()=>n());let{hideErrors:r=!1}=l,{initialQuery:u="select 'ABC' as category, 123 as num, 26400000 as sales_usd"}=l,{showResults:f=!0}=l,{disabled:a=!1}=l,s=u,c=s,{data:d=Fl(s)}=l;i();let h,S;qn(async()=>{d&&d.fetch(),t(5,S={initialState:u,disabled:a,schema:await Xn(),onChange:q=>{q.docChanged&&c.trim()!==q.state.doc.toString().trim()&&t(6,c=q.state.doc.toString())},onSubmit:()=>(t(4,s=c.trim()),s.endsWith(";")&&t(4,s=s.substring(0,s.length-1)),t(1,f=!0),!0)})});const b=()=>t(1,f=!f),y=()=>{t(4,s=c),t(1,f=!0)};function M(q){Nl[q?"unshift":"push"](()=>{h=q,t(7,h)})}const B=()=>h==null?void 0:h.focus(),P=q=>q.key==="Enter"&&(h==null?void 0:h.focus());return o.$$set=q=>{"hideErrors"in q&&t(2,r=q.hideErrors),"initialQuery"in q&&t(9,u=q.initialQuery),"showResults"in q&&t(1,f=q.showResults),"disabled"in q&&t(3,a=q.disabled),"data"in q&&i(t(0,d=q.data))},o.$$.update=()=>{o.$$.dirty&17&&s&&(i(t(0,d=Fl(s))),d.fetch()),o.$$.dirty&40&&S&&t(5,S.disabled=a,S)},[d,f,r,a,s,S,c,h,e,u,b,y,M,B,P]}class Di extends ye{constructor(l){super(),Se(this,l,Ii,Oi,Ce,{hideErrors:2,initialQuery:9,showResults:1,disabled:3,data:0})}}function Bi(o){let l,t;return l=new Di({}),{c(){A(l.$$.fragment)},l(e){R(l.$$.fragment,e)},m(e,n){U(l,e,n),t=!0},p:x,i(e){t||(m(l.$$.fragment,e),t=!0)},o(e){g(l.$$.fragment,e),t=!1},d(e){V(l,e)}}}class zi extends ye{constructor(l){super(),Se(this,l,null,Bi,Ce,{})}}export{zi as component};