pivotkit-element 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -1
- package/dist/THIRD_PARTY_LICENSES.txt +2 -2
- package/dist/chunks/chunk-4PHDW2LB.js +1 -0
- package/dist/chunks/chunk-5QXN3X2Q.js +1 -0
- package/dist/chunks/{chunk-VMHRXWK7.js → chunk-65G326ME.js} +1 -1
- package/dist/chunks/chunk-65O4Z5GI.js +1 -0
- package/dist/chunks/chunk-CCL5TDLA.js +6 -0
- package/dist/chunks/chunk-NSPPM3IJ.js +16 -0
- package/dist/chunks/chunk-PJA6QZ4Y.js +2 -0
- package/dist/chunks/chunk-QOKB5RDG.js +6 -0
- package/dist/chunks/chunk-SB3L4HHW.js +1 -0
- package/dist/chunks/chunk-WKVC2RPA.js +1 -0
- package/dist/chunks/chunk-XETFD6GR.js +1 -0
- package/dist/chunks/chunk-XR4CMFGN.js +1 -0
- package/dist/chunks/chunk-YUY4D5MF.js +8 -0
- package/dist/chunks/echarts-4DC3BQOK.js +5 -0
- package/dist/chunks/export-YHS47KGK.js +1 -0
- package/dist/chunks/import-csv-UCA275TR.js +1 -0
- package/dist/chunks/import-json-W4GCIW36.js +1 -0
- package/dist/chunks/import-ui-7XVUBL2H.js +1 -0
- package/dist/chunks/link-45LOEA7H.js +1 -0
- package/dist/chunks/menu-texts-de-74DWTJDI.js +1 -0
- package/dist/chunks/menus-XBN5D32E.js +2 -0
- package/dist/chunks/report-run-BZBFOMPF-4M6ACMUF.js +60 -0
- package/dist/chunks/unused-texts-Y4R67XSN-VYGDYJND.js +1 -0
- package/dist/chunks/unused-texts-de-6YVPTNVS-FL6CDBZX.js +1 -0
- package/dist/element.js +1 -1
- package/dist/import-worker.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +11 -5
- package/types/element.d.ts +11 -4
- package/types/jsx.d.ts +1 -1
- package/dist/chunks/chunk-D2E6EFC7.js +0 -6
- package/dist/chunks/chunk-FUHQLTFM.js +0 -1
- package/dist/chunks/chunk-IBQE3N74.js +0 -1
- package/dist/chunks/chunk-MB64GADT.js +0 -1
- package/dist/chunks/chunk-O2TTHYGT.js +0 -1
- package/dist/chunks/chunk-WNTTPBZ5.js +0 -9
- package/dist/chunks/chunk-WXBFHMFX.js +0 -1
- package/dist/chunks/echarts-42T6EZ6B.js +0 -18
- package/dist/chunks/export-6ILXDVGS.js +0 -6
- package/dist/chunks/import-csv-TPSP3I44.js +0 -1
- package/dist/chunks/import-json-NCJFIKAC.js +0 -1
- package/dist/chunks/import-ui-YBYWR3Q5.js +0 -1
- package/dist/chunks/link-52SWRX4P.js +0 -1
- package/dist/chunks/menu-texts-de-YZIOIWPD.js +0 -1
- package/dist/chunks/menus-UWW77KFI.js +0 -1
- package/dist/chunks/unused-texts-K3VFH65P-5EAURTYC.js +0 -1
- package/dist/chunks/unused-texts-de-OW4TGIVX-GHETGXFE.js +0 -1
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as oe,e as ne}from"./chunk-UTPKLCNX.js";import{A as K,B as Q,C as L,E as ee,F as N,aa as R,c as Y,ca as te,f as q,l as J,m as W,z as Z}from"./chunk-WXBFHMFX.js";import{c as G}from"./chunk-O2TTHYGT.js";import{b as d,c as _,d as A,e as P,f as S,g,l as z,q as V}from"./chunk-MB64GADT.js";import"./chunk-DCANE7XH.js";var ye=25569,$e=1048576,Ce=16384,re=32767,Te=Date.UTC(1900,0,1),ge=Date.UTC(1900,2,1),be=Date.UTC(1e4,0,1),Fe=new Set(["history"]);function M(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"").replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"")}function E(e,t){let o="",n=e+1;for(;n>0;){let r=(n-1)%26;o=String.fromCharCode(65+r)+o,n=Math.floor((n-1)/26)}return`${o}${t+1}`}function Se(e){if(!(e>=Te&&e<be))return null;let t=e/A+ye;return e<ge?t-1:t}function se(e){return`FF${z(e).toUpperCase()}`}function Ee(e){let t=String(e??"").replace(/[\u0000-\u001F\u007F\\/?*[\]:]/g," ").replace(/^'+|'+$/g,"").trim().slice(0,31).trim();return Fe.has(t.toLowerCase())?`${t} 1`:t||"Pivot"}function ke(e){let t=new Map;for(let[n,r]of e)t.has(r)||t.set(r,[]),t.get(r).push(n);let o=[];for(let[n,r]of[...t.entries()].sort((a,i)=>a[0]-i[0])){r.sort((s,c)=>s-c);let a=r[0],i=r[0];for(let s=1;s<=r.length;s++){if(s<r.length&&r[s]===i+1){i=r[s];continue}o.push(a===i?E(n,a):`${E(n,a)}:${E(n,i)}`),s<r.length&&(a=i=r[s])}}return o.join(" ")}function X(e,t){t=g(t,"toXlsx"),d(R(e),"toXlsx(grid): grid must come from toGrid()"),_("xlsxRows",e.rows.length,$e,"rows (an Excel sheet)"),_("xlsxColumns",e.columnCount,Ce,"columns (an Excel sheet)");let o={...te,...t.theme||{}},n=e.locale,r=new Map,a=[{fmt:0,bold:!1}],i=new Map([["0|false",0]]),s=(u,p)=>{let v=0;u&&u!=="General"&&(r.has(u)||r.set(u,164+r.size),v=r.get(u));let y=`${v}|${p}`;return i.has(y)||(i.set(y,a.length),a.push({fmt:v,bold:p})),i.get(y)},c=(u,p,v)=>{let y=p.length>re?p.slice(0,re):p;return`<c r="${u}" t="inlineStr" s="${s("General",v)}"><is><t xml:space="preserve">${M(y)}</t></is></c>`},m=(u,p,v,y)=>`<c r="${u}" s="${s(v,y)}"><v>${p}</v></c>`,h=new Array(e.columnCount).fill(6),f=new Map,x=e.rows.map((u,p)=>{let v=p<e.headerRows,y=u.map((l,F)=>{if(!l)return"";let $=E(F,p),T=v||l.total>0;if((!l.colSpan||l.colSpan===1)&&(h[F]=Math.max(h[F],Math.min(60,l.text.length+2))),l.kind==="value"&&typeof l.value=="number"&&Number.isFinite(l.value)){if(l.total===0&&l.valueIndex!==void 0&&e.conditional&&e.conditional[l.valueIndex]){let C=f.get(l.valueIndex)??{cells:[],min:1/0,max:-1/0};C.cells.push([p,F]),C.min=Math.min(C.min,l.value),C.max=Math.max(C.max,l.value),f.set(l.valueIndex,C)}if(l.valueType==="date"){let C=Se(l.value);return C===null?c($,l.text,T):m($,C,N(l.format,l.value,n),T)}return m($,l.value,N(l.format,l.value,n),T)}return(l.kind==="rowHeader"||l.kind==="colHeader")&&typeof l.value=="number"&&l.text===String(l.value)?m($,l.value,"General",T):l.text===""?T?`<c r="${$}" s="${s("General",!0)}"/>`:"":c($,l.text,T)});return`<row r="${p+1}">${y.join("")}</row>`}),b=1,D=[...f.entries()].map(([u,{cells:p,min:v,max:y}])=>{let l=e.conditional[u],F;if(l.type==="colorScale"){let $=l.colors.length>=2?l.colors:o.colorScale,T=$.length===3?'<cfvo type="min"/><cfvo type="percentile" val="50"/><cfvo type="max"/>':'<cfvo type="min"/><cfvo type="max"/>';F=`<cfRule type="colorScale" priority="${b++}"><colorScale>${T}${$.map(C=>`<color rgb="${se(C)}"/>`).join("")}</colorScale></cfRule>`}else{let $=v>0?'<cfvo type="num" val="0"/>':'<cfvo type="min"/>',T=y<0?'<cfvo type="num" val="0"/>':'<cfvo type="max"/>';F=`<cfRule type="dataBar" priority="${b++}"><dataBar>${$}${T}<color rgb="${se(l.color||o.dataBar)}"/></dataBar></cfRule>`}return`<conditionalFormatting sqref="${ke(p)}">${F}</conditionalFormatting>`}),w=e.headerRows>0||e.rowHeaderColumns>0?`<pane${e.rowHeaderColumns?` xSplit="${e.rowHeaderColumns}"`:""}${e.headerRows?` ySplit="${e.headerRows}"`:""} topLeftCell="${E(e.rowHeaderColumns,e.headerRows)}" activePane="${e.rowHeaderColumns&&e.headerRows?"bottomRight":e.headerRows?"bottomLeft":"topRight"}" state="frozen"/>`:"",j=h.map((u,p)=>`<col min="${p+1}" max="${p+1}" width="${u}" customWidth="1"/>`).join(""),pe=e.merges.length?`<mergeCells count="${e.merges.length}">${e.merges.map(u=>`<mergeCell ref="${E(u.col,u.row)}:${E(u.col+u.colSpan-1,u.row+u.rowSpan-1)}"/>`).join("")}</mergeCells>`:"",k=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
-
`,he=`${k}<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetViews><sheetView workbookViewId="0">${w}</sheetView></sheetViews>${j?`<cols>${j}</cols>`:""}<sheetData>${x.join("")}</sheetData>${pe}${D.join("")}</worksheet>`,xe=[...r.entries()].map(([u,p])=>`<numFmt numFmtId="${p}" formatCode="${M(u)}"/>`).join(""),de=`${k}<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">${r.size?`<numFmts count="${r.size}">${xe}</numFmts>`:""}<fonts count="2"><font><sz val="11"/><name val="Calibri"/></font><font><b/><sz val="11"/><name val="Calibri"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border/></borders><cellStyleXfs count="1"><xf/></cellStyleXfs><cellXfs count="${a.length}">${a.map(u=>`<xf numFmtId="${u.fmt}" fontId="${u.bold?1:0}"${u.fmt?' applyNumberFormat="1"':""}${u.bold?' applyFont="1"':""}/>`).join("")}</cellXfs><dxfs count="0"/></styleSheet>`,we=M(Ee(t.sheetName)),ve={"[Content_Types].xml":`${k}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`,"_rels/.rels":`${k}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`,"xl/workbook.xml":`${k}<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${we}" sheetId="1" r:id="rId1"/></sheets></workbook>`,"xl/_rels/workbook.xml.rels":`${k}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`,"xl/styles.xml":de,"xl/worksheets/sheet1.xml":he},H={};for(let[u,p]of Object.entries(ve))H[u]=oe(p);return ne(H,{level:6})}var O=String.raw`[+\-\u2212]?\p{Sc}?\d[\d.,'\u2019\u00a0\u202f ]*(?:[\u00a0\u202f ]?(?:%|\p{Sc}))?`,Re=new RegExp(`^${O}$`,"u"),De=new RegExp(`^${O}\\s\u2013\\s${O}$`,"u");function _e(e){return le(e)===","?";":","}function le(e){let t=q(e).formatToParts(1.5).find(o=>o.type==="decimal");return t?t.value:"."}function me(e){if(/^[\t\r]/.test(e))return`'${e}`;let t=e.replace(/^[\s\u0000-\u001F\u007F]+/,"");return/^[=@]/.test(t)||/^[+-]/.test(t)&&!Re.test(t)&&!De.test(t)?`'${e}`:e}function ue(e){let t=new Date(e),o=`${S(t.getUTCFullYear(),4)}-${S(t.getUTCMonth()+1)}-${S(t.getUTCDate())}`;return e%A===0?o:`${o} ${S(t.getUTCHours())}:${S(t.getUTCMinutes())}:${S(t.getUTCSeconds())}`}function Ae(e,t){let o=String(Number(e.toPrecision(15)));return t==="."?o:o.replace(".",t)}function Le(e,t){let o=Math.sign(e)*Number(Math.abs(e).toFixed(t));return o===0?0:o}function Ie(e,t,o,n,r){let a=Z(t)?.name,i=a==="percent"||a==="percent100",s=n||i?K(t,r):null,c=a==="percent"?e*100:e,m=Ae(s===null?c:Le(c,s),o);return i?`${m}%`:m}function B(e,t){let o=new Map;for(let n of e.merges)for(let r=n.row;r<n.row+n.rowSpan;r++)for(let a=n.col;a<n.col+n.colSpan;a++)(r!==n.row||a!==n.col)&&o.set(`${r},${a}`,e.rows[n.row][n.col]);return e.rows.map((n,r)=>n.map((a,i)=>{if(a)return a;let s=o.get(`${r},${i}`);return t&&s&&s.kind==="rowHeader"&&s.total===0&&(s.colSpan??1)===1?s:null}))}var ce=e=>e.kind==="value"&&typeof e.value=="number"&&Number.isFinite(e.value);function ie(e,t){return t=g(t,"toCsv"),d(R(e),"toCsv(grid): grid must come from toGrid()"),I(e,t)}function I(e,t){let o=e.locale??P,n=t.separator??_e(o),r=le(o),a=s=>{let c=me(s);return/["\r\n]/.test(c)||c.includes(n)?`"${c.replace(/"/g,'""')}"`:c};return B(e,t.repeatLabels!==!1).map(s=>s.map(c=>{if(!c)return"";if(ce(c)){let m=c.valueIndex!==void 0&&!!e.showAs?.[c.valueIndex];return c.valueType==="date"?ue(c.value):Ie(c.value,c.format,r,m,o)}return a(c.text)}).join(n)).join(`\r
|
|
3
|
-
`)+`\r
|
|
4
|
-
`}function ae(e){let t=o=>{let n=me(String(o??""));return/["\t\r\n]/.test(n)?`"${n.replace(/"/g,'""')}"`:n};return e.map(o=>o.map(t).join(" ")).join(`\r
|
|
5
|
-
`)+`\r
|
|
6
|
-
`}function Ne(e){return Array.isArray(e)?(d(e.every(Array.isArray),"toTsv(rows): rows must be arrays of texts"),ae(e)):(d(R(e),"toTsv(grid): grid must come from toGrid() or be an array of rows"),ae(B(e,!0).map(t=>t.map(o=>o?o.text:""))))}function Me(e){return!e||e.value===null||e.value===void 0?null:ce(e)?e.valueType==="date"?ue(e.value):Number(e.value.toPrecision(15)):typeof e.value=="number"?null:e.value}function Xe(e,t){t=g(t,"toJson"),d(R(e),"toJson(grid): grid must come from toGrid()");let o=B(e,!0),n=e.rowHeaderColumns,r=o.slice(0,e.headerRows),a=m=>m?m.text:"",i=r[r.length-1]??[],s=r.map(m=>m.slice());for(let m of e.merges)for(let h=m.row;h<Math.min(m.row+m.rowSpan,e.headerRows);h++)for(let f=m.col;f<m.col+m.colSpan;f++)s[h][f]=e.rows[m.row][m.col];let c={rowHeaders:Array.from({length:n},(m,h)=>a(i[h]??null)),columns:e.dataColumns.map((m,h)=>{let f=n+h,x=[],b=null;for(let D of s){let w=D[f];w&&w!==b&&w.kind!=="corner"&&w.text!==""&&x.push(w.text),b=w}return{labels:x,value:m.valueIndex>=0?e.valueNames[m.valueIndex]??null:null,total:m.total}}),rows:e.bodyRows.map((m,h)=>{let f=o[e.headerRows+h];return{labels:f.slice(0,n).map(a),total:m.total,collapsed:m.collapsed,values:f.slice(n).map(Me)}})};return JSON.stringify(c,null,t.space??2)}function Oe(e,t){return t=g(t,"toCsvBytes"),new TextEncoder().encode((t.bom===!1?"":"\uFEFF")+ie(e,t))}var fe=new Set(["date","datetime","time"]);function Be(e,t){if(!e||typeof e!="object")return;if(Object.hasOwn(e,t))return e[t];let o=t.toLowerCase(),n=Object.keys(e).find(r=>r.toLowerCase()===o);return n===void 0?void 0:e[n]}function Ue(e,t,o,n){let r=t?t.split(":")[0]:null;if(e.type==="date"){let a=r&&fe.has(r)?t:e.dateOnly?"date":"datetime",i=L(a,o);return s=>({kind:"value",total:0,value:s,valueType:"date",format:a,text:i(s)})}if(e.type==="number"&&r!=="text"){let a=t&&!fe.has(r)?t:null,i=a?L(a,o):null;return s=>{let c=a??`number:${ee(s,6)}`;return{kind:"value",total:0,value:s,valueType:"number",format:c,text:i?i(s):L(c,o)(s)}}}return e.type==="boolean"?a=>({kind:"value",total:0,value:null,valueType:"text",text:a?n.true:n.false}):a=>({kind:"value",total:0,value:null,valueType:"text",text:String(a)})}function U(e,t,o,n){d(Y(e),`${n}(data, indices): data must come from encode()`),d(t!==null&&typeof t=="object"&&typeof t.length=="number",`${n}(data, indices): indices must be an array of row positions`);let r=G(o),a=V(null,o.locale),i={...J,...o.labels||{}},s=e.columns;o.columns!==void 0&&(d(Array.isArray(o.columns),`${n}: options.columns must be an array of field names`),s=o.columns.map(f=>e.column(String(f))).filter(f=>f!==void 0)),_("cells",(t.length+1)*s.length,r.cells,"rows x columns of the rows export");let c=s.map(f=>{let x=Be(o.formats,f.name);return Ue(f,typeof x=="string"&&Q(x)?x.trim().toLowerCase():null,a,i)}),h=[s.map(f=>({kind:"colHeader",total:0,value:f.name,text:W(f.name,i)}))];for(let f=0;f<t.length;f++){let x=t[f];d(Number.isInteger(x)&&x>=0&&x<e.length,`${n}: indices[${f}] is not a row of the data`),h.push(s.map((b,D)=>{let w=b.codes[x];return w<0?null:c[D](b.dict[w])}))}return{rows:h,headerRows:1,rowHeaderColumns:0,columnCount:s.length,merges:[],dataColumns:[],bodyRows:[],formats:[],showAs:[],valueNames:[],conditional:[],locale:a,timeZone:e.timeZone}}function je(e,t,o){return o=g(o,"rowsToCsv"),I(U(e,t,o,"rowsToCsv"),o)}function He(e,t,o){return o=g(o,"rowsToCsvBytes"),new TextEncoder().encode((o.bom===!1?"":"\uFEFF")+I(U(e,t,o,"rowsToCsvBytes"),o))}function Ge(e,t,o){return o=g(o,"rowsToXlsx"),X(U(e,t,o,"rowsToXlsx"),{sheetName:o.sheetName})}export{je as rowsToCsv,He as rowsToCsvBytes,Ge as rowsToXlsx,ie as toCsv,Oe as toCsvBytes,Xe as toJson,Ne as toTsv,X as toXlsx};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-VMHRXWK7.js";import{b as C,c as E,d as S,f as O,g as R,h as T,i as k,j as P}from"./chunk-FUHQLTFM.js";import"./chunk-O2TTHYGT.js";import"./chunk-MB64GADT.js";import"./chunk-DCANE7XH.js";var I=[",",";"," ","|"],F={",":"commas",";":"semicolons"," ":"tabs","|":"vertical bars"},L=65536,_=100,N=34,A=10,b=13;function v(n,m,e,c,o={}){let s=m.charCodeAt(0),a=n.length,t=e,i=o.line??1;for(;t<a;){let f=i,l=[];for(;;){let r;if(n.charCodeAt(t)===N){let h=i,d=t+1,g="";for(;;){let u=n.indexOf('"',d);if(u===-1){if(o.sample)return a;throw E("UNCLOSED_QUOTE",o.file??"file",`the quote that opens a value in line ${h} is never closed.`,{line:h})}if(i+=D(n,d,u),g+=n.slice(d,u),n.charCodeAt(u+1)===N){g+='"',d=u+2;continue}t=u+1;break}let p=t;for(;p<a;){let u=n.charCodeAt(p);if(u===s||u===A||u===b)break;p++}r=p>t?g+n.slice(t,p):g,t=p}else{let h=t;for(;h<a;){let d=n.charCodeAt(h);if(d===s||d===A||d===b)break;h++}r=n.slice(t,h),t=h}if(l.push(r),o.maxFields!==void 0&&l.length>o.maxFields)throw S("columns",l.length,o.maxFields,o.file??"file","columns");let w=t<a?n.charCodeAt(t):-1;if(w===s){t++;continue}w===b?(t+=n.charCodeAt(t+1)===A?2:1,i++):w===A&&(t++,i++);break}if(c(l,f))break}return o.line=i,t}function D(n,m,e){let c=0;for(let o=m;o<e;o++){let s=n.charCodeAt(o);(s===A||s===b&&n.charCodeAt(o+1)!==A)&&c++}return c}function M(n,m,e){let c=n.slice(m,m+L),o={sep:e??",",score:-1,width:1},s=e?[e,...I.filter(a=>a!==e)]:I;for(let a of s){let t=new Map,i=0;v(c,a,0,r=>(r.length===1&&r[0]===""||(t.set(r.length,(t.get(r.length)??0)+1),i++),i>=_),{sample:!0});let f=1,l=0;for(let[r,w]of t)r>1&&(w>l||w===l&&r>f)&&(f=r,l=w);f>1&&(l>o.score||l===o.score&&f>o.width)&&(o={sep:a,score:l,width:f})}return o.sep}function U(n){if(!n)return".";try{return new Intl.NumberFormat(n).formatToParts(1.5).find(e=>e.type==="decimal")?.value===","?",":"."}catch{return"."}}async function W(n,m){let e=T(m),c=O(n,e);e.signal?.throwIfAborted();let o=await R(n,e.limits,c);e.onProgress?.({phase:"read",done:o.length,total:o.length});let{text:s,encoding:a}=y(o,c);e.signal?.throwIfAborted();let t=0,i=typeof e.separator=="string"&&e.separator.length===1?e.separator:null,f=/^sep=(.)\r?\n/i.exec(s.slice(0,8));f&&(t=f[0].length,i??=f[1]),i??=M(s,t,/\.tsv$/i.test(c)?" ":void 0);let l=P({file:c,limits:e.limits,locale:e.locale,hints:{decimal:i===";"?",":U(e.locale)}});l.note("ENCODING",{encoding:a}),l.note("SEPARATOR",{separator:i,name:F[i]??`"${i}"`});let r=t,w={file:c,line:t>0?2:1,maxFields:e.limits.columns};for(;r<s.length;){let h=0;r=v(s,i,r,d=>(l.row(d),++h>=C),w),e.onProgress?.({phase:"parse",done:r,total:s.length}),r<s.length&&(await k(),e.signal?.throwIfAborted())}return e.signal?.throwIfAborted(),l.finish(e.types)}export{M as detectSeparator,W as read,v as splitRows};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-VMHRXWK7.js";import{b as N,c as d,e as h,f as T,g as j,h as E,i as S,j as _}from"./chunk-FUHQLTFM.js";import"./chunk-O2TTHYGT.js";import"./chunk-MB64GADT.js";import"./chunk-DCANE7XH.js";var z=4,w=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function L(e){if(Array.isArray(e)){let a=e.find(r=>r!=null);return a===void 0?{kind:"objects",rows:[]}:Array.isArray(a)&&e.every(r=>r===null||Array.isArray(r))?{kind:"arrays",rows:e}:w(a)&&e.every(r=>r===null||w(r))?{kind:"objects",rows:e}:null}return w(e)?Array.isArray(e.columns)&&Array.isArray(e.data)&&e.data.every(a=>Array.isArray(a))?{kind:"columnar",columns:e.columns,data:e.data}:Array.isArray(e.columns)&&Array.isArray(e.rows)?{kind:e.rows.every(a=>a===null||Array.isArray(a))?"header":"objects",columns:e.columns,rows:e.rows}:null:null}function P(e){let a=L(e);if(a)return{shape:a,property:null};if(!w(e))return null;let r=null;for(let s of Object.keys(e)){let l=L(e[s]);if(l&&(l.kind!=="objects"||l.rows.length>0)){let f=l.rows?.length??l.data?.[0]?.length??0;(!r||f>r.size)&&(r={shape:l,property:s,size:f})}}return r}function I(e,a,r,s,l,f){for(let y of Object.keys(e)){let i=a+y,n=e[y];w(n)&&r<z&&Object.keys(n).length>0?I(n,`${i}.`,r+1,s,l,f):s.has(i)||(r>0&&(f.nested??=i),l(),s.set(i,s.size))}}function J(e,a,r,s,l){for(let f of Object.keys(e)){let y=a+f,i=e[f];if(w(i)&&r<z&&Object.keys(i).length>0)J(i,`${y}.`,r+1,s,l);else{let n=s.get(y);n!==void 0&&(l[n]=i)}}}async function $(e,a){let r=E(a),s=T(e,r);r.signal?.throwIfAborted();let l=await j(e,r.limits,s);r.onProgress?.({phase:"read",done:l.length,total:l.length});let{text:f}=v(l,s),y;try{y=JSON.parse(f)}catch(t){throw d("INVALID_JSON",s,`this is no valid JSON (${String(t.message).slice(0,200)}).`)}r.signal?.throwIfAborted();let i=P(y);if(!i)throw d("NO_TABLE",s,"no table found: the JSON must be an array of objects, an array of arrays, { columns, rows } or { columns, data }, or an object with one of these under a property.");let{shape:n,property:b}=i,c=_({file:s,limits:r.limits,locale:r.locale,hints:{textNumbers:!1}});b!==null&&c.note("JSON_PROPERTY",{property:b});let m=r.limits,k=0,A=async t=>{++k%N===0&&(r.onProgress?.({phase:"parse",done:k,total:t}),await S(),r.signal?.throwIfAborted())};if(n.kind==="columnar"){let t=n.data[0]?.length??0;if(n.columns.length!==n.data.length)throw d("NO_TABLE",s,`"columns" names ${n.columns.length} columns, but "data" holds ${n.data.length} arrays.`);if(!n.data.every(o=>o.length===t))throw d("NO_TABLE",s,'the arrays in "data" have different lengths.');h("columns",n.columns.length,m.columns,s,"columns"),h("rows",t,m.rows,s,"rows"),c.header(n.columns);for(let o=0;o<t;o++)c.row(n.data.map(g=>g[o])),await A(t)}else if(n.kind==="arrays"||n.kind==="header"){let t=n.rows;h("rows",t.length,m.rows+1,s,"rows");let o=0;for(n.kind==="header"?c.header(n.columns):(c.header(t[0]??[]),o=1);o<t.length;o++)c.row(t[o]??[]),await A(t.length)}else{let t=n.rows;h("rows",t.length,m.rows,s,"rows");let o=new Map;if(Array.isArray(n.columns))for(let u of n.columns)typeof u=="string"&&!o.has(u)&&o.set(u,o.size);let g=()=>h("columns",o.size+1,m.columns,s,"columns"),p={nested:null};for(let u of t)u&&I(u,"",0,o,g,p);p.nested&&c.note("JSON_FLATTENED",{example:p.nested}),c.header([...o.keys()]);for(let u of t){let O=new Array(o.size).fill(null);u&&J(u,"",0,o,O),c.row(O),await A(t.length)}}return r.signal?.throwIfAborted(),c.finish(r.types)}export{$ as read};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as B,J as N,K as D,L as Ue,M as $e,a as Me,b as ct,d as ae,i as Ie,j as se,n as le,o as ie,p as ce,s as ue,t as de}from"./chunk-WNTTPBZ5.js";import{b as Pe}from"./chunk-WXBFHMFX.js";import{a as U,c as me,d as pe,f as $,k as he}from"./chunk-FUHQLTFM.js";import{c as xe}from"./chunk-O2TTHYGT.js";import{a as M}from"./chunk-MB64GADT.js";import{c as oe}from"./chunk-DCANE7XH.js";var je={dataSource:"Data source",hostData:"The report's data",rows:{one:"{count} row",other:"{count} rows"},columns:{one:"{count} column",other:"{count} columns"},fromFile:"From a file, only in this browser",load:"Load",loadFile:"Load data\u2026",backToOriginal:"Back to original data",backHint:"Undo brings the file back",dropHint:"or drop a file onto the report",formats:"Reads {formats}",formatNames:{csv:"CSV or text",json:"JSON",xlsx:"Excel workbook"},dropTitle:"Drop the file to load it",dropOne:"Drop one file at a time.",reading:"Reading {name}\u2026",phases:{read:"Reading the file",unpack:"Unpacking the workbook",parse:"Reading the rows",type:"Checking the columns"},cancel:"Cancel",previewTitle:"Load {name}",sheet:"Sheet",hiddenSheet:"{name} (hidden)",firstRows:"The first rows",someColumns:"The first {shown} of {count} columns are shown; the others keep the type found.",typeOf:"Type of {column}",types:{string:"Text",number:"Number",date:"Date",boolean:"Yes/No"},yes:"Yes",no:"No",noRows:"The file holds no rows.",notesTitle:{one:"{count} note",other:"{count} notes"},apply:"Load data",loaded:"{name} loaded: {rows}, {columns}",stepLoaded:"{name} loaded",originalShown:"The original data is shown",failed:"{name} could not be loaded: {message}",refused:"{name} was not loaded: {message}",sourceLine:"{name}, only in this browser",sourceSheet:"{name}, sheet \u201C{sheet}\u201D, only in this browser",notes:{ENCODING:"Read as {encoding}.",SEPARATOR:"Values separated by {name}.",LINES_SKIPPED:{one:"{count} line above the column names was skipped (a title block).",other:"{count} lines above the column names were skipped (a title block)."},COLUMN_RENAMED:"Column \u201C{from}\u201D is named \u201C{to}\u201D.",COLUMN_UNNAMED:"Column {position} has no name; it is named \u201C{to}\u201D.",COLUMNS_RENAMED_MORE:{one:"{count} more column was renamed.",other:"{count} more columns were renamed."},COLUMN_DROPPED:"Column {position} has no name and no values and was left out.",COLUMNS_ADDED:{one:"{count} row has more values than there are column names; the extra values are in columns named \u201CColumn \u2026\u201D.",other:"{count} rows have more values than there are column names; the extra values are in columns named \u201CColumn \u2026\u201D."},ROWS_EMPTY:{one:"{count} empty row was left out.",other:"{count} empty rows were left out."},TEXT_CUT:{one:"{count} value longer than {max} characters was cut.",other:"{count} values longer than {max} characters were cut."},CHARACTERS_REMOVED:{one:"Control or text direction characters were removed from {count} value.",other:"Control or text direction characters were removed from {count} values."},DATE_ORDER:"Dates in \u201C{column}\u201D were read as {order}; the values fit both.",VALUES_NOT_CONVERTED:{one:"{count} value in \u201C{column}\u201D cannot be read as {type} and is empty.",other:"{count} values in \u201C{column}\u201D cannot be read as {type} and are empty."},JSON_PROPERTY:"The rows were read from \u201C{property}\u201D.",JSON_FLATTENED:"Nested values became columns named with a dot (\u201C{example}\u201D).",SHEET:"Read the sheet \u201C{sheet}\u201D.",SHEETS:"Read the sheet \u201C{sheet}\u201D of {count} sheets.",USED_RANGE:"The sheet's used range reaches row {usedRow}; the values end at row {lastRow}, the empty rows below were skipped.",ERROR_CELLS:{one:"{count} cell holds an Excel error (such as #N/A) and is empty.",other:"{count} cells hold an Excel error (such as #N/A) and are empty."}},dateOrders:{dmy:"day/month/year",mdy:"month/day/year"}},ut={dataSource:"Datenquelle",hostData:"Die Daten des Berichts",rows:{one:"{count} Zeile",other:"{count} Zeilen"},columns:{one:"{count} Spalte",other:"{count} Spalten"},fromFile:"Aus einer Datei, nur in diesem Browser",load:"Laden",loadFile:"Daten laden\u2026",backToOriginal:"Zur\xFCck zu den Originaldaten",backHint:"R\xFCckg\xE4ngig holt die Datei zur\xFCck",dropHint:"oder eine Datei auf den Bericht ziehen",formats:"Liest {formats}",formatNames:{csv:"CSV oder Text",json:"JSON",xlsx:"Excel-Arbeitsmappe"},dropTitle:"Loslassen, um die Datei zu laden",dropOne:"Bitte nur eine Datei auf einmal ziehen.",reading:"{name} wird gelesen\u2026",phases:{read:"Datei wird gelesen",unpack:"Arbeitsmappe wird entpackt",parse:"Zeilen werden gelesen",type:"Spalten werden gepr\xFCft"},cancel:"Abbrechen",previewTitle:"{name} laden",sheet:"Blatt",hiddenSheet:"{name} (ausgeblendet)",firstRows:"Die ersten Zeilen",someColumns:"Die ersten {shown} von {count} Spalten werden gezeigt; die anderen behalten den erkannten Typ.",typeOf:"Typ von {column}",types:{string:"Text",number:"Zahl",date:"Datum",boolean:"Ja/Nein"},yes:"Ja",no:"Nein",noRows:"Die Datei enth\xE4lt keine Zeilen.",notesTitle:{one:"{count} Hinweis",other:"{count} Hinweise"},apply:"Daten laden",loaded:"{name} geladen: {rows}, {columns}",stepLoaded:"{name} geladen",originalShown:"Die Originaldaten werden gezeigt",failed:"{name} konnte nicht geladen werden: {message}",refused:"{name} wurde nicht geladen: {message}",sourceLine:"{name}, nur in diesem Browser",sourceSheet:"{name}, Blatt \u201E{sheet}\u201C, nur in diesem Browser",notes:{ENCODING:"Gelesen als {encoding}.",SEPARATOR:"Werte getrennt durch {name}.",LINES_SKIPPED:{one:"{count} Zeile \xFCber den Spaltennamen wurde \xFCbersprungen (ein Titelblock).",other:"{count} Zeilen \xFCber den Spaltennamen wurden \xFCbersprungen (ein Titelblock)."},COLUMN_RENAMED:"Die Spalte \u201E{from}\u201C hei\xDFt jetzt \u201E{to}\u201C.",COLUMN_UNNAMED:"Spalte {position} hat keinen Namen; sie hei\xDFt jetzt \u201E{to}\u201C.",COLUMNS_RENAMED_MORE:{one:"{count} weitere Spalte wurde umbenannt.",other:"{count} weitere Spalten wurden umbenannt."},COLUMN_DROPPED:"Spalte {position} hat weder Namen noch Werte und wurde weggelassen.",COLUMNS_ADDED:{one:"{count} Zeile hat mehr Werte als Spaltennamen; die zus\xE4tzlichen Werte stehen in Spalten namens \u201EColumn \u2026\u201C.",other:"{count} Zeilen haben mehr Werte als Spaltennamen; die zus\xE4tzlichen Werte stehen in Spalten namens \u201EColumn \u2026\u201C."},ROWS_EMPTY:{one:"{count} leere Zeile wurde weggelassen.",other:"{count} leere Zeilen wurden weggelassen."},TEXT_CUT:{one:"{count} Wert mit mehr als {max} Zeichen wurde gek\xFCrzt.",other:"{count} Werte mit mehr als {max} Zeichen wurden gek\xFCrzt."},CHARACTERS_REMOVED:{one:"Aus {count} Wert wurden Steuer- oder Richtungszeichen entfernt.",other:"Aus {count} Werten wurden Steuer- oder Richtungszeichen entfernt."},DATE_ORDER:"Datumswerte in \u201E{column}\u201C wurden als {order} gelesen; die Werte passen zu beidem.",VALUES_NOT_CONVERTED:{one:"{count} Wert in \u201E{column}\u201C l\xE4sst sich nicht als {type} lesen und bleibt leer.",other:"{count} Werte in \u201E{column}\u201C lassen sich nicht als {type} lesen und bleiben leer."},JSON_PROPERTY:"Die Zeilen wurden aus \u201E{property}\u201C gelesen.",JSON_FLATTENED:"Verschachtelte Werte wurden zu Spalten mit Punkt im Namen (\u201E{example}\u201C).",SHEET:"Gelesen wurde das Blatt \u201E{sheet}\u201C.",SHEETS:"Gelesen wurde das Blatt \u201E{sheet}\u201C von {count} Bl\xE4ttern.",USED_RANGE:"Der benutzte Bereich des Blatts reicht bis Zeile {usedRow}; die Werte enden in Zeile {lastRow}, die leeren Zeilen darunter wurden \xFCbersprungen.",ERROR_CELLS:{one:"{count} Zelle enth\xE4lt einen Excel-Fehler (etwa #NV) und bleibt leer.",other:"{count} Zellen enthalten einen Excel-Fehler (etwa #NV) und bleiben leer."}},dateOrders:{dmy:"Tag/Monat/Jahr",mdy:"Monat/Tag/Jahr"}},ze=Object.freeze({en:je,de:ut}),Fe=new WeakMap;function k(e){let t=Fe.get(e);if(t)return t;let n=Object.hasOwn(ze,e.lang)?ze[e.lang]:je,r=e[Ue]?.dataImport,o=$e(n,r);return Fe.set(e,o),o}function Ve(e,t,n){let r=e.params&&typeof e.params=="object"?e.params:{},o=e.code;o==="COLUMN_RENAMED"&&r.from===""?o="COLUMN_UNNAMED":o==="SHEET"&&Number(r.count)>1&&(o="SHEETS");let s=Object.hasOwn(t.notes,o)?t.notes[o]:null;if(!s)return String(e.message??o);let l=Object.fromEntries(Object.entries(r).map(([c,m])=>[c,typeof m=="number"?m.toLocaleString(n.locale):String(m??"")]));return o==="DATE_ORDER"?l.order=Object.hasOwn(t.dateOrders,String(r.order))?t.dateOrders[String(r.order)]:l.order:o==="VALUES_NOT_CONVERTED"&&(l.type=Object.hasOwn(t.types,String(r.type))?t.types[String(r.type)]:l.type),N(typeof s=="string"?s:D(s,Number(r.count)||0,n),l)}var A=oe(Me(),1),a=oe(Me(),1),ge=oe(ct(),1);var W=1,dt=/^[a-z0-9][a-z0-9-]{0,63}$/,mt=/^\.[a-z0-9]{1,16}$/,pt=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/,Be=["reader"];function Z(e){let t=e,n=r=>{throw new M("INVALID_ARGUMENT",`plugin ${typeof t?.name=="string"?`"${t.name.slice(0,64)}" `:""}${r}`)};return(t===null||typeof t!="object"||Array.isArray(t))&&n("must be an object"),t.apiVersion!==W&&n(`uses plugin API version ${JSON.stringify(t.apiVersion)}; this pivotkit-core supports version ${W}. Use a version of the plugin made for API ${W}, or update pivotkit.`),Be.includes(t.kind)||n(`has kind ${JSON.stringify(t.kind)}; API ${W} knows ${Be.map(r=>`"${r}"`).join(", ")}`),(typeof t.name!="string"||!dt.test(t.name))&&n('needs a name of lower-case letters, digits and "-"'),(typeof t.label!="string"||t.label.trim()===""||t.label.length>100)&&n("needs a label of 1 to 100 characters"),(!Array.isArray(t.accept)||t.accept.length===0||!t.accept.every(r=>typeof r=="string"&&(mt.test(r)||pt.test(r))))&&n('needs accept: file name extensions (".xlsx") and media types ("text/csv"), in lower case'),typeof t.load!="function"&&n("needs load(): a function that imports the reader"),Object.freeze({apiVersion:t.apiVersion,kind:t.kind,name:t.name,label:t.label,accept:[...t.accept],load:t.load})}var ht=Z({apiVersion:1,kind:"reader",name:"csv",label:"CSV or text",accept:[".csv",".tsv",".txt",".tab","text/csv","text/tab-separated-values","text/plain"],load:()=>import("./import-csv-TPSP3I44.js")}),ft=Z({apiVersion:1,kind:"reader",name:"json",label:"JSON",accept:[".json","application/json"],load:()=>import("./import-json-NCJFIKAC.js")}),z=Object.freeze([ht,ft]);function H(e,t=[]){for(let c of t)Z(c);let n=[...t,...z],r=typeof e?.name=="string"?e.name.toLowerCase():"",o=r.lastIndexOf("."),s=o===-1?"":r.slice(o);if(s){let c=n.find(m=>m.accept.includes(s));if(c)return c}let l=typeof e?.type=="string"?e.type.toLowerCase().split(";")[0].trim():"";return l?n.find(c=>c.accept.includes(l)):void 0}var fe=new WeakMap;async function ye(e){let t=Z(e),n=fe.get(e);return n||(n=Promise.resolve(t.load()).then(r=>{let o=r,s=o?.default&&typeof o.read!="function"?o.default:o;if(!s||typeof s.read!="function")throw new M("INVALID_ARGUMENT",`plugin "${t.name}": its load() must give a module with read(file, options)`);if(s.sheets!==void 0&&typeof s.sheets!="function")throw new M("INVALID_ARGUMENT",`plugin "${t.name}": sheets must be a function when given`);return s}),n.catch(()=>fe.delete(e)),fe.set(e,n)),n}async function We(e,t={}){let n=$(e,t),r=xe(t);if(e&&typeof e=="object"&&typeof e.size=="number"&&e.size>r.fileBytes)throw pe("fileBytes",e.size,r.fileBytes,n,"bytes");let o=t.reader??H(e,t.plugins);if(!o)throw me("NO_READER",n,"no reader for this kind of file.");let s=await ye(o),l={...t};return delete l.plugins,delete l.reader,yt(await s.read(e,l),o.name)}function yt(e,t){let n=o=>{throw new M("INVALID_ARGUMENT",`plugin "${t}": read() must return a table of pivotkit-core/import (createTable().finish()); ${o}`)};(!e||typeof e!="object"||!Array.isArray(e.columns)||!Array.isArray(e.types)||!Array.isArray(e.data)||!Array.isArray(e.notes))&&n("it needs columns, types, data and notes");let r=e.data[0]?.length??0;return(e.types.length!==e.columns.length||e.data.length!==e.columns.length)&&n("columns, types and data differ in length"),e.columns.every(o=>typeof o=="string")||n("a column name is no string"),e.types.every(o=>U.includes(o))||n("a type is none of string, number, date, boolean"),e.data.every(o=>Array.isArray(o)&&o.length===r)||n("the columns differ in length"),e}function gt(e){let t=[];for(let n of[...e,...z])for(let r of Array.isArray(n?.accept)?n.accept:[])typeof r=="string"&&!t.includes(r)&&t.push(r);return t.join(",")}var Ke=(e,t={})=>[...e,...z].map(n=>typeof n?.name=="string"&&Object.hasOwn(t,n.name)?t[n.name]:typeof n?.label=="string"?n.label.trim().slice(0,100):"").filter((n,r,o)=>n&&o.indexOf(n)===r),Et=1e4;function Ze(e){let t=e.data[0]?.length??0,n=r=>Array.isArray(r)&&r.length===e.columns.length;return{...e,rowCount:Number.isInteger(e.rowCount)&&e.rowCount>=0?e.rowCount:t,raw:n(e.raw)&&e.raw.every(r=>Array.isArray(r)&&r.length===t)?e.raw:e.data,detected:n(e.detected)?e.detected:e.types,hints:e.hints&&typeof e.hints=="object"?e.hints:{decimal:".",dateOrder:"dmy"},notes:e.notes.filter(r=>r&&typeof r.code=="string").map(r=>({code:r.code,params:r.params&&typeof r.params=="object"?r.params:{},message:String(r.message??r.code)}))}}var wt=e=>e!==null&&typeof e=="object"&&Array.isArray(e.columns)&&Array.isArray(e.types)&&Array.isArray(e.data)&&Array.isArray(e.notes),bt=e=>e?.reason??new DOMException("The read was cancelled","AbortError"),x=Symbol("worker unavailable");function St(e,t,n,r,o,s=Et){let l;try{l=e()}catch{return Promise.resolve(x)}return!l||typeof l.postMessage!="function"?Promise.resolve(x):new Promise((c,m)=>{let y=!1,i=setTimeout(()=>{h(),c(x)},s),h=()=>{clearTimeout(i),l.terminate?.(),r?.removeEventListener("abort",T)},T=()=>{h(),m(bt(r))};if(r?.aborted){T();return}r?.addEventListener("abort",T,{once:!0}),l.onmessage=E=>{let p=E.data;if(p?.type==="ready"&&!y){y=!0,clearTimeout(i);try{l.postMessage({file:t,options:n})}catch{h(),c(x)}}else if(p?.type==="progress")p.progress&&typeof p.progress=="object"&&o?.(p.progress);else if(p?.type==="done")h(),wt(p.table)?c(p.table):m(new Error("The import worker returned no table"));else if(p?.type==="error"){h();let w=p.error??{};m(typeof w.code=="string"?new M(w.code,String(w.message??""),w.details??{}):new Error(String(w.message??"The file could not be read")))}},l.onmessageerror=()=>{h(),m(new Error("The import worker's answer could not be read"))},l.onerror=E=>{E.preventDefault?.(),h(),y?m(new Error(String(E.message||"The file could not be read"))):c(x)}})}async function Nt(e,{plugins:t=[],worker:n,sheet:r,locale:o,limits:s,signal:l,onProgress:c,readyMs:m}={}){let y={name:e.name,...r!==void 0?{sheet:r}:{},...o?{locale:o}:{},...s?{limits:s}:{}},i=H(e,t);if(n&&i&&z.includes(i)){let h=await St(n,e,y,l,c,m);if(h!==x)return Ze(h)}return l?.throwIfAborted(),Ze(await We(e,{...y,plugins:t,signal:l,onProgress:c}))}async function Tt(e,{plugins:t=[],limits:n,signal:r}={}){let o=H(e,t);if(!o)return[];let s=await ye(o);if(typeof s.sheets!="function")return[];let l=await s.sheets(e,{name:e.name,...n?{limits:n}:{},signal:r});return Array.isArray(l)?l.filter(c=>c&&typeof c.name=="string"&&Number.isInteger(c.index)):[]}var He=120;function Xe(e){if(e.length<=He)return e;let t=He-3,n=e.charCodeAt(t-1);return n>=55296&&n<=56319&&(t-=1),`${e.slice(0,t)}...`}var Dt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Je(e){let t=e.length*8,n=new Uint8Array(Math.ceil((e.length+9)/64)*64);n.set(e),n[e.length]=128;let r=new DataView(n.buffer);r.setUint32(n.length-8,Math.floor(t/2**32)),r.setUint32(n.length-4,t>>>0);let o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint32Array(64),l=(y,i)=>y>>>i|y<<32-i;for(let y=0;y<n.length;y+=64){for(let f=0;f<16;f++)s[f]=r.getUint32(y+f*4);for(let f=16;f<64;f++){let O=l(s[f-15],7)^l(s[f-15],18)^s[f-15]>>>3,P=l(s[f-2],17)^l(s[f-2],19)^s[f-2]>>>10;s[f]=s[f-16]+O+s[f-7]+P>>>0}let[i,h,T,E,p,w,I,C]=o;for(let f=0;f<64;f++){let O=C+(l(p,6)^l(p,11)^l(p,25))+(p&w^~p&I)+Dt[f]+s[f]>>>0,P=(l(i,2)^l(i,13)^l(i,22))+(i&h^i&T^h&T)>>>0;C=I,I=w,w=p,p=E+O>>>0,E=T,T=h,h=i,i=O+P>>>0}o[0]+=i,o[1]+=h,o[2]+=T,o[3]+=E,o[4]+=p,o[5]+=w,o[6]+=I,o[7]+=C}let c=new Uint8Array(32),m=new DataView(c.buffer);return o.forEach((y,i)=>m.setUint32(i*4,y)),c}async function vt(e,t={}){let n=new TextEncoder().encode(e),r=t.subtle!==void 0?t.subtle:globalThis.crypto?.subtle,o;try{o=r?new Uint8Array(await r.digest("SHA-256",n)):Je(n)}catch{o=Je(n)}return[...o].map(s=>s.toString(16).padStart(2,"0")).join("")}async function Ot(e,t,n){let r=await vt([e,...t].join("\0"),n);return`${Xe(e)}#${r.slice(0,16)}`}var kt=8,At=60;function qe(e,t){try{return new Intl.ListFormat(t,{type:"conjunction"}).format(e)}catch{return e.join(", ")}}function Ge(e,t){let n=["B","KB","MB","GB"],r=e,o=0;for(;r>=1e3&&o<n.length-1;)r/=1e3,o+=1;return`${r.toLocaleString(t,{maximumFractionDigits:o===0?0:1})} ${n[o]}`}function Ct({labels:e,locale:t,source:n,plugins:r,onPick:o,onBack:s,close:l}){let c=k(e),m={lang:e.lang,locale:t};return a.default.createElement("div",{className:"pk-data-menu","data-testid":"data-menu"},a.default.createElement(ue,{title:c.dataSource,testId:"data-source"},a.default.createElement("p",{"data-testid":"data-name"},a.default.createElement("strong",null,n.name??c.hostData)),a.default.createElement("p",{className:"pk-hint","data-testid":"data-size"},`${D(c.rows,n.rows,m)} \xD7 ${D(c.columns,n.columns,m)}`),n.imported?a.default.createElement("p",{className:"pk-hint"},c.fromFile):null),a.default.createElement(ue,{title:c.load},a.default.createElement(de,{icon:"upload",onSelect:()=>{l(),o()},testId:"load-file"},c.loadFile),n.imported?a.default.createElement(de,{icon:"reset",hint:c.backHint,onSelect:()=>{l(),s()},testId:"back-to-original"},c.backToOriginal):null,a.default.createElement("p",{className:"pk-hint","data-testid":"drop-hint"},`${c.dropHint}. ${N(c.formats,{formats:qe(Ke(r,c.formatNames),t)})}`)))}function Rt({labels:e,locale:t,plugins:n,box:r}){let o=k(e),{layer:s}=(0,a.useContext)(le),l=(0,a.useRef)(null),[c]=(0,a.useState)(ie);ce(!0,[l],null,s);let m=r();if(!s||!m)return null;let y=s.ownerDocument.defaultView,i=Math.max(0,m.left),h=Math.max(0,m.top),T={left:i,top:h,width:Math.max(0,Math.min(m.right,y?.innerWidth??m.right)-i),height:Math.max(0,Math.min(m.bottom,y?.innerHeight??m.bottom)-h)};return(0,ge.createPortal)(a.default.createElement("div",{ref:l,...c?{popover:"manual"}:{},className:"pk-drop",style:T,"aria-hidden":"true","data-testid":"drop-overlay"},a.default.createElement("div",null,a.default.createElement(se,{name:"upload",size:24}),a.default.createElement("strong",null,o.dropTitle),a.default.createElement("span",null,N(o.formats,{formats:qe(Ke(n,o.formatNames),t)})))),s)}function _t({labels:e,source:t}){let n=k(e);return a.default.createElement("span",{className:"pk-row-label pk-source","data-testid":"source-line"},a.default.createElement(se,{name:"file",size:14}),N(t.sheet?n.sourceSheet:n.sourceLine,{name:t.name,sheet:t.sheet??""}))}function Ye(e,t){let n=B(e),r=`"${t}": `;return n.startsWith(r)?n.slice(r.length):n}function Lt(e,t,n,r){if(e==null)return"";if(t==="boolean")return e?n.yes:n.no;if(t==="number"&&typeof e=="number")return e.toLocaleString(r,{maximumFractionDigits:10});let o=String(e).replace(/^(\d{4}-\d\d-\d\d)T(\d\d:\d\d)(?::00(?:\.000)?)?$/,"$1 $2");return o.length>80?`${o.slice(0,79)}\u2026`:o}function Mt({job:e,labels:t,locale:n,plugins:r,worker:o,limits:s,timeZone:l,onApply:c,onClose:m,announce:y}){let i=k(t),h={lang:t.lang,locale:n},{layer:T}=(0,a.useContext)(le),E=e.file,p=(0,a.useMemo)(()=>$(E,{}),[E]),[w,I]=(0,a.useState)(void 0),[C,f]=(0,a.useState)([]),[O,P]=(0,a.useState)(null),[F,K]=(0,a.useState)(null),[R,Ee]=(0,a.useState)(null),[we,X]=(0,a.useState)(null),[be,Se]=(0,a.useState)(!1),[tt,Ne]=(0,a.useState)(null),Te=O&&O.sheet===w?O:null,j=!Te&&tt!==w,v=(0,a.useRef)({onClose:m,announce:y,t:i,name:p,plugins:r,worker:o,locale:n,limits:s});(0,a.useEffect)(()=>{v.current={onClose:m,announce:y,t:i,name:p,plugins:r,worker:o,locale:n,limits:s}}),(0,a.useEffect)(()=>{let u=new AbortController,g=0,b=v.current;return Nt(E,{plugins:b.plugins,worker:b.worker,sheet:w,locale:b.locale,limits:b.limits,signal:u.signal,onProgress:S=>{let L=Date.now();(L-g>120||S.done>=S.total)&&(g=L,Ee(S))}}).then(S=>{u.signal.aborted||(P({table:S,sheet:w}),K(null))},S=>{if(u.signal.aborted)return;let L=N(v.current.t.failed,{name:v.current.name,message:Ye(S,v.current.name)});w===void 0?(v.current.announce(L,{tone:"error"}),v.current.onClose()):(Ne(w),X(L))}),()=>u.abort()},[E,w]),(0,a.useEffect)(()=>{let u=new AbortController;return Tt(E,{plugins:v.current.plugins,limits:v.current.limits,signal:u.signal}).then(g=>!u.signal.aborted&&f(g),()=>{}),()=>u.abort()},[E]);let _=Te?.table??null,q=(0,a.useMemo)(()=>{if(!_||!F||F.every((u,g)=>u===_.types[g]))return{table:_,error:null};try{return{table:he(_,F),error:null}}catch(u){return{table:_,error:B(u)}}},[_,F]),d=q.table,Q=(0,a.useRef)(null),De=(0,a.useRef)(null),ve=(0,a.useRef)(null),[nt]=(0,a.useState)(ie);ce(!0,[De,Q],null,T);let{onKeyDown:rt}=Ie(Q,!0,m),ee=!!d&&!j,Oe=(0,a.useRef)(!1);(0,a.useEffect)(()=>{ee&&!Oe.current&&(Oe.current=!0,ve.current?.focus({preventScroll:!0}))},[ee]);let te=(0,a.useRef)(!0);(0,a.useEffect)(()=>()=>{te.current=!1},[]);let ke=(0,a.useId)(),ne=(0,a.useId)(),Ae=(0,a.useId)(),Ce=ae(),Re=(()=>{let u=d?.notes.find(g=>g.code==="SHEET");return u&&u.params?.sheet!==void 0?String(u.params.sheet):null})(),ot=w??C.find(u=>u.name===Re)?.index??0,at=async()=>{if(!(!d||be)){Se(!0);try{await new Promise(b=>setTimeout(b,0));let u=Pe({columns:d.columns,types:d.types,data:d.data},{timeZone:l??"UTC",limits:s}),g=await Ot(p,d.columns);if(!te.current)return;c({encoded:u,source:{id:g,name:Xe(p)},file:{name:p,size:E.size,type:E.type},sheet:Re,rows:d.rowCount,columns:d.columns.map((b,S)=>({name:b,type:d.types[S]})),notes:d.notes.map(b=>({code:b.code,params:{...b.params},message:b.message}))})}catch(u){te.current&&(X(N(i.failed,{name:p,message:Ye(u,p)})),Se(!1))}}};if(!T)return null;let _e=nt?{popover:"manual"}:{},V=d?d.columns.slice(0,At):[],st=d?Math.min(kt,d.rowCount):0,Le=R&&Object.hasOwn(i.phases,String(R.phase))?i.phases[String(R.phase)]:i.phases.read,re=R&&R.total>0?Math.min(100,Math.round(R.done/R.total*100)):null,lt=d&&!j?`${D(i.rows,d.rowCount,h)} \xB7 ${D(i.columns,d.columns.length,h)} \xB7 ${Ge(E.size,n)}`:Ge(E.size,n);return(0,ge.createPortal)(a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{ref:De,..._e,className:"pk-scrim pk-import-scrim","aria-hidden":"true"}),a.default.createElement("div",{ref:Q,..._e,className:"pk-import",role:"dialog","aria-modal":"true","aria-labelledby":ke,"aria-describedby":d&&d.notes.length?`${ne} ${Ae}`:ne,"aria-busy":j||void 0,tabIndex:-1,onKeyDown:rt,"data-testid":"import-dialog"},a.default.createElement("div",{className:"pk-drill-head"},a.default.createElement("div",{className:"pk-drill-heading"},a.default.createElement("h2",{id:ke},N(i.previewTitle,{name:p})),a.default.createElement("p",{id:ne,className:"pk-hint",role:"status","data-testid":"import-meta"},lt))),a.default.createElement("div",{className:"pk-import-body"},C.length>1?a.default.createElement("label",{className:"pk-inline-form"},i.sheet,a.default.createElement("select",{name:`${Ce}-sheet`,value:ot,onChange:u=>{Ee(null),X(null),Ne(null),K(null),I(Number(u.target.value))},"data-testid":"import-sheet"},C.map(u=>a.default.createElement("option",{key:u.index,value:u.index},u.visible?u.name:N(i.hiddenSheet,{name:u.name}))))):null,we||q.error?a.default.createElement("p",{className:"pk-error",role:"alert","data-testid":"import-error"},we??q.error):null,j?a.default.createElement("div",{"data-testid":"import-progress"},a.default.createElement("p",null,N(i.reading,{name:p})),a.default.createElement("progress",{max:100,value:re??void 0,"aria-label":Le}),a.default.createElement("p",{className:"pk-hint"},`${Le}${re!==null?` \xB7 ${re} %`:""}`)):d?a.default.createElement(a.default.Fragment,null,d.rowCount===0?a.default.createElement("p",{"data-testid":"import-empty"},i.noRows):null,a.default.createElement("div",{className:"pk-drill-body","data-testid":"import-preview"},a.default.createElement("table",{className:"pk-drill-table"},a.default.createElement("caption",{className:"pk-sr"},i.firstRows),a.default.createElement("thead",null,a.default.createElement("tr",null,V.map((u,g)=>a.default.createElement("th",{key:g,scope:"col"},u,a.default.createElement("select",{name:`${Ce}-type-${g}`,value:d.types[g],"aria-label":N(i.typeOf,{column:u}),onChange:b=>K(S=>(S??_?.types??[]).map((L,it)=>it===g?b.target.value:L)),"data-testid":`import-type-${g}`},U.map(b=>a.default.createElement("option",{key:b,value:b},i.types[b]))))))),a.default.createElement("tbody",null,Array.from({length:st},(u,g)=>a.default.createElement("tr",{key:g},V.map((b,S)=>a.default.createElement("td",{key:S,className:d.types[S]==="number"?"pk-num":void 0},Lt(d.data[S][g],d.types[S],i,n)))))))),d.columns.length>V.length?a.default.createElement("p",{className:"pk-hint"},N(i.someColumns,{shown:V.length.toLocaleString(n),count:d.columns.length.toLocaleString(n)})):null,d.notes.length?a.default.createElement("div",{id:Ae,className:"pk-note","data-testid":"import-notes"},a.default.createElement("div",null,a.default.createElement("h3",null,D(i.notesTitle,d.notes.length,h)),a.default.createElement("ul",null,d.notes.map((u,g)=>a.default.createElement("li",{key:g,"data-code":u.code},Ve(u,i,h)))))):null):null),a.default.createElement("div",{className:"pk-popover-foot"},a.default.createElement("button",{type:"button",className:"pk-btn",onClick:m,"data-autofocus":"","data-testid":"import-cancel"},i.cancel),ee?a.default.createElement("button",{ref:ve,type:"button",className:"pk-btn pk-primary",onClick:at,disabled:be||!d||d.rowCount===0,"data-testid":"import-apply"},i.apply):null))),T)}var It=3,mn=Object.freeze({past:Object.freeze([]),future:Object.freeze([])});function Qe(e,t,n){return{past:[...e.past,{data:t.data,history:{...t.history,future:[]},note:n}].slice(-It),future:[]}}function xt(e,t){let n=e.past[e.past.length-1];return n?{steps:{past:e.past.slice(0,-1),future:[...e.future,{data:t.data,history:t.history,note:n.note}]},step:n}:null}function Pt(e,t){let n=e.future[e.future.length-1];return n?{steps:{past:[...e.past,{data:t.data,history:t.history,note:n.note}],future:e.future.slice(0,-1)},step:n}:null}function Ut(e){for(let t=e.past.length-1;t>=0;t--)if(e.past[t].data===null)return e.past[t].history;return null}function G(e,t,n,r=[]){let o=t?t.encoded:e.hostEncoded;return{cause:n,source:t?{...t.source}:e.hostSource?{...e.hostSource}:null,file:t?{...t.file}:null,sheet:t?t.sheet:null,rows:o.length,columns:o.schema.fields.map(s=>({name:s.name,type:s.type})),notes:r}}var $t=0;function Y(e,t){try{return{refused:e.onDataLoad?.(t)===!1}}catch(n){return t.cause!=="load"&&setTimeout(()=>{throw n},0),{refused:!0,error:n}}}function zt(e,t){let n={key:++$t,encoded:t.encoded,source:t.source,sheet:t.sheet,file:t.file},r=k(e.labels),o=Y(e,G(e,n,"load",t.notes));if(o.refused)return o.error!==void 0&&e.announce(N(r.refused,{name:t.source.name,message:B(o.error)}),{tone:"error"}),!1;let s={lang:e.labels.lang,locale:e.locale};return e.setSteps(Qe(e.steps,{data:e.imported,history:e.history.snapshot()},N(r.stepLoaded,{name:t.source.name}))),e.setImported(n),e.announce(N(r.loaded,{name:t.source.name,rows:D(r.rows,t.rows,s),columns:D(r.columns,t.columns.length,s)}),{action:{label:e.labels.undo,run:e.undo}}),!0}function Ft(e){if(!e.imported)return;let t=k(e.labels),n=Ut(e.steps);e.setSteps(Qe(e.steps,{data:e.imported,history:e.history.snapshot()},t.backToOriginal)),e.setImported(null),n&&e.history.replace({...n,past:[],future:[]}),Y(e,G(e,null,"original")),e.announce(t.originalShown,{action:{label:e.labels.undo,run:e.undo}})}function pn(e,t){let n=(t?xt:Pt)(e.steps,{data:e.imported,history:e.history.snapshot()});return n?(e.setSteps(n.steps),e.setImported(n.step.data),e.history.replace(n.step.history),Y(e,G(e,n.step.data,t?"undo":"redo")),n.step.note):null}function hn(e){e.imported&&Y(e,G(e,e.imported,"restore"))}var jt=0,J=new WeakMap;function et(e,t){let n=e.announce(t,{tone:"error"});typeof n=="number"&&typeof e.dismiss=="function"&&J.set(e.dismiss,[...J.get(e.dismiss)??[],n])}function Vt(e,t){let n=e.dismiss;typeof n=="function"&&((J.get(n)??[]).forEach(r=>n(r)),J.delete(n)),t.length===1?e.setJob({file:t[0],n:++jt}):t.length>1&&et(e,k(e.labels).dropOne)}function fn(e){e&&(e.value="",e.click())}function yn({api:e,input:t}){let n=ae(),r=e.job;return A.default.createElement(A.default.Fragment,null,A.default.createElement("input",{ref:t,type:"file",name:n,hidden:!0,tabIndex:-1,"aria-hidden":"true",accept:gt(e.plugins),onChange:o=>Vt(e,[...o.target.files??[]]),"data-testid":"file-input"}),e.dragging?A.default.createElement(Rt,{labels:e.labels,locale:e.locale,plugins:e.plugins,box:e.box}):null,r?A.default.createElement(Mt,{key:r.n,job:r,labels:e.labels,locale:e.locale,plugins:e.plugins,worker:e.worker,limits:e.limits,timeZone:e.timeZone,announce:(o,s)=>s?.tone==="error"?et(e,o):e.announce(o,s),onClose:()=>e.setJob(o=>o===r?null:o),onApply:o=>{zt(e,o),e.setJob(s=>s===r?null:s)}}):null)}function gn({api:e,close:t}){let n={name:e.sourceName??null,rows:e.encoded.length,columns:e.encoded.schema.fields.length,imported:!!e.imported};return A.default.createElement(Ct,{labels:e.labels,locale:e.locale,source:n,plugins:e.plugins,close:t,onPick:e.pick,onBack:()=>Ft(e)})}function En({api:e}){return e.imported?A.default.createElement(_t,{labels:e.labels,source:{name:e.imported.source.name,sheet:e.imported.sheet}}):null}export{gn as DataMenuPanel,yn as ImportLayer,En as SourceLine,pn as moveData,fn as pickFile,hn as restoreData,Vt as startFiles};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m,b as w,c as b,d as y}from"./chunk-UTPKLCNX.js";import{a as p,b as d,h as f}from"./chunk-MB64GADT.js";import"./chunk-DCANE7XH.js";var h=1024;function L(r,t){let e=[],n=0,l=!1,o=!1,c=new w((i,S)=>{n+=i.length,n>t?l=!0:e.push(i),o=o||S});for(let i=0;i<r.length&&!l;i+=h)c.push(r.subarray(i,i+h),i+h>=r.length);if(l)return{bytes:null,inflated:n};if(!o)throw new Error("unexpected end of data");let u=new Uint8Array(n),g=0;for(let i of e)u.set(i,g),g+=i.length;return{bytes:u,inflated:n}}var a="1.",s=Object.freeze({text:32e3,json:1e6}),k=/^[A-Za-z0-9_-]*$/;function j(r){let t="";for(let e=0;e<r.length;e+=32768)t+=String.fromCharCode(...r.subarray(e,e+32768));return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function v(r){let t=atob(r.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-r.length%4)%4)),e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function $(r){d(f(r),"encodeViewLink(view): view must be an object");let t=JSON.stringify(r),e=(l,o,c)=>new p("LIMIT_EXCEEDED",`${l.toLocaleString("en-US")} ${c} exceed the limit of ${o.toLocaleString("en-US")} (LINK_LIMITS)`,{limit:"link",value:l,max:o});if(t.length>s.json)throw e(t.length,s.json,"characters of the view");let n=a+j(m(b(t),{level:9}));if(n.length>s.text)throw e(n.length,s.text,"characters of the link");return n}function A(r){let t=o=>({view:null,issues:[{path:"",message:o}]});if(typeof r!="string"||r.trim()==="")return t("empty link");let e=r.trim();if(e.length>s.text)return t(`link longer than ${s.text} characters`);if(!e.startsWith(a)||!k.test(e.slice(a.length)))return t("not a pivotkit view link");let n=e.slice(a.length);if(n==="")return t("the link is damaged");let l;try{let o=L(v(n),s.json);if(o.bytes===null)return t(`view larger than ${s.json} characters`);l=y(o.bytes)}catch{return t("the link is damaged")}try{let o=JSON.parse(l);return f(o)?{view:o,issues:[]}:t("not a view object")}catch{return t("not valid JSON")}}export{s as LINK_LIMITS,A as decodeViewLink,$ as encodeViewLink};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-DCANE7XH.js";var e={aboutSetting:"\xDCber {setting}",settingInfo:{grandTotalRow:"Eine letzte Zeile mit der Summe jeder Spalte.",grandTotalColumn:"Eine letzte Spalte mit der Summe jeder Zeile.",rowSubtotals:"Mit zwei oder mehr Feldern in Zeilen: eine Summenzeile unter jeder Gruppe des \xE4u\xDFeren Felds.",colSubtotals:"Mit zwei oder mehr Feldern in Spalten: eine Summenspalte nach jeder Gruppe des \xE4u\xDFeren Felds.",along:"Die Richtung der Berechnung: Zeilen geht die Zeilen jeder Spalte hinunter, Spalten \xFCber die Spalten jeder Zeile. Eine laufende Summe addiert entlang, eine Differenz vergleicht mit dem Eintrag davor.",showAs:"Zeigt jeden Wert als Anteil, Differenz, laufende Summe oder Rang statt der Zahl selbst. Bei Prozenten sagt ein Tipp \xFCber dem Ergebnis, was 100 % ist.",exportXlsx:"Jede Zahl mit allen Nachkommastellen, Formate bleiben, bereit zum Rechnen.",exportCsv:"Prozente und Berechnungen wie in der Tabelle, als reiner Text.",copyTable:"Die Tabelle wie angezeigt, mit \xDCberschriften und Summen: tabulatorgetrennt, wird in Excel oder Google Sheets in Spalten eingef\xFCgt.",copyDataJson:"Die Zahlen der Tabelle mit ihren Beschriftungen als JSON, f\xFCr ein Programm. Nicht die Ansicht selbst: Das ist Ansichten \u2192 Ansicht als JSON kopieren.",drillCopy:"Die Zeilen wie im Bereich angezeigt, mit einer \xDCberschriftenzeile: tabulatorgetrennt, wird in Excel oder Google Sheets in Spalten eingef\xFCgt.",drillJson:"Die Zeilen als JSON-Objekte, mit den Feldnamen und Rohwerten der Daten, f\xFCr ein Programm.",groupLabels:"Mit zwei oder mehr Feldern in Zeilen: die Eintr\xE4ge des \xE4u\xDFeren Felds einmal unter der Achse, unter ihren Kategorien.",labelPosition:"Au\xDFen: Name und Zahl jedes Segments daneben. Innen: die Zahl auf dem Segment, die Namen in der Legende; au\xDFen, wenn der Ring eines Donuts daf\xFCr zu schmal ist.",sharedView:"Nur Admins k\xF6nnen gemeinsame Ansichten \xE4ndern.",valuesFilter:"Werte werden hier nicht gefiltert: Ein Feld in Zeilen oder Spalten \xFCber sein Men\xFC filtern oder ein Feld in Filter ziehen."},back:"Zur\xFCck",backTo:"Zur\xFCck zum Men\xFC von {name}",levelTitle:"{name} \u203A {topic}",searchMenu:"Im Men\xFC von {name} suchen",searchMenuShort:"In diesem Men\xFC suchen (Taste /)",searchResults:"Treffer",searchNothing:"Nichts gefunden. Ein anderes Wort versuchen oder die Suche leeren.",sortByValue:"Nach Wert sortieren",sortOldestShort:"\xC4lteste",sortNewestShort:"Neueste",filterTopic:"Filter",filterAll:"Alle",groupTopic:"Gruppieren",groupNoneShort:"Keine",off:"Aus",moveToTitle:"Verschieben nach",topOwn:"Top N\u2026",binsOff:"Bereiche entfernen",valueConditionTitle:"Bedingung f\xFCr einen Wert",nameHint:"Gilt mit Enter oder beim Verlassen des Felds; Escape gibt den Namen zur\xFCck.",showAsKeywords:"prozent % anteil",nameKeywords:"umbenennen bezeichnung titel",filterKeywords:"werte ausw\xE4hlen regel regeln bedingung zeitraum datum",formatDecimals:{one:"Zahl, {count} Dezimalstelle",other:"Zahl, {count} Dezimalstellen"},listAnd:" und ",summaryAll:"Alle {total} {noun} gezeigt",summarySome:"{shown} der {total} {noun} gezeigt",summaryNone:"Nichts gezeigt",summaryOk:"Alle Eintr\xE4ge ausgew\xE4hlt, keine Regeln.",summaryKept:"Alle Eintr\xE4ge ausgew\xE4hlt; die Regeln behalten sie alle.",summaryQuickOnly:"Alle Eintr\xE4ge ausgew\xE4hlt; {quick}.",summaryPicks:"{count} durch deine Auswahl weggelassen",summaryQuick:"{count} au\xDFerhalb von {quick}",summaryRules:{one:"{items} durch die Regel weggelassen",other:"{items} durch die Regeln weggelassen"},summaryTotals:{one:"{items} durch die Regel zum Gesamtwert weggelassen",other:"{items} durch die Regeln zu den Gesamtwerten weggelassen"},summaryRows:"{rows} von {total} Zeilen",summaryData:"Daten {range}",yearsAll:"{years} zusammengefasst",yearsOne:"nur {year}",emptyPicks:"Nichts ist ausgew\xE4hlt.",emptyRules:"Kein Eintrag ({noun}) erf\xFCllt {rules}.",emptyTotal:"Kein Eintrag ({noun}) hat einen Gesamtwert, {rule} \u2013 {spread}.",totalSpread:"die Gesamtwerte reichen von {low} ({lowItem}) bis {high} ({highItem})",totalWords:"der bei {measure} {op} {number} ist",totalWordsTwo:"der bei {measure} {op} {from} und {to} liegt",resetFilter:"Filter zur\xFCcksetzen",nouns:{item:{one:"Eintrag",other:"Eintr\xE4ge"},value:{one:"Wert",other:"Werte"},date:{one:"Datum",other:"Daten"},year:{one:"Jahr",other:"Jahre"},quarter:{one:"Quartal",other:"Quartale"},month:{one:"Monat",other:"Monate"},week:{one:"Woche",other:"Wochen"},day:{one:"Tag",other:"Tage"},weekday:{one:"Wochentag",other:"Wochentage"},hour:{one:"Stunde",other:"Stunden"},range:{one:"Bereich",other:"Bereiche"}},quickTitle:"Schnellauswahl",quickCount:{year:"Anzahl Jahre",month:"Anzahl Monate",day:"Anzahl Tage"},quickLast:{year:{one:"Letztes {count} Jahr",other:"Letzte {count} Jahre"},month:{one:"Letzter {count} Monat",other:"Letzte {count} Monate"},day:{one:"Letzter {count} Tag",other:"Letzte {count} Tage"}},quickRows:"{rows} Zeilen",quickHidden:{one:"{choices} wird nicht angeboten: die Daten enden am {latest}.",other:"{choices} werden nicht angeboten: die Daten enden am {latest}."},anchorLabel:"Gez\xE4hlt ab",anchorToday:"heute ({date})",anchorLatest:"dem letzten Datensatz ({date})",quickLine:"Schnellauswahl: {text}",changeAbove:"oben \xE4ndern",yearsCombined:"Jahre zusammengefasst",yearsCombinedHint:"ein Eintrag ({noun}) \xFCber die markierten Jahre",yearsCombinedOne:"Die Tabelle zeigt nur {year}.",pickItems:"Eintr\xE4ge ausw\xE4hlen",picksState:"{picked} von {total} ausgew\xE4hlt",picksAll:"alle {total} ausgew\xE4hlt",clear:"Zur\xFCcksetzen",clearPicks:"Auswahl zur\xFCcksetzen",rulesState:{one:"{count} Regel",other:"{count} Regeln"},rulesNoneState:"Keine Regeln",removeAll:"Entfernen",removeRules:"Regeln entfernen",tailOut:{one:"Durch die Regeln weggelassen ({count}) \u2013 das H\xE4kchen gilt wieder, sobald sie weg sind",other:"Durch die Regeln weggelassen ({count}) \u2013 die H\xE4kchen gelten wieder, sobald sie weg sind"},rulesKeep:"{noun} behalten, f\xFCr die alles zutrifft:",rulesNone:"{noun} behalten, f\xFCr die alles zutrifft. Unten eine Regel hinzuf\xFCgen.",ruleKeeps:"Beh\xE4lt {kept} der {total} {noun}",ruleKeepsNone:"Beh\xE4lt 0 der {total} {noun} \u2013 {spread}.",ruleIncomplete:"Gilt, sobald sie vollst\xE4ndig ist.",explainRule:"Diese Regel erkl\xE4ren",ruleInfo:{number:"Vergleicht den Wert selbst, nicht seinen Gesamtwert. Beispiel: \u201Ezwischen 20 und 25\u201C beh\xE4lt die Werte von 20 bis 25.",date:"Vergleicht jedes Datum nach seinem Kalendertag. Beispiel: \u201Evor 1. M\xE4rz 2022\u201C beh\xE4lt jeden Tag bis zum 28. Februar 2022.",group:"Vergleicht jeden Eintrag nach seinem Platz auf der Zeitachse. Beispiel: \u201Eab 2022\u201C beh\xE4lt 2022 und alle sp\xE4teren.",cyclic:"Vergleicht jeden Eintrag nach seinem Platz im Jahr, \xFCber alle Jahre zusammen. Beispiel: \u201Eab Juni\u201C beh\xE4lt Juni bis Dezember.",total:"Der Gesamtwert eines Eintrags ist sein Wert in der Zeile Gesamt \u2013 {measure} \xFCber {scope} \u2013 nicht eine einzelne Zelle. Beispiel: \u201Egr\xF6\xDFer als 20\u201C beh\xE4lt die {nouns} mit einem Gesamtwert \xFCber 20.",name:"Vergleicht den Namen jedes Eintrags, wie die Tabelle ihn schreibt. Beispiel: \u201Eenth\xE4lt \xE4r\u201C beh\xE4lt M\xE4rz."},scopeItems:"alle {count} Eintr\xE4ge von {field}",scopeDates:"die Daten {range}",scopeRows:"jede Zeile",pickerSearch:"Eintr\xE4ge suchen",pickerMatch:"{count} von {total} passen",pickerNone:"Kein Treffer",rulesTitle:"Regeln",ruleAnd:"und",addRule:"Regel hinzuf\xFCgen",addRuleItem:"{field} vergleichen",addRuleTotal:"Gesamtwert vergleichen",addRuleName:"Regel zum Namen",removeRule:"Diese Regel entfernen",rulesFull:"H\xF6chstens {max} Regeln je Feld.",ruleName:"Name",ruleValue:"Wert",ruleDate:"Datum",dateOps:{"=":"gleich","!=":"ungleich",">":"nach",">=":"ab","<":"vor","<=":"bis",between:"zwischen",notBetween:"nicht zwischen"},lastOp:{one:"im letzten",other:"in den letzten"},ruleUnits:{year:{one:"Jahr",other:"Jahren"},month:{one:"Monat",other:"Monaten"},day:{one:"Tag",other:"Tagen"}},ruleWhose:"Eintr\xE4ge von {field} mit Gesamtwert",blanksOut:"Leere Eintr\xE4ge werden nicht behalten.",ruleUnit:"Einheit",moveLeft:"Nach links",moveRight:"Nach rechts",remove:"Feld entfernen",chartAutoNow:"Jetzt: {type}",sharedViews:"Gemeinsame Ansichten",myViews:"Meine Ansichten",noViews:"Noch keine gespeicherten Ansichten.",noViewsStore:"Noch keine. Gespeicherte Ansichten bleiben nur in diesem Browser.",publishView:"{name} als gemeinsame Ansicht ver\xF6ffentlichen",publishConfirm:"\u201E{name}\u201C als gemeinsame Ansicht ver\xF6ffentlichen? Alle, die diesen Bericht nutzen, sehen sie.",publishAction:"Ver\xF6ffentlichen",storeNote:"Nur in diesem Browser gespeichert: nicht auf anderen Ger\xE4ten, und weg, wenn die Websitedaten gel\xF6scht werden.",storeFull:"dieser Browser beh\xE4lt h\xF6chstens {max} Ansichten",storeTooLarge:"die Ansichten br\xE4uchten mehr als {max} Zeichen",storeRefused:"dieser Browser hat sie nicht behalten (Speicher gesperrt oder voll)",storeChanged:"die Ansichten wurden in einem anderen Tab ge\xE4ndert; das Men\xFC neu \xF6ffnen",toastSaved:"Ansicht \u201E{name}\u201C gespeichert",toastDeleted:"Ansicht \u201E{name}\u201C gel\xF6scht",toastPublished:"Ansicht \u201E{name}\u201C ver\xF6ffentlicht",toastSaveFailed:"Die Ansicht konnte nicht gespeichert werden: {message}",toastDeleteFailed:"Die Ansicht konnte nicht gel\xF6scht werden: {message}",toastPublishFailed:"Die Ansicht konnte nicht ver\xF6ffentlicht werden: {message}",toastSaveRejected:"Der Server konnte die Ansicht nicht speichern.",toastDeleteRejected:"Der Server konnte die Ansicht nicht l\xF6schen.",toastPublishRejected:"Der Server konnte die Ansicht nicht ver\xF6ffentlichen.",deleteView:"{name} l\xF6schen",deleteConfirm:"\u201E{name}\u201C l\xF6schen?",deleteAction:"L\xF6schen",saveView:"Aktuelle Ansicht speichern",viewName:"Name der Ansicht",thisView:"Diese Ansicht",saveNamed:"\u201E{name}\u201C speichern",saveAs:"Speichern unter\u2026",saveSharedLocked:"Gemeinsame Ansicht: nicht \xE4nderbar. \u201ESpeichern unter\u201C nutzen.",saveNotInViews:"Noch nicht gespeichert. \u201ESpeichern unter\u201C nutzen.",replaceConfirm:"\u201E{name}\u201C gibt es schon. Ersetzen?",replaceAction:"Ersetzen",replaceSharedConfirm:"Die gemeinsame Ansicht \u201E{name}\u201C f\xFCr alle ersetzen?",save:"Speichern",cancel:"Abbrechen",expandAll:"Alle aufklappen",collapseAll:"Alle zuklappen",aggregation:"Zusammenfassen mit",moreStatistics:"Weitere Statistiken",showAsNone:"Der Wert selbst",moreCalculations:"Weitere Berechnungen",showAsNames:{percentOfGrandTotal:"% des Gesamtergebnisses",percentOfRowTotal:"% der Zeilensumme",percentOfColumnTotal:"% der Spaltensumme",percentOfParentRow:"% der \xFCbergeordneten Zeile",percentOfParentColumn:"% der \xFCbergeordneten Spalte",differenceFromPrevious:"Differenz zum vorherigen",percentDifferenceFromPrevious:"% Differenz zum vorherigen",runningTotal:"Laufende Summe",percentRunningTotal:"% laufende Summe",rankAscending:"Rang, kleinster zuerst",rankDescending:"Rang, gr\xF6\xDFter zuerst"},along:"Entlang",format:"Zahlenformat",formatAuto:"Automatisch",formats:{number:"Zahl","number:0":"Zahl ohne Nachkommastellen","number:2":"Zahl mit 2 Nachkommastellen",integer:"Ganze Zahl",currency:"W\xE4hrung",percent:"Prozent",compact:"Kompakt (1,2 Tsd.)",bytes:"Bytes (KB, MB)","duration:h":"Dauer aus Stunden","duration:s":"Dauer aus Sekunden"},conditional:"Hervorheben",conditionalNone:"Keine",colorScale:"Farbskala",dataBar:"Datenbalken",rename:"Name",sortOldest:"\xC4lteste zuerst",sortNewest:"Neueste zuerst",groupNone:"Keine Gruppierung (jedes Datum mit Uhrzeit)",groupTimeline:"Entlang der Zeitachse",groupCyclic:"Gleicher Zeitraum in jedem Jahr",unitHints:{year:"2025",yearQuarter:"Q1 2025",yearMonth:"Jan. 2025",yearWeek:"2025-W03",day:"15.01.2025",quarter:"Q1 jedes Jahres",month:"Jan. jedes Jahres",week:"W03 jedes Jahres",weekday:"Mo. bis So.",hour:"00:00 bis 23:00",bin:""},bins:"Zahlenbereiche",binsState:"Bereiche zu {size} ab {start}",binSize:"Bereichsgr\xF6\xDFe",binStart:"Beginnt bei",binStartFar:"Bereiche ab {start} k\xF6nnen die Werte dieses Felds ({min} bis {max}) nicht fassen: Jede Zeile w\xE4re leer. Einen Beginn n\xE4her an den Werten w\xE4hlen.",apply:"Anwenden",topN:"Oberste Eintr\xE4ge",topCount:"Anzahl",bottom:"Unterste",topBy:"nach",searchValues:"Werte suchen",selectAll:"Alle ausw\xE4hlen",selectNone:"Keine ausw\xE4hlen",onlyThis:"Nur",valuesShown:"{shown} von {total} Werten; suchen, um weitere zu finden",conditionNumber:"Bedingung f\xFCr die Beschriftung",conditionNone:"Keine Bedingung",conditionValue:"Text",selected:"{count} ausgew\xE4hlt",exportDownload:"Herunterladen",exportCopy:"Kopieren",exportXlsx:"Excel-Arbeitsmappe (.xlsx)",exportCsv:"CSV-Datei (.csv)",exportPng:"Diagramm als Bild (.png)",exportPngNeedsChart:"Zuerst zum Diagramm wechseln.",exportNeedsField:"Zuerst ein Feld hinzuf\xFCgen.",copyTable:"Tabelle kopieren",copyDataJson:"Daten als JSON kopieren",toastTableCopied:"Tabelle kopiert: tabulatorgetrennt, wird in Excel oder Google Sheets in Spalten eingef\xFCgt",toastDataCopied:"Daten als JSON kopiert",toastCopyBlocked:"Diese Seite erlaubt kein Kopieren. Stattdessen eine Datei herunterladen.",drillTitle:"Zeilen hinter diesem Wert",drillCount:{one:"{count} Zeile",other:"{count} Zeilen"},drillShown:"Die ersten {shown} von {count} Zeilen",drillCopy:"Kopieren",drillJson:"Als JSON kopieren",drillCsv:"CSV herunterladen",drillXlsx:"Excel herunterladen",drillPart:"{shown} von {count} Zeilen",drillCopied:"{rows} kopiert: tabulatorgetrennt, wird in Excel oder Google Sheets in Spalten eingef\xFCgt",drillCopiedJson:"{rows} als JSON kopiert",drillExported:"{file} exportiert ({rows})",drillExportNote:"Enth\xE4lt die ersten {shown} von {count} Zeilen, wie hier gezeigt.",showTips:"Tipps zeigen",showSettingInfo:"Erkl\xE4rungen zeigen",resetTips:"Ausgeblendete Tipps wieder zeigen",sectionChanged:", ge\xE4ndert",help:"Hilfe",shortcutsTitle:"Tastenk\xFCrzel",keys:{Mod:"Strg",Shift:"Umschalt","Arrow keys":"Pfeiltasten",Enter:"Eingabe",Space:"Leertaste",Escape:"Esc",F10:"F10"},shortcuts:{undo:"R\xFCckg\xE4ngig",redo:"Wiederholen",move:"Zwischen den Werten der Tabelle wechseln",open:"Die Zeilen hinter einem Wert \xF6ffnen; nach einer \xDCberschrift sortieren; ein Men\xFC \xF6ffnen",drag:"Ein Feld oder einen Chip aufnehmen und ablegen",close:"Ein Men\xFC, ein Fenster oder einen Tipp schlie\xDFen",fields:"In der Feldliste: auf und ab zwischen den Feldern, links und rechts zum Griff eines Felds, seinem \u201Ei\u201C und seinem Men\xFC",fieldMenu:"Das Men\xFC des Felds im Fokus \xF6ffnen"},valueLabels:"Wertbeschriftung",valueLabelNames:{auto:"Automatisch",off:"Aus",value:"Wert",percent:"Prozent",both:"Wert und Prozent"},legend:"Legende",legendNames:{auto:"Automatisch",bottom:"Unten",right:"Rechts",off:"Aus"},chartTitle:"Titel",chartTitleNone:"Kein Titel",smoothLines:"Gegl\xE4ttete Linien",labelPosition:"Beschriftung",labelPositionNames:{outside:"Au\xDFen",inside:"Innen"},axisLabels:"Achsenbeschriftung",axisLabelNames:{auto:"Automatisch",all:"Alle (schr\xE4g)",nth:"Jede n-te"},groupLabels:"Gruppen unter der Achse",groupLabelNames:{auto:"Automatisch",on:"Ein",off:"Aus"},defaultName:"Standardnamen verwenden",shareThisView:"Diese Ansicht teilen",copyLink:"Link kopieren",copyJson:"Ansicht als JSON kopieren",downloadView:"Ansicht herunterladen (.pivotkit.json)",sharePrivacy:"Eine Ansicht enth\xE4lt die Namen der Felder und in ihren Filtern die dort gew\xE4hlten Werte: Nur dort teilen, wo diese gesehen werden d\xFCrfen.",loadView:"Ansichtsdatei \xF6ffnen\u2026",loadViewHint:"Eine Ansichtsdatei, eine Ansicht als JSON oder einen Link einf\xFCgen oder eine .pivotkit.json-Datei w\xE4hlen.",loadViewText:"Ansicht als JSON oder Link",chooseFile:"Datei w\xE4hlen\u2026",load:"Laden",loadCheckTitle:"Diese Ansicht passt vielleicht nicht zu diesen Daten",loadAnyway:"Trotzdem laden",switchAndLoad:"Zu \u201E{source}\u201C wechseln und laden",switchStartsFresh:"Der Wechsel zeigt die anderen Daten mit dieser Ansicht; R\xFCckg\xE4ngig beginnt dort.",numberInvalid:"Eine Zahl eingeben, etwa {example}.",countInvalid:"Eine ganze Zahl ab 1 eingeben.",countMax:"Eine ganze Zahl bis {max} eingeben.",sizeInvalid:"Eine Zahl \xFCber 0 eingeben, etwa {example}.",valueFilterBy:"Wert",valueFilterOp:"Bedingung",valueFilterNumber:"Zahl",valueFilterTo:"und",valueOps:{"=":"gleich","!=":"ungleich",">":"gr\xF6\xDFer als",">=":"mindestens","<":"kleiner als","<=":"h\xF6chstens",between:"zwischen",notBetween:"nicht zwischen"},moreFormats:"Weitere Formate",totals:"Summen",grandTotalRow:"Gesamtzeile",grandTotalColumn:"Gesamtspalte",rowSubtotals:"Teilergebnisse der Zeilen",colSubtotals:"Teilergebnisse der Spalten",needsRowField:"Braucht ein Feld in Zeilen.",needsColField:"Braucht ein Feld in Spalten.",needsRowFields:"Braucht zwei oder mehr Felder in Zeilen.",needsColFields:"Braucht zwei oder mehr Felder in Spalten.",expandNothing:"Nichts ist zugeklappt.",collapseNeedsRows:"Braucht zwei oder mehr Felder in Zeilen.",collapseAllDone:"Alle Gruppen sind schon zugeklappt.",groupsCollapsed:{one:"{count} Gruppe zugeklappt",other:"{count} Gruppen zugeklappt"},groupsExpanded:{one:"{count} Gruppe aufgeklappt",other:"{count} Gruppen aufgeklappt"},chartDisplay:"Darstellung",toastExported:"{file} exportiert",toastLinkCopied:"Link kopiert",toastJsonCopied:"Ansicht als JSON kopiert",toastCopyFailed:"Diese Seite erlaubt kein Kopieren. Stattdessen \u201EAnsicht herunterladen\u201C verwenden.",toastLinkTooLong:"Diese Ansicht ist zu gro\xDF f\xFCr einen Link. Stattdessen \u201EAnsicht herunterladen\u201C verwenden."};export{e as de};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as Wn,B as at,C as be,D as kt,Da as ao,E as zt,I as Gn,J as Ht,L as Wt,M as Gt,N as vt,O as Re,P as Qn,Qa as ro,R as Yn,S as Xn,W as fe,X as Qt,Y as Yt,Z as ze,a as Pt,b as qn,c as Un,d as Vt,g as ot,h as _e,ha as rt,i as Jn,ia as Xt,j as Kn,ja as Zt,k as we,l as Ae,la as en,m as jt,ma as Zn,n as qt,na as eo,o as _n,p as Ut,q as Jt,qa as to,r as zn,ra as no,s as Kt,sa as oo,w as Hn,y as Ee,z as _t}from"./chunk-IBQE3N74.js";import{B as Ke,C as nt,D as Dn,E as Mn,F as Bn,G as Bt,I as Pn,J as L,K as W,L as Vn,M as jn,a as Oe,d as ie,e as Cn,f as Je,h as Tn,i as Ln,j as X,n as ht,q as Dt,r as On,s as gt,t as $e,u as Pe,y as H,z as Mt}from"./chunk-WNTTPBZ5.js";import{B as Me,D as Be,V as $n,X as Rn,ba as Fn,e as In,m as Q}from"./chunk-WXBFHMFX.js";import{a as An}from"./chunk-O2TTHYGT.js";import"./chunk-MB64GADT.js";import{c as Le}from"./chunk-DCANE7XH.js";var lo={aboutSetting:"About {setting}",settingInfo:{grandTotalRow:"A last row with the total of every column.",grandTotalColumn:"A last column with the total of every row.",rowSubtotals:"With two or more fields in Rows: a total row under each group of the outer field.",colSubtotals:"With two or more fields in Columns: a total column after each group of the outer field.",along:"The direction the calculation walks: Rows goes down the rows of each column, Columns across the columns of each row. A running total adds up along it, a difference compares with the item before it.",showAs:"Shows each value as a share, a difference, a running total or a rank instead of the number itself. For percentages, a tip above the result says what 100% is.",exportXlsx:"Every number with all its decimals, formats kept, ready to calculate with.",exportCsv:"Percentages and calculations as the table shows them, as plain text.",copyTable:"The table as it is shown, headers and totals included: tab-separated, pastes into Excel or Google Sheets as columns.",copyDataJson:"The table's numbers with their labels as JSON, for a program. Not the view itself: that is Views \u2192 Copy view as JSON.",drillCopy:"The rows as the panel shows them, with a header row: tab-separated, pastes into Excel or Google Sheets as columns.",drillJson:"The rows as JSON objects, with the data's field names and raw values, for a program.",groupLabels:"With two or more fields in Rows: the outer field's items written once under the axis, below their categories.",labelPosition:"Outside: each slice's name and number next to it. Inside: the number on the slice, the names in the legend; outside when a donut's ring is too thin for it.",sharedView:"Only admins can change shared views.",valuesFilter:"Values are not filtered here: filter a field on Rows or Columns through its menu, or move a field to Filters."},back:"Back",backTo:"Back to the menu of {name}",levelTitle:"{name} \u203A {topic}",searchMenu:"Search in the menu of {name}",searchMenuShort:"Search in this menu (key /)",searchResults:"Results",searchNothing:"Nothing found. Try another word, or clear the search.",sortByValue:"Sort by value",sortOldestShort:"Oldest",sortNewestShort:"Newest",filterTopic:"Filter",filterAll:"All",groupTopic:"Group",groupNoneShort:"None",off:"Off",moveToTitle:"Move to",topOwn:"Top N\u2026",binsOff:"Remove ranges",valueConditionTitle:"Condition on a value",nameHint:"Applies with Enter or when you leave the field; Escape gives the name back.",showAsKeywords:"percent % share",nameKeywords:"rename label title",filterKeywords:"values pick choose rule rules condition range dates",formatDecimals:{one:"Number, {count} decimal",other:"Number, {count} decimals"},listAnd:" and ",summaryAll:"All {total} {noun} shown",summarySome:"{shown} of {total} {noun} shown",summaryNone:"Nothing shown",summaryOk:"Every item is picked, no rules.",summaryKept:"Every item is picked; the rules keep them all.",summaryQuickOnly:"Every item is picked; {quick}.",summaryPicks:"{count} left out by your picks",summaryQuick:"{count} outside {quick}",summaryRules:{one:"{items} left out by the rule",other:"{items} left out by the rules"},summaryTotals:{one:"{items} left out by the rule on the total",other:"{items} left out by the rules on the totals"},summaryRows:"{rows} of {total} rows",summaryData:"data {range}",yearsAll:"{years} combined",yearsOne:"{year} only",emptyPicks:"Nothing is picked.",emptyRules:"No {noun} meets {rules}.",emptyTotal:"No {noun} has a total {rule} \u2013 {spread}.",totalSpread:"the totals go from {low} ({lowItem}) to {high} ({highItem})",totalWords:"{measure} that {op} {number}",totalWordsTwo:"{measure} that {op} {from} and {to}",resetFilter:"Reset filter",nouns:{item:{one:"item",other:"items"},value:{one:"value",other:"values"},date:{one:"date",other:"dates"},year:{one:"year",other:"years"},quarter:{one:"quarter",other:"quarters"},month:{one:"month",other:"months"},week:{one:"week",other:"weeks"},day:{one:"day",other:"days"},weekday:{one:"weekday",other:"weekdays"},hour:{one:"hour",other:"hours"},range:{one:"range",other:"ranges"}},quickTitle:"Quick choices",quickCount:{year:"Number of years",month:"Number of months",day:"Number of days"},quickLast:{year:{one:"Last {count} year",other:"Last {count} years"},month:{one:"Last {count} month",other:"Last {count} months"},day:{one:"Last {count} day",other:"Last {count} days"}},quickRows:"{rows} rows",quickHidden:{one:"{choices} is not offered: the data end {latest}.",other:"{choices} are not offered: the data end {latest}."},anchorLabel:"Counted back from",anchorToday:"today ({date})",anchorLatest:"the latest record ({date})",quickLine:"Quick choice: {text}",changeAbove:"change it above",yearsCombined:"Years combined",yearsCombinedHint:"one {noun} over the years ticked",yearsCombinedOne:"The table shows {year} only.",pickItems:"Pick items",picksState:"{picked} of {total} picked",picksAll:"all {total} picked",clear:"Clear",clearPicks:"Clear picks",rulesState:{one:"{count} rule",other:"{count} rules"},rulesNoneState:"No rules",removeAll:"Remove",removeRules:"Remove the rules",tailOut:{one:"Left out by the rules ({count}) \u2013 its tick applies again once they go",other:"Left out by the rules ({count}) \u2013 their ticks apply again once they go"},rulesKeep:"Keep the {noun} for which all of these are true:",rulesNone:"Keep the {noun} for which all of these are true. Add one below.",ruleKeeps:"Keeps {kept} of {total} {noun}",ruleKeepsNone:"Keeps 0 of {total} {noun} \u2013 {spread}.",ruleIncomplete:"Applies once it is complete.",explainRule:"Explain this rule",ruleInfo:{number:"Compares the value itself, not its total. Example: \u201Cis between 20 and 25\u201D keeps the values from 20 to 25.",date:"Compares each date by its calendar day. Example: \u201Cis before Mar 1, 2022\u201D keeps every day up to Feb 28, 2022.",group:"Compares each {noun} by its place on the time line. Example: \u201Cis from 2022\u201D keeps 2022 and every later one.",cyclic:"Compares each {noun} by its place in the year, over all the years combined. Example: \u201Cis from Jun\u201D keeps Jun to Dec.",total:"The total is the {noun}\u2019s Grand Total \u2013 the {measure} over {scope}, as the Grand Total row shows it \u2013 not a single cell. Example: \u201Cis greater than 20\u201D keeps the {nouns} whose total is above 20.",name:"Compares the name of each {noun} as the table writes it. Example: \u201Ccontains ar\u201D keeps Mar and March."},scopeItems:"all {count} {field} items",scopeDates:"the dates {range}",scopeRows:"every row",pickerSearch:"Search items",pickerMatch:"{count} of {total} match",pickerNone:"No match",rulesTitle:"Rules",ruleAnd:"and",addRule:"Add a rule",addRuleItem:"Compare {field}",addRuleTotal:"Compare its total",addRuleName:"Rule on the name",removeRule:"Remove this rule",rulesFull:"At most {max} rules per field.",ruleName:"The name",ruleValue:"Value",ruleDate:"Date",dateOps:{"=":"is","!=":"is not",">":"is after",">=":"is from","<":"is before","<=":"is up to",between:"is between",notBetween:"is not between"},lastOp:{one:"is in the last",other:"is in the last"},ruleUnits:{year:{one:"year",other:"years"},month:{one:"month",other:"months"},day:{one:"day",other:"days"}},ruleWhose:"{field} items whose total",blanksOut:"Blank items are not kept.",ruleUnit:"Unit",moveLeft:"Move left",moveRight:"Move right",remove:"Remove field",chartAutoNow:"Now: {type}",sharedViews:"Shared views",myViews:"My views",noViews:"No saved views yet.",noViewsStore:"None yet. Saved views stay in this browser only.",publishView:"Publish {name} as a shared view",publishConfirm:"Publish \u201C{name}\u201D as a shared view? Everyone who uses this report sees it.",publishAction:"Publish",storeNote:"Kept in this browser only: not on other devices, and gone when the site's data is cleared.",storeFull:"this browser keeps at most {max} views",storeTooLarge:"the views would take more than {max} characters",storeRefused:"this browser did not keep it (storage blocked or full)",storeChanged:"the views were changed in another tab; open the menu again",toastSaved:"View \u201C{name}\u201D saved",toastDeleted:"View \u201C{name}\u201D deleted",toastPublished:"View \u201C{name}\u201D published",toastSaveFailed:"The view could not be saved: {message}",toastDeleteFailed:"The view could not be deleted: {message}",toastPublishFailed:"The view could not be published: {message}",toastSaveRejected:"The server could not save the view.",toastDeleteRejected:"The server could not delete the view.",toastPublishRejected:"The server could not publish the view.",deleteView:"Delete {name}",deleteConfirm:"Delete \u201C{name}\u201D?",deleteAction:"Delete",saveView:"Save current view",viewName:"Name of the view",thisView:"This view",saveNamed:"Save \u201C{name}\u201D",saveAs:"Save as\u2026",saveSharedLocked:"Shared view: you cannot change it. Use Save as.",saveNotInViews:"Not saved yet. Use Save as.",replaceConfirm:"\u201C{name}\u201D exists. Replace it?",replaceAction:"Replace",replaceSharedConfirm:"Replace the shared view \u201C{name}\u201D for everyone?",save:"Save",cancel:"Cancel",expandAll:"Expand all",collapseAll:"Collapse all",aggregation:"Summarize by",moreStatistics:"More statistics",showAsNone:"The value itself",moreCalculations:"More calculations",showAsNames:{percentOfGrandTotal:"% of grand total",percentOfRowTotal:"% of row total",percentOfColumnTotal:"% of column total",percentOfParentRow:"% of parent row",percentOfParentColumn:"% of parent column",differenceFromPrevious:"Difference from previous",percentDifferenceFromPrevious:"% difference from previous",runningTotal:"Running total",percentRunningTotal:"% running total",rankAscending:"Rank, smallest first",rankDescending:"Rank, largest first"},along:"Along",format:"Number format",formatAuto:"Automatic",formats:{number:"Number","number:0":"Number, no decimals","number:2":"Number, 2 decimals",integer:"Whole number",currency:"Currency",percent:"Percent",compact:"Compact (1.2K)",bytes:"Bytes (KB, MB)","duration:h":"Duration from hours","duration:s":"Duration from seconds"},conditional:"Highlight",conditionalNone:"None",colorScale:"Colour scale",dataBar:"Data bars",rename:"Name",sortOldest:"Oldest first",sortNewest:"Newest first",groupNone:"No grouping (every date and time)",groupTimeline:"Along the time line",groupCyclic:"Same period every year",unitHints:{year:"2025",yearQuarter:"Q1 2025",yearMonth:"Jan 2025",yearWeek:"2025-W03",day:"Jan 15, 2025",quarter:"Q1 of every year",month:"Jan of every year",week:"W03 of every year",weekday:"Mon to Sun",hour:"00:00 to 23:00",bin:""},bins:"Number ranges",binsState:"Ranges of {size} from {start}",binSize:"Range size",binStart:"Starting at",binStartFar:"Ranges from {start} cannot hold this field's values ({min} to {max}): every row would be blank. Pick a start closer to them.",apply:"Apply",topN:"Top items",topCount:"Count",bottom:"Bottom",topBy:"by",searchValues:"Search values",selectAll:"Select all",selectNone:"Select none",onlyThis:"Only",valuesShown:"{shown} of {total} values; search to find more",conditionNumber:"Condition on the label",conditionNone:"No condition",conditionValue:"Text",selected:"{count} selected",exportDownload:"Download",exportCopy:"Copy",exportXlsx:"Excel workbook (.xlsx)",exportCsv:"CSV file (.csv)",exportPng:"Chart image (.png)",exportPngNeedsChart:"Switch to Chart first.",exportNeedsField:"Add a field first.",copyTable:"Copy table",copyDataJson:"Copy data as JSON",toastTableCopied:"Table copied: tab-separated, pastes into Excel or Google Sheets as columns",toastDataCopied:"Data copied as JSON",toastCopyBlocked:"This page does not allow copying. Download a file instead.",drillTitle:"Rows behind this value",drillCount:{one:"{count} row",other:"{count} rows"},drillShown:"Showing the first {shown} of {count} rows",drillCopy:"Copy",drillJson:"Copy as JSON",drillCsv:"Download CSV",drillXlsx:"Download Excel",drillPart:"{shown} of {count} rows",drillCopied:"Copied {rows}: tab-separated, pastes into Excel or Google Sheets as columns",drillCopiedJson:"Copied {rows} as JSON",drillExported:"Exported {file} ({rows})",drillExportNote:"Holds the first {shown} of {count} rows, as shown here.",showTips:"Show tips",showSettingInfo:"Show explanations",resetTips:"Show dismissed tips again",sectionChanged:", changed",help:"Help",shortcutsTitle:"Keyboard shortcuts",keys:{Mod:"Ctrl",Shift:"Shift","Arrow keys":"Arrow keys",Enter:"Enter",Space:"Space",Escape:"Escape",F10:"F10"},shortcuts:{undo:"Undo",redo:"Redo",move:"Move between values in the table",open:"Open the rows behind a value; sort by a header; open a menu",drag:"Pick up a field or chip, and drop it",close:"Close a menu, a panel or a tip",fields:"In the field list: up and down between fields, left and right to a field's grip, its \u201Ci\u201D and its menu",fieldMenu:"Open the menu of the field in focus"},valueLabels:"Value labels",valueLabelNames:{auto:"Automatic",off:"Off",value:"Value",percent:"Percent",both:"Value and percent"},legend:"Legend",legendNames:{auto:"Automatic",bottom:"Bottom",right:"Right",off:"Off"},chartTitle:"Title",chartTitleNone:"No title",smoothLines:"Smooth lines",labelPosition:"Labels",labelPositionNames:{outside:"Outside",inside:"Inside"},axisLabels:"Axis labels",axisLabelNames:{auto:"Automatic",all:"All (slanted)",nth:"Every n-th"},groupLabels:"Group labels under the axis",groupLabelNames:{auto:"Automatic",on:"On",off:"Off"},defaultName:"Use the default name",shareThisView:"Share this view",copyLink:"Copy link",copyJson:"Copy view as JSON",downloadView:"Download view (.pivotkit.json)",sharePrivacy:"A view holds the names of fields and, in its filters, the values chosen there: share it only where those may be seen.",loadView:"Open view file\u2026",loadViewHint:"Paste a view file, a view as JSON or a link, or choose a .pivotkit.json file.",loadViewText:"View as JSON or link",chooseFile:"Choose file\u2026",load:"Load",loadCheckTitle:"This view may not fit this data",loadAnyway:"Load anyway",switchAndLoad:"Switch to \u201C{source}\u201D and load",switchStartsFresh:"Switching shows the other data with this view; Undo starts there.",numberInvalid:"Enter a number, such as {example}.",countInvalid:"Enter a whole number of 1 or more.",countMax:"Enter a whole number up to {max}.",sizeInvalid:"Enter a number above 0, such as {example}.",valueFilterBy:"Value",valueFilterOp:"Condition",valueFilterNumber:"Number",valueFilterTo:"and",valueOps:{"=":"is","!=":"is not",">":"is greater than",">=":"is at least","<":"is less than","<=":"is at most",between:"is between",notBetween:"is not between"},moreFormats:"More formats",totals:"Totals",grandTotalRow:"Grand total row",grandTotalColumn:"Grand total column",rowSubtotals:"Row subtotals",colSubtotals:"Column subtotals",needsRowField:"Needs a field in Rows.",needsColField:"Needs a field in Columns.",needsRowFields:"Needs two or more fields in Rows.",needsColFields:"Needs two or more fields in Columns.",expandNothing:"Nothing is collapsed.",collapseNeedsRows:"Needs two or more fields in Rows.",collapseAllDone:"Every group is collapsed already.",groupsCollapsed:{one:"{count} group collapsed",other:"{count} groups collapsed"},groupsExpanded:{one:"{count} group expanded",other:"{count} groups expanded"},chartDisplay:"Display",toastExported:"Exported {file}",toastLinkCopied:"Link copied",toastJsonCopied:"View copied as JSON",toastCopyFailed:"This page does not allow copying. Use \u201CDownload view\u201D instead.",toastLinkTooLong:"This view is too large for a link. Use \u201CDownload view\u201D instead."},tn=new Map([["en",lo]]);function Zo(e,t){tn.set(e,t)}var ea=e=>tn.has(e),so=new WeakMap;function io(e){let t=tn.get(e.lang)??lo,n=so.get(e);if(n&&n.base===t)return n.out;let o={...e,...jn(t,e[Vn])};return so.set(e,{base:t,out:o}),o}var $=Le(Oe(),1);var m=Le(Oe(),1);var V=Le(Oe(),1);var b=Le(Oe(),1),Ge=Le(Oe(),1);var oe=Le(Oe(),1),k=Le(Oe(),1);var Fe=Object.freeze({count:500,text:5e6});function ta(e){try{return JSON.stringify(e)?.length??0}catch{return-1}}function co(e){let t={templates:[],issues:[]},n=(a,l)=>t.issues.push({path:a,message:l}),o=e;if(typeof e=="string"){if(e.length>Fe.text)return n("",`longer than ${Fe.text} characters; not read`),t;try{o=JSON.parse(e)}catch{return n("","not valid JSON"),t}}if(!Array.isArray(o))return n("","not a list of templates"),t;o.length>Fe.count&&n("",`${o.length} templates, more than ${Fe.count}: the first ${Fe.count} are read`);let r=typeof e=="string"?-1/0:0;for(let a=0;a<Math.min(o.length,Fe.count);a++){let l=o[a];if(r!==-1/0){let h=ta(l);if(h<0){n(`[${a}]`,"not JSON; left out");continue}if(r+=h,r>Fe.text){n(`[${a}]`,`the templates are longer than ${Fe.text} characters as JSON; this one and the rest are left out`);break}}let s=Bn(l);if(s.failed||!s.view){n(`[${a}]`,`${s.issues.at(-1)?.message??"no view"}; left out`);continue}let i=s.view===l,d=Mt(i?Object.hasOwn(s.view,"name")?s.view.name:void 0:s.name,Ke.name);if(!d){n(`[${a}]`,"no name; left out");continue}let u={...s.view};i&&delete u.name;let c={name:d,view:u},p=Mt(s.description,Ke.description);p&&(c.description=p),s.source&&Object.keys(s.source).length>0&&(c.source=s.source),t.templates.push(c),s.issues.forEach(h=>n(`[${a}]${h.path?`.${h.path}`:""}`,h.message))}return t}var P=Le(Oe(),1);var Z=Le(Oe(),1),na=new Set(["count","countUnique","listUnique"]),yt=e=>na.has(e)?"count":"field";function rn(e,t,n,o={}){let r=at(e);if(!r.values[t])return e;let a=e.values[t],l={...r.values[t],...n};if(n.agg&&n.agg!==a.agg){l.showAs=n.showAs??null;let s=o.defaults??{},i=typeof s.format=="string"&&Me(s.format)?s.format:null,d=a.format&&a.format!==i?a.format:null;n.format!==void 0?l.format=n.format:d?l.format=yt(a.agg)===yt(n.agg)?d:null:l.format=i&&yt(typeof s.agg=="string"?s.agg:"sum")===yt(n.agg)?i:null}return r.values[t]=l,r}function oa(e,t,n){if(!n)return null;for(let o of[n.min,n.max]){let r=Math.floor((o-t)/e),a=t+r*e,l=e*1e-9;if(!Number.isSafeInteger(r)||a+e===a||a>o+l||o>=a+e+l)return"far"}return null}function st(e,t,n,o){let r=at(e),a=r.filters.findIndex(i=>be(i.field,t)),l=r.filters.filter(i=>!(be(i.field,t)&&n.includes(i.type))),s=a===-1?l.length:Math.min(a,l.length);return l.splice(s,0,...o),r.filters=l,!zt(r,t)&&kt(e).some(i=>be(i,t))&&!l.some(i=>be(i.field,t))&&r.filters.splice(s,0,{field:t,type:"exclude",items:[]}),r}function No(e,t,n,o){let r=at(e),a=n?JSON.stringify(n):null,l=a===null?-1:r.filters.findIndex(s=>be(s.field,t)&&JSON.stringify(s)===a);if(l===-1){if(!o)return r;let s=r.filters.map(i=>be(i.field,t)).lastIndexOf(!0);return r.filters.splice(s+1,0,o),r}return o?r.filters[l]=o:(r.filters.splice(l,1),!zt(r,t)&&kt(e).some(s=>be(s,t))&&!r.filters.some(s=>be(s.field,t))&&r.filters.splice(l,0,{field:t,type:"exclude",items:[]})),r}function sn(e,t,n,o){let r=new Set(n.map(l=>JSON.stringify(l))),a=o.filter(l=>!r.has(JSON.stringify(l)));return st(e,t,["include","exclude"],a.length?[{field:t,type:"exclude",items:a}]:[])}function uo(e,t,n){return st(e,t,["label"],n&&n.value!==""?[{field:t,type:"label",op:n.op,value:n.value}]:[])}function xo(e,t,n,o){let r=n?{field:t,type:"top",count:n.count,bottom:!!n.bottom,...n.by?{by:n.by}:{}}:null;return o?No(e,t,o,r):st(e,t,["top"],r?[r]:[])}var St=Object.freeze(["relative","compare","value","label"]),mo=10,We=(e,t,n,o)=>No(e,t,n,o),aa=Object.freeze(["year","yearQuarter"]);function So(e,t,n){let o=vt(t,n),r=e.column(Re(t,n))?.type??"string",a=r==="date",l=o?o.by==="day"?"date":"group":r==="number"||r==="date"?r:null,s=a&&!!o&&H.cyclicUnits.includes(o.by),i=a&&!s;return{item:l,dates:a,cyclic:s,quick:i,months:i&&!aa.includes(o?.by),days:i&&l==="date",unit:o?.by??null}}function Co(e,t,{labels:n,locale:o,timeZone:r,date:a,labelOf:l,span:s}){return t.type==="value"?Kn(e,t,n,o):zn(t,n,o,{timeZone:r,date:a,labelOf:l,span:s})}function ra(e,t,n,o=[]){let r=fe(e,t,["relative"]),a=fe(e,t,["compare"]);if(n.cyclic){let d=a.filter(To),u=d.length?sa(d,o):null;return u?{id:"yearsCombined",years:u,filters:d}:{id:"all",filters:[]}}let l={year:!0,month:n.months,day:n.days},s=r.find(d=>l[d.unit]);return s?{id:s.unit==="year"?s.count===1?"thisYear":"years":`${s.unit}s`,count:s.count,anchor:s.anchor??"today",filters:[s]}:{id:"all",filters:[]}}function sa(e,t){let n=new Set(t);for(let o of e){let[r,a]=Jt(o.value,o.value2).map(Number);n=new Set([...n].filter(l=>(r<=l&&l<=a)==(o.op==="between")))}return n.size?[...n].sort((o,r)=>o-r):null}var To=e=>e.type==="compare"&&(e.op==="between"||e.op==="notBetween")&&Jt(e.value,e.value2)!==null;function la(e,t,n){if(!t.length||t.length===n.length)return[];let o=(l,s)=>`${String(l).padStart(4,"0")}-${s?"12-31":"01-01"}`,r=(l,s,i)=>({field:e,type:"compare",op:l,value:o(s,!1),value2:o(i,!0)}),a=[r("between",t[0],t[t.length-1])];for(let l=1;l<t.length;l++)n.some(s=>t[l-1]<s&&s<t[l])&&a.push(r("notBetween",t[l-1]+1,t[l]-1));return a}function ia(e,t,n,o){let r=fe(e,t,["compare"]).filter(To).reduce((a,l)=>We(a,t,l,null),e);return la(t,n,o).reduce((a,l)=>We(a,t,null,l),r)}function Lo(e,t,n){return st(e,t,["relative"],n?[{field:t,type:"relative",unit:n.unit,count:n.count,...n.anchor==="latest"?{anchor:"latest"}:{}}]:[])}function ca(e,t,n){let o=at(e);for(let r of o.filters)be(r.field,t)&&r.type==="relative"&&(delete r.anchor,n==="latest"&&(r.anchor="latest"));return o}var ua=(e,t)=>st(e,t,["include","exclude",...St],[]);function nn(e,t,n,o,r){let a=Rn(e,{...t,rows:[n],cols:[],values:[{...o.field?{field:o.field}:{},agg:o.agg}],filters:r,sort:[]}),l=new Map;if(!a.values.length)return{totals:l,rows:a.rows.length};for(let s of a.rowRoot.children){let i=a.value(s,a.colRoot,0);l.set(JSON.stringify(s.key),typeof i=="number"&&Number.isFinite(i)?i:null)}return{totals:l,rows:a.rows.length}}function Oo(e,t){return t&&!e.some(n=>ze(n,t))?[...e,{field:t.field??null,agg:t.agg}]:e}function ln(e,t){let n=[];for(let o of e.values){let r={field:o.field??null,agg:o.agg};Yt(o,o.field?t(o.field)??"string":"number")&&!n.some(a=>ze(a,r))&&n.push(r)}return n.length?n:[{field:null,agg:"count"}]}function ma(e,t,n=[]){let o=new Set(n.map(r=>JSON.stringify(r)));return fe(e,t,St).filter(r=>!o.has(JSON.stringify(r))).reduce((r,a)=>We(r,t,a,null),e)}var da=Object.freeze(["grandTotalRow","grandTotalColumn","rowSubtotals","colSubtotals"]);function pa(e,t){return t==="grandTotalRow"?e.rows.length>=1?null:"needsRowField":t==="grandTotalColumn"?e.cols.length>=1?null:"needsColField":t==="rowSubtotals"?e.rows.length>=2?null:"needsRowFields":e.cols.length>=2?null:"needsColFields"}function Ao(e,t,n){let o=e.column(Re(t,n))?.type??"string";return o==="date"||o==="boolean"?null:o==="number"?"number":"text"}function fa(e,t,n,o,r){let a=s=>typeof s.field=="string"&&s.field.toLowerCase()===t.toLowerCase(),l=[];n&&n.summary&&l.push(L(o.filterSummary,{shown:n.summary.shown.toLocaleString(r),total:n.summary.total.toLocaleString(r)})),l.push(...n?.rules??[]);for(let s of e.filters.filter(a))(s.type==="value"||s.type==="label"&&!n?.rules)&&l.push(Co(e,s,{labels:o,locale:r,timeZone:"UTC",date:!1}));return l.length?l.join(", "):null}var hn=300,se=e=>JSON.stringify(e);function Io({items:e,selected:t,onChange:n,labels:o,locale:r,autoFocus:a=!1,tail:l,children:s}){let[i,d]=(0,V.useState)(""),u=ie(),c=i.trim().toLocaleLowerCase(),p=c?e.filter(S=>S.label.toLocaleLowerCase().includes(c)):e,h=l?p.filter(S=>!l.isOut(S)):p,g=l?p.filter(S=>l.isOut(S)):[],f=h.slice(0,hn),N=S=>{let C=new Set(t);for(let x of p)S?C.add(se(x.value)):C.delete(se(x.value));n(C)},w=S=>{let C=new Set(t),x=se(S);C.has(x)?C.delete(x):C.add(x),n(C)},v=(S,C)=>{let x=se(S.value);return V.default.createElement("li",{key:x,className:`pk-value${C?" pk-value-out":""}`},V.default.createElement("label",null,V.default.createElement("input",{type:"checkbox",name:u,checked:t.has(x),onChange:()=>w(S.value)}),V.default.createElement("span",{className:"pk-value-label"},S.label),V.default.createElement("span",{className:"pk-count"},S.count.toLocaleString(r))),V.default.createElement("button",{type:"button",className:"pk-link pk-only",onClick:()=>n(new Set([x])),"aria-label":`${o.onlyThis}: ${S.label}`},o.onlyThis))};return V.default.createElement(V.default.Fragment,null,V.default.createElement("label",{className:"pk-search"},V.default.createElement(X,{name:"search"}),V.default.createElement("span",{className:"pk-sr"},o.searchValues),V.default.createElement(Ee,{type:"search",value:i,placeholder:o.searchValues,onChange:d,clearLabel:o.clearText,"data-autofocus":a?"":void 0,"data-testid":"filter-search"})),V.default.createElement("div",{className:"pk-filter-actions"},V.default.createElement("button",{type:"button",className:"pk-action",onClick:()=>N(!0),"data-testid":"select-all"},o.selectAll),V.default.createElement("button",{type:"button",className:"pk-action",onClick:()=>N(!1),"data-testid":"select-none"},o.selectNone)),V.default.createElement("div",{className:"pk-filter-body"},V.default.createElement("ul",{className:"pk-values",role:"list"},f.map(S=>v(S,!1)),h.length>f.length?V.default.createElement("li",{className:"pk-hint pk-values-more"},L(o.valuesShown,{shown:f.length,total:h.length.toLocaleString(r)})):null,g.length&&l?l.render(g,S=>v(S,!0),c!==""):null),s))}function ha({view:e,base:t,field:n,encoded:o,locale:r,labels:a,commit:l,close:s}){let i=t??e,d=ie(),u=(0,V.useMemo)(()=>Pe(o,n,{view:i,locale:r,labels:a.core}),[o,n,i,r,a]),c=(0,V.useMemo)(()=>u?u.items.map(O=>O.value):[],[u]),[p,h]=(0,V.useState)(()=>new Set(Qt(i,n,c).map(se))),g=fe(i,n,["label"])[0],[f,N]=(0,V.useState)(g?.op??""),[w,v]=(0,V.useState)(g?.value??"");if(!u)return null;let S=Q(n,a.core),C=()=>{let O=sn(i,n,c.filter(B=>p.has(se(B))),c);O=uo(O,n,f?{op:f,value:w}:null),s(),l(O,{step:"filter",field:S})},x=Ao(o,i,n)??(g?"text":null);return V.default.createElement("form",{className:"pk-filter",onSubmit:O=>{O.preventDefault(),C()}},V.default.createElement("div",{className:"pk-popover-head"},V.default.createElement("h3",null,L(a.filterTitle,{field:S})),V.default.createElement("span",{className:"pk-muted"},L(a.selected,{count:p.size.toLocaleString(r)}))),V.default.createElement(Io,{items:u.items,selected:p,onChange:h,labels:a,locale:r,autoFocus:!0},x?V.default.createElement("fieldset",{className:"pk-condition"},V.default.createElement("legend",null,x==="number"?a.conditionNumber:a.condition),V.default.createElement("select",{name:`${d}-op`,value:f,onChange:O=>N(O.target.value),"aria-label":x==="number"?a.conditionNumber:a.condition},V.default.createElement("option",{value:""},a.conditionNone),H.labelOps.map(O=>V.default.createElement("option",{key:O,value:O},a.labelOps[O]??O))),f?V.default.createElement(Ee,{type:"text",value:w,onChange:v,onClear:()=>{!t&&fe(i,n,["label"]).length&&l(uo(i,n,null),{step:"filter",field:S})},clearLabel:a.clearText,"aria-label":a.conditionValue,placeholder:a.conditionValue,maxLength:1e3,"data-testid":"filter-condition-text"}):null):null),V.default.createElement("div",{className:"pk-popover-foot"},V.default.createElement("button",{type:"button",className:"pk-btn",onClick:s},a.cancel),V.default.createElement("button",{type:"submit",className:"pk-btn pk-primary","data-testid":"filter-apply"},a.apply)))}function ns({target:e,onClose:t,view:n,encoded:o,locale:r,labels:a,commit:l}){let s=(0,V.useMemo)(()=>({current:e?e.anchor:null}),[e]);return V.default.createElement(Dt,{open:!!e,anchor:s,onClose:t,label:e?L(a.filterTitle,{field:Q(e.field,a.core)}):"",className:"pk-filter-popover",fill:!0},e?V.default.createElement(ha,{key:e.field,view:n,base:e.base,field:e.field,encoded:o,locale:r,labels:a,commit:l,close:t}):null)}function lt({id:e,name:t,tabIndex:n}){let{explain:o,labels:r}=(0,Ge.useContext)(rt),a=r&&r.settingInfo&&Object.hasOwn(r.settingInfo,e)?r.settingInfo[e]:null;return!o||!r||!a?null:Ge.default.createElement(_t,{info:{description:a},name:t,label:L(r.aboutSetting,{setting:t}),labels:r,className:"pk-setting-info",testId:`setting-info-${e}`,tabIndex:n})}function Qe({title:e,children:t,info:n}){let o=typeof e=="string"?e:"";return Ge.default.createElement(gt,{title:e,head:n?Ge.default.createElement(lt,{id:n,name:o}):null},t)}var po=Object.freeze(["number","number:0","number:2","currency","percent"].filter(Me)),fo=Object.freeze(["integer","compact","bytes","duration:h","duration:s"].filter(Me)),ho=H.showAs.filter(e=>["percentOfGrandTotal","percentOfRowTotal","percentOfColumnTotal"].includes(e)),go=Object.freeze({percent:.256,bytes:1536e3,"duration:h":1.5,"duration:s":3725}),cn=Object.freeze([3,5,10]);function gn(e,t,n,o,r,a,l,s){let i=u=>({step:"moved",field:a,zone:u}),d=Wn.filter(u=>u!==t).map(u=>({id:`move-${u}`,text:L(r.moveTo,{zone:r.zones[u]}),icon:"chevronRight",closes:!0,change:()=>({view:Gn(e,t,n,u,void 0,{type:l,defaults:u==="values"?s:void 0}),note:i(u)})}));return t!=="filters"&&n>0&&d.push({id:"move-left",text:r.moveLeft,icon:"chevronRight",closes:!0,change:()=>({view:Ht(e,t,n,n-1),note:{step:"reordered",zone:t}})}),t!=="filters"&&n<o-1&&d.push({id:"move-right",text:r.moveRight,icon:"chevronRight",closes:!0,change:()=>({view:Ht(e,t,n,n+1),note:{step:"reordered",zone:t}})}),{id:"move",title:r.moveToTitle,kind:"menu",icon:"swap",groups:[{choices:d}]}}function ga({view:e,zone:t,index:n,field:o,types:r,labels:a,locale:l,state:s,defaultsOf:i,encoded:d}){let u=Re(e,o),c=Q(o,a.core),p=r.get(u.toLowerCase()),h=p==="date",g=vt(e,o),f=Yn(e,o),N=R=>R.toLocaleString(l,{maximumFractionDigits:6}),w=Oo(ln(e,R=>r.get(R.toLowerCase())),f?.by==="value"?f.value:null),v=u===o?i?.(u)?.order:void 0,S=Array.isArray(v)&&v.length>0,C=f?.by==="custom"?f.items:S?v:null,x=(R,y,M)=>f?f.by===R&&f.order===y&&(R!=="value"||ze(f.value,M)):R==="label"&&y==="asc",O=(R,y,M,q,U,ee)=>({id:`sort-${R}`,text:y,icon:ee,checked:x(M,q,U),change:()=>{let K=M==="value"?{by:M,order:q,value:U}:M==="custom"?{by:M,order:q,items:[...C]}:{by:M,order:q};return{view:Qn(e,o,Xn(K,S)),note:{step:"sort",field:c}}}}),B=w.flatMap((R,y)=>{let M=_e(e,R,a);return[O(`value-desc-${y}`,L(a.sortValueDesc,{value:M}),"value","desc",R,"sortDesc"),O(`value-asc-${y}`,L(a.sortValueAsc,{value:M}),"value","asc",R,"sortAsc")]});C&&B.push(O("custom",a.sortCustom,"custom","asc",null,"sortAsc"),O("custom-desc",a.sortCustomDesc,"custom","desc",null,"sortDesc"));let E=f&&f.by!=="label"?Jn(e,f,a):null,A=[{id:"sort",title:a.sort,kind:"segmented",icon:"sortAsc",state:E,changed:!!E,groups:[{choices:[O("label-asc",h?a.sortOldestShort:a.sortLabelAsc,"label","asc",null),O("label-desc",h?a.sortNewestShort:a.sortLabelDesc,"label","desc",null)]}]},{id:"sortValue",title:a.sortByValue,kind:B.length<=2?"inline":"menu",icon:"sortDesc",state:E,changed:!!E,groups:[{choices:B}]},$o({view:e,field:o,labels:a,locale:l,state:s,encoded:d})];if(h){let R=M=>()=>{let q=Q(u,a.core),U=M?Kt(q,M,a):null;return{view:Gt(e,o,M,{name:U??void 0}).view,note:{step:"group",field:q}}},y=M=>({id:`group-${M}`,text:a.units[M]??M,hint:a.unitHints[M]||void 0,checked:g?.by===M,closes:!0,change:R(M)});A.push({id:"group",title:a.groupTopic,kind:"menu",icon:"date",state:g?a.units[g.by]??g.by:a.groupNoneShort,changed:!!g,groups:[{title:a.groupTimeline,choices:H.timelineUnits.map(y)},{title:a.groupCyclic,choices:H.cyclicUnits.map(y)},{choices:[{id:"group-none",text:a.groupNone,checked:!g,closes:!0,change:R(null)}]}]})}else if(p==="number"){let R=g?.by==="bin"?g:null;A.push({id:"bins",title:a.bins,kind:"panel",icon:"number",state:R?L(a.binsState,{size:N(R.size),start:N(R.origin??0)}):a.off,changed:!!R})}let I=fe(e,o,["top"])[0],D=I?.by??ln(e,R=>r.get(R.toLowerCase()))[0];return A.push({id:"top",title:a.topN,kind:"panel",icon:"top",state:I?ya(e,I,a,l):a.off,changed:!!I,searchExtra:cn.map(R=>({id:`top-${R}`,text:L(a.topBadge,{count:R.toLocaleString(l)}),choice:{id:`top-${R}`,text:L(a.topBadge,{count:R.toLocaleString(l)}),checked:!!(I&&!I.bottom&&I.count===R),change:()=>({view:xo(e,o,{count:R,bottom:!1,by:D},I),note:{step:"top",field:c}})}}))}),A.push(gn(e,t,n,e[t].length,a,c,p,i?.(o))),A}var ka=/\d+/;function $o({view:e,field:t,labels:n,locale:o,state:r,encoded:a}){let s={step:"filter",field:Q(t,n.core)},i=fa(e,t,r,n,o),d=a?So(a,e,t):null,u=a?.timeZone??"UTC",c=h=>h.charAt(0).toLocaleUpperCase(o)+h.slice(1),p=d?.quick?h=>{let g=Number(ka.exec(h)?.[0]);if(!Number.isSafeInteger(g)||g<1)return[];let f=g>H.relativeMaxCount?[]:d.months?["year","month"]:["year"],N=fe(e,t,["relative"])[0]?.anchor,w=Wt(a,Re(e,t)),v=f.map(x=>{let O=c(Ut({unit:x,count:g,anchor:N},n,o,u,void 0,w));return{id:`quick-${x}-${g}`,text:O,choice:{id:`quick-${x}-${g}`,text:O,change:()=>({view:Lo(e,t,{unit:x,count:g,anchor:N}),note:s})}}});return d.item==="group"&&g>=1e3&&g<=9999&&e.derived.some(x=>x.name.toLowerCase()===t.toLowerCase()&&x.by==="year")?[...[">=","<=","<",">"].map(x=>{let O={field:t,type:"compare",op:x,value:g},B=c(L(n.compareShort[x],{value:String(g)}));return{id:`compare-${x}-${g}`,text:B,choice:{id:`compare-${x}-${g}`,text:B,change:()=>({view:We(e,t,null,O),note:s})}}}),...v]:v}:void 0;return{id:"filter",title:n.filterTopic,kind:"panel",icon:"filter",state:i??n.filterAll,changed:i!==null,keywords:n.filterKeywords,searchExtra:[{id:"open-filter-rules",text:n.rulesTitle,focus:"conditions"},{id:"open-filter-text",text:n.addRuleName,focus:"conditions"},{id:"open-filter-value",text:n.addRuleTotal,focus:"conditions"}],searchFor:p}}function va({view:e,index:t,field:n,types:o,labels:r,locale:a,state:l,encoded:s}){let i=o.get(Re(e,n).toLowerCase());return[$o({view:e,field:n,labels:r,locale:a,state:l,encoded:s}),gn(e,"filters",t,kt(e).length,r,Q(n,r.core),i)]}function ya(e,t,n,o){let r=t.by??(e.values?.[0]?{field:e.values[0].field??null,agg:e.values[0].agg}:null);return`${L(t.bottom?n.bottomBadge:n.topBadge,{count:t.count.toLocaleString(o)})} ${L(n.by,{value:_e(e,r,n)})}`}function wa(e,t,n){if(Object.hasOwn(t.formats,e))return t.formats[e];let o=/^number:(\d+)$/.exec(e);if(o)return W(t.formatDecimals,Number(o[1]),{lang:t.lang,locale:n});let r=e.split(":")[0];return Object.hasOwn(t.formats,r)?t.formats[r]:e}function Ea({view:e,index:t,types:n,labels:o,locale:r,defaultsOf:a,earlier:l}){let s=e.values[t],i=s.field?n.get(s.field.toLowerCase())??"string":"number",d=s.field?a?.(s.field):void 0,u=ot(s,o),c=N=>()=>({view:rn(e,t,N,{defaults:d}),note:{step:"value",field:u}}),p=s.field?In(i):["count"],h=N=>({id:`agg-${N}`,text:o.core.aggregators[N]??N,checked:s.agg===N,closes:!0,change:c({agg:N})}),g=p.filter(N=>!H.commonAggregators.includes(N)),f=[{id:"summarize",title:o.aggregation,kind:"menu",icon:"sigma",state:o.core.aggregators[s.agg]??s.agg,groups:[{choices:H.commonAggregators.filter(N=>p.includes(N)).map(h)},...g.length?[{title:o.moreStatistics,choices:g.map(h)}]:[]]}];if(Yt(s,i)){let N=E=>{let A=o.showAsNames[E]??E;return{id:`showas-${E}`,text:A,keywords:A.includes("%")?o.showAsKeywords:void 0,checked:s.showAs?.type===E,change:c({showAs:{type:E,axis:s.showAs?.axis??"rows"}})}},w=s.showAs&&H.showAsAlongAxis.includes(s.showAs.type)?s.showAs:null;f.push({id:"showAs",title:o.showAs,kind:"menu",info:"showAs",icon:"table",state:s.showAs?o.showAsNames[s.showAs.type]??s.showAs.type:o.showAsNone,changed:!!s.showAs,groups:[{choices:[{id:"showas-none",text:o.showAsNone,checked:!s.showAs,change:c({showAs:null})},...ho.map(N)]},{title:o.moreCalculations,choices:H.showAs.filter(E=>!ho.includes(E)).map(N)},...w?[{title:o.along,choices:["rows","cols"].map(E=>({id:`along-${E}`,text:o.zones[E],checked:w.axis===E,change:c({showAs:{...w,axis:E}})}))}]:[]]});let v=E=>Be(E,{locale:r})(Object.hasOwn(go,E)?go[E]:1234.5),S=E=>({id:`format-${E}`,text:o.formats[E]??E,hint:v(E),checked:s.format===E,change:c({format:E})}),C=s.format?wa(s.format,o,r):o.formatAuto,x=!s.format||po.includes(s.format)||fo.includes(s.format);f.push({id:"format",title:o.format,kind:"menu",icon:"number",state:C,changed:!!s.format&&s.format!==d?.format,groups:[{choices:[...x?[]:[{id:"format-current",text:C,checked:!0,change:c({format:s.format})}],{id:"format-auto",text:o.formatAuto,checked:!s.format,change:c({format:null})},...po.map(S)]},{title:o.moreFormats,choices:fo.map(S)}]});let O=E=>{let A=I=>I.agg===s.agg&&(I.field??null)===(s.field??null);for(let I of[e,...[...l?.()??[]].reverse()]){let D=(I.values??[]).find(A)?.conditional;if(D?.type===E)return D}return E==="colorScale"?{type:E}:{type:E,color:null}},B=(E,A,I)=>{let D=(s.conditional?.type??null)===I;return{id:E,text:A,checked:D,change:D?()=>null:c({conditional:I?O(I):null})}};f.push({id:"highlight",title:o.conditional,kind:"segmented",icon:"sparkle",changed:!!s.conditional,groups:[{choices:[B("cond-none",o.conditionalNone,null),B("cond-colorScale",o.colorScale,"colorScale"),B("cond-dataBar",o.dataBar,"dataBar")]}]})}return f.push({id:"name",title:o.rename,kind:"panel",icon:"text",state:u,changed:!!s.label,keywords:o.nameKeywords}),f.push(gn(e,"values",t,e.values.length,o,u,i)),f}function ba({view:e,labels:t,folding:n,tips:o,explanations:r,act:a}){let l=[];return o.controls&&l.push({id:"show-tips",text:t.showTips,checkbox:!0,checked:o.on,run:()=>a.tipsOn(!o.on)}),r&&l.push({id:"show-explanations",text:t.showSettingInfo,checkbox:!0,checked:r.on,run:()=>a.explain(!r.on)}),o.controls&&l.push({id:"reset-tips",text:t.resetTips,icon:"reset",disabled:!o.canReset,run:a.resetTips}),[{id:"totals",title:t.totals,kind:"inline",titled:!0,groups:[{choices:da.map(s=>{let i=pa(e,s);return{id:`total-${s}`,text:t[s],checkbox:!0,checked:e.totals[s],disabled:i!==null,reason:i?t[i]:void 0,info:s,run:()=>a.total(s,!e.totals[s])}})}]},{id:"rows",title:t.zones.rows,kind:"inline",titled:!0,groups:[{choices:[{id:"expand-all",text:t.expandAll,icon:"plus",closes:!0,disabled:!n.canExpand,reason:n.why.expand?t[n.why.expand]:void 0,run:a.expand},{id:"collapse-all",text:t.collapseAll,icon:"chevronRight",closes:!0,disabled:!n.canCollapse,reason:n.why.collapse?t[n.why.collapse]:void 0,run:a.collapse}]}]},{id:"help",title:t.help,kind:"inline",titled:!0,groups:[{choices:l}]},{id:"shortcuts",title:t.shortcutsTitle,kind:"panel",icon:"info"}]}function Na(e){let t=new Map;return e.map(n=>{let o=`${n.scope}:${n.name}`;return t.set(o,(t.get(o)??0)+1),`entry:${o}:${t.get(o)}`})}var xa=(e,t)=>e[t+1]??e[t-1];function Sa(e,t=""){return e.flatMap(n=>{if(n.hidden)return[];let r=[...t&&n.searchFor?n.searchFor(t):[],...n.searchExtra??[]].map(a=>({id:a.id,text:a.text,path:n.title,topic:n,choice:a.choice,focus:a.focus}));return n.kind==="panel"?[{id:`open-${n.id}`,text:n.title,path:"",topic:n},...r]:(n.groups??[]).flatMap(a=>a.choices.map(l=>({id:l.id,text:l.text,path:[n.title,a.title].filter(Boolean).join(" \u203A "),topic:n,choice:l})))})}var Ca=8;function Ta(e,t,n){let o=i=>i.toLocaleLowerCase(n),r=o(t).split(/\s+/).filter(Boolean);if(!r.length)return[];let a=e.filter(i=>{let d=o(`${i.text} ${i.path} ${i.topic.keywords??""} ${i.choice?.keywords??""}`);return r.every(u=>d.includes(u))}),l=i=>o(i.choice?.keywords??"").split(/\s+/).includes(r[0]),s=i=>l(i)?0:o(i.text).startsWith(r[0])?1:2;return[0,1,2].flatMap(i=>a.filter(d=>s(d)===i)).slice(0,Ca)}var Ro=(e,t,n,o)=>`${e}${t?`, ${t}`:""}${n?o:""}`;function La(e,t,n){if(n===0)return null;switch(e){case"ArrowDown":return(t+1)%n;case"ArrowUp":return t<=0?n-1:t-1;case"Home":return 0;case"End":return n-1;default:return null}}function Oa(e,t,n,o){let r=n.toLocaleLowerCase(o),a=n.length>1?t:t+1;for(let l=0;l<e.length;l++){let s=(Math.max(0,a)+l)%e.length;if(e[s].trim().toLocaleLowerCase(o).startsWith(r))return s}return null}var bt='[role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]';function wt(e){return[...e.querySelectorAll(bt)].filter(t=>t.closest('[role="menu"]')===e&&t.getClientRects().length>0)}function Aa(e){let t=e.closest(".pk-popover")?.id;return t?Cn(e)?.querySelector(`[aria-controls="${CSS.escape(t)}"]`)??null:null}function Ia(e,t){if(e.key!=="Tab"||e.shiftKey)return!1;let n=Aa(e.target),o=n?Tn(n):null;return e.preventDefault(),o?.focus(),n&&(!o||Je(o)!==o)&&n.focus({preventScroll:!0}),t(),!0}function un({label:e,labelledBy:t,className:n,close:o,children:r,testId:a}){let l=(0,b.useRef)(null),s=(0,b.useRef)(null),i=(0,b.useRef)({text:"",at:0});(0,b.useLayoutEffect)(()=>{let c=l.current;if(!c)return;let p=wt(c),h=p.find(g=>g.dataset.pkItem===s.current)??p.find(g=>g.hasAttribute("data-pk-start"))??p[0];for(let g of p)g.tabIndex=g===h?0:-1});let d=c=>{let p=c.target.closest?.(bt);if(p&&l.current&&p.closest('[role="menu"]')===l.current){s.current=p.dataset.pkItem??null;for(let h of wt(l.current))h.tabIndex=h===p?0:-1}},u=c=>{let p=l.current;if(!p||c.target.closest('[role="menu"]')!==p||c.altKey||c.ctrlKey||c.metaKey||Ia(c,o))return;let h=wt(p),g=h.indexOf(Je(p)),f=S=>{S!==null&&h[S]&&(c.preventDefault(),c.stopPropagation(),h[S].focus())},N=c.target.closest("[data-pk-seg]");if(N&&(c.key==="ArrowLeft"||c.key==="ArrowRight")){let S=wt(p).filter(x=>N.contains(x)),C=S.indexOf(c.target)+(c.key==="ArrowRight"?1:-1);C>=0&&C<S.length?(c.preventDefault(),c.stopPropagation(),S[C].focus()):c.key==="ArrowRight"&&(c.preventDefault(),c.stopPropagation());return}let w=c.target.closest("[data-pk-level]");if(w&&(c.key==="ArrowRight"||c.key==="Enter"||c.key===" ")){c.preventDefault(),c.stopPropagation(),w.click();return}let v=La(c.key,g,h.length);if(v!==null){f(v);return}if(c.key.length===1&&c.key!==" "){let S=Date.now();i.current={text:S-i.current.at<600?i.current.text+c.key:c.key,at:S},f(Oa(h.map(C=>C.dataset.pkText??C.textContent??""),g,i.current.text))}};return b.default.createElement("div",{ref:l,role:"menu","aria-label":e,"aria-labelledby":t,className:`pk-level-menu${n?` ${n}`:""}`,onKeyDown:u,onFocus:d,"data-testid":a},r)}function Ct({id:e,text:t,onSelect:n,checked:o,checkbox:r,hint:a,icon:l,danger:s,testId:i,start:d,plain:u,label:c,className:p,disabled:h,reason:g,haspopup:f,level:N,description:w,current:v,children:S}){let C=o===void 0?"menuitem":r?"menuitemcheckbox":"menuitemradio",x=(0,b.useId)(),O=[h&&g?x:null,w?`${x}-d`:null].filter(Boolean).join(" ")||void 0;return b.default.createElement("button",{type:"button",role:C,"aria-checked":o===void 0?void 0:o,"aria-label":c,"aria-haspopup":f,"aria-disabled":h||void 0,"aria-describedby":O,"aria-current":v?"true":void 0,tabIndex:-1,className:`pk-option${o?" pk-checked":""}${s?" pk-danger":""}${h?" pk-disabled":""}${p?` ${p}`:""}`,"data-pk-option":"","data-pk-item":e,"data-pk-text":u??(typeof t=="string"?t:void 0),"data-pk-start":d?"":void 0,"data-pk-level":N,"data-testid":i??e,onClick:h?void 0:n},b.default.createElement("span",{className:"pk-option-icon"},o||v?b.default.createElement(X,{name:"check"}):l?b.default.createElement(X,{name:l}):null),b.default.createElement("span",{className:"pk-option-text"},t,h&&g?b.default.createElement("span",{id:x,className:"pk-option-hint","data-testid":`${i??e}-reason`},g):null),a?b.default.createElement("span",{className:"pk-item-hint"},a):null,w?b.default.createElement("span",{id:`${x}-d`,hidden:!0},w):null,S)}function Fo({choice:e,onPick:t,start:n}){let{explain:o,labels:r}=(0,b.useContext)(rt),a=e.info&&o&&r?.settingInfo&&Object.hasOwn(r.settingInfo,e.info)?r.settingInfo[e.info]:null,l=b.default.createElement(Ct,{id:e.id,testId:e.testId,text:e.text,hint:e.hint,icon:e.icon,checked:e.checked,checkbox:e.checkbox,current:e.current,disabled:e.disabled,reason:e.reason,description:a,start:n,haspopup:e.open?"dialog":void 0,className:e.open?"pk-topic-row":void 0,onSelect:()=>t(e)},e.open?b.default.createElement(X,{name:"chevronRight",size:16,className:"pk-topic-chevron"}):null);return!a&&!e.actions?.length?l:b.default.createElement("div",{role:"none",className:"pk-setting-row"},l,(e.actions??[]).map(s=>b.default.createElement("button",{key:s.id,type:"button",role:"menuitem",tabIndex:-1,className:"pk-icon-btn","aria-label":s.label,title:s.label,"aria-haspopup":s.open?"dialog":void 0,"data-pk-item":s.id,"data-pk-text":s.label,"data-testid":s.testId??s.id,onClick:()=>t(s)},b.default.createElement(X,{name:s.icon}))),a?b.default.createElement("span",{"aria-hidden":"true"},b.default.createElement(lt,{id:e.info,name:e.text,tabIndex:-1})):null)}function $a({topic:e,labels:t,onOpen:n}){return b.default.createElement(Ct,{id:`topic-${e.id}`,level:e.id,text:e.title,plain:e.title,icon:e.icon,label:Ro(e.title,e.state,e.changed,t.sectionChanged),haspopup:e.kind==="menu"?"menu":"dialog",className:"pk-topic-row",onSelect:n},e.state?b.default.createElement("span",{className:"pk-topic-state","data-testid":`topic-state-${e.id}`},e.changed?b.default.createElement("span",{className:"pk-section-mark","aria-hidden":"true"},"\u25CF "):null,b.default.createElement("span",{className:"pk-badge-cut"},e.state)):null,b.default.createElement(X,{name:"chevronRight",size:16,className:"pk-topic-chevron"}))}function Ra({topic:e,onPick:t}){return b.default.createElement(b.default.Fragment,null,(e.groups??[]).map((n,o)=>b.default.createElement(gt,{key:o,menu:!0,title:n.title,label:n.title?void 0:e.title},n.choices.map(r=>b.default.createElement(Fo,{key:r.id,choice:r,start:r.checked,onPick:t})))),b.default.createElement(mn,{topic:e}))}function mn({topic:e}){return e.note?b.default.createElement("p",{className:"pk-hint pk-menu-hint",role:"none","data-testid":e.noteId},e.note):null}function Fa({topic:e,labels:t,onPick:n,onOpen:o}){if(e.hidden)return null;if(e.kind==="menu"||e.kind==="panel")return b.default.createElement($a,{topic:e,labels:t,onOpen:o});let r=e.groups?.[0]?.choices??[];if(e.kind==="segmented")return b.default.createElement("div",{role:"group","aria-label":Ro(e.title,e.state,e.changed,t.sectionChanged),className:"pk-topic-seg","data-pk-seg":"","data-testid":`topic-${e.id}`},b.default.createElement("span",{className:"pk-topic-seg-title","aria-hidden":"true"},b.default.createElement("span",{className:"pk-option-icon"},e.icon?b.default.createElement(X,{name:e.icon}):null),e.title,e.changed&&!e.state?b.default.createElement("span",{className:"pk-section-mark"}," \u25CF"):null),e.state?b.default.createElement("span",{className:"pk-topic-state pk-topic-seg-state","data-testid":`topic-state-${e.id}`},e.changed?b.default.createElement("span",{className:"pk-section-mark","aria-hidden":"true"},"\u25CF "):null,b.default.createElement("span",{className:"pk-badge-cut"},e.state)):null,b.default.createElement("span",{className:"pk-segmented pk-small"},r.map(l=>b.default.createElement("button",{key:l.id,type:"button",role:"menuitemradio","aria-checked":!!l.checked,tabIndex:-1,"data-pk-option":"","data-pk-item":l.id,"data-pk-text":l.text,"data-testid":l.id,onClick:()=>n(l)},l.text))));let a=r.map(l=>b.default.createElement(Fo,{key:l.id,choice:l,onPick:n}));return e.titled?b.default.createElement(gt,{menu:!0,title:e.title,testId:`topic-${e.id}`,titleTestId:`topic-title-${e.id}`,after:b.default.createElement(mn,{topic:e})},a):b.default.createElement(b.default.Fragment,null,b.default.createElement("div",{role:"group","aria-label":e.title,"data-testid":`topic-${e.id}`},a),b.default.createElement(mn,{topic:e}))}function Da({hits:e,labels:t,onPick:n,onOpen:o,close:r}){return e.length?b.default.createElement(un,{label:t.searchResults,close:r,testId:"menu-search-hits"},e.map(a=>b.default.createElement(Ct,{key:a.id,id:`hit-${a.id}`,text:a.choice?a.text:`${a.text}\u2026`,plain:a.text,checked:a.choice?.checked,icon:a.choice?a.topic.icon:"chevronRight",hint:a.path||void 0,haspopup:a.choice?void 0:"dialog",onSelect:()=>a.choice?n(a.choice):o(a.topic.id,void 0,a.focus)}))):b.default.createElement("p",{className:"pk-hint pk-level-nothing",role:"status","data-testid":"menu-search-nothing"},t.searchNothing)}function it({name:e,labels:t,topics:n,close:o,onPick:r,panel:a,head:l,foot:s,search:i=!1,locale:d,focusAgain:u}){let[c,p]=(0,b.useState)({stack:[],focus:null}),h=c.stack.length?c.stack[c.stack.length-1].level:null,[g,f]=(0,b.useState)(""),N=(0,b.useRef)(null),w=(0,b.useId)(),v=h?n.find(E=>E.id===h)??null:null;(0,b.useLayoutEffect)(()=>{let E=N.current,A=c.focus;if(!E||!A)return;let I=A.indexOf(":"),[D,R]=[A.slice(0,I),A.slice(I+1)],y=A==="level"?E.querySelector(".pk-level-body [data-autofocus]")??E.querySelector('.pk-level-body [role="menuitemradio"][aria-checked="true"]')??E.querySelector(".pk-level-body :is(button, input, select):not([disabled])")??E.querySelector(".pk-level-back"):A==="search"?E.querySelector(".pk-level-search input"):E.querySelector(D==="row"?`[data-pk-level="${CSS.escape(R)}"]`:`[data-pk-item="${CSS.escape(R)}"]`)??E.querySelector(bt);y?.focus({preventScroll:!0}),y?.scrollIntoView?.({block:"nearest"})},[c,u]);let S=(E,A=`row:${E}`,I=void 0)=>{f(""),p({stack:[...c.stack,{level:E,from:A,hint:I}],focus:"level"})},C=(E=void 0)=>{let A=c.stack[c.stack.length-1];p({stack:c.stack.slice(0,-1),focus:E??A?.from??null})},x=E=>{if(E.open){E.run?.(),S(E.open,E.backTo??`item:${E.id}`);return}E.closes||(p({stack:[],focus:g?"search":c.stack.length?c.stack[0].from:`item:${E.id}`}),f("")),r(E)},O=E=>{if(E.defaultPrevented)return;let A=E.target,I=A.matches("input:not([type=checkbox], [type=radio]), textarea, select");if(E.key==="/"&&i&&!h&&!I){E.preventDefault(),N.current?.querySelector(".pk-level-search input")?.focus();return}h&&(E.key==="Escape"||E.key==="ArrowLeft"&&!I&&!A.closest("[data-pk-seg], .pk-segmented"))&&(E.preventDefault(),E.stopPropagation(),C())},B=()=>{let E=i&&g.trim()?Ta(Sa(n,g),g,d):null;return b.default.createElement(b.default.Fragment,null,l,i?b.default.createElement("label",{className:"pk-search pk-level-search"},b.default.createElement(X,{name:"search"}),b.default.createElement("span",{className:"pk-sr"},L(t.searchMenu,{name:e})),b.default.createElement(Ee,{type:"search",value:g,placeholder:t.searchMenuShort,onChange:f,clearLabel:t.clearText,"aria-label":L(t.searchMenu,{name:e}),autoComplete:"off","data-testid":"menu-search",onKeyDown:A=>{A.key==="ArrowDown"?(A.preventDefault(),N.current?.querySelector(`.pk-level-first ${bt}`)?.focus()):A.key==="Enter"&&A.preventDefault()}})):null,b.default.createElement("div",{className:"pk-level-first"},E?b.default.createElement(Da,{hits:E,labels:t,onPick:x,onOpen:S,close:o}):b.default.createElement(un,{label:e,close:o,testId:"level-first"},n.map(A=>b.default.createElement(Fa,{key:A.id,topic:A,labels:t,onPick:x,onOpen:()=>S(A.id)})),s?b.default.createElement(b.default.Fragment,null,b.default.createElement("div",{role:"separator",className:"pk-level-sep"}),s):null)))};return b.default.createElement("div",{ref:N,className:"pk-levels",onKeyDown:O,"data-level":h??""},v?b.default.createElement(b.default.Fragment,null,b.default.createElement("div",{className:"pk-level-head"},b.default.createElement("button",{type:"button",className:"pk-link pk-level-back",onClick:()=>C(),"aria-label":L(t.backTo,{name:e}),"data-testid":"level-back"},b.default.createElement(X,{name:"chevronRight",size:16,className:"pk-flip"}),t.back),b.default.createElement("h3",{id:w,className:"pk-level-title","data-testid":"level-title"},L(t.levelTitle,{name:e,topic:v.levelTitle??v.title})),v.info?b.default.createElement(lt,{id:v.info,name:v.title}):null),b.default.createElement("div",{className:"pk-level-body","data-testid":`level-${v.id}`},v.kind==="menu"?b.default.createElement(un,{labelledBy:w,close:o},b.default.createElement(Ra,{topic:v,onPick:x})):b.default.createElement("div",{role:"group","aria-labelledby":w,className:"pk-level-panel"},a(v.id,C,c.stack[c.stack.length-1]?.hint)))):B())}function ct(e=450){let t=(0,b.useRef)(null),n=(0,b.useRef)(null),o=()=>{t.current&&clearTimeout(t.current),t.current=null,n.current=null},r=()=>{let l=n.current;o(),l?.()},a=(0,b.useRef)(r);return(0,b.useEffect)(()=>{a.current=r}),(0,b.useEffect)(()=>()=>a.current(),[]),{later:l=>{o(),n.current=l,t.current=setTimeout(r,e)},now:r,cancel:o}}function Do(e,t,n=450){let[o,r]=(0,b.useState)(e),[a,l]=(0,b.useState)(e);e!==a&&(l(e),o===a&&r(e));let s=(0,b.useRef)({text:o,seen:a,apply:t});(0,b.useEffect)(()=>{s.current={...s.current,seen:a,apply:t}});let i=ct(n),d=()=>{i.cancel(),s.current.text!==s.current.seen&&(s.current.seen=s.current.text,s.current.apply(s.current.text))},u=(0,b.useRef)(d);return(0,b.useEffect)(()=>{u.current=d}),(0,b.useEffect)(()=>()=>u.current(),[]),{text:o,set:c=>{s.current.text=c,r(c),n>0&&i.later(d)},flush:d,restore:()=>(i.cancel(),s.current.text===s.current.seen?!1:(s.current.text=s.current.seen,r(s.current.seen),!0))}}var ko=new Map;function Ma(e){let t=ko.get(e);if(!t){let n;try{n=new Intl.NumberFormat(e).formatToParts(12345.6)}catch{n=new Intl.NumberFormat("en-US").formatToParts(12345.6)}t={decimal:n.find(o=>o.type==="decimal")?.value??".",group:n.find(o=>o.type==="group")?.value??","},ko.set(e,t)}return t}var vo=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ba=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i;function Nt(e,t){let n=String(e??"").replace(/[\s\u00a0\u202f]/g,"").replace(/\u2212/g,"-");if(n==="")return null;let{decimal:o,group:r}=Ma(t),a=/[\s\u00a0\u202f]/.test(r)?"":vo(r),l=vo(o),s=a?`\\d{1,3}(?:${a}\\d{3})+`:"(?!)",d=new RegExp(`^([+-]?)(${s}|\\d+)?(?:${l}(\\d+))?$`).exec(n);if(d&&(d[2]!==void 0||d[3]!==void 0)){let u=(d[2]??"0").split(r).join(""),c=+`${d[1]}${u}${d[3]!==void 0?`.${d[3]}`:""}`;return Number.isFinite(c)?c:null}if(Ba.test(n)){let u=Number(n);return Number.isFinite(u)?u:null}return null}function ce(e,t){if(typeof e!="number"||!Number.isFinite(e))return"";try{return e.toLocaleString(t,{useGrouping:!1,maximumFractionDigits:20})}catch{return String(e)}}function Ne(e,{kind:t="number",required:n=!0,tried:o=!1,max:r,labels:a,locale:l}){let s=Nt(e,l);if(r!==void 0&&s!==null&&Number.isInteger(s)&&s>r)return{value:null,problem:L(a.countMax,{max:r.toLocaleString(l)})};let i=s!==null&&(t==="number"||(t==="size"?s>0:Number.isInteger(s)&&s>=1)),d=()=>t==="count"?a.countInvalid:L(t==="size"?a.sizeInvalid:a.numberInvalid,{example:(t==="size"?.5:1234.5).toLocaleString(l)});return e.trim()===""?{value:null,problem:n&&o?d():null}:i?{value:s,problem:null}:{value:null,problem:d()}}function Ye({value:e,onChange:t,problem:n,label:o,testId:r,className:a="pk-field-label",shown:l,shownClass:s,onKeyDown:i,onBlur:d,onFocus:u,autoFocus:c}){let p=(0,oe.useId)(),h=ie();return oe.default.createElement(oe.default.Fragment,null,oe.default.createElement("label",{className:a},l?oe.default.createElement("span",{className:s},l):oe.default.createElement("span",{className:"pk-sr"},o),oe.default.createElement("input",{type:"text",name:h,inputMode:"decimal",autoComplete:"off",spellCheck:!1,value:e,onChange:g=>t(g.target.value),onKeyDown:i,onBlur:d,onFocus:u,"aria-label":o,"aria-invalid":n?!0:void 0,"aria-describedby":n?p:void 0,"data-autofocus":c?"":void 0,"data-testid":r})),n?oe.default.createElement("p",{id:p,className:"pk-form-problem","data-testid":`${r}-problem`},n):null)}var Xe=({now:e,restore:t,back:n})=>o=>{o.key==="Enter"?(o.preventDefault(),e()):o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),t()||n())};function Mo({choices:e,names:t,index:n,onChange:o,label:r,prefix:a,testId:l}){let s=ie();return e.length<2?oe.default.createElement("span",{className:"pk-by","data-testid":l},a?`${a} ${t[0]}`:t[0]):oe.default.createElement("label",{className:"pk-field-label pk-by-pick"},a?oe.default.createElement("span",null,a):oe.default.createElement("span",{className:"pk-sr"},r),oe.default.createElement("select",{name:s,value:n,onChange:i=>o(Number(i.target.value)),"aria-label":r,"data-testid":l},e.map((i,d)=>oe.default.createElement("option",{key:`${i.field}:${i.agg}`,value:d},t[d]))))}var Bo=(e,t)=>Math.max(0,e.findIndex(n=>ze(n,t)));function Tt(e,t,n,o){let r=Oo(ln(e,a=>t.get(a.toLowerCase())),o);return{choices:r,names:r.map(a=>_e(e,a,n))}}var je=e=>e==="between"||e==="notBetween",Pa=(e,t)=>e.charAt(0).toLocaleUpperCase(t)+e.slice(1),yo=e=>JSON.stringify(e,(t,n)=>n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).sort(([o],[r])=>o<r?-1:1)):n),Va=e=>e.type==="value"?"total":e.type==="label"?"name":"item",Et=Object.freeze({year:10,month:24,day:90}),ja=13,qa=864e5;function Ua(e,t){let n=e.unit,o=n===null?e.item==="number"?"value":e.item==="date"?"date":"item":n==="bin"?"range":n==="day"?"day":n.replace(/^year(.)/,(r,a)=>a.toLowerCase());return Object.hasOwn(t.nouns,o)?t.nouns[o]:t.nouns.item}function Ja(e,t,n){let o=Date.parse(`${e.from}T00:00Z`),r=Date.parse(`${e.to}T00:00Z`)+qa,a=0;return t.dict.forEach((l,s)=>{typeof l=="number"&&l>=o&&l<r&&(a+=n[s])}),a}function Ka(e){let t=new Float64Array(e.dict.length);for(let n=0;n<e.codes.length;n++)e.codes[n]>=0&&t[e.codes[n]]++;return t}function _a(e,t){let n=new Map;return e.dict.forEach((o,r)=>{if(typeof o=="number"){let a=new Date(o).getUTCFullYear();n.set(a,(n.get(a)??0)+t[r])}}),[...n.entries()].sort((o,r)=>o[0]-r[0]).map(([o,r])=>({year:o,rows:r}))}function za({out:e,row:t,searching:n,labels:o,locale:r}){let[a,l]=(0,m.useState)(!1),s=(0,m.useId)(),i=a||n,d=(0,m.useRef)(null);return(0,m.useEffect)(()=>{a&&d.current?.firstElementChild?.scrollIntoView?.({block:"nearest"})},[a]),m.default.createElement("li",{className:"pk-values-tail"},m.default.createElement("button",{type:"button",className:"pk-tail-toggle","aria-expanded":i,"aria-controls":s,onClick:()=>l(!i),"data-testid":"tail-toggle"},m.default.createElement(X,{name:i?"chevronDown":"chevronRight",size:14}),m.default.createElement("span",null,L(W(o.tailOut,e.length,{lang:o.lang,locale:r}),{count:e.length.toLocaleString(r)}))),i?m.default.createElement("ul",{ref:d,id:s,role:"list",className:"pk-tail-list","data-testid":"tail-list"},e.slice(0,hn).map(t)):null)}function on({id:e,title:t,state:n,open:o,onToggle:r,action:a,children:l}){let s=(0,m.useId)();return m.default.createElement("section",{className:"pk-fsection","data-testid":`fsection-${e}`},m.default.createElement("div",{className:"pk-fsection-head"},m.default.createElement("button",{type:"button",className:"pk-fsection-toggle","aria-expanded":o,"aria-controls":s,onClick:r,"data-testid":`section-${e}`},m.default.createElement(X,{name:o?"chevronDown":"chevronRight",size:16}),m.default.createElement("span",{className:"pk-fsection-title"},t),n?m.default.createElement("span",{className:"pk-fsection-state"},n):null),a),o?m.default.createElement("div",{className:"pk-fsection-body",id:s,"data-testid":`${e}-body`},l):null)}function Ha({ctx:e,state:t}){let{labels:n,locale:o,view:r,field:a}=e,{shown:l,total:s,noun:i,unpicked:d,byQuick:u,byRules:c,byTotals:p,rows:h,rowsAll:g,span:f,yearsText:N,empty:w,quickWords:v}=t,S=E=>E.toLocaleString(o),C={lang:n.lang,locale:o},x=l===0?n.summaryNone:l===s?L(n.summaryAll,{total:S(s),noun:W(i,s,C)}):L(n.summarySome,{shown:S(l),total:S(s),noun:W(i,s,C)}),O=[];l===0&&w?O.push(w):(d&&O.push(L(n.summaryPicks,{count:S(d)})),u&&O.push(L(n.summaryQuick,{count:S(u),quick:v})),c&&O.push(L(W(n.summaryRules,t.itemRules,C),{items:S(c)})),p&&O.push(L(W(n.summaryTotals,t.totalRules,C),{items:S(p)})));let B=[L(n.summaryRows,{rows:S(h),total:S(g)})];return f&&B.push(L(n.summaryData,{range:`${we(Ae(f.min),o)} \u2013 ${we(Ae(f.max),o)}`})),N&&B.push(N),m.default.createElement("div",{className:"pk-filter-summary"},m.default.createElement("div",{className:`pk-summary-card${l===0?" pk-summary-empty":""}`,role:"status","data-testid":"filter-summary"},m.default.createElement("p",{className:"pk-summary-head","data-testid":"filter-summary-head"},x),m.default.createElement("p",{className:"pk-summary-why","data-testid":"filter-summary-why"},O.length?O.join(" \xB7 "):t.rules?n.summaryKept:v?L(n.summaryQuickOnly,{quick:v}):n.summaryOk),m.default.createElement("p",{className:"pk-summary-meta","data-testid":"filter-summary-meta"},B.join(" \xB7 ")),m.default.createElement("button",{type:"button",className:"pk-action pk-summary-reset",disabled:!t.canReset,onClick:()=>e.act(ua(r,a),"section-picks"),"data-testid":"filter-reset"},n.resetFilter)))}function Wa({ctx:e,quick:t,anchor:n,setAnchorLocal:o,span:r,column:a,counts:l}){let{view:s,field:i,labels:d,locale:u,fk:c,timeZone:p,commit:h,note:g,back:f}=e,N={lang:d.lang,locale:u},w=r.max,v=Ae(w),[S]=(0,m.useState)(()=>Date.now()),C=(F,_)=>jt({unit:F,count:_,anchor:n},p,S,w),x=F=>{for(let _=1;_<=Et[F];_++){let ue=C(F,_);if(ue&&ue.from<=v)return _}return null},O=(0,m.useMemo)(()=>({year:Math.max(2,x("year")??Et.year),month:x("month")??Et.month,day:x("day")??Et.day}),[n,w,p]),B={year:t.id==="years"?t.count:O.year,month:t.id==="months"?t.count:O.month,day:t.id==="days"?t.count:O.day},[E,A]=(0,m.useState)(()=>Object.fromEntries(Object.entries(B).map(([F,_])=>[F,ce(_,u)]))),[I,D]=(0,m.useState)(null),R=`${t.id}:${t.count??""}:${n}`,[y,M]=(0,m.useState)(R);if(R!==y){M(R);let F={...E};for(let _ of H.relativeUnits)_!==I&&(F[_]=ce(B[_],u));A(F)}let q=ct(),U=(0,m.useId)(),ee=ie(),K=F=>h(Lo(s,i,F?{...F,anchor:n}:null),g),j=(F,_,ue)=>{let te=_n(F,_,r,u);if(te?.none)return null;let pe=te?`${te.data} `:qt(F,_,u),Se=te?L(W(d.noData,te.count,N),{range:te.missing.join(", ")}):null;return m.default.createElement("span",{className:"pk-quick-sub",id:G(ue)},m.default.createElement("span",null,pe,Se?m.default.createElement("span",{className:"pk-quick-missing"},"(",Se,")"):null),m.default.createElement("span",{className:"pk-quick-rows"},L(d.quickRows,{rows:Ja(F,a,l).toLocaleString(u)})))},G=F=>`${U}-${F}`,Y=(F,_,ue,te,pe,Se,ne=!!Se)=>m.default.createElement("label",{className:"pk-radio pk-quick",key:F},m.default.createElement("input",{type:"radio",name:ee,checked:_,onChange:ue,"aria-label":te,"aria-describedby":ne?G(F):void 0,"data-autofocus":_&&e.hint!=="conditions"?"":void 0,"data-testid":`quick-${F}`}),pe,Se),he=[],xe=[Y("all",t.id==="all"||t.id==="custom",()=>K(null),d.filterAll,m.default.createElement("span",null,d.filterAll),m.default.createElement("span",{className:"pk-quick-sub",id:G("all")},m.default.createElement("span",null,`${we(Ae(r.min),u)}\u2013${we(v,u)}`),m.default.createElement("span",{className:"pk-quick-rows"},L(d.quickRows,{rows:a.codes.length.toLocaleString(u)}))))],ae=C("year",1),re=Pa(d.relative.year,u);ae&&j(ae,"year","thisYear")?xe.push(Y("thisYear",t.id==="thisYear",()=>K({unit:"year",count:1}),re,m.default.createElement("span",null,re),j(ae,"year","thisYear"))):ae&&he.push(`${re} (${qt(ae,"year",u)})`);for(let F of["year","month","day"]){if(F==="month"&&!c.months||F==="day"&&!c.days)continue;let _=Ne(E[F],{kind:"count",max:H.relativeMaxCount,labels:d,locale:u}),ue=_.value,te=`${F}s`,pe=ue??B[F],Se=Object.fromEntries(Object.entries(d.quickLast[F]).map(([ke,Te])=>[ke,String(Te).replace("{count}","{n}")])),ne=W(Se,pe,N),[le,ut]=ne.split("{n}"),Ce=C(F,pe),Ze=Ce?j(Ce,F,te):null;if(!Ze&&t.id!==te){he.push(L(ne,{n:pe.toLocaleString(u)}));continue}let et=()=>K({unit:F,count:pe});xe.push(m.default.createElement("div",{className:"pk-quick-row",key:F},Y(te,t.id===te,et,L(ne,{n:pe.toLocaleString(u)}),m.default.createElement("span",{"aria-hidden":"true"},le),null,!!Ze),m.default.createElement(Ye,{value:E[F],onChange:ke=>{A({...E,[F]:ke}),q.later(()=>{let Te=Ne(ke,{kind:"count",max:H.relativeMaxCount,labels:d,locale:u}).value;Te!==null&&K({unit:F,count:Te})})},onKeyDown:Xe({now:q.now,restore:()=>{q.cancel();let ke=ce(B[F],u);return E[F]===ke?!1:(A({...E,[F]:ke}),!0)},back:f}),onBlur:()=>{D(null),q.now()},onFocus:()=>D(F),problem:_.problem,label:d.quickCount[F],testId:`quick-${te}-count`,className:"pk-field-label pk-count-input"}),m.default.createElement("span",{"aria-hidden":"true"},ut),Ze))}let de=new Date(jt({unit:"day",count:1},p,S)?.from??Ae(S)),ge=c.months?Date.UTC(de.getUTCFullYear(),de.getUTCMonth(),1):Date.UTC(de.getUTCFullYear(),0,1),qe=w<ge,Ue=(0,m.useId)(),De=ie();return m.default.createElement(m.default.Fragment,null,m.default.createElement("div",{role:"radiogroup","aria-label":d.quickTitle,className:"pk-radios pk-quick-choices","data-testid":"quick-choices"},xe),qe?m.default.createElement("div",{className:"pk-quick-anchor"},m.default.createElement("label",{htmlFor:Ue},d.anchorLabel),m.default.createElement("select",{id:Ue,name:De,value:n,onChange:F=>{let _=F.target.value;o(_),t.filters.length&&h(ca(s,i,_),g)},"data-testid":"quick-anchor"},m.default.createElement("option",{value:"today"},L(d.anchorToday,{date:we(Ae(de.getTime()),u)})),m.default.createElement("option",{value:"latest"},L(d.anchorLatest,{date:we(v,u)})))):null,he.length?m.default.createElement("p",{className:"pk-hint pk-quick-hidden","data-testid":"quick-hidden"},L(W(d.quickHidden,he.length,N),{choices:he.join(", "),latest:we(v,u)})):null)}function Ga({ctx:e,years:t,on:n}){let{view:o,field:r,labels:a,locale:l,commit:s,note:i,noun:d}=e,u=t.map(p=>p.year),c=p=>{let h=n.includes(p)?n.filter(g=>g!==p):[...n,p].sort((g,f)=>g-f);s(ia(o,r,h,u),i)};return m.default.createElement(m.default.Fragment,null,m.default.createElement("p",{className:"pk-hint pk-years-hint"},L(a.yearsCombinedHint,{noun:W(d,1,{lang:a.lang,locale:l})})),m.default.createElement("div",{className:"pk-years",role:"group","aria-label":a.yearsCombined,"data-testid":"years-combined"},t.map(p=>{let h=n.includes(p.year);return m.default.createElement("button",{key:p.year,type:"button",className:"pk-year-chip","aria-pressed":h,disabled:h&&n.length===1,onClick:()=>c(p.year),"data-testid":`year-${p.year}`},h?m.default.createElement(X,{name:"check",size:12}):null,m.default.createElement("span",null,String(p.year)),m.default.createElement("span",{className:"pk-quick-rows"},L(a.quickRows,{rows:p.rows.toLocaleString(l)})))})),n.length===1?m.default.createElement("p",{className:"pk-hint"},L(a.yearsCombinedOne,{year:String(n[0])})):null)}function Qa({items:e,value:t,onChange:n,label:o,testId:r,labels:a,locale:l}){let[s,i]=(0,m.useState)(!1),[d,u]=(0,m.useState)(""),[c,p]=(0,m.useState)(0),h=(0,m.useRef)(null),g=(0,m.useId)(),f=ie(),N=d.trim().toLocaleLowerCase(),w=N?e.filter(A=>A.label.toLocaleLowerCase().includes(N)):e,v=w.slice(0,hn),S=e.find(A=>String(A.value)===t),C=()=>{u(""),p(Math.max(0,e.findIndex(A=>String(A.value)===t))),i(!0)},x=()=>i(!1),O=A=>{x(),n(String(A.value))},B=A=>`${g}-${A}`,E=A=>{A.key==="ArrowDown"||A.key==="ArrowUp"?(A.preventDefault(),p(I=>Math.min(v.length-1,Math.max(0,I+(A.key==="ArrowDown"?1:-1))))):A.key==="Enter"?(A.preventDefault(),v[c]&&O(v[c])):A.key==="Escape"&&(A.preventDefault(),A.stopPropagation(),x())};return m.default.createElement("span",{className:"pk-picker"},m.default.createElement("button",{ref:h,type:"button",className:"pk-picker-button","aria-haspopup":"listbox","aria-expanded":s,"aria-label":o,onClick:()=>s?x():C(),onKeyDown:A=>{!s&&(A.key==="ArrowDown"||A.key==="ArrowUp")&&(A.preventDefault(),C())},"data-testid":r},S?S.label:t||a.ruleValue),m.default.createElement(Dt,{open:s,anchor:h,onClose:x,label:o,className:"pk-picker-pop"},m.default.createElement("input",{type:"search",name:f,role:"combobox",className:"pk-picker-search",value:d,onChange:A=>{u(A.target.value),p(0)},onKeyDown:E,"aria-label":a.pickerSearch,"aria-expanded":"true","aria-controls":g,"aria-activedescendant":v[c]?B(c):void 0,"aria-autocomplete":"list",autoComplete:"off",placeholder:a.pickerSearch,"data-autofocus":"","data-testid":"picker-search"}),m.default.createElement("ul",{role:"listbox",id:g,className:"pk-picker-list","aria-label":o,"data-testid":"picker-list"},v.map((A,I)=>m.default.createElement("li",{key:String(A.value),id:B(I),role:"option","aria-selected":String(A.value)===t,className:`pk-picker-option${I===c?" pk-picker-active":""}`,onMouseMove:()=>p(I),onClick:()=>O(A),"data-testid":"picker-option"},m.default.createElement("span",null,A.label),m.default.createElement("span",{className:"pk-count"},A.count.toLocaleString(l)))),v.length?null:m.default.createElement("li",{className:"pk-hint pk-picker-none"},a.pickerNone)),m.default.createElement("p",{className:"pk-hint pk-picker-count","aria-live":"polite","data-testid":"picker-count"},L(a.pickerMatch,{count:w.length.toLocaleString(l),total:e.length.toLocaleString(l)}))))}function Ya({rule:e,ctx:t,apply:n,first:o}){let{field:r,labels:a,locale:l,fk:s,items:i}=t,d=(0,m.useContext)(ht).size==="narrow",u=s.dates?a.dateOps:a.valueOps,c=s.dates?[...H.valueOps,"last"]:H.valueOps,p=y=>y===void 0?"":s.item==="number"?ce(y,l):String(y),h=e?.type==="compare"?e:null,g=e?.type==="relative"?e:null,[f,N]=(0,m.useState)(()=>({op:g?"last":h?.op??">=",a:p(h?.value),b:p(h?.value2),count:ce(g?.count??5,l),unit:g?.unit??"year"})),w=ct(),v=ie(),S=y=>s.item==="number"?Nt(y,l):s.item==="date"?/^\d{4,}-\d{2}-\d{2}$/.test(y)?y:null:y===""?null:Number(y),C=y=>{if(y.op==="last"){let U=Ne(y.count,{kind:"count",max:H.relativeMaxCount,labels:a,locale:l}).value;return U!==null?{field:r,type:"relative",unit:y.unit,count:U,...g?.anchor==="latest"?{anchor:"latest"}:{}}:null}let[M,q]=[S(y.a),S(y.b)];return M===null||je(y.op)&&q===null?null:{field:r,type:"compare",op:y.op,value:M,...je(y.op)?{value2:q}:{}}},x=(y,M=!1)=>{let q={...f,...y};N(q);let U=()=>{let ee=C(q);ee&&n(ee)};M?w.later(U):(w.cancel(),U())},O=()=>{w.cancel();let y={a:p(h?.value),b:p(h?.value2),count:ce(g?.count??5,l)};return f.a===y.a&&f.b===y.b&&f.count===y.count?!1:(N({...f,...y}),!0)},B=Xe({now:w.now,restore:O,back:t.back}),E=(y,M,q)=>{if(s.item==="number"){let K=Ne(f[y],{required:!1,labels:a,locale:l}).problem;return m.default.createElement(Ye,{value:f[y],onChange:j=>x({[y]:j},!0),onKeyDown:B,onBlur:w.now,problem:K,label:M,testId:q,className:"pk-field-label pk-narrow-input"})}if(s.item==="date")return m.default.createElement("input",{type:"date",name:`${v}-${y}`,value:f[y],onChange:K=>x({[y]:K.target.value}),"aria-label":M,"data-testid":q});let U=i.filter(K=>typeof K.value=="number"),ee=f[y]!==""&&!U.some(K=>String(K.value)===f[y]);return U.length>=ja&&!d?m.default.createElement(Qa,{items:ee?[{value:Number(f[y]),label:f[y],count:0},...U]:U,value:f[y],onChange:K=>x({[y]:K}),label:M,testId:q,labels:a,locale:l}):m.default.createElement("select",{name:`${v}-${y}`,value:f[y],onChange:K=>x({[y]:K.target.value}),"aria-label":M,"data-testid":q},m.default.createElement("option",{value:"",disabled:!0},a.ruleValue),ee?m.default.createElement("option",{value:f[y]},f[y]):null,U.map(K=>m.default.createElement("option",{key:String(K.value),value:String(K.value)},K.label)))},A=s.item==="date"?a.ruleDate:a.ruleValue,I={lang:a.lang,locale:l},D=Ne(f.count,{kind:"count",max:H.relativeMaxCount,labels:a,locale:l}),R=D.value??2;return m.default.createElement(m.default.Fragment,null,m.default.createElement("span",{className:"pk-rule-subject"},Q(r,a.core)),m.default.createElement("select",{className:"pk-rule-op",name:`${v}-op`,value:f.op,onChange:y=>x({op:y.target.value}),"aria-label":a.valueFilterOp,"data-autofocus":o?"":void 0,"data-testid":"rule-item-op"},c.map(y=>m.default.createElement("option",{key:y,value:y},y==="last"?W(a.lastOp,R,I):u[y]??y))),f.op==="last"?m.default.createElement(m.default.Fragment,null,m.default.createElement(Ye,{value:f.count,onChange:y=>x({count:y},!0),onKeyDown:B,onBlur:w.now,problem:D.problem,label:a.quickCount[f.unit],testId:"rule-last-count",className:"pk-field-label pk-count-input"}),m.default.createElement("select",{name:`${v}-unit`,value:f.unit,onChange:y=>x({unit:y.target.value}),"aria-label":a.ruleUnit,"data-testid":"rule-last-unit"},H.relativeUnits.map(y=>m.default.createElement("option",{key:y,value:y},W(a.ruleUnits[y],R,I))))):m.default.createElement(m.default.Fragment,null,E("a",A,"rule-item-value"),je(f.op)?m.default.createElement(m.default.Fragment,null,m.default.createElement("span",null,a.valueFilterTo),E("b",`${a.valueFilterTo} ${A}`,"rule-item-value2")):null,f.op==="!="||f.op==="notBetween"?m.default.createElement("span",{className:"pk-hint pk-rule-note","data-testid":"rule-blanks"},a.blanksOut):null))}function Xa({rule:e,ctx:t,apply:n,first:o}){let{view:r,types:a,labels:l,locale:s}=t,{choices:i,names:d}=Tt(r,a,l,e?.by),[u,c]=(0,m.useState)(()=>({by:Bo(i,e?.by),op:e?.op??">",a:ce(e?.value,s),b:ce(e?.value2,s)})),p=ct(),h=ie(),g=(v,S=!1)=>{let C={...u,...v};c(C);let x=()=>{let[O,B]=[Nt(C.a,s),Nt(C.b,s)];if(O!==null&&(!je(C.op)||B!==null)){let E=i[C.by];n({field:t.field,type:"value",by:{field:E.field,agg:E.agg},op:C.op,value:O,...je(C.op)?{value2:B}:{}})}};S?p.later(x):(p.cancel(),x())},f=()=>{p.cancel();let v={a:ce(e?.value,s),b:ce(e?.value2,s)};return u.a===v.a&&u.b===v.b?!1:(c({...u,...v}),!0)},N=Xe({now:p.now,restore:f,back:t.back}),w=(v,S,C,x)=>m.default.createElement(Ye,{value:u[v],onChange:O=>g({[v]:O},!0),onKeyDown:N,onBlur:p.now,problem:Ne(u[v],{required:!1,labels:l,locale:s}).problem,label:S,shown:x,testId:C,className:"pk-field-label pk-narrow-input"});return m.default.createElement(m.default.Fragment,null,m.default.createElement("span",{className:"pk-rule-subject pk-rule-lead"},L(l.ruleWhose,{field:Q(t.field,l.core)})),m.default.createElement(Mo,{choices:i,names:d,index:u.by,onChange:v=>g({by:v}),label:l.valueFilterBy,testId:"value-filter-by"}),m.default.createElement("select",{className:"pk-rule-op",name:`${h}-op`,value:u.op,onChange:v=>g({op:v.target.value}),"aria-label":l.valueFilterOp,"data-autofocus":o?"":void 0,"data-testid":"value-filter-op"},H.valueOps.map(v=>m.default.createElement("option",{key:v,value:v},l.valueOps[v]??v))),w("a",l.valueFilterNumber,"value-filter-number"),je(u.op)?w("b",`${l.valueFilterTo} ${l.valueFilterNumber}`,"value-filter-number2",l.valueFilterTo):null)}function Za({rule:e,ctx:t,apply:n,first:o}){let{field:r,labels:a}=t,[l,s]=(0,m.useState)(e?.op??"contains"),i=(c,p)=>{p!==""&&n({field:r,type:"label",op:c,value:p})},d=Do(e?.value??"",c=>i(l,c)),u=ie();return m.default.createElement(m.default.Fragment,null,m.default.createElement("span",{className:"pk-rule-subject"},a.ruleName),m.default.createElement("select",{className:"pk-rule-op",name:u,value:l,onChange:c=>{s(c.target.value),i(c.target.value,d.text)},"aria-label":a.condition,"data-autofocus":o?"":void 0,"data-testid":"filter-condition-op"},H.labelOps.map(c=>m.default.createElement("option",{key:c,value:c},a.labelOps[c]??c))),m.default.createElement(Ee,{type:"text",value:d.text,onChange:d.set,onBlur:d.flush,onKeyDown:Xe({now:d.flush,restore:d.restore,back:t.back}),onClear:()=>d.set(""),clearLabel:a.clearText,"aria-label":a.conditionValue,placeholder:a.conditionValue,maxLength:1e3,"data-testid":"filter-condition-text"}))}var er={item:Ya,total:Xa,name:Za};function tr({ctx:e,rules:t,focusFirst:n,quickLine:o,results:r}){let{view:a,field:l,labels:s,locale:i,commit:d,note:u,fk:c,nameKind:p,noun:h}=e,{explain:g}=(0,m.useContext)(rt),f={lang:s.lang,locale:i},[N,w]=(0,m.useState)(null),[v,S]=(0,m.useState)(null),[C,x]=(0,m.useState)(0),O=yo(t),[B,E]=(0,m.useState)(O),[A,I]=(0,m.useState)(null);O!==B&&(E(O),O!==A&&(x(C+1),w(null)));let D=(0,m.useRef)(null),R=(0,m.useRef)(!1);(0,m.useEffect)(()=>{R.current&&(R.current=!1,D.current?.querySelector(".pk-rule-adds button:not([disabled])")?.focus())},[C]),(0,m.useEffect)(()=>{if(N){let j=D.current?.querySelector(".pk-rule:last-child");j?.querySelector("[data-autofocus]")?.focus({preventScroll:!0}),j?.scrollIntoView?.({block:"nearest"});let G=j?.closest(".pk-level-body");if(j&&G){let Y=j.getBoundingClientRect().bottom-G.getBoundingClientRect().bottom;Y>0&&(G.scrollTop+=Math.ceil(Y))}}},[N]);let y=["item","total","name"].filter(j=>j==="item"?!!c.item:j==="name"?!!p:!0),M=t.length+(N?1:0),q=M>=mo||a.filters.length>=An.filters,U={item:L(s.addRuleItem,{field:Q(l,s.core)}),total:s.addRuleTotal,name:s.addRuleName},ee=(j,G)=>{let Y=W(h,1,f);if(G==="total"){let he=j?.by??Tt(a,e.types,s,void 0).choices[0];return L(s.ruleInfo.total,{noun:Y,nouns:W(h,2,f),measure:_e(a,he,s),scope:e.scope})}return G==="name"?L(s.ruleInfo.name,{noun:Y}):L(s.ruleInfo[c.item==="group"?c.cyclic?"cyclic":"group":c.item??"group"],{noun:Y})},K=(j,G,Y)=>{let he=er[G],xe=qe=>{let Ue=We(a,l,j,qe);I(yo(fe(Ue,l,St).filter(De=>!e.quickFilters.includes(De)))),j||w(null),d(Ue,u)},ae=()=>{R.current=!0,j?d(We(a,l,j,null),u):(w(null),x(C+1))},re=j?r.get(j):null,de=v===Y,ge=`${C}-${Y}`;return m.default.createElement("li",{key:`${C}:${Y}`,className:"pk-rule","data-testid":"rule","data-kind":G},Y>0||o?m.default.createElement("span",{className:"pk-rule-and"},s.ruleAnd):null,m.default.createElement("span",{className:"pk-rule-body"},m.default.createElement(he,{rule:j,ctx:e,apply:xe,first:n&&Y===0||!j&&N!==null})),m.default.createElement("span",{className:"pk-rule-tools"},g?m.default.createElement("button",{type:"button",className:"pk-icon-btn pk-rule-info","aria-expanded":de,"aria-controls":de?ge:void 0,onClick:()=>S(de?null:Y),"aria-label":s.explainRule,title:s.explainRule,"data-testid":"rule-info"},m.default.createElement(X,{name:"info",size:14})):null,m.default.createElement("button",{type:"button",className:"pk-icon-btn pk-rule-remove",onClick:ae,"aria-label":s.removeRule,title:s.removeRule,"data-testid":"rule-remove"},m.default.createElement(X,{name:"x",size:14}))),m.default.createElement("p",{className:`pk-hint pk-rule-result${re&&re.kept===0?" pk-rule-result-empty":""}`,"data-testid":"rule-result"},re?re.text:s.ruleIncomplete),de?m.default.createElement("p",{className:"pk-rule-info-text",id:ge,"data-testid":"rule-info-text"},ee(j,G)):null)};return m.default.createElement("fieldset",{ref:D,className:"pk-condition pk-rules","data-testid":"rules"},m.default.createElement("legend",{className:"pk-sr"},s.rulesTitle),m.default.createElement("p",{className:"pk-hint"},L(M||o?s.rulesKeep:s.rulesNone,{noun:W(h,2,f)})),M||o?m.default.createElement("ul",{className:"pk-rule-list",role:"list"},o?m.default.createElement("li",{className:"pk-rule pk-rule-quick","data-testid":"rule-quick"},m.default.createElement("span",null,L(s.quickLine,{text:o})),m.default.createElement("button",{type:"button",className:"pk-action",onClick:e.focusQuick,"data-testid":"rule-quick-change"},s.changeAbove)):null,[...t.map((j,G)=>K(j,Va(j),G)),...N?[K(null,N,t.length)]:[]]):null,m.default.createElement("div",{className:"pk-rule-adds",role:"group","aria-label":s.addRule},y.map((j,G)=>m.default.createElement("button",{key:j,type:"button",className:"pk-btn pk-small-btn",disabled:q,onClick:()=>w(j),"data-autofocus":n&&!M&&G===0?"":void 0,"data-testid":`rule-add-${j}`},m.default.createElement(X,{name:"plus",size:14}),m.default.createElement("span",{className:"pk-btn-text"},U[j])))),q?m.default.createElement("p",{className:"pk-hint"},L(s.rulesFull,{max:mo})):null)}var nr=(e,t,n)=>e.filters.filter(o=>!(typeof o.field=="string"&&o.field.toLowerCase()===t.toLowerCase()&&n.includes(o.type)));function Po({view:e,field:t,encoded:n,types:o,labels:r,locale:a,commit:l,back:s,hint:i}){let d=(0,m.useMemo)(()=>Pe(n,t,{view:e,locale:a,labels:r.core}),[n,t,e,a,r]),u=(0,m.useContext)(ht).size==="narrow",c=(0,m.useMemo)(()=>So(n,e,t),[n,e,t]),p=Re(e,t),h=c.dates?n.column(p):null,g=(0,m.useMemo)(()=>c.dates?Wt(n,p):null,[n,c.dates,p]),f=(0,m.useMemo)(()=>h?Ka(h):null,[h]),N=(0,m.useMemo)(()=>c.cyclic&&h&&f?_a(h,f):[],[c.cyclic,h,f]),w=ra(e,t,c,N.map(T=>T.year)),[v,S]=(0,m.useState)(null),C=w.anchor??v??"today",[x,O]=(0,m.useState)(!0),[B,E]=(0,m.useState)(null),[A,I]=(0,m.useState)(i==="conditions"?!0:null),D=(0,m.useRef)(null),y=fe(e,t,St).filter(T=>!w.filters.includes(T)),M=y.filter(T=>T.type!=="value"),q=y.filter(T=>T.type==="value"),U=y.length>0||w.filters.length>0,ee=(0,m.useRef)(U),K=(0,m.useRef)(!1),j=(0,m.useRef)(!1),G=()=>{if(!j.current)return;let T=D.current?Je(D.current):null;(!T||!T.isConnected||!D.current?.contains(T)||T instanceof HTMLButtonElement&&T.disabled)&&D.current?.querySelector('[data-testid="section-rules"]')?.focus(),j.current=!1};(0,m.useEffect)(G),(0,m.useEffect)(()=>{ee.current!==U&&(ee.current=U,K.current?K.current=!1:(I(U),E(!U)),j.current=!0,setTimeout(G,100))},[U]);let[Y,he]=(0,m.useState)(0);(0,m.useEffect)(()=>{if(Y){let T=D.current?.querySelector('[data-testid="quick-choices"] input:checked, [data-testid="years-combined"] [aria-pressed="true"]:not(:disabled)')??D.current?.querySelector('[data-testid="years-combined"] button:not(:disabled)');T?.scrollIntoView?.({block:"center"}),T?.focus({preventScroll:!0})}},[Y]);let xe=n.timeZone,ae=Ua(c,r),re={lang:r.lang,locale:a},de=JSON.stringify(e),ge=(0,m.useMemo)(()=>{if(!d)return null;let T=nr(e,t,["value","top"]),J=q[0]?.by??Tt(e,o,r,void 0).choices[0],z=nn(n,e,t,J,[...T,...q]),ve=new Map;for(let ye of q){let Ft=nn(n,e,t,ye.by,T),ft=nn(n,e,t,ye.by,[...T,ye]);ve.set(ye,{totals:Ft.totals,kept:ft.totals.size})}return{shown:z.totals,rows:z.rows,perRule:ve,by:J}},[n,de,t,d]),qe=(0,m.useMemo)(()=>{let T=new Map;for(let J of M){let z=Pe(n,t,{view:{...e,filters:[J]},locale:a,labels:r.core});T.set(J,z?z.items.filter(ve=>ve.kept).length:0)}if(w.filters.length&&M.length){let J=Pe(n,t,{view:{...e,filters:w.filters},locale:a,labels:r.core});T.set("quick",new Set(J?J.items.filter(z=>!z.kept).map(z=>se(z.value)):[]))}return T},[n,de,t,a,r]);if(!d||!ge)return null;let De={step:"filter",field:Q(t,r.core)},F=d.items.map(T=>T.value),_=Qt(e,t,F),ue=new Set(_.map(se)),te=Ao(n,e,t)??(y.some(T=>T.type==="label")?"text":null),pe=T=>d.items.find(J=>J.value===T)?.label,Se=T=>Co(e,T,{labels:r,locale:a,timeZone:xe,date:c.dates,labelOf:pe,span:g}),ne=T=>T.toLocaleString(a),le=w.id==="yearsCombined"&&w.years?w.years:N.map(T=>T.year),ut=c.cyclic&&N.length>1?le.length===1?L(r.yearsOne,{year:String(le[0])}):L(r.yearsAll,{years:le.length===N.length||le[le.length-1]-le[0]===le.length-1?`${le[0]}\u2013${le[le.length-1]}`:le.join(", ")}):null,Ce=w.id==="yearsCombined"?ut:w.filters.length?Ut(w.filters[0],r,a,xe,void 0,g):null,Ze=qe.get("quick")??(w.filters.length?new Set(d.items.filter(T=>!T.kept).map(T=>se(T.value))):new Set),et=d.items.filter(T=>T.kept&&ue.has(se(T.value))),ke=q.length?et.filter(T=>ge.shown.has(se(T.value))).length:et.length,Te=F.length-_.length,Lt=d.items.filter(T=>ue.has(se(T.value))&&Ze.has(se(T.value))).length,Nn=d.items.filter(T=>ue.has(se(T.value))&&!T.kept).length-Lt,_o=et.length-ke,xn=(T,J)=>{let z=[...T.entries()].filter(([,me])=>me!==null);if(!z.length)return null;let[ve,ye]=[z.reduce((me,tt)=>tt[1]<me[1]?tt:me),z.reduce((me,tt)=>tt[1]>me[1]?tt:me)],Ft=e.values.find(me=>ze({field:me.field??null,agg:me.agg},J)),ft=Be(Ft?.format??(J.agg==="count"||J.agg==="countUnique"?"integer":"number"),{locale:a}),Sn=me=>pe(JSON.parse(me))??me;return L(r.totalSpread,{low:ft(ve[1]),lowItem:Sn(ve[0]),high:ft(ye[1]),highItem:Sn(ye[0])})},zo=T=>{let J=_e(e,T.by,r),z=r.valueOps[T.op]??T.op,ve=ye=>typeof ye=="number"?ye.toLocaleString(a,{maximumFractionDigits:6}):"";return je(T.op)?L(r.totalWordsTwo,{measure:J,op:z,from:ve(Math.min(T.value,T.value2)),to:ve(Math.max(T.value,T.value2))}):L(r.totalWords,{measure:J,op:z,number:ve(T.value)})},mt=null;if(ke===0){let T=q.find(J=>ge.perRule.get(J)?.kept===0);T?mt=L(r.emptyTotal,{noun:W(ae,1,re),rule:zo(T),spread:xn(ge.perRule.get(T).totals,T.by)??""}):_.length===0?mt=r.emptyPicks:Lt+Nn>0&&(mt=L(r.emptyRules,{noun:W(ae,1,re),rules:[...Ce?[Ce]:[],...M.map(Se)].join(r.listAnd)}))}let Ot=new Map;for(let T of y)if(T.type==="value"){let J=ge.perRule.get(T),z=J.kept===0?L(r.ruleKeepsNone,{total:ne(F.length),noun:W(ae,F.length,re),spread:xn(J.totals,T.by)??""}):L(r.ruleKeeps,{kept:ne(J.kept),total:ne(F.length),noun:W(ae,F.length,re)});Ot.set(T,{kept:J.kept,text:z})}else{let J=qe.get(T)??0;Ot.set(T,{kept:J,text:L(r.ruleKeeps,{kept:ne(J),total:ne(F.length),noun:W(ae,F.length,re)})})}let At=[...e.rows,...e.cols].filter(T=>T.toLowerCase()!==t.toLowerCase()).map(T=>L(r.scopeItems,{count:ne(Pe(n,T,{view:e,locale:a,labels:r.core})?.items.length??0),field:Q(T,r.core)}));g&&At.push(L(r.scopeDates,{range:`${we(Ae(g.min),a)} \u2013 ${we(Ae(g.max),a)}`}));let Ho=At.length?At.join(r.listAnd):r.scopeRows,Wo=()=>{O(!0),he(T=>T+1)},It=(T,J)=>{l(T,De),requestAnimationFrame(()=>{let z=D.current?Je(D.current):null;(!z||!z.isConnected||!D.current?.contains(z)||z instanceof HTMLButtonElement&&z.disabled)&&D.current?.querySelector(`[data-testid="${J}"]`)?.focus()})},dt={view:e,field:t,types:o,labels:r,locale:a,commit:l,note:De,back:s,fk:c,nameKind:te,timeZone:xe,hint:i,items:d.items,noun:ae,scope:Ho,quickFilters:w.filters,focusQuick:Wo,act:It},$t=B??!U,Rt=A??U,Go=()=>{K.current=!0,E(!$t),u&&!$t&&I(!1)},Qo=()=>{K.current=!0,I(!Rt),u&&!Rt&&E(!1)},Yo={shown:ke,total:F.length,noun:ae,unpicked:Te,byQuick:Lt,byRules:Nn,byTotals:_o,itemRules:M.length,totalRules:q.length,rows:ge.rows,rowsAll:n.length,span:g,yearsText:ut,empty:mt,quickWords:Ce,rules:y.length,canReset:Te>0||U},Xo=T=>T.kept===!1,pt=c.quick&&g&&h&&f?{id:"quick",title:r.quickTitle,body:m.default.createElement(Wa,{ctx:dt,quick:w,anchor:C,setAnchorLocal:S,span:g,column:h,counts:f})}:c.cyclic&&N.length>1&&N.length<=12?{id:"years",title:r.yearsCombined,body:m.default.createElement(Ga,{ctx:dt,years:N,on:le})}:null;return m.default.createElement("div",{ref:D,className:"pk-filter pk-filter-level"},m.default.createElement(Ha,{ctx:dt,state:Yo}),pt?m.default.createElement(on,{id:pt.id,title:pt.title,state:Ce&&!x?Ce:null,open:x,onToggle:()=>O(!x)},pt.body):null,m.default.createElement(on,{id:"picks",title:r.pickItems,state:Te?L(r.picksState,{picked:ne(_.length),total:ne(F.length)}):L(r.picksAll,{total:ne(F.length)}),open:$t,onToggle:Go,action:m.default.createElement("button",{type:"button",className:"pk-action",disabled:!Te,"aria-label":r.clearPicks,onClick:()=>It(sn(e,t,F,F),"section-picks"),"data-testid":"filter-clear-picks"},r.clear)},m.default.createElement(Io,{items:d.items,selected:ue,onChange:T=>l(sn(e,t,F.filter(J=>T.has(se(J))),F),De),labels:r,locale:a,autoFocus:!U&&!c.quick&&i!=="conditions",tail:U?{isOut:Xo,render:(T,J,z)=>m.default.createElement(za,{out:T,row:J,searching:z,labels:r,locale:a})}:void 0})),m.default.createElement(on,{id:"rules",title:r.rulesTitle,state:y.length?m.default.createElement(m.default.Fragment,null,m.default.createElement("span",{className:"pk-section-mark"},"\u25CF")," ",L(W(r.rulesState,y.length,re),{count:ne(y.length)})):r.rulesNoneState,open:Rt,onToggle:Qo,action:m.default.createElement("button",{type:"button",className:"pk-action",disabled:!y.length,"aria-label":r.removeRules,onClick:()=>It(ma(e,t,w.filters),"section-rules"),"data-testid":"filter-remove-rules"},r.removeAll)},m.default.createElement(tr,{ctx:dt,rules:y,focusFirst:i==="conditions",quickLine:Ce,results:Ot})))}function or({view:e,field:t,types:n,labels:o,locale:r,commit:a,back:l}){let s=fe(e,t,["top"])[0],{choices:i,names:d}=Tt(e,n,o,s?.by),[u,c]=(0,$.useState)(()=>Bo(i,s?.by)),p=s&&!s.bottom&&cn.includes(s.count)?s.count:null,[h,g]=(0,$.useState)(!!s&&p===null),[f,N]=(0,$.useState)(!!s?.bottom),[w,v]=(0,$.useState)(ce(s?.count??10,r)),S=ct(),C=Ne(w,{kind:"count",labels:o,locale:r}),x=Q(t,o.core),O=I=>a(xo(e,t,I,s),{step:"top",field:x}),B=I=>{let D={bottom:f,count:w,by:u,...I},R=Ne(D.count,{kind:"count",labels:o,locale:r}).value;R!==null&&O({count:R,bottom:D.bottom,by:i[D.by]})},E=ie(),A=(I,D,R,y)=>$.default.createElement("label",{className:"pk-radio"},$.default.createElement("input",{type:"radio",name:E,checked:R,onChange:y,"data-autofocus":R?"":void 0,"data-testid":`top-${I}`}),$.default.createElement("span",null,D));return $.default.createElement("div",{className:"pk-level-form"},$.default.createElement("div",{role:"radiogroup","aria-label":o.topN,className:"pk-radios"},A("off",o.off,!s&&!h,()=>{g(!1),O(null)}),cn.map(I=>$.default.createElement($.default.Fragment,{key:I},A(String(I),L(o.topBadge,{count:I.toLocaleString(r)}),!h&&p===I,()=>{g(!1),O({count:I,bottom:!1,by:i[u]})}))),A("own",o.topOwn,h,()=>{g(!0),B({})})),h?$.default.createElement("div",{className:"pk-inline-form"},$.default.createElement("div",{className:"pk-segmented pk-small",role:"group","aria-label":o.topN},[!1,!0].map(I=>$.default.createElement("button",{key:String(I),type:"button","aria-pressed":f===I,onClick:()=>{N(I),B({bottom:I})},"data-testid":I?"top-bottom":"top-top"},I?o.bottom:o.top))),$.default.createElement(Ye,{value:w,onChange:I=>{v(I),S.later(()=>B({count:I}))},onKeyDown:Xe({now:S.now,restore:()=>{S.cancel();let I=ce(s?.count??10,r);return w===I?!1:(v(I),!0)},back:l}),onBlur:S.now,problem:C.problem,label:o.topCount,testId:"top-count",className:"pk-field-label pk-narrow-input"})):null,$.default.createElement("div",{className:"pk-inline-form"},$.default.createElement(Mo,{choices:i,names:d,index:u,onChange:I=>{c(I),s&&O({count:s.count,bottom:!!s.bottom,by:i[I]})},label:o.topBy,prefix:o.topBy,testId:"top-by"})))}function ar({view:e,field:t,labels:n,locale:o,range:r,regroup:a,back:l}){let s=vt(e,t),i=s?.by==="bin"?s:null,[d,u]=(0,$.useState)(ce(i?.size,o)),[c,p]=(0,$.useState)(ce(i?.origin,o)),[h,g]=(0,$.useState)(!1),f=(0,$.useId)(),N=Ne(d,{kind:"size",tried:h,labels:n,locale:o}),w=Ne(c,{required:!1,labels:n,locale:o}),v=N.value,S=c.trim()===""?0:w.value,C=v!==null&&S!==null&&oa(v,S,r)==="far",x=O=>O.toLocaleString(o,{maximumFractionDigits:6});return $.default.createElement("form",{className:"pk-inline-form pk-bin-form",onSubmit:O=>{if(O.preventDefault(),i&&d.trim()===""){a(null);return}g(!0),v!==null&&S!==null&&!C&&a("bin",v,S)},onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),l())}},$.default.createElement(Ye,{value:d,onChange:u,problem:N.problem,label:n.binSize,shown:n.binSize,testId:"bin-size",autoFocus:!0}),$.default.createElement("label",{className:"pk-field-label"},$.default.createElement("span",null,n.binStart),$.default.createElement(Ee,{type:"text",inputMode:"decimal",autoComplete:"off",spellCheck:!1,value:c,placeholder:"0",onChange:p,clearLabel:n.clearText,"data-testid":"bin-start","aria-invalid":C||w.problem?!0:void 0,"aria-describedby":C||w.problem?f:void 0})),w.problem?$.default.createElement("p",{id:f,className:"pk-form-problem","data-testid":"bin-start-problem"},w.problem):C&&r&&S!==null&&v!==null?$.default.createElement("p",{id:f,className:"pk-form-problem","data-testid":"bin-problem"},L(n.binStartFar,{start:x(S),min:x(r.min),max:x(r.max)})):null,$.default.createElement("button",{type:"submit",className:"pk-btn pk-primary",disabled:C,"data-testid":"bin-apply"},n.apply),i?$.default.createElement("button",{type:"button",className:"pk-btn",onClick:()=>a(null),"data-testid":"bin-off"},n.binsOff):null)}function rr({view:e,index:t,labels:n,commit:o,back:r}){let a=e.values[t],s={step:"value",field:ot(a,n)},i=Do(a.label??"",d=>o(rn(e,t,{label:d.trim()||null}),s),0);return $.default.createElement("div",{className:"pk-inline-form pk-level-form"},$.default.createElement(Ee,{type:"text",value:i.text,placeholder:ot({...a,label:null},n),onChange:i.set,onBlur:i.flush,onKeyDown:Xe({now:()=>{i.flush(),r()},restore:i.restore,back:r}),onClear:()=>a.label?o(rn(e,t,{label:null}),s):void 0,clearLabel:n.defaultName,"aria-label":n.rename,maxLength:200,"data-autofocus":"","data-testid":"value-name"}),$.default.createElement("p",{className:"pk-hint"},n.nameHint))}function kn({name:e,info:t,extra:n,labels:o}){let r=$.default.createElement($.default.Fragment,null,t?.description,t?.href?$.default.createElement($.default.Fragment,null," ",$.default.createElement("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"pk-learn-more"},o.learnMore)):null,t?.description&&n?$.default.createElement($.default.Fragment,null,$.default.createElement("br",null),$.default.createElement("br",null)):null,n);return $.default.createElement("div",{className:"pk-level-name"},$.default.createElement("span",{className:"pk-level-name-text","data-testid":"menu-head"},e),t?.description||n?$.default.createElement(_t,{info:{description:r},name:e,labels:o,className:"pk-menu-info",testId:"menu-info"}):null)}function vn({labels:e,onRemove:t,close:n}){return $.default.createElement(Ct,{id:"menu-remove",text:e.remove,icon:"trash",danger:!0,onSelect:()=>{n(),t()}})}var yn=(e,t)=>n=>{let o=n.change?.();n.closes&&t(),o&&e(o.view,o.note)};function as({view:e,zone:t,index:n,field:o,types:r,labels:a,commit:l,close:s,onRemove:i,defaultsOf:d,rangeOf:u,locale:c,info:p,state:h,encoded:g}){let f=Re(e,o),N=ga({view:e,zone:t,index:n,field:o,types:r,labels:a,locale:c,state:h,defaultsOf:d,encoded:g}),w=(C,x,O)=>{s();let B=Q(f,a.core),E=C?Kt(B,C,a,x):null;l(Gt(e,o,C,{size:x,origin:O,name:E??void 0}).view,{step:"group",field:B})},v=(C,x,O)=>C==="filter"?$.default.createElement(Po,{view:e,field:o,encoded:g,types:r,labels:a,locale:c,commit:l,back:x,hint:O}):C==="top"?$.default.createElement(or,{view:e,field:o,types:r,labels:a,locale:c,commit:l,back:x}):C==="bins"?$.default.createElement(ar,{view:e,field:o,labels:a,locale:c,range:u?.(f)??null,regroup:w,back:x}):null,S=Q(o,a.core);return $.default.createElement(it,{name:S,labels:a,locale:c,topics:N,close:s,onPick:yn(l,s),panel:v,search:!0,head:$.default.createElement(kn,{name:S,info:p,labels:a}),foot:$.default.createElement(vn,{labels:a,onRemove:i,close:s})})}function rs({view:e,index:t,field:n,types:o,labels:r,commit:a,close:l,onRemove:s,locale:i,info:d,state:u,encoded:c}){let p=Q(n,r.core);return $.default.createElement(it,{name:p,labels:r,locale:i,topics:va({view:e,index:t,field:n,types:o,labels:r,locale:i,state:u,encoded:c}),close:l,onPick:yn(a,l),panel:(h,g,f)=>h==="filter"?$.default.createElement(Po,{view:e,field:n,encoded:c,types:o,labels:r,locale:i,commit:a,back:g,hint:f}):null,search:!0,head:$.default.createElement(kn,{name:p,info:d,labels:r}),foot:$.default.createElement(vn,{labels:r,onRemove:s,close:l})})}function ss({view:e,index:t,types:n,labels:o,commit:r,close:a,onRemove:l,defaultsOf:s,info:i,earlier:d,locale:u="en-US"}){let{explain:c}=$.default.useContext(rt),p=ot(e.values[t],o),h=Ea({view:e,index:t,types:n,labels:o,locale:u,defaultsOf:s,earlier:d});return $.default.createElement(it,{name:p,labels:o,locale:u,topics:h,close:a,onPick:yn(r,a),panel:(g,f)=>g==="name"?$.default.createElement(rr,{view:e,index:t,labels:o,commit:r,back:f}):null,search:!0,head:$.default.createElement(kn,{name:p,info:i,extra:c?o.settingInfo.valuesFilter:null,labels:o}),foot:$.default.createElement(vn,{labels:o,onRemove:l,close:a})})}var sr=/[<>:"/\\|?*\u0000-\u001F\u007F]+/g,lr=/^(con|prn|aux|nul|com\d|lpt\d)$/i;function wn(e){let n=ir((typeof e=="string"?e:"").replace(sr,"-").replace(/^[\s.-]+/,"").slice(0,120));return n&&!lr.test(n)?n:"pivot"}function ir(e){let t=e.length;for(;t>0&&(e[t-1]==="."||/\s/.test(e[t-1]));)t--;return e.slice(0,t)}function cr(e){let t=/^data:([^,;]*)((?:;[^,;]*)*?)(;base64)?,(.*)$/s.exec(e);if(!t)throw new TypeError("not a data: URL");let n=t[1]||"application/octet-stream";if(t[3]){let o=atob(t[4]),r=new Uint8Array(o.length);for(let a=0;a<o.length;a++)r[a]=o.charCodeAt(a);return new Blob([r],{type:n})}return new Blob([decodeURIComponent(t[4])],{type:n})}function Vo(e,t,n=document){let o=URL.createObjectURL(e),r=n.createElement("a");r.href=o,r.download=t,r.rel="noopener",n.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(o),1e4)}async function dn(e,t){try{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")return await navigator.clipboard.writeText(e),!0}catch{}if(!t)return!1;let n=t.ownerDocument,o=n.createElement("textarea");o.value=e,o.readOnly=!0,o.className="pk-sr";let r=t.getRootNode()instanceof ShadowRoot?t.getRootNode().activeElement:n.activeElement;t.appendChild(o);let a;try{o.select(),a=typeof n.execCommand=="function"&&n.execCommand("copy")}catch{a=!1}return o.remove(),r?.focus?.({preventScroll:!0}),a}var ur="0.4.0",mr=()=>typeof location<"u"?location.href:void 0;function dr(e,t){let{view:n,viewName:o,sourceId:r,sourceName:a,schemaUrl:l,encoded:s,announce:i,limits:d,param:u}=e,c=()=>Dn(nt(n,{name:o??"",createdAt:new Date,generator:{name:"pivotkit-react",version:ur},source:{id:r,name:a},data:s,...l!==void 0?{schemaUrl:l}:{}}));return{copyLink:async()=>{let p=eo(e.shareLink,mr());if(p===null)return;let h;try{h=(Zt()??await Xt()).encodeViewLink(nt(n,{name:o??void 0,source:{id:r}},{link:!0}))}catch(f){i(f&&f.code==="LIMIT_EXCEEDED"?t.toastLinkTooLong:L(t.error,{message:String(f)}),{tone:"error"});return}let g=await dn(Zn(p,u,h),e.root.current);i(g?t.toastLinkCopied:t.toastCopyFailed,g?void 0:{tone:"error"})},copyJson:async()=>{let p=await dn(c(),e.root.current);i(p?t.toastJsonCopied:t.toastCopyFailed,p?void 0:{tone:"error"})},download:()=>{let p=Mn(o||a||wn(e.fileName)),h=new Blob([c()],{type:"application/json"});e.onExport?.({kind:"json",fileName:p,blob:h})!==!1&&(Vo(h,p,e.root.current?.ownerDocument??document),i(L(t.toastExported,{file:p})))},loadText:async p=>{let h=to(p,s,{limits:d,sourceId:r});if(h.failed==="notJson"){let v=p.trim(),C=(v.includes("#")?en(v.slice(v.indexOf("#")),u)??en(v.slice(v.indexOf("#")),"pivot"):null)??(v.startsWith("1.")?v:null);if(!C)return t.viewFailed.notJson;try{let x=(Zt()??await Xt()).decodeViewLink(C);h=x.view?no(x.view,s,{limits:d,sourceId:r}):{view:null,issues:[],failed:"badLink",file:null}}catch{return t.viewFailed.badLink}}if(!h.view)return t.viewFailed[h.failed??"notView"]??t.viewFailed.notView;let g=h,f=oo(g,t,Array.isArray(e.sources)?e.sources:[]);if(!f)return e.applyLoaded(g),null;let N=f.switchTo,w=e.onSourceSwitch;return{lines:f.lines,load:()=>e.applyLoaded(g),switchTo:N&&typeof w=="function"?{name:N.name,run:()=>w({source:{id:N.id,name:N.name},view:g.file?.view??g.view,name:g.file?.name||void 0})}:void 0}}}}var xt=e=>e.host||e.store,pr=(e,t)=>!!t&&e.name===t.name&&(e.scope==="user"?"user":"shared")===t.scope&&e.at!==void 0===t.store&&(!t.store||(e.sourceId??null)===(t.storeSource??null)),pn=(e,t,n)=>e.find(o=>o.at!==void 0&&o.name===t&&(o.sourceId??null)===(n??null));function fr(e,t,n,o=!1){if(!e)return null;let r;if(e.scope==="shared")r=n.publish?{kind:"publish"}:xt(n)?{kind:null,why:"saveSharedLocked"}:null;else if(e.scope==="user"&&e.store){let a=pn(t,e.name,e.storeSource);r=n.store?a?{kind:"store",at:a.at,storeSource:e.storeSource??null}:{kind:"store",storeSource:n.sourceId??null}:null}else e.scope==="user"?r=n.host?{kind:"host"}:null:r=xt(n)?{kind:null,why:"saveNotInViews"}:null;return r&&r.kind&&o?{kind:null,why:"exportNeedsField"}:r}function hr(e,t,n){if(n.host)return{kind:"host",replaces:t.find(r=>r.scope==="user"&&r.at===void 0&&r.name===e)??null};let o=pn(t,e,n.sourceId)??pn(t,e,null);return o?{kind:"store",at:o.at,storeSource:o.sourceId??null,replaces:o}:{kind:"store",storeSource:n.sourceId??null,replaces:null}}var He=Object.freeze({count:100,text:5e5}),wo=!1;function jo(e){return e?e.length>He.text?(wo||(wo=!0,console.warn(`pivotkit: the browser store of views holds more than ${He.text} characters; it is not read, and the next save replaces it`)),[]):co(e).templates:[]}function ms(e,t){return jo(e).map((n,o)=>({name:n.name,view:n.view,at:o,...n.source?.id?{sourceId:n.source.id}:{}})).filter(n=>!n.sourceId||!t||n.sourceId===t)}function gr(e,t,n){let o=jo(e),r=o;if(t.remove!==void 0){if(o[t.remove]?.name!==t.removeName)throw new Error(n("changed",0));r=o.filter((s,i)=>i!==t.remove)}let a=!!(t.name&&t.view);if(a&&t.replace!==void 0){let s=o[t.replace];if(s?.name!==t.name)throw new Error(n("changed",0));r=o.map((i,d)=>d===t.replace?{name:s.name,view:t.view,...s.source?{source:s.source}:{}}:i)}else if(a){let s=t.sourceId;if(r=r.filter(i=>i.name!==t.name||(i.source?.id??void 0)!==s),r.push({name:t.name,view:t.view,...s?{source:{id:s}}:{}}),r.length>He.count)throw new Error(n("count",He.count))}let l=r.length?JSON.stringify(r.map(s=>nt(s.view,{name:s.name,source:s.source},{link:!0}))):null;if(a&&l&&l.length>He.text)throw new Error(n("text",He.text));return l}function kr(e,t,n,o,r){let a={count:n.storeFull,text:n.storeTooLarge,changed:n.storeChanged},l=gr(e,t,(s,i)=>L(a[s],{max:i.toLocaleString(o)}));if(!r(l))throw new Error(n.storeRefused)}function vr({view:e,plan:t,labels:n,onChart:o,close:r}){let a=Vt(e.chart);return Un.map(l=>k.default.createElement($e,{key:l,icon:Pt[l].icon,checked:e.display==="chart"&&a===l,hint:l==="auto"&&t?L(n.chartAutoNow,{type:n.chartTypes[t.name]}):void 0,onSelect:()=>{r(),o(l)},testId:`chart-${l}`},n.chartTypes[l]))}var Eo={slices:["auto","off","value","percent","both"],other:["auto","off","value"]},yr=["outside","inside"],wr=["auto","bottom","right","off"],Er=["auto","all","nth"],br=["auto","on","off"];function Nr({title:e,labels:t,onDisplay:n}){let[o,r]=(0,k.useState)(e??""),[a,l]=(0,k.useState)(e);return e!==a&&(l(e),r(e??"")),k.default.createElement("form",{className:"pk-inline-form",onSubmit:s=>{s.preventDefault(),n({title:o.trim()||null})}},k.default.createElement(Ee,{type:"text",value:o,onChange:r,onClear:()=>e?n({title:null}):void 0,clearLabel:t.clearText,placeholder:t.chartTitleNone,"aria-label":t.chartTitle,maxLength:200,"data-testid":"chart-title"}),k.default.createElement("button",{type:"submit",className:"pk-btn pk-primary",disabled:(o.trim()||null)===(e??null)},t.apply))}function Ve({title:e,info:t,children:n}){let o=(0,k.useId)();return k.default.createElement("div",{className:"pk-subsection",role:e?"group":void 0,"aria-labelledby":e?o:void 0},e?k.default.createElement("div",{className:`pk-subtitle${t?" pk-setting-row":""}`},k.default.createElement("span",{id:o},e),t?k.default.createElement(lt,{id:t,name:e}):null):null,n)}function xr({view:e,plan:t,labels:n,onDisplay:o}){let r=e.chart,a=t?t.name:Vt(r),l=qn.includes(a),s=Pt[a].axis,i=l?Eo.slices:Eo.other,d=!l&&(r.valueLabels==="percent"||r.valueLabels==="both")?"value":r.valueLabels;return k.default.createElement(Qe,{title:n.chartDisplay},k.default.createElement(Ve,{title:n.valueLabels},k.default.createElement("div",{className:"pk-choice-grid"},i.map(u=>k.default.createElement($e,{key:u,checked:d===u,onSelect:()=>o({valueLabels:u}),testId:`labels-${u}`},n.valueLabelNames[u])))),l?k.default.createElement(Ve,{title:n.labelPosition,info:"labelPosition"},k.default.createElement("div",{className:"pk-choice-grid"},yr.map(u=>k.default.createElement($e,{key:u,checked:(r.labelPosition??"outside")===u,disabled:r.valueLabels==="off",onSelect:()=>o({labelPosition:u}),testId:`label-position-${u}`},n.labelPositionNames[u])))):null,k.default.createElement(Ve,{title:n.legend},k.default.createElement("div",{className:"pk-choice-grid"},wr.map(u=>k.default.createElement($e,{key:u,checked:r.legend===u,onSelect:()=>o({legend:u}),testId:`legend-${u}`},n.legendNames[u])))),k.default.createElement(Ve,{title:n.chartTitle},k.default.createElement(Nr,{title:r.title,labels:n,onDisplay:o})),s?k.default.createElement(Ve,{title:n.axisLabels},k.default.createElement("div",{className:"pk-choice-grid"},Er.map(u=>k.default.createElement($e,{key:u,checked:r.axisLabels===u,onSelect:()=>o({axisLabels:u}),testId:`axis-${u}`},n.axisLabelNames[u])))):null,s&&e.rows.length>=2?k.default.createElement(Ve,{title:n.groupLabels,info:"groupLabels"},k.default.createElement("div",{className:"pk-choice-grid"},br.map(u=>k.default.createElement($e,{key:u,checked:r.groupLabels===u,onSelect:()=>o({groupLabels:u}),testId:`groups-${u}`},n.groupLabelNames[u])))):null,a==="line"||a==="area"?k.default.createElement(Ve,null,k.default.createElement(Cr,{checked:r.smooth,onChange:u=>o({smooth:u}),testId:"chart-smooth"},n.smoothLines)):null)}function ds({view:e,plan:t,labels:n,onChart:o,onDisplay:r,close:a}){return k.default.createElement(k.default.Fragment,null,k.default.createElement(Qe,{title:n.chartType},k.default.createElement("div",{className:"pk-choice-grid"},k.default.createElement(vr,{view:e,plan:t,labels:n,onChart:o,close:a}))),k.default.createElement(xr,{view:e,plan:t,labels:n,onDisplay:r}))}function Sr({labels:e,mod:t}){let n=o=>o==="Mod"?t==="\u2318"?"\u2318":e.keys.Mod:Object.hasOwn(e.keys,o)?e.keys[o]:o;return k.default.createElement("dl",{className:"pk-shortcuts","data-testid":"shortcuts"},ao.map(o=>k.default.createElement("div",{key:o.text,className:"pk-shortcut"},k.default.createElement("dt",null,o.keys.map((r,a)=>k.default.createElement(k.default.Fragment,{key:r},a?" + ":null,k.default.createElement("kbd",null,n(r))))),k.default.createElement("dd",null,e.shortcuts[o.text]))))}function Cr({checked:e,onChange:t,testId:n,children:o}){let r=ie();return k.default.createElement("label",{className:"pk-switch"},k.default.createElement("input",{type:"checkbox",name:r,checked:e,onChange:a=>t(a.target.checked),"data-testid":n}),k.default.createElement("span",{className:"pk-switch-track","aria-hidden":"true"}),k.default.createElement("span",{className:"pk-switch-text"},o))}function ps({view:e,labels:t,onTotal:n,onExpand:o,onCollapse:r,close:a,tips:l,mod:s,folding:i,help:d}){let u=ba({view:e,labels:t,folding:i,tips:l,explanations:d?.explanations??null,act:{total:n,expand:()=>o(t),collapse:()=>r(t),tipsOn:c=>l.onOn(c),resetTips:()=>l.onReset(),explain:c=>d?.explanations?.set(c)}});return k.default.createElement(it,{name:t.options,labels:t,topics:u,close:a,onPick:qo(a),panel:c=>c==="shortcuts"?k.default.createElement(Sr,{labels:t,mod:s}):null})}var qo=e=>t=>{t.closes&&e(),t.run?.()};function Uo({question:e,action:t,cancel:n,onYes:o,onNo:r,testId:a,yesId:l,noId:s,danger:i=!1,busy:d=!1,focusYes:u=!1}){let c=(0,k.useRef)(null),p=(0,k.useRef)(null);return(0,k.useEffect)(()=>{(u?p:c).current?.focus({preventScroll:!0})},[u]),k.default.createElement("div",{className:"pk-confirm pk-save-confirm",role:"group","aria-label":e,"data-testid":a},k.default.createElement("span",{className:"pk-confirm-text"},e),k.default.createElement("button",{ref:p,type:"button",className:i?"pk-btn pk-danger-btn":"pk-btn pk-primary",disabled:d,"data-autofocus":u?"":void 0,"data-testid":l,onClick:o},t),k.default.createElement("button",{ref:c,type:"button",className:"pk-btn",disabled:d,"data-autofocus":u?void 0:"","data-testid":s,onClick:r},n))}function Tr({labels:e,button:t,onSave:n,resolve:o,close:r}){let[a,l]=(0,k.useState)(""),[s,i]=(0,k.useState)(null),d=(0,k.useRef)(null),u=(0,k.useRef)(!1);return(0,k.useEffect)(()=>{s?u.current=!0:u.current&&d.current?.focus({preventScroll:!0})},[s]),s?k.default.createElement(Uo,{question:L(e.replaceConfirm,{name:s.name}),action:e.replaceAction,cancel:e.cancel,testId:"replace-confirm",yesId:"confirm-replace",noId:"cancel-replace",onYes:()=>{r(),n(s.name,s.target)},onNo:()=>i(null)}):k.default.createElement("form",{className:"pk-inline-form",onSubmit:c=>{c.preventDefault();let p=a.trim(),h=p?o(p):null;h?.replaces?i({name:p,target:h}):h&&(r(),n(p,h))}},k.default.createElement(Ee,{type:"text",value:a,onChange:l,clearLabel:e.clearText,placeholder:e.viewName,"aria-label":e.viewName,maxLength:120,"data-testid":"saved-view-name",inputRef:d}),k.default.createElement("button",{type:"submit",className:"pk-btn pk-primary",disabled:!a.trim()},t))}function Lr({check:e,labels:t,onCancel:n,close:o,title:r,quiet:a=!1}){let l=(0,k.useId)(),s=(0,k.useRef)(null);return(0,k.useEffect)(()=>{a||s.current?.focus({preventScroll:!0})},[a]),k.default.createElement("div",{className:"pk-load-check",role:"group","aria-labelledby":l,"data-testid":"load-check"},k.default.createElement("p",{id:l,className:"pk-load-check-title"},k.default.createElement(X,{name:"info",size:16}),k.default.createElement("span",null,r??t.loadCheckTitle)),k.default.createElement("ul",{className:"pk-load-check-lines"},e.lines.map((i,d)=>k.default.createElement("li",{key:d},i))),k.default.createElement("div",{className:"pk-load-check-actions"},e.switchTo?k.default.createElement("button",{ref:s,type:"button",className:"pk-btn pk-primary","data-autofocus":"","data-testid":"load-switch",onClick:()=>{o(),e.switchTo?.run()}},L(t.switchAndLoad,{source:e.switchTo.name})):null,k.default.createElement("button",{ref:e.switchTo?void 0:s,type:"button",className:e.switchTo?"pk-btn":"pk-btn pk-primary","data-autofocus":e.switchTo?void 0:"","data-testid":"load-anyway",onClick:()=>{o(),e.load()}},t.loadAnyway),k.default.createElement("button",{type:"button",className:"pk-btn","data-testid":"load-cancel",onClick:n},t.cancel)),e.switchTo?k.default.createElement("p",{className:"pk-hint"},t.switchStartsFresh):null)}function Or({labels:e,onLoadText:t,close:n}){let[o,r]=(0,k.useState)(""),[a,l]=(0,k.useState)(null),[s,i]=(0,k.useState)(null),[d,u]=(0,k.useState)(!1),c=(0,k.useRef)(null),p=(0,k.useRef)(null),h=(0,k.useId)(),g=ie();(0,k.useEffect)(()=>{s||p.current?.focus({preventScroll:!0})},[s]);let f=async N=>{u(!0);let w=await t(N);u(!1),typeof w=="string"?l(w):w?i(w):n()};return s?k.default.createElement(Lr,{check:s,labels:e,onCancel:()=>i(null),close:n}):k.default.createElement("form",{className:"pk-inline-form pk-load-view",onSubmit:N=>{N.preventDefault(),f(o)}},k.default.createElement("p",{className:"pk-hint"},e.loadViewHint),k.default.createElement(Ee,{multiline:!0,value:o,onChange:N=>{r(N),l(null)},clearLabel:e.clearText,"aria-label":e.loadViewText,placeholder:e.loadViewText,rows:4,spellCheck:!1,"aria-invalid":a?!0:void 0,"aria-describedby":a?h:void 0,"data-testid":"load-view-text",inputRef:p}),a?k.default.createElement("p",{id:h,className:"pk-form-problem",role:"alert","data-testid":"load-view-problem"},a):null,k.default.createElement("input",{ref:c,type:"file",name:`${g}-file`,accept:"application/json,.json",className:"pk-sr",tabIndex:-1,"aria-hidden":"true","aria-label":e.chooseFile,"data-testid":"load-view-file",onChange:async N=>{let w=N.target.files?.[0];if(N.target.value="",w){let v;try{v=w.size>Ke.text?null:await w.text()}catch{v=null}v===null?l(w.size>Ke.text?e.viewFailed.tooLarge:e.viewFailed.file):f(v)}}}),k.default.createElement("button",{type:"button",className:"pk-btn",onClick:()=>c.current?.click(),disabled:d,"data-testid":"load-view-choose"},k.default.createElement(X,{name:"file"}),k.default.createElement("span",{className:"pk-btn-text"},e.chooseFile)),k.default.createElement("button",{type:"submit",className:"pk-btn pk-primary",disabled:d||!o.trim(),"data-testid":"load-view-apply"},e.load))}function Ar(e,t){let n=(a,l,s,i,d)=>Promise.resolve().then(a).then(()=>(e.announce(L(l,{name:d})),!0),u=>(e.announce(Pn(s,i,u),{tone:"error"}),!1)),o=a=>kr(e.viewsText,a,t,e.locale,e.keep);return{save:(a,l)=>{let s=e.viewKey;return n(()=>a.kind==="publish"?e.onPublish(l,e.view):a.kind==="host"?e.onSave(l,e.view,{scope:"user"}):o({name:l,view:e.view,sourceId:e.sourceId,replace:a.at}),t.toastSaved,t.toastSaveFailed,t.toastSaveRejected,l).then(i=>i&&e.onSaved({name:l,scope:a.kind==="publish"?"shared":"user",store:a.kind==="store",storeSource:a.kind==="store"?a.storeSource:null},s))},remove:e.onDelete||e.store?a=>n(()=>a.at!==void 0?o({remove:a.at,removeName:a.name}):e.onDelete(a.name,{scope:a.scope}),t.toastDeleted,t.toastDeleteFailed,t.toastDeleteRejected,a.name):null,publish:e.onPublish?a=>n(()=>e.onPublish(a.name,e.normalized(a.view)),t.toastPublished,t.toastPublishFailed,t.toastPublishRejected,a.name):null}}function fs({templates:e,labels:t,onLoad:n,actions:o,close:r,share:a}){let{save:l,remove:s,publish:i}=Ar(o,t),d={host:!!o.onSave,store:!!o.store,publish:!!i,sourceId:o.sourceId},u=fr(o.loaded,e,d,o.empty),c=o.store&&!o.onSave,[p,h]=(0,k.useState)(null),[g,f]=(0,k.useState)(!1);(0,k.useEffect)(()=>{a?.prepare?.()},[a]);let N=!!i||e.some(D=>D.scope==="shared"&&D.deletable),w=Na(e),v=D=>e.flatMap((R,y)=>R.scope===D?[y]:[]),S=(D,R)=>{let y=e[D],M=w[D],q=xa(R,R.indexOf(D)),U=(ee,K)=>()=>h({kind:ee,t:y,focus:K});return{id:M,testId:`saved-view-${y.name}`,text:y.name,icon:"bookmark",current:pr(y,o.loaded),closes:!0,run:()=>n(y),info:y.scope==="shared"&&N&&!(s&&y.deletable)?"sharedView":void 0,actions:[...i&&y.scope==="user"?[{id:`publish:${M}`,testId:`publish-view-${y.name}`,text:y.name,label:L(t.publishView,{name:y.name}),icon:"upload",open:"confirm",backTo:`item:${M}`,run:U("publish",`item:${M}`)}]:[],...s&&y.deletable?[{id:`delete:${M}`,testId:`delete-view-${y.name}`,text:y.name,label:L(t.deleteView,{name:y.name}),icon:"trash",open:"confirm",backTo:`item:${M}`,run:U("delete",q===void 0?void 0:`item:${w[q]}`)}]:[]]}},C=v("shared"),x=v("user"),O=[];u&&O.push({id:"save-loaded",text:L(t.saveNamed,{name:o.loaded.name}),icon:"save",disabled:u.kind===null,reason:u.kind===null?t[u.why]:void 0,...u.kind==="publish"?{open:"confirm",run:()=>h({kind:"replaceShared"})}:{closes:!0,run:()=>l(u,o.loaded.name)}}),xt(d)&&O.push({id:"save-as",text:o.loaded?t.saveAs:`${t.saveView}\u2026`,icon:"save",open:"saveAs"});let B=a?dr(a,t):null,E=p?.kind==="replaceShared"?{text:L(t.replaceSharedConfirm,{name:o.loaded?.name}),action:t.replaceAction,testId:"replace-shared-confirm",yesId:"confirm-replace-shared",noId:"cancel-replace-shared"}:p?{text:L(p.kind==="publish"?t.publishConfirm:t.deleteConfirm,{name:p.t.name}),action:p.kind==="publish"?t.publishAction:t.deleteAction,testId:`${p.kind}-confirm`,yesId:`confirm-${p.kind}`,noId:`cancel-${p.kind}`}:null,A=[...O.length?[{id:"thisView",title:t.thisView,kind:"inline",titled:!0,groups:[{choices:O}]}]:[],...C.length?[{id:"sharedViews",title:t.sharedViews,kind:"inline",titled:!0,groups:[{choices:C.map(D=>S(D,C))}]}]:[],...x.length||xt(d)||!C.length?[{id:"myViews",title:t.myViews,kind:"inline",titled:!0,groups:[{choices:x.map(D=>S(D,x))}],note:x.length?c?t.storeNote:null:c?t.noViewsStore:t.noViews,noteId:c?"store-note":void 0}]:[],...B?[{id:"share",title:t.shareThisView,kind:"inline",titled:!0,groups:[{choices:[...a.canLink?[{id:"copy-link",text:t.copyLink,icon:"link",closes:!0,run:B.copyLink}]:[],{id:"copy-json",text:t.copyJson,icon:"copy",closes:!0,run:B.copyJson},{id:"download-view",text:t.downloadView,icon:"download",closes:!0,run:B.download},{id:"load-view",text:t.loadView,icon:"upload",open:"load"}]}],note:t.sharePrivacy,noteId:"share-privacy"}]:[],{id:"saveAs",title:t.saveAs,levelTitle:(o.loaded?t.saveAs:t.saveView).replace(/…$/,""),kind:"panel",hidden:!0},{id:"load",title:t.loadView,levelTitle:t.loadView.replace(/…$/,""),kind:"panel",hidden:!0},{id:"confirm",title:E?.action??"",kind:"panel",hidden:!0}],I=(D,R)=>D==="saveAs"?k.default.createElement(Tr,{labels:t,button:o.loaded?t.saveAs.replace(/…$/,""):t.save,onSave:(y,M)=>l(M,y),resolve:y=>hr(y,e,d),close:r}):D==="load"&&B?k.default.createElement(Or,{labels:t,onLoadText:B.loadText,close:r}):D==="confirm"&&E&&p?k.default.createElement(Uo,{question:E.text,action:E.action,cancel:t.cancel,danger:p.kind==="delete",focusYes:p.kind!=="replaceShared",busy:g,testId:E.testId,yesId:E.yesId,noId:E.noId,onNo:()=>R(),onYes:async()=>{if(p.kind==="replaceShared"){r(),l(u,o.loaded.name);return}f(!0);let y=await(p.kind==="publish"?i:s)?.(p.t);f(!1),y&&R(p.focus)}}):null;return k.default.createElement(it,{name:t.views,labels:t,topics:A,close:r,onPick:qo(r),panel:I,focusAgain:e.length})}function Ie({icon:e,text:t,info:n,onSelect:o,testId:r,disabled:a,reason:l}){let s=k.default.createElement($e,{icon:e,onSelect:o,disabled:a,reason:l,testId:r},t);return n?k.default.createElement("div",{className:"pk-setting-row"},s,k.default.createElement(lt,{id:n,name:t})):s}function hs({labels:e,onExport:t,chartReady:n,display:o,empty:r=!1,prepare:a,close:l}){(0,k.useEffect)(()=>{a()},[a]);let s=d=>()=>{l(),t(d)},i=r?{disabled:!0,reason:e.exportNeedsField}:{};return k.default.createElement(k.default.Fragment,null,k.default.createElement(Qe,{title:e.exportDownload},k.default.createElement(Ie,{icon:"file",text:e.exportXlsx,info:"exportXlsx",onSelect:s("xlsx"),...i,testId:"export-xlsx"}),k.default.createElement(Ie,{icon:"file",text:e.exportCsv,info:"exportCsv",onSelect:s("csv"),...i,testId:"export-csv"}),k.default.createElement(Ie,{icon:"image",text:e.exportPng,disabled:r||!n,reason:r?i.reason:o!=="chart"?e.exportPngNeedsChart:void 0,onSelect:s("png"),testId:"export-png"})),k.default.createElement(Qe,{title:e.exportCopy},k.default.createElement(Ie,{icon:"copy",text:e.copyTable,info:"copyTable",onSelect:s("copy-table"),...i,testId:"export-copy-table"}),k.default.createElement(Ie,{icon:"copy",text:e.copyDataJson,info:"copyDataJson",onSelect:s("copy-json"),...i,testId:"export-copy-json"})))}var Jo="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",En=null,an=null;function bn(){return an??=import("./export-6ILXDVGS.js").then(e=>(En=e,e),e=>{throw an=null,e}),an}var Ir=()=>En,$r=()=>{bn().catch(()=>{})};function fn(e,{doc:t,onExport:n,...o}){return n?.({...o,blob:e})===!1?!1:(Vo(e,o.fileName,t),!0)}async function Ko(e,{type:t,container:n,onExport:o,...r}){return o?.({...r,blob:new Blob([e],{type:t}),text:e})===!1?"kept":await dn(e,n)?"copied":"blocked"}async function ks(e,{fileName:t,result:n,locale:o,labels:r,limits:a,root:l,chartRef:s,announce:i,onExport:d}){r=io(r);let u=wn(t),c=l.current?.ownerDocument;try{if(e==="png"){let N=l.current?getComputedStyle(l.current).getPropertyValue("--pk-surface").trim():"",w=s.current?.getDataURL({type:"png",pixelRatio:2,backgroundColor:N||void 0}),v=`${u}.png`;w&&fn(cr(w),{kind:e,fileName:v,doc:c,onExport:d})&&i(L(r.toastExported,{file:v}));return}if(!n)return;let p=En??await bn(),h=Fn(n,{locale:o,labels:r.core,limits:a});if(e==="copy-table"||e==="copy-json"){let N=e==="copy-json",w=await Ko(N?p.toJson(h):p.toTsv(h),{kind:e,fileName:`${u}.${N?"json":"tsv"}`,type:N?"application/json":"text/tab-separated-values",container:l.current,onExport:d});w!=="kept"&&i(w==="copied"?N?r.toastDataCopied:r.toastTableCopied:r.toastCopyBlocked,w==="copied"?void 0:{tone:"error"});return}let g=`${u}.${e}`,f=e==="xlsx"?p.toXlsx(h,{sheetName:u}):p.toCsvBytes(h,{bom:!0});fn(new Blob([f],{type:e==="xlsx"?Jo:"text/csv;charset=utf-8"}),{kind:e,fileName:g,doc:c,onExport:d})&&i(L(r.toastExported,{file:g}))}catch(p){i(L(r.toastExportFailed,{message:Bt(p)}),{tone:"error"})}}function Rr({shown:e,count:t},n,o){return e<t?L(n.drillPart,{shown:e.toLocaleString(o),count:t.toLocaleString(o)}):W(n.drillCount,t,{lang:n.lang,locale:o})}async function Fr(e,{drill:t,encoded:n,labels:o,onExport:r,announce:a,root:l}){let{locale:s}=t,i={shown:t.rows.length,count:t.count},d=Rr(i,o,s),u=wn(t.name);try{let c=Ir()??await bn();if(e==="drill-copy"||e==="drill-json"){let v=e==="drill-json",S=v?JSON.stringify(Array.from(t.indices,x=>Hn(n,x)),null,2):c.toTsv([t.columns.map(x=>x.label??x.name),...t.rows]),C=await Ko(S,{kind:e,fileName:`${u}.${v?"json":"tsv"}`,type:v?"application/json":"text/tab-separated-values",container:l,onExport:r,rows:i});C!=="kept"&&a(C==="copied"?L(v?o.drillCopiedJson:o.drillCopied,{rows:d}):o.toastCopyBlocked,C==="copied"?void 0:{tone:"error"});return}let p=e==="drill-xlsx",h=Object.fromEntries(t.columns.map(v=>[v.name,v.label??v.name])),g={locale:s,formats:t.formats,labels:{fields:h,true:o.core.true,false:o.core.false}},f=`${u}.${p?"xlsx":"csv"}`,N=p?c.rowsToXlsx(n,t.indices,{...g,sheetName:t.name}):c.rowsToCsvBytes(n,t.indices,g),w=new Blob([N],{type:p?Jo:"text/csv;charset=utf-8"});fn(w,{kind:e,fileName:f,doc:l?.ownerDocument,onExport:r,rows:i})&&a(L(o.drillExported,{file:f,rows:d}))}catch(c){a(L(o.toastExportFailed,{message:Bt(c)}),{tone:"error"})}}var bo=new Set(["date","datetime","time"]);function Dr(e,{locale:t,labels:n,format:o}){let r=typeof o=="string"&&Me(o)?o.trim().toLowerCase():null;if(e.type==="date")return{text:Be(r&&bo.has(r.split(":")[0])?r:e.dateOnly?"date":"datetime",{locale:t}),numeric:!1};if(e.type==="number"){let a=new Intl.NumberFormat(t,{maximumFractionDigits:6});return{text:r&&!bo.has(r.split(":")[0])?Be(r,{locale:t}):s=>a.format(s),numeric:r!=="text"}}return e.type==="boolean"?{text:a=>a?n.true:n.false,numeric:!1}:{text:a=>String(a),numeric:!1}}function Mr(e,t,{locale:n,labels:o,formatOf:r=()=>{}}){let a=e.columns.map(s=>({column:s,...Dr(s,{locale:n,labels:o,format:r(s.name)})})),l=Array.from(t,s=>a.map(({column:i,text:d})=>{let u=i.codes[s],c=u<0?null:i.dict[u];return c==null?"":d(c)}));return{columns:a.map(s=>({name:s.column.name,numeric:s.numeric})),rows:l}}function Br(e,t,n,o){let r=[],a=[],l=(s,i,d)=>{let u=$n(e,s,d);for(let c=u;c&&c.parent;c=c.parent){let p=e.label(s,c,o.core);r.unshift(`${Q(i[c.depth-1],o.core)}: ${p}`),a.unshift(p)}};return l("cols",e.colFields,n),l("rows",e.rowFields,t),{title:r.length?r.join(" \xB7 "):o.core.grandTotal,name:a.length?a.join(" \u2013 "):o.core.grandTotal}}function Pr({result:e,rowPath:t,colPath:n,count:o,indices:r,formatOf:a,nameOf:l,infoOf:s},i){let d=Mr(e.encoded,r,{locale:e.locale,labels:i.core,formatOf:a}),u=d.columns.map(p=>({...p,label:l(p.name),description:s(p.name)?.description})),c=Object.fromEntries(d.columns.map(p=>[p.name,a(p.name)]).filter(([,p])=>typeof p=="string"));return{...Br(e,t,n,i),count:o,rows:d.rows,columns:u,indices:r,formats:c,locale:e.locale}}function ys({drill:e,onClose:t,labels:n,locale:o,exportContext:r}){let a=(0,P.useId)(),l=(0,P.useMemo)(()=>e?Pr(e,n):null,[e,n]),s=(0,P.useRef)(null),[i,d]=(0,P.useState)(!1),u=(0,P.useContext)(ht).size==="narrow",{onKeyDown:c}=Ln(s,!!l,i?()=>d(!1):t);if((0,P.useEffect)(()=>{l&&r&&$r()},[l,r]),!l)return null;let p=l.count.toLocaleString(o),h=l.rows.length<l.count,g=(f,N)=>()=>{N(),r&&Fr(f,{drill:l,labels:n,...r,root:r.root.current})};return P.default.createElement(P.default.Fragment,null,P.default.createElement("div",{className:"pk-scrim pk-drill-scrim",onClick:t,"aria-hidden":"true"}),P.default.createElement("div",{className:`pk-drill${i&&!u?" pk-drill-big":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a,"data-testid":"drill-panel","data-pk-enlarged":i&&!u?"":void 0,ref:s,tabIndex:-1,onKeyDown:f=>{f.target instanceof Node&&s.current?.contains(f.target)&&c(f)}},P.default.createElement("div",{className:"pk-drill-head"},P.default.createElement("div",{className:"pk-drill-heading"},P.default.createElement("h2",{id:a},n.drillTitle),P.default.createElement("p",{className:"pk-drill-path"},l.title),P.default.createElement("p",{className:"pk-muted","data-testid":"drill-count"},h?L(n.drillShown,{shown:l.rows.length.toLocaleString(o),count:p}):W(n.drillCount,l.count,{lang:n.lang,locale:o}))),P.default.createElement("div",{className:"pk-drill-actions"},r?P.default.createElement(On,{label:n.exportLabel,icon:"download",text:n.exportLabel,role:"dialog",align:"end",testId:"drill-export",className:"pk-btn pk-small-btn"},f=>P.default.createElement(P.default.Fragment,null,h?P.default.createElement("p",{className:"pk-hint pk-menu-hint","data-testid":"drill-export-note"},L(n.drillExportNote,{shown:l.rows.length.toLocaleString(o),count:p})):null,P.default.createElement(Qe,{title:n.exportDownload},P.default.createElement(Ie,{icon:"file",text:n.drillCsv,onSelect:g("drill-csv",f),testId:"drill-csv"}),P.default.createElement(Ie,{icon:"file",text:n.drillXlsx,onSelect:g("drill-xlsx",f),testId:"drill-xlsx"})),P.default.createElement(Qe,{title:n.exportCopy},P.default.createElement(Ie,{icon:"copy",text:n.drillCopy,info:"drillCopy",onSelect:g("drill-copy",f),testId:"drill-copy"}),P.default.createElement(Ie,{icon:"copy",text:n.drillJson,info:"drillJson",onSelect:g("drill-json",f),testId:"drill-json"})))):null,u?null:P.default.createElement("button",{type:"button",className:"pk-btn pk-pressable pk-small-btn","data-pk-on":i?"":void 0,onClick:()=>d(f=>!f),"data-testid":"drill-enlarge"},P.default.createElement(X,{name:"enlarge",size:14}),P.default.createElement("span",{className:"pk-btn-text"},i?n.reduce:n.enlarge)),P.default.createElement("button",{type:"button",className:"pk-icon-btn",onClick:t,"data-autofocus":"","aria-label":n.close,title:n.close},P.default.createElement(X,{name:"x"})))),P.default.createElement("div",{className:"pk-drill-body",tabIndex:0,"aria-label":l.title},P.default.createElement("table",{className:"pk-drill-table"},P.default.createElement("thead",null,P.default.createElement("tr",null,l.columns.map(f=>P.default.createElement("th",{key:f.name,scope:"col",className:f.numeric?"pk-num":void 0,title:f.description,"aria-description":f.description},f.label??f.name)))),P.default.createElement("tbody",null,l.rows.map((f,N)=>P.default.createElement("tr",{key:N},l.columns.map((w,v)=>P.default.createElement("td",{key:w.name,className:w.numeric?"pk-num":void 0},w.numeric||f[v].length<24?f[v]:P.default.createElement("div",{className:"pk-drill-text"},f[v]))))))))))}function ws({api:e,close:t,labels:n}){let o=ro(),[r,a]=(0,Z.useState)(!1),[l,s]=(0,Z.useState)(0),i=(0,Z.useRef)(null),[d]=(0,Z.useState)(()=>!o),u=(0,Z.useRef)(e.load);return(0,Z.useEffect)(()=>{u.current=e.load}),(0,Z.useEffect)(()=>{if(o)return;let c=!0;return u.current().catch(()=>c&&a(!0)),()=>{c=!1}},[o,l]),(0,Z.useEffect)(()=>{let c=i.current?.closest(".pk-popover"),p=Je(c);d&&c&&(p===c||!p||!c.contains(p))&&c.querySelector("[data-pk-option], [data-autofocus]")?.focus({preventScroll:!0})},[d,o,r]),Z.default.createElement("div",{ref:i},o?Z.default.createElement(o.DataMenuPanel,{api:e,close:t}):r?Z.default.createElement("div",{className:"pk-menu-failed",role:"alert","data-testid":"menu-failed"},Z.default.createElement("p",null,n.menuFailed),Z.default.createElement("button",{type:"button",className:"pk-btn pk-small-btn","data-autofocus":"",onClick:()=>{a(!1),s(c=>c+1)}},n.tryAgain)):Z.default.createElement("p",{className:"pk-hint pk-menu-loading",role:"status"},n.loadingMenu))}export{as as AxisMenu,ds as ChartTypePanel,ws as DataMenu,ys as DrillPanel,hs as ExportPanel,rs as FilterMenu,ns as FilterPopover,Lr as LoadCheck,ps as OptionsPanel,ss as ValueMenu,fs as ViewsPanel,Zo as addMenuTexts,ea as hasMenuTexts,io as menuLabels,$r as prepareExporters,ks as runExport,ms as storedViews};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-DCANE7XH.js";var k={item:"{subject}: {text}",quote:"\u201C{key}\u201D",position:"{subject} (no. {n} in {part})",view:"The view",sections:{sort:"Sorting",derived:"Groupings",totals:"Totals",collapsed:"Collapsed groups",display:"Table or chart",chart:"Chart",formatting:"Formatting"},settings:{display:"display",type:"chart type",valueLabels:"value labels",legend:"legend position",axisLabels:"axis labels",groupLabels:"group labels",labelPosition:"label position",other:"setting"},dropped:{rows:"it is left out of Rows",cols:"it is left out of Columns",values:"this value is left out",filters:"this filter is left out",sort:"the usual order is used",derived:"this grouping is left out",other:"it is left out"},codes:{notView:"this is not a pivotkit view - the report starts empty",notJson:"this is not valid JSON - the report starts empty",tooLarge:"the view is too large - the report starts empty",badVersion:"the view has an unknown version - the report starts empty",newerVersion:"the view comes from a newer pivotkit - the report starts empty; update pivotkit to open it",noMigration:"the view cannot be brought to this version - the report starts empty",unknownKey:"this setting is unknown here - it is ignored",notList:"this is not a list - nothing of it is used",tooMany:"more than {max} entries - only the first {max} are used",tooManyItems:"more than {max} items - only the first {max} are used",itemType:"the item \u201C{value}\u201D does not fit a {type} field - it is left out",unknownField:"the data has no field \u201C{field}\u201D - {dropped}",unknownFieldHere:"the data has no field of this name - {dropped}",placedTwice:"the field is in Rows or Columns twice - only its first place is used",groupingNoName:"the grouping has no name - it is left out",groupingNameTaken:"the data already has a field of this name - the grouping is left out",groupingNoSource:"the data has no field \u201C{field}\u201D to group - the grouping is left out",groupingUnknown:"the grouping \u201C{value}\u201D is unknown - it is left out",binsNeedNumber:"ranges need a number field, \u201C{field}\u201D is not one - the grouping is left out",groupingNeedsDate:"a date grouping needs a date field, \u201C{field}\u201D is not one - the grouping is left out",binSize:"ranges need a size above zero - the grouping is left out",notValueRef:"this is not a value - {dropped}",unknownAggregator:"the calculation \u201C{value}\u201D is unknown - {dropped}",aggregatorNeedsField:"{agg} needs a field - {dropped}",aggregatorType:"{agg} does not work on \u201C{field}\u201D ({type}) - {dropped}",unknownFormat:"the number format \u201C{value}\u201D is unknown - the usual format is used",badLabel:"the name is empty or longer than {max} characters - the usual name is used",unknownShowAs:"\u201CShow as\u201D \u201C{value}\u201D is unknown - the plain value is shown",showAsNotAdditive:"this \u201CShow as\u201D needs a sum or a count, not {agg} - the plain value is shown",showAsNotNumber:"{agg} gives no number to show as a share - the plain value is shown",unknownConditional:"the colour format \u201C{value}\u201D is unknown - the value is shown without colours",conditionalNotNumber:"colours need a number value - the value is shown without colours",colorScaleColors:"the colour scale needs two or three colours - the default colours are used",dataBarColor:"the bar colour is not a colour - the default colour is used",unknownFilterType:"the filter type \u201C{value}\u201D is unknown - this filter is left out",filterNoItems:"the filter lists no items - it is left out",filterLabelOp:"the text condition \u201C{value}\u201D is unknown - this filter is left out",filterText:"the text condition has no text - this filter is left out",filterNotNumber:"{agg} gives no number to filter by - this filter is left out",filterCount:"Top needs a whole number from 1 to {max} - this filter is left out",filterValue:"the condition needs a comparison and a number - this filter is left out",filterValue2:"\u201C{value}\u201D needs a second number - this filter is left out",filterCompareField:"only numbers and dates can be compared - this filter is left out",filterCompareValue:"the comparison needs an operator and a number or a date (2022-03-01) that fits the field - this filter is left out",filterRelativeField:"a range like \u201Clast 5 years\u201D needs a date field - this filter is left out",filterRelativeUnit:"the unit \u201C{value}\u201D is unknown (years, months or days) - this filter is left out",filterRelativeCount:"the range needs a whole number from 1 to {max} - this filter is left out",filterRelativeAnchor:"the range can count back from \u201Ctoday\u201D or from \u201Clatest\u201D (the latest record), not from \u201C{value}\u201D - this filter is left out",sortNoItems:"the custom order lists no items - the usual order is used",sortedTwice:"the field is sorted twice - only its first sort is used",badTotals:"the totals cannot be read - the usual totals are shown",collapsedPath:"a collapsed group does not fit the fields - it is shown expanded",unknownSetting:"the {setting} \u201C{value}\u201D is unknown - the default is used",badTitle:"the title is empty or longer than {max} characters - the chart has no title",unknownLocale:"the language \u201C{value}\u201D is unknown - the report's language is used",unknownTimeZone:"the time zone \u201C{value}\u201D is unknown - the data's time zone is used",timeZoneMismatch:"the view was made for the time zone {value}, the data is in {zone} - times are read in {zone}"},other:"this part could not be used - it is left out"},f=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),i=(e,a)=>f(e)&&Object.hasOwn(e,a)?e[a]:void 0,p=e=>typeof e=="string"&&e.trim()!==""?e.trim():null,g=/^(rows|cols|values|filters|sort|derived)\[(\d+)\]/;function C(e,a){let s=p(i(e,"label"));if(s)return s;let n=i(e,"agg");if(typeof n!="string")return null;let o=i(e,"field");return a.value({field:typeof o=="string"?o:null,agg:n,label:null,showAs:null})}function D(e,a,s,n){if(e.code==="unknownKey")return n.fill(s.quote,{key:e.path});let o=g.exec(e.path);if(o){let r=i(a,o[1]),u=Array.isArray(r)?r[Number(o[2])]:void 0,d=o[1]==="values"?C(u,n):p(o[1]==="rows"||o[1]==="cols"?u:o[1]==="derived"?i(u,"name"):i(u,"field"));if(d)return o[1]==="values"||o[1]==="derived"?d:n.field(d)}let t=/^[a-z]*/i.exec(e.path)?.[0]??"";return i(n.labels.zones,t)??i(s.sections,t)??s.view}function c(e,a,s,n){let{labels:o,fill:t}=n,r=/^[a-z]*/i.exec(e.path)?.[0]??"",u=typeof e.code=="string"?e.code:"",d=u==="unknownField"&&/^(rows|cols|filters|sort)\[\d+\]$/.test(e.path)?"unknownFieldHere":u,m=u?i(s.codes,d)??s.other:"{message}",l=f(e.params)?e.params:{},w=o.core,v={dropped:i(s.dropped,r)??s.dropped.other,setting:i(s.settings,e.path.split(".").pop()??"")??s.settings.other,field:typeof l.field=="string"?n.field(l.field):"",value:l.value??"",agg:typeof l.agg=="string"?i(w.aggregators,l.agg)??l.agg:"",type:typeof l.type=="string"?i(o.types,l.type)??l.type:"",max:typeof l.max=="number"?l.max.toLocaleString(o.lang):"",zone:l.zone??"",message:e.message},[b,y=""]=s.item.split("{subject}"),h={text:t(m,v)};return{pre:t(b,h),subject:D(e,a,s,n),post:t(y,h)}}function N(e,a,s){let n=e.map(t=>({...c(t.issue,t.raw,a,s),at:g.exec(t.issue.path)})),o=new Map;for(let t of n){let r=o.get(t.subject)??new Set;r.add(t.at?t.at[0]:""),o.set(t.subject,r)}return n.map(({at:t,...r})=>{if(!t||o.get(r.subject).size<2)return r;let u=i(s.labels.zones,t[1])??i(a.sections,t[1])??t[1];return{...r,subject:s.fill(a.position,{subject:r.subject,n:Number(t[2])+1,part:u})}})}export{k as en,c as unusedItem,N as unusedItems};
|